Move some code to lib.
This commit is contained in:
parent
bdc324018a
commit
db4d07afaa
3 changed files with 13 additions and 14 deletions
11
src/librssguard/miscellaneous/application.cpp
Normal file → Executable file
11
src/librssguard/miscellaneous/application.cpp
Normal file → Executable file
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "dynamic-shortcuts/dynamicshortcuts.h"
|
||||
#include "exceptions/applicationexception.h"
|
||||
#include "gui/dialogs/formabout.h"
|
||||
#include "gui/dialogs/formmain.h"
|
||||
#include "gui/feedmessageviewer.h"
|
||||
#include "gui/feedsview.h"
|
||||
|
@ -111,6 +112,16 @@ void Application::showPolls() const {
|
|||
}
|
||||
}
|
||||
|
||||
void Application::offerChanges() const {
|
||||
if (isFirstRun() || isFirstRun(APP_VERSION)) {
|
||||
qApp->showGuiMessage(QSL(APP_NAME), QObject::tr("Welcome to %1.\n\nPlease, check NEW stuff included in this\n"
|
||||
"version by clicking this popup notification.").arg(APP_LONG_NAME),
|
||||
QSystemTrayIcon::NoIcon, nullptr, false, [] {
|
||||
FormAbout(qApp->mainForm()).exec();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bool Application::isAlreadyRunning() {
|
||||
return sendMessage((QStringList() << APP_IS_RUNNING << Application::arguments().mid(1)).join(ARGUMENTS_LIST_SEPARATOR));
|
||||
}
|
||||
|
|
1
src/librssguard/miscellaneous/application.h
Normal file → Executable file
1
src/librssguard/miscellaneous/application.h
Normal file → Executable file
|
@ -50,6 +50,7 @@ class RSSGUARD_DLLSPEC Application : public QtSingleApplication {
|
|||
void hideOrShowMainForm();
|
||||
void loadDynamicShortcuts();
|
||||
void showPolls() const;
|
||||
void offerChanges() const;
|
||||
|
||||
bool isAlreadyRunning();
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "core/feedsmodel.h"
|
||||
#include "definitions/definitions.h"
|
||||
#include "gui/dialogs/formabout.h"
|
||||
#include "gui/dialogs/formmain.h"
|
||||
#include "gui/feedmessageviewer.h"
|
||||
#include "gui/feedsview.h"
|
||||
|
@ -75,27 +74,15 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
qApp->reactOnForeignNotifications();
|
||||
|
||||
// Instantiate main application window.
|
||||
FormMain main_window;
|
||||
|
||||
qApp->loadDynamicShortcuts();
|
||||
qApp->hideOrShowMainForm();
|
||||
qApp->showTrayIcon();
|
||||
|
||||
// Load activated accounts.
|
||||
qApp->feedReader()->feedsModel()->loadActivatedServiceAccounts();
|
||||
|
||||
if (qApp->isFirstRun() || qApp->isFirstRun(APP_VERSION)) {
|
||||
qApp->showGuiMessage(QSL(APP_NAME), QObject::tr("Welcome to %1.\n\nPlease, check NEW stuff included in this\n"
|
||||
"version by clicking this popup notification.").arg(APP_LONG_NAME),
|
||||
QSystemTrayIcon::NoIcon, nullptr, false, [] {
|
||||
FormAbout(qApp->mainForm()).exec();
|
||||
});
|
||||
}
|
||||
|
||||
qApp->offerChanges();
|
||||
qApp->showPolls();
|
||||
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->loadAllExpandStates();
|
||||
|
||||
// Enter global event loop.
|
||||
return Application::exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue