-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDactApplication.hh
119 lines (99 loc) · 2.77 KB
/
DactApplication.hh
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef DACTAPPLICATION_H
#define DACTAPPLICATION_H
#include <QApplication>
#include <QMenuBar>
#include <QScopedPointer>
#include <QStandardItemModel>
#include <QStringList>
#include <QUrl>
#include "config.hh"
#include "AboutWindow.hh"
#include "MainWindow.hh"
#include "PreferencesWindow.hh"
#ifdef USE_REMOTE_CORPUS
#include <RemoteWindow.hh>
#endif // USE_REMOTE_CORPUS
#ifdef USE_WEBSERVICE
#include "WebserviceWindow.hh"
#endif // USE_WEBSERVICE
class DactApplication: public QApplication
{
Q_OBJECT
public:
DactApplication(int &argc, char** argv);
QStandardItemModel *historyModel();
void init();
void openCorpora(QStringList const &fileNames);
void openMacros(QStringList const &fileNames);
void openUrl(QUrl const &url);
int exec();
signals:
void colorPreferencesChanged();
public slots:
/*!
Clear the query history
*/
void clearHistory();
/*!
Convert a compact corpus to a Dact corpus.
*/
void convertCompactCorpus();
/*!
Convert a directory corpus to a Dact corpus.
*/
void convertDirectoryCorpus();
void openCookbook();
void openCorpus(QString const &filename);
/*!
Opens manual in the default webbrowser.
*/
void openHelp();
void showAboutWindow();
void showOpenCorpus();
/*!
Raises the PreferencesWindow.
*/
void showPreferencesWindow();
#ifdef USE_REMOTE_CORPUS
/*!
Instantiate (if not already instantiated) and raise the remote window.
*/
void showRemoteWindow();
#endif // USE_REMOTE_CORPUS
#ifdef USE_WEBSERVICE
/*!
Instantiate (if not already instantiated) and raise the Alpinowebservice query window.
*/
void showWebserviceWindow();
#endif // USE_WEBSERVICE
protected:
bool event(QEvent *event);
private slots:
void emitColorPreferencesChanged();
void prepareQuit();
/*!
Used when starting Dact, does not show the dialog if a corpus was provided
as a command-line argument.
*/
void showOpenCorpusLaunch();
private:
void convertCorpus(QString const &path);
void _openCorpora(QStringList const &fileNames);
void _openMacros(QStringList const &fileNames);
void _openUrl(QUrl const &url);
void readHistory(QString const &settingsKey);
void writeHistory(QString const &settingsKey);
bool d_dactStartedWithCorpus;
QStringList d_argMacros;
QScopedPointer<QStandardItemModel> d_historyModel;
QScopedPointer<QMenuBar> d_menu;
QScopedPointer<AboutWindow> d_aboutWindow;
#ifdef USE_REMOTE_CORPUS
QScopedPointer<RemoteWindow> d_remoteWindow;
#endif // USE_REMOTE_CORPUS
#ifdef USE_WEBSERVICE
QScopedPointer<WebserviceWindow> d_webserviceWindow;
#endif // USE_WEBSERVICE
QScopedPointer<PreferencesWindow> d_preferencesWindow;
};
#endif