mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-28 04:40:20 +02:00
Small adjustments
Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
parent
37e12fff02
commit
b296085ea0
@ -60,6 +60,11 @@ CreateShortcutDialog::CreateShortcutDialog(InstancePtr instance, QWidget* parent
|
||||
InstIconKey = instance->iconKey();
|
||||
ui->iconButton->setIcon(APPLICATION->icons()->getIcon(InstIconKey));
|
||||
ui->instNameTextBox->setText(instance->name());
|
||||
|
||||
m_QuickJoinSupported = instance->traits().contains("feature:is_quick_play_singleplayer");
|
||||
if (!m_QuickJoinSupported) {
|
||||
// TODO: Remove radio box and add a single server address textbox instead
|
||||
}
|
||||
}
|
||||
|
||||
CreateShortcutDialog::~CreateShortcutDialog()
|
||||
@ -78,31 +83,35 @@ void CreateShortcutDialog::on_iconButton_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void CreateShortcutDialog::on_saveTargetSelectionBox_currentIndexChanged(int index)
|
||||
{}
|
||||
void CreateShortcutDialog::on_saveTargetSelectionBox_currentIndexChanged(int index) {}
|
||||
|
||||
void CreateShortcutDialog::on_instNameTextBox_textChanged(const QString& arg1)
|
||||
{}
|
||||
void CreateShortcutDialog::on_instNameTextBox_textChanged(const QString& arg1) {}
|
||||
|
||||
void CreateShortcutDialog::on_overrideAccountCheckbox_stateChanged(int state)
|
||||
{}
|
||||
void CreateShortcutDialog::on_overrideAccountCheckbox_stateChanged(int state) {}
|
||||
|
||||
void CreateShortcutDialog::on_accountSelectionBox_currentIndexChanged(int index)
|
||||
{}
|
||||
void CreateShortcutDialog::on_accountSelectionBox_currentIndexChanged(int index) {}
|
||||
|
||||
void CreateShortcutDialog::on_targetCheckbox_stateChanged(int state)
|
||||
{}
|
||||
void CreateShortcutDialog::on_targetCheckbox_stateChanged(int state) {}
|
||||
|
||||
void CreateShortcutDialog::on_worldSelectionBox_currentIndexChanged(int index)
|
||||
{}
|
||||
void CreateShortcutDialog::on_worldSelectionBox_currentIndexChanged(int index) {}
|
||||
|
||||
void CreateShortcutDialog::on_serverAddressTextBox_textChanged(const QString& arg1)
|
||||
{}
|
||||
void CreateShortcutDialog::on_serverAddressBox_textChanged(const QString& arg1) {}
|
||||
|
||||
void CreateShortcutDialog::targetChanged()
|
||||
{}
|
||||
void CreateShortcutDialog::targetChanged() {}
|
||||
|
||||
// Real work
|
||||
void CreateShortcutDialog::createShortcut() const
|
||||
{}
|
||||
|
||||
void CreateShortcutDialog::createShortcut()
|
||||
{
|
||||
QString targetString = tr("instance");
|
||||
QStringList extraArgs;
|
||||
if (ui->targetCheckbox->isChecked()) {
|
||||
if (ui->worldTarget->isChecked()) {
|
||||
targetString = tr("world");
|
||||
extraArgs = { "--world", /* world ID */ };
|
||||
} else if (ui->serverTarget->isChecked()) {
|
||||
targetString = tr("server");
|
||||
extraArgs = { "--server", /* server address */ };
|
||||
}
|
||||
}
|
||||
ShortcutUtils::createInstanceShortcutOnDesktop({ m_instance.get(), m_instance->name(), targetString, this, extraArgs });
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class CreateShortcutDialog : public QDialog {
|
||||
explicit CreateShortcutDialog(InstancePtr instance, QWidget* parent = nullptr);
|
||||
~CreateShortcutDialog();
|
||||
|
||||
void createShortcut() const;
|
||||
void createShortcut();
|
||||
|
||||
private slots:
|
||||
// Icon, target and name
|
||||
@ -46,13 +46,15 @@ class CreateShortcutDialog : public QDialog {
|
||||
// Override target (world, server)
|
||||
void on_targetCheckbox_stateChanged(int state);
|
||||
void on_worldSelectionBox_currentIndexChanged(int index);
|
||||
void on_serverAddressTextBox_textChanged(const QString& arg1);
|
||||
void on_serverAddressBox_textChanged(const QString& arg1);
|
||||
void targetChanged();
|
||||
|
||||
private:
|
||||
/* data */
|
||||
// Data
|
||||
Ui::CreateShortcutDialog* ui;
|
||||
QString InstIconKey;
|
||||
InstancePtr m_instance;
|
||||
bool m_QuickJoinSupported = false;
|
||||
|
||||
// Index representations
|
||||
};
|
||||
|
@ -10,7 +10,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>450</width>
|
||||
<height>365</height>
|
||||
<height>370</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -161,9 +161,15 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="serverAddressTextBox">
|
||||
<property name="placeholderText">
|
||||
<string>Server Address</string>
|
||||
<widget class="QComboBox" name="serverAddressBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user