Began removal of platform/. The Monitor:: namespace is completely converted.
[aesalon.git] / src / gui / SessionEditor.h
blob61c5012a387cbed3ccc3bf91010f99c51f8a2712
1 #ifndef AESALON_GUI_SESSION_EDITOR_H
2 #define AESALON_GUI_SESSION_EDITOR_H
4 #include <QWidget>
5 #include <QDialog>
6 #include <QDialogButtonBox>
7 #include <QPushButton>
8 #include <QLabel>
9 #include <QLineEdit>
10 #include <QFormLayout>
11 #include <QVBoxLayout>
12 #include <QHBoxLayout>
13 #include <QFileDialog>
14 #include <QSpinBox>
15 #include <QButtonGroup>
16 #include <QRadioButton>
18 #include "Session.h"
20 namespace Aesalon {
21 namespace GUI {
23 class SessionEditor : public QDialog { Q_OBJECT
24 private:
25 Session *session;
27 QVBoxLayout *layout;
28 QFormLayout *form_layout;
29 QLineEdit *session_name;
31 QHBoxLayout *session_type_layout;
32 QButtonGroup *session_type_group;
33 QRadioButton *launch_session_type;
34 QRadioButton *connect_session_type;
35 QHBoxLayout *executable_path_layout;
36 QLabel *executable_path_label;
37 QLineEdit *executable_path;
38 QPushButton *file_select_dialog;
39 QFileDialog *file_dialog;
40 QLabel *arguments_label;
41 QLineEdit *arguments;
42 QSpinBox *port;
44 QDialogButtonBox *button_box;
46 static QString last_directory;
48 void create_widgets();
49 public:
50 SessionEditor(QWidget *parent = 0, Session *session = 0);
51 virtual ~SessionEditor() {}
53 Session *get_session() const { return session; }
54 public slots:
55 void accept();
56 void show_file_select_dialog();
57 void change_selected_file(QString new_filename);
58 void change_session_type(Session::session_type_e new_type);
59 void session_type_changed(QAbstractButton *new_type) {
60 if(new_type == launch_session_type) change_session_type(Session::LAUNCH_SESSION);
61 else change_session_type(Session::CONNECT_SESSION);
65 } // namespace GUI
66 } // namespace Aesalon
68 #endif