diff options
| author | Tannin <devnull@localhost> | 2013-10-10 19:32:01 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-10-10 19:32:01 +0200 |
| commit | 54c7131a5e2fa282369e25344ac190d51676c383 (patch) | |
| tree | cf03c6b8ba02afc17fece75d5e83a20cac4a8fbc /src | |
| parent | 15e256ef4460ecfdf05b4f17b4fe8f889f4c6b11 (diff) | |
- new toggle to display hidden downloads
- hidden downloads can be un-hidden
- the installation manager now more thoroughly cleans up the temporary directory after installation
- added SkyrimLauncher.exe to the list of auto-detected executables
- bugfix: shutting down MO while downloads where active in some occasions didn't work
- bugfix: when canceling the only active download the taskbar icon didn't return to normal
Diffstat (limited to 'src')
| -rw-r--r-- | src/downloadlistwidget.cpp | 20 | ||||
| -rw-r--r-- | src/downloadlistwidget.h | 2 | ||||
| -rw-r--r-- | src/downloadlistwidgetcompact.cpp | 20 | ||||
| -rw-r--r-- | src/downloadlistwidgetcompact.h | 2 | ||||
| -rw-r--r-- | src/downloadmanager.cpp | 58 | ||||
| -rw-r--r-- | src/downloadmanager.h | 24 | ||||
| -rw-r--r-- | src/installationmanager.cpp | 72 | ||||
| -rw-r--r-- | src/installationmanager.h | 5 | ||||
| -rw-r--r-- | src/main.cpp | 5 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 6 | ||||
| -rw-r--r-- | src/mainwindow.h | 1 | ||||
| -rw-r--r-- | src/mainwindow.ui | 9 | ||||
| -rw-r--r-- | src/moapplication.cpp | 6 | ||||
| -rw-r--r-- | src/moapplication.h | 60 | ||||
| -rw-r--r-- | src/shared/skyriminfo.cpp | 1 | ||||
| -rw-r--r-- | src/version.rc | 4 |
16 files changed, 189 insertions, 106 deletions
diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp index b657ca69..b4d40799 100644 --- a/src/downloadlistwidget.cpp +++ b/src/downloadlistwidget.cpp @@ -208,6 +208,11 @@ void DownloadListWidgetDelegate::issueRemoveFromView() emit removeDownload(m_ContextRow, false); } +void DownloadListWidgetDelegate::issueRestoreToView() +{ + emit restoreDownload(m_ContextRow); +} + void DownloadListWidgetDelegate::issueCancel() { emit cancelDownload(m_ContextRow); @@ -277,13 +282,18 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel * QMenu menu(m_View); m_ContextRow = qobject_cast<QSortFilterProxyModel*>(model)->mapToSource(index).row(); DownloadManager::DownloadState state = m_Manager->getState(m_ContextRow); + bool hidden = m_Manager->isHidden(m_ContextRow); if (state >= DownloadManager::STATE_READY) { menu.addAction(tr("Install"), this, SLOT(issueInstall())); if (m_Manager->isInfoIncomplete(m_ContextRow)) { menu.addAction(tr("Query Info"), this, SLOT(issueQueryInfo())); } menu.addAction(tr("Delete"), this, SLOT(issueDelete())); - menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView())); + if (hidden) { + menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView())); + } else { + menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView())); + } } else if (state == DownloadManager::STATE_DOWNLOADING){ menu.addAction(tr("Cancel"), this, SLOT(issueCancel())); menu.addAction(tr("Pause"), this, SLOT(issuePause())); @@ -295,9 +305,11 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel * menu.addSeparator(); menu.addAction(tr("Delete Installed..."), this, SLOT(issueDeleteCompleted())); menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll())); - menu.addSeparator(); - menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted())); - menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll())); + if (!hidden) { + menu.addSeparator(); + menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted())); + menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll())); + } menu.exec(mouseEvent->globalPos()); event->accept(); diff --git a/src/downloadlistwidget.h b/src/downloadlistwidget.h index c80200fb..f5bfdbaa 100644 --- a/src/downloadlistwidget.h +++ b/src/downloadlistwidget.h @@ -65,6 +65,7 @@ signals: void installDownload(int index); void queryInfo(int index); void removeDownload(int index, bool deleteFile); + void restoreDownload(int index); void cancelDownload(int index); void pauseDownload(int index); void resumeDownload(int index); @@ -83,6 +84,7 @@ private slots: void issueInstall(); void issueDelete(); void issueRemoveFromView(); + void issueRestoreToView(); void issueCancel(); void issuePause(); void issueResume(); diff --git a/src/downloadlistwidgetcompact.cpp b/src/downloadlistwidgetcompact.cpp index 8dd6e275..d2a71dd5 100644 --- a/src/downloadlistwidgetcompact.cpp +++ b/src/downloadlistwidgetcompact.cpp @@ -195,6 +195,11 @@ void DownloadListWidgetCompactDelegate::issueRemoveFromView() emit removeDownload(m_ContextIndex.row(), false); } +void DownloadListWidgetCompactDelegate::issueRestoreToView() +{ + emit restoreDownload(m_ContextIndex.row()); +} + void DownloadListWidgetCompactDelegate::issueCancel() { emit cancelDownload(m_ContextIndex.row()); @@ -265,13 +270,18 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem QMenu menu; m_ContextIndex = qobject_cast<QSortFilterProxyModel*>(model)->mapToSource(index); DownloadManager::DownloadState state = m_Manager->getState(m_ContextIndex.row()); + bool hidden = m_Manager->isHidden(m_ContextIndex.row()); if (state >= DownloadManager::STATE_READY) { menu.addAction(tr("Install"), this, SLOT(issueInstall())); if (m_Manager->isInfoIncomplete(m_ContextIndex.row())) { menu.addAction(tr("Query Info"), this, SLOT(issueQueryInfo())); } menu.addAction(tr("Delete"), this, SLOT(issueDelete())); - menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView())); + if (hidden) { + menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView())); + } else { + menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView())); + } } else if (state == DownloadManager::STATE_DOWNLOADING){ menu.addAction(tr("Cancel"), this, SLOT(issueCancel())); menu.addAction(tr("Pause"), this, SLOT(issuePause())); @@ -283,9 +293,11 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem menu.addSeparator(); menu.addAction(tr("Delete Installed..."), this, SLOT(issueDeleteCompleted())); menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll())); - menu.addSeparator(); - menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted())); - menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll())); + if (!hidden) { + menu.addSeparator(); + menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted())); + menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll())); + } menu.exec(mouseEvent->globalPos()); event->accept(); diff --git a/src/downloadlistwidgetcompact.h b/src/downloadlistwidgetcompact.h index 78f51840..05d00b9d 100644 --- a/src/downloadlistwidgetcompact.h +++ b/src/downloadlistwidgetcompact.h @@ -65,6 +65,7 @@ signals: void installDownload(int index); void queryInfo(int index); void removeDownload(int index, bool deleteFile); + void restoreDownload(int index); void cancelDownload(int index); void pauseDownload(int index); void resumeDownload(int index); @@ -83,6 +84,7 @@ private slots: void issueInstall(); void issueDelete(); void issueRemoveFromView(); + void issueRestoreToView(); void issueCancel(); void issuePause(); void issueResume(); diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index b965d598..eca5600a 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -69,14 +69,16 @@ DownloadManager::DownloadInfo *DownloadManager::DownloadInfo::createNew(const Ne return info; } -DownloadManager::DownloadInfo *DownloadManager::DownloadInfo::createFromMeta(const QString &filePath) +DownloadManager::DownloadInfo *DownloadManager::DownloadInfo::createFromMeta(const QString &filePath, bool showHidden) { DownloadInfo *info = new DownloadInfo; QString metaFileName = filePath + ".meta"; QSettings metaFile(metaFileName, QSettings::IniFormat); - if (metaFile.value("removed", false).toBool()) { + if (!showHidden && metaFile.value("removed", false).toBool()) { return NULL; + } else { + info->m_Hidden = metaFile.value("removed", false).toBool(); } QString fileName = QFileInfo(filePath).fileName(); @@ -151,7 +153,7 @@ QString DownloadManager::DownloadInfo::currentURL() DownloadManager::DownloadManager(NexusInterface *nexusInterface, QObject *parent) - : IDownloadManager(parent), m_NexusInterface(nexusInterface), m_DirWatcher() + : IDownloadManager(parent), m_NexusInterface(nexusInterface), m_DirWatcher(), m_ShowHidden(false) { connect(&m_DirWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString))); } @@ -188,13 +190,15 @@ void DownloadManager::pauseAll() ::Sleep(100); bool done = false; + QTime startTime = QTime::currentTime(); // further loops: busy waiting for all downloads to complete. This could be neater... - while (!done) { + while (!done && (startTime.secsTo(QTime::currentTime()) < 5)) { QCoreApplication::processEvents(); done = true; foreach (DownloadInfo *info, m_ActiveDownloads) { if ((info->m_State < STATE_CANCELED) || - (info->m_State != STATE_FETCHINGFILEINFO) || (info->m_State != STATE_FETCHINGMODINFO)) { + (info->m_State == STATE_FETCHINGFILEINFO) || + (info->m_State == STATE_FETCHINGMODINFO)) { done = false; break; } @@ -230,6 +234,12 @@ void DownloadManager::setSupportedExtensions(const QStringList &extensions) refreshList(); } +void DownloadManager::setShowHidden(bool showHidden) +{ + m_ShowHidden = showHidden; + refreshList(); +} + void DownloadManager::refreshList() { // remove finished downloads @@ -267,7 +277,7 @@ void DownloadManager::refreshList() QString fileName = QDir::fromNativeSeparators(m_OutputDirectory) + "/" + file; - DownloadInfo *info = DownloadInfo::createFromMeta(fileName); + DownloadInfo *info = DownloadInfo::createFromMeta(fileName, m_ShowHidden); if (info != NULL) { m_ActiveDownloads.push_front(info); } @@ -437,6 +447,22 @@ void DownloadManager::refreshAlphabeticalTranslation() } +void DownloadManager::restoreDownload(int index) +{ + if ((index < 0) || (index >= m_ActiveDownloads.size())) { + throw MyException(tr("invalid index")); + } + + DownloadInfo *download = m_ActiveDownloads.at(index); + download->m_Hidden = false; + + QString filePath = m_OutputDirectory + "/" + download->m_FileName; + + QSettings metaSettings(filePath.append(".meta"), QSettings::IniFormat); + metaSettings.setValue("removed", false); +} + + void DownloadManager::removeDownload(int index, bool deleteFile) { try { @@ -492,9 +518,13 @@ void DownloadManager::pauseDownload(int index) return; } - if (m_ActiveDownloads.at(index)->m_State == STATE_DOWNLOADING) { - setState(m_ActiveDownloads.at(index), STATE_PAUSING); - qDebug("pausing %d - %s", index, m_ActiveDownloads[index]->m_FileName.toUtf8().constData()); + DownloadInfo *info = m_ActiveDownloads.at(index); + + if (info->m_State == STATE_DOWNLOADING) { + setState(info, STATE_PAUSING); + qDebug("pausing %d - %s", index, info->m_FileName.toUtf8().constData()); + } else if ((info->m_State == STATE_FETCHINGMODINFO) || (info->m_State == STATE_FETCHINGFILEINFO)) { + setState(info, STATE_READY); } } @@ -671,6 +701,14 @@ int DownloadManager::getModID(int index) const return m_ActiveDownloads.at(index)->m_ModID; } +bool DownloadManager::isHidden(int index) const +{ + if ((index < 0) || (index >= m_ActiveDownloads.size())) { + throw MyException(tr("invalid index")); + } + return m_ActiveDownloads.at(index)->m_Hidden; +} + NexusInfo DownloadManager::getNexusInfo(int index) const { @@ -843,6 +881,7 @@ void DownloadManager::createMetaFile(DownloadInfo *info) metaFile.setValue("uninstalled", info->m_State == DownloadManager::STATE_UNINSTALLED); metaFile.setValue("paused", (info->m_State == DownloadManager::STATE_PAUSED) || (info->m_State == DownloadManager::STATE_ERROR)); + metaFile.setValue("removed", info->m_Hidden); // slightly hackish... for (int i = 0; i < m_ActiveDownloads.size(); ++i) { @@ -1110,6 +1149,7 @@ void DownloadManager::downloadFinished() QByteArray data = info->m_Reply->readAll(); info->m_Output.write(data); info->m_Output.close(); + TaskProgressManager::instance().forgetMe(info->m_TaskProgressId); bool error = false; diff --git a/src/downloadmanager.h b/src/downloadmanager.h index 0d49aa35..a42ac073 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -102,8 +102,10 @@ private: NexusInfo m_NexusInfo; + bool m_Hidden; + static DownloadInfo *createNew(const NexusInfo &nexusInfo, int modID, int fileID, const QStringList &URLs); - static DownloadInfo *createFromMeta(const QString &filePath); + static DownloadInfo *createFromMeta(const QString &filePath, bool showHidden); /** * @brief rename the file @@ -169,6 +171,11 @@ public: void setSupportedExtensions(const QStringList &extensions); /** + * @brief sets whether hidden files are to be shown after all + */ + void setShowHidden(bool showHidden); + + /** * @brief download from an already open network connection * * @param reply the network reply to download from @@ -264,6 +271,13 @@ public: int getModID(int index) const; /** + * @brief determine if the specified file is supposed to be hidden + * @param index index of the file to look up + * @return true if the specified file is supposed to be hidden + */ + bool isHidden(int index) const; + + /** * @brief retrieve all nexus info of the download specified by index * * @param index index of the file to look up @@ -353,6 +367,12 @@ public slots: void removeDownload(int index, bool deleteFile); /** + * @brief restores the specified download to view (which was previously hidden + * @param index index of the download to restore + */ + void restoreDownload(int index); + + /** * @brief cancel the specified download. This will lead to the corresponding file to be deleted * * @param index index of the download to cancel @@ -436,6 +456,8 @@ private: std::map<QString, int> m_DownloadFails; + bool m_ShowHidden; + }; #endif // DOWNLOADMANAGER_H diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index 87efecf1..6b430eea 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -184,11 +184,7 @@ bool InstallationManager::unpackSingleFile(const QString &fileName) QString InstallationManager::extractFile(const QString &fileName) { if (unpackSingleFile(fileName)) { - QString tempFileName = QDir::tempPath().append("/").append(QFileInfo(fileName).fileName()); - - m_FilesToDelete.insert(tempFileName); - - return tempFileName; + return QDir::tempPath().append("/").append(QFileInfo(fileName).fileName()); } else { return QString(); } @@ -571,49 +567,36 @@ bool InstallationManager::doInstall(GuessedValue<QString> &modName, int modID, } -void InstallationManager::openFile(const QString &fileName) +bool InstallationManager::wasCancelled() { - unpackSingleFile(fileName); + return m_CurrentArchive->getLastError() == Archive::ERROR_EXTRACT_CANCELLED; +} - QString tempFileName = QDir::tempPath().append("/").append(QFileInfo(fileName).fileName()); - SHELLEXECUTEINFOW execInfo; - memset(&execInfo, 0, sizeof(SHELLEXECUTEINFOW)); - execInfo.cbSize = sizeof(SHELLEXECUTEINFOW); - execInfo.fMask = SEE_MASK_NOCLOSEPROCESS; - execInfo.lpVerb = L"open"; - std::wstring fileNameW = ToWString(tempFileName); - execInfo.lpFile = fileNameW.c_str(); - execInfo.nShow = SW_SHOWNORMAL; - if (!::ShellExecuteExW(&execInfo)) { - qCritical("failed to spawn %s: %d", tempFileName.toUtf8().constData(), ::GetLastError()); - } +void InstallationManager::postInstallCleanup() const +{ + m_CurrentArchive->close(); - m_FilesToDelete.insert(tempFileName); -} + // directories we may want to remove. sorted from longest to shortest to ensure we remove subdirectories first. + auto longestFirst = [](const QString &LHS, const QString &RHS) -> bool { + if (LHS.size() != RHS.size()) return LHS.size() > RHS.size(); + else return LHS < RHS; + }; + std::set<QString, std::function<bool(const QString&, const QString&)>> directoriesToRemove(longestFirst); -// copy and pasted from mo_dll -bool EndsWith(LPCWSTR string, LPCWSTR subString) -{ - size_t slen = wcslen(string); - size_t len = wcslen(subString); - if (slen < len) { - return false; + // clean up temp files + // TODO: this doesn't yet remove directories. Also, the files may be left there if this point isn't reached + foreach (const QString &tempFile, m_TempFilesToDelete) { + QFileInfo fileInfo(QDir::tempPath() + "/" + tempFile); + QFile::remove(fileInfo.absoluteFilePath()); + directoriesToRemove.insert(fileInfo.absolutePath()); } - for (size_t i = 0; i < len; ++i) { - if (towlower(string[slen - len + i]) != towlower(subString[i])) { - return false; - } + // try to delete each directory we had temporary files in. the call fails for non-empty directories which is ok + foreach (const QString &dir, directoriesToRemove) { + QDir().rmdir(dir); } - return true; -} - - -bool InstallationManager::wasCancelled() -{ - return m_CurrentArchive->getLastError() == Archive::ERROR_EXTRACT_CANCELLED; } @@ -675,9 +658,7 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> bool archiveOpen = m_CurrentArchive->open(ToWString(QDir::toNativeSeparators(fileName)).c_str(), new MethodCallback<InstallationManager, void, LPSTR>(this, &InstallationManager::queryPassword)); - ON_BLOCK_EXIT([this] { - this->m_CurrentArchive->close(); - }); + ON_BLOCK_EXIT(std::bind(&InstallationManager::postInstallCleanup, this)); QScopedPointer<DirectoryTree> filesTree(archiveOpen ? createFilesTree() : NULL); IPluginInstaller::EInstallResult installResult = IPluginInstaller::RESULT_NOTATTEMPTED; @@ -729,13 +710,6 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> qPrintable(installer->name()), e.what()); } - // clean up temp files - // TODO: this doesn't yet remove directories. Also, the files may be left there if this point isn't reached - foreach (const QString &tempFile, m_TempFilesToDelete) { - QFile::remove(QDir::tempPath() + "/" + tempFile); - } - - // act upon the installation result. at this point the files have already been // extracted to the correct location switch (installResult) { diff --git a/src/installationmanager.h b/src/installationmanager.h index 0e43a15d..1c6f9f19 100644 --- a/src/installationmanager.h +++ b/src/installationmanager.h @@ -168,9 +168,7 @@ private: bool ensureValidModName(MOBase::GuessedValue<QString> &name) const; -private slots: - - void openFile(const QString &fileName); + void postInstallCleanup() const; private: @@ -202,7 +200,6 @@ private: QProgressDialog m_InstallationProgress; - std::set<QString> m_FilesToDelete; std::set<QString> m_TempFilesToDelete; }; diff --git a/src/main.cpp b/src/main.cpp index c4431ac4..7c2a9b0e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -433,7 +433,10 @@ int main(int argc, char *argv[]) qDebug("initializing tutorials"); TutorialManager::init(QDir::fromNativeSeparators(ToQString(GameInfo::instance().getTutorialDir())).append("/")); - application.setStyleFile(settings.value("Settings/style", "").toString()); + if (!application.setStyleFile(settings.value("Settings/style", "").toString())) { + // disable invalid stylesheet + settings.setValue("Settings/style", ""); + } int res = 1; { // scope to control lifetime of mainwindow diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 57201db9..33dc75ed 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4265,6 +4265,7 @@ void MainWindow::updateDownloadListDelegate() connect(ui->downloadView->itemDelegate(), SIGNAL(installDownload(int)), this, SLOT(installDownload(int))); connect(ui->downloadView->itemDelegate(), SIGNAL(queryInfo(int)), &m_DownloadManager, SLOT(queryInfo(int))); connect(ui->downloadView->itemDelegate(), SIGNAL(removeDownload(int, bool)), &m_DownloadManager, SLOT(removeDownload(int, bool))); + connect(ui->downloadView->itemDelegate(), SIGNAL(restoreDownload(int)), &m_DownloadManager, SLOT(restoreDownload(int))); connect(ui->downloadView->itemDelegate(), SIGNAL(cancelDownload(int)), &m_DownloadManager, SLOT(cancelDownload(int))); connect(ui->downloadView->itemDelegate(), SIGNAL(pauseDownload(int)), &m_DownloadManager, SLOT(pauseDownload(int))); connect(ui->downloadView->itemDelegate(), SIGNAL(resumeDownload(int)), &m_DownloadManager, SLOT(resumeDownload(int))); @@ -4735,3 +4736,8 @@ void MainWindow::on_linkButton_pressed() ui->linkButton->menu()->actions().at(1)->setIcon(linkDesktopFile.exists() ? removeIcon : addIcon); ui->linkButton->menu()->actions().at(2)->setIcon(linkMenuFile.exists() ? removeIcon : addIcon); } + +void MainWindow::on_showHiddenBox_toggled(bool checked) +{ + m_DownloadManager.setShowHidden(checked); +} diff --git a/src/mainwindow.h b/src/mainwindow.h index dfec5f49..ad4ed82e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -502,6 +502,7 @@ private slots: // ui slots void on_groupCombo_currentIndexChanged(int index); void on_categoriesList_itemSelectionChanged(); void on_linkButton_pressed(); + void on_showHiddenBox_toggled(bool checked); }; #endif // MAINWINDOW_H diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 923df17c..b29136ff 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -968,7 +968,7 @@ p, li { white-space: pre-wrap; } </layout>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,2">
+ <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,2">
<item>
<widget class="QCheckBox" name="compactBox">
<property name="text">
@@ -977,6 +977,13 @@ p, li { white-space: pre-wrap; } </widget>
</item>
<item>
+ <widget class="QCheckBox" name="showHiddenBox">
+ <property name="text">
+ <string>Show Hidden</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="MOBase::LineEditClear" name="downloadFilterEdit">
<property name="placeholderText">
<string>Namefilter</string>
diff --git a/src/moapplication.cpp b/src/moapplication.cpp index efb0b615..ac660c6c 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -32,7 +32,7 @@ MOApplication::MOApplication(int argc, char **argv) } -void MOApplication::setStyleFile(const QString &styleName) +bool MOApplication::setStyleFile(const QString &styleName) { // remove all files from watch QStringList currentWatch = m_StyleWatcher.files(); @@ -42,11 +42,15 @@ void 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; + } m_StyleWatcher.addPath(styleSheetName); updateStyle(styleSheetName); } else { setStyleSheet(""); } + return true; } diff --git a/src/moapplication.h b/src/moapplication.h index 3d74031d..dd7f5eab 100644 --- a/src/moapplication.h +++ b/src/moapplication.h @@ -17,33 +17,33 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef MOAPPLICATION_H
-#define MOAPPLICATION_H
-
-#include <QApplication>
-#include <QFileSystemWatcher>
-
-
-class MOApplication : public QApplication {
-Q_OBJECT
-public:
-
- MOApplication(int argc, char **argv);
-
- virtual bool notify (QObject *receiver, QEvent *event);
-
-public slots:
-
- void setStyleFile(const QString &style);
-
-private slots:
-
- void updateStyle(const QString &fileName);
-
-private:
-
- QFileSystemWatcher m_StyleWatcher;
-};
-
-
-#endif // MOAPPLICATION_H
+#ifndef MOAPPLICATION_H +#define MOAPPLICATION_H + +#include <QApplication> +#include <QFileSystemWatcher> + + +class MOApplication : public QApplication { +Q_OBJECT +public: + + MOApplication(int argc, char **argv); + + virtual bool notify (QObject *receiver, QEvent *event); + +public slots: + + bool setStyleFile(const QString &style); + +private slots: + + void updateStyle(const QString &fileName); + +private: + + QFileSystemWatcher m_StyleWatcher; +}; + + +#endif // MOAPPLICATION_H diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index 8c6b79ef..71d791f5 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -295,6 +295,7 @@ std::vector<ExecutableInfo> SkyrimInfo::getExecutables() result.push_back(ExecutableInfo(L"SKSE", L"skse_loader.exe", L"", L"", DEFAULT_CLOSE));
result.push_back(ExecutableInfo(L"SBW", L"SBW.exe", L"", L"", DEFAULT_CLOSE));
result.push_back(ExecutableInfo(L"Skyrim", L"TESV.exe", L"", L"", DEFAULT_CLOSE));
+ result.push_back(ExecutableInfo(L"Skyrim Launcher", L"SkyrimLauncher.exe", L"", L"", DEFAULT_CLOSE));
result.push_back(ExecutableInfo(L"BOSS", L"BOSS/BOSS.exe", L"", L"", DEFAULT_STAY));
result.push_back(ExecutableInfo(L"Creation Kit", L"CreationKit.exe", L"", L"", DEFAULT_STAY, L"202480"));
diff --git a/src/version.rc b/src/version.rc index 16669011..e71bc1b5 100644 --- a/src/version.rc +++ b/src/version.rc @@ -1,7 +1,7 @@ #include "Winver.h"
-#define VER_FILEVERSION 1,0,4,0
-#define VER_FILEVERSION_STR "1,0,4,0\0"
+#define VER_FILEVERSION 1,0,5,0
+#define VER_FILEVERSION_STR "1,0,5,0\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
|
