diff --git a/CMakeLists.txt b/CMakeLists.txt index edbb0daad..c5624a6f1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,6 +292,7 @@ set(APP_SOURCES src/gui/messagebox.cpp src/gui/formupdate.cpp src/gui/comboboxwithstatus.cpp + src/gui/basetoolbar.cpp src/gui/messagestoolbar.cpp # DYNAMIC-SHORTCUTS sources. @@ -366,6 +367,7 @@ set(APP_HEADERS src/gui/messagebox.h src/gui/formupdate.h src/gui/comboboxwithstatus.h + src/gui/basetoolbar.h src/gui/messagestoolbar.h # DYNAMIC-SHORTCUTS headers. diff --git a/src/gui/basetoolbar.cpp b/src/gui/basetoolbar.cpp new file mode 100644 index 000000000..a1f189a39 --- /dev/null +++ b/src/gui/basetoolbar.cpp @@ -0,0 +1,9 @@ +#include "gui/basetoolbar.h" + + +BaseToolBar::BaseToolBar(const QString &title, QWidget *parent) + : QToolBar(title, parent) { +} + +BaseToolBar::~BaseToolBar() { +} diff --git a/src/gui/basetoolbar.h b/src/gui/basetoolbar.h new file mode 100644 index 000000000..09c4678a5 --- /dev/null +++ b/src/gui/basetoolbar.h @@ -0,0 +1,26 @@ +#ifndef TOOLBAR_H +#define TOOLBAR_H + +#include + + +class BaseToolBar : public QToolBar { + Q_OBJECT + + public: + // Constructors and destructors. + explicit BaseToolBar(const QString &title, QWidget *parent = 0); + virtual ~BaseToolBar(); + + virtual QList changeableActions() const = 0; + virtual void setChangeableActions(const QList actions) = 0; + virtual void saveChangeableActions() const = 0; + virtual void loadChangeableActions() = 0; + + signals: + + public slots: + +}; + +#endif // TOOLBAR_H diff --git a/src/gui/messagestoolbar.cpp b/src/gui/messagestoolbar.cpp index 653b5f473..2c7757584 100644 --- a/src/gui/messagestoolbar.cpp +++ b/src/gui/messagestoolbar.cpp @@ -2,7 +2,7 @@ MessagesToolBar::MessagesToolBar(const QString &title, QWidget *parent) - : QToolBar(title, parent) { + : BaseToolBar(title, parent) { } MessagesToolBar::~MessagesToolBar() { diff --git a/src/gui/messagestoolbar.h b/src/gui/messagestoolbar.h index 8d89ecfc0..06f5ed7ec 100644 --- a/src/gui/messagestoolbar.h +++ b/src/gui/messagestoolbar.h @@ -1,9 +1,10 @@ #ifndef NEWSTOOLBAR_H #define NEWSTOOLBAR_H -#include +#include "gui/basetoolbar.h" -class MessagesToolBar : public QToolBar { + +class MessagesToolBar : public BaseToolBar { Q_OBJECT public: @@ -11,6 +12,27 @@ class MessagesToolBar : public QToolBar { explicit MessagesToolBar(const QString &title, QWidget *parent = 0); virtual ~MessagesToolBar(); + QList changeableActions() const { + // TODO: Vracet akce, ktere muze uzivatel upravovat v tomto toolbaru. + // nebudou se tedy vracet spacer widgety nebo lineedity a tak podobnÄ›, + // proste jen akce ktere sou uzivatelsky upravitelne + // http://stackoverflow.com/questions/5364957/in-qt-4-7-how-can-a-pop-up-menu-be-added-to-a-qtoolbar-button + // http://www.qtcentre.org/threads/23840-how-align-some-buttons-in-QToolbar-from-right-to-left + return QList(); + } + + void setChangeableActions(const QList actions) { + // TODO: ulozit akce, ktere muze uzivatel upravovat do tohoto toolbaru + // todle musi zachovat vsechny widgety na konci - treba filtrovaci + // lineedit zprav + } + + void saveChangeableActions() const { + } + + void loadChangeableActions() { + } + signals: public slots: