diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index e257f5ae..dc8f77fe 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -16,6 +16,8 @@ #include "mainwindow.h" #include "ui_mainwindow.h" +#include + #include #include @@ -104,3 +106,13 @@ void MainWindow::closeEvent(QCloseEvent *event) settings->getConfig().setValue("MainWindowState", saveState()); QMainWindow::closeEvent(event); } + +void MainWindow::on_instanceView_customContextMenuRequested(const QPoint &pos) +{ + QMenu *instContextMenu = new QMenu("Instance", this); + + // Add the actions from the toolbar to the context menu. + instContextMenu->addActions(ui->instanceToolBar->actions()); + + instContextMenu->exec(ui->instanceView->mapToGlobal(pos)); +} diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 91efd497..ce06a085 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -56,6 +56,8 @@ private slots: void on_mainToolBar_visibilityChanged(bool); + void on_instanceView_customContextMenuRequested(const QPoint &pos); + private: Ui::MainWindow *ui; diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 3e832276..bc58f7f8 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -34,7 +34,11 @@ 0 - + + + Qt::CustomContextMenu + + @@ -110,6 +114,9 @@ Add a new instance. + + Add a new instance. + @@ -122,6 +129,9 @@ Open the instance folder in a file browser. + + Open the instance folder in a file browser. + @@ -134,6 +144,9 @@ Reload the instance list. + + Reload the instance list. + @@ -146,6 +159,9 @@ Open the central mods folder in a file browser. + + Open the central mods folder in a file browser. + @@ -158,6 +174,9 @@ Check for new updates for MultiMC + + Check for new updates for MultiMC + @@ -170,6 +189,9 @@ Change settings. + + Change settings. + QAction::PreferencesRole @@ -185,6 +207,9 @@ Open the bug tracker to report a bug with MultiMC. + + Open the bug tracker to report a bug with MultiMC. + @@ -197,6 +222,9 @@ Open the MultiMC dev blog to read news about MultiMC. + + Open the MultiMC dev blog to read news about MultiMC. + @@ -209,6 +237,9 @@ View information about MultiMC. + + About MultiMC + QAction::AboutRole @@ -220,6 +251,9 @@ Launch the selected instance. + + Launch the selected instance. + @@ -228,6 +262,9 @@ Rename the selected instance. + + Rename the selected instance. + @@ -236,6 +273,9 @@ Change the selected instance's group. + + Change the selected instance's group. + @@ -244,6 +284,9 @@ Change the selected instance's icon. + + Change the selected instance's icon. + @@ -252,6 +295,9 @@ Edit the notes for the selected instance. + + Edit the notes for the selected instance. + @@ -260,6 +306,9 @@ Change settings for the selected instance. + + Change settings for the selected instance. + @@ -268,6 +317,9 @@ Make a shortcut on the desktop for the selected instance. + + Make a shortcut on the desktop for the selected instance. + @@ -276,6 +328,9 @@ Manage saves for the selected instance. + + Manage saves for the selected instance. + @@ -284,6 +339,9 @@ Edit the mods for the selected instance. + + Edit the mods for the selected instance. + @@ -292,6 +350,9 @@ Change the selected instance's Minecraft version. + + Change the selected instance's Minecraft version. + @@ -300,13 +361,19 @@ Change the version of LWJGL for the selected instance to use. + + Change the version of LWJGL for the selected instance to use. + Rebuild Jar - Re-installs the mods for the selected instance. + Reinstall the mods for the selected instance. + + + Reinstall the mods for the selected instance. @@ -314,7 +381,10 @@ View Folder - Opens the selected instance's root folder in a file browser. + Open the selected instance's root folder in a file browser. + + + Open the selected instance's root folder in a file browser. @@ -322,7 +392,10 @@ Delete - Deletes the selected instance. + Delete the selected instance. + + + Delete the selected instance.