revert changes to settings and used menu for shortcuts
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
This commit is contained in:
@@ -701,9 +701,6 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
m_settings->registerSetting("InstSortMode", "Name");
|
||||
m_settings->registerSetting("SelectedInstance", QString());
|
||||
|
||||
// Shortcut creation
|
||||
m_settings->registerSetting("ShortcutCreationMode", "Desktop");
|
||||
|
||||
// Window state and geometry
|
||||
m_settings->registerSetting("MainWindowState", "");
|
||||
m_settings->registerSetting("MainWindowGeometry", "");
|
||||
|
||||
@@ -208,6 +208,13 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
exportInstanceMenu->addAction(ui->actionExportInstanceMrPack);
|
||||
exportInstanceMenu->addAction(ui->actionExportInstanceFlamePack);
|
||||
ui->actionExportInstance->setMenu(exportInstanceMenu);
|
||||
|
||||
auto shortcutInstanceMenu = new QMenu(this);
|
||||
shortcutInstanceMenu->addAction(ui->actionCreateInstanceShortcutDesktop);
|
||||
shortcutInstanceMenu->addAction(ui->actionCreateInstanceShortcutApplications);
|
||||
shortcutInstanceMenu->addAction(ui->actionCreateInstanceShortcutOther);
|
||||
|
||||
ui->actionCreateInstanceShortcut->setMenu(shortcutInstanceMenu);
|
||||
}
|
||||
|
||||
// hide, disable and show stuff
|
||||
@@ -235,6 +242,13 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
}
|
||||
|
||||
ui->actionViewJavaFolder->setEnabled(BuildConfig.JAVA_DOWNLOADER_ENABLED);
|
||||
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
bool isFlatpak = DesktopServices::isFlatpak();
|
||||
|
||||
ui->actionCreateInstanceShortcutDesktop->setEnabled(isFlatpak);
|
||||
ui->actionCreateInstanceShortcutApplications->setEnabled(isFlatpak);
|
||||
#endif
|
||||
}
|
||||
|
||||
// add the toolbar toggles to the view menu
|
||||
@@ -1491,167 +1505,169 @@ void MainWindow::on_actionKillInstance_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
||||
void MainWindow::createInstanceShortcut(QString shortcutFilePath) {
|
||||
|
||||
QString appPath = QApplication::applicationFilePath();
|
||||
QString iconPath;
|
||||
QStringList args;
|
||||
#if defined(Q_OS_MACOS)
|
||||
appPath = QApplication::applicationFilePath();
|
||||
if (appPath.startsWith("/private/var/")) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"),
|
||||
tr("The launcher is in the folder it was extracted from, therefore it cannot create shortcuts."));
|
||||
return;
|
||||
}
|
||||
|
||||
auto pIcon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
if (pIcon == nullptr) {
|
||||
pIcon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "Icon.icns");
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
if (!iconFile.open(QFile::WriteOnly)) {
|
||||
QMessageBox::critical(this, tr("Create instance Application"), tr("Failed to create icon for Application."));
|
||||
return;
|
||||
}
|
||||
|
||||
QIcon icon = pIcon->icon();
|
||||
|
||||
bool success = icon.pixmap(1024, 1024).save(iconPath, "ICNS");
|
||||
iconFile.close();
|
||||
|
||||
if (!success) {
|
||||
iconFile.remove();
|
||||
QMessageBox::critical(this, tr("Create instance Application"), tr("Failed to create icon for Application."));
|
||||
return;
|
||||
}
|
||||
#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
if (appPath.startsWith("/tmp/.mount_")) {
|
||||
// AppImage!
|
||||
appPath = QProcessEnvironment::systemEnvironment().value(QStringLiteral("APPIMAGE"));
|
||||
if (appPath.isEmpty()) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"),
|
||||
tr("Launcher is running as misconfigured AppImage? ($APPIMAGE environment variable is missing)"));
|
||||
} else if (appPath.endsWith("/")) {
|
||||
appPath.chop(1);
|
||||
}
|
||||
}
|
||||
|
||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
if (icon == nullptr) {
|
||||
icon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.png");
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
if (!iconFile.open(QFile::WriteOnly)) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
bool success = icon->icon().pixmap(64, 64).save(&iconFile, "PNG");
|
||||
iconFile.close();
|
||||
|
||||
if (!success) {
|
||||
iconFile.remove();
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (DesktopServices::isFlatpak()) {
|
||||
appPath = "flatpak";
|
||||
QString flatpakAppId = BuildConfig.LAUNCHER_DESKTOPFILENAME;
|
||||
flatpakAppId.remove(".desktop");
|
||||
args.append({ "run", flatpakAppId });
|
||||
}
|
||||
|
||||
#elif defined(Q_OS_WIN)
|
||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
if (icon == nullptr) {
|
||||
icon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico");
|
||||
|
||||
// part of fix for weird bug involving the window icon being replaced
|
||||
// dunno why it happens, but this 2-line fix seems to be enough, so w/e
|
||||
auto appIcon = APPLICATION->getThemedIcon("logo");
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
if (!iconFile.open(QFile::WriteOnly)) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
bool success = icon->icon().pixmap(64, 64).save(&iconFile, "ICO");
|
||||
iconFile.close();
|
||||
|
||||
// restore original window icon
|
||||
QGuiApplication::setWindowIcon(appIcon);
|
||||
|
||||
if (!success) {
|
||||
iconFile.remove();
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
|
||||
#else
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Not supported on your platform!"));
|
||||
return;
|
||||
#endif
|
||||
args.append({ "--launch", m_selectedInstance->id() });
|
||||
|
||||
if (!FS::createShortcut(std::move(shortcutFilePath), appPath, args, m_selectedInstance->name(), iconPath)) {
|
||||
#if not defined(Q_OS_MACOS)
|
||||
iconFile.remove();
|
||||
#endif
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionCreateInstanceShortcutOther_triggered() {
|
||||
if (!m_selectedInstance)
|
||||
return;
|
||||
|
||||
QString defaultedDir = FS::getDesktopDir();
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
QString extension = ".desktop";
|
||||
#elif defined(Q_OS_WINDOWS)
|
||||
QString extension = ".lnk";
|
||||
#else
|
||||
QString extension = "";
|
||||
#endif
|
||||
|
||||
QString shortcutFilePath = FS::PathCombine(defaultedDir, FS::RemoveInvalidFilenameChars(m_selectedInstance->name()) + extension);
|
||||
QFileDialog fileDialog;
|
||||
// workaround to make sure the portal file dialog opens in the desktop directory
|
||||
fileDialog.setDirectoryUrl(defaultedDir);
|
||||
|
||||
shortcutFilePath = fileDialog.getSaveFileName(this, tr("Create Shortcut"), shortcutFilePath, tr("Desktop Entries") + " (*.desktop)");
|
||||
if (shortcutFilePath.isEmpty())
|
||||
return; // file dialog canceled by user
|
||||
|
||||
createInstanceShortcut(shortcutFilePath);
|
||||
QMessageBox::information(this, tr("Create instance shortcut"), tr("Created a shortcut to this instance!"));
|
||||
}
|
||||
|
||||
void MainWindow::on_actionCreateInstanceShortcutDesktop_triggered() {
|
||||
if (!m_selectedInstance)
|
||||
return;
|
||||
|
||||
QString shortcutFilePath = FS::PathCombine(FS::getDesktopDir(), FS::RemoveInvalidFilenameChars(m_selectedInstance->name()));
|
||||
createInstanceShortcut(shortcutFilePath);
|
||||
QMessageBox::information(this, tr("Create instance shortcut"), tr("Created a shortcut to this instance on your desktop!"));
|
||||
}
|
||||
|
||||
void MainWindow::on_actionCreateInstanceShortcutApplications_triggered()
|
||||
{
|
||||
if (!m_selectedInstance)
|
||||
return;
|
||||
|
||||
std::vector<QString> paths;
|
||||
QString mode = APPLICATION->settings()->get("ShortcutCreationMode").toString();
|
||||
if (mode == "Applications") {
|
||||
paths.push_back(FS::getApplicationsDir());
|
||||
} else if (mode == "Both") {
|
||||
paths.push_back(FS::getDesktopDir());
|
||||
paths.push_back(FS::getApplicationsDir());
|
||||
} else {
|
||||
// Default to desktop
|
||||
paths.push_back(FS::getDesktopDir());
|
||||
}
|
||||
|
||||
for (const QString& shortcutDirPath : paths) {
|
||||
if (shortcutDirPath.isEmpty()) {
|
||||
// TODO come up with an alternative solution (open "save file" dialog)
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Couldn't find desktop?!"));
|
||||
return;
|
||||
}
|
||||
|
||||
QString shortcutFilePath;
|
||||
QString appPath = QApplication::applicationFilePath();
|
||||
QString iconPath;
|
||||
QStringList args;
|
||||
#if defined(Q_OS_MACOS)
|
||||
appPath = QApplication::applicationFilePath();
|
||||
if (appPath.startsWith("/private/var/")) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"),
|
||||
tr("The launcher is in the folder it was extracted from, therefore it cannot create shortcuts."));
|
||||
return;
|
||||
}
|
||||
|
||||
auto pIcon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
if (pIcon == nullptr) {
|
||||
pIcon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "Icon.icns");
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
if (!iconFile.open(QFile::WriteOnly)) {
|
||||
QMessageBox::critical(this, tr("Create instance Application"), tr("Failed to create icon for Application."));
|
||||
return;
|
||||
}
|
||||
|
||||
QIcon icon = pIcon->icon();
|
||||
|
||||
bool success = icon.pixmap(1024, 1024).save(iconPath, "ICNS");
|
||||
iconFile.close();
|
||||
|
||||
if (!success) {
|
||||
iconFile.remove();
|
||||
QMessageBox::critical(this, tr("Create instance Application"), tr("Failed to create icon for Application."));
|
||||
return;
|
||||
}
|
||||
#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
if (appPath.startsWith("/tmp/.mount_")) {
|
||||
// AppImage!
|
||||
appPath = QProcessEnvironment::systemEnvironment().value(QStringLiteral("APPIMAGE"));
|
||||
if (appPath.isEmpty()) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"),
|
||||
tr("Launcher is running as misconfigured AppImage? ($APPIMAGE environment variable is missing)"));
|
||||
} else if (appPath.endsWith("/")) {
|
||||
appPath.chop(1);
|
||||
}
|
||||
}
|
||||
|
||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
if (icon == nullptr) {
|
||||
icon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.png");
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
if (!iconFile.open(QFile::WriteOnly)) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
bool success = icon->icon().pixmap(64, 64).save(&iconFile, "PNG");
|
||||
iconFile.close();
|
||||
|
||||
if (!success) {
|
||||
iconFile.remove();
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (DesktopServices::isFlatpak()) {
|
||||
shortcutFilePath = FS::PathCombine(shortcutDirPath, FS::RemoveInvalidFilenameChars(m_selectedInstance->name()) + ".desktop");
|
||||
QFileDialog fileDialog;
|
||||
// workaround to make sure the portal file dialog opens in the desktop directory
|
||||
fileDialog.setDirectoryUrl(shortcutDirPath);
|
||||
shortcutFilePath =
|
||||
fileDialog.getSaveFileName(this, tr("Create Shortcut"), shortcutFilePath, tr("Desktop Entries") + " (*.desktop)");
|
||||
if (shortcutFilePath.isEmpty())
|
||||
return; // file dialog canceled by user
|
||||
appPath = "flatpak";
|
||||
QString flatpakAppId = BuildConfig.LAUNCHER_DESKTOPFILENAME;
|
||||
flatpakAppId.remove(".desktop");
|
||||
args.append({ "run", flatpakAppId });
|
||||
}
|
||||
|
||||
#elif defined(Q_OS_WIN)
|
||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
if (icon == nullptr) {
|
||||
icon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico");
|
||||
|
||||
// part of fix for weird bug involving the window icon being replaced
|
||||
// dunno why it happens, but this 2-line fix seems to be enough, so w/e
|
||||
auto appIcon = APPLICATION->getThemedIcon("logo");
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
if (!iconFile.open(QFile::WriteOnly)) {
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
bool success = icon->icon().pixmap(64, 64).save(&iconFile, "ICO");
|
||||
iconFile.close();
|
||||
|
||||
// restore original window icon
|
||||
QGuiApplication::setWindowIcon(appIcon);
|
||||
|
||||
if (!success) {
|
||||
iconFile.remove();
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create icon for shortcut."));
|
||||
return;
|
||||
}
|
||||
|
||||
#else
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Not supported on your platform!"));
|
||||
return;
|
||||
#endif
|
||||
args.append({ "--launch", m_selectedInstance->id() });
|
||||
|
||||
bool userDefinedShortcutPath = !shortcutFilePath.isEmpty();
|
||||
if (shortcutFilePath.isEmpty())
|
||||
shortcutFilePath = FS::PathCombine(shortcutDirPath, FS::RemoveInvalidFilenameChars(m_selectedInstance->name()));
|
||||
if (!FS::createShortcut(shortcutFilePath, appPath, args, m_selectedInstance->name(), iconPath)) {
|
||||
#if not defined(Q_OS_MACOS)
|
||||
iconFile.remove();
|
||||
#endif
|
||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!"));
|
||||
return;
|
||||
}
|
||||
|
||||
if(userDefinedShortcutPath)
|
||||
break;
|
||||
}
|
||||
#if not defined(Q_OS_MACOS)
|
||||
QMessageBox::information(this, tr("Create instance shortcut"), tr("Created a shortcut to this instance!"));
|
||||
#else
|
||||
QMessageBox::information(this, tr("Create instance shortcut"), tr("Created a shortcut to this instance!"));
|
||||
#endif
|
||||
QString shortcutFilePath = FS::PathCombine(FS::getApplicationsDir(), FS::RemoveInvalidFilenameChars(m_selectedInstance->name()));
|
||||
createInstanceShortcut(shortcutFilePath);
|
||||
QMessageBox::information(this, tr("Create instance shortcut"), tr("Created a shortcut to this instance in your applications folder!"));
|
||||
}
|
||||
|
||||
void MainWindow::taskEnd()
|
||||
|
||||
@@ -165,7 +165,13 @@ class MainWindow : public QMainWindow {
|
||||
|
||||
void on_actionEditInstance_triggered();
|
||||
|
||||
void on_actionCreateInstanceShortcut_triggered();
|
||||
inline void on_actionCreateInstanceShortcut_triggered() {
|
||||
on_actionCreateInstanceShortcutDesktop_triggered();
|
||||
};
|
||||
|
||||
void on_actionCreateInstanceShortcutDesktop_triggered();
|
||||
void on_actionCreateInstanceShortcutApplications_triggered();
|
||||
void on_actionCreateInstanceShortcutOther_triggered();
|
||||
|
||||
void taskEnd();
|
||||
|
||||
@@ -226,6 +232,7 @@ class MainWindow : public QMainWindow {
|
||||
void setSelectedInstanceById(const QString& id);
|
||||
void updateStatusCenter();
|
||||
void setInstanceActionsEnabled(bool enabled);
|
||||
void createInstanceShortcut(QString shortcutDirPath);
|
||||
|
||||
void runModalTask(Task* task);
|
||||
void instanceFromInstanceTask(InstanceTask* task);
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>27</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="fileMenu">
|
||||
@@ -235,8 +235,7 @@
|
||||
</widget>
|
||||
<action name="actionMoreNews">
|
||||
<property name="icon">
|
||||
<iconset theme="news">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="news"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>More news...</string>
|
||||
@@ -250,8 +249,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="cat">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="cat"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Meow</string>
|
||||
@@ -286,8 +284,7 @@
|
||||
</action>
|
||||
<action name="actionAddInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="new">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="new"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Instanc&e...</string>
|
||||
@@ -298,8 +295,7 @@
|
||||
</action>
|
||||
<action name="actionCheckUpdate">
|
||||
<property name="icon">
|
||||
<iconset theme="checkupdate">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="checkupdate"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Update...</string>
|
||||
@@ -313,8 +309,7 @@
|
||||
</action>
|
||||
<action name="actionSettings">
|
||||
<property name="icon">
|
||||
<iconset theme="settings">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="settings"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Setti&ngs...</string>
|
||||
@@ -328,8 +323,7 @@
|
||||
</action>
|
||||
<action name="actionManageAccounts">
|
||||
<property name="icon">
|
||||
<iconset theme="accounts">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="accounts"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Manage Accounts...</string>
|
||||
@@ -337,8 +331,7 @@
|
||||
</action>
|
||||
<action name="actionLaunchInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="launch">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="launch"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Launch</string>
|
||||
@@ -349,8 +342,7 @@
|
||||
</action>
|
||||
<action name="actionKillInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="status-bad">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="status-bad"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Kill</string>
|
||||
@@ -364,8 +356,7 @@
|
||||
</action>
|
||||
<action name="actionRenameInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="rename">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="rename"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rename</string>
|
||||
@@ -376,8 +367,7 @@
|
||||
</action>
|
||||
<action name="actionChangeInstGroup">
|
||||
<property name="icon">
|
||||
<iconset theme="tag">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="tag"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Change Group...</string>
|
||||
@@ -399,8 +389,7 @@
|
||||
</action>
|
||||
<action name="actionEditInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="settings">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="settings"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Edit...</string>
|
||||
@@ -414,8 +403,7 @@
|
||||
</action>
|
||||
<action name="actionViewSelectedInstFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Folder</string>
|
||||
@@ -426,8 +414,7 @@
|
||||
</action>
|
||||
<action name="actionDeleteInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="delete">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="delete"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dele&te</string>
|
||||
@@ -441,8 +428,7 @@
|
||||
</action>
|
||||
<action name="actionCopyInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="copy">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="copy"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cop&y...</string>
|
||||
@@ -456,8 +442,7 @@
|
||||
</action>
|
||||
<action name="actionExportInstance">
|
||||
<property name="icon">
|
||||
<iconset theme="export">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="export"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>E&xport...</string>
|
||||
@@ -468,8 +453,7 @@
|
||||
</action>
|
||||
<action name="actionExportInstanceZip">
|
||||
<property name="icon">
|
||||
<iconset theme="launcher">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="launcher"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Prism Launcher (zip)</string>
|
||||
@@ -477,8 +461,7 @@
|
||||
</action>
|
||||
<action name="actionExportInstanceMrPack">
|
||||
<property name="icon">
|
||||
<iconset theme="modrinth">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="modrinth"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Modrinth (mrpack)</string>
|
||||
@@ -486,8 +469,7 @@
|
||||
</action>
|
||||
<action name="actionExportInstanceFlamePack">
|
||||
<property name="icon">
|
||||
<iconset theme="flame">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="flame"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CurseForge (zip)</string>
|
||||
@@ -495,20 +477,18 @@
|
||||
</action>
|
||||
<action name="actionCreateInstanceShortcut">
|
||||
<property name="icon">
|
||||
<iconset theme="shortcut">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="shortcut"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create Shortcut</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Creates a shortcut on your desktop to launch the selected instance.</string>
|
||||
<string>Creates a shortcut on a selected folder to launch the selected instance.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNoAccountsAdded">
|
||||
<property name="icon">
|
||||
<iconset theme="noaccount">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="noaccount"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No accounts added!</string>
|
||||
@@ -519,8 +499,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="noaccount">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="noaccount"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No Default Account</string>
|
||||
@@ -531,8 +510,7 @@
|
||||
</action>
|
||||
<action name="actionCloseWindow">
|
||||
<property name="icon">
|
||||
<iconset theme="status-bad">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="status-bad"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close &Window</string>
|
||||
@@ -546,8 +524,7 @@
|
||||
</action>
|
||||
<action name="actionViewInstanceFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Instances</string>
|
||||
@@ -558,8 +535,7 @@
|
||||
</action>
|
||||
<action name="actionViewLauncherRootFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Launcher &Root</string>
|
||||
@@ -570,8 +546,7 @@
|
||||
</action>
|
||||
<action name="actionViewCentralModsFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="centralmods">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="centralmods"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Central Mods</string>
|
||||
@@ -582,8 +557,7 @@
|
||||
</action>
|
||||
<action name="actionViewSkinsFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Skins</string>
|
||||
@@ -594,8 +568,7 @@
|
||||
</action>
|
||||
<action name="actionViewIconsFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Instance Icons</string>
|
||||
@@ -606,8 +579,7 @@
|
||||
</action>
|
||||
<action name="actionViewLogsFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Logs</string>
|
||||
@@ -623,8 +595,7 @@
|
||||
</action>
|
||||
<action name="actionReportBug">
|
||||
<property name="icon">
|
||||
<iconset theme="bug">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="bug"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Report a Bug or Suggest a Feature</string>
|
||||
@@ -635,8 +606,7 @@
|
||||
</action>
|
||||
<action name="actionDISCORD">
|
||||
<property name="icon">
|
||||
<iconset theme="discord">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="discord"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Discord Guild</string>
|
||||
@@ -647,8 +617,7 @@
|
||||
</action>
|
||||
<action name="actionMATRIX">
|
||||
<property name="icon">
|
||||
<iconset theme="matrix">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="matrix"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Matrix Space</string>
|
||||
@@ -659,8 +628,7 @@
|
||||
</action>
|
||||
<action name="actionREDDIT">
|
||||
<property name="icon">
|
||||
<iconset theme="reddit-alien">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="reddit-alien"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sub&reddit</string>
|
||||
@@ -671,8 +639,7 @@
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset theme="about">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="about"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&About %1</string>
|
||||
@@ -686,8 +653,7 @@
|
||||
</action>
|
||||
<action name="actionClearMetadata">
|
||||
<property name="icon">
|
||||
<iconset theme="refresh">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="refresh"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Clear Metadata Cache</string>
|
||||
@@ -698,8 +664,7 @@
|
||||
</action>
|
||||
<action name="actionAddToPATH">
|
||||
<property name="icon">
|
||||
<iconset theme="custom-commands">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="custom-commands"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Install to &PATH</string>
|
||||
@@ -710,8 +675,7 @@
|
||||
</action>
|
||||
<action name="actionFoldersButton">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Folders</string>
|
||||
@@ -722,8 +686,7 @@
|
||||
</action>
|
||||
<action name="actionHelpButton">
|
||||
<property name="icon">
|
||||
<iconset theme="help">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="help"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Help</string>
|
||||
@@ -734,8 +697,7 @@
|
||||
</action>
|
||||
<action name="actionAccountsButton">
|
||||
<property name="icon">
|
||||
<iconset theme="noaccount">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="noaccount"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Accounts</string>
|
||||
@@ -743,8 +705,7 @@
|
||||
</action>
|
||||
<action name="actionOpenWiki">
|
||||
<property name="icon">
|
||||
<iconset theme="help">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="help"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>%1 &Help</string>
|
||||
@@ -755,8 +716,7 @@
|
||||
</action>
|
||||
<action name="actionViewWidgetThemeFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Widget Themes</string>
|
||||
@@ -767,8 +727,7 @@
|
||||
</action>
|
||||
<action name="actionViewIconThemeFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>I&con Theme</string>
|
||||
@@ -779,8 +738,7 @@
|
||||
</action>
|
||||
<action name="actionViewCatPackFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cat Packs</string>
|
||||
@@ -791,8 +749,7 @@
|
||||
</action>
|
||||
<action name="actionViewJavaFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Java</string>
|
||||
@@ -801,6 +758,39 @@
|
||||
<string>Open the Java folder in a file browser. Only available if the built-in Java downloader is used.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCreateInstanceShortcutDesktop">
|
||||
<property name="text">
|
||||
<string>Desktop</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Creates an shortcut to this instance on your desktop</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::TextHeuristicRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCreateInstanceShortcutApplications">
|
||||
<property name="text">
|
||||
<string>Applications</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create a shortcut of this instance on your start menu</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::TextHeuristicRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCreateInstanceShortcutOther">
|
||||
<property name="text">
|
||||
<string>Other...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Creates a shortcut in a folder selected by you</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::TextHeuristicRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -65,15 +65,6 @@ enum InstSortMode {
|
||||
Sort_LastLaunch
|
||||
};
|
||||
|
||||
enum ShortcutCreationMode {
|
||||
// Create a shortcut in the applications
|
||||
Shortcut_OnlyApplications,
|
||||
// Create a shortcut in both locations
|
||||
Shortcut_Both,
|
||||
// Create a shortcut on the desktop
|
||||
Shortcut_OnlyDesktop
|
||||
};
|
||||
|
||||
LauncherPage::LauncherPage(QWidget* parent) : QWidget(parent), ui(new Ui::LauncherPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -263,19 +254,6 @@ void LauncherPage::applySettings()
|
||||
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
|
||||
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
|
||||
s->set("SkipModpackUpdatePrompt", ui->skipModpackUpdatePromptBtn->isChecked());
|
||||
|
||||
auto shortcutMode = (ShortcutCreationMode) ui->createShortcutActionComboBox->currentIndex();
|
||||
switch (shortcutMode) {
|
||||
case Shortcut_OnlyApplications:
|
||||
s->set("ShortcutCreationMode", "Applications");
|
||||
break;
|
||||
case Shortcut_Both:
|
||||
s->set("ShortcutCreationMode", "Both");
|
||||
break;
|
||||
case Shortcut_OnlyDesktop:
|
||||
s->set("ShortcutCreationMode", "Desktop");
|
||||
break;
|
||||
}
|
||||
}
|
||||
void LauncherPage::loadSettings()
|
||||
{
|
||||
@@ -341,19 +319,6 @@ void LauncherPage::loadSettings()
|
||||
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
||||
ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool());
|
||||
ui->skipModpackUpdatePromptBtn->setChecked(s->get("SkipModpackUpdatePrompt").toBool());
|
||||
|
||||
QString shortcutModeStr = s->get("ShortcutCreationMode").toString();
|
||||
ShortcutCreationMode shortcutMode = Shortcut_OnlyDesktop;
|
||||
if(shortcutModeStr == "Applications") {
|
||||
shortcutMode = Shortcut_OnlyApplications;
|
||||
} else if(shortcutModeStr == "Desktop") {
|
||||
// Guess we don't need that, but it's here for completeness
|
||||
shortcutMode = Shortcut_OnlyDesktop;
|
||||
} else if(shortcutModeStr == "Both") {
|
||||
shortcutMode = Shortcut_Both;
|
||||
}
|
||||
|
||||
ui->createShortcutActionComboBox->setCurrentIndex(shortcutMode);
|
||||
}
|
||||
|
||||
void LauncherPage::refreshFontPreview()
|
||||
@@ -404,4 +369,4 @@ void LauncherPage::refreshFontPreview()
|
||||
void LauncherPage::retranslate()
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
@@ -282,23 +282,6 @@
|
||||
<string>Miscellaneous</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="numberOfManualRetriesSpinBox">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="timeoutSecondsLabel">
|
||||
<property name="toolTip">
|
||||
<string>Seconds to wait until the requests are terminated</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timeout for HTTP requests</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="numberOfConcurrentDownloadsSpinBox">
|
||||
<property name="minimum">
|
||||
@@ -306,27 +289,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="timeoutSecondsSpinBox">
|
||||
<property name="suffix">
|
||||
<string>s</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="numberOfConcurrentDownloadsLabel">
|
||||
<property name="text">
|
||||
<string>Number of concurrent downloads</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="numberOfManualRetriesLabel">
|
||||
<property name="text">
|
||||
<string>Number of manual retries</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="numberOfConcurrentTasksLabel">
|
||||
<property name="text">
|
||||
@@ -341,30 +303,42 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="createShortcutActionLabel">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="numberOfConcurrentDownloadsLabel">
|
||||
<property name="text">
|
||||
<string>Create shortcut action</string>
|
||||
<string>Number of concurrent downloads</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="createShortcutActionComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Applications only</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Applications & Desktop</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Desktop only</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="numberOfManualRetriesLabel">
|
||||
<property name="text">
|
||||
<string>Number of manual retries</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="numberOfManualRetriesSpinBox">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="timeoutSecondsLabel">
|
||||
<property name="toolTip">
|
||||
<string>Seconds to wait until the requests are terminated</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timeout for HTTP requests</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="timeoutSecondsSpinBox">
|
||||
<property name="suffix">
|
||||
<string>s</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -694,4 +668,4 @@
|
||||
<buttongroups>
|
||||
<buttongroup name="sortingModeGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user