summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-09-20 23:38:31 +0200
committerPetr Mrázek <peterix@gmail.com>2017-09-20 23:38:31 +0200
commitba3cbb7330fd3435423eb3a77373ca82d65681d3 (patch)
treed03c176ce5c30e13e15143967b6d800f0d403f92 /application
parent9a6c2b0e2c0a4fb9f26b9c9d1137a66d7977251b (diff)
downloadMultiMC-ba3cbb7330fd3435423eb3a77373ca82d65681d3.tar
MultiMC-ba3cbb7330fd3435423eb3a77373ca82d65681d3.tar.gz
MultiMC-ba3cbb7330fd3435423eb3a77373ca82d65681d3.tar.lz
MultiMC-ba3cbb7330fd3435423eb3a77373ca82d65681d3.tar.xz
MultiMC-ba3cbb7330fd3435423eb3a77373ca82d65681d3.zip
NOISSUE more work on Legacy migration
Diffstat (limited to 'application')
-rw-r--r--application/InstancePageProvider.h3
-rw-r--r--application/InstanceWindow.cpp17
-rw-r--r--application/InstanceWindow.h2
-rw-r--r--application/MainWindow.cpp2
-rw-r--r--application/MultiMC.cpp5
5 files changed, 23 insertions, 6 deletions
diff --git a/application/InstancePageProvider.h b/application/InstancePageProvider.h
index 3b361e3e..1f5a6aef 100644
--- a/application/InstancePageProvider.h
+++ b/application/InstancePageProvider.h
@@ -50,6 +50,9 @@ public:
if(legacy)
{
values.append(new LegacyUpgradePage(legacy.get()));
+ values.append(new NotesPage(legacy.get()));
+ values.append(new WorldListPage(legacy.get(), legacy->worldList(), "worlds", "worlds", tr("Worlds"), "Worlds"));
+ values.append(new ScreenshotsPage(FS::PathCombine(legacy->minecraftRoot(), "screenshots")));
}
auto logMatcher = inst->getLogFileMatcher();
if(logMatcher)
diff --git a/application/InstanceWindow.cpp b/application/InstanceWindow.cpp
index dd643f47..3c39491b 100644
--- a/application/InstanceWindow.cpp
+++ b/application/InstanceWindow.cpp
@@ -72,7 +72,7 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget *parent)
m_launchOfflineButton = new QPushButton();
horizontalLayout->addWidget(m_launchOfflineButton);
m_launchOfflineButton->setText(tr("Launch Offline"));
- setKillButton(m_instance->isRunning());
+ updateLaunchButtons();
connect(m_launchOfflineButton, SIGNAL(clicked(bool)), SLOT(on_btnLaunchMinecraftOffline_clicked()));
m_closeButton = new QPushButton();
@@ -115,14 +115,21 @@ void InstanceWindow::on_instanceStatusChanged(BaseInstance::Status, BaseInstance
}
}
-void InstanceWindow::setKillButton(bool kill)
+void InstanceWindow::updateLaunchButtons()
{
- if(kill)
+ if(m_instance->isRunning())
{
m_launchOfflineButton->setEnabled(false);
m_killButton->setText(tr("Kill"));
m_killButton->setToolTip(tr("Kill the running instance"));
}
+ else if(!m_instance->canLaunch())
+ {
+ m_launchOfflineButton->setEnabled(false);
+ m_killButton->setText(tr("Launch"));
+ m_killButton->setToolTip(tr("Launch the instance"));
+ m_killButton->setEnabled(false);
+ }
else
{
m_launchOfflineButton->setEnabled(true);
@@ -141,9 +148,9 @@ void InstanceWindow::on_InstanceLaunchTask_changed(std::shared_ptr<LaunchTask> p
m_proc = proc;
}
-void InstanceWindow::on_RunningState_changed(bool running)
+void InstanceWindow::on_RunningState_changed(bool)
{
- setKillButton(running);
+ updateLaunchButtons();
m_container->refreshContainer();
}
diff --git a/application/InstanceWindow.h b/application/InstanceWindow.h
index 8e272e09..7617965e 100644
--- a/application/InstanceWindow.h
+++ b/application/InstanceWindow.h
@@ -57,7 +57,7 @@ protected:
void closeEvent(QCloseEvent *) override;
private:
- void setKillButton(bool kill);
+ void updateLaunchButtons();
private:
std::shared_ptr<LaunchTask> m_proc;
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 86f0398d..a6732cb0 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -665,8 +665,10 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
}
QMenu myMenu;
myMenu.addActions(actions);
+ /*
if (onInstance)
myMenu.setEnabled(m_selectedInstance->canLaunch());
+ */
myMenu.exec(view->mapToGlobal(pos));
}
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index 52450b0f..0d3ed9a8 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -969,6 +969,11 @@ bool MultiMC::launch(InstancePtr instance, bool online, BaseProfilerFactory *pro
showInstanceWindow(instance, "console");
return true;
}
+ else if (instance->canEdit())
+ {
+ showInstanceWindow(instance);
+ return true;
+ }
return false;
}