]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * This file is part of the PulseView project. | |
3 | * | |
4 | * Copyright (C) 2014 Martin Ling <martin-sigrok@earth.li> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation; either version 2 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | |
18 | */ | |
19 | ||
20 | #ifndef PULSEVIEW_PV_APPLICATION_HPP | |
21 | #define PULSEVIEW_PV_APPLICATION_HPP | |
22 | ||
23 | #include <vector> | |
24 | ||
25 | #include <QApplication> | |
26 | #include <QStringList> | |
27 | #include <QTranslator> | |
28 | ||
29 | #include <libsigrokcxx/libsigrokcxx.hpp> | |
30 | ||
31 | #include "globalsettings.hpp" | |
32 | ||
33 | using std::shared_ptr; | |
34 | using std::pair; | |
35 | using std::vector; | |
36 | ||
37 | class Application : public QApplication, public pv::GlobalSettingsInterface | |
38 | { | |
39 | Q_OBJECT | |
40 | ||
41 | public: | |
42 | Application(int &argc, char* argv[]); | |
43 | ||
44 | QStringList get_languages(); | |
45 | void switch_language(const QString& language); | |
46 | void on_setting_changed(const QString &key, const QVariant &value); | |
47 | ||
48 | void collect_version_info(shared_ptr<sigrok::Context> context); | |
49 | void print_version_info(); | |
50 | ||
51 | vector< pair<QString, QString> > get_version_info() const; | |
52 | vector<QString> get_fw_path_list() const; | |
53 | vector<QString> get_pd_path_list() const; | |
54 | vector< pair<QString, QString> > get_driver_list() const; | |
55 | vector< pair<QString, QString> > get_input_format_list() const; | |
56 | vector< pair<QString, QString> > get_output_format_list() const; | |
57 | vector< pair<QString, QString> > get_pd_list() const; | |
58 | ||
59 | private: | |
60 | bool notify(QObject *receiver, QEvent *event); | |
61 | ||
62 | vector< pair<QString, QString> > version_info_; | |
63 | vector<QString> fw_path_list_; | |
64 | vector<QString> pd_path_list_; | |
65 | vector< pair<QString, QString> > driver_list_; | |
66 | vector< pair<QString, QString> > input_format_list_; | |
67 | vector< pair<QString, QString> > output_format_list_; | |
68 | vector< pair<QString, QString> > pd_list_; | |
69 | ||
70 | QTranslator app_translator_, qt_translator_, qtbase_translator_; | |
71 | }; | |
72 | ||
73 | #endif // PULSEVIEW_PV_APPLICATION_HPP |