index 7b616fe18fb196334a5301f3e9f319a65a31a619..4846158a712fa7faea9706d9e20214060971ab9d 100644 (file)
virtual void on_button_click() {
//Retreive selected objects
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPDesktop *desktop = _dialog.getDesktop();
if (!desktop) return;
Inkscape::Selection *selection = sp_desktop_selection(desktop);
private :
virtual void on_button_click() {
//Retreive selected objects
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPDesktop *desktop = _dialog.getDesktop();
if (!desktop) return;
Inkscape::Selection *selection = sp_desktop_selection(desktop);
virtual void on_button_click()
{
- if (!SP_ACTIVE_DESKTOP) return;
- SPEventContext *event_context = sp_desktop_event_context(SP_ACTIVE_DESKTOP);
+ if (!_dialog.getDesktop()) return;
+ SPEventContext *event_context = sp_desktop_event_context(_dialog.getDesktop());
if (!SP_IS_NODE_CONTEXT (event_context)) return ;
if (_distribute)
private :
virtual void on_button_click()
{
- if (!SP_ACTIVE_DESKTOP) return;
+ if (!_dialog.getDesktop()) return;
// see comment in ActionAlign above
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
// xGap and yGap are the minimum space required between bounding rectangles.
double const xGap = removeOverlapXGap.get_value();
double const yGap = removeOverlapYGap.get_value();
- removeoverlap(sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList(),
+ removeoverlap(sp_desktop_selection(_dialog.getDesktop())->itemList(),
xGap, yGap);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Remove overlaps"));
}
};
private :
virtual void on_button_click()
{
- if (!SP_ACTIVE_DESKTOP) return;
+ if (!_dialog.getDesktop()) return;
// see comment in ActionAlign above
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
prefs_set_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
- graphlayout(sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList());
+ graphlayout(sp_desktop_selection(_dialog.getDesktop())->itemList());
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Arrange connector network"));
}
};
private :
virtual void on_button_click()
{
- if (!SP_ACTIVE_DESKTOP) return;
+ if (!_dialog.getDesktop()) return;
// see comment in ActionAlign above
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
prefs_set_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
- unclump ((GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList());
+ unclump ((GSList *) sp_desktop_selection(_dialog.getDesktop())->itemList());
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Unclump"));
}
};
private :
virtual void on_button_click()
{
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPDesktop *desktop = _dialog.getDesktop();
if (!desktop) return;
Inkscape::Selection *selection = sp_desktop_selection(desktop);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Randomize positions"));
}
};
bool _distribute;
virtual void on_button_click()
{
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPDesktop *desktop = _dialog.getDesktop();
if (!desktop) return;
Inkscape::Selection *selection = sp_desktop_selection(desktop);
}
if (changed) {
- sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Distribute text baselines"));
}
}
if (changed) {
- sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Align text baselines"));
}
}
_combo.append_text(_("Drawing"));
_combo.append_text(_("Selection"));
- _combo.set_active(6);
+ _combo.set_active(prefs_get_int_attribute("dialogs.align", "align-to", 6));
_combo.signal_changed().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_ref_change));
_anchorBox.pack_start(_anchorLabel);
}
void AlignAndDistribute::on_ref_change(){
-//Make blink the master
+
+ prefs_set_int_attribute("dialogs.align", "align-to", _combo.get_active_row_number());
+
+ //Make blink the master
}