Skip to content

Commit

Permalink
ui testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mharj authored and amorilia committed Nov 4, 2012
1 parent 63fc64e commit 750483c
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 37 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Makefile.Debug
Makefile.Release
moc_*.cpp
qrc_*.cpp
ui_*.h

# compiled
*.o
Expand All @@ -13,6 +14,9 @@ qrc_*.cpp
.cproject
.settings

# qtcreator
NifSkope.pro.user

# binary
NifSkope

Expand Down
9 changes: 7 additions & 2 deletions NifSkope.pro
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ HEADERS += \
widgets/refrbrowser.h \
widgets/uvedit.h \
widgets/valueedit.h \
widgets/xmlcheck.h
widgets/xmlcheck.h \
ui/about_dialog.h

SOURCES += \
basemodel.cpp \
Expand Down Expand Up @@ -209,7 +210,8 @@ SOURCES += \
widgets/refrbrowser.cpp \
widgets/uvedit.cpp \
widgets/valueedit.cpp \
widgets/xmlcheck.cpp
widgets/xmlcheck.cpp \
ui/about_dialog.cpp

RESOURCES += \
nifskope.qrc
Expand Down Expand Up @@ -254,3 +256,6 @@ console {
TRANSLATIONS += lang/NifSkope_de.ts lang/NifSkope_fr.ts

# vim: set filetype=config :

FORMS += \
ui/about_dialog.ui
39 changes: 4 additions & 35 deletions nifskope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,41 +147,7 @@ void NifSkope::migrateSettings() const

void NifSkope::about()
{
QString text = tr(
"<p style='white-space:pre'>NifSkope is a tool for analyzing and editing NetImmerse/Gamebryo '.nif' files.</p>"
"<p>NifSkope is based on NifTool's XML file format specification. "
"For more information visit our site at <a href='http://niftools.sourceforge.net'>http://niftools.sourceforge.net</a></p>"
"<p>NifSkope is free software available under a BSD license. "
"The source is available via <a href='http://niftools.git.sourceforge.net/git/gitweb.cgi?p=niftools/nifskope'>git</a> "
"(<a href='git://niftools.git.sourceforge.net/gitroot/niftools/nifskope'>clone</a>) on <a href='http://sourceforge.net'>SourceForge</a>. "
"Instructions on compiling NifSkope are available on the <a href='http://niftools.sourceforge.net/wiki/NifSkope/Compile'>NifTools wiki</a>.</p>"
"<p>The most recent version of NifSkope can always be downloaded from the <a href='https://sourceforge.net/projects/niftools/files/nifskope/'>"
"NifTools SourceForge Project page</a>.</p>"
// only the windows build uses havok
// (Q_OS_WIN32 is also defined on win64)
#ifdef Q_OS_WIN32
"<center><img src=':/img/havok_logo' /></center>"
"<p>NifSkope uses Havok(R) for the generation of mopp code. "
"(C)Copyright 1999-2008 Havok.com Inc. (and its Licensors). "
"All Rights Reserved. "
"See <a href='http://www.havok.com'>www.havok.com</a> for details.</p>"
#endif
"<center><img src=':/img/qhull_logo' /></center>"
"<p>NifSkope uses Qhull for the generation of convex hulls. "
"Copyright(c) 1993-2010 C.B. Barber and The Geometry Center. "
"Qhull is free software and may be obtained from <a href='http://www.qhull.org'>www.qhull.org</a>. "
"See Qhull_COPYING.txt for details."
);

#ifdef NIFSKOPE_REVISION
QMessageBox mb( tr("About NifSkope %1 (revision %2)").arg(NIFSKOPE_VERSION).arg(NIFSKOPE_REVISION), text, QMessageBox::Information,
QMessageBox::Ok + QMessageBox::Default, 0, 0, this);
#else
QMessageBox mb( tr("About NifSkope %1").arg(NIFSKOPE_VERSION), text, QMessageBox::Information,
QMessageBox::Ok + QMessageBox::Default, 0, 0, this);
#endif
mb.setIconPixmap( QPixmap( ":/res/nifskope.png" ) );
mb.exec();
aboutDialog->show();
}

void NifSkope::sltResetBlockDetails()
Expand All @@ -193,6 +159,9 @@ void NifSkope::sltResetBlockDetails()
NifSkope::NifSkope()
: QMainWindow(), selecting( false ), initialShowEvent( true )
{
// init UI parts
aboutDialog = new AboutDialog(this);

// migrate settings from older versions of NifSkope
migrateSettings();

Expand Down
4 changes: 4 additions & 0 deletions nifskope.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class QUdpSocket;

#include "message.h"

#include "ui/about_dialog.h"

//! \file nifskope.h The main header for NifSkope

//! The main application class for NifSkope.
Expand Down Expand Up @@ -183,6 +185,8 @@ protected slots:
void initDockWidgets();
void initToolBars();
void initMenu();

QWidget *aboutDialog;

void setViewFont( const QFont & );

Expand Down
34 changes: 34 additions & 0 deletions ui/about_dialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "about_dialog.h"

AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent) {
ui.setupUi(this);
this->setFixedSize(600,400);
this->setWindowTitle( tr("About NifSkope %1 (revision %2)").arg(NIFSKOPE_VERSION).arg(NIFSKOPE_REVISION) );
QString text = tr(
"<p style='white-space:pre'>NifSkope is a tool for analyzing and editing NetImmerse/Gamebryo '.nif' files.</p>"
"<p>NifSkope is based on NifTool's XML file format specification. "
"For more information visit our site at <a href='http://niftools.sourceforge.net'>http://niftools.sourceforge.net</a></p>"
"<p>NifSkope is free software available under a BSD license. "
"The source is available via <a href='http://niftools.git.sourceforge.net/git/gitweb.cgi?p=niftools/nifskope'>git</a> "
"(<a href='git://niftools.git.sourceforge.net/gitroot/niftools/nifskope'>clone</a>) on <a href='http://sourceforge.net'>SourceForge</a>. "
"Instructions on compiling NifSkope are available on the <a href='http://niftools.sourceforge.net/wiki/NifSkope/Compile'>NifTools wiki</a>.</p>"
"<p>The most recent version of NifSkope can always be downloaded from the <a href='https://sourceforge.net/projects/niftools/files/nifskope/'>"
"NifTools SourceForge Project page</a>.</p>"
// only the windows build uses havok
// (Q_OS_WIN32 is also defined on win64)
#ifdef Q_OS_WIN32
"<center><img src=':/img/havok_logo' /></center>"
"<p>NifSkope uses Havok(R) for the generation of mopp code. "
"(C)Copyright 1999-2008 Havok.com Inc. (and its Licensors). "
"All Rights Reserved. "
"See <a href='http://www.havok.com'>www.havok.com</a> for details.</p>"
#endif
"<center><img src=':/img/qhull_logo' /></center>"
"<p>NifSkope uses Qhull for the generation of convex hulls. "
"Copyright(c) 1993-2010 C.B. Barber and The Geometry Center. "
"Qhull is free software and may be obtained from <a href='http://www.qhull.org'>www.qhull.org</a>. "
"See Qhull_COPYING.txt for details."
);
ui.text->setText(text);
}
17 changes: 17 additions & 0 deletions ui/about_dialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef ABOUT_H
#define ABOUT_H

#include "ui_about_dialog.h"

class AboutDialog : public QDialog {
Q_OBJECT

public:
AboutDialog(QWidget *parent = 0);

private:
Ui::AboutDialog ui;
};


#endif // ABOUT_H
129 changes: 129 additions & 0 deletions ui/about_dialog.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>10</x>
<y>360</y>
<width>581</width>
<height>31</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QLabel" name="text">
<property name="geometry">
<rect>
<x>140</x>
<y>10</y>
<width>451</width>
<height>351</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="image">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>121</width>
<height>121</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../nifskope.qrc">:/res/nifskope.png</pixmap>
</property>
</widget>
</widget>
<resources>
<include location="../nifskope.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

0 comments on commit 750483c

Please sign in to comment.