forked from nspire-emus/firebird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
102 lines (78 loc) · 2.41 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSettings>
#include "emuthread.h"
#include "flashdialog.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void closeEvent(QCloseEvent *) override;
void dockVisibilityChanged(bool v);
//Drag & Drop
void dropEvent(QDropEvent* event) override;
void dragEnterEvent(QDragEnterEvent *ev) override;
//Menu "Emulator"
void restart();
void screenshot();
void connectUSB();
void usblinkChanged(bool state);
//Menu "Flash"
void saveFlash();
void createFlash();
//Serial
void serialChar(const char c);
//Debugging
void debugStr(QString str);
void debugCommand();
//File transfer
void reload_filebrowser();
void changeProgress(int value);
//Settings
void selectBoot1();
void selectFlash();
void setDebuggerOnStartup(bool b);
void setDebuggerOnWarning(bool b);
void setUIMode(bool docks_enabled);
void setAutostart(bool b);
void setBootOrder(bool diags_first);
void setUSBPath(QString path);
void setGDBPort(int port);
void setRDBGPort(int port);
//Tool bar (above screen)
void showSpeed(double percent);
signals:
void debuggerCommand();
void usblink_progress_changed(int progress);
public:
QByteArray debug_command;
//usblink callbacks
static void usblink_dirlist_callback_nested(struct usblink_file *file, void *data);
static void usblink_dirlist_callback(struct usblink_file *file, void *data);
static void usblink_progress_callback(int progress, void *data);
private:
void selectBoot1(QString path);
void selectFlash(QString path);
Ui::MainWindow *ui = nullptr;
// On Mac you can't show docks after all of them are hidden...
// Keep track of them to count whether that's about to happen
std::vector<QDockWidget *> docks;
// Whether to call usblink_dirlist when the tab is selected
// Small hack: static as used in static callbacks...
static bool refresh_filebrowser;
EmuThread emu;
QSettings *settings = nullptr;
FlashDialog flash_dialog;
// To make it possible to activate the debugger
QDockWidget *dock_debugger = nullptr;
};
// Used as global instance by EmuThread and friends
extern MainWindow *main_window;
#endif // MAINWINDOW_H