Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
5dc18d30
Commit
5dc18d30
authored
Mar 13, 2013
by
Otmane Lahlou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: connect actions on the widget tree and on the search box to their slots
parent
9941b80c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
3 deletions
+73
-3
Code/Common/Gui/mvdApplicationsToolBox.cxx
Code/Common/Gui/mvdApplicationsToolBox.cxx
+60
-1
Code/Common/Gui/mvdApplicationsToolBox.h
Code/Common/Gui/mvdApplicationsToolBox.h
+13
-2
No files found.
Code/Common/Gui/mvdApplicationsToolBox.cxx
View file @
5dc18d30
...
...
@@ -38,6 +38,7 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAlgorithm.h"
namespace
mvd
{
...
...
@@ -68,6 +69,22 @@ ApplicationsToolBox
m_UI
(
new
mvd
::
Ui
::
ApplicationsToolBox
()
)
{
m_UI
->
setupUi
(
this
);
//
// connect search box changed
QObject
::
connect
(
m_UI
->
m_SearchLine
,
SIGNAL
(
textChanged
(
const
QString
&
)
),
this
,
SLOT
(
OnSearchBoxChanged
(
const
QString
&
)
)
);
//
// connect double click on the tree Widget
QObject
::
connect
(
GetAlgorithmsTree
(),
SIGNAL
(
itemDoubleClicked
(
QTreeWidgetItem
*
,
int
)
),
this
,
SLOT
(
OnAlgorithmTreeDoubleClick
(
QTreeWidgetItem
*
,
int
)
)
);
}
/*******************************************************************************/
...
...
@@ -112,7 +129,8 @@ ApplicationsToolBox
cmainItem
->
setText
(
0
,
qcurrentMainItem
);
//
// step #2 -> Applications name as secondary items
// TODO : add category icon
// step #2 -> Applications name are secondary items
StringVector
::
const_iterator
itApps
=
(
*
itTag
).
second
.
begin
();
while
(
itApps
!=
(
*
itTag
).
second
.
end
()
)
{
...
...
@@ -121,6 +139,10 @@ ApplicationsToolBox
QTreeWidgetItem
*
secItem
=
new
QTreeWidgetItem
(
cmainItem
);
QString
qcurrentSecItem
(
(
*
itApps
).
c_str
()
);
secItem
->
setText
(
0
,
qcurrentSecItem
);
//
// TODO : add algorithm icon
++
itApps
;
}
...
...
@@ -128,6 +150,14 @@ ApplicationsToolBox
}
}
/*******************************************************************************/
void
ApplicationsToolBox
::
ExecuteAlgorithm
(
const
QString
&
appName
)
{
std
::
cout
<<
"ApplicationsToolBox::ExecuteAlgorithm - "
<<
ToStdString
(
appName
)
<<
"- WIP."
<<
std
::
endl
;
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
...
...
@@ -142,6 +172,35 @@ ApplicationsToolBox
FillTreeUsingTags
();
}
/*******************************************************************************/
void
ApplicationsToolBox
::
OnSearchBoxChanged
(
const
QString
&
search
)
{
//
// get the search text
m_SearchText
=
search
;
// fill the tree with the application
FillTreeUsingTags
();
}
/*******************************************************************************/
void
ApplicationsToolBox
::
OnAlgorithmTreeDoubleClick
(
QTreeWidgetItem
*
item
,
int
column
)
{
std
::
cout
<<
"Algorithm name "
<<
ToStdString
(
item
->
text
(
column
)
)
<<
std
::
endl
;
QString
appName
=
item
->
text
(
column
);
//
// Execute the algorithm
if
(
!
appName
.
isEmpty
()
)
{
ExecuteAlgorithm
(
appName
);
}
}
/*******************************************************************************/
}
// end namespace 'mvd'
Code/Common/Gui/mvdApplicationsToolBox.h
View file @
5dc18d30
...
...
@@ -102,7 +102,9 @@ public:
//
// Public SLOTS.
public
slots
:
void
OnAvailableApplicationsTagsChanged
(
const
ApplicationsTagContainer
&
appsTags
);
void
OnAvailableApplicationsTagsChanged
(
const
ApplicationsTagContainer
&
appsTags
);
void
OnSearchBoxChanged
(
const
QString
&
search
);
void
OnAlgorithmTreeDoubleClick
(
QTreeWidgetItem
*
item
,
int
column
);
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
...
...
@@ -130,6 +132,11 @@ private:
*/
void
FillTreeUsingTags
();
/**
* \brief Launch the appName algorithm
*/
void
ExecuteAlgorithm
(
const
QString
&
appName
);
//
// Private attributes.
private:
...
...
@@ -141,8 +148,12 @@ private:
/**
* \brief map storing applications and its tags
*/
ApplicationsTagContainer
m_AppTags
;
ApplicationsTagContainer
m_AppTags
;
/**
* \brief text to search in the widget tree
*/
QString
m_SearchText
;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment