summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77e0947)
raw | patch | inline | side by side (parent: 77e0947)
author | bdilly <bdilly@users.sourceforge.net> | |
Wed, 8 Aug 2007 05:47:10 +0000 (05:47 +0000) | ||
committer | bdilly <bdilly@users.sourceforge.net> | |
Wed, 8 Aug 2007 05:47:10 +0000 (05:47 +0000) |
diff --git a/src/file.cpp b/src/file.cpp
index d697a7d785a496abc770d8eff85c97c006504f23..d5f0c6f6eea5791ccc06ee688fca2942bd790877 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
* This 'save' function called by the others below
* It was divided in file_save_local and file_save_remote
* to support remote saving too.
+ * Now file_save is calling only local saving, but it will be solved.
*
* \param official whether to set :output_module and :modified in the
* document; is true for normal save, false for temporary saves
@@ -512,18 +513,18 @@ file_save(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri,
#ifdef WITH_GNOME_VFS
- if (gnome_vfs_initialized() && !gnome_vfs_uri_is_local(gnome_vfs_uri_new(uri.c_str()))) {
- // Use VFS for this
- bool success = file_save_remote(doc, uri, key, saveas, official);
- if (!success) {
- g_warning("Error: Could not save file '%s' with VFS\n", uri.c_str());
- return false;
- }
- else
- return true;
- }
- else
- return file_save_local(parentWindow, doc, uri, key, saveas, official);
+// if (gnome_vfs_initialized() && !gnome_vfs_uri_is_local(gnome_vfs_uri_new(uri.c_str()))) {
+// // Use VFS for this
+// bool success = file_save_remote(doc, uri, key, saveas, official);
+// if (!success) {
+// g_warning("Error: Could not save file '%s' with VFS\n", uri.c_str());
+// return false;
+// }
+// else
+// return true;
+// }
+// else
+ return file_save_local(parentWindow, doc, uri, key, saveas, official);
#else
return file_save_local(parentWindow, doc, uri, key, saveas, official);
#ifdef WITH_GNOME_VFS
-
+/*
+ * Used only for remote saving using VFS and a specific uri. Gets the file at the /tmp.
+ */
bool
file_save_remote(SPDocument *doc, const Glib::ustring &uri,
Inkscape::Extension::Extension *key, bool saveas, bool official)
}
uri.append(prefs_get_string_attribute("options.ocalurl", "str"));
uri.append(Glib::path_get_basename(fileName));
-
- success = file_save(parentWindow, doc, uri, selectionType, FALSE, FALSE);
- remove(fileName.c_str());
+ // Save as a remote file using the dav protocol.
+ success = file_save_remote(doc, uri, selectionType, FALSE, FALSE);
+ //remove(fileName.c_str());
if (!success)
g_warning( "Error exporting the document." );
bool success = sp_file_export_to_ocal_dialog(parentWindow);
if (success)
SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Document exported..."));
-
+}
+
+/*######################
+## I M P O R T F R O M O C A L
+######################*/
+
+/**
+ * Import a document from OCAL
+ */
+void
+sp_file_import_from_ocal(Gtk::Window &parentWindow)
+{
+ // Try to execute the new code and return;
+ if (!SP_ACTIVE_DOCUMENT)
+ return;
+ //bool success = sp_file_import_from_ocal_dialog(parentWindow);
+ //if (success)
+ // SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Document imported..."));
}
+
/*######################
## P R I N T
######################*/
diff --git a/src/file.h b/src/file.h
index 33210fabdb923a9666803b9a85b985fd3155ac6a..c5a854922907d74ca6babad7037b30d19e3bc429 100644 (file)
--- a/src/file.h
+++ b/src/file.h
bool sp_file_export_to_ocal_dialog (void *widget);
+/*######################
+## I M P O R T F R O M O C A L
+######################*/
+
+/**
+ * Import a document from OCAL
+ */
+void sp_file_import_from_ocal (Gtk::Window &parentWindow );
+
+
+/**
+ * Import a document from OCAL
+ */
+//bool sp_file_import_from_ocal_dialog (void *widget);
+
+
+
/*######################
## P R I N T
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index 9002323033b3d12812fefaaaec1d9fa7ba5da702..cdf725232df6a188979ee59c334fbcc8c033d263 100644 (file)
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
" <separator/>\n"
" <verb verb-id=\"FileImport\" />\n"
" <verb verb-id=\"FileExport\" />\n"
+" <verb verb-id=\"FileImportFromOCAL\" />\n"
" <verb verb-id=\"FileExportToOCAL\" />\n"
" <separator/>\n"
/* These are ugly, but what needs to happen here is allowing users
diff --git a/src/ui/icons.cpp b/src/ui/icons.cpp
index f7f66d57448877ec83e6dd28d58f44da697fc342..f24dad66bff7edd9a957d0c4fca2e478ff211f13 100644 (file)
--- a/src/ui/icons.cpp
+++ b/src/ui/icons.cpp
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 503d059916b845b3b1d196a4c98998b7bae77431..6ac6042d4cf69a99ced3b24283606734abe226b1 100644 (file)
--- a/src/ui/stock-items.cpp
+++ b/src/ui/stock-items.cpp
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(IMPORTFROMOCAL, _("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")));
diff --git a/src/ui/stock.cpp b/src/ui/stock.cpp
index 6d4c7b391df54f1cc8765a252c2ef9e697376582..f0ec456b1cb30cc424aa209076ace7d4f251cf58 100644 (file)
--- a/src/ui/stock.cpp
+++ b/src/ui/stock.cpp
Gtk::StockID const OPEN_RECENT("open-recent");
Gtk::StockID const IMPORT("import");
Gtk::StockID const EXPORT("export");
+Gtk::StockID const IMPORTFROMOCAL("import_from_ocal");
Gtk::StockID const EXPORTTOOCAL("export_to_ocal");
Gtk::StockID const VACUUM_DEFS("vacuum-defs");
// Edit menu
diff --git a/src/ui/stock.h b/src/ui/stock.h
index 4069115a7a090677b30ae71a9719cf21139181ca..ad99a3c055bf26438a2dcc28199621228cb428ad 100644 (file)
--- a/src/ui/stock.h
+++ b/src/ui/stock.h
extern Gtk::StockID const OPEN_RECENT;
extern Gtk::StockID const IMPORT;
extern Gtk::StockID const EXPORT;
+extern Gtk::StockID const IMPORTFROMOCAL;
extern Gtk::StockID const EXPORTTOOCAL;
extern Gtk::StockID const VACUUM_DEFS;
// Edit menu
index a6302aa9dd0a2e812cfbccc9c0a7f6beb5463d76..e1671e5b1064f85fd6ca873590db669d8c2d54b2 100644 (file)
this->set_text(prefs_get_string_attribute(_prefs_path.c_str(), _attr.c_str()));
}
-void PrefEntry::on_activate()
+void PrefEntry::on_changed()
{
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
index 5b64028837c79712160b3d6a2425fc3b16cac18b..4ed0a35aa7f3287422cd9b72c4d96ea3fa10cc38 100644 (file)
protected:
std::string _prefs_path;
std::string _attr;
- void on_activate();
+ void on_changed();
};
class DialogPage : public Gtk::Table
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 38ce87e59921d44975537c5d2dc9504fc3c63105..897f11369f4704178f6d6b6bd191bc55b78a6c56 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
case SP_VERB_FILE_EXPORT:
sp_file_export_dialog(NULL);
break;
+ case SP_VERB_FILE_IMPORT_FROM_OCAL:
+ sp_file_import_from_ocal(*parent);
+ break;
case SP_VERB_FILE_EXPORT_TO_OCAL:
sp_file_export_to_ocal(*parent);
break;
N_("Import a bitmap or SVG image into this document"), "file_import"),
new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."),
N_("Export this document or a selection as a bitmap image"), "file_export"),
- new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("_Export To OCAL"), N_("_Export this document to Open Clip Art Library"), "file_export_to_ocal"),
+ new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import From OCAL"), N_("Import a document from Open Clip Art Library"), NULL),
+ new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("Export To OCAL"), N_("Export this document to Open Clip Art Library"), NULL),
new FileVerb(SP_VERB_FILE_NEXT_DESKTOP, "NextWindow", N_("N_ext Window"),
N_("Switch to the next document window"), "window_next"),
new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "PrevWindow", N_("P_revious Window"),
diff --git a/src/verbs.h b/src/verbs.h
index b86a84ee5ddaa0caf340ce8baa485b9372543097..ec21ac06887ddae53017c1d56896440e99fd6537 100644 (file)
--- a/src/verbs.h
+++ b/src/verbs.h
SP_VERB_FILE_PRINT_PREVIEW,
SP_VERB_FILE_IMPORT,
SP_VERB_FILE_EXPORT,
- SP_VERB_FILE_EXPORT_TO_OCAL, /**< Export the file to Open ClipArt Library */
+ SP_VERB_FILE_IMPORT_FROM_OCAL, /**< Import the file from Open Clip Art Library */
+ SP_VERB_FILE_EXPORT_TO_OCAL, /**< Export the file to Open Clip Art Library */
SP_VERB_FILE_NEXT_DESKTOP,
SP_VERB_FILE_PREV_DESKTOP,
SP_VERB_FILE_CLOSE_VIEW,