]> sigrok.org Git - pulseview.git/blame - pv/application.hpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / application.hpp
CommitLineData
dac1bb97
ML
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
efdec55a 17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
dac1bb97
ML
18 */
19
7a01bd36
JH
20#ifndef PULSEVIEW_PV_APPLICATION_HPP
21#define PULSEVIEW_PV_APPLICATION_HPP
dac1bb97 22
49719858
SA
23#include <vector>
24
dac1bb97 25#include <QApplication>
380f4ee6 26#include <QStringList>
0466001b 27#include <QTranslator>
dac1bb97 28
49719858
SA
29#include <libsigrokcxx/libsigrokcxx.hpp>
30
22dc4040 31#include "devicemanager.hpp"
0466001b
SA
32#include "globalsettings.hpp"
33
49719858
SA
34using std::shared_ptr;
35using std::pair;
36using std::vector;
37
0466001b 38class Application : public QApplication, public pv::GlobalSettingsInterface
dac1bb97 39{
49719858
SA
40 Q_OBJECT
41
dac1bb97
ML
42public:
43 Application(int &argc, char* argv[]);
49719858 44
c8e2f09b
SA
45 const QStringList get_languages() const;
46 const QString get_language_editors(const QString& language) const;
0466001b 47 void switch_language(const QString& language);
c8e2f09b 48
0466001b
SA
49 void on_setting_changed(const QString &key, const QVariant &value);
50
22dc4040 51 void collect_version_info(pv::DeviceManager &device_manager);
49719858
SA
52 void print_version_info();
53
54 vector< pair<QString, QString> > get_version_info() const;
55 vector<QString> get_fw_path_list() const;
56 vector<QString> get_pd_path_list() const;
57 vector< pair<QString, QString> > get_driver_list() const;
58 vector< pair<QString, QString> > get_input_format_list() const;
59 vector< pair<QString, QString> > get_output_format_list() const;
60 vector< pair<QString, QString> > get_pd_list() const;
61
dac1bb97
ML
62private:
63 bool notify(QObject *receiver, QEvent *event);
49719858
SA
64
65 vector< pair<QString, QString> > version_info_;
66 vector<QString> fw_path_list_;
67 vector<QString> pd_path_list_;
68 vector< pair<QString, QString> > driver_list_;
69 vector< pair<QString, QString> > input_format_list_;
70 vector< pair<QString, QString> > output_format_list_;
71 vector< pair<QString, QString> > pd_list_;
0466001b 72
4353c902 73 QTranslator app_translator_, qt_translator_, qtbase_translator_;
dac1bb97
ML
74};
75
7a01bd36 76#endif // PULSEVIEW_PV_APPLICATION_HPP