Display new acc dialog when launched with no existing accs.

This commit is contained in:
Martin Rotter 2017-09-26 09:30:56 +02:00
parent 1e85c26961
commit 53e08f6368
3 changed files with 10 additions and 8 deletions

View File

@ -19,6 +19,7 @@
#include "core/feedsmodel.h" #include "core/feedsmodel.h"
#include "definitions/definitions.h" #include "definitions/definitions.h"
#include "gui/dialogs/formmain.h"
#include "miscellaneous/databasefactory.h" #include "miscellaneous/databasefactory.h"
#include "miscellaneous/feedreader.h" #include "miscellaneous/feedreader.h"
#include "miscellaneous/iconfactory.h" #include "miscellaneous/iconfactory.h"
@ -94,7 +95,7 @@ QStringList FeedsModel::mimeTypes() const {
} }
bool FeedsModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, bool FeedsModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column,
const QModelIndex& parent) { const QModelIndex& parent) {
Q_UNUSED(row) Q_UNUSED(row)
Q_UNUSED(column) Q_UNUSED(column)
@ -539,8 +540,8 @@ void FeedsModel::loadActivatedServiceAccounts() {
} }
if (serviceRoots().isEmpty()) { if (serviceRoots().isEmpty()) {
QTimer::singleShot(2000, [this]() { QTimer::singleShot(3000, [this]() {
addServiceAccount(StandardServiceEntryPoint().createNewRoot(), true); qApp->mainForm()->showAddAccountDialog();
}); });
} }
} }

View File

@ -64,7 +64,7 @@ class FeedsModel : public QAbstractItemModel {
// Returns all activated service roots. // Returns all activated service roots.
// NOTE: Service root nodes are lying directly UNDER // NOTE: Service root nodes are lying directly UNDER
// the model root item. // the model root item.
QList<ServiceRoot*>serviceRoots() const; QList<ServiceRoot*> serviceRoots() const;
// Determines if there is any account activated from given entry point. // Determines if there is any account activated from given entry point.
bool containsServiceRootFromEntryPoint(const ServiceEntryPoint* point) const; bool containsServiceRootFromEntryPoint(const ServiceEntryPoint* point) const;
@ -79,15 +79,15 @@ class FeedsModel : public QAbstractItemModel {
// so feeds with "default" auto-update strategy should be updated. // so feeds with "default" auto-update strategy should be updated.
// //
// This method might change some properties of some feeds. // This method might change some properties of some feeds.
QList<Feed*>feedsForScheduledUpdate(bool auto_update_now); QList<Feed*> feedsForScheduledUpdate(bool auto_update_now);
// Returns (undeleted) messages for given feeds. // Returns (undeleted) messages for given feeds.
// This is usually used for displaying whole feeds // This is usually used for displaying whole feeds
// in "newspaper" mode. // in "newspaper" mode.
QList<Message>messagesForItem(RootItem* item) const; QList<Message> messagesForItem(RootItem* item) const;
// Returns ALL RECURSIVE CHILD feeds contained within single index. // Returns ALL RECURSIVE CHILD feeds contained within single index.
QList<Feed*>feedsForIndex(const QModelIndex& index) const; QList<Feed*> feedsForIndex(const QModelIndex& index) const;
// Returns feed/category which lies at the specified index or // Returns feed/category which lies at the specified index or
// root item if index is invalid. // root item if index is invalid.

View File

@ -67,6 +67,8 @@ class FormMain : public QMainWindow {
// Turns on/off fullscreen mode // Turns on/off fullscreen mode
void switchFullscreenMode(); void switchFullscreenMode();
void showAddAccountDialog();
private slots: private slots:
void updateAddItemMenu(); void updateAddItemMenu();
void updateRecycleBinMenu(); void updateRecycleBinMenu();
@ -83,7 +85,6 @@ class FormMain : public QMainWindow {
void backupDatabaseSettings(); void backupDatabaseSettings();
void restoreDatabaseSettings(); void restoreDatabaseSettings();
void showWiki(); void showWiki();
void showAddAccountDialog();
void showDbCleanupAssistant(); void showDbCleanupAssistant();
void reportABug(); void reportABug();
void donate(); void donate();