Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
0ceb22b9
Commit
0ceb22b9
authored
Apr 21, 2010
by
Sebastian Eichelbaum
Browse files
[CHANGE] - GUI now forbids deletion of nav slices as they would crash OW
parent
dd6d5918
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
+22
-3
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
+5
-0
No files found.
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
View file @
0ceb22b9
...
...
@@ -74,9 +74,9 @@ WQtDatasetBrowser::WQtDatasetBrowser( WMainWindow* parent )
m_moduleTreeWidget
->
setMinimumHeight
(
250
);
// create context menu for tree items
QAction
*
deleteModuleAction
=
new
QAction
(
WQt4Gui
::
getMainWindow
()
->
getIconManager
()
->
getIcon
(
"remove"
),
"Remove Module"
,
m_moduleTreeWidget
);
connect
(
deleteModuleAction
,
SIGNAL
(
triggered
()
),
this
,
SLOT
(
deleteModuleTreeItem
()
)
);
m_moduleTreeWidget
->
addAction
(
deleteModuleAction
);
m_
deleteModuleAction
=
new
QAction
(
WQt4Gui
::
getMainWindow
()
->
getIconManager
()
->
getIcon
(
"remove"
),
"Remove Module"
,
m_moduleTreeWidget
);
connect
(
m_
deleteModuleAction
,
SIGNAL
(
triggered
()
),
this
,
SLOT
(
m_
deleteModuleTreeItem
()
)
);
m_moduleTreeWidget
->
addAction
(
m_
deleteModuleAction
);
m_textureSorter
=
new
WQtTextureSorter
(
m_panel
);
m_textureSorter
->
setToolTip
(
"Reorder the textures."
);
...
...
@@ -410,20 +410,39 @@ void WQtDatasetBrowser::selectTreeItem()
// Here we just take a prototype module with no output connectors
// to get the modules with no input connector.
module
=
WModuleFactory
::
getModuleFactory
()
->
getPrototypeByName
(
"HUD"
);
// deletion of headers and subjects is not allowed
m_deleteModuleAction
->
setEnabled
(
false
);
createCompatibleButtons
(
module
);
break
;
case
DATASET
:
module
=
(
static_cast
<
WQtDatasetTreeItem
*
>
(
m_moduleTreeWidget
->
selectedItems
().
at
(
0
)
)
)
->
getModule
();
// crashed modules should not provide any props
if
(
module
->
isCrashed
()()
)
{
return
;
}
// enable the delete action as it might be disabled before.
m_deleteModuleAction
->
setEnabled
(
true
);
props
=
module
->
getProperties
();
infoProps
=
module
->
getInformationProperties
();
createCompatibleButtons
(
module
);
break
;
case
MODULE
:
module
=
(
static_cast
<
WQtModuleTreeItem
*
>
(
m_moduleTreeWidget
->
selectedItems
().
at
(
0
)
)
)
->
getModule
();
// NOTE: this hack prevents the navigation slices to be removed as they are buggy and crash OpenWalnut if they get removed
if
(
module
->
getName
()
==
"Navigation Slices"
)
{
m_deleteModuleAction
->
setEnabled
(
false
);
}
else
{
m_deleteModuleAction
->
setEnabled
(
true
);
}
// crashed modules should not provide any props
if
(
module
->
isCrashed
()()
)
{
return
;
...
...
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
View file @
0ceb22b9
...
...
@@ -198,6 +198,11 @@ private:
std
::
vector
<
std
::
string
>
m_moduleWhiteList
;
//!< Stores a list of modules allowed to be shown.
/**
* The action to remove a module from the tree.
*/
QAction
*
m_deleteModuleAction
;
private
slots
:
/**
* function that gets called when a tree item is selected, on a new select that tab widget
...
...
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