diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 10:46:14 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 10:46:14 +0100 |
commit | 616c37269053bc4f111792dbb9374cc119a58339 (patch) | |
tree | 7ac3bc3bbec628593473bc87ffcec9acf24e990b /gui/MainWindow.cpp | |
parent | 994972bf5da5584186e6e82c36287afeb6c1e23a (diff) | |
download | PrismLauncher-616c37269053bc4f111792dbb9374cc119a58339.tar.gz PrismLauncher-616c37269053bc4f111792dbb9374cc119a58339.tar.bz2 PrismLauncher-616c37269053bc4f111792dbb9374cc119a58339.zip |
Fix more stuff. Detached tools, only MCEdit for now.
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r-- | gui/MainWindow.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index b05c58f7..3f469061 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -1440,7 +1440,34 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex & for (auto profiler : MMC->profilers().values()) { QAction *profilerAction = launchMenu->addAction(profiler->name()); - connect(profilerAction, &QAction::triggered, [this, profiler](){doLaunch(true, profiler.get());}); + QString error; + if (!profiler->check(&error)) + { + profilerAction->setDisabled(true); + profilerAction->setToolTip(tr("Profiler not setup correctly. Go into settings, \"External Tools\".")); + } + else + { + connect(profilerAction, &QAction::triggered, [this, profiler](){doLaunch(true, profiler.get());}); + } + } + launchMenu->addSeparator()->setText(tr("Tools")); + for (auto tool : MMC->tools().values()) + { + QAction *toolAction = launchMenu->addAction(tool->name()); + QString error; + if (!tool->check(&error)) + { + toolAction->setDisabled(true); + toolAction->setToolTip(tr("Tool not setup correctly. Go into settings, \"External Tools\".")); + } + else + { + connect(toolAction, &QAction::triggered, [this, tool]() + { + tool->createDetachedTool(m_selectedInstance, this)->run(); + }); + } } ui->actionLaunchInstance->setMenu(launchMenu); |