mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
[AdBlock] Add "Other..." entry in AddSubscription dialog
To make it less confusing how to add a subscription that is not listed in known subscriptions.
This commit is contained in:
parent
5b6db60605
commit
c4e0646915
@ -43,7 +43,8 @@ AdBlockAddSubscriptionDialog::AdBlockAddSubscriptionDialog(QWidget* parent)
|
||||
<< Subscription("Antisocial (English)", "http://adversity.googlecode.com/hg/Antisocial.txt")
|
||||
<< Subscription("RU Adlist (Russian)", "https://ruadlist.googlecode.com/hg/advblock.txt")
|
||||
<< Subscription("ABPindo (Indonesian)", "https://indonesianadblockrules.googlecode.com/hg/subscriptions/abpindo.txt")
|
||||
<< Subscription("ChinaList (Chinese)", "http://adblock-chinalist.googlecode.com/svn/trunk/adblock.txt");
|
||||
<< Subscription("ChinaList (Chinese)", "http://adblock-chinalist.googlecode.com/svn/trunk/adblock.txt")
|
||||
<< Subscription(tr("Other..."), QString());
|
||||
|
||||
foreach (const Subscription &subscription, m_knownSubscriptions) {
|
||||
ui->comboBox->addItem(subscription.title);
|
||||
@ -67,6 +68,12 @@ void AdBlockAddSubscriptionDialog::indexChanged(int index)
|
||||
{
|
||||
const Subscription subscription = m_knownSubscriptions.at(index);
|
||||
|
||||
// "Other..." entry
|
||||
if (subscription.url.isEmpty()) {
|
||||
ui->title->clear();
|
||||
ui->url->clear();
|
||||
}
|
||||
else {
|
||||
int pos = subscription.title.indexOf(QLatin1Char('('));
|
||||
QString title = subscription.title;
|
||||
|
||||
@ -79,6 +86,7 @@ void AdBlockAddSubscriptionDialog::indexChanged(int index)
|
||||
|
||||
ui->url->setText(subscription.url);
|
||||
ui->url->setCursorPosition(0);
|
||||
}
|
||||
}
|
||||
|
||||
AdBlockAddSubscriptionDialog::~AdBlockAddSubscriptionDialog()
|
||||
|
Loading…
Reference in New Issue
Block a user