From db034d36e3cc13c9a9a28283f7d7630bd0e40df2 Mon Sep 17 00:00:00 2001 From: "Andrew rugby471@gmail.com" <> Date: Fri, 11 Mar 2011 19:01:27 +0000 Subject: converted to use var_name from CamelCase removed erroneous size_request (bzr r10092.1.4) --- src/file.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 2816b0434..d997a72f7 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1444,7 +1444,7 @@ sp_file_export_to_ocal(Gtk::Window &parentWindow) * Display an ImportToOcal Dialog, and the selected document from OCAL */ void -sp_file_import_from_ocal(Gtk::Window &parentWindow) +sp_file_import_from_ocal(Gtk::Window &parent_window) { static Glib::ustring import_path; @@ -1452,44 +1452,44 @@ sp_file_import_from_ocal(Gtk::Window &parentWindow) if (!doc) return; - Inkscape::UI::Dialog::FileImportFromOCALDialog *importDialogInstance = NULL; + Inkscape::UI::Dialog::FileImportFromOCALDialog *import_dialog = NULL; - if (!importDialogInstance) { - importDialogInstance = new + if (!import_dialog) { + import_dialog = new Inkscape::UI::Dialog::FileImportFromOCALDialog( - parentWindow, + parent_window, import_path, Inkscape::UI::Dialog::IMPORT_TYPES, (char const *)_("Import From Open Clip Art Library")); } - bool success = importDialogInstance->show(); + bool success = import_dialog->show(); if (!success) { - delete importDialogInstance; + delete import_dialog; return; } // Get file name and extension type - Glib::ustring fileName = importDialogInstance->getFilename(); - Inkscape::Extension::Extension *selection = importDialogInstance->getSelectionType(); + Glib::ustring file_name = import_dialog->get_filename(); + Inkscape::Extension::Extension *selection = import_dialog->get_selection_type(); - delete importDialogInstance; - importDialogInstance = NULL; + delete import_dialog; + import_dialog = NULL; - if (fileName.size() > 0) { + if (file_name.size() > 0) { - Glib::ustring newFileName = Glib::filename_to_utf8(fileName); + Glib::ustring new_file_name = Glib::filename_to_utf8(file_name); - if ( newFileName.size() > 0) - fileName = newFileName; + if (new_file_name.size() > 0) + file_name = new_file_name; else g_warning( "ERROR CONVERTING OPEN FILENAME TO UTF-8" ); - import_path = fileName; + import_path = file_name; if (import_path.size()>0) import_path.append(G_DIR_SEPARATOR_S); - file_import(doc, fileName, selection); + file_import(doc, file_name, selection); } return; -- cgit v1.2.3 From d643c9d4c725c32f7084e7d59d60e6e897819c89 Mon Sep 17 00:00:00 2001 From: "Andrew rugby471@gmail.com" <> Date: Sun, 13 Mar 2011 07:55:20 +0000 Subject: Added OCAL namespace within Dialog namespace (bzr r10092.1.7) --- src/file.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index d997a72f7..967c59b08 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1328,8 +1328,8 @@ sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) export_path = export_path_local; // Show the Export To OCAL dialog - Inkscape::UI::Dialog::FileExportToOCALDialog *exportDialogInstance = - new Inkscape::UI::Dialog::FileExportToOCALDialog( + Inkscape::UI::Dialog::OCAL:ExportDialog *exportDialogInstance = + new Inkscape::UI::Dialog::OCAL:ExportDialog parentWindow, Inkscape::UI::Dialog::EXPORT_TYPES, (char const *) _("Select file to export to") @@ -1452,11 +1452,11 @@ sp_file_import_from_ocal(Gtk::Window &parent_window) if (!doc) return; - Inkscape::UI::Dialog::FileImportFromOCALDialog *import_dialog = NULL; + Inkscape::UI::Dialog::OCAL::ImportDialog *import_dialog = NULL; if (!import_dialog) { import_dialog = new - Inkscape::UI::Dialog::FileImportFromOCALDialog( + Inkscape::UI::Dialog::OCAL::ImportDialog( parent_window, import_path, Inkscape::UI::Dialog::IMPORT_TYPES, -- cgit v1.2.3 From 7ab46bc54ee3aaa87282dfd35d8f6000fe811750 Mon Sep 17 00:00:00 2001 From: "Andrew rugby471@gmail.com" <> Date: Tue, 22 Mar 2011 17:14:49 +0000 Subject: Split OCALDialog code in fill.cpp into two, so we can have async stuff working Added StatusWidget to show status of operations in dialog Styled no search results label appropriately Corrected callbacks for buttons Start to get image downloading working (bzr r10092.1.17) --- src/file.cpp | 52 ++++++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 967c59b08..bfb10e6d6 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1441,8 +1441,19 @@ sp_file_export_to_ocal(Gtk::Window &parentWindow) ######################*/ /** - * Display an ImportToOcal Dialog, and the selected document from OCAL + * 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) +{ + SPDocument *doc = SP_ACTIVE_DOCUMENT; + + if (!filename.empty()) { + Inkscape::Extension::Extension *selection = import_dialog->get_selection_type(); + file_import(doc, filename, selection); + } +} + void sp_file_import_from_ocal(Gtk::Window &parent_window) { @@ -1452,7 +1463,7 @@ sp_file_import_from_ocal(Gtk::Window &parent_window) if (!doc) return; - Inkscape::UI::Dialog::OCAL::ImportDialog *import_dialog = NULL; + Inkscape::UI::Dialog::OCAL::ImportDialog* import_dialog = NULL; if (!import_dialog) { import_dialog = new @@ -1463,36 +1474,13 @@ sp_file_import_from_ocal(Gtk::Window &parent_window) (char const *)_("Import From Open Clip Art Library")); } - bool success = import_dialog->show(); - if (!success) { - delete import_dialog; - return; - } - - // Get file name and extension type - Glib::ustring file_name = import_dialog->get_filename(); - Inkscape::Extension::Extension *selection = import_dialog->get_selection_type(); - - delete import_dialog; - import_dialog = NULL; - - if (file_name.size() > 0) { - - Glib::ustring new_file_name = Glib::filename_to_utf8(file_name); - - if (new_file_name.size() > 0) - file_name = new_file_name; - else - g_warning( "ERROR CONVERTING OPEN FILENAME TO UTF-8" ); - - import_path = file_name; - if (import_path.size()>0) - import_path.append(G_DIR_SEPARATOR_S); - - file_import(doc, file_name, selection); - } - - return; + import_dialog->signal_response().connect( + sigc::bind( + sigc::ptr_fun(&on_import_from_ocal_response), + import_dialog) + ); + + import_dialog->show_all(); } /*###################### -- cgit v1.2.3 From 002481162f050709a125e38dc60145ef77c10c98 Mon Sep 17 00:00:00 2001 From: "Andrew rugby471@gmail.com" <> Date: Thu, 24 Mar 2011 19:14:21 +0000 Subject: 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) --- src/file.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/file.cpp') 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( - 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(); } /*###################### -- cgit v1.2.3 From d039527800711fd1b7a86f1670b8ab45cd8b8cea Mon Sep 17 00:00:00 2001 From: "Andrew rugby471@gmail.com" <> Date: Fri, 25 Mar 2011 19:53:27 +0000 Subject: Change menutems and title to "Import Clip Art" (bzr r10092.1.20) --- src/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index cee5280c0..76e1e9d6d 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1470,7 +1470,7 @@ sp_file_import_from_ocal(Gtk::Window &parent_window) parent_window, import_path, Inkscape::UI::Dialog::IMPORT_TYPES, - (char const *)_("Import From Open Clip Art Library")); + (char const *)_("Import Clip Art")); import_ocal_dialog->signal_response().connect( sigc::ptr_fun(&on_import_from_ocal_response)); -- cgit v1.2.3 From 15efa741213c01b0b01f63877978b90054672a96 Mon Sep 17 00:00:00 2001 From: "Andrew rugby471@gmail.com" <> Date: Sat, 26 Mar 2011 08:22:37 +0000 Subject: Sorted wrapping of labels (bzr r10092.1.22) --- src/file.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 76e1e9d6d..6fda8052b 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1468,7 +1468,6 @@ sp_file_import_from_ocal(Gtk::Window &parent_window) import_ocal_dialog = new Inkscape::UI::Dialog::OCAL::ImportDialog( parent_window, - import_path, Inkscape::UI::Dialog::IMPORT_TYPES, (char const *)_("Import Clip Art")); -- cgit v1.2.3