Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

dialogoptions.cpp 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  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. #ifndef Q_OS_WIN
  15. ui->checkStartAtBoot->hide();
  16. ui->label->hide();
  17. #endif
  18. }
  19. DialogOptions::~DialogOptions()
  20. {
  21. delete ui;
  22. }
  23. void DialogOptions::save()
  24. {
  25. Options::instance()->setAutoConnect(ui->checkAutoConnect->isChecked());
  26. Options::instance()->setStartAtBoot(ui->checkStartAtBoot->isChecked());
  27. Options::instance()->setDefaultLogin(ui->lineDefaultLogin->lineEdit()->text());
  28. Options::instance()->setAutoReconnectInterval(ui->spinAutoreconnectInterval->value());
  29. }