mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-15 22:08:43 +00:00
Changed: #1193 The user can specify the ovqt plugins path if not using the default path.
This commit is contained in:
parent
425ade7f2e
commit
4708f38638
1 changed files with 13 additions and 2 deletions
|
@ -38,6 +38,8 @@
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
#include <QtGui/QSplashScreen>
|
#include <QtGui/QSplashScreen>
|
||||||
|
#include <QtGui/QFileDialog>
|
||||||
|
#include <QtGui/QInputDialog>
|
||||||
|
|
||||||
static const char *appNameC = "ObjectViewerQt";
|
static const char *appNameC = "ObjectViewerQt";
|
||||||
|
|
||||||
|
@ -135,7 +137,7 @@ sint main(int argc, char **argv)
|
||||||
QTranslator qtTranslator;
|
QTranslator qtTranslator;
|
||||||
QString locale = settings->value("Language", QLocale::system().name()).toString();
|
QString locale = settings->value("Language", QLocale::system().name()).toString();
|
||||||
QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
translator.load("object_viewer_qt_" + locale, ":/");
|
// translator.load("object_viewer_qt_" + locale, ":/");
|
||||||
qtTranslator.load("qt_" + locale, qtTrPath);
|
qtTranslator.load("qt_" + locale, qtTrPath);
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
app.installTranslator(&qtTranslator);
|
app.installTranslator(&qtTranslator);
|
||||||
|
@ -149,7 +151,7 @@ sint main(int argc, char **argv)
|
||||||
pluginManager.setSettings(settings);
|
pluginManager.setSettings(settings);
|
||||||
QStringList pluginPaths;
|
QStringList pluginPaths;
|
||||||
#if !defined(NL_OS_MAC)
|
#if !defined(NL_OS_MAC)
|
||||||
pluginPaths << QString("./plugins");
|
pluginPaths << settings->value("PluginPath", "./plugins").toString();
|
||||||
#else
|
#else
|
||||||
pluginPaths << qApp->applicationDirPath() + QString("/../PlugIns/ovqt");
|
pluginPaths << qApp->applicationDirPath() + QString("/../PlugIns/ovqt");
|
||||||
#endif
|
#endif
|
||||||
|
@ -176,6 +178,15 @@ sint main(int argc, char **argv)
|
||||||
QString absolutePaths = absolutePluginPaths.absolutePath();
|
QString absolutePaths = absolutePluginPaths.absolutePath();
|
||||||
const QString reason = QCoreApplication::translate("Application", "Could not find ovqt_plugin_core in %1").arg(absolutePaths);
|
const QString reason = QCoreApplication::translate("Application", "Could not find ovqt_plugin_core in %1").arg(absolutePaths);
|
||||||
displayError(msgCoreLoadFailure(reason));
|
displayError(msgCoreLoadFailure(reason));
|
||||||
|
|
||||||
|
QString newPath = QFileDialog::getExistingDirectory(0, QCoreApplication::translate("Application", "Change the plugins path"), QDir::homePath());
|
||||||
|
bool ok;
|
||||||
|
QString text = QInputDialog::getText(0, QCoreApplication::translate("Application", "Enter the plugins path"),
|
||||||
|
QCoreApplication::translate("Application", "Plugin path:"), QLineEdit::Normal,
|
||||||
|
newPath, &ok);
|
||||||
|
if (ok && !text.isEmpty())
|
||||||
|
settings->setValue("PluginPath", text);
|
||||||
|
settings->sync();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (corePlugin->hasError())
|
if (corePlugin->hasError())
|
||||||
|
|
Loading…
Reference in a new issue