summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorBruno Dilly <bruno.dilly@gmail.com>2007-08-06 18:32:13 +0000
committerbdilly <bdilly@users.sourceforge.net>2007-08-06 18:32:13 +0000
commitf006ebdee5b2f29127a152978ac72e41f61ced33 (patch)
treed35a9cc73d84182ad90838bcd77cda2e3574679d /src/ui
parentAdd Gail and Diederik; correct Danilo's name. (diff)
downloadinkscape-f006ebdee5b2f29127a152978ac72e41f61ced33.tar.gz
inkscape-f006ebdee5b2f29127a152978ac72e41f61ced33.zip
adds export to ocal feature without dialog window
(bzr r3398)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp7
-rw-r--r--src/ui/dialog/inkscape-preferences.h4
-rw-r--r--src/ui/icons.cpp6
-rw-r--r--src/ui/stock-items.cpp1
-rw-r--r--src/ui/stock.cpp1
-rw-r--r--src/ui/stock.h1
-rw-r--r--src/ui/widget/preferences-widget.cpp22
-rw-r--r--src/ui/widget/preferences-widget.h14
8 files changed, 54 insertions, 2 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index cd6cd0b9f..99ec59449 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -5,6 +5,7 @@
* Carl Hetherington
* Marco Scholten
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
+ * Bruno Dilly <bruno.dilly@gmail.com>
*
* Copyright (C) 2004-2007 Authors
*
@@ -621,6 +622,12 @@ void InkscapePreferences::initPageMisc()
_misc_overs_bitmap.set_size_request(_sb_width);
_misc_overs_bitmap.init("options.bitmapoversample", "value", labels, values, num_items, 1);
_page_misc.add_line( false, _("Oversample bitmaps:"), _misc_overs_bitmap, "", "", false);
+ _misc_ocal_url.init("options.ocalurl", "str", true);
+ _page_misc.add_line( false, _("Open Clip Art Library URL:"), _misc_ocal_url, "", _("The url of the Open Clip Art Library webdav server. It's used by the Export to OCAL function."), true);
+ _misc_ocal_username.init("options.ocalusername", "str", true);
+ _page_misc.add_line( false, _("Open Clip Art Library Username:"), _misc_ocal_username, "", _("The username used to log into Open Clip Art Library."), true);
+ _misc_ocal_password.init("options.ocalpassword", "str", false);
+ _page_misc.add_line( false, _("Open Clip Art Library Password:"), _misc_ocal_password, "", _("The password used to log into Open Clip Art Library."), true);
this->AddPage(_page_misc, _("Misc"), PREFS_PAGE_MISC);
}
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index fc3adb20a..c1999f946 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -5,6 +5,7 @@
* Carl Hetherington
* Marco Scholten
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
+ * Bruno Dilly <bruno.dilly@gmail.com>
*
* Copyright (C) 2004-2007 Authors
*
@@ -154,6 +155,9 @@ protected:
PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
PrefCheckButton _misc_small_toolbar;
PrefCombo _misc_overs_bitmap;
+ PrefEntry _misc_ocal_url;
+ PrefEntry _misc_ocal_username;
+ PrefEntry _misc_ocal_password;
int _max_dialog_width;
int _max_dialog_height;
diff --git a/src/ui/icons.cpp b/src/ui/icons.cpp
index f24dad66b..f7f66d574 100644
--- a/src/ui/icons.cpp
+++ b/src/ui/icons.cpp
@@ -57,6 +57,12 @@ init()
src.set_filename(get_icon_path("export.svg"));
_export.add_source(src);
icons->add(Stock::EXPORT, _export);
+ // Export to OCAL
+ Gtk::IconSet _export_to_ocal;
+ src.set_icon_name("ExportToOCAL");
+ src.set_filename(get_icon_path("export_to_ocal.svg"));
+ _export_to_ocal.add_source(src);
+ icons->add(Stock::EXPORTTOOCAL, _export_to_ocal);
// Vacuum Defs
Gtk::IconSet _vacuum_defs;
src.set_icon_name("VacuumDefs");
diff --git a/src/ui/stock-items.cpp b/src/ui/stock-items.cpp
index 09e2a894d..503d05991 100644
--- a/src/ui/stock-items.cpp
+++ b/src/ui/stock-items.cpp
@@ -33,6 +33,7 @@ init()
add(Gtk::StockItem(SAVE_AS, _("PLACEHOLDER, do not translate")));
add(Gtk::StockItem(IMPORT, _("PLACEHOLDER, do not translate")));
add(Gtk::StockItem(EXPORT, _("PLACEHOLDER, do not translate")));
+ add(Gtk::StockItem(EXPORTTOOCAL, _("PLACEHOLDER, do not translate")));
add(Gtk::StockItem(PRINT, _("PLACEHOLDER, do not translate")));
add(Gtk::StockItem(PRINT_PREVIEW, _("PLACEHOLDER, do not translate")));
add(Gtk::StockItem(VACUUM_DEFS, _("PLACEHOLDER, do not translate")));
diff --git a/src/ui/stock.cpp b/src/ui/stock.cpp
index 03e491340..6d4c7b391 100644
--- a/src/ui/stock.cpp
+++ b/src/ui/stock.cpp
@@ -19,6 +19,7 @@ namespace Stock {
Gtk::StockID const OPEN_RECENT("open-recent");
Gtk::StockID const IMPORT("import");
Gtk::StockID const EXPORT("export");
+Gtk::StockID const EXPORTTOOCAL("export_to_ocal");
Gtk::StockID const VACUUM_DEFS("vacuum-defs");
// Edit menu
Gtk::StockID const UNDO_HISTORY("undo-history");
diff --git a/src/ui/stock.h b/src/ui/stock.h
index 733edacdb..4069115a7 100644
--- a/src/ui/stock.h
+++ b/src/ui/stock.h
@@ -22,6 +22,7 @@ namespace Stock {
extern Gtk::StockID const OPEN_RECENT;
extern Gtk::StockID const IMPORT;
extern Gtk::StockID const EXPORT;
+extern Gtk::StockID const EXPORTTOOCAL;
extern Gtk::StockID const VACUUM_DEFS;
// Edit menu
extern Gtk::StockID const UNDO_HISTORY;
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index 00d8b5a26..a6302aa9d 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -3,8 +3,9 @@
*
* Authors:
* Marco Scholten
+ * Bruno Dilly <bruno.dilly@gmail.com>
*
- * Copyright (C) 2004, 2006 Authors
+ * Copyright (C) 2004, 2006, 2007 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
@@ -266,6 +267,25 @@ void PrefCombo::on_changed()
}
}
+void PrefEntry::init(const std::string& prefs_path, const std::string& attr,
+ bool visibility)
+{
+ _prefs_path = prefs_path;
+ _attr = attr;
+ this->set_invisible_char('*');
+ this->set_visibility(visibility);
+ this->set_text(prefs_get_string_attribute(_prefs_path.c_str(), _attr.c_str()));
+}
+
+void PrefEntry::on_activate()
+{
+ if (this->is_visible()) //only take action if user changed value
+ {
+ prefs_set_string_attribute(_prefs_path.c_str(), _attr.c_str(), this->get_text().c_str());
+ }
+ return;
+}
+
} // namespace Widget
} // namespace UI
} // namespace Inkscape
diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h
index 361d737a8..5b6402883 100644
--- a/src/ui/widget/preferences-widget.h
+++ b/src/ui/widget/preferences-widget.h
@@ -3,8 +3,9 @@
*
* Authors:
* Marco Scholten
+ * Bruno Dilly <bruno.dilly@gmail.com>
*
- * Copyright (C) 2004, 2006 Authors
+ * Copyright (C) 2004, 2006, 2007 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
@@ -88,6 +89,17 @@ protected:
void on_changed();
};
+class PrefEntry : public Gtk::Entry
+{
+public:
+ void init(const std::string& prefs_path, const std::string& attr,
+ bool mask);
+protected:
+ std::string _prefs_path;
+ std::string _attr;
+ void on_activate();
+};
+
class DialogPage : public Gtk::Table
{
public: