diff options
| author | Denis Declara <declara91@gmail.com> | 2012-05-05 13:32:42 +0000 |
|---|---|---|
| committer | Denis Declara <declara91@gmail.com> | 2012-05-05 13:32:42 +0000 |
| commit | aeb9c1bde66de096910757abb17dedb94ad74207 (patch) | |
| tree | c0adf97685b0fa8af1553b14d20601f280492762 /src/ui/dialog | |
| parent | Fixed some math, so that the objects now line up correctly (diff) | |
| parent | Adding checks to prevent null pointer dereferences (diff) | |
| download | inkscape-aeb9c1bde66de096910757abb17dedb94ad74207.tar.gz inkscape-aeb9c1bde66de096910757abb17dedb94ad74207.zip | |
Trunk merge
(bzr r11073.1.29)
Diffstat (limited to 'src/ui/dialog')
| -rw-r--r-- | src/ui/dialog/behavior.h | 2 | ||||
| -rw-r--r-- | src/ui/dialog/calligraphic-profile-rename.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/clonetiler.cpp | 57 | ||||
| -rw-r--r-- | src/ui/dialog/debug.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/dialog.cpp | 8 | ||||
| -rw-r--r-- | src/ui/dialog/dialog.h | 4 | ||||
| -rw-r--r-- | src/ui/dialog/export.cpp | 41 | ||||
| -rw-r--r-- | src/ui/dialog/export.h | 41 | ||||
| -rw-r--r-- | src/ui/dialog/filedialogimpl-gtkmm.h | 1 | ||||
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.cpp | 20 | ||||
| -rw-r--r-- | src/ui/dialog/find.cpp | 27 | ||||
| -rw-r--r-- | src/ui/dialog/floating-behavior.cpp | 19 | ||||
| -rw-r--r-- | src/ui/dialog/floating-behavior.h | 5 | ||||
| -rw-r--r-- | src/ui/dialog/guides.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 45 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 1 | ||||
| -rw-r--r-- | src/ui/dialog/layer-properties.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-add.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/messages.h | 1 | ||||
| -rw-r--r-- | src/ui/dialog/panel-dialog.h | 4 | ||||
| -rw-r--r-- | src/ui/dialog/undo-history.h | 1 | ||||
| -rw-r--r-- | src/ui/dialog/xml-tree.cpp | 3 |
22 files changed, 221 insertions, 69 deletions
diff --git a/src/ui/dialog/behavior.h b/src/ui/dialog/behavior.h index 385cd05f5..5d5519a03 100644 --- a/src/ui/dialog/behavior.h +++ b/src/ui/dialog/behavior.h @@ -45,7 +45,7 @@ public: virtual operator Gtk::Widget&() =0; virtual GtkWidget *gobj() =0; virtual void present() =0; - virtual Gtk::VBox *get_vbox() =0; + virtual Gtk::Box *get_vbox() =0; virtual void show() =0; virtual void hide() =0; virtual void show_all_children() =0; diff --git a/src/ui/dialog/calligraphic-profile-rename.cpp b/src/ui/dialog/calligraphic-profile-rename.cpp index da3b5a802..c6633df0b 100644 --- a/src/ui/dialog/calligraphic-profile-rename.cpp +++ b/src/ui/dialog/calligraphic-profile-rename.cpp @@ -30,7 +30,7 @@ namespace Dialog { CalligraphicProfileRename::CalligraphicProfileRename() : _applied(false) { - Gtk::VBox *mainVBox = get_vbox(); + Gtk::Box *mainVBox = get_vbox(); _layout_table.set_spacings(4); _layout_table.resize (1, 2); diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index 7b7c66553..47ec03b30 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -95,7 +95,7 @@ CloneTiler::CloneTiler (void) : #if GTK_CHECK_VERSION(3,0,0) GtkWidget *mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); - gtk_box_new(GTK_BOX(mainbox), FALSE); + gtk_box_set_homogeneous(GTK_BOX(mainbox), FALSE); #else GtkWidget *mainbox = gtk_vbox_new(FALSE, 4); #endif @@ -803,7 +803,7 @@ CloneTiler::CloneTiler (void) : { #if GTK_CHECK_VERSION(3,0,0) GtkWidget *vvb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - gtk_box_new(GTK_BOX(vvb), FALSE); + gtk_box_set_homogeneous(GTK_BOX(vvb), FALSE); #else GtkWidget *vvb = gtk_vbox_new (FALSE, 0); #endif @@ -1003,11 +1003,19 @@ CloneTiler::CloneTiler (void) : g_object_set_data (G_OBJECT(dlg), "rowscols", (gpointer) hb); { +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment>a = Gtk::Adjustment::create(0.0, 1, 500, 1, 10, 0); +#else Gtk::Adjustment *a = new Gtk::Adjustment (0.0, 1, 500, 1, 10, 0); +#endif int value = prefs->getInt(prefs_path + "jmax", 2); a->set_value (value); +#if WITH_GTKMM_3_0 + Inkscape::UI::Widget::SpinButton *sb = new Inkscape::UI::Widget::SpinButton(a, 1.0, 0); +#else Inkscape::UI::Widget::SpinButton *sb = new Inkscape::UI::Widget::SpinButton (*a, 1.0, 0); +#endif sb->set_tooltip_text (_("How many rows in the tiling")); sb->set_width_chars (7); gtk_box_pack_start (GTK_BOX (hb), GTK_WIDGET(sb->gobj()), TRUE, TRUE, 0); @@ -1025,11 +1033,19 @@ CloneTiler::CloneTiler (void) : } { +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment> a = Gtk::Adjustment::create(0.0, 1, 500, 1, 10, 0); +#else Gtk::Adjustment *a = new Gtk::Adjustment (0.0, 1, 500, 1, 10, 0); +#endif int value = prefs->getInt(prefs_path + "imax", 2); a->set_value (value); +#if WITH_GTKMM_3_0 + Inkscape::UI::Widget::SpinButton *sb = new Inkscape::UI::Widget::SpinButton(a, 1.0, 0); +#else Inkscape::UI::Widget::SpinButton *sb = new Inkscape::UI::Widget::SpinButton (*a, 1.0, 0); +#endif sb->set_tooltip_text (_("How many columns in the tiling")); sb->set_width_chars (7); gtk_box_pack_start (GTK_BOX (hb), GTK_WIDGET(sb->gobj()), TRUE, TRUE, 0); @@ -1057,7 +1073,11 @@ CloneTiler::CloneTiler (void) : { // Width spinbutton +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment> a = Gtk::Adjustment::create(0.0, -1e6, 1e6, 1.0, 10.0, 0); +#else Gtk::Adjustment *a = new Gtk::Adjustment (0.0, -1e6, 1e6, 1.0, 10.0, 0); +#endif sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (u), GTK_ADJUSTMENT (a->gobj())); double value = prefs->getDouble(prefs_path + "fillwidth", 50.0); @@ -1065,7 +1085,11 @@ CloneTiler::CloneTiler (void) : gdouble const units = sp_pixels_get_units (value, unit); a->set_value (units); +#if WITH_GTKMM_3_0 + Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton(a, 1.0, 2); +#else Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton (*a, 1.0, 2); +#endif e->set_tooltip_text (_("Width of the rectangle to be filled")); e->set_width_chars (7); e->set_digits (4); @@ -1083,7 +1107,11 @@ CloneTiler::CloneTiler (void) : { // Height spinbutton +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment> a = Gtk::Adjustment::create(0.0, -1e6, 1e6, 1.0, 10.0, 0); +#else Gtk::Adjustment *a = new Gtk::Adjustment (0.0, -1e6, 1e6, 1.0, 10.0, 0); +#endif sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (u), GTK_ADJUSTMENT (a->gobj())); double value = prefs->getDouble(prefs_path + "fillheight", 50.0); @@ -1091,7 +1119,11 @@ CloneTiler::CloneTiler (void) : gdouble const units = sp_pixels_get_units (value, unit); a->set_value (units); +#if WITH_GTKMM_3_0 + Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton(a, 1.0, 2); +#else Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton (*a, 1.0, 2); +#endif e->set_tooltip_text (_("Height of the rectangle to be filled")); e->set_width_chars (7); e->set_digits (4); @@ -2586,7 +2618,7 @@ GtkWidget * CloneTiler::clonetiler_new_tab(GtkWidget *nb, const gchar *label) GtkWidget *l = gtk_label_new_with_mnemonic (label); #if GTK_CHECK_VERSION(3,0,0) GtkWidget *vb = gtk_box_new(GTK_ORIENTATION_VERTICAL, VB_MARGIN); - gtk_box_new(GTK_BOX(vb), FALSE); + gtk_box_set_homogeneous(GTK_BOX(vb), FALSE); #else GtkWidget *vb = gtk_vbox_new (FALSE, VB_MARGIN); #endif @@ -2644,19 +2676,36 @@ GtkWidget * CloneTiler::clonetiler_spinbox(const char *tip, const char *attr, do #endif { +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment> a; + if (exponent) { + a = Gtk::Adjustment::create(1.0, lower, upper, 0.01, 0.05, 0); + } else { + a = Gtk::Adjustment::create(0.0, lower, upper, 0.1, 0.5, 0); + } +#else Gtk::Adjustment *a; if (exponent) { a = new Gtk::Adjustment (1.0, lower, upper, 0.01, 0.05, 0); } else { a = new Gtk::Adjustment (0.0, lower, upper, 0.1, 0.5, 0); } +#endif Inkscape::UI::Widget::SpinButton *sb; +#if WITH_GTKMM_3_0 + if (exponent) { + sb = new Inkscape::UI::Widget::SpinButton(a, 0.01, 2); + } else { + sb = new Inkscape::UI::Widget::SpinButton(a, 0.1, 1); + } +#else if (exponent) { sb = new Inkscape::UI::Widget::SpinButton (*a, 0.01, 2); } else { sb = new Inkscape::UI::Widget::SpinButton (*a, 0.1, 1); } +#endif sb->set_tooltip_text (tip); sb->set_width_chars (5); @@ -2717,7 +2766,7 @@ void CloneTiler::clonetiler_pick_to(GtkToggleButton *tb, gpointer data) void CloneTiler::clonetiler_reset_recursive(GtkWidget *w) { - if (w && GTK_IS_OBJECT(w)) { + if (w && G_IS_OBJECT(w)) { { int r = GPOINTER_TO_INT (g_object_get_data(G_OBJECT(w), "zeroable")); if (r && GTK_IS_SPIN_BUTTON(w)) { // spinbutton diff --git a/src/ui/dialog/debug.cpp b/src/ui/dialog/debug.cpp index 8ffbd5c52..7095d2611 100644 --- a/src/ui/dialog/debug.cpp +++ b/src/ui/dialog/debug.cpp @@ -69,7 +69,7 @@ DebugDialogImpl::DebugDialogImpl() set_title(_("Messages")); set_size_request(300, 400); - Gtk::VBox *mainVBox = get_vbox(); + Gtk::Box *mainVBox = get_vbox(); //## Add a menu for clear() menuBar.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_File"), fileMenu) ); diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 426e66eeb..14a26b716 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -54,14 +54,14 @@ gboolean sp_retransientize_again(gpointer dlgPtr) return FALSE; // so that it is only called once } -void sp_dialog_shutdown(GtkObject */*object*/, gpointer dlgPtr) +void sp_dialog_shutdown(GObject * /*object*/, gpointer dlgPtr) { Dialog *dlg = static_cast<Dialog *>(dlgPtr); dlg->onShutdown(); } -void hideCallback(GtkObject */*object*/, gpointer dlgPtr) +void hideCallback(GObject * /*object*/, gpointer dlgPtr) { g_return_if_fail( dlgPtr != NULL ); @@ -69,7 +69,7 @@ void hideCallback(GtkObject */*object*/, gpointer dlgPtr) dlg->onHideF12(); } -void unhideCallback(GtkObject */*object*/, gpointer dlgPtr) +void unhideCallback(GObject * /*object*/, gpointer dlgPtr) { g_return_if_fail( dlgPtr != NULL ); @@ -160,7 +160,7 @@ void Dialog::onShowF12() inline Dialog::operator Gtk::Widget &() { return *_behavior; } inline GtkWidget *Dialog::gobj() { return _behavior->gobj(); } inline void Dialog::present() { _behavior->present(); } -inline Gtk::VBox *Dialog::get_vbox() { return _behavior->get_vbox(); } +inline Gtk::Box *Dialog::get_vbox() { return _behavior->get_vbox(); } inline void Dialog::hide() { _behavior->hide(); } inline void Dialog::show() { _behavior->show(); } inline void Dialog::show_all_children() { _behavior->show_all_children(); } diff --git a/src/ui/dialog/dialog.h b/src/ui/dialog/dialog.h index 43e7dda3b..025e9eb58 100644 --- a/src/ui/dialog/dialog.h +++ b/src/ui/dialog/dialog.h @@ -32,7 +32,7 @@ enum BehaviorType { FLOATING, DOCK }; void sp_retransientize(Inkscape::Application *inkscape, SPDesktop *desktop, gpointer dlgPtr); gboolean sp_retransientize_again(gpointer dlgPtr); -void sp_dialog_shutdown(GtkObject *object, gpointer dlgPtr); +void sp_dialog_shutdown(GObject *object, gpointer dlgPtr); /** * Base class for Inkscape dialogs. @@ -79,7 +79,7 @@ public: virtual operator Gtk::Widget &(); virtual GtkWidget *gobj(); virtual void present(); - virtual Gtk::VBox *get_vbox(); + virtual Gtk::Box *get_vbox(); virtual void show(); virtual void hide(); virtual void show_all_children(); diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index af5788ac6..e10668473 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -408,14 +408,27 @@ void Export::set_default_filename () { } +#if WITH_GTKMM_3_0 +Glib::RefPtr<Gtk::Adjustment> Export::createSpinbutton( gchar const * /*key*/, float val, float min, float max, + float step, float page, GtkWidget *us, + Gtk::Table *t, int x, int y, + const Glib::ustring ll, const Glib::ustring lr, + int digits, unsigned int sensitive, + void (Export::*cb)() ) +#else Gtk::Adjustment * Export::createSpinbutton( gchar const * /*key*/, float val, float min, float max, float step, float page, GtkWidget *us, Gtk::Table *t, int x, int y, const Glib::ustring ll, const Glib::ustring lr, int digits, unsigned int sensitive, void (Export::*cb)() ) +#endif { +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment> adj = Gtk::Adjustment::create(val, min, max, step, page, 0); +#else Gtk::Adjustment *adj = new Gtk::Adjustment ( val, min, max, step, page, 0 ); +#endif if (us) { sp_unit_selector_add_adjustment ( SP_UNIT_SELECTOR (us), GTK_ADJUSTMENT (adj->gobj()) ); } @@ -431,7 +444,11 @@ Gtk::Adjustment * Export::createSpinbutton( gchar const * /*key*/, float val, fl pos++; } +#if WITH_GTKMM_3_0 + Gtk::SpinButton *sb = new Gtk::SpinButton(adj, 1.0, digits); +#else Gtk::SpinButton *sb = new Gtk::SpinButton(*adj, 1.0, digits); +#endif t->attach (*sb, x + pos, x + pos + 1, y, y + 1, Gtk::EXPAND, Gtk::EXPAND, 0, 0 ); sb->set_size_request (80, -1); sb->set_sensitive (sensitive); @@ -1288,7 +1305,11 @@ void Export::detectSize() { } /* sp_export_detect_size */ /// Called when area x0 value is changed +#if WITH_GTKMM_3_0 +void Export::areaXChange(Glib::RefPtr<Gtk::Adjustment>& adj) +#else void Export::areaXChange (Gtk::Adjustment *adj) +#endif { float x0, x1, xdpi, width; @@ -1331,7 +1352,11 @@ void Export::areaXChange (Gtk::Adjustment *adj) } // end of sp_export_area_x_value_changed() /// Called when area y0 value is changed. +#if WITH_GTKMM_3_0 +void Export::areaYChange(Glib::RefPtr<Gtk::Adjustment>& adj) +#else void Export::areaYChange (Gtk::Adjustment *adj) +#endif { float y0, y1, ydpi, height; @@ -1662,7 +1687,11 @@ void Export::setArea( double x0, double y0, double x1, double y1 ) * @param adj The adjustment widget * @param val What value to set it to. */ +#if WITH_GTKMM_3_0 +void Export::setValue(Glib::RefPtr<Gtk::Adjustment>& adj, double val ) +#else void Export::setValue( Gtk::Adjustment *adj, double val ) +#endif { if (adj) { adj->set_value(val); @@ -1680,7 +1709,11 @@ void Export::setValue( Gtk::Adjustment *adj, double val ) * @param adj The adjustment widget * @param val What the value should be in points. */ +#if WITH_GTKMM_3_0 +void Export::setValuePx(Glib::RefPtr<Gtk::Adjustment>& adj, double val) +#else void Export::setValuePx( Gtk::Adjustment *adj, double val) +#endif { const SPUnit *unit = sp_unit_selector_get_unit ((SPUnitSelector *)unit_selector->gobj() ); @@ -1699,7 +1732,11 @@ void Export::setValuePx( Gtk::Adjustment *adj, double val) * * @return The value in the specified adjustment. */ +#if WITH_GTKMM_3_0 +float Export::getValue(Glib::RefPtr<Gtk::Adjustment>& adj) +#else float Export::getValue( Gtk::Adjustment *adj ) +#endif { if (!adj) { g_message("sp_export_value_get : adj is NULL"); @@ -1721,7 +1758,11 @@ float Export::getValue( Gtk::Adjustment *adj ) * * @return The value in the adjustment in points. */ +#if WITH_GTKMM_3_0 +float Export::getValuePx(Glib::RefPtr<Gtk::Adjustment>& adj) +#else float Export::getValuePx( Gtk::Adjustment *adj ) +#endif { float value = getValue( adj); const SPUnit *unit = sp_unit_selector_get_unit ((SPUnitSelector *)unit_selector->gobj()); diff --git a/src/ui/dialog/export.h b/src/ui/dialog/export.h index eaab04762..5e421c66b 100644 --- a/src/ui/dialog/export.h +++ b/src/ui/dialog/export.h @@ -94,10 +94,17 @@ private: /* * Getter/setter style functions for the spinbuttons */ +#if WITH_GTKMM_3_0 + void setValue(Glib::RefPtr<Gtk::Adjustment>& adj, double val); + void setValuePx(Glib::RefPtr<Gtk::Adjustment>& adj, double val); + float getValue(Glib::RefPtr<Gtk::Adjustment>& adj); + float getValuePx(Glib::RefPtr<Gtk::Adjustment>& adj); +#else void setValue (Gtk::Adjustment *adj, double val); void setValuePx (Gtk::Adjustment *adj, double val); float getValue (Gtk::Adjustment *adj); float getValuePx (Gtk::Adjustment *adj); +#endif /** * Helper function to create, style and pack spinbuttons for the export dialog. @@ -119,12 +126,22 @@ private: * @param sensitive Whether the spin button is sensitive or not * @param cb Callback for when this spin button is changed (optional) */ +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment> createSpinbutton( gchar const *key, float val, float min, float max, + float step, float page, GtkWidget *us, + Gtk::Table *t, int x, int y, + const Glib::ustring ll, const Glib::ustring lr, + int digits, unsigned int sensitive, + void (Export::*cb)() ); +#else Gtk::Adjustment * createSpinbutton( gchar const *key, float val, float min, float max, float step, float page, GtkWidget *us, Gtk::Table *t, int x, int y, const Glib::ustring ll, const Glib::ustring lr, int digits, unsigned int sensitive, void (Export::*cb)() ); +#endif + /** * One of the area select radio buttons was pressed */ @@ -145,14 +162,22 @@ private: */ void onAreaX0Change() {areaXChange(x0_adj);} ; void onAreaX1Change() {areaXChange(x1_adj);} ; +#if WITH_GTKMM_3_0 + void areaXChange(Glib::RefPtr<Gtk::Adjustment>& adj); +#else void areaXChange ( Gtk::Adjustment *adj); +#endif /** * Area Y value changed callback */ void onAreaY0Change() {areaYChange(y0_adj);} ; void onAreaY1Change() {areaYChange(y1_adj);} ; +#if WITH_GTKMM_3_0 + void areaYChange(Glib::RefPtr<Gtk::Adjustment>& adj); +#else void areaYChange ( Gtk::Adjustment *adj); +#endif /** * Area width value changed callback @@ -261,6 +286,21 @@ private: Gtk::VBox area_box; Gtk::VBox singleexport_box; +#if WITH_GTKMM_3_0 + /* Custom size widgets */ + Glib::RefPtr<Gtk::Adjustment> x0_adj; + Glib::RefPtr<Gtk::Adjustment> x1_adj; + Glib::RefPtr<Gtk::Adjustment> y0_adj; + Glib::RefPtr<Gtk::Adjustment> y1_adj; + Glib::RefPtr<Gtk::Adjustment> width_adj; + Glib::RefPtr<Gtk::Adjustment> height_adj; + + /* Bitmap size widgets */ + Glib::RefPtr<Gtk::Adjustment> bmwidth_adj; + Glib::RefPtr<Gtk::Adjustment> bmheight_adj; + Glib::RefPtr<Gtk::Adjustment> xdpi_adj; + Glib::RefPtr<Gtk::Adjustment> ydpi_adj; +#else /* Custom size widgets */ Gtk::Adjustment *x0_adj; Gtk::Adjustment *x1_adj; @@ -274,6 +314,7 @@ private: Gtk::Adjustment *bmheight_adj; Gtk::Adjustment *xdpi_adj; Gtk::Adjustment *ydpi_adj; +#endif Gtk::VBox size_box; Gtk::Label* bm_label; diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h index d40edd67d..4caa106ad 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.h +++ b/src/ui/dialog/filedialogimpl-gtkmm.h @@ -21,6 +21,7 @@ #include <gtkmm/filechooserdialog.h> #include <glib/gstdio.h> #include <gtkmm/comboboxtext.h> +#include <gtkmm/checkbutton.h> //General includes #include <unistd.h> diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index dd3e90b2c..4af328b49 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -62,6 +62,7 @@ #include "io/sys.h" #include <iostream> +#include <gtkmm/checkbutton.h> #include <gtkmm/colorbutton.h> #include <gtkmm/paned.h> #include <gtkmm/scrolledwindow.h> @@ -2125,16 +2126,27 @@ void FilterEffectsDialog::PrimitiveList::on_drag_end(const Glib::RefPtr<Gdk::Dra bool FilterEffectsDialog::PrimitiveList::on_scroll_timeout() { if(_autoscroll) { - Gtk::Adjustment& a = *dynamic_cast<Gtk::ScrolledWindow*>(get_parent())->get_vadjustment(); - double v; +#if WITH_GTKMM_3_0 + Glib::RefPtr<Gtk::Adjustment> a = dynamic_cast<Gtk::ScrolledWindow*>(get_parent())->get_vadjustment(); + double v = a->get_value() + _autoscroll; + + if(v < 0) + v = 0; + if(v > a->get_upper() - a->get_page_size()) + v = a->get_upper() - a->get_page_size(); - v = a.get_value() + _autoscroll; - if(v < 0) + a->set_value(v); +#else + Gtk::Adjustment& a = *dynamic_cast<Gtk::ScrolledWindow*>(get_parent())->get_vadjustment(); + double v = a.get_value() + _autoscroll; + + if(v < 0) v = 0; if(v > a.get_upper() - a.get_page_size()) v = a.get_upper() - a.get_page_size(); a.set_value(v); +#endif queue_draw(); } diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 641acd3f3..03a440d5c 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -64,8 +64,8 @@ namespace Dialog { Find::Find() : UI::Widget::Panel("", "/dialogs/find", SP_VERB_DIALOG_FIND), - entry_find(_("F_ind:"), _("Find objects by their content (exact or partial match)")), - entry_replace(_("Re_place:"), _("Replace found objects with this value ")), + entry_find(_("F_ind:"), _("Find objects by their content or properties (exact or partial match)")), + entry_replace(_("Re_place:"), _("Replace match with this value")), check_scope_all(_("_All"), _("Search in all layers")), check_scope_layer(_("Current _layer"), _("Limit search to the current layer")), @@ -84,8 +84,8 @@ Find::Find() frame_options(_("General")), check_ids(_("_ID"), _("Search id name"), true), - check_attributename(_("Attribute _Name"), _("Search attribute name"), false), - check_attributevalue(_("Attribute _Value"), _("Search attribute value"), true), + check_attributename(_("Attribute _name"), _("Search attribute name"), false), + check_attributevalue(_("Attribute _value"), _("Search attribute value"), true), check_style(_("_Style"), _("Search style"), true), check_font(_("_Font"), _("Search fonts"), false), frame_properties(_("Properties")), @@ -104,11 +104,11 @@ Find::Find() check_images(_("Images"), _("Search images"), false), check_offsets(_("Offsets"), _("Search offset objects"), false), - frame_types(_("Object Types")), + frame_types(_("Object types")), status(""), - button_find(_("_Find"), _("Select all objects matching the selected fields ")), - button_replace(_("_Replace All"), _("Replace all the matching objects")), + button_find(_("_Find"), _("Select all objects matching the selection criteria")), + button_replace(_("_Replace All"), _("Replace all matches")), _action_replace(false), blocked(false), desktop(NULL), @@ -825,7 +825,14 @@ Find::onAction() "<b>%d</b> objects found (out of <b>%d</b>), %s match.", count), count, all, exact? _("exact") : _("partial")); - status.set_text(Glib::ustring::compose("%1 %2 %3", count, _("objects"), _action_replace? _("replaced") : _("found") )); + if (_action_replace){ + // TRANSLATORS: "%1" is replaced with the number of matches + status.set_text(Glib::ustring::compose(_("%1 objects replaced"), count)); + } + else { + // TRANSLATORS: "%1" is replaced with the number of matches + status.set_text(Glib::ustring::compose(_("%1 objects found"), count)); + } Inkscape::Selection *selection = sp_desktop_selection (desktop); selection->clear(); @@ -837,7 +844,7 @@ Find::onAction() } } else { - status.set_text(_("Not found")); + status.set_text(_("Nothing found")); if (!check_scope_selection.get_active()) { Inkscape::Selection *selection = sp_desktop_selection (desktop); selection->clear(); @@ -863,7 +870,7 @@ Find::onToggleCheck () } if (!objectok) { - status.set_text(_("Select an object")); + status.set_text(_("Select an object type")); } diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index 6748665ad..ba81c6d47 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -32,30 +32,24 @@ namespace Behavior { FloatingBehavior::FloatingBehavior(Dialog &dialog) : Behavior(dialog), _d (new Gtk::Dialog(_dialog._title)) -#if GTK_VERSION_GE(2, 12) ,_dialog_active(_d->property_is_active()) ,_steps(0) ,_trans_focus(Inkscape::Preferences::get()->getDoubleLimited("/dialogs/transparency/on-focus", 0.95, 0.0, 1.0)) ,_trans_blur(Inkscape::Preferences::get()->getDoubleLimited("/dialogs/transparency/on-blur", 0.50, 0.0, 1.0)) ,_trans_time(Inkscape::Preferences::get()->getIntLimited("/dialogs/transparency/animate-time", 100, 0, 5000)) -#endif { hide(); - _d->set_has_separator(false); signal_delete_event().connect(sigc::mem_fun(_dialog, &Inkscape::UI::Dialog::Dialog::_onDeleteEvent)); sp_transientize(GTK_WIDGET(_d->gobj())); _dialog.retransientize_suppress = false; -#if GTK_VERSION_GE(2, 12) _focus_event(); _dialog_active.signal_changed().connect(sigc::mem_fun(this, &FloatingBehavior::_focus_event)); -#endif } -#if GTK_VERSION_GE(2, 12) /** * A function called when the window gets focus. * @@ -126,8 +120,6 @@ bool FloatingBehavior::_trans_timer (void) { return true; } -#endif - FloatingBehavior::~FloatingBehavior() { delete _d; @@ -142,7 +134,7 @@ FloatingBehavior::create(Dialog &dialog) inline FloatingBehavior::operator Gtk::Widget &() { return *_d; } inline GtkWidget *FloatingBehavior::gobj() { return GTK_WIDGET(_d->gobj()); } -inline Gtk::VBox* FloatingBehavior::get_vbox() { return _d->get_vbox(); } +inline Gtk::Box* FloatingBehavior::get_vbox() { return _d->get_vbox(); } inline void FloatingBehavior::present() { _d->present(); } inline void FloatingBehavior::hide() { _d->hide(); } inline void FloatingBehavior::show() { _d->show(); } @@ -151,7 +143,14 @@ inline void FloatingBehavior::resize(int width, int height) { _d-> inline void FloatingBehavior::move(int x, int y) { _d->move(x, y); } inline void FloatingBehavior::set_position(Gtk::WindowPosition position) { _d->set_position(position); } inline void FloatingBehavior::set_size_request(int width, int height) { _d->set_size_request(width, height); } -inline void FloatingBehavior::size_request(Gtk::Requisition &requisition) {requisition = _d->size_request(); } +inline void FloatingBehavior::size_request(Gtk::Requisition &requisition) { +#if WITH_GTKMM_3_0 + Gtk::Requisition requisition_natural; + _d->get_preferred_size(requisition, requisition_natural); +#else + requisition = _d->size_request(); +#endif +} inline void FloatingBehavior::get_position(int &x, int &y) { _d->get_position(x, y); } inline void FloatingBehavior::get_size(int &width, int &height) { _d->get_size(width, height); } inline void FloatingBehavior::set_title(Glib::ustring title) { _d->set_title(title); } diff --git a/src/ui/dialog/floating-behavior.h b/src/ui/dialog/floating-behavior.h index c6b6a93e9..56ed76b41 100644 --- a/src/ui/dialog/floating-behavior.h +++ b/src/ui/dialog/floating-behavior.h @@ -36,7 +36,7 @@ public: operator Gtk::Widget &(); GtkWidget *gobj(); void present(); - Gtk::VBox *get_vbox(); + Gtk::Box *get_vbox(); void show(); void hide(); void show_all_children(); @@ -66,7 +66,6 @@ private: Gtk::Dialog *_d; //< the actual dialog -#if GTK_VERSION_GE(2, 12) void _focus_event (void); bool _trans_timer (void); @@ -75,8 +74,6 @@ private: float _trans_focus; //< The percentage opacity when the dialog is focused float _trans_blur; //< The percentage opactiy when the dialog is not focused int _trans_time; //< The amount of time (in ms) for the dialog to change it's transparency -#endif - }; } // namespace Behavior diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index ce21f9c6e..d20f2a220 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -166,7 +166,7 @@ void GuidelinePropertiesDialog::_setup() { add_button(Gtk::Stock::DELETE, -12); add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - Gtk::VBox *mainVBox = get_vbox(); + Gtk::Box *mainVBox = get_vbox(); _layout_table.set_spacings(4); _layout_table.resize (3, 4); diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 719e42f16..685ea70e1 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -520,21 +520,22 @@ void InkscapePreferences::initPageUI() _page_ui.add_line( false, _("Language (requires restart):"), _ui_languages, "", _("Set the language for menus and number formats"), false); - Glib::ustring sizeLabels[] = {_("Large"), _("Small"), _("Smaller")}; - int sizeValues[] = {0, 1, 2}; - - _misc_small_tools.init( "/toolbox/tools/small", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 0 ); - _page_ui.add_line( false, _("Toolbox icon size:"), _misc_small_tools, "", - _("Set the size for the tool icons (requires restart)"), false); + { + Glib::ustring sizeLabels[] = {_("Large"), _("Small"), _("Smaller")}; + int sizeValues[] = {0, 1, 2}; - _misc_small_toolbar.init( "/toolbox/small", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 0 ); - _page_ui.add_line( false, _("Control bar icon size:"), _misc_small_toolbar, "", - _("Set the size for the icons in tools' control bars to use (requires restart)"), false); + _misc_small_tools.init( "/toolbox/tools/small", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 0 ); + _page_ui.add_line( false, _("Toolbox icon size:"), _misc_small_tools, "", + _("Set the size for the tool icons (requires restart)"), false); - _misc_small_secondary.init( "/toolbox/secondary", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 1 ); - _page_ui.add_line( false, _("Secondary toolbar icon size:"), _misc_small_secondary, "", - _("Set the size for the icons in secondary toolbars to use (requires restart)"), false); + _misc_small_toolbar.init( "/toolbox/small", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 0 ); + _page_ui.add_line( false, _("Control bar icon size:"), _misc_small_toolbar, "", + _("Set the size for the icons in tools' control bars to use (requires restart)"), false); + _misc_small_secondary.init( "/toolbox/secondary", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 1 ); + _page_ui.add_line( false, _("Secondary toolbar icon size:"), _misc_small_secondary, "", + _("Set the size for the icons in secondary toolbars to use (requires restart)"), false); + } _ui_colorsliders_top.init( _("Work-around color sliders not drawing"), "/options/workarounds/colorsontop", false); _page_ui.add_line( false, "", _ui_colorsliders_top, "", @@ -625,7 +626,6 @@ void InkscapePreferences::initPageUI() _("Same as Normal but may work better with some window managers")); #endif -#if GTK_VERSION_GE(2, 12) _page_windows.add_group_header( _("Dialog Transparency")); _win_trans_focus.init("/dialogs/transparency/on-focus", 0.5, 1.0, 0.01, 0.1, 1.0, false, false); _page_windows.add_line( true, _("Opacity when focused:"), _win_trans_focus, "", ""); @@ -633,7 +633,6 @@ void InkscapePreferences::initPageUI() _page_windows.add_line( true, _("Opacity when unfocused:"), _win_trans_blur, "", ""); _win_trans_time.init("/dialogs/transparency/animate-time", 0, 1000, 10, 100, 100, true, false); _page_windows.add_line( true, _("Time of opacity change animation:"), _win_trans_time, "ms", ""); -#endif _page_windows.add_group_header( _("Miscellaneous")); #ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs @@ -770,6 +769,10 @@ void InkscapePreferences::initPageIO() _page_mouse.add_line( false, _("Click/drag threshold:"), _mouse_thres, _("pixels"), _("Maximum mouse drag (in screen pixels) which is considered a click, not a drag"), false); + _mouse_grabsize.init("/options/grabsize/value", 1, 7, 1, 2, 3, 0); + _page_mouse.add_line(false, _("Handle size"), _mouse_grabsize, "", + _("Set the relative size of node handles."), true); + _mouse_use_ext_input.init( _("Use pressure-sensitive tablet (requires restart)"), "/options/useextinput/value", true); _page_mouse.add_line(false, "",_mouse_use_ext_input, "", _("Use the capabilities of a tablet or other pressure-sensitive device. Disable this only if you have problems with the tablet (you can still use it as a mouse)")); @@ -815,7 +818,7 @@ void InkscapePreferences::initPageIO() _svgoutput_attrwarn.init( _("Print warnings"), "/options/svgoutput/incorrect_attributes_warn", true); _page_svgoutput.add_line( true, "", _svgoutput_attrwarn, "", _("Print warning if invalid or non-useful attributes found. Database files located in inkscape_data_dir/attributes."), false); _svgoutput_attrremove.init( _("Remove attributes"), "/options/svgoutput/incorrect_attributes_remove", false); - _page_svgoutput.add_line( true, "", _svgoutput_attrremove, "", _("Delete invalid or non-useful attributes from element tag."), false); + _page_svgoutput.add_line( true, "", _svgoutput_attrremove, "", _("Delete invalid or non-useful attributes from element tag"), false); /* Add incorrect style properties options */ _page_svgoutput.add_group_header( _("Inappropriate Style Properties Actions")); @@ -823,7 +826,7 @@ void InkscapePreferences::initPageIO() _svgoutput_stylepropwarn.init( _("Print warnings"), "/options/svgoutput/incorrect_style_properties_warn", true); _page_svgoutput.add_line( true, "", _svgoutput_stylepropwarn, "", _("Print warning if inappropriate style properties found (i.e. 'font-family' set on a <rect>). Database files located in inkscape_data_dir/attributes."), false); _svgoutput_stylepropremove.init( _("Remove style properties"), "/options/svgoutput/incorrect_style_properties_remove", false); - _page_svgoutput.add_line( true, "", _svgoutput_stylepropremove, "", _("Delete inappropriate style properties."), false); + _page_svgoutput.add_line( true, "", _svgoutput_stylepropremove, "", _("Delete inappropriate style properties"), false); /* Add default or inherited style properties options */ _page_svgoutput.add_group_header( _("Non-useful Style Properties Actions")); @@ -831,16 +834,16 @@ void InkscapePreferences::initPageIO() _svgoutput_styledefaultswarn.init( _("Print warnings"), "/options/svgoutput/style_defaults_warn", true); _page_svgoutput.add_line( true, "", _svgoutput_styledefaultswarn, "", _("Print warning if redundant style properties found (i.e. if a property has the default value and a different value is not inherited or if value is the same as would be inherited). Database files located in inkscape_data_dir/attributes."), false); _svgoutput_styledefaultsremove.init( _("Remove style properties"), "/options/svgoutput/style_defaults_remove", false); - _page_svgoutput.add_line( true, "", _svgoutput_styledefaultsremove, "", _("Delete redundant style properties."), false); + _page_svgoutput.add_line( true, "", _svgoutput_styledefaultsremove, "", _("Delete redundant style properties"), false); - _page_svgoutput.add_group_header( _("Check Attributes and Style Properties on:")); + _page_svgoutput.add_group_header( _("Check Attributes and Style Properties on")); _svgoutput_check_reading.init( _("Reading"), "/options/svgoutput/check_on_reading", false); - _page_svgoutput.add_line( true, "", _svgoutput_check_reading, "", _("Check attributes and style properties on reading in SVG files (including those internal to Inkscape which will slow down startup)."), false); + _page_svgoutput.add_line( true, "", _svgoutput_check_reading, "", _("Check attributes and style properties on reading in SVG files (including those internal to Inkscape which will slow down startup)"), false); _svgoutput_check_editing.init( _("Editing"), "/options/svgoutput/check_on_editing", false); - _page_svgoutput.add_line( true, "", _svgoutput_check_editing, "", _("Check attributes and style properties while editing SVG files (may slow down Inkscape, mostly useful for debugging)."), false); + _page_svgoutput.add_line( true, "", _svgoutput_check_editing, "", _("Check attributes and style properties while editing SVG files (may slow down Inkscape, mostly useful for debugging)"), false); _svgoutput_check_writing.init( _("Writing"), "/options/svgoutput/check_on_writing", true); - _page_svgoutput.add_line( true, "", _svgoutput_check_writing, "", _("Check attributes and style properties on writing out SVG files."), false); + _page_svgoutput.add_line( true, "", _svgoutput_check_writing, "", _("Check attributes and style properties on writing out SVG files"), false); this->AddPage(_page_svgoutput, _("SVG output"), iter_io, PREFS_PAGE_IO_SVGOUTPUT); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 1d03ab706..101831086 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -166,6 +166,7 @@ protected: UI::Widget::PrefSpinButton _mouse_sens; UI::Widget::PrefSpinButton _mouse_thres; + UI::Widget::PrefSlider _mouse_grabsize; UI::Widget::PrefCheckButton _mouse_use_ext_input; UI::Widget::PrefCheckButton _mouse_switch_on_ext_input; diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index f292ad565..4fd792407 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -36,7 +36,7 @@ namespace Dialogs { LayerPropertiesDialog::LayerPropertiesDialog() : _strategy(NULL), _desktop(NULL), _layer(NULL), _position_visible(false) { - Gtk::VBox *mainVBox = get_vbox(); + Gtk::Box *mainVBox = get_vbox(); _layout_table.set_spacings(4); _layout_table.resize (1, 2); diff --git a/src/ui/dialog/livepatheffect-add.cpp b/src/ui/dialog/livepatheffect-add.cpp index 36a9f06a3..c22aace37 100644 --- a/src/ui/dialog/livepatheffect-add.cpp +++ b/src/ui/dialog/livepatheffect-add.cpp @@ -72,7 +72,7 @@ LivePathEffectAdd::LivePathEffectAdd() : add_button.set_use_underline(true); add_button.set_can_default(); - Gtk::VBox *mainVBox = get_vbox(); + Gtk::Box *mainVBox = get_vbox(); mainVBox->pack_start(scrolled_window, true, true); add_action_widget(close_button, Gtk::RESPONSE_CLOSE); add_action_widget(add_button, Gtk::RESPONSE_APPLY); diff --git a/src/ui/dialog/messages.h b/src/ui/dialog/messages.h index 350c1feec..6ed246ece 100644 --- a/src/ui/dialog/messages.h +++ b/src/ui/dialog/messages.h @@ -19,6 +19,7 @@ #include <gtkmm/box.h> #include <gtkmm/textview.h> #include <gtkmm/button.h> +#include <gtkmm/checkbutton.h> #include <gtkmm/menubar.h> #include <gtkmm/menu.h> #include <gtkmm/scrolledwindow.h> diff --git a/src/ui/dialog/panel-dialog.h b/src/ui/dialog/panel-dialog.h index 1e44e23a1..1fefd811e 100644 --- a/src/ui/dialog/panel-dialog.h +++ b/src/ui/dialog/panel-dialog.h @@ -154,7 +154,7 @@ PanelDialog<B>::PanelDialog(Widget::Panel &panel, char const *prefs_path, int co PanelDialogBase(panel, prefs_path, verb_num, apply_label), Dialog(&B::create, prefs_path, verb_num, apply_label) { - Gtk::VBox *vbox = get_vbox(); + Gtk::Box *vbox = get_vbox(); _panel.signalResponse().connect(sigc::mem_fun(*this, &PanelDialog::_handleResponse)); _panel.signalPresent().connect(sigc::mem_fun(*this, &PanelDialog::_presentDialog)); @@ -204,7 +204,7 @@ PanelDialog<Behavior::FloatingBehavior>::PanelDialog(UI::Widget::Panel &panel, c PanelDialogBase(panel, prefs_path, verb_num, apply_label), Dialog(&Behavior::FloatingBehavior::create, prefs_path, verb_num, apply_label) { - Gtk::VBox *vbox = get_vbox(); + Gtk::Box *vbox = get_vbox(); _panel.signalResponse().connect(sigc::mem_fun(*this, &PanelDialog::_handleResponse)); vbox->pack_start(_panel, true, true, 0); diff --git a/src/ui/dialog/undo-history.h b/src/ui/dialog/undo-history.h index d94464517..ee7941580 100644 --- a/src/ui/dialog/undo-history.h +++ b/src/ui/dialog/undo-history.h @@ -16,6 +16,7 @@ #include <gtkmm/scrolledwindow.h> #include <gtkmm/treemodel.h> #include <gtkmm/treeselection.h> +#include <glibmm/property.h> #include <functional> #include <sstream> diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 5c39a2b22..03678d26d 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -49,8 +49,7 @@ #include "widgets/sp-xmlview-tree.h" #if !GTK_CHECK_VERSION(2,22,0) -#define GDK_KEY_Escape 0xff1b -#define GDK_KEY_Return 0xff0d +#include "compat-key-syms.h" #endif namespace Inkscape { |
