diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index c46df3e8c..e46e1048a 100755 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -1,6 +1,10 @@ -3.0.1 +3.0.2 ————— +Changed: +▪ Some GUI refinements and fixes. +▪ Added more logging entries. + Fixed: ▪ Fixed problem with importing invalid OPML 2.0 files. (bug #145) diff --git a/src/core/feedsmodel.cpp b/src/core/feedsmodel.cpp index 2a2a3164d..e495f63d2 100755 --- a/src/core/feedsmodel.cpp +++ b/src/core/feedsmodel.cpp @@ -677,7 +677,7 @@ void FeedsModel::reloadWholeLayout() { emit layoutChanged(); } -bool FeedsModel::addServiceAccount(ServiceRoot *root) { +bool FeedsModel::addServiceAccount(ServiceRoot *root, bool freshly_activated) { int new_row_index = m_rootItem->childCount(); beginInsertRows(indexForItem(m_rootItem), new_row_index, new_row_index); @@ -692,7 +692,7 @@ bool FeedsModel::addServiceAccount(ServiceRoot *root) { connect(root, SIGNAL(reloadMessageListRequested(bool)), this, SIGNAL(reloadMessageListRequested(bool))); connect(root, SIGNAL(itemExpandRequested(QList,bool)), this, SIGNAL(itemExpandRequested(QList,bool))); - root->start(); + root->start(freshly_activated); return true; } @@ -731,7 +731,7 @@ void FeedsModel::loadActivatedServiceAccounts() { QList roots = entry_point->initializeSubtree(); foreach (ServiceRoot *root, roots) { - addServiceAccount(root); + addServiceAccount(root, false); } } diff --git a/src/core/feedsmodel.h b/src/core/feedsmodel.h index 6807b6709..605c92db6 100755 --- a/src/core/feedsmodel.h +++ b/src/core/feedsmodel.h @@ -146,7 +146,7 @@ class FeedsModel : public QAbstractItemModel { void updateFeeds(const QList &feeds); // Adds given service root account. - bool addServiceAccount(ServiceRoot *root); + bool addServiceAccount(ServiceRoot *root, bool freshly_activated); // Loads feed/categories from the database. void loadActivatedServiceAccounts(); diff --git a/src/gui/dialogs/formaddaccount.cpp b/src/gui/dialogs/formaddaccount.cpp index d191d9128..945a6d28e 100755 --- a/src/gui/dialogs/formaddaccount.cpp +++ b/src/gui/dialogs/formaddaccount.cpp @@ -56,7 +56,7 @@ void FormAddAccount::addSelectedAccount() { ServiceRoot *new_root = point->createNewRoot(); if (new_root != NULL) { - m_model->addServiceAccount(new_root); + m_model->addServiceAccount(new_root, true); } else { qCritical("Cannot create new account."); diff --git a/src/gui/dialogs/formmain.cpp b/src/gui/dialogs/formmain.cpp index 98e1b6c60..0ca48553a 100755 --- a/src/gui/dialogs/formmain.cpp +++ b/src/gui/dialogs/formmain.cpp @@ -197,6 +197,14 @@ void FormMain::updateAddItemMenu() { m_ui->m_menuAddItem->addMenu(root_menu); } + + if (m_ui->m_menuAddItem->isEmpty()) { + QAction *no_action = new QAction(qApp->icons()->fromTheme(QSL("dialog-error")), + tr("No accounts activated"), + m_ui->m_menuAddItem); + no_action->setEnabled(false); + m_ui->m_menuAddItem->addAction(no_action); + } } void FormMain::updateRecycleBinMenu() { diff --git a/src/services/abstract/serviceroot.h b/src/services/abstract/serviceroot.h index 55818e2f3..2ef26f714 100755 --- a/src/services/abstract/serviceroot.h +++ b/src/services/abstract/serviceroot.h @@ -78,7 +78,7 @@ class ServiceRoot : public RootItem { // // Stop method is called just before application exits OR when // user explicitly deletes existing service instance. - virtual void start() = 0; + virtual void start(bool freshly_activated) = 0; virtual void stop() = 0; // Returns the UNIQUE code of the given service. diff --git a/src/services/standard/standardserviceroot.cpp b/src/services/standard/standardserviceroot.cpp index d2ab9d2b2..5fd4019b5 100755 --- a/src/services/standard/standardserviceroot.cpp +++ b/src/services/standard/standardserviceroot.cpp @@ -61,13 +61,13 @@ StandardServiceRoot::~StandardServiceRoot() { qDeleteAll(m_feedContextMenu); } -void StandardServiceRoot::start() { +void StandardServiceRoot::start(bool freshly_activated) { loadFromDatabase(); - if (getSubTree(RootItemKind::Category | RootItemKind::Feed).isEmpty()) { + if (freshly_activated) { // In other words, if there are no feeds or categories added. if (MessageBox::show(qApp->mainForm(), QMessageBox::Question, QObject::tr("Load initial set of feeds"), - tr("You started %1 for the first time, now you can load initial set of feeds.").arg(APP_NAME), + tr("This account does not include any feeds. You can now add default set of feeds."), tr("Do you want to load initial set of feeds?"), QString(), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { QString target_opml_file = APP_INITIAL_FEEDS_PATH + QDir::separator() + FEED_INITIAL_OPML_PATTERN; diff --git a/src/services/standard/standardserviceroot.h b/src/services/standard/standardserviceroot.h index bf8eb71cd..48784611b 100755 --- a/src/services/standard/standardserviceroot.h +++ b/src/services/standard/standardserviceroot.h @@ -38,7 +38,7 @@ class StandardServiceRoot : public ServiceRoot { virtual ~StandardServiceRoot(); // Start/stop root. - void start(); + void start(bool freshly_activated); void stop(); QString code(); diff --git a/src/services/tt-rss/ttrssserviceroot.cpp b/src/services/tt-rss/ttrssserviceroot.cpp index 286565324..dce28c353 100755 --- a/src/services/tt-rss/ttrssserviceroot.cpp +++ b/src/services/tt-rss/ttrssserviceroot.cpp @@ -51,7 +51,9 @@ TtRssServiceRoot::~TtRssServiceRoot() { delete m_network; } -void TtRssServiceRoot::start() { +void TtRssServiceRoot::start(bool freshly_activated) { + Q_UNUSED(freshly_activated) + loadFromDatabase(); if (childCount() == 1 && child(0)->kind() == RootItemKind::Bin) { diff --git a/src/services/tt-rss/ttrssserviceroot.h b/src/services/tt-rss/ttrssserviceroot.h index 214029c88..9f70af5cf 100755 --- a/src/services/tt-rss/ttrssserviceroot.h +++ b/src/services/tt-rss/ttrssserviceroot.h @@ -35,7 +35,7 @@ class TtRssServiceRoot : public ServiceRoot { explicit TtRssServiceRoot(RootItem *parent = NULL); virtual ~TtRssServiceRoot(); - void start(); + void start(bool freshly_activated); void stop(); QString code();