summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e74a931)
raw | patch | inline | side by side (parent: e74a931)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 25 Feb 2007 01:33:07 +0000 (01:33 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 25 Feb 2007 01:33:07 +0000 (01:33 +0000) |
src/dialogs/export.cpp | patch | blob | history |
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index f5e764ce38537de56701a1b69c6a67983251999e..8c06f83cd1eba496f551a84ca4c83094cf2e786e 100644 (file)
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
vb->pack_start(*batch_box);
}
+ {
+ Gtk::HBox* hide_box = new Gtk::HBox(FALSE, 5);
+ GtkWidget *he = gtk_check_button_new_with_label(_("Hide all except selected"));
+ gtk_widget_set_sensitive(GTK_WIDGET(he), TRUE);
+ gtk_object_set_data(GTK_OBJECT(dlg), "hide_checkbox", he);
+ hide_box->pack_start(*Glib::wrap(he), false, false);
+ gtk_tooltips_set_tip(tt, he, _("In the exported image, hide all objects except those that are selected"), NULL);
+ hide_box->show_all();
+ vb->pack_start(*hide_box);
+ }
+
/* Buttons */
Gtk::HButtonBox* bb = new Gtk::HButtonBox(Gtk::BUTTONBOX_END);
bb->set_border_width(3);
} // end of sp_export_dialog()
static void
-sp_export_update_batch_checkbutton (GtkObject *base)
+sp_export_update_checkbuttons (GtkObject *base)
{
gint num = g_slist_length((GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList());
GtkWidget *be = (GtkWidget *)gtk_object_get_data(base, "batch_checkbox");
+ GtkWidget *he = (GtkWidget *)gtk_object_get_data(base, "hide_checkbox");
if (num >= 2) {
gtk_widget_set_sensitive (be, true);
gtk_button_set_label (GTK_BUTTON(be), g_strdup_printf (_("Batch export %d selected objects"), num));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(be), FALSE);
gtk_widget_set_sensitive (be, FALSE);
}
+ if (num > 0) {
+ gtk_widget_set_sensitive (he, true);
+ } else {
+ gtk_widget_set_sensitive (he, false);
+ }
}
static inline void
selection_names[key]);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
- sp_export_update_batch_checkbutton (GTK_OBJECT(dlg));
+ sp_export_update_checkbuttons (GTK_OBJECT(dlg));
}
sp_export_area_toggled(button, base);
}
- sp_export_update_batch_checkbutton (base);
+ sp_export_update_checkbuttons (base);
}
static void
SPNamedView *nv = sp_desktop_namedview(SP_ACTIVE_DESKTOP);
GtkWidget *be = (GtkWidget *)gtk_object_get_data(base, "batch_checkbox");
+ GtkWidget *he = (GtkWidget *)gtk_object_get_data(base, "hide_checkbox");
+ bool hide = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (he));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (be))) {
// Batch export of selected objects
if (!sp_export_png_file (sp_desktop_document (SP_ACTIVE_DESKTOP), fn,
area.x0, area.y0, area.x1, area.y1, width, height, dpi, dpi,
nv->pagecolor,
- NULL, NULL, TRUE)) { // overwrite without asking
+ NULL, NULL, TRUE, // overwrite without asking
+ hide ? (GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList() : NULL
+ )) {
gchar * error;
gchar * safeFile = Inkscape::IO::sanitizeString(fn);
error = g_strdup_printf(_("Could not export to filename %s.\n"), safeFile);
if (!sp_export_png_file (sp_desktop_document (SP_ACTIVE_DESKTOP), filename,
x0, y0, x1, y1, width, height, xdpi, ydpi,
nv->pagecolor,
- sp_export_progress_callback, base)) {
+ sp_export_progress_callback, base, FALSE,
+ hide ? (GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList() : NULL
+ )) {
gchar * error;
gchar * safeFile = Inkscape::IO::sanitizeString(filename);
error = g_strdup_printf(_("Could not export to filename %s.\n"), safeFile);