summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-10-13 19:40:31 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-10-13 19:40:31 +0000
commit34789891fcdbd099bd390ce3d0465dee24a788db (patch)
tree1b16d78374f9d56c0f03a6b20c9e2e6048f4fb5e /src/ui/dialog
parentupdate to trunk (diff)
parentUI message generalisation (diff)
downloadinkscape-34789891fcdbd099bd390ce3d0465dee24a788db.tar.gz
inkscape-34789891fcdbd099bd390ce3d0465dee24a788db.zip
Update to trunk
(bzr r12588.1.12)
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/clonetiler.cpp10
-rw-r--r--src/ui/dialog/dialog-manager.cpp9
-rw-r--r--src/ui/dialog/dialog-manager.h4
-rw-r--r--src/ui/dialog/document-properties.cpp10
-rw-r--r--src/ui/dialog/export.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-win32.h4
-rw-r--r--src/ui/dialog/find.cpp2
-rw-r--r--src/ui/dialog/guides.cpp2
8 files changed, 23 insertions, 22 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index b3675440b..87c399339 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -1107,7 +1107,7 @@ CloneTiler::CloneTiler (void) :
#endif
double value = prefs->getDouble(prefs_path + "fillwidth", 50.0);
- Inkscape::Util::Unit const unit = unit_menu->getUnit();
+ Inkscape::Util::Unit const *unit = unit_menu->getUnit();
gdouble const units = Inkscape::Util::Quantity::convert(value, "px", unit);
fill_width->set_value (units);
@@ -1140,7 +1140,7 @@ CloneTiler::CloneTiler (void) :
#endif
double value = prefs->getDouble(prefs_path + "fillheight", 50.0);
- Inkscape::Util::Unit const unit = unit_menu->getUnit();
+ Inkscape::Util::Unit const *unit = unit_menu->getUnit();
gdouble const units = Inkscape::Util::Quantity::convert(value, "px", unit);
fill_height->set_value (units);
@@ -2948,7 +2948,7 @@ void CloneTiler::clonetiler_switch_to_fill(GtkToggleButton * /*tb*/, GtkWidget *
void CloneTiler::clonetiler_fill_width_changed(GtkAdjustment *adj, Inkscape::UI::Widget::UnitMenu *u)
{
gdouble const raw_dist = gtk_adjustment_get_value (adj);
- Inkscape::Util::Unit const unit = u->getUnit();
+ Inkscape::Util::Unit const *unit = u->getUnit();
gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, unit, "px");
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -2958,7 +2958,7 @@ void CloneTiler::clonetiler_fill_width_changed(GtkAdjustment *adj, Inkscape::UI:
void CloneTiler::clonetiler_fill_height_changed(GtkAdjustment *adj, Inkscape::UI::Widget::UnitMenu *u)
{
gdouble const raw_dist = gtk_adjustment_get_value (adj);
- Inkscape::Util::Unit const unit = u->getUnit();
+ Inkscape::Util::Unit const *unit = u->getUnit();
gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, unit, "px");
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -2971,7 +2971,7 @@ void CloneTiler::clonetiler_unit_changed()
gdouble width_pixels = prefs->getDouble(prefs_path + "fillwidth");
gdouble height_pixels = prefs->getDouble(prefs_path + "fillheight");
- Inkscape::Util::Unit unit = unit_menu->getUnit();
+ Inkscape::Util::Unit const *unit = unit_menu->getUnit();
gdouble width_value = Inkscape::Util::Quantity::convert(width_pixels, "px", unit);
gdouble height_value = Inkscape::Util::Quantity::convert(height_pixels, "px", unit);
diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp
index 17f6ae74d..6d32e3aa8 100644
--- a/src/ui/dialog/dialog-manager.cpp
+++ b/src/ui/dialog/dialog-manager.cpp
@@ -243,14 +243,14 @@ Dialog *DialogManager::getDialog(GQuark name) {
/**
* Shows the named dialog, creating it if necessary.
*/
-void DialogManager::showDialog(gchar const *name) {
- showDialog(g_quark_from_string(name));
+void DialogManager::showDialog(gchar const *name, bool grabfocus) {
+ showDialog(g_quark_from_string(name), grabfocus);
}
/**
* Shows the named dialog, creating it if necessary.
*/
-void DialogManager::showDialog(GQuark name) {
+void DialogManager::showDialog(GQuark name, bool grabfocus) {
bool wantTiming = Inkscape::Preferences::get()->getBool("/dialogs/debug/trackAppear", false);
GTimer *timer = (wantTiming) ? g_timer_new() : 0; // if needed, must be created/started before getDialog()
Dialog *dialog = getDialog(name);
@@ -261,7 +261,8 @@ void DialogManager::showDialog(GQuark name) {
tracker->setAutodelete(true);
timer = 0;
}
- dialog->present();
+ if (grabfocus)
+ dialog->present();
}
if ( timer ) {
diff --git a/src/ui/dialog/dialog-manager.h b/src/ui/dialog/dialog-manager.h
index 33b166aa1..15573f760 100644
--- a/src/ui/dialog/dialog-manager.h
+++ b/src/ui/dialog/dialog-manager.h
@@ -44,8 +44,8 @@ public:
void registerFactory(GQuark name, DialogFactory factory);
Dialog *getDialog(gchar const* dlgName);
Dialog *getDialog(GQuark dlgName);
- void showDialog(gchar const *name);
- void showDialog(GQuark name);
+ void showDialog(gchar const *name, bool grabfocus=true);
+ void showDialog(GQuark name, bool grabfocus=true);
protected:
DialogManager(DialogManager const &d); // no copy
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 37d0ce213..a6019c55c 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -1441,7 +1441,7 @@ void DocumentProperties::update()
_rum_deflt.setUnit (nv->doc_units->abbr);
double doc_w = sp_desktop_document(dt)->getRoot()->width.value;
- Glib::ustring doc_w_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->width.unit).abbr;
+ Glib::ustring doc_w_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->width.unit)->abbr;
if (doc_w_unit == "") {
doc_w_unit = "px";
} else if (doc_w_unit == "%" && sp_desktop_document(dt)->getRoot()->viewBox_set) {
@@ -1449,7 +1449,7 @@ void DocumentProperties::update()
doc_w = sp_desktop_document(dt)->getRoot()->viewBox.width();
}
double doc_h = sp_desktop_document(dt)->getRoot()->height.value;
- Glib::ustring doc_h_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->height.unit).abbr;
+ Glib::ustring doc_h_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->height.unit)->abbr;
if (doc_h_unit == "") {
doc_h_unit = "px";
} else if (doc_h_unit == "%" && sp_desktop_document(dt)->getRoot()->viewBox_set) {
@@ -1644,11 +1644,11 @@ void DocumentProperties::onDocUnitChange()
{
SPDocument *doc = SP_ACTIVE_DOCUMENT;
Inkscape::XML::Node *repr = sp_desktop_namedview(getDesktop())->getRepr();
- Inkscape::Util::Unit old_doc_unit = unit_table.getUnit("px");
+ Inkscape::Util::Unit const *old_doc_unit = unit_table.getUnit("px");
if(repr->attribute("inkscape:document-units")) {
old_doc_unit = unit_table.getUnit(repr->attribute("inkscape:document-units"));
}
- Inkscape::Util::Unit doc_unit = _rum_deflt.getUnit();
+ Inkscape::Util::Unit const *doc_unit = _rum_deflt.getUnit();
// Don't execute when change is being undone
if (!DocumentUndo::getUndoSensitive(doc)) {
@@ -1657,7 +1657,7 @@ void DocumentProperties::onDocUnitChange()
// Set document unit
Inkscape::SVGOStringStream os;
- os << doc_unit.abbr;
+ os << doc_unit->abbr;
repr->setAttribute("inkscape:document-units", os.str().c_str());
// Set viewBox
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index 577793496..f1f7cf6c1 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -1884,7 +1884,7 @@ void Export::setValuePx(Glib::RefPtr<Gtk::Adjustment>& adj, double val)
void Export::setValuePx( Gtk::Adjustment *adj, double val)
#endif
{
- const Unit unit = unit_selector->getUnit();
+ Unit const *unit = unit_selector->getUnit();
setValue(adj, Inkscape::Util::Quantity::convert(val, "px", unit));
@@ -1934,7 +1934,7 @@ float Export::getValuePx( Gtk::Adjustment *adj )
#endif
{
float value = getValue( adj);
- const Unit unit = unit_selector->getUnit();
+ Unit const *unit = unit_selector->getUnit();
return Inkscape::Util::Quantity::convert(value, unit, "px");
} // end of sp_export_value_get_px()
diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h
index 2e6bb4bb8..29bcb9a45 100644
--- a/src/ui/dialog/filedialogimpl-win32.h
+++ b/src/ui/dialog/filedialogimpl-win32.h
@@ -140,7 +140,7 @@ public:
/// Shows the file dialog, and blocks until a file
/// has been selected.
- /// @return Returns true if the the user selected a
+ /// @return Returns true if the user selected a
/// file, or false if the user pressed cancel.
bool show();
@@ -341,7 +341,7 @@ public:
/// Shows the file dialog, and blocks until a file
/// has been selected.
- /// @return Returns true if the the user selected a
+ /// @return Returns true if the user selected a
/// file, or false if the user pressed cancel.
bool show();
diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp
index def7b5bdb..37f2761df 100644
--- a/src/ui/dialog/find.cpp
+++ b/src/ui/dialog/find.cpp
@@ -664,7 +664,7 @@ bool Find::item_type_match (SPItem *item)
if ( SP_IS_RECT(item)) {
return ( all ||check_rects.get_active());
- } else if (SP_IS_GENERICELLIPSE(item) || SP_IS_ELLIPSE(item) || SP_IS_ARC(item) || SP_IS_CIRCLE(item)) {
+ } else if (SP_IS_GENERICELLIPSE(item)) {
return ( all || check_ellipses.get_active());
} else if (SP_IS_STAR(item) || SP_IS_POLYGON(item)) {
diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp
index 2de387364..5dfafa78d 100644
--- a/src/ui/dialog/guides.cpp
+++ b/src/ui/dialog/guides.cpp
@@ -59,7 +59,7 @@ Glib::ustring GuidelinePropertiesDialog::_angle_unit_status = DEG; // initialize
GuidelinePropertiesDialog::~GuidelinePropertiesDialog() {
// save current status
_relative_toggle_status = _relative_toggle.get_active();
- _angle_unit_status = _spin_angle.getUnit().abbr;
+ _angle_unit_status = _spin_angle.getUnit()->abbr;
}
void GuidelinePropertiesDialog::showDialog(SPGuide *guide, SPDesktop *desktop) {