From 78c4178f2a70bb55bd761efc92d58b8ac0e3747b Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 17 Aug 2013 08:49:36 +0200 Subject: - plugins that failed to load are now reported as problems - some wording fixes in the tutorial - updated proxyPython to a modified interface --- src/mainwindow.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') 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 MainWindow::activeProblems() const +{ + std::vector 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:
    "); + foreach (const QString &plugin, m_UnloadedPlugins) { + result += "
  • " + plugin + "
  • "; + } + result += "
      "; + 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); -- cgit v1.3.1