forked from bitshares/bitshares1-qtwallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBitSharesApp.hpp
43 lines (33 loc) · 1.11 KB
/
BitSharesApp.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include <fc/exception/exception.hpp>
#include <QApplication>
class ClientWrapper;
class Html5Viewer;
class MainWindow;
class QSplashScreen;
class QLocalServer;
/** Subclass needed to reimplement 'notify' method and catch unknown exceptions.
*/
class BitSharesApp : protected QApplication
{
Q_OBJECT
public:
/** Builds & starts the app.
When this function completes it also destroys application object.
*/
static int run(int& argc, char** argv);
private:
BitSharesApp(int& argc, char** argv);
virtual ~BitSharesApp();
int run();
void prepareStartupSequence(ClientWrapper* client, Html5Viewer* viewer, MainWindow* mainWindow, QSplashScreen* splash);
QLocalServer* startSingleInstanceServer(MainWindow* mainWindow);
void onExceptionCaught(const fc::exception& e);
void onUnknownExceptionCaught();
void displayFailureInfo(const std::string& detail);
/// Overrided from QApplication to catch all exceptions.
virtual bool notify(QObject * receiver, QEvent * e) override;
/// Class attributes;
private:
static BitSharesApp* _instance;
};