Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
Plugin-Datacontrol
Commits
cfcd9c6e
Commit
cfcd9c6e
authored
May 31, 2016
by
Hans-Christian Ebke
Browse files
Changed the header area widget installation mechanism to something more robust.
parent
b15b2b91
Changes
2
Hide whitespace changes
Inline
Side-by-side
DataControlPlugin.cc
View file @
cfcd9c6e
...
...
@@ -218,33 +218,27 @@ void DataControlPlugin::initializePlugin()
toolIcon_
=
new
QIcon
(
OpenFlipper
::
Options
::
iconDirStr
()
+
OpenFlipper
::
Options
::
dirSeparator
()
+
"datacontrol-toolbox.png"
);
emit
addToolbox
(
"Data Control"
,
tool_
,
toolIcon_
);
QWidget
*
childControlArea
=
tool_
->
parent
()
->
findChild
<
QWidget
*>
(
"ChildControlArea"
);
if
(
childControlArea
)
{
std
::
cout
<<
"Child Control Area found."
<<
std
::
endl
;
advancedSettingsBtn_
=
new
QToolButton
();
advancedSettingsBtn_
->
setAutoRaise
(
true
);
advancedSettingsBtn_
->
setIcon
(
QIcon
(
OpenFlipper
::
Options
::
iconDirStr
()
+
OpenFlipper
::
Options
::
dirSeparator
()
+
"preferences.png"
));
advancedSettingsBtn_
->
setIconSize
(
QSize
(
16
,
16
));
advancedSettingsBtn_
->
setPopupMode
(
QToolButton
::
InstantPopup
);
advancedSettingsBtn_
->
setToolTip
(
tr
(
"Advanced Settings"
));
QHBoxLayout
*
hl
=
new
QHBoxLayout
;
hl
->
addWidget
(
advancedSettingsBtn_
);
hl
->
addStretch
(
1
);
hl
->
setContentsMargins
(
8
,
0
,
0
,
0
);
childControlArea
->
setLayout
(
hl
);
QMenu
*
menu
=
new
QMenu
();
menu
->
addAction
(
tool_
->
lightSources
);
menu
->
addAction
(
tool_
->
notSelected
);
menu
->
addAction
(
tool_
->
sourceSelected
);
menu
->
addAction
(
tool_
->
targetSelected
);
advancedSettingsBtn_
->
setMenu
(
menu
);
}
else
{
std
::
cout
<<
"Child Control Area NOT found."
<<
std
::
endl
;
}
QWidget
*
headerAreaWidget
=
new
QWidget
();
advancedSettingsBtn_
=
new
QToolButton
();
advancedSettingsBtn_
->
setAutoRaise
(
true
);
advancedSettingsBtn_
->
setIcon
(
QIcon
(
OpenFlipper
::
Options
::
iconDirStr
()
+
OpenFlipper
::
Options
::
dirSeparator
()
+
"preferences.png"
));
advancedSettingsBtn_
->
setIconSize
(
QSize
(
16
,
16
));
advancedSettingsBtn_
->
setPopupMode
(
QToolButton
::
InstantPopup
);
advancedSettingsBtn_
->
setToolTip
(
tr
(
"Advanced Settings"
));
QHBoxLayout
*
hl
=
new
QHBoxLayout
;
hl
->
addWidget
(
advancedSettingsBtn_
);
hl
->
addStretch
(
1
);
hl
->
setContentsMargins
(
8
,
0
,
0
,
0
);
headerAreaWidget
->
setLayout
(
hl
);
QMenu
*
menu
=
new
QMenu
();
menu
->
addAction
(
tool_
->
lightSources
);
menu
->
addAction
(
tool_
->
notSelected
);
menu
->
addAction
(
tool_
->
sourceSelected
);
menu
->
addAction
(
tool_
->
targetSelected
);
advancedSettingsBtn_
->
setMenu
(
menu
);
emit
addToolbox
(
"Data Control"
,
tool_
,
toolIcon_
,
headerAreaWidget
);
}
...
...
@@ -903,7 +897,8 @@ void DataControlPlugin::saveOnExit(INIFile& _ini){
}
void
DataControlPlugin
::
showReducedUi
(
bool
reduced
)
{
advancedSettingsBtn_
->
setVisible
(
reduced
);
if
(
advancedSettingsBtn_
)
advancedSettingsBtn_
->
setVisible
(
reduced
);
}
void
DataControlPlugin
::
slotObjectUpdated
(
int
_identifier
,
const
UpdateType
&
_type
)
...
...
DataControlPlugin.hh
View file @
cfcd9c6e
...
...
@@ -110,7 +110,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
void
copyObject
(
int
_oldId
,
int
&
_newId
);
// ToolboxInterface
void
addToolbox
(
QString
_name
,
QWidget
*
_widget
,
QIcon
*
_icon
);
void
addToolbox
(
QString
_name
,
QWidget
*
_widget
,
QIcon
*
_icon
,
QWidget
*
_headerAreaWidget
);
private
slots
:
// BaseInterface
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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