| 25 | extern Global global; |
| 26 | |
| 27 | SyncPreferences::SyncPreferences(QWidget *parent) : |
| 28 | QWidget(parent) |
| 29 | { |
| 30 | this->setFont(global.getGuiFont(font())); |
| 31 | QGridLayout *mainLayout = new QGridLayout(this); |
| 32 | setLayout(mainLayout); |
| 33 | |
| 34 | syncAutomatically = new QCheckBox(tr("Sync automatically"), this); |
| 35 | syncAutomatically->setChecked(true); |
| 36 | |
| 37 | syncInterval = new QComboBox(this); |
| 38 | syncInterval->addItem(tr("Every 15 minutes"), 15); |
| 39 | syncInterval->addItem(tr("Every 30 minutes"), 30); |
| 40 | syncInterval->addItem(tr("Every hour"), 60); |
| 41 | syncInterval->addItem(tr("Every day"), 1440); |
| 42 | |
| 43 | syncOnStartup = new QCheckBox(tr("Sync on startup"), this); |
| 44 | //syncOnStartup->setEnabled(false); |
| 45 | syncOnShutdown = new QCheckBox(tr("Sync on shutdown"),this); |
| 46 | //syncOnShutdown->setEnabled(false); |
| 47 | enableSyncNotifications = new QCheckBox(tr("Enable sync notifications"), this); |
| 48 | showGoodSyncMessagesInTray = new QCheckBox(tr("Show successful syncs"), this); |
| 49 | apiRateRestart = new QCheckBox(tr("Restart sync on API limit (experimental)"), this); |
| 50 | |
| 51 | enableProxy = new QCheckBox(tr("Enable Proxy*"), this); |
| 52 | enableSocks5 = new QCheckBox(tr("Enable Socks5"),this); |
| 53 | QLabel *hostLabel = new QLabel(tr("Proxy Hostname"), this); |
| 54 | QLabel *portLabel = new QLabel(tr("Proxy Port"), this); |
| 55 | QLabel *userLabel = new QLabel(tr("Proxy Username"), this); |
| 56 | QLabel *passwordLabel = new QLabel(tr("Proxy Password"),this); |
| 57 | QLabel *restartLabel = new QLabel(tr("*Note: Restart required"),this); |
| 58 | |
| 59 | host = new QLineEdit(this); |
| 60 | port = new QLineEdit(this); |
| 61 | userId = new QLineEdit(this); |
| 62 | password = new QLineEdit(this); |
| 63 | |
| 64 | enableProxy->setChecked(global.isProxyEnabled()); |
| 65 | enableSocks5->setChecked(global.isSocks5Enabled()); |
| 66 | host->setText(global.getProxyHost()); |
| 67 | port->setText(QString::number(global.getProxyPort())); |
| 68 | port->setInputMask("00000"); |
| 69 | userId->setText(global.getProxyUserid()); |
| 70 | password->setText(global.getProxyPassword()); |
| 71 | password->setEchoMode(QLineEdit::Password); |
| 72 | |
| 73 | popupOnSyncError = new QCheckBox(tr("Popup message on sync errors."),0); |
| 74 | popupOnSyncError->setChecked(global.popupOnSyncError()); |
| 75 | |
| 76 | mainLayout->addWidget(enableSyncNotifications,0,0); |
| 77 | mainLayout->addWidget(showGoodSyncMessagesInTray, 0,1); |
| 78 | mainLayout->addWidget(syncOnStartup,1,0); |
| 79 | mainLayout->addWidget(popupOnSyncError, 1,1); |
| 80 | mainLayout->addWidget(syncOnShutdown,2,0); |
| 81 | mainLayout->addWidget(syncAutomatically,3,0); |
| 82 | mainLayout->addWidget(syncInterval, 3,1); |
| 83 | mainLayout->addWidget(apiRateRestart, 4,0); |
| 84 |
nothing calls this directly
no test coverage detected