Author: kitone
Date: Sun Jun 7 14:55:37 2015
New Revision: 937
URL: http://svn.gna.org/viewcvs/subtitleeditor?rev=937&view=rev
Log:
Emit signals on style edition.
Modified:
trunk/ChangeLog
trunk/src/document.h
trunk/src/style.cc
trunk/src/styles.cc
Modified: trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/ChangeLog?rev=937&r1=936&r2=937&view=diff
==============================================================================
--- trunk/ChangeLog (original)
+++ trunk/ChangeLog Sun Jun 7 14:55:37 2015
@@ -1,3 +1,10 @@
+2015-06-07 kitone <[email protected]>
+
+ * src/document.h:
+ * src/style.cc:
+ * src/styles.cc:
+ Emit signals on style edition.
+
2015-06-06 kitone <[email protected]>
*
plugins/actions/configurekeyboardshortcuts/dialog-configure-keyboard-shortcuts.ui:
Modified: trunk/src/document.h
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/src/document.h?rev=937&r1=936&r2=937&view=diff
==============================================================================
--- trunk/src/document.h (original)
+++ trunk/src/document.h Sun Jun 7 14:55:37 2015
@@ -293,6 +293,12 @@
* the (external) timing mode of the document editing
changed.
* "document-changed"
* the document has changed after the editing of something
like subtitle, metadata ...
+ * "style-changed"
+ * one or more styles have been changed.
+ * "style-deleted"
+ * one or more styles have been removed.
+ * "style-insered"
+ * one or more styles have been created.
*/
sigc::signal<void>& get_signal(const std::string &name);
Modified: trunk/src/style.cc
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/src/style.cc?rev=937&r1=936&r2=937&view=diff
==============================================================================
--- trunk/src/style.cc (original)
+++ trunk/src/style.cc Sun Jun 7 14:55:37 2015
@@ -23,6 +23,7 @@
#include "style.h"
#include "utility.h"
+#include "document.h"
#include <iostream>
/*
@@ -144,6 +145,8 @@
(*m_iter)[column.encoding] = utility::string_to_int(value);
else
std::cerr << "Style::set " << name << " UNKNOW" << std::endl;
+
+ m_document->emit_signal("style-changed");
}
/*
Modified: trunk/src/styles.cc
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/src/styles.cc?rev=937&r1=936&r2=937&view=diff
==============================================================================
--- trunk/src/styles.cc (original)
+++ trunk/src/styles.cc Sun Jun 7 14:55:37 2015
@@ -84,7 +84,9 @@
*/
Style Styles::append()
{
- return Style(&m_document, m_document.get_style_model()->append());
+ Style style(&m_document, m_document.get_style_model()->append());
+ m_document.emit_signal("style-insered");
+ return style;
}
/*
@@ -93,5 +95,6 @@
void Styles::remove(const Style &style)
{
m_document.get_style_model()->erase(style.m_iter);
+ m_document.emit_signal("style-removed");
}
_______________________________________________
Subtitleeditor-commits mailing list
[email protected]
https://mail.gna.org/listinfo/subtitleeditor-commits