mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-29 13:20:18 +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();
|
InstIconKey = instance->iconKey();
|
||||||
ui->iconButton->setIcon(APPLICATION->icons()->getIcon(InstIconKey));
|
ui->iconButton->setIcon(APPLICATION->icons()->getIcon(InstIconKey));
|
||||||
ui->instNameTextBox->setText(instance->name());
|
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()
|
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
|
// 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);
|
explicit CreateShortcutDialog(InstancePtr instance, QWidget* parent = nullptr);
|
||||||
~CreateShortcutDialog();
|
~CreateShortcutDialog();
|
||||||
|
|
||||||
void createShortcut() const;
|
void createShortcut();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
// Icon, target and name
|
// Icon, target and name
|
||||||
@ -46,13 +46,15 @@ class CreateShortcutDialog : public QDialog {
|
|||||||
// Override target (world, server)
|
// Override target (world, server)
|
||||||
void on_targetCheckbox_stateChanged(int state);
|
void on_targetCheckbox_stateChanged(int state);
|
||||||
void on_worldSelectionBox_currentIndexChanged(int index);
|
void on_worldSelectionBox_currentIndexChanged(int index);
|
||||||
void on_serverAddressTextBox_textChanged(const QString& arg1);
|
void on_serverAddressBox_textChanged(const QString& arg1);
|
||||||
void targetChanged();
|
void targetChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* data */
|
// Data
|
||||||
Ui::CreateShortcutDialog* ui;
|
Ui::CreateShortcutDialog* ui;
|
||||||
QString InstIconKey;
|
QString InstIconKey;
|
||||||
InstancePtr m_instance;
|
InstancePtr m_instance;
|
||||||
bool m_QuickJoinSupported = false;
|
bool m_QuickJoinSupported = false;
|
||||||
|
|
||||||
|
// Index representations
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>450</width>
|
<width>450</width>
|
||||||
<height>365</height>
|
<height>370</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -161,9 +161,15 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="serverAddressTextBox">
|
<widget class="QComboBox" name="serverAddressBox">
|
||||||
<property name="placeholderText">
|
<property name="sizePolicy">
|
||||||
<string>Server Address</string>
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="editable">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user