summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorAndrew rugby471@gmail.com <>2011-03-24 19:14:21 +0000
committerAndrew rugby471@gmail.com <>2011-03-24 19:14:21 +0000
commit002481162f050709a125e38dc60145ef77c10c98 (patch)
tree8ab6929749e954648e2aae51992eefa94319babe /src/file.cpp
parentSplit OCALDialog code in fill.cpp into two, so we can have async stuff working (diff)
downloadinkscape-002481162f050709a125e38dc60145ef77c10c98.tar.gz
inkscape-002481162f050709a125e38dc60145ef77c10c98.zip
Made dialog's state persistant
Cleanup of code Made download of image work Put all images into a /tmp/openclipart directory Use GUID for filename (bzr r10092.1.18)
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/file.cpp b/src/file.cpp
index bfb10e6d6..cee5280c0 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -1113,7 +1113,7 @@ sp_file_import(Gtk::Window &parentWindow)
return;
}
- //# Get file name and extension type
+ // Get file name and extension type
Glib::ustring fileName = importDialogInstance->getFilename();
Inkscape::Extension::Extension *selection = importDialogInstance->getSelectionType();
@@ -1440,16 +1440,17 @@ sp_file_export_to_ocal(Gtk::Window &parentWindow)
## I M P O R T F R O M O C A L
######################*/
+Inkscape::UI::Dialog::OCAL::ImportDialog* import_ocal_dialog = NULL;
+
/**
* Display an ImportFromOcal Dialog, and the selected document from OCAL
*/
-void on_import_from_ocal_response(Glib::ustring filename,
- Inkscape::UI::Dialog::OCAL::ImportDialog* import_dialog)
+void on_import_from_ocal_response(Glib::ustring filename)
{
SPDocument *doc = SP_ACTIVE_DOCUMENT;
if (!filename.empty()) {
- Inkscape::Extension::Extension *selection = import_dialog->get_selection_type();
+ Inkscape::Extension::Extension *selection = import_ocal_dialog->get_selection_type();
file_import(doc, filename, selection);
}
}
@@ -1463,24 +1464,19 @@ sp_file_import_from_ocal(Gtk::Window &parent_window)
if (!doc)
return;
- Inkscape::UI::Dialog::OCAL::ImportDialog* import_dialog = NULL;
-
- if (!import_dialog) {
- import_dialog = new
+ if (import_ocal_dialog == NULL) {
+ import_ocal_dialog = new
Inkscape::UI::Dialog::OCAL::ImportDialog(
parent_window,
import_path,
Inkscape::UI::Dialog::IMPORT_TYPES,
(char const *)_("Import From Open Clip Art Library"));
- }
- import_dialog->signal_response().connect(
- sigc::bind<Inkscape::UI::Dialog::OCAL::ImportDialog*>(
- sigc::ptr_fun(&on_import_from_ocal_response),
- import_dialog)
- );
+ import_ocal_dialog->signal_response().connect(
+ sigc::ptr_fun(&on_import_from_ocal_response));
+ }
- import_dialog->show_all();
+ import_ocal_dialog->show_all();
}
/*######################