offer predefined URLs for some greader sites
This commit is contained in:
parent
279256c27d
commit
234d0b13c6
@ -4,6 +4,11 @@
|
|||||||
#define GREADER_UNLIMITED_BATCH_SIZE -1
|
#define GREADER_UNLIMITED_BATCH_SIZE -1
|
||||||
#define GREADER_DEFAULT_BATCH_SIZE 100
|
#define GREADER_DEFAULT_BATCH_SIZE 100
|
||||||
|
|
||||||
|
// URLs.
|
||||||
|
#define GREADER_URL_REEDAH "https://www.reedah.com"
|
||||||
|
#define GREADER_URL_TOR "https://theoldreader.com"
|
||||||
|
#define GREADER_URL_BAZQUX "https://bazqux.com"
|
||||||
|
|
||||||
// States.
|
// States.
|
||||||
|
|
||||||
// Means "unread" message.
|
// Means "unread" message.
|
||||||
|
@ -46,6 +46,7 @@ GreaderAccountDetails::GreaderAccountDetails(QWidget* parent) : QWidget(parent)
|
|||||||
connect(m_ui.m_txtPassword->lineEdit(), &BaseLineEdit::textChanged, this, &GreaderAccountDetails::onPasswordChanged);
|
connect(m_ui.m_txtPassword->lineEdit(), &BaseLineEdit::textChanged, this, &GreaderAccountDetails::onPasswordChanged);
|
||||||
connect(m_ui.m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &GreaderAccountDetails::onUsernameChanged);
|
connect(m_ui.m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &GreaderAccountDetails::onUsernameChanged);
|
||||||
connect(m_ui.m_txtUrl->lineEdit(), &BaseLineEdit::textChanged, this, &GreaderAccountDetails::onUrlChanged);
|
connect(m_ui.m_txtUrl->lineEdit(), &BaseLineEdit::textChanged, this, &GreaderAccountDetails::onUrlChanged);
|
||||||
|
connect(m_ui.m_cmbService, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &GreaderAccountDetails::fillPredefinedUrl);
|
||||||
|
|
||||||
setTabOrder(m_ui.m_cmbService, m_ui.m_txtUrl->lineEdit());
|
setTabOrder(m_ui.m_cmbService, m_ui.m_txtUrl->lineEdit());
|
||||||
setTabOrder(m_ui.m_txtUrl->lineEdit(), m_ui.m_spinLimitMessages);
|
setTabOrder(m_ui.m_txtUrl->lineEdit(), m_ui.m_spinLimitMessages);
|
||||||
@ -127,3 +128,24 @@ void GreaderAccountDetails::onUrlChanged() {
|
|||||||
m_ui.m_txtUrl->setStatus(WidgetWithStatus::StatusType::Ok, tr("URL is okay."));
|
m_ui.m_txtUrl->setStatus(WidgetWithStatus::StatusType::Ok, tr("URL is okay."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GreaderAccountDetails::fillPredefinedUrl() {
|
||||||
|
switch (service()) {
|
||||||
|
case GreaderServiceRoot::Service::Reedah:
|
||||||
|
m_ui.m_txtUrl->lineEdit()->setText(QSL(GREADER_URL_REEDAH));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GreaderServiceRoot::Service::Bazqux:
|
||||||
|
m_ui.m_txtUrl->lineEdit()->setText(QSL(GREADER_URL_BAZQUX));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GreaderServiceRoot::Service::TheOldReader:
|
||||||
|
m_ui.m_txtUrl->lineEdit()->setText(QSL(GREADER_URL_TOR));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
m_ui.m_txtUrl->lineEdit()->clear();
|
||||||
|
m_ui.m_txtUrl->setFocus();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -28,6 +28,7 @@ class GreaderAccountDetails : public QWidget {
|
|||||||
void onUsernameChanged();
|
void onUsernameChanged();
|
||||||
void onPasswordChanged();
|
void onPasswordChanged();
|
||||||
void onUrlChanged();
|
void onUrlChanged();
|
||||||
|
void fillPredefinedUrl();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::GreaderAccountDetails m_ui;
|
Ui::GreaderAccountDetails m_ui;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user