diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in index dc50a686d..bcc2f0320 100644 --- a/src/definitions/definitions.h.in +++ b/src/definitions/definitions.h.in @@ -66,6 +66,7 @@ #define CHANGE_EVENT_DELAY 250 #define SPACER_OBJECT_NAME "spacer" #define FILTER_OBJECT_NAME "filter" +#define SEPARATOR_ACTION_NAME "separator" #define FILTER_WIDTH 150 #define FILTER_RIGHT_MARGIN 5 diff --git a/src/gui/basetoolbar.cpp b/src/gui/basetoolbar.cpp index fbacbb904..a46501f57 100644 --- a/src/gui/basetoolbar.cpp +++ b/src/gui/basetoolbar.cpp @@ -27,5 +27,8 @@ void BaseToolBar::loadChangeableActions() { if (available_actions.contains(action_name)) { addAction(available_actions.value(action_name)); } + else if (action_name == SEPARATOR_ACTION_NAME) { + addSeparator(); + } } } diff --git a/src/gui/messagestoolbar.cpp b/src/gui/messagestoolbar.cpp index c603f29a1..f9356daa4 100644 --- a/src/gui/messagestoolbar.cpp +++ b/src/gui/messagestoolbar.cpp @@ -56,6 +56,9 @@ void MessagesToolBar::saveChangeableActions() const { if (action_name != FILTER_OBJECT_NAME && action_name != SPACER_OBJECT_NAME) { action_names.append(action->objectName()); } + else if (action->isSeparator()) { + action_names.append(SEPARATOR_ACTION_NAME); + } } Settings::instance()->setValue(APP_CFG_GUI, "messages_toolbar", action_names.join(",")); diff --git a/src/gui/toolbareditor.cpp b/src/gui/toolbareditor.cpp index d81116f78..fb857c6cb 100644 --- a/src/gui/toolbareditor.cpp +++ b/src/gui/toolbareditor.cpp @@ -1,5 +1,7 @@ #include "gui/toolbareditor.h" +#include "gui/basetoolbar.h" + ToolBarEditor::ToolBarEditor(QWidget *parent) : QDialog(parent), m_ui(new Ui::ToolBarEditor) { @@ -9,3 +11,14 @@ ToolBarEditor::ToolBarEditor(QWidget *parent) ToolBarEditor::~ToolBarEditor() { delete m_ui; } + +void ToolBarEditor::loadFromToolBar(BaseToolBar* tool_bar) { + m_toolBar = tool_bar; + + // TODO: nastavit dialog podle toolbaru +} + +void ToolBarEditor::saveToolBar() { + // TODO: ulozit actiony nastaveny v tomdl + // e nastavovacim dialogu do prirazenyho toolbaru +} diff --git a/src/gui/toolbareditor.h b/src/gui/toolbareditor.h index 68ff2ec55..7d003f486 100644 --- a/src/gui/toolbareditor.h +++ b/src/gui/toolbareditor.h @@ -5,10 +5,13 @@ #include "ui_toolbareditor.h" + namespace Ui { class ToolBarEditor; } +class BaseToolBar; + // TODO: dialog pro úpravu prirazeneho toolbaru. class ToolBarEditor : public QDialog { Q_OBJECT @@ -18,8 +21,13 @@ class ToolBarEditor : public QDialog { explicit ToolBarEditor(QWidget *parent = 0); virtual ~ToolBarEditor(); + // Toolbar operations. + void loadFromToolBar(BaseToolBar *tool_bar); + void saveToolBar(); + private: Ui::ToolBarEditor *m_ui; + BaseToolBar *m_toolBar; }; #endif // TOOLBAREDITOR_H