-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsaveprofiledialog.cpp
More file actions
33 lines (27 loc) · 905 Bytes
/
saveprofiledialog.cpp
File metadata and controls
33 lines (27 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <QSettings>
#include "saveprofiledialog.h"
#include "ui_saveprofiledialog.h"
// This dialog doesn't actually update the current profile -- it just selects
// the required name (which may or may not be the name of an existing profile)
// and returns it via profileMame().
SaveProfileDialog::SaveProfileDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SaveProfileDialog)
{
ui->setupUi(this);
QSettings settings;
settings.beginGroup("Profiles");
ui->comboBox->addItems(settings.childGroups());
settings.endGroup();
// Select the item corresponding to the current profile
QString prof = settings.value("current-profile", "").toString();
ui->comboBox->setCurrentText(prof.isEmpty() ? "Untitled" : prof);
}
SaveProfileDialog::~SaveProfileDialog()
{
delete ui;
}
QString SaveProfileDialog::profileName()
{
return ui->comboBox->currentText();
}