Skip to content

Commit d09f287

Browse files
author
Davide Faconti
committed
Added Help->About dialog
1 parent 4911c0e commit d09f287

File tree

5 files changed

+184
-0
lines changed

5 files changed

+184
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ set(RESOURCE_FILES
7373
)
7474

7575
set(FORMS_UI
76+
./bt_editor/about_dialog.ui
7677
./bt_editor/mainwindow.ui
7778
./bt_editor/action_form.ui
7879
./bt_editor/sidepanel_editor.ui

bt_editor/about_dialog.ui

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Dialog</class>
4+
<widget class="QDialog" name="Dialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>618</width>
10+
<height>450</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Dialog</string>
15+
</property>
16+
<property name="styleSheet">
17+
<string notr="true">background-color: #1c2b36;</string>
18+
</property>
19+
<layout class="QVBoxLayout" name="verticalLayout">
20+
<item>
21+
<widget class="QPushButton" name="pushButton">
22+
<property name="minimumSize">
23+
<size>
24+
<width>24</width>
25+
<height>24</height>
26+
</size>
27+
</property>
28+
<property name="maximumSize">
29+
<size>
30+
<width>24</width>
31+
<height>24</height>
32+
</size>
33+
</property>
34+
<property name="baseSize">
35+
<size>
36+
<width>24</width>
37+
<height>24</height>
38+
</size>
39+
</property>
40+
<property name="layoutDirection">
41+
<enum>Qt::RightToLeft</enum>
42+
</property>
43+
<property name="text">
44+
<string/>
45+
</property>
46+
<property name="icon">
47+
<iconset resource="resources/icons.qrc">
48+
<normaloff>:/icons/close_x.png</normaloff>:/icons/close_x.png</iconset>
49+
</property>
50+
<property name="iconSize">
51+
<size>
52+
<width>24</width>
53+
<height>24</height>
54+
</size>
55+
</property>
56+
<property name="flat">
57+
<bool>true</bool>
58+
</property>
59+
</widget>
60+
</item>
61+
<item>
62+
<widget class="QFrame" name="frame">
63+
<property name="minimumSize">
64+
<size>
65+
<width>600</width>
66+
<height>200</height>
67+
</size>
68+
</property>
69+
<property name="maximumSize">
70+
<size>
71+
<width>600</width>
72+
<height>200</height>
73+
</size>
74+
</property>
75+
<property name="frameShape">
76+
<enum>QFrame::NoFrame</enum>
77+
</property>
78+
<property name="frameShadow">
79+
<enum>QFrame::Plain</enum>
80+
</property>
81+
<layout class="QHBoxLayout" name="horizontalLayout"/>
82+
</widget>
83+
</item>
84+
<item>
85+
<widget class="QTextBrowser" name="text">
86+
<property name="styleSheet">
87+
<string notr="true">color: white</string>
88+
</property>
89+
<property name="frameShape">
90+
<enum>QFrame::NoFrame</enum>
91+
</property>
92+
<property name="frameShadow">
93+
<enum>QFrame::Plain</enum>
94+
</property>
95+
<property name="html">
96+
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
97+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
98+
p, li { white-space: pre-wrap; }
99+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
100+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Thanks for using Groot.&lt;/p&gt;
101+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
102+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This project is one of the main components of &lt;a href=&quot;https://eurecat.org/es/portfolio-items/mood2be/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#8ae234;&quot;&gt;MOOD2Be&lt;/span&gt;&lt;/a&gt;, and it is developed at &lt;a href=&quot;https://eurecat.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#8ae234;&quot;&gt;Eurecat&lt;/span&gt;&lt;/a&gt; by Davide Faconti.&lt;/p&gt;
103+
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;MOOD2Be is one of the six &lt;span style=&quot; font-weight:600;&quot;&gt;Integrated Technical Projects (ITPs)&lt;/span&gt; selected from the &lt;a href=&quot;https://robmosys.eu/itp/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#8ae234;&quot;&gt;RobMoSys first open call&lt;/span&gt;&lt;/a&gt;. It received funding from the European Union’s Horizon 2020 Research and Innovation Programme under the RobMoSys project.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
104+
</property>
105+
</widget>
106+
</item>
107+
</layout>
108+
</widget>
109+
<resources>
110+
<include location="resources/icons.qrc"/>
111+
<include location="resources/icons.qrc"/>
112+
</resources>
113+
<connections>
114+
<connection>
115+
<sender>pushButton</sender>
116+
<signal>pressed()</signal>
117+
<receiver>Dialog</receiver>
118+
<slot>accept()</slot>
119+
<hints>
120+
<hint type="sourcelabel">
121+
<x>596</x>
122+
<y>20</y>
123+
</hint>
124+
<hint type="destinationlabel">
125+
<x>308</x>
126+
<y>224</y>
127+
</hint>
128+
</hints>
129+
</connection>
130+
</connections>
131+
</ui>

bt_editor/mainwindow.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
#include <QToolButton>
1212
#include <QWidgetAction>
1313
#include <QTreeWidgetItem>
14+
#include <QSvgWidget>
1415
#include <QShortcut>
1516
#include <QTabBar>
17+
#include <QDesktopServices>
1618
#include <QInputDialog>
1719
#include <nodes/Node>
1820
#include <nodes/NodeData>
@@ -30,6 +32,8 @@
3032

3133
#include "utils.h"
3234

35+
#include "ui_about_dialog.h"
36+
3337
using QtNodes::DataModelRegistry;
3438
using QtNodes::FlowView;
3539
using QtNodes::FlowScene;
@@ -1346,3 +1350,28 @@ void MainWindow::clearTreeModels()
13461350
_tree_nodes_model = BuiltinNodeModels();
13471351
_editor_widget->updateTreeView();
13481352
}
1353+
1354+
void MainWindow::on_actionAbout_triggered()
1355+
{
1356+
auto ui = new Ui_Dialog;
1357+
QDialog dialog(this);
1358+
ui->setupUi(&dialog);
1359+
1360+
auto svg_widget = new QSvgWidget( tr(":/icons/svg/logo_splashscreen.svg") );
1361+
ui->frame->layout()->addWidget(svg_widget);
1362+
dialog.setWindowFlags( Qt::SplashScreen );
1363+
// dialog.setFixedSize( dialog.minimumSizeHint() );
1364+
dialog.exec();
1365+
1366+
}
1367+
1368+
void MainWindow::on_actionReportIssue_triggered()
1369+
{
1370+
const char* url = "https://github.com/BehaviorTree/Groot/issues";
1371+
QMessageBox::warning( this, "Issue Reporting",
1372+
tr("Reporting an issue you allow us to make this software better and better. Thanks!\n"
1373+
"You will be redirected to our Github Page:\n\n"
1374+
"%1").arg(url),
1375+
QMessageBox::Ok);
1376+
QDesktopServices::openUrl(QUrl(url));
1377+
}

bt_editor/mainwindow.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ public slots:
115115
signals:
116116
void updateGraphic();
117117

118+
private slots:
119+
void on_actionAbout_triggered();
120+
121+
void on_actionReportIssue_triggered();
122+
118123
private:
119124

120125
void updateCurrentMode();

bt_editor/mainwindow.ui

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,16 @@ QToolButton:disabled{
767767
</widget>
768768
<addaction name="menuSwitch_To"/>
769769
</widget>
770+
<widget class="QMenu" name="menuHelp">
771+
<property name="title">
772+
<string>Help</string>
773+
</property>
774+
<addaction name="actionReportIssue"/>
775+
<addaction name="actionAbout"/>
776+
</widget>
770777
<addaction name="menuLoad"/>
771778
<addaction name="menuMode"/>
779+
<addaction name="menuHelp"/>
772780
</widget>
773781
<action name="actionLoad">
774782
<property name="text">
@@ -819,6 +827,16 @@ QToolButton:disabled{
819827
<string>Log Replay</string>
820828
</property>
821829
</action>
830+
<action name="actionReportIssue">
831+
<property name="text">
832+
<string>Report an Issue...</string>
833+
</property>
834+
</action>
835+
<action name="actionAbout">
836+
<property name="text">
837+
<string>About</string>
838+
</property>
839+
</action>
822840
</widget>
823841
<resources>
824842
<include location="resources/icons.qrc"/>

0 commit comments

Comments
 (0)