mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Launcher: Clone content list button (feature #4784)
This commit is contained in:
parent
7023e86d19
commit
686049679c
4 changed files with 69 additions and 32 deletions
|
@ -104,6 +104,7 @@
|
||||||
Feature #4673: Weapon sheathing
|
Feature #4673: Weapon sheathing
|
||||||
Feature #4675: Support for NiRollController
|
Feature #4675: Support for NiRollController
|
||||||
Feature #4730: Native animated containers support
|
Feature #4730: Native animated containers support
|
||||||
|
Feature #4784: Launcher: Duplicate Content Lists
|
||||||
Feature #4812: Support NiSwitchNode
|
Feature #4812: Support NiSwitchNode
|
||||||
Feature #4836: Daytime node switch
|
Feature #4836: Daytime node switch
|
||||||
Feature #4859: Make water reflections more configurable
|
Feature #4859: Make water reflections more configurable
|
||||||
|
|
|
@ -39,10 +39,13 @@ Launcher::DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, Config:
|
||||||
const QString encoding = mGameSettings.value("encoding", "win1252");
|
const QString encoding = mGameSettings.value("encoding", "win1252");
|
||||||
mSelector->setEncoding(encoding);
|
mSelector->setEncoding(encoding);
|
||||||
|
|
||||||
mProfileDialog = new TextInputDialog(tr("New Content List"), tr("Content List name:"), this);
|
mNewProfileDialog = new TextInputDialog(tr("New Content List"), tr("Content List name:"), this);
|
||||||
|
mCloneProfileDialog = new TextInputDialog(tr("Clone Content List"), tr("Content List name:"), this);
|
||||||
|
|
||||||
connect(mProfileDialog->lineEdit(), SIGNAL(textChanged(QString)),
|
connect(mNewProfileDialog->lineEdit(), SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(updateOkButton(QString)));
|
this, SLOT(updateNewProfileOkButton(QString)));
|
||||||
|
connect(mCloneProfileDialog->lineEdit(), SIGNAL(textChanged(QString)),
|
||||||
|
this, SLOT(updateCloneProfileOkButton(QString)));
|
||||||
|
|
||||||
buildView();
|
buildView();
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
@ -61,6 +64,7 @@ void Launcher::DataFilesPage::buildView()
|
||||||
|
|
||||||
//tool buttons
|
//tool buttons
|
||||||
ui.newProfileButton->setToolTip ("Create a new Content List");
|
ui.newProfileButton->setToolTip ("Create a new Content List");
|
||||||
|
ui.cloneProfileButton->setToolTip ("Clone the current Content List");
|
||||||
ui.deleteProfileButton->setToolTip ("Delete an existing Content List");
|
ui.deleteProfileButton->setToolTip ("Delete an existing Content List");
|
||||||
|
|
||||||
//combo box
|
//combo box
|
||||||
|
@ -70,6 +74,7 @@ void Launcher::DataFilesPage::buildView()
|
||||||
|
|
||||||
// Add the actions to the toolbuttons
|
// Add the actions to the toolbuttons
|
||||||
ui.newProfileButton->setDefaultAction (ui.newProfileAction);
|
ui.newProfileButton->setDefaultAction (ui.newProfileAction);
|
||||||
|
ui.cloneProfileButton->setDefaultAction (ui.cloneProfileAction);
|
||||||
ui.deleteProfileButton->setDefaultAction (ui.deleteProfileAction);
|
ui.deleteProfileButton->setDefaultAction (ui.deleteProfileAction);
|
||||||
|
|
||||||
//establish connections
|
//establish connections
|
||||||
|
@ -246,10 +251,10 @@ void Launcher::DataFilesPage::slotProfileChanged(int index)
|
||||||
|
|
||||||
void Launcher::DataFilesPage::on_newProfileAction_triggered()
|
void Launcher::DataFilesPage::on_newProfileAction_triggered()
|
||||||
{
|
{
|
||||||
if (mProfileDialog->exec() != QDialog::Accepted)
|
if (mNewProfileDialog->exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString profile = mProfileDialog->lineEdit()->text();
|
QString profile = mNewProfileDialog->lineEdit()->text();
|
||||||
|
|
||||||
if (profile.isEmpty())
|
if (profile.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
@ -273,6 +278,20 @@ void Launcher::DataFilesPage::addProfile (const QString &profile, bool setAsCurr
|
||||||
setProfile (ui.profilesComboBox->findText (profile), false);
|
setProfile (ui.profilesComboBox->findText (profile), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Launcher::DataFilesPage::on_cloneProfileAction_triggered()
|
||||||
|
{
|
||||||
|
if (mCloneProfileDialog->exec() != QDialog::Accepted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QString profile = mCloneProfileDialog->lineEdit()->text();
|
||||||
|
|
||||||
|
if (profile.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
mLauncherSettings.setContentList(profile, selectedFilePaths());
|
||||||
|
addProfile(profile, true);
|
||||||
|
}
|
||||||
|
|
||||||
void Launcher::DataFilesPage::on_deleteProfileAction_triggered()
|
void Launcher::DataFilesPage::on_deleteProfileAction_triggered()
|
||||||
{
|
{
|
||||||
QString profile = ui.profilesComboBox->currentText();
|
QString profile = ui.profilesComboBox->currentText();
|
||||||
|
@ -295,17 +314,16 @@ void Launcher::DataFilesPage::on_deleteProfileAction_triggered()
|
||||||
checkForDefaultProfile();
|
checkForDefaultProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::DataFilesPage::updateOkButton(const QString &text)
|
void Launcher::DataFilesPage::updateNewProfileOkButton(const QString &text)
|
||||||
{
|
{
|
||||||
// We do this here because we need the profiles combobox text
|
// We do this here because we need the profiles combobox text
|
||||||
if (text.isEmpty()) {
|
mNewProfileDialog->setOkButtonEnabled(!text.isEmpty() && ui.profilesComboBox->findText(text) == -1);
|
||||||
mProfileDialog->setOkButtonEnabled(false);
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
(ui.profilesComboBox->findText(text) == -1)
|
void Launcher::DataFilesPage::updateCloneProfileOkButton(const QString &text)
|
||||||
? mProfileDialog->setOkButtonEnabled(true)
|
{
|
||||||
: mProfileDialog->setOkButtonEnabled(false);
|
// We do this here because we need the profiles combobox text
|
||||||
|
mCloneProfileDialog->setOkButtonEnabled(!text.isEmpty() && ui.profilesComboBox->findText(text) == -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::DataFilesPage::checkForDefaultProfile()
|
void Launcher::DataFilesPage::checkForDefaultProfile()
|
||||||
|
|
|
@ -62,9 +62,11 @@ namespace Launcher
|
||||||
void slotProfileDeleted(const QString &item);
|
void slotProfileDeleted(const QString &item);
|
||||||
void slotAddonDataChanged ();
|
void slotAddonDataChanged ();
|
||||||
|
|
||||||
void updateOkButton(const QString &text);
|
void updateNewProfileOkButton(const QString &text);
|
||||||
|
void updateCloneProfileOkButton(const QString &text);
|
||||||
|
|
||||||
void on_newProfileAction_triggered();
|
void on_newProfileAction_triggered();
|
||||||
|
void on_cloneProfileAction_triggered();
|
||||||
void on_deleteProfileAction_triggered();
|
void on_deleteProfileAction_triggered();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -73,7 +75,8 @@ namespace Launcher
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
TextInputDialog *mProfileDialog;
|
TextInputDialog *mNewProfileDialog;
|
||||||
|
TextInputDialog *mCloneProfileDialog;
|
||||||
|
|
||||||
Files::ConfigurationManager &mCfgMgr;
|
Files::ConfigurationManager &mCfgMgr;
|
||||||
|
|
||||||
|
|
|
@ -2,20 +2,6 @@
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>DataFilesPage</class>
|
<class>DataFilesPage</class>
|
||||||
<widget class="QWidget" name="DataFilesPage">
|
<widget class="QWidget" name="DataFilesPage">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>518</width>
|
|
||||||
<height>108</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="contextMenuPolicy">
|
<property name="contextMenuPolicy">
|
||||||
<enum>Qt::DefaultContextMenu</enum>
|
<enum>Qt::DefaultContextMenu</enum>
|
||||||
</property>
|
</property>
|
||||||
|
@ -79,6 +65,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="cloneProfileButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Clone Content List</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Clone Content List</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="deleteProfileButton">
|
<widget class="QToolButton" name="deleteProfileButton">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
@ -87,9 +86,6 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Delete Content List</string>
|
<string>Delete Content List</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
|
||||||
<string>Ctrl+D</string>
|
|
||||||
</property>
|
|
||||||
<property name="autoRaise">
|
<property name="autoRaise">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
@ -115,6 +111,22 @@
|
||||||
<string>Ctrl+N</string>
|
<string>Ctrl+N</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="cloneProfileAction">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="edit-copy">
|
||||||
|
<normaloff/>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Clone Content List</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Clone Content List</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+G</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="deleteProfileAction">
|
<action name="deleteProfileAction">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
@ -130,6 +142,9 @@
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Delete Content List</string>
|
<string>Delete Content List</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+D</string>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="checkAction">
|
<action name="checkAction">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
|
|
Loading…
Reference in a new issue