summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/clonetiler.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-06-25 20:21:44 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-06-25 20:21:44 +0000
commit60f288cc584bf34c65698341427cf377b88c7138 (patch)
treeb8b7e6d3c24f95350e85e4c1754a27d5dc9bde6c /src/ui/dialog/clonetiler.cpp
parent1. make it compile (diff)
downloadinkscape-60f288cc584bf34c65698341427cf377b88c7138.tar.gz
inkscape-60f288cc584bf34c65698341427cf377b88c7138.zip
2. connect signals
(bzr r13341.5.2)
Diffstat (limited to 'src/ui/dialog/clonetiler.cpp')
-rw-r--r--src/ui/dialog/clonetiler.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index fb131d8da..b0298afa6 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -75,15 +75,12 @@ static gdouble trace_zoom;
static SPDocument *trace_doc = NULL;
-CloneTiler::CloneTiler (void) :
+CloneTiler::CloneTiler () :
UI::Widget::Panel ("", "/dialogs/clonetiler/", SP_VERB_DIALOG_CLONETILER),
dlg(NULL),
desktop(NULL),
deskTrack(),
- table_row_labels(NULL),
- selectChangedConn(),
- subselChangedConn(),
- selectModifiedConn()
+ table_row_labels(NULL)
{
Gtk::Box *contents = _getContents();
contents->set_spacing(0);
@@ -1272,12 +1269,14 @@ CloneTiler::CloneTiler (void) :
// connect to global selection changed signal (so we can change desktops) and
// external_change (so we're not fooled by undo)
- g_signal_connect (G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (clonetiler_change_selection), dlg);
- g_signal_connect (G_OBJECT (INKSCAPE), "external_change", G_CALLBACK (clonetiler_external_change), dlg);
- g_signal_connect(G_OBJECT(dlg), "destroy", G_CALLBACK(clonetiler_disconnect_gsignal), G_OBJECT (INKSCAPE));
+ selectChangedConn = INKSCAPE->signal_selection_changed.connect(sigc::hide<0>(sigc::bind(sigc::ptr_fun(&CloneTiler::clonetiler_change_selection), dlg)));
+ externChangedConn = INKSCAPE->signal_external_change.connect (sigc::hide<0>(sigc::bind(sigc::ptr_fun(&CloneTiler::clonetiler_external_change), dlg)));
+ //g_signal_connect (G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (clonetiler_change_selection), dlg);
+ //g_signal_connect (G_OBJECT (INKSCAPE), "external_change", G_CALLBACK (clonetiler_external_change), dlg);
+ g_signal_connect(G_OBJECT(dlg), "destroy", G_CALLBACK(clonetiler_disconnect_gsignal), this);
// update now
- clonetiler_change_selection (NULL, sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
+ clonetiler_change_selection (sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
}
{
@@ -1349,7 +1348,7 @@ void CloneTiler::on_picker_color_changed(guint rgba)
is_updating = false;
}
-void CloneTiler::clonetiler_change_selection(Inkscape::Application * /*inkscape*/, Inkscape::Selection *selection, GtkWidget *dlg)
+void CloneTiler::clonetiler_change_selection(Inkscape::Selection *selection, GtkWidget *dlg)
{
GtkWidget *buttons = GTK_WIDGET(g_object_get_data (G_OBJECT(dlg), "buttons_on_tiles"));
GtkWidget *status = GTK_WIDGET(g_object_get_data (G_OBJECT(dlg), "status"));
@@ -1378,16 +1377,21 @@ void CloneTiler::clonetiler_change_selection(Inkscape::Application * /*inkscape*
}
}
-void CloneTiler::clonetiler_external_change(Inkscape::Application * /*inkscape*/, GtkWidget *dlg)
+void CloneTiler::clonetiler_external_change(GtkWidget *dlg)
{
- clonetiler_change_selection (NULL, sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
+ clonetiler_change_selection (sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
}
-void CloneTiler::clonetiler_disconnect_gsignal(GObject *widget, gpointer source)
+void CloneTiler::clonetiler_disconnect_gsignal(GObject *, gpointer source)
{
- if (source && G_IS_OBJECT(source)) {
- sp_signal_disconnect_by_data (source, widget);
- }
+ //if (source && G_IS_OBJECT(source)) {
+ //sp_signal_disconnect_by_data (source, widget);
+ //}
+ g_return_if_fail(source != NULL);
+
+ CloneTiler* dlg = reinterpret_cast<CloneTiler*>(source);
+ dlg->selectChangedConn.disconnect();
+ dlg->externChangedConn.disconnect();
}
Geom::Affine CloneTiler::clonetiler_get_transform(
@@ -2164,7 +2168,7 @@ void CloneTiler::clonetiler_remove(GtkWidget */*widget*/, GtkWidget *dlg, bool d
}
g_slist_free (to_delete);
- clonetiler_change_selection (NULL, selection, dlg);
+ clonetiler_change_selection (selection, dlg);
if (do_undo) {
DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER,
@@ -2630,7 +2634,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg)
clonetiler_trace_finish ();
}
- clonetiler_change_selection (NULL, selection, dlg);
+ clonetiler_change_selection (selection, dlg);
desktop->clearWaitingCursor();