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
17cda25a
Commit
17cda25a
authored
Jun 04, 2010
by
Mathias Goldau
Browse files
[CHANGE] Improved documentation, header include ordering and dataset browser shortcut
parent
7cd1ba93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
30 deletions
+45
-30
src/gui/qt4/WIconManager.cpp
src/gui/qt4/WIconManager.cpp
+5
-2
src/gui/qt4/WIconManager.h
src/gui/qt4/WIconManager.h
+8
-7
src/gui/qt4/WMainWindow.cpp
src/gui/qt4/WMainWindow.cpp
+1
-5
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
+16
-9
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
+15
-7
No files found.
src/gui/qt4/WIconManager.cpp
View file @
17cda25a
...
...
@@ -25,8 +25,9 @@
#include <cassert>
#include <string>
#include "
WIconManag
er.h"
#include "
../../common/WAss
er
t
.h"
#include "../../kernel/WModuleFactory.h"
#include "WIconManager.h"
void
WIconManager
::
addIcon
(
std
::
string
name
,
const
char
*
const
xpm
[]
)
{
...
...
@@ -48,7 +49,9 @@ QIcon WIconManager::getIcon( const std::string name )
icon
=
QIcon
(
QPixmap
(
WModuleFactory
::
getModuleFactory
()
->
getPrototypeByName
(
name
)
->
getXPMIcon
()
)
);
}
else
assert
(
0
&&
"No icon with the given name found."
);
{
WAssert
(
0
,
"Found no icon named: "
+
name
);
}
return
icon
;
}
src/gui/qt4/WIconManager.h
View file @
17cda25a
...
...
@@ -31,27 +31,28 @@
#include <QtGui/QIcon>
/**
*
class to store and handle access to all available icons
*
Manages icon access. Icons stored either here inside or inside of modules.
*/
class
WIconManager
{
public:
/**
*
function to a
dd an Icon to the icon store
* \param name
t
he icon's name
* \param xpm
t
he icon itself in XPM format
*
A
dd
s
an Icon to the icon store
* \param name
T
he icon's name
* \param xpm
T
he icon itself in XPM format
*/
void
addIcon
(
std
::
string
name
,
const
char
*
const
xpm
[]
);
/**
* returns a previously stored icon
* \param name name of the requested icon
* Searches icons in the internal map and all modules for the given icon name.
* \param name Name of the requested icon
* \return A QIcon copy if the icon name was found otherwise a WAssert will fail.
*/
QIcon
getIcon
(
const
std
::
string
name
);
protected:
private:
std
::
map
<
std
::
string
,
QIcon
*
>
m_iconList
;
//!< A map storing icons and the names used to identify them
std
::
map
<
std
::
string
,
QIcon
*
>
m_iconList
;
//!< A map storing icons and the names used to identify them
};
#endif // WICONMANAGER_H
src/gui/qt4/WMainWindow.cpp
View file @
17cda25a
...
...
@@ -120,11 +120,7 @@ void WMainWindow::setupGUI()
// directly -> set shortcuts, and some further properties using QAction's interface
QMenu
*
viewMenu
=
m_menuBar
->
addMenu
(
"View"
);
QAction
*
dsbTrigger
=
m_datasetBrowser
->
toggleViewAction
();
QList
<
QKeySequence
>
dsbShortcut
;
dsbShortcut
.
append
(
QKeySequence
(
Qt
::
Key_F9
)
);
dsbTrigger
->
setShortcuts
(
dsbShortcut
);
viewMenu
->
addAction
(
dsbTrigger
);
viewMenu
->
addAction
(
m_datasetBrowser
->
toggleViewAction
()
);
viewMenu
->
addSeparator
();
// NOTE: the shortcuts for these view presets should be chosen carefully. Most keysequences have another meaning in the most applications
...
...
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
View file @
17cda25a
...
...
@@ -29,32 +29,30 @@
#include <vector>
#include <QtCore/QList>
#include <QtGui/QMenu>
#include <QtGui/QScrollArea>
#include <QtGui/QShortcut>
#include <QtGui/QMenu>
#include "../../../common/WLogger.h"
#include "../../../common/WPreferences.h"
#include "../../../dataHandler/WDataSet.h"
#include "../../../kernel/WModuleFactory.h"
#include "../../../kernel/WKernel.h"
#include "../../../kernel/WModuleFactory.h"
#include "../../../modules/data/WMData.h"
#include "../events/WEventTypes.h"
#include "../events/WModuleAssocEvent.h"
#include "../events/WRoiAssocEvent.h"
#include "../events/WRoiRemoveEvent.h"
#include "../events/WModuleReadyEvent.h"
#include "../events/WModuleDeleteEvent.h"
#include "../events/WModuleReadyEvent.h"
#include "../events/WModuleRemovedEvent.h"
#include "../events/WEventTypes.h"
#include "../events/WRoiAssocEvent.h"
#include "../events/WRoiRemoveEvent.h"
#include "../guiElements/WQtApplyModulePushButton.h"
#include "../WMainWindow.h"
#include "../WQt4Gui.h"
#include "WQtBranchTreeItem.h"
#include "WQtNumberEdit.h"
#include "WQtNumberEditDouble.h"
#include "WQtTextureSorter.h"
#include "WQtBranchTreeItem.h"
#include "WQtDatasetBrowser.h"
...
...
@@ -818,6 +816,15 @@ boost::shared_ptr< WRMROIRepresentation > WQtDatasetBrowser::getFirstRoiInSelect
return
roi
;
}
QAction
*
WQtDatasetBrowser
::
toggleViewAction
()
const
{
QAction
*
result
=
QDockWidget
::
toggleViewAction
();
QList
<
QKeySequence
>
shortcut
;
shortcut
.
append
(
QKeySequence
(
Qt
::
Key_F9
)
);
result
->
setShortcuts
(
shortcut
);
return
result
;
}
void
WQtDatasetBrowser
::
deleteModuleTreeItem
()
{
if
(
m_moduleTreeWidget
->
selectedItems
().
count
()
>
0
)
...
...
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
View file @
17cda25a
...
...
@@ -56,21 +56,19 @@ class WQtDatasetBrowser : public QDockWidget
public:
/**
*
Default c
onstructor.
*
C
onstructor.
*
* \param parent Parent widget.
*
* \return
*/
explicit
WQtDatasetBrowser
(
WMainWindow
*
parent
=
0
);
/**
* Destructor.
*
Default
Destructor.
*/
virtual
~
WQtDatasetBrowser
();
/**
*
a
dds a page to the context widget
*
A
dds a page to the context widget
*
* \param content A widget with controls
*
...
...
@@ -79,7 +77,7 @@ public:
int
addTabWidgetContent
(
WQtDSBWidget
*
content
);
/**
*
a
dds a subject entry to the tree widget
*
A
dds a subject entry to the tree widget
*
* \param name The entry name of the subjectin the tree widget
* \return A pointer to the tree widget item
...
...
@@ -87,7 +85,7 @@ public:
WQtSubjectTreeItem
*
addSubject
(
std
::
string
name
);
/**
*
a
dds a dataset entry to any given subject in the tree widget
*
A
dds a dataset entry to any given subject in the tree widget
*
* \param module shared pointer to the module associated with this tree widget entry
* \param subjectId subject id this dataset belongs to
...
...
@@ -145,6 +143,16 @@ public:
*/
boost
::
shared_ptr
<
WRMROIRepresentation
>
getFirstRoiInSelectedBranch
();
/**
* Returns a checkable action that can be used to show or close this dock widget.
* The action's text is set to the dock widget's window title.
*
* This member function is overwritten to add a keyboard shortcut to this action.
*
* \return Modified QAction
*/
QAction
*
toggleViewAction
()
const
;
protected:
/**
...
...
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