diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp
index 061981e332..8663102b00 100644
--- a/apps/launcher/datafilespage.cpp
+++ b/apps/launcher/datafilespage.cpp
@@ -130,99 +130,6 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
setupConfig();
}
-void DataFilesPage::newProfile()
-{
- bool ok;
- QString text = QInputDialog::getText(this, tr("New Profile"),
- tr("Profile Name:"), QLineEdit::Normal,
- tr("New Profile"), &ok);
- if (ok && !text.isEmpty()) {
- if (mProfilesComboBox->findText(text) != -1)
- {
- QMessageBox::warning(this, tr("Profile already exists"),
- tr("the profile %0 already exists.").arg(text),
- QMessageBox::Ok);
- } else {
- // Add the new profile to the combobox
- mProfilesComboBox->addItem(text);
- mProfilesComboBox->setCurrentIndex(mProfilesComboBox->findText(text));
-
- }
-
- }
-
-}
-
-void DataFilesPage::copyProfile()
-{
- QString profile = mProfilesComboBox->currentText();
- bool ok;
-
- QString text = QInputDialog::getText(this, tr("Copy Profile"),
- tr("Profile Name:"), QLineEdit::Normal,
- tr("%0 Copy").arg(profile), &ok);
- if (ok && !text.isEmpty()) {
- if (mProfilesComboBox->findText(text) != -1)
- {
- QMessageBox::warning(this, tr("Profile already exists"),
- tr("the profile %0 already exists.").arg(text),
- QMessageBox::Ok);
- } else {
- // Add the new profile to the combobox
- mProfilesComboBox->addItem(text);
-
- // First write the current profile as the new profile
- writeConfig(text);
- mProfilesComboBox->setCurrentIndex(mProfilesComboBox->findText(text));
-
- }
-
- }
-
-}
-
-void DataFilesPage::deleteProfile()
-{
- QString profile = mProfilesComboBox->currentText();
-
-
- if (profile.isEmpty()) {
- return;
- }
-
- QMessageBox deleteMessageBox(this);
- deleteMessageBox.setWindowTitle(tr("Delete Profile"));
- deleteMessageBox.setText(tr("Are you sure you want to delete %0?").arg(profile));
- deleteMessageBox.setIcon(QMessageBox::Warning);
- QAbstractButton *deleteButton =
- deleteMessageBox.addButton(tr("Delete"), QMessageBox::ActionRole);
-
- deleteMessageBox.addButton(QMessageBox::Cancel);
-
- deleteMessageBox.exec();
-
- if (deleteMessageBox.clickedButton() == deleteButton) {
-
- qDebug() << "Delete profile " << profile;
-
- // Make sure we have no groups open
- while (!mLauncherConfig->group().isEmpty()) {
- mLauncherConfig->endGroup();
- }
-
- mLauncherConfig->beginGroup("Profiles");
-
- // Open the profile-name subgroup
- mLauncherConfig->beginGroup(profile);
- mLauncherConfig->remove(""); // Clear the subgroup
- mLauncherConfig->endGroup();
- mLauncherConfig->endGroup();
-
- // Remove the profile from the combobox
- mProfilesComboBox->removeItem(mProfilesComboBox->findText(profile));
- }
-}
-
void DataFilesPage::setupDataFiles(const QString &path)
{
qDebug() << "setupDataFiles called!";
@@ -361,6 +268,99 @@ void DataFilesPage::setupConfig()
connect(mProfilesComboBox, SIGNAL(textChanged(const QString&, const QString&)), this, SLOT(profileChanged(const QString&, const QString&)));
}
+void DataFilesPage::newProfile()
+{
+ bool ok;
+ QString text = QInputDialog::getText(this, tr("New Profile"),
+ tr("Profile Name:"), QLineEdit::Normal,
+ tr("New Profile"), &ok);
+ if (ok && !text.isEmpty()) {
+ if (mProfilesComboBox->findText(text) != -1)
+ {
+ QMessageBox::warning(this, tr("Profile already exists"),
+ tr("the profile %0 already exists.").arg(text),
+ QMessageBox::Ok);
+ } else {
+ // Add the new profile to the combobox
+ mProfilesComboBox->addItem(text);
+ mProfilesComboBox->setCurrentIndex(mProfilesComboBox->findText(text));
+
+ }
+
+ }
+
+}
+
+void DataFilesPage::copyProfile()
+{
+ QString profile = mProfilesComboBox->currentText();
+ bool ok;
+
+ QString text = QInputDialog::getText(this, tr("Copy Profile"),
+ tr("Profile Name:"), QLineEdit::Normal,
+ tr("%0 Copy").arg(profile), &ok);
+ if (ok && !text.isEmpty()) {
+ if (mProfilesComboBox->findText(text) != -1)
+ {
+ QMessageBox::warning(this, tr("Profile already exists"),
+ tr("the profile %0 already exists.").arg(text),
+ QMessageBox::Ok);
+ } else {
+ // Add the new profile to the combobox
+ mProfilesComboBox->addItem(text);
+
+ // First write the current profile as the new profile
+ writeConfig(text);
+ mProfilesComboBox->setCurrentIndex(mProfilesComboBox->findText(text));
+
+ }
+
+ }
+
+}
+
+void DataFilesPage::deleteProfile()
+{
+ QString profile = mProfilesComboBox->currentText();
+
+
+ if (profile.isEmpty()) {
+ return;
+ }
+
+ QMessageBox deleteMessageBox(this);
+ deleteMessageBox.setWindowTitle(tr("Delete Profile"));
+ deleteMessageBox.setText(tr("Are you sure you want to delete %0?").arg(profile));
+ deleteMessageBox.setIcon(QMessageBox::Warning);
+ QAbstractButton *deleteButton =
+ deleteMessageBox.addButton(tr("Delete"), QMessageBox::ActionRole);
+
+ deleteMessageBox.addButton(QMessageBox::Cancel);
+
+ deleteMessageBox.exec();
+
+ if (deleteMessageBox.clickedButton() == deleteButton) {
+
+ qDebug() << "Delete profile " << profile;
+
+ // Make sure we have no groups open
+ while (!mLauncherConfig->group().isEmpty()) {
+ mLauncherConfig->endGroup();
+ }
+
+ mLauncherConfig->beginGroup("Profiles");
+
+ // Open the profile-name subgroup
+ mLauncherConfig->beginGroup(profile);
+ mLauncherConfig->remove(""); // Clear the subgroup
+ mLauncherConfig->endGroup();
+ mLauncherConfig->endGroup();
+
+ // Remove the profile from the combobox
+ mProfilesComboBox->removeItem(mProfilesComboBox->findText(profile));
+ }
+}
+
void DataFilesPage::masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
{
if (mMastersWidget->selectionModel()->hasSelection()) {