diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index f48ea603b..7b453671c 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -169,6 +169,7 @@ bool MainDialog::setup() return false; } + loadSettings(); return true; } @@ -182,7 +183,14 @@ void MainDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous) void MainDialog::loadSettings() { + int width = mLauncherSettings.value(QString("General/MainWindow/width")).toInt(); + int height = mLauncherSettings.value(QString("General/MainWindow/height")).toInt(); + int posX = mLauncherSettings.value(QString("General/MainWindow/posx")).toInt(); + int posY = mLauncherSettings.value(QString("General/MainWindow/posy")).toInt(); + + resize(width, height); + move(posX, posY); } void MainDialog::saveSettings() @@ -193,6 +201,12 @@ void MainDialog::saveSettings() mLauncherSettings.setValue(QString("General/MainWindow/width"), width); mLauncherSettings.setValue(QString("General/MainWindow/height"), height); + QString posX = QString::number(this->pos().x()); + QString posY = QString::number(this->pos().y()); + + mLauncherSettings.setValue(QString("General/MainWindow/posx"), posX); + mLauncherSettings.setValue(QString("General/MainWindow/posy"), posY); + qDebug() << "size: " << width << height; } diff --git a/apps/launcher/utils/profilescombobox.cpp b/apps/launcher/utils/profilescombobox.cpp index a2c8668cb..4c258dae6 100644 --- a/apps/launcher/utils/profilescombobox.cpp +++ b/apps/launcher/utils/profilescombobox.cpp @@ -69,6 +69,9 @@ void ProfilesComboBox::slotEditingFinished() qDebug() << current << previous; + if (currentIndex() == -1) + return; + if (current.isEmpty()) return; @@ -78,13 +81,8 @@ void ProfilesComboBox::slotEditingFinished() if (findText(current) != -1) return; - if (currentIndex() == -1) { - addItem(current); - setCurrentIndex(findText(current)); - } else { - setItemText(currentIndex(), current); - emit(profileRenamed(previous, current)); - } + setItemText(currentIndex(), current); + emit(profileRenamed(previous, current)); } void ProfilesComboBox::slotIndexChanged(int index)