##// END OF EJS Templates
Merge branch 'feature/CataloguesBasicGui' into develop
trabillard -
r1107:bc8467a5b117 merge
parent child
Show More
@@ -0,0 +1,31
1 #ifndef SCIQLOP_CATALOGUEEVENTSWIDGET_H
2 #define SCIQLOP_CATALOGUEEVENTSWIDGET_H
3
4 #include <Common/spimpl.h>
5 #include <QWidget>
6
7 namespace Ui {
8 class CatalogueEventsWidget;
9 }
10
11 class CatalogueEventsWidget : public QWidget {
12 Q_OBJECT
13
14 signals:
15 void eventSelected(const QString &event);
16
17 public:
18 explicit CatalogueEventsWidget(QWidget *parent = 0);
19 virtual ~CatalogueEventsWidget();
20
21 public slots:
22 void populateWithCatalogue(const QString &catalogue);
23
24 private:
25 Ui::CatalogueEventsWidget *ui;
26
27 class CatalogueEventsWidgetPrivate;
28 spimpl::unique_impl_ptr<CatalogueEventsWidgetPrivate> impl;
29 };
30
31 #endif // SCIQLOP_CATALOGUEEVENTSWIDGET_H
@@ -0,0 +1,21
1 #ifndef SCIQLOP_CATALOGUEEXPLORER_H
2 #define SCIQLOP_CATALOGUEEXPLORER_H
3
4 #include <QDialog>
5
6 namespace Ui {
7 class CatalogueExplorer;
8 }
9
10 class CatalogueExplorer : public QDialog {
11 Q_OBJECT
12
13 public:
14 explicit CatalogueExplorer(QWidget *parent = 0);
15 virtual ~CatalogueExplorer();
16
17 private:
18 Ui::CatalogueExplorer *ui;
19 };
20
21 #endif // SCIQLOP_CATALOGUEEXPLORER_H
@@ -0,0 +1,32
1 #ifndef SCIQLOP_CATALOGUEINSPECTORWIDGET_H
2 #define SCIQLOP_CATALOGUEINSPECTORWIDGET_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class CatalogueInspectorWidget;
8 }
9
10 class CatalogueInspectorWidget : public QWidget {
11 Q_OBJECT
12
13 public:
14 explicit CatalogueInspectorWidget(QWidget *parent = 0);
15 virtual ~CatalogueInspectorWidget();
16
17 /// Enum matching the pages inside the stacked widget
18 enum class Page { Empty, CatalogueProperties, EventProperties };
19
20 Page currentPage() const;
21
22 void setEvent(const QString &event);
23 void setCatalogue(const QString &catalogue);
24
25 public slots:
26 void showPage(Page page);
27
28 private:
29 Ui::CatalogueInspectorWidget *ui;
30 };
31
32 #endif // SCIQLOP_CATALOGUEINSPECTORWIDGET_H
@@ -0,0 +1,31
1 #ifndef SCIQLOP_CATALOGUESIDEBARWIDGET_H
2 #define SCIQLOP_CATALOGUESIDEBARWIDGET_H
3
4 #include <Common/spimpl.h>
5 #include <QTreeWidgetItem>
6 #include <QWidget>
7
8 namespace Ui {
9 class CatalogueSideBarWidget;
10 }
11
12 class CatalogueSideBarWidget : public QWidget {
13 Q_OBJECT
14
15 signals:
16 void catalogueSelected(const QString &catalogue);
17 void allEventsSelected();
18 void trashSelected();
19
20 public:
21 explicit CatalogueSideBarWidget(QWidget *parent = 0);
22 virtual ~CatalogueSideBarWidget();
23
24 private:
25 Ui::CatalogueSideBarWidget *ui;
26
27 class CatalogueSideBarWidgetPrivate;
28 spimpl::unique_impl_ptr<CatalogueSideBarWidgetPrivate> impl;
29 };
30
31 #endif // SCIQLOP_CATALOGUESIDEBARWIDGET_H
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,100
1 #include "Catalogue/CatalogueEventsWidget.h"
2 #include "ui_CatalogueEventsWidget.h"
3
4 #include <QtDebug>
5
6 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
7 void addEventItem(const QStringList &data, QTableWidget *tableWidget);
8
9 enum class Column { Event, TStart, TEnd, Tags, Product, NbColumn };
10 QStringList columnNames() { return QStringList{"Event", "TStart", "TEnd", "Tags", "Product"}; }
11 };
12
13
14 CatalogueEventsWidget::CatalogueEventsWidget(QWidget *parent)
15 : QWidget(parent),
16 ui(new Ui::CatalogueEventsWidget),
17 impl{spimpl::make_unique_impl<CatalogueEventsWidgetPrivate>()}
18 {
19 ui->setupUi(this);
20
21 connect(ui->btnTime, &QToolButton::clicked, [this](auto checked) {
22 if (checked) {
23 ui->btnChart->setChecked(false);
24 }
25 });
26
27 connect(ui->btnChart, &QToolButton::clicked, [this](auto checked) {
28 if (checked) {
29 ui->btnTime->setChecked(false);
30 }
31 });
32
33 connect(ui->tableWidget, &QTableWidget::cellClicked, [this](auto row, auto column) {
34 auto event = ui->tableWidget->item(row, 0)->text();
35 emit this->eventSelected(event);
36 });
37
38 connect(ui->tableWidget, &QTableWidget::currentItemChanged,
39 [this](auto current, auto previous) {
40 if (current && current->row() >= 0) {
41 auto event = ui->tableWidget->item(current->row(), 0)->text();
42 emit this->eventSelected(event);
43 }
44 });
45
46 connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, [this]() {
47 auto selection = ui->tableWidget->selectedRanges();
48 auto isNotMultiSelection
49 = selection.isEmpty() || (selection.count() == 1 && selection.first().rowCount() == 1);
50 ui->btnChart->setEnabled(isNotMultiSelection);
51 ui->btnTime->setEnabled(isNotMultiSelection);
52 });
53
54 Q_ASSERT(impl->columnNames().count() == (int)CatalogueEventsWidgetPrivate::Column::NbColumn);
55 ui->tableWidget->setColumnCount((int)CatalogueEventsWidgetPrivate::Column::NbColumn);
56 ui->tableWidget->setHorizontalHeaderLabels(impl->columnNames());
57 ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
58 ui->tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
59 ui->tableWidget->horizontalHeader()->setSortIndicatorShown(true);
60 }
61
62 CatalogueEventsWidget::~CatalogueEventsWidget()
63 {
64 delete ui;
65 }
66
67 void CatalogueEventsWidget::populateWithCatalogue(const QString &catalogue)
68 {
69 ui->tableWidget->clearContents();
70 ui->tableWidget->setRowCount(0);
71
72 // TODO
73 impl->addEventItem(
74 {catalogue + " - Event 1", "12/12/2012 12:12", "12/12/2042 12:52", "cloud", "mfi/b_gse42"},
75 ui->tableWidget);
76 impl->addEventItem(
77 {catalogue + " - Event 2", "12/12/2012 12:10", "12/12/2042 12:42", "Acloud", "mfi/b_gse1"},
78 ui->tableWidget);
79 impl->addEventItem(
80 {catalogue + " - Event 3", "12/12/2012 12:22", "12/12/2042 12:12", "Gcloud", "mfi/b_gse2"},
81 ui->tableWidget);
82 impl->addEventItem(
83 {catalogue + " - Event 4", "12/12/2012 12:00", "12/12/2042 12:62", "Bcloud", "mfi/b_gse3"},
84 ui->tableWidget);
85 }
86
87 void CatalogueEventsWidget::CatalogueEventsWidgetPrivate::addEventItem(const QStringList &data,
88 QTableWidget *tableWidget)
89 {
90 tableWidget->setSortingEnabled(false);
91 auto row = tableWidget->rowCount();
92 tableWidget->setRowCount(row + 1);
93
94 for (auto i = 0; i < (int)Column::NbColumn; ++i) {
95 auto item = new QTableWidgetItem(data.value(i));
96 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
97 tableWidget->setItem(row, i, item);
98 }
99 tableWidget->setSortingEnabled(true);
100 }
@@ -0,0 +1,22
1 #include "Catalogue/CatalogueExplorer.h"
2 #include "ui_CatalogueExplorer.h"
3
4 CatalogueExplorer::CatalogueExplorer(QWidget *parent)
5 : QDialog(parent, Qt::Dialog | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint),
6 ui(new Ui::CatalogueExplorer)
7 {
8 ui->setupUi(this);
9
10 connect(ui->catalogues, &CatalogueSideBarWidget::catalogueSelected, [this](auto name) {
11 ui->inspector->setCatalogue(name);
12 ui->events->populateWithCatalogue(name);
13 });
14
15 connect(ui->events, &CatalogueEventsWidget::eventSelected,
16 [this](auto name) { ui->inspector->setEvent(name); });
17 }
18
19 CatalogueExplorer::~CatalogueExplorer()
20 {
21 delete ui;
22 }
@@ -0,0 +1,36
1 #include "Catalogue/CatalogueInspectorWidget.h"
2 #include "ui_CatalogueInspectorWidget.h"
3
4 CatalogueInspectorWidget::CatalogueInspectorWidget(QWidget *parent)
5 : QWidget(parent), ui(new Ui::CatalogueInspectorWidget)
6 {
7 ui->setupUi(this);
8 showPage(Page::Empty);
9 }
10
11 CatalogueInspectorWidget::~CatalogueInspectorWidget()
12 {
13 delete ui;
14 }
15
16 void CatalogueInspectorWidget::showPage(CatalogueInspectorWidget::Page page)
17 {
18 ui->stackedWidget->setCurrentIndex(static_cast<int>(page));
19 }
20
21 CatalogueInspectorWidget::Page CatalogueInspectorWidget::currentPage() const
22 {
23 return static_cast<Page>(ui->stackedWidget->currentIndex());
24 }
25
26 void CatalogueInspectorWidget::setEvent(const QString &event)
27 {
28 showPage(Page::EventProperties);
29 ui->leEventName->setText(event);
30 }
31
32 void CatalogueInspectorWidget::setCatalogue(const QString &catalogue)
33 {
34 showPage(Page::CatalogueProperties);
35 ui->leCatalogueName->setText(catalogue);
36 }
@@ -0,0 +1,101
1 #include "Catalogue/CatalogueSideBarWidget.h"
2 #include "ui_CatalogueSideBarWidget.h"
3
4 constexpr auto ALL_EVENT_ITEM_TYPE = QTreeWidgetItem::UserType;
5 constexpr auto TRASH_ITEM_TYPE = QTreeWidgetItem::UserType + 1;
6 constexpr auto CATALOGUE_ITEM_TYPE = QTreeWidgetItem::UserType + 2;
7 constexpr auto DATABASE_ITEM_TYPE = QTreeWidgetItem::UserType + 3;
8
9
10 struct CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate {
11 void configureTreeWidget(QTreeWidget *treeWidget);
12 QTreeWidgetItem *addDatabaseItem(const QString &name, QTreeWidget *treeWidget);
13 void addCatalogueItem(const QString &name, QTreeWidgetItem *parentDatabaseItem);
14 };
15
16 CatalogueSideBarWidget::CatalogueSideBarWidget(QWidget *parent)
17 : QWidget(parent),
18 ui(new Ui::CatalogueSideBarWidget),
19 impl{spimpl::make_unique_impl<CatalogueSideBarWidgetPrivate>()}
20 {
21 ui->setupUi(this);
22 impl->configureTreeWidget(ui->treeWidget);
23
24 auto emitSelection = [this](auto item) {
25 switch (item->type()) {
26 case CATALOGUE_ITEM_TYPE:
27 emit this->catalogueSelected(item->text(0));
28 break;
29 case ALL_EVENT_ITEM_TYPE:
30 emit this->allEventsSelected();
31 break;
32 case TRASH_ITEM_TYPE:
33 emit this->trashSelected();
34 break;
35 case DATABASE_ITEM_TYPE:
36 default:
37 break;
38 }
39 };
40
41 connect(ui->treeWidget, &QTreeWidget::itemClicked, emitSelection);
42 connect(ui->treeWidget, &QTreeWidget::currentItemChanged, emitSelection);
43 }
44
45 CatalogueSideBarWidget::~CatalogueSideBarWidget()
46 {
47 delete ui;
48 }
49
50 void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::configureTreeWidget(
51 QTreeWidget *treeWidget)
52 {
53 auto allEventsItem = new QTreeWidgetItem({"All Events"}, ALL_EVENT_ITEM_TYPE);
54 allEventsItem->setIcon(0, QIcon(":/icones/allEvents.png"));
55 treeWidget->addTopLevelItem(allEventsItem);
56
57 auto trashItem = new QTreeWidgetItem({"Trash"}, TRASH_ITEM_TYPE);
58 trashItem->setIcon(0, QIcon(":/icones/trash.png"));
59 treeWidget->addTopLevelItem(trashItem);
60
61 auto separator = new QFrame(treeWidget);
62 separator->setFrameShape(QFrame::HLine);
63
64 auto separatorItem = new QTreeWidgetItem();
65 separatorItem->setFlags(Qt::NoItemFlags);
66 treeWidget->addTopLevelItem(separatorItem);
67 treeWidget->setItemWidget(separatorItem, 0, separator);
68
69 // Test
70 auto db = addDatabaseItem("Database 1", treeWidget);
71 addCatalogueItem("Catalogue 1", db);
72 addCatalogueItem("Catalogue 2", db);
73 addCatalogueItem("Catalogue 3", db);
74 addCatalogueItem("Catalogue 4", db);
75
76 auto db2 = addDatabaseItem("Database 2", treeWidget);
77 addCatalogueItem("Catalogue A", db2);
78 addCatalogueItem("Catalogue B", db2);
79 addCatalogueItem("Catalogue C", db2);
80
81 treeWidget->expandAll();
82 }
83
84 QTreeWidgetItem *
85 CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::addDatabaseItem(const QString &name,
86 QTreeWidget *treeWidget)
87 {
88 auto databaseItem = new QTreeWidgetItem({name}, DATABASE_ITEM_TYPE);
89 databaseItem->setIcon(0, QIcon(":/icones/database.png"));
90 treeWidget->addTopLevelItem(databaseItem);
91
92 return databaseItem;
93 }
94
95 void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::addCatalogueItem(
96 const QString &name, QTreeWidgetItem *parentDatabaseItem)
97 {
98 auto catalogueItem = new QTreeWidgetItem({name}, CATALOGUE_ITEM_TYPE);
99 catalogueItem->setIcon(0, QIcon(":/icones/catalogue.png"));
100 parentDatabaseItem->addChild(catalogueItem);
101 }
@@ -0,0 +1,139
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>CatalogueEventsWidget</class>
4 <widget class="QWidget" name="CatalogueEventsWidget">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>566</width>
10 <height>258</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Form</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">
17 <property name="leftMargin">
18 <number>0</number>
19 </property>
20 <property name="topMargin">
21 <number>0</number>
22 </property>
23 <property name="rightMargin">
24 <number>0</number>
25 </property>
26 <property name="bottomMargin">
27 <number>0</number>
28 </property>
29 <item>
30 <layout class="QHBoxLayout" name="horizontalLayout">
31 <item>
32 <widget class="QToolButton" name="btnAdd">
33 <property name="text">
34 <string>+</string>
35 </property>
36 <property name="icon">
37 <iconset>
38 <normaloff>:/icones/add.png</normaloff>:/icones/add.png</iconset>
39 </property>
40 <property name="autoRaise">
41 <bool>true</bool>
42 </property>
43 </widget>
44 </item>
45 <item>
46 <widget class="QToolButton" name="btnRemove">
47 <property name="text">
48 <string> - </string>
49 </property>
50 <property name="icon">
51 <iconset>
52 <normaloff>:/icones/remove.png</normaloff>:/icones/remove.png</iconset>
53 </property>
54 <property name="autoRaise">
55 <bool>true</bool>
56 </property>
57 </widget>
58 </item>
59 <item>
60 <widget class="Line" name="line">
61 <property name="orientation">
62 <enum>Qt::Vertical</enum>
63 </property>
64 </widget>
65 </item>
66 <item>
67 <widget class="QToolButton" name="btnTime">
68 <property name="text">
69 <string>T</string>
70 </property>
71 <property name="icon">
72 <iconset>
73 <normaloff>:/icones/time.png</normaloff>:/icones/time.png</iconset>
74 </property>
75 <property name="checkable">
76 <bool>true</bool>
77 </property>
78 <property name="autoRaise">
79 <bool>true</bool>
80 </property>
81 </widget>
82 </item>
83 <item>
84 <widget class="QToolButton" name="btnChart">
85 <property name="text">
86 <string>G</string>
87 </property>
88 <property name="icon">
89 <iconset>
90 <normaloff>:/icones/chart.png</normaloff>:/icones/chart.png</iconset>
91 </property>
92 <property name="checkable">
93 <bool>true</bool>
94 </property>
95 <property name="autoRaise">
96 <bool>true</bool>
97 </property>
98 </widget>
99 </item>
100 <item>
101 <widget class="Line" name="line_2">
102 <property name="orientation">
103 <enum>Qt::Vertical</enum>
104 </property>
105 </widget>
106 </item>
107 <item>
108 <widget class="QLineEdit" name="lineEdit">
109 <property name="enabled">
110 <bool>false</bool>
111 </property>
112 </widget>
113 </item>
114 </layout>
115 </item>
116 <item>
117 <widget class="QTableWidget" name="tableWidget">
118 <property name="alternatingRowColors">
119 <bool>true</bool>
120 </property>
121 <property name="selectionBehavior">
122 <enum>QAbstractItemView::SelectRows</enum>
123 </property>
124 <attribute name="horizontalHeaderHighlightSections">
125 <bool>false</bool>
126 </attribute>
127 <attribute name="verticalHeaderVisible">
128 <bool>false</bool>
129 </attribute>
130 <attribute name="verticalHeaderDefaultSectionSize">
131 <number>25</number>
132 </attribute>
133 </widget>
134 </item>
135 </layout>
136 </widget>
137 <resources/>
138 <connections/>
139 </ui>
@@ -0,0 +1,83
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>CatalogueExplorer</class>
4 <widget class="QDialog" name="CatalogueExplorer">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>755</width>
10 <height>481</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Catalogue Explorer</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">
17 <item>
18 <widget class="QSplitter" name="horizontalSplitter">
19 <property name="orientation">
20 <enum>Qt::Horizontal</enum>
21 </property>
22 <widget class="CatalogueSideBarWidget" name="catalogues" native="true">
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
25 <horstretch>1</horstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
28 </property>
29 </widget>
30 <widget class="QSplitter" name="verticalSplitter">
31 <property name="sizePolicy">
32 <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
33 <horstretch>3</horstretch>
34 <verstretch>0</verstretch>
35 </sizepolicy>
36 </property>
37 <property name="orientation">
38 <enum>Qt::Vertical</enum>
39 </property>
40 <widget class="CatalogueEventsWidget" name="events" native="true">
41 <property name="sizePolicy">
42 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
43 <horstretch>0</horstretch>
44 <verstretch>5</verstretch>
45 </sizepolicy>
46 </property>
47 </widget>
48 <widget class="CatalogueInspectorWidget" name="inspector" native="true">
49 <property name="sizePolicy">
50 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
51 <horstretch>0</horstretch>
52 <verstretch>2</verstretch>
53 </sizepolicy>
54 </property>
55 </widget>
56 </widget>
57 </widget>
58 </item>
59 </layout>
60 </widget>
61 <customwidgets>
62 <customwidget>
63 <class>CatalogueSideBarWidget</class>
64 <extends>QWidget</extends>
65 <header>Catalogue/CatalogueSideBarWidget.h</header>
66 <container>1</container>
67 </customwidget>
68 <customwidget>
69 <class>CatalogueEventsWidget</class>
70 <extends>QWidget</extends>
71 <header>Catalogue/CatalogueEventsWidget.h</header>
72 <container>1</container>
73 </customwidget>
74 <customwidget>
75 <class>CatalogueInspectorWidget</class>
76 <extends>QWidget</extends>
77 <header>Catalogue/CatalogueInspectorWidget.h</header>
78 <container>1</container>
79 </customwidget>
80 </customwidgets>
81 <resources/>
82 <connections/>
83 </ui>
@@ -0,0 +1,214
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>CatalogueInspectorWidget</class>
4 <widget class="QWidget" name="CatalogueInspectorWidget">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Form</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_2">
17 <property name="leftMargin">
18 <number>0</number>
19 </property>
20 <property name="topMargin">
21 <number>0</number>
22 </property>
23 <property name="rightMargin">
24 <number>0</number>
25 </property>
26 <property name="bottomMargin">
27 <number>0</number>
28 </property>
29 <item>
30 <widget class="QFrame" name="frame">
31 <property name="frameShape">
32 <enum>QFrame::Box</enum>
33 </property>
34 <property name="frameShadow">
35 <enum>QFrame::Sunken</enum>
36 </property>
37 <property name="lineWidth">
38 <number>1</number>
39 </property>
40 <layout class="QVBoxLayout" name="verticalLayout">
41 <property name="leftMargin">
42 <number>0</number>
43 </property>
44 <property name="topMargin">
45 <number>0</number>
46 </property>
47 <property name="rightMargin">
48 <number>0</number>
49 </property>
50 <property name="bottomMargin">
51 <number>0</number>
52 </property>
53 <item>
54 <widget class="QStackedWidget" name="stackedWidget">
55 <property name="currentIndex">
56 <number>1</number>
57 </property>
58 <widget class="QWidget" name="emptyPage"/>
59 <widget class="QWidget" name="catalogueInspectorPage">
60 <layout class="QGridLayout" name="gridLayout_2">
61 <item row="1" column="0">
62 <widget class="QLabel" name="label_7">
63 <property name="text">
64 <string>Name</string>
65 </property>
66 </widget>
67 </item>
68 <item row="1" column="1">
69 <widget class="QLineEdit" name="leCatalogueName"/>
70 </item>
71 <item row="2" column="0">
72 <widget class="QLabel" name="label_8">
73 <property name="text">
74 <string>Author</string>
75 </property>
76 </widget>
77 </item>
78 <item row="2" column="1">
79 <widget class="QLineEdit" name="leCatalogueAuthor">
80 <property name="text">
81 <string/>
82 </property>
83 </widget>
84 </item>
85 <item row="3" column="1">
86 <spacer name="verticalSpacer_2">
87 <property name="orientation">
88 <enum>Qt::Vertical</enum>
89 </property>
90 <property name="sizeHint" stdset="0">
91 <size>
92 <width>20</width>
93 <height>40</height>
94 </size>
95 </property>
96 </spacer>
97 </item>
98 <item row="0" column="0" colspan="2">
99 <widget class="QLabel" name="label_9">
100 <property name="font">
101 <font>
102 <pointsize>10</pointsize>
103 <weight>75</weight>
104 <bold>true</bold>
105 </font>
106 </property>
107 <property name="text">
108 <string>Catalogue Properties</string>
109 </property>
110 </widget>
111 </item>
112 </layout>
113 </widget>
114 <widget class="QWidget" name="eventInspectorPage">
115 <layout class="QGridLayout" name="gridLayout">
116 <item row="5" column="1">
117 <widget class="QDateTimeEdit" name="dateTimeEventTEnd"/>
118 </item>
119 <item row="4" column="0">
120 <widget class="QLabel" name="label_4">
121 <property name="text">
122 <string>TStart</string>
123 </property>
124 </widget>
125 </item>
126 <item row="6" column="0">
127 <widget class="QLabel" name="label_6">
128 <property name="text">
129 <string>Tags</string>
130 </property>
131 </widget>
132 </item>
133 <item row="3" column="0">
134 <widget class="QLabel" name="label_3">
135 <property name="text">
136 <string>Product</string>
137 </property>
138 </widget>
139 </item>
140 <item row="3" column="1">
141 <widget class="QLineEdit" name="leEventProduct"/>
142 </item>
143 <item row="5" column="0">
144 <widget class="QLabel" name="label_5">
145 <property name="text">
146 <string>Tend</string>
147 </property>
148 </widget>
149 </item>
150 <item row="4" column="1">
151 <widget class="QDateTimeEdit" name="dateTimeEventTStart"/>
152 </item>
153 <item row="2" column="0">
154 <widget class="QLabel" name="label_2">
155 <property name="text">
156 <string>Mission</string>
157 </property>
158 </widget>
159 </item>
160 <item row="1" column="1">
161 <widget class="QLineEdit" name="leEventName"/>
162 </item>
163 <item row="1" column="0">
164 <widget class="QLabel" name="label">
165 <property name="text">
166 <string>Name</string>
167 </property>
168 </widget>
169 </item>
170 <item row="2" column="1">
171 <widget class="QLineEdit" name="leEventMission"/>
172 </item>
173 <item row="6" column="1">
174 <widget class="QLineEdit" name="leEventTags"/>
175 </item>
176 <item row="7" column="1">
177 <spacer name="verticalSpacer">
178 <property name="orientation">
179 <enum>Qt::Vertical</enum>
180 </property>
181 <property name="sizeHint" stdset="0">
182 <size>
183 <width>20</width>
184 <height>40</height>
185 </size>
186 </property>
187 </spacer>
188 </item>
189 <item row="0" column="0" colspan="2">
190 <widget class="QLabel" name="label_10">
191 <property name="font">
192 <font>
193 <pointsize>10</pointsize>
194 <weight>75</weight>
195 <bold>true</bold>
196 </font>
197 </property>
198 <property name="text">
199 <string>Event Properties</string>
200 </property>
201 </widget>
202 </item>
203 </layout>
204 </widget>
205 </widget>
206 </item>
207 </layout>
208 </widget>
209 </item>
210 </layout>
211 </widget>
212 <resources/>
213 <connections/>
214 </ui>
@@ -0,0 +1,90
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>CatalogueSideBarWidget</class>
4 <widget class="QWidget" name="CatalogueSideBarWidget">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>330</width>
10 <height>523</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Form</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">
17 <property name="leftMargin">
18 <number>0</number>
19 </property>
20 <property name="topMargin">
21 <number>0</number>
22 </property>
23 <property name="rightMargin">
24 <number>0</number>
25 </property>
26 <property name="bottomMargin">
27 <number>0</number>
28 </property>
29 <item>
30 <layout class="QHBoxLayout" name="horizontalLayout">
31 <item>
32 <widget class="QToolButton" name="btnAdd">
33 <property name="text">
34 <string>+</string>
35 </property>
36 <property name="icon">
37 <iconset>
38 <normaloff>:/icones/add.png</normaloff>:/icones/add.png</iconset>
39 </property>
40 <property name="autoRaise">
41 <bool>true</bool>
42 </property>
43 </widget>
44 </item>
45 <item>
46 <widget class="QToolButton" name="btnRemove">
47 <property name="text">
48 <string> - </string>
49 </property>
50 <property name="icon">
51 <iconset>
52 <normaloff>:/icones/remove.png</normaloff>:/icones/remove.png</iconset>
53 </property>
54 <property name="autoRaise">
55 <bool>true</bool>
56 </property>
57 </widget>
58 </item>
59 <item>
60 <spacer name="horizontalSpacer">
61 <property name="orientation">
62 <enum>Qt::Horizontal</enum>
63 </property>
64 <property name="sizeHint" stdset="0">
65 <size>
66 <width>40</width>
67 <height>20</height>
68 </size>
69 </property>
70 </spacer>
71 </item>
72 </layout>
73 </item>
74 <item>
75 <widget class="QTreeWidget" name="treeWidget">
76 <attribute name="headerVisible">
77 <bool>false</bool>
78 </attribute>
79 <column>
80 <property name="text">
81 <string notr="true">1</string>
82 </property>
83 </column>
84 </widget>
85 </item>
86 </layout>
87 </widget>
88 <resources/>
89 <connections/>
90 </ui>
@@ -22,6 +22,7
22 22 #include "MainWindow.h"
23 23 #include "ui_MainWindow.h"
24 24
25 #include <Catalogue/CatalogueExplorer.h>
25 26 #include <DataSource/DataSourceController.h>
26 27 #include <DataSource/DataSourceWidget.h>
27 28 #include <Settings/SqpSettingsDialog.h>
@@ -60,7 +61,8 public:
60 61 : m_LastOpenLeftInspectorSize{},
61 62 m_LastOpenRightInspectorSize{},
62 63 m_GeneralSettingsWidget{new SqpSettingsGeneralWidget{mainWindow}},
63 m_SettingsDialog{new SqpSettingsDialog{mainWindow}}
64 m_SettingsDialog{new SqpSettingsDialog{mainWindow}},
65 m_CatalogExplorer{new CatalogueExplorer{mainWindow}}
64 66 {
65 67 }
66 68
@@ -70,6 +72,8 public:
70 72 SqpSettingsGeneralWidget *m_GeneralSettingsWidget;
71 73 /// Settings dialog. MainWindow has the ownership
72 74 SqpSettingsDialog *m_SettingsDialog;
75 /// Catalogue dialog. MainWindow has the ownership
76 CatalogueExplorer *m_CatalogExplorer;
73 77 };
74 78
75 79 MainWindow::MainWindow(QWidget *parent)
@@ -189,6 +193,7 MainWindow::MainWindow(QWidget *parent)
189 193 auto timeWidget = new TimeWidget{};
190 194 mainToolBar->addWidget(timeWidget);
191 195
196 // Interaction modes
192 197 auto actionPointerMode = new QAction{QIcon(":/icones/pointer.png"), "Move", this};
193 198 actionPointerMode->setCheckable(true);
194 199 actionPointerMode->setChecked(sqpApp->plotsInteractionMode()
@@ -234,6 +239,7 MainWindow::MainWindow(QWidget *parent)
234 239 mainToolBar->addAction(actionZonesMode);
235 240 mainToolBar->addSeparator();
236 241
242 // Cursors
237 243 auto btnCursor = new QToolButton{this};
238 244 btnCursor->setIcon(QIcon(":/icones/cursor.png"));
239 245 btnCursor->setText("Cursor");
@@ -288,6 +294,11 MainWindow::MainWindow(QWidget *parent)
288 294 cursorModeActionGroup->addAction(horizontalCursorAction);
289 295 cursorModeActionGroup->addAction(crossCursorAction);
290 296
297 // Catalog
298 mainToolBar->addSeparator();
299 mainToolBar->addAction(QIcon(":/icones/catalogue.png"), "Catalogues",
300 [this]() { impl->m_CatalogExplorer->show(); });
301
291 302 // //////// //
292 303 // Settings //
293 304 // //////// //
@@ -132,7 +132,7
132 132 <x>0</x>
133 133 <y>0</y>
134 134 <width>800</width>
135 <height>28</height>
135 <height>21</height>
136 136 </rect>
137 137 </property>
138 138 </widget>
@@ -19,7 +19,11 gui_moc_headers = [
19 19 'include/Visualization/VisualizationDragWidget.h',
20 20 'include/Visualization/ColorScaleEditor.h',
21 21 'include/Actions/SelectionZoneAction.h',
22 'include/Visualization/VisualizationMultiZoneSelectionDialog.h'
22 'include/Visualization/VisualizationMultiZoneSelectionDialog.h',
23 'include/Catalogue/CatalogueExplorer.h',
24 'include/Catalogue/CatalogueEventsWidget.h',
25 'include/Catalogue/CatalogueSideBarWidget.h',
26 'include/Catalogue/CatalogueInspectorWidget.h'
23 27 ]
24 28
25 29 gui_ui_files = [
@@ -36,7 +40,11 gui_ui_files = [
36 40 'ui/Visualization/VisualizationWidget.ui',
37 41 'ui/Visualization/VisualizationZoneWidget.ui',
38 42 'ui/Visualization/ColorScaleEditor.ui',
39 'ui/Visualization/VisualizationMultiZoneSelectionDialog.ui'
43 'ui/Visualization/VisualizationMultiZoneSelectionDialog.ui',
44 'ui/Catalogue/CatalogueExplorer.ui',
45 'ui/Catalogue/CatalogueEventsWidget.ui',
46 'ui/Catalogue/CatalogueSideBarWidget.ui',
47 'ui/Catalogue/CatalogueInspectorWidget.ui'
40 48 ]
41 49
42 50 gui_qresources = ['resources/sqpguiresources.qrc']
@@ -91,7 +99,11 gui_sources = [
91 99 'src/Actions/SelectionZoneAction.cpp',
92 100 'src/Actions/ActionsGuiController.cpp',
93 101 'src/Visualization/VisualizationActionManager.cpp',
94 'src/Visualization/VisualizationMultiZoneSelectionDialog.cpp'
102 'src/Visualization/VisualizationMultiZoneSelectionDialog.cpp',
103 'src/Catalogue/CatalogueExplorer.cpp',
104 'src/Catalogue/CatalogueEventsWidget.cpp',
105 'src/Catalogue/CatalogueSideBarWidget.cpp',
106 'src/Catalogue/CatalogueInspectorWidget.cpp'
95 107 ]
96 108
97 109 gui_inc = include_directories(['include'])
@@ -18,5 +18,12
18 18 <file>icones/drag.png</file>
19 19 <file>icones/cursor.png</file>
20 20 <file>icones/pointer.png</file>
21 <file>icones/catalogue.png</file>
22 <file>icones/add.png</file>
23 <file>icones/remove.png</file>
24 <file>icones/chart.png</file>
25 <file>icones/allEvents.png</file>
26 <file>icones/trash.png</file>
27 <file>icones/database.png</file>
21 28 </qresource>
22 29 </RCC>
@@ -142,9 +142,7 VisualizationSelectionZoneItem::VisualizationSelectionZoneItem(QCustomPlot *plot
142 142 setColor(QColor(DEFAULT_COLOR));
143 143 }
144 144
145 VisualizationSelectionZoneItem::~VisualizationSelectionZoneItem()
146 {
147 }
145 VisualizationSelectionZoneItem::~VisualizationSelectionZoneItem() {}
148 146
149 147 VisualizationGraphWidget *VisualizationSelectionZoneItem::parentGraphWidget() const noexcept
150 148 {
General Comments 0
You need to be logged in to leave comments. Login now