FormEditAccount::FormEditAccount(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormEditAccount), m_editableRoot(nullptr) { m_ui->setupUi(this); m_btnOk = m_ui->m_buttonBox->button(QDialogButtonBox::Ok); setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint); setWindowIcon(qApp->icons()->fromTheme(QSL("tinytinyrss"))); m_ui->m_lblServerSideUpdateInformation->setText(tr("Leaving this option on causes that updates " "of feeds will be probably much slower and may time-out often.")); m_ui->m_lblDescription->setText(tr("Note that at least API level %1 is required.").arg(MINIMAL_API_LEVEL)); m_ui->m_txtHttpUsername->lineEdit()->setPlaceholderText(tr("HTTP authentication username")); m_ui->m_txtHttpPassword->lineEdit()->setPlaceholderText(tr("HTTP authentication password")); m_ui->m_txtPassword->lineEdit()->setPlaceholderText(tr("Password for your TT-RSS account")); m_ui->m_txtUsername->lineEdit()->setPlaceholderText(tr("Username for your TT-RSS account")); m_ui->m_txtUrl->lineEdit()->setPlaceholderText(tr("FULL URL of your TT-RSS instance WITH trailing \"/api/\" string")); m_ui->m_lblTestResult->setStatus(WidgetWithStatus::Information, tr("No test done yet."), tr("Here, results of connection test are shown.")); setTabOrder(m_ui->m_txtUrl->lineEdit(), m_ui->m_checkServerSideUpdate); setTabOrder(m_ui->m_checkServerSideUpdate, m_ui->m_txtUsername->lineEdit()); setTabOrder(m_ui->m_txtUsername->lineEdit(), m_ui->m_txtPassword->lineEdit()); setTabOrder(m_ui->m_txtPassword->lineEdit(), m_ui->m_checkShowPassword); setTabOrder(m_ui->m_checkShowPassword, m_ui->m_gbHttpAuthentication); setTabOrder(m_ui->m_gbHttpAuthentication, m_ui->m_txtHttpUsername->lineEdit()); setTabOrder(m_ui->m_txtHttpUsername->lineEdit(), m_ui->m_txtHttpPassword->lineEdit()); setTabOrder(m_ui->m_txtHttpPassword->lineEdit(), m_ui->m_checkShowHttpPassword); setTabOrder(m_ui->m_checkShowHttpPassword, m_ui->m_btnTestSetup); setTabOrder(m_ui->m_btnTestSetup, m_ui->m_buttonBox); connect(m_ui->m_checkShowPassword, SIGNAL(toggled(bool)), this, SLOT(displayPassword(bool))); connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(onClickedOk())); connect(m_ui->m_buttonBox, SIGNAL(rejected()), this, SLOT(onClickedCancel())); connect(m_ui->m_txtPassword->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onPasswordChanged())); connect(m_ui->m_txtUsername->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUsernameChanged())); connect(m_ui->m_txtHttpPassword->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onHttpPasswordChanged())); connect(m_ui->m_txtHttpUsername->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onHttpUsernameChanged())); connect(m_ui->m_txtUrl->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUrlChanged())); connect(m_ui->m_txtPassword->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(checkOkButton())); connect(m_ui->m_txtUsername->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(checkOkButton())); connect(m_ui->m_txtUrl->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(checkOkButton())); connect(m_ui->m_btnTestSetup, SIGNAL(clicked()), this, SLOT(performTest())); connect(m_ui->m_gbHttpAuthentication, SIGNAL(toggled(bool)), this, SLOT(onHttpPasswordChanged())); connect(m_ui->m_gbHttpAuthentication, SIGNAL(toggled(bool)), this, SLOT(onHttpUsernameChanged())); connect(m_ui->m_checkShowHttpPassword, SIGNAL(toggled(bool)), this, SLOT(displayHttpPassword(bool))); onPasswordChanged(); onUsernameChanged(); onUrlChanged(); onHttpPasswordChanged(); onHttpUsernameChanged(); checkOkButton(); displayPassword(false); displayHttpPassword(false); }
/*----------------------------------------------------------------------------*/ NewPasswordDialog::NewPasswordDialog(QWidget *parent) : QDialog(parent), ui(new Ui::NewPasswordDialog) { ui->setupUi(this); onPasswordChanged(); }
DatabaseConnectionDialog::DatabaseConnectionDialog(QWidget *parent) : QDialog(parent), ui(new Ui::DatabaseConnectionDialog) { ui->setupUi(this); this->setWindowTitle("Database connection"); try { defaultProperties = DatabaseProperties("./config/admin.xml"); currentProperties = new DatabaseProperties(defaultProperties); if(!currentProperties) { throw error::NullPointerException("DatabaseProperties::currentProperties", AT); } refreshDisplayedValues(); } catch(const QString& exception) { qDebug() << exception; } catch(const error::NullPointerException& exception) { qDebug() << exception.toString(); } connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(validDatabaseAndAccept())); connect(ui->hostEdit, SIGNAL(textChanged(QString)), this, SLOT(onHostValueChanged(QString))); connect(ui->portEdit, SIGNAL(textChanged(QString)), this, SLOT(onPortEditValueChanged(QString))); connect(ui->passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(onPasswordChanged(QString))); connect(ui->userEdit, SIGNAL(textChanged(QString)), this, SLOT(onUserNameChanged(QString))); connect(ui->databaseNameEdit, SIGNAL(textChanged(QString)), SLOT(onDatabaseNameChanged(QString))); connect(this, SIGNAL(propertiesValueChanged()), this, SLOT(onPropertiesValueChanged())); }
FormEditTtRssAccount::FormEditTtRssAccount(QWidget* parent) : QDialog(parent), m_ui(new Ui::FormEditTtRssAccount), m_editableRoot(nullptr) { m_ui->setupUi(this); m_btnOk = m_ui->m_buttonBox->button(QDialogButtonBox::Ok); GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("tinytinyrss"))); m_ui->m_lblTestResult->label()->setWordWrap(true); m_ui->m_lblServerSideUpdateInformation->setText(tr("Leaving this option on causes that updates " "of feeds will be probably much slower and may time-out often.")); m_ui->m_lblDescription->setText(tr("Note that at least API level %1 is required.").arg(TTRSS_MINIMAL_API_LEVEL)); m_ui->m_txtHttpUsername->lineEdit()->setPlaceholderText(tr("HTTP authentication username")); m_ui->m_txtHttpPassword->lineEdit()->setPlaceholderText(tr("HTTP authentication password")); m_ui->m_txtPassword->lineEdit()->setPlaceholderText(tr("Password for your TT-RSS account")); m_ui->m_txtUsername->lineEdit()->setPlaceholderText(tr("Username for your TT-RSS account")); m_ui->m_txtUrl->lineEdit()->setPlaceholderText(tr("URL of your TT-RSS instance WITHOUT trailing \"/api/\" string")); m_ui->m_lblTestResult->setStatus(WidgetWithStatus::Information, tr("No test done yet."), tr("Here, results of connection test are shown.")); GuiUtilities::setLabelAsNotice(*m_ui->m_lblDescription, false); GuiUtilities::setLabelAsNotice(*m_ui->m_lblServerSideUpdateInformation, false); setTabOrder(m_ui->m_txtUrl->lineEdit(), m_ui->m_checkServerSideUpdate); setTabOrder(m_ui->m_checkServerSideUpdate, m_ui->m_txtUsername->lineEdit()); setTabOrder(m_ui->m_txtUsername->lineEdit(), m_ui->m_txtPassword->lineEdit()); setTabOrder(m_ui->m_txtPassword->lineEdit(), m_ui->m_checkShowPassword); setTabOrder(m_ui->m_checkShowPassword, m_ui->m_gbHttpAuthentication); setTabOrder(m_ui->m_gbHttpAuthentication, m_ui->m_txtHttpUsername->lineEdit()); setTabOrder(m_ui->m_txtHttpUsername->lineEdit(), m_ui->m_txtHttpPassword->lineEdit()); setTabOrder(m_ui->m_txtHttpPassword->lineEdit(), m_ui->m_checkShowHttpPassword); setTabOrder(m_ui->m_checkShowHttpPassword, m_ui->m_btnTestSetup); setTabOrder(m_ui->m_btnTestSetup, m_ui->m_buttonBox); connect(m_ui->m_checkShowPassword, &QCheckBox::toggled, this, &FormEditTtRssAccount::displayPassword); connect(m_ui->m_buttonBox, &QDialogButtonBox::accepted, this, &FormEditTtRssAccount::onClickedOk); connect(m_ui->m_buttonBox, &QDialogButtonBox::rejected, this, &FormEditTtRssAccount::onClickedCancel); connect(m_ui->m_txtPassword->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::onPasswordChanged); connect(m_ui->m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::onUsernameChanged); connect(m_ui->m_txtHttpPassword->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::onHttpPasswordChanged); connect(m_ui->m_txtHttpUsername->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::onHttpUsernameChanged); connect(m_ui->m_txtUrl->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::onUrlChanged); connect(m_ui->m_txtPassword->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::checkOkButton); connect(m_ui->m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::checkOkButton); connect(m_ui->m_txtUrl->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditTtRssAccount::checkOkButton); connect(m_ui->m_btnTestSetup, &QPushButton::clicked, this, &FormEditTtRssAccount::performTest); connect(m_ui->m_gbHttpAuthentication, &QGroupBox::toggled, this, &FormEditTtRssAccount::onHttpPasswordChanged); connect(m_ui->m_gbHttpAuthentication, &QGroupBox::toggled, this, &FormEditTtRssAccount::onHttpUsernameChanged); connect(m_ui->m_checkShowHttpPassword, &QCheckBox::toggled, this, &FormEditTtRssAccount::displayHttpPassword); onPasswordChanged(); onUsernameChanged(); onUrlChanged(); onHttpPasswordChanged(); onHttpUsernameChanged(); checkOkButton(); displayPassword(false); displayHttpPassword(false); }
FormEditOwnCloudAccount::FormEditOwnCloudAccount(QWidget* parent) : QDialog(parent), m_ui(new Ui::FormEditOwnCloudAccount), m_editableRoot(nullptr) { m_ui->setupUi(this); m_btnOk = m_ui->m_buttonBox->button(QDialogButtonBox::Ok); GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("owncloud"))); m_ui->m_lblTestResult->label()->setWordWrap(true); m_ui->m_lblServerSideUpdateInformation->setText(tr("Leaving this option on causes that updates " "of feeds will be probably much slower and may time-out often.")); m_ui->m_lblDescription->setText(tr("Note that at least version %1 is required.").arg(OWNCLOUD_MIN_VERSION)); m_ui->m_txtPassword->lineEdit()->setPlaceholderText(tr("Password for your ownCloud account")); m_ui->m_txtUsername->lineEdit()->setPlaceholderText(tr("Username for your ownCloud account")); m_ui->m_txtUrl->lineEdit()->setPlaceholderText(tr("URL of your ownCloud server, without any API path")); m_ui->m_lblTestResult->setStatus(WidgetWithStatus::Information, tr("No test done yet."), tr("Here, results of connection test are shown.")); m_ui->m_lblLimitMessages->setText( tr("Limiting number of downloaded messages per feed makes updating of feeds faster but if your feed contains " "bigger number of messages than specified limit, then some messages might not be downloaded during feed update.")); connect(m_ui->m_spinLimitMessages, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [=](int value) { if (value <= 0) { m_ui->m_spinLimitMessages->setSuffix(QSL(" ") + tr("= unlimited")); } else { m_ui->m_spinLimitMessages->setSuffix(QSL(" ") + tr("messages")); } }); GuiUtilities::setLabelAsNotice(*m_ui->m_lblLimitMessages, false); GuiUtilities::setLabelAsNotice(*m_ui->m_lblServerSideUpdateInformation, false); GuiUtilities::setLabelAsNotice(*m_ui->m_lblDescription, false); setTabOrder(m_ui->m_txtUrl->lineEdit(), m_ui->m_checkServerSideUpdate); setTabOrder(m_ui->m_checkServerSideUpdate, m_ui->m_spinLimitMessages); setTabOrder(m_ui->m_spinLimitMessages, m_ui->m_txtUsername->lineEdit()); setTabOrder(m_ui->m_txtUsername->lineEdit(), m_ui->m_txtPassword->lineEdit()); setTabOrder(m_ui->m_txtPassword->lineEdit(), m_ui->m_checkShowPassword); setTabOrder(m_ui->m_checkShowPassword, m_ui->m_btnTestSetup); setTabOrder(m_ui->m_btnTestSetup, m_ui->m_buttonBox); connect(m_ui->m_checkShowPassword, &QCheckBox::toggled, this, &FormEditOwnCloudAccount::displayPassword); connect(m_ui->m_buttonBox, &QDialogButtonBox::accepted, this, &FormEditOwnCloudAccount::onClickedOk); connect(m_ui->m_buttonBox, &QDialogButtonBox::rejected, this, &FormEditOwnCloudAccount::onClickedCancel); connect(m_ui->m_txtPassword->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditOwnCloudAccount::onPasswordChanged); connect(m_ui->m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditOwnCloudAccount::onUsernameChanged); connect(m_ui->m_txtUrl->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditOwnCloudAccount::onUrlChanged); connect(m_ui->m_txtPassword->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditOwnCloudAccount::checkOkButton); connect(m_ui->m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditOwnCloudAccount::checkOkButton); connect(m_ui->m_txtUrl->lineEdit(), &BaseLineEdit::textChanged, this, &FormEditOwnCloudAccount::checkOkButton); connect(m_ui->m_btnTestSetup, &QPushButton::clicked, this, &FormEditOwnCloudAccount::performTest); onPasswordChanged(); onUsernameChanged(); onUrlChanged(); checkOkButton(); displayPassword(false); }
FormFeedDetails::FormFeedDetails(ServiceRoot *service_root, QWidget *parent) : QDialog(parent), m_editableFeed(nullptr), m_serviceRoot(service_root) { initialize(); createConnections(); // Initialize that shit. onTitleChanged(QString()); onDescriptionChanged(QString()); onUrlChanged(QString()); onUsernameChanged(QString()); onPasswordChanged(QString()); }
void FormFeedDetails::createConnections() { // General connections. connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(apply())); connect(m_ui->m_txtTitle->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onTitleChanged(QString))); connect(m_ui->m_txtDescription->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onDescriptionChanged(QString))); connect(m_ui->m_txtUrl->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUrlChanged(QString))); connect(m_ui->m_txtUsername->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUsernameChanged(QString))); connect(m_ui->m_txtPassword->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onPasswordChanged(QString))); connect(m_ui->m_gbAuthentication, SIGNAL(toggled(bool)), this, SLOT(onAuthenticationSwitched())); connect(m_ui->m_cmbAutoUpdateType, SIGNAL(currentIndexChanged(int)), this, SLOT(onAutoUpdateTypeChanged(int))); connect(m_ui->m_btnFetchMetadata, SIGNAL(clicked()), this, SLOT(guessFeed())); // Icon connections. connect(m_actionFetchIcon, SIGNAL(triggered()), this, SLOT(guessIconOnly())); connect(m_actionLoadIconFromFile, SIGNAL(triggered()), this, SLOT(onLoadIconFromFile())); connect(m_actionNoIcon, SIGNAL(triggered()), this, SLOT(onNoIconSelected())); connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon())); }
GeneralSettingsPage::GeneralSettingsPage(QWidget *parent) : SettingsPage(parent), m_passwordModel(new ArchivePasswordModel(this)), m_pathEdit(new QLineEdit(this)), m_commandEdit(new QLineEdit(this)), m_passwordEdit(new QLineEdit(this)), m_pathButton(new QPushButton(QIcon::fromTheme("document-open"), tr("&Browse"), this)), m_passwordButton(new QPushButton(QIcon::fromTheme("list-add"), tr("&Add"), this)), m_concurrentSpinBox(new QSpinBox(this)), m_commandCheckBox(new QCheckBox(tr("&Enable custom command"), this)), m_extractCheckBox(new QCheckBox(tr("&Extract archives"), this)), m_deleteCheckBox(new QCheckBox(tr("&Delete extracted archives"), this)), m_passwordView(new QListView(this)), m_layout(new QFormLayout(this)) { setWindowTitle(tr("General")); m_passwordButton->setEnabled(false); m_concurrentSpinBox->setRange(1, MAX_CONCURRENT_TRANSFERS); m_passwordView->setModel(m_passwordModel); m_passwordView->setContextMenuPolicy(Qt::CustomContextMenu); m_layout->addRow(tr("Download &path:"), m_pathEdit); m_layout->addWidget(m_pathButton); m_layout->addRow(tr("&Maximum concurrent downloads:"), m_concurrentSpinBox); m_layout->addRow(tr("&Custom command (%f for filename):"), m_commandEdit); m_layout->addRow(m_commandCheckBox); m_layout->addRow(m_extractCheckBox); m_layout->addRow(m_deleteCheckBox); m_layout->addRow(new QLabel(tr("Archive passwords:"), this)); m_layout->addRow(m_passwordView); m_layout->addRow(tr("Add &password:"), m_passwordEdit); m_layout->addWidget(m_passwordButton); connect(m_passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(onPasswordChanged(QString))); connect(m_passwordEdit, SIGNAL(returnPressed()), m_passwordButton, SLOT(animateClick())); connect(m_pathButton, SIGNAL(clicked()), this, SLOT(showFileDialog())); connect(m_passwordButton, SIGNAL(clicked()), this, SLOT(addPassword())); connect(m_passwordView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showPasswordContextMenu(QPoint))); restore(); }
void FormFeedDetails::onAuthenticationSwitched() { onUsernameChanged(m_ui->m_txtUsername->lineEdit()->text()); onPasswordChanged(m_ui->m_txtPassword->lineEdit()->text()); }