summaryrefslogtreecommitdiffstats
path: root/gui/MainWindow.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-16 10:46:14 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-16 10:46:14 +0100
commit616c37269053bc4f111792dbb9374cc119a58339 (patch)
tree7ac3bc3bbec628593473bc87ffcec9acf24e990b /gui/MainWindow.cpp
parent994972bf5da5584186e6e82c36287afeb6c1e23a (diff)
downloadMultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar.gz
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar.lz
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar.xz
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.zip
Fix more stuff. Detached tools, only MCEdit for now.
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r--gui/MainWindow.cpp29
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 &current, 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);