#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())); } 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()); }