Skip to content

Commit

Permalink
3 ➡️ 4 (#234)
Browse files Browse the repository at this point in the history
* Release 3.5.1 (#195)

Signed-off-by: Steve Peters <[email protected]>

* check_test_ran.py: remove grep/xsltproc (#203)

We aren't using QTest anymore in ign-gui, so remove
the parts of check_test_ran.py that translated QTest
xml files into junit, since they don't work easily
on Windows and aren't needed any longer.

Fixes #198.

Signed-off-by: Steve Peters <[email protected]>

* Fixed material specular in scene3D (#218)

Signed-off-by: ahcorde <[email protected]>

* Remove tools/code_check and update codecov (#222)

Signed-off-by: Louise Poubel <[email protected]>

* Removed duplicated code with rendering::sceneFromFirstRenderEngine (#223)

Signed-off-by: ahcorde <[email protected]>

* Emit more events from Scene3D (#213)

* Start porting events from ign-gazebo

Signed-off-by: Louise Poubel <[email protected]>

* Remove test that fails due to #216

Signed-off-by: Louise Poubel <[email protected]>

* Move Scene3d_TEST.cc to test/integration

There seems to be a problem with loading the ignition-rendering-ogre
plugin from the Scene3D test if it links to that plugin. Making
Scene3D_TEST.cc into an integration test works because it doesn't
directly call any plugin methods.

This also changes the linking for the Grid3D plugin to only link
to the ignition-rendering core library target instead of the
IGNITION-RENDERING_LIBRARIES variable which includes the ogre
component library plugins.

Signed-off-by: Steve Peters <[email protected]>

* process qt events to allow scene to initialize

Signed-off-by: Steve Peters <[email protected]>

* Add test helper to check event

Signed-off-by: Louise Poubel <[email protected]>

* added more tests

Signed-off-by: ahcorde <[email protected]>

* make linters happy

Signed-off-by: ahcorde <[email protected]>

* Move TestHelper code to .cc file, fix windows?

Signed-off-by: Steve Peters <[email protected]>

* Fix windows?

Signed-off-by: ahcorde <[email protected]>

* Fix windows?

Signed-off-by: Alejandro Hernández <[email protected]>

* Expect values of Vector3 point in click events

Signed-off-by: Steve Peters <[email protected]>

* Remove debug message

Signed-off-by: Steve Peters <[email protected]>

* Remove unused variable

Signed-off-by: Steve Peters <[email protected]>

Co-authored-by: Steve Peters <[email protected]>
Co-authored-by: ahcorde <[email protected]>

* Avoid grid3D crash (#227)

Signed-off-by: ahcorde <[email protected]>

* Confirmation dialog when closing main window (#225)

* Adds confirmation dialog when closing window
* Updates docs and extends test coverage.
* Adds dialog_on_exit atribute to example .config

Signed-off-by: Franco Cipollone <[email protected]>

* update codeowners (#232)

Signed-off-by: Jenn Nguyen <[email protected]>

* 🎈 3.6.0 (#233)

Signed-off-by: Louise Poubel <[email protected]>

* Bump required ign-rendering version to 4.8 (#234)

Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Steve Peters <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Franco Cipollone <[email protected]>
Co-authored-by: Jenn Nguyen <[email protected]>
  • Loading branch information
5 people authored Jun 22, 2021
2 parents 1fd25de + 6feab90 commit 8e8f51c
Show file tree
Hide file tree
Showing 29 changed files with 722 additions and 6,129 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

* @chapulina
* @jennuine
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id: ci
uses: ignition-tooling/action-ignition-ci@bionic
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
codecov-enabled: true
focal-ci:
runs-on: ubuntu-latest
name: Ubuntu Focal CI
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project(ignition-gui4 VERSION 4.3.0)
#============================================================================
# Find ignition-cmake
#============================================================================
find_package(ignition-cmake2 2.3 REQUIRED)
find_package(ignition-cmake2 2.8.0 REQUIRED)

#============================================================================
# Configure the project
Expand Down Expand Up @@ -59,7 +59,7 @@ set(IGN_TRANSPORT_VER ${ignition-transport9_VERSION_MAJOR})

#--------------------------------------
# Find ignition-rendering
ign_find_package(ignition-rendering4 REQUIRED COMPONENTS ogre)
ign_find_package(ignition-rendering4 REQUIRED VERSION 4.8 COMPONENTS ogre)
set(IGN_RENDERING_VER ${ignition-rendering4_VERSION_MAJOR})

#--------------------------------------
Expand Down
34 changes: 34 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,40 @@

### Ignition Gui 3.X.X (202X-XX-XX)

### Ignition Gui 3.6.0 (2021-06-17)

1. Update codeowners
* [Pull request #232](https://github.com/ignitionrobotics/ign-gui/pull/232)

1. Confirmation dialog when closing main window
* [Pull request #225](https://github.com/ignitionrobotics/ign-gui/pull/225)

1. Avoid grid3D crash
* [Pull request #227](https://github.com/ignitionrobotics/ign-gui/pull/227)

1. Emit more events from Scene3D
* [Pull request #213](https://github.com/ignitionrobotics/ign-gui/pull/213)

1. Removed duplicated code with rendering::sceneFromFirstRenderEngine
* [Pull request #223](https://github.com/ignitionrobotics/ign-gui/pull/223)

1. Remove `tools/code_check` and update codecov
* [Pull request #222](https://github.com/ignitionrobotics/ign-gui/pull/222)

1. Fixed material specular in `Scene3D`
* [Pull request #218](https://github.com/ignitionrobotics/ign-gui/pull/218)

1. `check_test_ran.py`: remove grep/xsltproc
* [Pull request #203](https://github.com/ignitionrobotics/ign-gui/pull/203)

### Ignition Gui 3.5.1 (2021-03-18)

1. Scene3D: port mesh material fixes from ign-gazebo
* [Pull request #191](https://github.com/ignitionrobotics/ign-gui/pull/191)

1. Improve the height of plugins in the right split
* [Pull request #194](https://github.com/ignitionrobotics/ign-gui/pull/194)

### Ignition Gui 3.5.0 (2021-03-10)

1. Screenshot plugin
Expand Down
1 change: 1 addition & 0 deletions examples/config/layout.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<position_y>230</position_y>
<width>550</width>
<height>551</height>
<dialog_on_exit>true</dialog_on_exit>
</window>
<plugin filename="Publisher">
<title>1</title>
Expand Down
21 changes: 20 additions & 1 deletion include/ignition/gui/MainWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace ignition

/// \brief The main window class creates a QQuickWindow and acts as an
/// interface which provides properties and functions which can be called
/// from MainWindow.qml
/// from Main.qml
class IGNITION_GUI_VISIBLE MainWindow : public QObject
{
Q_OBJECT
Expand Down Expand Up @@ -177,6 +177,14 @@ namespace ignition
NOTIFY ShowPluginMenuChanged
)

/// \brief Flag to enable confirmation dialog on exit
Q_PROPERTY(
bool showDialogOnExit
READ ShowDialogOnExit
WRITE SetShowDialogOnExit
NOTIFY ShowDialogOnExitChanged
)

/// \brief Constructor
public: MainWindow();

Expand Down Expand Up @@ -344,6 +352,14 @@ namespace ignition
/// \param[in] _showPluginMenu True to show.
public: Q_INVOKABLE void SetShowPluginMenu(const bool _showPluginMenu);

/// \brief Get the flag to show the plugin menu.
/// \return True to show.
public: Q_INVOKABLE bool ShowDialogOnExit() const;

/// \brief Set the flag to show the confirmation dialog when exiting.
/// \param[in] _showDialogOnExit True to show.
public: Q_INVOKABLE void SetShowDialogOnExit(bool _showDialogOnExit);

/// \brief Callback when load configuration is selected
public slots: void OnLoadConfig(const QString &_path);

Expand Down Expand Up @@ -398,6 +414,9 @@ namespace ignition
/// \brief Notifies when the show menu flag has changed.
signals: void ShowPluginMenuChanged();

/// \brief Notifies when the showDialogOnExit flag has changed.
signals: void ShowDialogOnExitChanged();

/// \brief Notifies when the window config has changed.
signals: void configChanged();

Expand Down
31 changes: 30 additions & 1 deletion include/ignition/gui/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ApplicationWindow
property string pluginToolBarTextColorLight: MainWindow.pluginToolBarTextColorLight
property string pluginToolBarColorDark: MainWindow.pluginToolBarColorDark
property string pluginToolBarTextColorDark: MainWindow.pluginToolBarTextColorDark

property bool showDialogOnExit: MainWindow.showDialogOnExit
/**
* Tool bar background color
*/
Expand All @@ -71,6 +71,14 @@ ApplicationWindow
titleLabel.text = window.title
}

// Handler for window closing
onClosing: {
close.accepted = !showDialogOnExit
if(showDialogOnExit){
confirmationDialogOnExit.open()
}
}

// C++ signals to QML slots
Connections {
target: MainWindow
Expand Down Expand Up @@ -315,4 +323,25 @@ ApplicationWindow
}
}
}

/**
* Confirmation dialog on close button
*/
Dialog {
id: confirmationDialogOnExit
title: "Do you really want to exit?"

modal: true
focus: true
parent: ApplicationWindow.overlay
width: 300
x: (parent.width - width) / 2
y: (parent.height - height) / 2
closePolicy: Popup.CloseOnEscape
standardButtons: Dialog.Ok | Dialog.Cancel

onAccepted: {
Qt.quit()
}
}
}
8 changes: 8 additions & 0 deletions src/Application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ bool Application::LoadConfig(const std::string &_config)
return false;
}
this->dataPtr->windowConfig.MergeFromXML(std::string(printer.CStr()));

// Closing behavior.
if (auto dialogOnExitElem = winElem->FirstChildElement("dialog_on_exit"))
{
bool showDialogOnExit{false};
dialogOnExitElem->QueryBoolText(&showDialogOnExit);
this->dataPtr->mainWin->SetShowDialogOnExit(showDialogOnExit);
}
}

this->ApplyConfig();
Expand Down
16 changes: 16 additions & 0 deletions src/MainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ namespace ignition
/// \brief Minimum number of paint events to consider the window to be
/// fully initialized.
public: const unsigned int paintCountMin{20};

/// \brief Show the confirmation dialog on exit
public: bool showDialogOnExit{false};
};
}
}
Expand Down Expand Up @@ -843,3 +846,16 @@ void MainWindow::SetShowPluginMenu(const bool _showPluginMenu)
this->dataPtr->windowConfig.showPluginMenu = _showPluginMenu;
this->ShowPluginMenuChanged();
}

/////////////////////////////////////////////////
bool MainWindow::ShowDialogOnExit() const
{
return this->dataPtr->showDialogOnExit;
}

/////////////////////////////////////////////////
void MainWindow::SetShowDialogOnExit(bool _showDialogOnExit)
{
this->dataPtr->showDialogOnExit = _showDialogOnExit;
this->ShowDialogOnExitChanged();
}
2 changes: 1 addition & 1 deletion src/plugins/grid_3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ ign_gui_add_plugin(Grid3D
TEST_SOURCES
# Grid3D_TEST.cc
PUBLIC_LINK_LIBS
${IGNITION-RENDERING_LIBRARIES}
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}
)

4 changes: 2 additions & 2 deletions src/plugins/grid_3d/Grid3D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ namespace plugins
class Grid3DPrivate
{
/// brief Parent window
public: QQuickWindow *quickWindow;
public: QQuickWindow *quickWindow = nullptr;

/// \brief We keep a pointer to the engine and rely on it not being
/// destroyed, since it is a singleton.
public: rendering::RenderEngine *engine;
public: rendering::RenderEngine *engine = nullptr;

/// \brief We keep the scene name rather than a shared pointer because we
/// don't want to share ownership.
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/scene3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ ign_gui_add_plugin(Scene3D
Scene3D.cc
QT_HEADERS
Scene3D.hh
TEST_SOURCES
# Scene3D_TEST.cc
PUBLIC_LINK_LIBS
${IGNITION-RENDERING_LIBRARIES}
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}
)

Loading

0 comments on commit 8e8f51c

Please sign in to comment.