added instance shortcut feature
Signed-off-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
This commit is contained in:
@@ -65,6 +65,15 @@ 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);
|
||||
@@ -254,6 +263,19 @@ 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()
|
||||
{
|
||||
@@ -319,6 +341,19 @@ 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()
|
||||
|
||||
@@ -282,41 +282,6 @@
|
||||
<string>Miscellaneous</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="numberOfConcurrentDownloadsSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="numberOfConcurrentTasksLabel">
|
||||
<property name="text">
|
||||
<string>Number of concurrent tasks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="numberOfConcurrentTasksSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</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="2" column="1">
|
||||
<widget class="QSpinBox" name="numberOfManualRetriesSpinBox">
|
||||
<property name="minimum">
|
||||
@@ -334,6 +299,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="numberOfConcurrentDownloadsSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="timeoutSecondsSpinBox">
|
||||
<property name="suffix">
|
||||
@@ -341,6 +313,60 @@
|
||||
</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">
|
||||
<string>Number of concurrent tasks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="numberOfConcurrentTasksSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="createShortcutActionLabel">
|
||||
<property name="text">
|
||||
<string>Create shortcut action</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>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user