You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dialogoptions.cpp 1.1KB

12345678910111213141516171819202122232425262728293031
  1. #include "dialogoptions.h"
  2. #include "ui_dialogoptions.h"
  3. DialogOptions::DialogOptions(QWidget *parent) : QDialog(parent), ui(new Ui::DialogOptions)
  4. {
  5. ui->setupUi(this);
  6. foreach(EpiUser usr, Epimafia::loadUsers())
  7. if(!usr.isUnknown() && usr.hasLogin())
  8. ui->lineDefaultLogin->addItem(usr.getLogin());
  9. ui->checkAutoConnect->setChecked(Options::instance()->isAutoConnect());
  10. ui->checkStartAtBoot->setChecked(Options::instance()->startAtBoot());
  11. ui->lineDefaultLogin->lineEdit()->setText(Options::instance()->getDefaultLogin(false));
  12. ui->spinAutoreconnectInterval->setValue(Options::instance()->getAutoReconnectInterval());
  13. connect(this, SIGNAL(accepted()), this, SLOT(save()));
  14. }
  15. DialogOptions::~DialogOptions()
  16. {
  17. delete ui;
  18. }
  19. void DialogOptions::save()
  20. {
  21. Options::instance()->setAutoConnect(ui->checkAutoConnect->isChecked());
  22. Options::instance()->setStartAtBoot(ui->checkStartAtBoot->isChecked());
  23. Options::instance()->setDefaultLogin(ui->lineDefaultLogin->lineEdit()->text());
  24. Options::instance()->setAutoReconnectInterval(ui->spinAutoreconnectInterval->value());
  25. }