diff options
| author | Tannin <devnull@localhost> | 2013-11-18 20:17:14 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-11-18 20:17:14 +0100 |
| commit | c6101e34e1e142a3442c3a4543ea22dabd31fa33 (patch) | |
| tree | 0e737a47f5cec0afac715ae7f6e5fd1e5fb108b9 /src/moapplication.cpp | |
| parent | 75475a7984466afd1cf77f2e4a9f722c0a859404 (diff) | |
- archive.dll now supports querying the crc value of files
- esptk now determines if a esp is a dummy (without records)
- hook.dll no longer creates a log file if noone wrote to it
- nexus id and installtime columns are now hidden by default
- modlist can now be refreshed without saving first (so plugins can replace the modlist.txt as a whole)
- plugins can now query more details about virtualised files
- added style options "plastique" and "cleanlooks"
- "overwrite" is no longer listed with a creation time
- a warning will now be displayed if the user has too many plugins active
- a warning will now be displayed if mods with scripts have an installation order that doesn't match the corresponding esp load order
- nmm importer now has select all/deselect all buttons
- nmm importer no longer tries to unpack missing files from archives (won't work anyway)
- initial support for importing from nmm 0.5 alpha
- removed some broken warning suppresions
- python runner now works with bundled python
- extended qbs build system (still fails to build the main gui application)
- implemented a nsis-based installer
Diffstat (limited to 'src/moapplication.cpp')
| -rw-r--r-- | src/moapplication.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/moapplication.cpp b/src/moapplication.cpp index ba23808b..7e3104db 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -23,12 +23,15 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <appconfig.h> #include <QFile> #include <QStringList> +#include <QPlastiqueStyle> +#include <QCleanlooksStyle> MOApplication::MOApplication(int argc, char **argv) : QApplication(argc, argv) { connect(&m_StyleWatcher, SIGNAL(fileChanged(QString)), SLOT(updateStyle(QString))); + m_DefaultStyle = style()->objectName(); } @@ -42,11 +45,12 @@ bool MOApplication::setStyleFile(const QString &styleName) // set new stylesheet or clear it if (styleName.length() != 0) { QString styleSheetName = applicationDirPath() + "/" + MOBase::ToQString(AppConfig::stylesheetsPath()) + "/" + styleName; - if (!QFile::exists(styleSheetName)) { - return false; + if (QFile::exists(styleSheetName)) { + m_StyleWatcher.addPath(styleSheetName); + updateStyle(styleSheetName); + } else { + updateStyle(styleName); } - m_StyleWatcher.addPath(styleSheetName); - updateStyle(styleSheetName); } else { setStyleSheet(""); } @@ -74,11 +78,18 @@ bool MOApplication::notify(QObject *receiver, QEvent *event) void MOApplication::updateStyle(const QString &fileName) { - QFile file(fileName); - if (file.open(QFile::ReadOnly)) { - setStyleSheet(file.readAll()); + if (fileName == "Plastique") { + setStyle(new QPlastiqueStyle); + setStyleSheet(""); + } else if (fileName == "Cleanlooks") { + setStyle(new QCleanlooksStyle); + setStyleSheet(""); } else { - qDebug("no stylesheet"); + setStyle(m_DefaultStyle); + if (QFile::exists(fileName)) { + setStyleSheet(QString("file:///%1").arg(fileName)); + } else { + qWarning("invalid stylesheet: %s", qPrintable(fileName)); + } } - file.close(); } |
