RTXI  2.4
The Real-Time eXperiment Interface Documentation
rtxi_wizard.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 Georgia Institute of Technology, University of Utah, Weill Cornell Medical College
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef RTXI_WIZARD_H
19 #define RTXI_WIZARD_H
20 
21 #include <QtNetwork>
22 #include <map>
23 #include <main_window.h>
24 #include <plugin.h>
25 
26 namespace RTXIWizard
27 {
28  class Panel : public QWidget
29  {
30  Q_OBJECT
31 
32  public:
33  struct module_t {
34  // QListWidgetItem *listItem;
35  QUrl readme_url;
36  QUrl clone_url;
37  QUrl location;
38  QString readme;
39  bool installed;
40  };
41  std::map<QString, module_t> modules;
42 
43  Panel(QWidget *);
44  virtual ~Panel(void);
45  void installFromString(std::string);
46  void rebuildListWidgets(void);
47 
48  private slots:
49  void cloneModule(void);
50  void getRepos(void);
51  void getReadme(void);
52  void parseRepos(void);
53  void parseReadme(void);
54 
55  void updateButton(void);
56 
57  private:
58  void initParameters(void);
59  int printGitError(int);
60  enum button_mode_t {DOWNLOAD, UPDATE } button_mode;
61 
62  QMdiSubWindow *subWindow;
63 
64  QNetworkAccessManager qnam;
65  QNetworkReply *reply;
66  QProgressDialog *progressDialog;
67 
68  QTextEdit *readmeWindow;
69  QListWidget *availableListWidget;
70  QListWidget *installedListWidget;
71 
72  QPushButton *cloneButton;
73  QPushButton *syncButton;
74 
75  std::vector<QString> exclude_list;
76  };
77 
78  class Plugin : public QObject, public ::Plugin::Object
79  {
80  Q_OBJECT
81  friend class Panel;
82 
83  public:
84  static Plugin *getInstance(void);
85 
86  public slots:
87  void showRTXIWizardPanel(void);
88 
89  private:
90  void removeRTXIWizardPanel(Panel *);
91  Plugin(void);
92  ~Plugin(void);
93  Plugin(const Plugin &) : QObject() {};
94  Plugin &operator=(const Plugin &)
95  {
96  return *getInstance();
97  };
98  static Plugin *instance;
99  Panel *panel;
100  }; // class Plugin
101 
102 };
103 
104 #endif
RTXIWizard::Plugin::getInstance
static Plugin * getInstance(void)
Definition: rtxi_wizard.cpp:582
RTXIWizard::Panel::module_t::location
QUrl location
Definition: rtxi_wizard.h:37
Plugin::Object
Definition: plugin.h:145
plugin.h
RTXIWizard::Panel::module_t::installed
bool installed
Definition: rtxi_wizard.h:39
RTXIWizard::Plugin::Panel
friend class Panel
Definition: rtxi_wizard.h:81
RTXIWizard::Panel::module_t::readme
QString readme
Definition: rtxi_wizard.h:38
RTXIWizard::Panel
Definition: rtxi_wizard.h:28
RTXIWizard::Plugin::showRTXIWizardPanel
void showRTXIWizardPanel(void)
Definition: rtxi_wizard.cpp:566
RTXIWizard
Definition: rtxi_wizard.h:26
RTXIWizard::Panel::modules
std::map< QString, module_t > modules
Definition: rtxi_wizard.h:41
RTXIWizard::Panel::Panel
Panel(QWidget *)
Definition: rtxi_wizard.cpp:30
RTXIWizard::Panel::installFromString
void installFromString(std::string)
Definition: rtxi_wizard.cpp:454
RTXIWizard::Panel::module_t::readme_url
QUrl readme_url
Definition: rtxi_wizard.h:35
RTXIWizard::Panel::~Panel
virtual ~Panel(void)
Definition: rtxi_wizard.cpp:97
Plugin
Classes associated with the loading/unloading of binaries at run-time.
Definition: plugin.h:35
RTXIWizard::Panel::rebuildListWidgets
void rebuildListWidgets(void)
Definition: rtxi_wizard.cpp:435
RTXIWizard::Panel::module_t
Definition: rtxi_wizard.h:33
RTXIWizard::Panel::module_t::clone_url
QUrl clone_url
Definition: rtxi_wizard.h:36
main_window.h