Added more open folder actions

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-11-19 02:30:19 +02:00
parent 1150249cec
commit e99926ea94
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
4 changed files with 57 additions and 17 deletions

View File

@ -108,12 +108,9 @@ bool openDirectory(const QString& path, [[maybe_unused]] bool ensureExists)
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
if (!isSandbox()) {
return IndirectOpen(f);
} else {
return f();
}
#else
return f();
#endif
return f();
}
bool openFile(const QString& path)

View File

@ -1198,17 +1198,27 @@ void MainWindow::on_actionViewCentralModsFolder_triggered()
void MainWindow::on_actionViewIconThemeFolder_triggered()
{
DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path());
DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path(), true);
}
void MainWindow::on_actionViewWidgetThemeFolder_triggered()
{
DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path());
DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path(), true);
}
void MainWindow::on_actionViewCatPackFolder_triggered()
{
DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path());
DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path(), true);
}
void MainWindow::on_actionViewIconsFolder_triggered()
{
DesktopServices::openDirectory(APPLICATION->icons()->getDirectory(), true);
}
void MainWindow::on_actionViewLogsFolder_triggered()
{
DesktopServices::openDirectory("logs", true);
}
void MainWindow::refreshInstances()

View File

@ -117,6 +117,8 @@ class MainWindow : public QMainWindow {
void on_actionViewIconThemeFolder_triggered();
void on_actionViewWidgetThemeFolder_triggered();
void on_actionViewCatPackFolder_triggered();
void on_actionViewIconsFolder_triggered();
void on_actionViewLogsFolder_triggered();
void on_actionViewSelectedInstFolder_triggered();

View File

@ -194,6 +194,9 @@
<addaction name="actionViewIconThemeFolder"/>
<addaction name="actionViewWidgetThemeFolder"/>
<addaction name="actionViewCatPackFolder"/>
<addaction name="actionViewIconsFolder"/>
<addaction name="separator"/>
<addaction name="actionViewLogsFolder"/>
</widget>
<widget class="QMenu" name="accountsMenu">
<property name="title">
@ -545,10 +548,10 @@
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View &amp;Instance Folder</string>
<string>&amp;Instances</string>
</property>
<property name="toolTip">
<string>Open the instance folder in a file browser.</string>
<string>Open the instances folder in a file browser.</string>
</property>
</action>
<action name="actionViewLauncherRootFolder">
@ -557,7 +560,7 @@
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View Launcher &amp;Root Folder</string>
<string>Launcher &amp;Root</string>
</property>
<property name="toolTip">
<string>Open the launcher's root folder in a file browser.</string>
@ -569,12 +572,36 @@
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View &amp;Central Mods Folder</string>
<string>&amp;Central Mods</string>
</property>
<property name="toolTip">
<string>Open the central mods folder in a file browser.</string>
</property>
</action>
<action name="actionViewIconsFolder">
<property name="icon">
<iconset theme="viewfolder">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Instance Icons</string>
</property>
<property name="toolTip">
<string>Open the instance icons folder in a file browser.</string>
</property>
</action>
<action name="actionViewLogsFolder">
<property name="icon">
<iconset theme="viewfolder">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Logs</string>
</property>
<property name="toolTip">
<string>Open the logs folder in a file browser.</string>
</property>
</action>
<action name="actionChangeTheme">
<property name="text">
<string>Themes</string>
@ -718,10 +745,10 @@
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View &amp;Widget Themes Folder</string>
<string>&amp;Widget Themes</string>
</property>
<property name="toolTip">
<string>View Widget Theme Folder</string>
<string>Open the widget themes folder in a file browser.</string>
</property>
</action>
<action name="actionViewIconThemeFolder">
@ -730,18 +757,22 @@
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View I&amp;con Theme Folder</string>
<string>I&amp;con Theme</string>
</property>
<property name="toolTip">
<string>View Icon Theme Folder</string>
<string>Open the icon theme folder in a file browser.</string>
</property>
</action>
<action name="actionViewCatPackFolder">
<property name="icon">
<iconset theme="viewfolder"/>
<iconset theme="viewfolder">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View Cat Packs Folder</string>
<string>Cat Packs</string>
</property>
<property name="toolTip">
<string>Open the cat packs folder in a file browser.</string>
</property>
</action>
</widget>