summaryrefslogtreecommitdiffstats
path: root/src/extension/param
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
commit25a9ed4f38121eeb59cf15dbf19391aaef45bba3 (patch)
treee123aeae50d98a52e1ad4575b29bf3c199619e33 /src/extension/param
parentSolve crash when deleting CSS property (diff)
parentinkview: Convert to ApplicationWindow (diff)
downloadinkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.tar.gz
inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.zip
Merge changes from trunk
(bzr r14949.1.64)
Diffstat (limited to 'src/extension/param')
-rw-r--r--src/extension/param/bool.cpp9
-rw-r--r--src/extension/param/enum.cpp2
-rw-r--r--src/extension/param/float.cpp17
-rw-r--r--src/extension/param/int.cpp18
-rw-r--r--src/extension/param/notebook.cpp8
-rw-r--r--src/extension/param/parameter.cpp10
-rw-r--r--src/extension/param/radiobutton.cpp11
-rw-r--r--src/extension/param/string.cpp2
8 files changed, 18 insertions, 59 deletions
diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp
index d64f798ba..ca61d8c51 100644
--- a/src/extension/param/bool.cpp
+++ b/src/extension/param/bool.cpp
@@ -14,6 +14,7 @@
#include <gtkmm/box.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/checkbutton.h>
+#include <glib/gi18n.h>
#include "xml/node.h"
#include "../extension.h"
@@ -129,14 +130,10 @@ Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node,
return NULL;
}
-#if WITH_GTKMM_3_0
- Gtk::Box * hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4));
+ auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4));
hbox->set_homogeneous(false);
-#else
- Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
-#endif
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
label->show();
hbox->pack_end(*label, true, true);
diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp
index 4e7420807..8bc0fbda7 100644
--- a/src/extension/param/enum.cpp
+++ b/src/extension/param/enum.cpp
@@ -251,7 +251,7 @@ Gtk::Widget *ParamComboBox::get_widget(SPDocument * doc, Inkscape::XML::Node * n
}
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, false, false, _indent);
diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp
index dff7cbf46..23a03ea8f 100644
--- a/src/extension/param/float.cpp
+++ b/src/extension/param/float.cpp
@@ -15,6 +15,7 @@
#include <gtkmm/scale.h>
#include "ui/widget/spinbutton.h"
#include "ui/widget/spin-scale.h"
+#include <glib/gi18n.h>
#include "xml/node.h"
#include "extension/extension.h"
@@ -176,16 +177,12 @@ Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * nod
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
-#if WITH_GTKMM_3_0
- ParamFloatAdjustment * pfa = new ParamFloatAdjustment(this, doc, node, changeSignal);
+ auto pfa = new ParamFloatAdjustment(this, doc, node, changeSignal);
Glib::RefPtr<Gtk::Adjustment> fadjust(pfa);
-#else
- ParamFloatAdjustment * fadjust = Gtk::manage(new ParamFloatAdjustment(this, doc, node, changeSignal));
-#endif
if (_mode == FULL) {
- UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_text, fadjust, _precision);
+ UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_(_text), fadjust, _precision);
scale->set_size_request(400, -1);
scale->show();
hbox->pack_start(*scale, false, false);
@@ -193,15 +190,11 @@ Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * nod
}
else if (_mode == MINIMAL) {
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, true, true, _indent);
-#if WITH_GTKMM_3_0
- Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(fadjust, 0.1, _precision));
-#else
- Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(*fadjust, 0.1, _precision));
-#endif
+ auto spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(fadjust, 0.1, _precision));
spin->show();
hbox->pack_start(*spin, false, false);
}
diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp
index dda801282..222d4f243 100644
--- a/src/extension/param/int.cpp
+++ b/src/extension/param/int.cpp
@@ -15,6 +15,7 @@
#include <gtkmm/scale.h>
#include "ui/widget/spinbutton.h"
#include "ui/widget/spin-scale.h"
+#include <glib/gi18n.h>
#include "xml/node.h"
#include "extension/extension.h"
@@ -157,32 +158,23 @@ ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
-
-#if WITH_GTKMM_3_0
- ParamIntAdjustment * pia = new ParamIntAdjustment(this, doc, node, changeSignal);
+ auto pia = new ParamIntAdjustment(this, doc, node, changeSignal);
Glib::RefPtr<Gtk::Adjustment> fadjust(pia);
-#else
- ParamIntAdjustment * fadjust = Gtk::manage(new ParamIntAdjustment(this, doc, node, changeSignal));
-#endif
if (_mode == FULL) {
- UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_text, fadjust, 0);
+ UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_(_text), fadjust, 0);
scale->set_size_request(400, -1);
scale->show();
hbox->pack_start(*scale, false, false);
}
else if (_mode == MINIMAL) {
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, true, true, _indent);
-#if WITH_GTKMM_3_0
- Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(fadjust, 1.0, 0));
-#else
- Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(*fadjust, 1.0, 0));
-#endif
+ auto spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(fadjust, 1.0, 0));
spin->show();
hbox->pack_start(*spin, false, false);
}
diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp
index 20c8e8481..957d12d06 100644
--- a/src/extension/param/notebook.cpp
+++ b/src/extension/param/notebook.cpp
@@ -353,11 +353,7 @@ public:
// hook function
this->signal_switch_page().connect(sigc::mem_fun(this, &ParamNotebookWdg::changed_page));
};
-#if WITH_GTKMM_3_0
void changed_page(Gtk::Widget *page, guint pagenum);
-#else
- void changed_page(GtkNotebookPage *page, guint pagenum);
-#endif
bool activated;
};
@@ -368,11 +364,7 @@ public:
* is actually visible. This to exclude 'fake' changes when the
* notebookpages are added or removed.
*/
-#if WITH_GTKMM_3_0
void ParamNotebookWdg::changed_page(Gtk::Widget * /*page*/, guint pagenum)
-#else
-void ParamNotebookWdg::changed_page(GtkNotebookPage * /*page*/, guint pagenum)
-#endif
{
if (get_visible()) {
_pref->set((int)pagenum, _doc, _node);
diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp
index e4a614667..a5632a39a 100644
--- a/src/extension/param/parameter.cpp
+++ b/src/extension/param/parameter.cpp
@@ -58,16 +58,6 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex
const char *guitext = in_repr->attribute("gui-text");
if (guitext == NULL) {
guitext = in_repr->attribute("_gui-text");
- if (guitext == NULL) {
- // guitext = ""; // propably better to require devs to explicitly set an empty gui-text if this is what they want
- } else {
- const char *context = in_repr->attribute("msgctxt");
- if (context != NULL) {
- guitext = g_dpgettext2(NULL, context, guitext);
- } else {
- guitext = _(guitext);
- }
- }
}
const char *gui_tip = in_repr->attribute("gui-tip");
if (gui_tip == NULL) {
diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp
index 1d1b860c6..c54cc0ec3 100644
--- a/src/extension/param/radiobutton.cpp
+++ b/src/extension/param/radiobutton.cpp
@@ -303,17 +303,12 @@ Gtk::Widget * ParamRadioButton::get_widget(SPDocument * doc, Inkscape::XML::Node
return NULL;
}
-#if WITH_GTKMM_3_0
- Gtk::Box * hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4));
+ auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4));
hbox->set_homogeneous(false);
- Gtk::Box * vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0));
+ auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0));
vbox->set_homogeneous(false);
-#else
- Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
- Gtk::VBox * vbox = Gtk::manage(new Gtk::VBox(false, 0));
-#endif
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START, Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START, Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, false, false, _indent);
diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp
index 6b082b133..1d9205502 100644
--- a/src/extension/param/string.cpp
+++ b/src/extension/param/string.cpp
@@ -166,7 +166,7 @@ Gtk::Widget * ParamString::get_widget(SPDocument * doc, Inkscape::XML::Node * no
}
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, false, false, _indent);