Skip to content

Commit

Permalink
5 ➡️ 6 (main)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Sep 9, 2021
2 parents 51e7f4b + 1cad501 commit 0221c3a
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 105 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ ign_create_docs(
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md"
ADDITIONAL_INPUT_DIRS "${CMAKE_SOURCE_DIR}/src/plugins"
TAGFILES
"\"${CMAKE_SOURCE_DIR}/doc/qt.tag.xml=http://doc.qt.io/qt-5/\" \
\"${IGNITION-MATH_DOXYGEN_TAGFILE} = ${IGNITION-MATH_API_URL}\" \
\"${IGNITION-MSGS_DOXYGEN_TAGFILE} = ${IGNITION-MSGS_API_URL}\" \
\"${IGNITION-RENDERING_DOXYGEN_TAGFILE} = ${IGNITION-RENDERING_API_URL}\" \
\"${IGNITION-TRANSPORT_DOXYGEN_TAGFILE} = ${IGNITION-TRANSPORT_API_URL}\" \
\"${IGNITION-COMMON_DOXYGEN_TAGFILE} = ${IGNITION-COMMON_API_URL}\""
"${CMAKE_SOURCE_DIR}/doc/qt.tag.xml=http://doc.qt.io/qt-5/"
"${IGNITION-MATH_DOXYGEN_TAGFILE} = ${IGNITION-MATH_API_URL}"
"${IGNITION-MSGS_DOXYGEN_TAGFILE} = ${IGNITION-MSGS_API_URL}"
"${IGNITION-RENDERING_DOXYGEN_TAGFILE} = ${IGNITION-RENDERING_API_URL}"
"${IGNITION-TRANSPORT_DOXYGEN_TAGFILE} = ${IGNITION-TRANSPORT_API_URL}"
"${IGNITION-COMMON_DOXYGEN_TAGFILE} = ${IGNITION-COMMON_API_URL}"
)

if(TARGET doc)
Expand Down
38 changes: 38 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@

### Ignition Gui 5.X.X (20XX-XX-XX)

### Ignition Gui 5.2.0 (2021-07-27)

1. New teleop plugin implementation.
* [Pull request #245](https:/ignitionrobotics/ign-gui/pull/245)

1. Fix plugin added signal, add PluginByName
* [Pull request #249](https:/ignitionrobotics/ign-gui/pull/249)

1. Fixed tests by passing valid argv
* [Pull request #244](https:/ignitionrobotics/ign-gui/pull/244)

1. Screenshot plugin fixed dbg message
* [Pull request #246](https:/ignitionrobotics/ign-gui/pull/246)

1. Detect ign instead of using cmake module to check for ignition-tools
* [Pull request #240](https:/ignitionrobotics/ign-gui/pull/240)

### Ignition Gui 5.1.0 (2021-06-23)

1. Depend on common 4.1 and rendering 5.1
Expand Down Expand Up @@ -67,6 +84,27 @@

### Ignition Gui 4.X.X (20XX-XX-XX)


### Ignition Gui 4.5.0 (2021-07-26)

1. New teleop plugin implementation.
* [Pull request #245](https:/ignitionrobotics/ign-gui/pull/245)

1. Fix codeowners
* [Pull request #251](https:/ignitionrobotics/ign-gui/pull/251)

1. Fix plugin added signal, add PluginByName
* [Pull request #249](https:/ignitionrobotics/ign-gui/pull/249)

1. Fixed tests by passing valid argv
* [Pull request #244](https:/ignitionrobotics/ign-gui/pull/244)

1. Screenshot plugin fixed dbg message
* [Pull request #246](https:/ignitionrobotics/ign-gui/pull/246)

1. Detect ign instead of using cmake module to check for ignition-tools
* [Pull request #240](https:/ignitionrobotics/ign-gui/pull/240)

### Ignition Gui 4.4.0 (2021-06-21)

1. Bump required ign-rendering version to 4.8
Expand Down
10 changes: 10 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ release will remove the deprecated code.
* The `Scene3D` plugin is deprecated, use `MinimalScene` with
`TransportSceneManager` instead.

## Ignition GUI 5.1 to 5.2

* The `Application::PluginAdded` signal used to send empty strings. Now it
sends the plugin's unique name.

## Ignition GUI 4.4 to 4.5

* The `Application::PluginAdded` signal used to send empty strings. Now it
sends the plugin's unique name.

## Ignition GUI 3.x to 4.x

* Use rendering4, transport9 and msgs6.
Expand Down
85 changes: 0 additions & 85 deletions bitbucket-pipelines.yml

This file was deleted.

86 changes: 86 additions & 0 deletions include/ignition/gui/qml/IgnSortFilterModel.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Copyright (C) 2021 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

// Borrowed from
// https://martin.rpdev.net/2019/01/15/using-delegatemodel-in-qml-for-sorting-and-filtering.html

import QtQuick 2.9
import QtQml.Models 2.3

DelegateModel {
/**
* Used by sorting. Override it to create custom sort behaviour.
*/
property var lessThan: function(_left, _right)
{
return true;
}

/**
* Override this function to define what items should be accepted or not.
*/
property var filterAcceptsItem: function(_item)
{
return true;
}

/**
* Update the item list
*/
function update() {
if (items.count > 0) {
items.setGroups(0, items.count, "items");
}

// Step 1: Filter items
var visible = [];
for (var i = 0; i < items.count; ++i) {
var item = items.get(i);
if (filterAcceptsItem(item.model)) {
visible.push(item);
}
}

// Step 2: Sort the list of visible items
visible.sort(function(_a, _b) {
return lessThan(_a.model, _b.model) ? -1 : 1;
});

// Step 3: Add all items to the visible group:
for (i = 0; i < visible.length; ++i) {
item = visible[i];
item.inVisible = true;
if (item.visibleIndex !== i) {
visibleItems.move(item.visibleIndex, i, 1);
}
}
}

items.onChanged: update()
onLessThanChanged: update()
onFilterAcceptsItemChanged: update()

groups: DelegateModelGroup {
id: visibleItems

name: "visible"
includeByDefault: false
}

filterOnGroup: "visible"
}

3 changes: 2 additions & 1 deletion include/ignition/gui/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ ApplicationWindow

PluginMenu {
id: pluginMenu
width: 200
x: parent.width - width
height: window.height * 0.3
transformOrigin: Menu.TopRight
transformOrigin: Popup.TopRight
}
}
}
Expand Down
90 changes: 77 additions & 13 deletions include/ignition/gui/qml/PluginMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,92 @@
*/
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.Controls.Material.impl 2.2
import QtQuick.Layouts 1.3

Menu {
Popup {
id: pluginMenu
padding: 0

Connections {
target: MainWindow
onConfigChanged: {
pluginMenuListView.model = MainWindow.PluginListModel()
filteredModel.model = MainWindow.PluginListModel()
}
}

ListView {
id: pluginMenuListView
height: pluginMenu.height
/**
* Color for search bar
*/
property color searchColor: (Material.theme == Material.Light) ?
Material.color(Material.Grey, Material.Shade200):
Material.color(Material.Grey, Material.Shade900);

onOpened: searchField.forceActiveFocus()

ColumnLayout {
anchors.fill: parent
spacing: 0

Rectangle {
id: searchSortBar
color: searchColor
height: 50
width: parent.width
RowLayout {
id: rowLayout
anchors.fill: parent
spacing: 0
Rectangle {
color: "transparent"
height: 25
width: 25
Layout.leftMargin: 5
Image {
id: searchIcon
source: "images/search.svg"
anchors.verticalCenter: parent.verticalCenter
}
}
TextField {
id: searchField
Layout.fillHeight: true
Layout.preferredWidth: parent.width - 50
selectByMouse: true
onTextEdited: {
filteredModel.update();
}
}
}
}

ListView {
id: pluginMenuListView
Layout.fillHeight: true
width: parent.width
clip: true

model: filteredModel

ScrollBar.vertical: ScrollBar {
active: true
width: 8
policy: ScrollBar.AlwaysOn
}
}
}

IgnSortFilterModel {
id: filteredModel

filterAcceptsItem: function(item) {
var itemStr = item.modelData.toLowerCase();
var filterStr = searchField.text.toLowerCase();
return itemStr.includes(filterStr);
}

model: MainWindow.PluginListModel()

delegate: ItemDelegate {
width: parent.width
Expand All @@ -41,14 +113,6 @@ Menu {
pluginMenu.close()
}
}

model: MainWindow.PluginListModel()

ScrollBar.vertical: ScrollBar {
active: true
width: 8
policy: ScrollBar.AlwaysOn
}
}
}

Loading

0 comments on commit 0221c3a

Please sign in to comment.