GH-2832 add .minecraft and libraries buttons to version page

This commit is contained in:
Petr Mrázek 2020-01-09 13:45:46 +01:00
parent 355e5e24da
commit 6a095deea6
3 changed files with 34 additions and 0 deletions

View File

@ -43,6 +43,7 @@
#include "icons/IconList.h"
#include "Exception.h"
#include "Version.h"
#include "DesktopServices.h"
#include <meta/Index.h>
#include <meta/VersionList.h>
@ -507,6 +508,16 @@ void VersionPage::on_actionInstall_LiteLoader_triggered()
}
}
void VersionPage::on_actionLibrariesFolder_triggered()
{
DesktopServices::openDirectory(m_inst->getLocalLibraryPath(), true);
}
void VersionPage::on_actionMinecraftFolder_triggered()
{
DesktopServices::openDirectory(m_inst->gameRoot(), true);
}
void VersionPage::versionCurrent(const QModelIndex &current, const QModelIndex &previous)
{
currentIdx = current.row();

View File

@ -66,6 +66,9 @@ private slots:
void on_actionCustomize_triggered();
void on_actionDownload_All_triggered();
void on_actionMinecraftFolder_triggered();
void on_actionLibrariesFolder_triggered();
void updateVersionControls();
private:

View File

@ -95,6 +95,10 @@
<addaction name="actionAdd_to_Minecraft_jar"/>
<addaction name="actionReplace_Minecraft_jar"/>
<addaction name="actionAdd_Empty"/>
<addaction name="separator"/>
<addaction name="actionMinecraftFolder"/>
<addaction name="actionLibrariesFolder"/>
<addaction name="separator"/>
<addaction name="actionReload"/>
<addaction name="actionDownload_All"/>
</widget>
@ -223,6 +227,22 @@
<string>Download the files needed to launch the instance now.</string>
</property>
</action>
<action name="actionMinecraftFolder">
<property name="text">
<string>Open .minecraft</string>
</property>
<property name="toolTip">
<string>Open the instance's .minecraft folder.</string>
</property>
</action>
<action name="actionLibrariesFolder">
<property name="text">
<string>Open libraries</string>
</property>
<property name="toolTip">
<string>Open the instance's local libraries folder.</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>