Some minor Adblock dialog fixes to make loading of it smoother.
This commit is contained in:
parent
5a3f25c295
commit
838420b573
src
gui
miscellaneous
network-web
@ -96,7 +96,6 @@ void FeedsView::updateAutoUpdateStatus() {
|
|||||||
if (!m_autoUpdateTimer->isActive()) {
|
if (!m_autoUpdateTimer->isActive()) {
|
||||||
m_autoUpdateTimer->setInterval(AUTO_UPDATE_INTERVAL);
|
m_autoUpdateTimer->setInterval(AUTO_UPDATE_INTERVAL);
|
||||||
m_autoUpdateTimer->start();
|
m_autoUpdateTimer->start();
|
||||||
|
|
||||||
qDebug("Auto-update timer started with interval %d.", m_autoUpdateTimer->interval());
|
qDebug("Auto-update timer started with interval %d.", m_autoUpdateTimer->interval());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
0
src/miscellaneous/autosaver.cpp
Normal file → Executable file
0
src/miscellaneous/autosaver.cpp
Normal file → Executable file
@ -69,9 +69,7 @@ QList<Language> Localization::installedLanguages() {
|
|||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
|
|
||||||
// Iterate all found language files.
|
// Iterate all found language files.
|
||||||
foreach (const QFileInfo &file, file_dir.entryInfoList(QStringList() << "rssguard-*.qm",
|
foreach (const QFileInfo &file, file_dir.entryInfoList(QStringList() << "rssguard-*.qm", QDir::Files, QDir::Name)) {
|
||||||
QDir::Files,
|
|
||||||
QDir::Name)) {
|
|
||||||
if (translator.load(file.absoluteFilePath())) {
|
if (translator.load(file.absoluteFilePath())) {
|
||||||
Language new_language;
|
Language new_language;
|
||||||
new_language.m_code = translator.translate("QObject", "LANG_ABBREV");
|
new_language.m_code = translator.translate("QObject", "LANG_ABBREV");
|
||||||
|
@ -180,19 +180,20 @@ void AdBlockDialog::learnAboutRules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AdBlockDialog::loadSubscriptions() {
|
void AdBlockDialog::loadSubscriptions() {
|
||||||
|
setEnabled(false);
|
||||||
for (int i = 0; i < m_ui->m_tabs->count(); ++i) {
|
for (int i = 0; i < m_ui->m_tabs->count(); ++i) {
|
||||||
qobject_cast<AdBlockTreeWidget*>(m_ui->m_tabs->widget(i))->refresh();
|
qobject_cast<AdBlockTreeWidget*>(m_ui->m_tabs->widget(i))->refresh();
|
||||||
}
|
}
|
||||||
|
setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdBlockDialog::load()
|
void AdBlockDialog::load() {
|
||||||
{
|
|
||||||
if (m_loaded || !m_ui->m_checkEnable->isChecked()) {
|
if (m_loaded || !m_ui->m_checkEnable->isChecked()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (AdBlockSubscription* subscription, m_manager->subscriptions()) {
|
foreach (AdBlockSubscription *subscription, m_manager->subscriptions()) {
|
||||||
AdBlockTreeWidget* tree = new AdBlockTreeWidget(subscription, m_ui->m_tabs);
|
AdBlockTreeWidget *tree = new AdBlockTreeWidget(subscription, m_ui->m_tabs);
|
||||||
m_ui->m_tabs->addTab(tree, subscription->title());
|
m_ui->m_tabs->addTab(tree, subscription->title());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,11 +205,10 @@ void AdBlockDialog::load()
|
|||||||
QTimer::singleShot(100, this, SLOT(loadSubscriptions()));
|
QTimer::singleShot(100, this, SLOT(loadSubscriptions()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdBlockDialog::closeEvent(QCloseEvent* ev)
|
void AdBlockDialog::closeEvent(QCloseEvent *event) {
|
||||||
{
|
|
||||||
if (m_ui->m_checkUseLimitedEasyList->isChecked() != m_useLimitedEasyList) {
|
if (m_ui->m_checkUseLimitedEasyList->isChecked() != m_useLimitedEasyList) {
|
||||||
m_manager->setUseLimitedEasyList(m_ui->m_checkUseLimitedEasyList->isChecked());
|
m_manager->setUseLimitedEasyList(m_ui->m_checkUseLimitedEasyList->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget::closeEvent(ev);
|
QWidget::closeEvent(event);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ class AdBlockDialog : public QDialog {
|
|||||||
void load();
|
void load();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent* ev);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupMenu();
|
void setupMenu();
|
||||||
|
@ -229,19 +229,19 @@ void AdBlockTreeWidget::refresh() {
|
|||||||
m_itemChangingBlock = true;
|
m_itemChangingBlock = true;
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
QFont boldFont;
|
QFont bold_font;
|
||||||
boldFont.setBold(true);
|
bold_font.setBold(true);
|
||||||
|
|
||||||
m_topItem = new QTreeWidgetItem(this);
|
m_topItem = new QTreeWidgetItem(this);
|
||||||
m_topItem->setText(0, m_subscription->title());
|
m_topItem->setText(0, m_subscription->title());
|
||||||
m_topItem->setFont(0, boldFont);
|
m_topItem->setFont(0, bold_font);
|
||||||
m_topItem->setExpanded(true);
|
m_topItem->setExpanded(true);
|
||||||
addTopLevelItem(m_topItem);
|
addTopLevelItem(m_topItem);
|
||||||
|
|
||||||
const QVector<AdBlockRule*> &allRules = m_subscription->allRules();
|
const QVector<AdBlockRule*> &all_rules = m_subscription->allRules();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
foreach (const AdBlockRule *rule, allRules) {
|
foreach (const AdBlockRule *rule, all_rules) {
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_topItem);
|
QTreeWidgetItem *item = new QTreeWidgetItem(m_topItem);
|
||||||
item->setText(0, rule->filter());
|
item->setText(0, rule->filter());
|
||||||
item->setData(0, Qt::UserRole + 10, index);
|
item->setData(0, Qt::UserRole + 10, index);
|
||||||
@ -252,6 +252,10 @@ void AdBlockTreeWidget::refresh() {
|
|||||||
|
|
||||||
adjustItemFeatures(item, rule);
|
adjustItemFeatures(item, rule);
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
|
if (index % 100 == 0) {
|
||||||
|
qApp->processEvents();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showRule(0);
|
showRule(0);
|
||||||
|
@ -87,7 +87,9 @@ void WebView::saveCurrentPageToFile() {
|
|||||||
QString selected_file;
|
QString selected_file;
|
||||||
QString implicit_file_base_name = tr("source_page");
|
QString implicit_file_base_name = tr("source_page");
|
||||||
|
|
||||||
if (qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::AlwaysPromptForFilename)).toBool()) {
|
// NOTE: It is good to always ask for destination here, since download manager
|
||||||
|
// is not displaying afterwards because this is *not* real download actually.
|
||||||
|
//if (qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::AlwaysPromptForFilename)).toBool()) {
|
||||||
QString filter_html = tr("HTML web pages (*.html)");
|
QString filter_html = tr("HTML web pages (*.html)");
|
||||||
|
|
||||||
QString filter;
|
QString filter;
|
||||||
@ -104,7 +106,7 @@ void WebView::saveCurrentPageToFile() {
|
|||||||
qApp->settings()->setValue(GROUP(Downloads), Downloads::TargetExplicitDirectory,
|
qApp->settings()->setValue(GROUP(Downloads), Downloads::TargetExplicitDirectory,
|
||||||
QDir::toNativeSeparators(QFileInfo(selected_file).absolutePath()));
|
QDir::toNativeSeparators(QFileInfo(selected_file).absolutePath()));
|
||||||
}
|
}
|
||||||
}
|
/*}
|
||||||
else {
|
else {
|
||||||
QString base_folder = qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::TargetDirectory)).toString();
|
QString base_folder = qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::TargetDirectory)).toString();
|
||||||
|
|
||||||
@ -124,7 +126,7 @@ void WebView::saveCurrentPageToFile() {
|
|||||||
|
|
||||||
selected_file = subsequent_file_name;
|
selected_file = subsequent_file_name;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (!selected_file.isEmpty()) {
|
if (!selected_file.isEmpty()) {
|
||||||
QFile selected_file_handle(selected_file);
|
QFile selected_file_handle(selected_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user