-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.cpp
47 lines (36 loc) · 902 Bytes
/
main.cpp
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
#include "MainWindow.h"
#include "ImportExport.h"
#include "script.h"
#include "ConsoleWidget.h"
#include "pyConsole.h"
#include <QtGui>
#include <QApplication>
MainWindow *main_window=NULL;
int main(int argc, char *argv[])
{
QString filename = "";
if (argc > 1)
filename = argv[1];
QApplication a(argc, argv);
register_builtin_importers_exporters();
#ifdef SPROXEL_USE_PYTHON
init_script(argc>=1 ? argv[0] : "sproxel.exe");
#endif
MainWindow window(filename);
main_window=&window;
window.show();
#ifdef SPROXEL_USE_PYTHON
script_set_main_window(&window);
scan_plugins();
register_plugins();
run_script("startup.py");
//get_python_console_widget()->toggleViewAction()->setChecked(true);
#endif
int r=a.exec();
#ifdef SPROXEL_USE_PYTHON
unregister_plugins();
close_script();
#endif
main_window=NULL;
return r;
}