diff options
| author | Tannin <devnull@localhost> | 2013-08-17 08:49:36 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-08-17 08:49:36 +0200 |
| commit | 78c4178f2a70bb55bd761efc92d58b8ac0e3747b (patch) | |
| tree | 9b82bba2f0eeb1ac94e15f80773d947034179ff0 /src/mainwindow.cpp | |
| parent | 7d79e3ad1e8a710e836e1cd44106a610e6d2a049 (diff) | |
- plugins that failed to load are now reported as problems
- some wording fixes in the tutorial
- updated proxyPython to a modified interface
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 84e5b094..a8f69090 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -988,12 +988,14 @@ void MainWindow::loadPlugins() if (QLibrary::isLibrary(pluginName)) { QPluginLoader pluginLoader(pluginName); if (pluginLoader.instance() == NULL) { + m_UnloadedPlugins.push_back(pluginName); qCritical("failed to load plugin %s: %s", pluginName.toUtf8().constData(), pluginLoader.errorString().toUtf8().constData()); } else { if (registerPlugin(pluginLoader.instance())) { qDebug("loaded plugin \"%s\"", pluginName.toUtf8().constData()); } else { + m_UnloadedPlugins.push_back(pluginName); qWarning("plugin \"%s\" failed to load", pluginName.toUtf8().constData()); } } @@ -1001,6 +1003,8 @@ void MainWindow::loadPlugins() } m_DownloadManager.setSupportedExtensions(m_InstallationManager.getSupportedExtensions()); + + m_DiagnosisPlugins.push_back(this); } IGameInfo &MainWindow::gameInfo() const @@ -1936,6 +1940,46 @@ IDownloadManager *MainWindow::downloadManager() return &m_DownloadManager; } +std::vector<unsigned int> MainWindow::activeProblems() const +{ + std::vector<unsigned int> problems; + if (m_UnloadedPlugins.size() != 0) { + problems.push_back(PROBLEM_PLUGINSNOTLOADED); + } + return problems; +} + +QString MainWindow::shortDescription(unsigned int key) const +{ + switch (key) { + case PROBLEM_PLUGINSNOTLOADED: { + return tr("Some plugins could not be loaded"); + } break; + } +} + +QString MainWindow::fullDescription(unsigned int key) const +{ + switch (key) { + case PROBLEM_PLUGINSNOTLOADED: { + QString result = tr("The following Plugins could not be loaded. The reason may be missing dependencies (i.e. python) or an outdated version:<ul>"); + foreach (const QString &plugin, m_UnloadedPlugins) { + result += "<li>" + plugin + "</li>"; + } + result += "<ul>"; + return result; + } break; + } +} + +bool MainWindow::hasGuidedFix(unsigned int key) const +{ + return false; +} + +void MainWindow::startGuidedFix(unsigned int key) const +{ +} void MainWindow::installMod() { @@ -3519,7 +3563,7 @@ void MainWindow::on_actionNexus_triggered() std::wstring nxmPath = ToWString(QApplication::applicationDirPath() + "/nxmhandler.exe"); std::wstring executable = ToWString(QApplication::applicationFilePath()); ::ShellExecuteW(NULL, L"open", nxmPath.c_str(), - (std::wstring(L"reg ") + GameInfo::instance().getGameShortName() + L" " + executable).c_str(), NULL, SW_SHOWNORMAL); + (std::wstring(L"reg ") + GameInfo::instance().getGameShortName() + L" \"" + executable + L"\"").c_str(), NULL, SW_SHOWNORMAL); ::ShellExecuteW(NULL, L"open", GameInfo::instance().getNexusPage().c_str(), NULL, NULL, SW_SHOWNORMAL); ui->tabWidget->setCurrentIndex(4); |
