This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDolmenApp.h
207 lines (187 loc) · 6.07 KB
/
DolmenApp.h
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/*
* DolmenApp.h
*
* Copyright (C) 2010-2017 Julien Eychenne
*
* This file is part of Dolmen.
*
* Dolmen is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License (GPL) as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* Dolmen is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dolmen. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Julien Eychenne
* Purpose: Main app
* Created: September 2010
*/
#ifndef DOLMENAPP_H
#define DOLMENAPP_H
#include <QMainWindow>
#include <QVBoxLayout>
#include <QSplitter>
#include <QSizePolicy>
#include <QMessageBox>
#include <QSpacerItem>
#include <QPushButton>
#include <QSet>
#include <QString>
#include <QToolBar>
#include <QTime>
#include <QProgressDialog>
#include <QProcess>
//#include <QtPlugin>
#include "lib/Project.h"
#include "lib/Plugin.h"
#include "lib/SqlDatabase.h"
#include "lib/ZipArchive.h"
#include "utils/routines.h"
#include "utils/Global.h"
#include "search/QueryParser.h"
#include "gui/FileSidebar.h"
#include "gui/MetadataSidebar.h"
#include "gui/CorpusBrowser.h"
#include "gui/BookmarkBrowser.h"
#include "gui/Viewer.h"
#include "gui/BottomPane.h"
#include "gui/MainMenu.h"
#include "gui/actions.h"
#include "gui/QueryView.h"
#include "gui/SearchWindow.h"
#include "gui/splitters.h"
#include "gui/PreferenceEditor.h"
#include "gui/GaugeDialog.h"
#include "gui/GaugeView.h"
#include "gui/AnnotationView.h"
#include "runtime/PluginHandler.h"
//#ifdef Q_OS_WIN
//Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
//#endif
class DolmenApp : public QMainWindow
{
Q_OBJECT
public:
DolmenApp(sol::state_view lua, QString m_version, QWidget *parent = 0, const QString project = QString());
~DolmenApp();
public slots:
void onMainSearchClicked();
void onMainSearchClicked(Grammar *grammar);
void warnUser(QString msg);
void displayQuery(Query *);
void closeEvent(QCloseEvent *);
void askPath(DFile *);
void displayImportProgressBar(int);
void updateImportProgressBar(int);
void loadQuery(const QString &);
void forwardQuery(int);
// Since Dolmen 2.0, output and error messages are redirected to the status bar
void output(const QString &text);
void error(const QString &text);
void about();
void license();
void acknowledgements();
void editPreferences();
void openDocumentation();
void onOpenProject();
void onAddFiles();
signals:
void app_saveFileWithPath(DFile *, const QString &);
void app_openProject();
private slots:
void onFileBrowserDoubleClicked();
void closeCurrentView();
void openRecentProject();
void editProject();
void updatePreferences();
void enableProjectActions(); // enable actions such as "Save project...", "Open query..."
void openLastProject();
void setGlobalProjectPath(QString);
void clearRecentProjects();
void cleanUpProcess();
void displaySupportedAudioFormats();
void toggleFileBrowser();
void toggleBottomTabs();
void toggleMetadata();
void toggleStatusBar();
void compareSpeakers();
void openGaugeView(const QString &task, int tier_no);
void openAnnotationMatch(Annotation *a, int tier, double tstart, double tend);
void installUserPlugin();
void importMetadata(const QString &path);
void onExtendConcMenu();
void onGoToWebsite();
void runLastQuery();
private:
QWidget *root_widget, *wgt_browser_bar;
QVBoxLayout *vlayout_browser_bar;
Splitter *hsplitter, *vsplitter, *view_splitter;
QToolBar *m_toolbar;
QMenu *projects_submenu;
QProgressDialog *import_progress;
QString m_version;
FileSidebar *m_sidebar;
CorpusBrowser *corpus_browser;
BookmarkBrowser *bookmark_browser;
ScriptBrowser *script_browser;
Viewer *viewer;
BottomPane *m_tabs_bottom;
PreferenceEditor *prefs_editor;
MetadataSideBar *metadata_widget;
MainMenu *menu;
QMenu *file_menu, *search_menu, *edit_menu, *window_menu, *tools_menu, *help_menu;
Project *current_project;
QueryParser *m_query_parser;
ActionOpenProject *action_open_project;
ActionAddFile *action_add_file;
ActionOpenQuery *action_open_query;
ActionAddFolder *action_add_folder;
ActionSaveProject *action_save_project;
ActionSaveProjectAs *action_save_project_as;
ActionImportMetaCsv *action_import_meta;
QAction *action_close_view, *action_show_browser, *action_show_bottom_tabs, *action_show_status,
*action_show_metadata, *action_compare_speakers, *action_compare_annotators, *run_last_query;
QProcess *process; // process to display doc
QList<Query*> queries; // keep track of all previous queries, in order
MainDatabase *m_db;
PluginHandler *m_plugin_handler;
sol::state_view m_lua;
SearchWindow *m_search_window; // Last search window
// initialize GUI
void setProject();
void setupUi();
void setMainMenu();
void setFileMenu();
void setSearchMenu();
void setEditMenu();
void setWindowMenu();
void setToolsMenu();
void setHelpMenu();
void setBrowserBar();
void setMetadataBar();
void setSplitters();
void setViewer();
void setBottomTabs();
void setConnections();
void checkPraat();
void resetQueryParser();
void readSettings();
void writeSettings();
void setQueryViewConnections(QueryView *view);
void initializeSound();
void initializePlugins();
void initializeGrammars();
void postInitialize();
void testPlugins(QDir root, QStringList &plugins);
void setMainPlugin(Plugin *plugin);
void closeApplication();
void setMainDatabase();
void cacheSearchWindow(SearchWindow *window);
};
#endif // DOLMENAPP_H