123456789101112131415161718192021222324252627282930313233343536 |
- #include "dialogoptions.h"
- #include "ui_dialogoptions.h"
-
- DialogOptions::DialogOptions(QWidget *parent) : QDialog(parent), ui(new Ui::DialogOptions)
- {
- ui->setupUi(this);
-
- foreach(EpiUser usr, Epimafia::loadUsers())
- if(!usr.isUnknown() && usr.hasLogin())
- ui->lineDefaultLogin->addItem(usr.getLogin());
-
- ui->checkAutoConnect->setChecked(Options::instance()->isAutoConnect());
- ui->checkStartAtBoot->setChecked(Options::instance()->startAtBoot());
- ui->lineDefaultLogin->lineEdit()->setText(Options::instance()->getDefaultLogin(false));
- ui->spinAutoreconnectInterval->setValue(Options::instance()->getAutoReconnectInterval());
- connect(this, SIGNAL(accepted()), this, SLOT(save()));
-
- #ifndef Q_OS_WIN
- ui->checkStartAtBoot->hide();
- ui->label->hide();
- #endif
-
- }
-
- DialogOptions::~DialogOptions()
- {
- delete ui;
- }
-
- void DialogOptions::save()
- {
- Options::instance()->setAutoConnect(ui->checkAutoConnect->isChecked());
- Options::instance()->setStartAtBoot(ui->checkStartAtBoot->isChecked());
- Options::instance()->setDefaultLogin(ui->lineDefaultLogin->lineEdit()->text());
- Options::instance()->setAutoReconnectInterval(ui->spinAutoreconnectInterval->value());
- }
|