diff options
author | Andrew <forkk@forkk.net> | 2013-01-31 14:31:16 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-01-31 14:31:16 -0600 |
commit | de2632af0dcd7e6a1c3c763c9f7cf38c67ead441 (patch) | |
tree | 3fc6dd755ca34e07ee6b335dbca70785c5ada201 /gui | |
parent | 90764f97d94a52517d735ed96d26bb52a2d75de1 (diff) | |
download | MultiMC-de2632af0dcd7e6a1c3c763c9f7cf38c67ead441.tar MultiMC-de2632af0dcd7e6a1c3c763c9f7cf38c67ead441.tar.gz MultiMC-de2632af0dcd7e6a1c3c763c9f7cf38c67ead441.tar.lz MultiMC-de2632af0dcd7e6a1c3c763c9f7cf38c67ead441.tar.xz MultiMC-de2632af0dcd7e6a1c3c763c9f7cf38c67ead441.zip |
Added instance context menu and status tips.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/mainwindow.cpp | 12 | ||||
-rw-r--r-- | gui/mainwindow.h | 2 | ||||
-rw-r--r-- | gui/mainwindow.ui | 81 |
3 files changed, 91 insertions, 4 deletions
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 <QMenu> + #include <QDesktopServices> #include <QUrl> @@ -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 @@ <number>0</number> </property> <item> - <widget class="QTreeView" name="instanceView"/> + <widget class="QTreeView" name="instanceView"> + <property name="contextMenuPolicy"> + <enum>Qt::CustomContextMenu</enum> + </property> + </widget> </item> </layout> </widget> @@ -110,6 +114,9 @@ <property name="toolTip"> <string>Add a new instance.</string> </property> + <property name="statusTip"> + <string>Add a new instance.</string> + </property> </action> <action name="actionViewInstanceFolder"> <property name="icon"> @@ -122,6 +129,9 @@ <property name="toolTip"> <string>Open the instance folder in a file browser.</string> </property> + <property name="statusTip"> + <string>Open the instance folder in a file browser.</string> + </property> </action> <action name="actionRefresh"> <property name="icon"> @@ -134,6 +144,9 @@ <property name="toolTip"> <string>Reload the instance list.</string> </property> + <property name="statusTip"> + <string>Reload the instance list.</string> + </property> </action> <action name="actionViewCentralModsFolder"> <property name="icon"> @@ -146,6 +159,9 @@ <property name="toolTip"> <string>Open the central mods folder in a file browser.</string> </property> + <property name="statusTip"> + <string>Open the central mods folder in a file browser.</string> + </property> </action> <action name="actionCheckUpdate"> <property name="icon"> @@ -158,6 +174,9 @@ <property name="toolTip"> <string>Check for new updates for MultiMC</string> </property> + <property name="statusTip"> + <string>Check for new updates for MultiMC</string> + </property> </action> <action name="actionSettings"> <property name="icon"> @@ -170,6 +189,9 @@ <property name="toolTip"> <string>Change settings.</string> </property> + <property name="statusTip"> + <string>Change settings.</string> + </property> <property name="menuRole"> <enum>QAction::PreferencesRole</enum> </property> @@ -185,6 +207,9 @@ <property name="toolTip"> <string>Open the bug tracker to report a bug with MultiMC.</string> </property> + <property name="statusTip"> + <string>Open the bug tracker to report a bug with MultiMC.</string> + </property> </action> <action name="actionNews"> <property name="icon"> @@ -197,6 +222,9 @@ <property name="toolTip"> <string>Open the MultiMC dev blog to read news about MultiMC.</string> </property> + <property name="statusTip"> + <string>Open the MultiMC dev blog to read news about MultiMC.</string> + </property> </action> <action name="actionAbout"> <property name="icon"> @@ -209,6 +237,9 @@ <property name="toolTip"> <string>View information about MultiMC.</string> </property> + <property name="statusTip"> + <string>About MultiMC</string> + </property> <property name="menuRole"> <enum>QAction::AboutRole</enum> </property> @@ -220,6 +251,9 @@ <property name="toolTip"> <string>Launch the selected instance.</string> </property> + <property name="statusTip"> + <string>Launch the selected instance.</string> + </property> </action> <action name="actionRenameInstance"> <property name="text"> @@ -228,6 +262,9 @@ <property name="toolTip"> <string>Rename the selected instance.</string> </property> + <property name="statusTip"> + <string>Rename the selected instance.</string> + </property> </action> <action name="actionChangeInstGroup"> <property name="text"> @@ -236,6 +273,9 @@ <property name="toolTip"> <string>Change the selected instance's group.</string> </property> + <property name="statusTip"> + <string>Change the selected instance's group.</string> + </property> </action> <action name="actionChangeInstIcon"> <property name="text"> @@ -244,6 +284,9 @@ <property name="toolTip"> <string>Change the selected instance's icon.</string> </property> + <property name="statusTip"> + <string>Change the selected instance's icon.</string> + </property> </action> <action name="actionEditInstNotes"> <property name="text"> @@ -252,6 +295,9 @@ <property name="toolTip"> <string>Edit the notes for the selected instance.</string> </property> + <property name="statusTip"> + <string>Edit the notes for the selected instance.</string> + </property> </action> <action name="actionInstanceSettings"> <property name="text"> @@ -260,6 +306,9 @@ <property name="toolTip"> <string>Change settings for the selected instance.</string> </property> + <property name="statusTip"> + <string>Change settings for the selected instance.</string> + </property> </action> <action name="actionMakeDesktopShortcut"> <property name="text"> @@ -268,6 +317,9 @@ <property name="toolTip"> <string>Make a shortcut on the desktop for the selected instance.</string> </property> + <property name="statusTip"> + <string>Make a shortcut on the desktop for the selected instance.</string> + </property> </action> <action name="actionManageInstSaves"> <property name="text"> @@ -276,6 +328,9 @@ <property name="toolTip"> <string>Manage saves for the selected instance.</string> </property> + <property name="statusTip"> + <string>Manage saves for the selected instance.</string> + </property> </action> <action name="actionEditInstMods"> <property name="text"> @@ -284,6 +339,9 @@ <property name="toolTip"> <string>Edit the mods for the selected instance.</string> </property> + <property name="statusTip"> + <string>Edit the mods for the selected instance.</string> + </property> </action> <action name="actionChangeInstMCVersion"> <property name="text"> @@ -292,6 +350,9 @@ <property name="toolTip"> <string>Change the selected instance's Minecraft version.</string> </property> + <property name="statusTip"> + <string>Change the selected instance's Minecraft version.</string> + </property> </action> <action name="actionChangeInstLWJGLVersion"> <property name="text"> @@ -300,13 +361,19 @@ <property name="toolTip"> <string>Change the version of LWJGL for the selected instance to use.</string> </property> + <property name="statusTip"> + <string>Change the version of LWJGL for the selected instance to use.</string> + </property> </action> <action name="actionRebuildInstJar"> <property name="text"> <string>Rebuild Jar</string> </property> <property name="toolTip"> - <string>Re-installs the mods for the selected instance.</string> + <string>Reinstall the mods for the selected instance.</string> + </property> + <property name="statusTip"> + <string>Reinstall the mods for the selected instance.</string> </property> </action> <action name="actionViewSelectedInstFolder"> @@ -314,7 +381,10 @@ <string>View Folder</string> </property> <property name="toolTip"> - <string>Opens the selected instance's root folder in a file browser.</string> + <string>Open the selected instance's root folder in a file browser.</string> + </property> + <property name="statusTip"> + <string>Open the selected instance's root folder in a file browser.</string> </property> </action> <action name="actionDeleteInstance"> @@ -322,7 +392,10 @@ <string>Delete</string> </property> <property name="toolTip"> - <string>Deletes the selected instance.</string> + <string>Delete the selected instance.</string> + </property> + <property name="statusTip"> + <string>Delete the selected instance.</string> </property> </action> </widget> |