[qet] [1419] Title block template editor: the logos combo box is now updated after every change made from the logo manager . |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 1419
Author: xavier
Date: 2011-12-30 03:42:50 +0100 (Fri, 30 Dec 2011)
Log Message:
-----------
Title block template editor: the logos combo box is now updated after every change made from the logo manager.
Modified Paths:
--------------
branches/0.3/sources/titleblock/qettemplateeditor.cpp
branches/0.3/sources/titleblock/qettemplateeditor.h
branches/0.3/sources/titleblock/templatelogomanager.cpp
branches/0.3/sources/titleblock/templatelogomanager.h
Modified: branches/0.3/sources/titleblock/qettemplateeditor.cpp
===================================================================
--- branches/0.3/sources/titleblock/qettemplateeditor.cpp 2011-12-30 02:17:26 UTC (rev 1418)
+++ branches/0.3/sources/titleblock/qettemplateeditor.cpp 2011-12-30 02:42:50 UTC (rev 1419)
@@ -98,10 +98,9 @@
void QETTitleBlockTemplateEditor::editLogos() {
if (tb_template_) {
if (!logo_manager_) {
- logo_manager_ = new TitleBlockTemplateLogoManager(tb_template_);
+ initLogoManager();
}
logo_manager_ -> show();
- template_cell_editor_widget_ -> updateLogosComboBox(tb_template_);
}
}
@@ -243,6 +242,16 @@
);
}
+void QETTitleBlockTemplateEditor::initLogoManager() {
+ logo_manager_ = new TitleBlockTemplateLogoManager(tb_template_);
+ connect(
+ logo_manager_,
+ SIGNAL(logosChanged(const TitleBlockTemplate *)),
+ template_cell_editor_widget_,
+ SLOT(updateLogosComboBox(const TitleBlockTemplate *))
+ );
+}
+
/**
Update various things when user changes the selected cells.
@param selected_cells List of selected cells.
Modified: branches/0.3/sources/titleblock/qettemplateeditor.h
===================================================================
--- branches/0.3/sources/titleblock/qettemplateeditor.h 2011-12-30 02:17:26 UTC (rev 1418)
+++ branches/0.3/sources/titleblock/qettemplateeditor.h 2011-12-30 02:42:50 UTC (rev 1419)
@@ -80,6 +80,7 @@
void initActions();
void initMenus();
void initWidgets();
+ void initLogoManager();
public slots:
void selectedCellsChanged(QList<TitleBlockCell *>);
Modified: branches/0.3/sources/titleblock/templatelogomanager.cpp
===================================================================
--- branches/0.3/sources/titleblock/templatelogomanager.cpp 2011-12-30 02:17:26 UTC (rev 1418)
+++ branches/0.3/sources/titleblock/templatelogomanager.cpp 2011-12-30 02:42:50 UTC (rev 1419)
@@ -51,6 +51,13 @@
}
/**
+ Emit the logosChanged() signal.
+*/
+void TitleBlockTemplateLogoManager::emitLogosChangedSignal() {
+ emit(logosChanged(const_cast<const TitleBlockTemplate *>(managed_template_)));
+}
+
+/**
Initialize widgets composing the Logo manager
*/
void TitleBlockTemplateLogoManager::initWidgets() {
@@ -264,6 +271,7 @@
open_dialog_dir_ = QDir(filepath);
if (managed_template_ -> addLogoFromFile(filepath, logo_name)) {
fillView();
+ emitLogosChangedSignal();
}
}
@@ -275,7 +283,8 @@
if (current_logo.isNull()) return;
if (managed_template_ -> removeLogo(current_logo)) {
- fillView();
+ fillView();
+ emitLogosChangedSignal();
}
}
@@ -317,5 +326,6 @@
if (managed_template_ -> renameLogo(current_logo, entered_name)) {
fillView();
+ emitLogosChangedSignal();
}
}
Modified: branches/0.3/sources/titleblock/templatelogomanager.h
===================================================================
--- branches/0.3/sources/titleblock/templatelogomanager.h 2011-12-30 02:17:26 UTC (rev 1418)
+++ branches/0.3/sources/titleblock/templatelogomanager.h 2011-12-30 02:42:50 UTC (rev 1419)
@@ -35,7 +35,12 @@
public:
QString currentLogo() const;
+ signals:
+ void logosChanged(const TitleBlockTemplate *);
+
protected:
+ void emitLogosChangedSignal();
+
private:
void initWidgets();
void fillView();