Skip to content

Commit

Permalink
Merge pull request #13 from amorilia/release/1.1.3
Browse files Browse the repository at this point in the history
Preparing 1.1.3 release.
  • Loading branch information
mharj committed Nov 17, 2012
2 parents 1ba7221 + cd9ae74 commit 36ebfdd
Show file tree
Hide file tree
Showing 13 changed files with 305 additions and 113 deletions.
4 changes: 4 additions & 0 deletions .gitignore
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
8 changes: 7 additions & 1 deletion CHANGELOG.TXT
@@ -1,6 +1,12 @@
== CHANGELOG ==

This is version 1.1.2 of NifSkope.
This is version 1.1.3 of NifSkope.

changes since 1.1.2:
* Fix accidently broken xml for Fallout 3 (contributed by ttl269).
* Qmake getting git hash no longer relies on git executable.
* Code refactor: xml for ui of about form.
* Fix for registry entry proliferation (niftools issue #3584193, reported by neomonkeus).

changes since 1.1.1:
* When combining material properties, keep original material names as much as possible (reported by koniption).
Expand Down
34 changes: 26 additions & 8 deletions NifSkope.pro
Expand Up @@ -28,13 +28,26 @@ DESTDIR = .
DEFINES += NIFSKOPE_VERSION=\\\"$$cat(VERSION)\\\"

# build NIFSKOPE_REVISION macro
unix {
system(git --version > /dev/null 2>&1):DEFINES += NIFSKOPE_REVISION=\\\"$$system(git log -1 --pretty=format:%h)\\\"
else:DEFINES += NIFSKOPE_REVISION=\\\"unknown\\\"
GIT_HEAD = $$cat(.git/HEAD)
# at this point GIT_HEAD either contains commit hash, or symbolic ref:
# GIT_HEAD = 303c05416ecceb3368997c86676a6e63e968bc9b
# GIT_HEAD = ref: refs/head/feature/blabla
contains(GIT_HEAD, "ref:") {
# resolve symbolic ref
GIT_HEAD = .git/$$member(GIT_HEAD, 1)
# GIT_HEAD now points to the file containing hash,
# e.g. .git/refs/head/feature/blabla
exists($$GIT_HEAD) {
GIT_HEAD = $$cat($$GIT_HEAD)
} else {
clear(GIT_HEAD)
}
}
win32 {
system(git --version > NUL 2>&1):DEFINES += NIFSKOPE_REVISION=\\\"$$system(git log -1 --pretty=format:%h)\\\"
else:DEFINES += NIFSKOPE_REVISION=\\\"unknown\\\"
count(GIT_HEAD, 1) {
# single component, hopefully the commit hash
# fetch first seven characters (abbreviated hash)
GIT_HEAD ~= s/^(.......).*/\\1/
DEFINES += NIFSKOPE_REVISION=\\\"$$GIT_HEAD\\\"
}

HEADERS += \
Expand Down Expand Up @@ -115,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 @@ -196,11 +210,15 @@ SOURCES += \
widgets/refrbrowser.cpp \
widgets/uvedit.cpp \
widgets/valueedit.cpp \
widgets/xmlcheck.cpp
widgets/xmlcheck.cpp \
ui/about_dialog.cpp

RESOURCES += \
nifskope.qrc

FORMS += \
ui/about_dialog.ui

fsengine {
DEFINES += FSENGINE
HEADERS += \
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.1.2
1.1.3
27 changes: 1 addition & 26 deletions config.h
Expand Up @@ -43,32 +43,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Include this if you want to access the current version or persistent QSettings.
*/

//! QSettings keys for older versions of nifskope
/*!
* Add versions to this list (most recent first) whenever incrementing NIFSKOPE_VERSION
*/
const QStringList NIFSKOPE_OLDERVERSIONS = (QStringList()
<< "NifSkope-1.0.22"
<< "NifSkope-1.0.21"
<< "NifSkope-1.0.20"
<< "NifSkope-1.0.19"
<< "NifSkope-1.0.18"
<< "NifSkope-1.0.17"
<< "NifSkope-1.0.16"
<< "NifSkope-1.0.15"
<< "NifSkope-1.0.14"
<< "NifSkope-1.0.13"
<< "NifSkope-1.0.12"
<< "NifSkope-1.0.11"
<< "NifSkope-1.0.10"
<< "NifSkope-1.0.9"
<< "NifSkope-1.0.8"
<< "NifSkope-1.0.7"
<< "NifSkope-1.0.6"
<< "NifSkope-1.0.5"
<< "NifSkope");

//! Create or use a QSettings variable for nifskope
#define NIFSKOPE_QSETTINGS(config) QSettings config( "NifTools", "NifSkope-"NIFSKOPE_VERSION )
#define NIFSKOPE_QSETTINGS(config) QSettings config( "NifTools", "NifSkope" )

#endif
2 changes: 1 addition & 1 deletion docsys
Submodule docsys updated from 52bbd8 to cf4459
3 changes: 3 additions & 0 deletions linux-install/maketarball.sh
Expand Up @@ -72,6 +72,9 @@ FILES="NifSkope.pro \
shaders/*.vert
nifexpr.cpp
nifexpr.h
ui/*.h
ui/*.cpp
ui/*.ui
lang/*.ts
lang/*.qm
qhull.h
Expand Down
17 changes: 16 additions & 1 deletion linux-install/nifskope.spec.in
Expand Up @@ -26,7 +26,7 @@ make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
%{__install} -Dp -m0755 nifskope $RPM_BUILD_ROOT/%{_bindir}/nifskope
%{__install} -Dp -m0755 release/nifskope $RPM_BUILD_ROOT/%{_bindir}/nifskope
%{__install} -Dp -m0644 nifskope.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps/nifskope.png
%{__install} -d $RPM_BUILD_ROOT/%{_datadir}/nifskope/doc
%{__install} -d $RPM_BUILD_ROOT/%{_datadir}/nifskope/shaders
Expand Down Expand Up @@ -81,6 +81,21 @@ rm -rf $RPM_BUILD_ROOT
%{!?_without_freedesktop:%{_datadir}/applications/%{desktop_vendor}-nifskope.desktop}

%changelog
* Sat Nov 17 2012 amorilia - 1.1.3-1
- Fix accidently broken xml for Fallout 3 (contributed by ttl269).
- Qmake getting git hash no longer relies on git executable.
- Code refactor: xml for ui of about form.
- Fix for registry entry proliferation (niftools issue #3584193, reported by neomonkeus).
* Sun Oct 28 2012 amorilia - 1.1.2-1
- When combining material properties, keep original material names as much as possible (reported by koniption).
- Fix display of transformed havok shapes (reported by koniption).
- Skyrim material updates (contributed by ttl269).
- Skyrim body part updates.
- Document sane defaults for Skyrim bhkRigidBody "Unknown 7 Shorts" (reported by ttl296).
- Rename: binormals are now more accurately called bitangents.
- Collada export improvements (contributed by mharj).
- Support node culling by regular expression in collada/obj export (contributed by mharj).
- Fix block order of bhkCompressedMeshShapeData (reported by ttl269).
* Mon Oct 1 2012 amorilia - 1.1.1-1
- Fix unsigned int enum issue.
* Tue Sep 18 2012 amorilia - 1.1.0-1
Expand Down
81 changes: 15 additions & 66 deletions nifskope.cpp
Expand Up @@ -101,84 +101,30 @@ FSManager * fsmanager = 0;

//! \file nifskope.cpp The main file for NifSkope

void NifSkope::copySettings(QSettings & cfg, const QSettings & oldcfg, const QString name) const
{
if ((!cfg.contains(name)) && oldcfg.contains(name)) {
//qDebug() << "copying nifskope setting" << name;
cfg.setValue(name, oldcfg.value(name));
}
}

void NifSkope::migrateSettings() const
{
// load current nifskope settings
NIFSKOPE_QSETTINGS(cfg);
// do nothing if already migrated; this prevents re-importing of corrupt / otherwise not-working values
if( cfg.contains( "migrated" ) ) return;
// check for older nifskope settings
for (QStringList::ConstIterator it = NIFSKOPE_OLDERVERSIONS.begin(); it != NIFSKOPE_OLDERVERSIONS.end(); ++it ) {
QSettings oldcfg( "NifTools", *it );
// check for missing keys and copy them from old settings
QStringList keys = oldcfg.allKeys();
// check if we are running a new version of nifskope
if (cfg.value("version").toString() != NIFSKOPE_VERSION) {
// check all keys and delete all binary ones
//to prevent portability problems between Qt versions
QStringList keys = cfg.allKeys();
for (QStringList::ConstIterator key = keys.begin(); key != keys.end(); ++key) {
//qDebug() << "checking" << *key << oldcfg.value(*key).type();
switch (oldcfg.value(*key).type()) {
case QVariant::Bool:
case QVariant::ByteArray:
case QVariant::Color:
case QVariant::Double:
case QVariant::Int:
case QVariant::String:
case QVariant::StringList:
case QVariant::UInt:
// copy settings for these types
copySettings(cfg, oldcfg, *key);
default:
; // do nothing
if (cfg.value(*key).type() == QVariant::ByteArray) {
qDebug() << "removing config setting" << *key
<< "whilst migrating settings from previous nifskope version";
cfg.remove(*key);
}
}
// set version key to current version
cfg.setValue("version", NIFSKOPE_VERSION);
}
cfg.setValue( "migrated", 1 );
}

/*
* main GUI window
*/

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."
);

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

void NifSkope::sltResetBlockDetails()
{
if (tree)
Expand All @@ -188,6 +134,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 Expand Up @@ -351,7 +300,7 @@ NifSkope::NifSkope()
connect( aNifToolsDownloads, SIGNAL( triggered() ), this, SLOT( openURL() ) );

aNifSkope = new QAction( tr("About &NifSkope"), this );
connect( aNifSkope, SIGNAL( triggered() ), this, SLOT( about() ) );
connect( aNifSkope, SIGNAL( triggered() ), aboutDialog, SLOT( open() ) );

aAboutQt = new QAction( tr("About &Qt"), this );
connect( aAboutQt, SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) );
Expand Down
14 changes: 5 additions & 9 deletions nifskope.h
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 @@ -130,9 +132,6 @@ public slots:
//! A slot for starting the XML checker.
void sltShredder();

//! Display the "About NifSkope" window.
void about();

//! Reset "block details"
void sltResetBlockDetails();

Expand Down Expand Up @@ -183,15 +182,12 @@ protected slots:
void initDockWidgets();
void initToolBars();
void initMenu();

//! "About NifSkope" dialog.
QWidget *aboutDialog;

void setViewFont( const QFont & );

//! Copy settings from one config to another, without overwriting keys.
/*!
* This is a helper function for migrateSettings().
*/
void copySettings(QSettings & cfg, const QSettings & oldcfg, const QString name) const;

//! Migrate settings from older versions of nifskope.
void migrateSettings() const;

Expand Down
37 changes: 37 additions & 0 deletions ui/about_dialog.cpp
@@ -0,0 +1,37 @@
#include "about_dialog.h"

AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent) {
ui.setupUi(this);
#ifdef NIFSKOPE_REVISION
this->setWindowTitle( tr("About NifSkope %1 (revision %2)").arg(NIFSKOPE_VERSION).arg(NIFSKOPE_REVISION) );
#else
this->setWindowTitle( tr("About NifSkope %1").arg(NIFSKOPE_VERSION) );
#endif
QString text = tr(
"<p>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
@@ -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

0 comments on commit 36ebfdd

Please sign in to comment.