From 5915945014c543604c92d33ef0088c4fa95cf36a Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 1 Nov 2012 11:11:27 +0900 Subject: Fix for 620568 : Changes to 'Hide all except selected' in Export Bitmap - Revert changes from r11569 (bzr r11857) --- src/ui/dialog/export.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/ui/dialog/export.cpp') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 62dd93126..e6c8ca107 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -296,7 +296,7 @@ Export::Export (void) : batch_box.pack_start(batch_export, false, false); hide_export.set_sensitive(true); - hide_export.set_active (true); + hide_export.set_active (prefs->getBool("/dialogs/export/hideexceptselected/value", false)); hide_box.pack_start(hide_export, false, false); @@ -328,6 +328,7 @@ Export::Export (void) : browse_button.signal_clicked().connect(sigc::mem_fun(*this, &Export::onBrowse)); batch_export.signal_clicked().connect(sigc::mem_fun(*this, &Export::onBatchClicked)); export_button.signal_clicked().connect(sigc::mem_fun(*this, &Export::onExport)); + hide_export.signal_clicked().connect(sigc::mem_fun(*this, &Export::onHideExceptSelected)); desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &Export::setTargetDesktop) ); deskTrack.connect(GTK_WIDGET(gobj())); @@ -547,7 +548,7 @@ void Export::updateCheckbuttons () batch_export.set_sensitive(false); } - hide_export.set_sensitive (num > 0 && current_key == SELECTION_SELECTION); + //hide_export.set_sensitive (num > 0); } inline void Export::findDefaultSelection() @@ -786,8 +787,6 @@ void Export::onAreaToggled () } } - hide_export.set_sensitive (key == SELECTION_SELECTION); - return; } // end of sp_export_area_toggled() @@ -919,6 +918,11 @@ Glib::ustring Export::absolutize_path_from_document_location (SPDocument *doc, c return path; } +void Export::onHideExceptSelected () +{ + prefs->setBool("/dialogs/export/hideexceptselected/value", hide_export.get_active()); +} + /// Called when export button is clicked void Export::onExport () { -- cgit v1.2.3 From 15f08c37a261583b138f9cbecd6c271921f4e514 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 15 Nov 2012 11:42:04 +0000 Subject: cppcheck: Simple fixes for src/ui/dialog (bzr r11874) --- src/ui/dialog/export.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ui/dialog/export.cpp') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index e6c8ca107..c073375a2 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -1438,7 +1438,7 @@ void Export::areaXChange (Gtk::Adjustment *adj) return; } - if (sp_unit_selector_update_test ((SPUnitSelector *)unit_selector->gobj())) { + if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { return; } @@ -1485,7 +1485,7 @@ void Export::areaYChange (Gtk::Adjustment *adj) return; } - if (sp_unit_selector_update_test ((SPUnitSelector *)unit_selector->gobj())) { + if (sp_unit_selector_update_test (SP_UNIT_SELECTOR(unit_selector->gobj()))) { return; } @@ -1640,7 +1640,7 @@ void Export::onBitmapWidthChange () return; } - if (sp_unit_selector_update_test ((SPUnitSelector *)unit_selector->gobj())) { + if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { return; } @@ -1674,7 +1674,7 @@ void Export::onBitmapHeightChange () return; } - if (sp_unit_selector_update_test ((SPUnitSelector *)unit_selector->gobj())) { + if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { return; } @@ -1734,7 +1734,7 @@ void Export::onExportXdpiChange() return; } - if (sp_unit_selector_update_test ((SPUnitSelector *)unit_selector->gobj())) { + if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { return; } @@ -1836,7 +1836,7 @@ void Export::setValuePx(Glib::RefPtr& adj, double val) void Export::setValuePx( Gtk::Adjustment *adj, double val) #endif { - const SPUnit *unit = sp_unit_selector_get_unit ((SPUnitSelector *)unit_selector->gobj() ); + const SPUnit *unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(unit_selector->gobj()) ); setValue(adj, sp_pixels_get_units (val, *unit)); @@ -1886,7 +1886,7 @@ float Export::getValuePx( Gtk::Adjustment *adj ) #endif { float value = getValue( adj); - const SPUnit *unit = sp_unit_selector_get_unit ((SPUnitSelector *)unit_selector->gobj()); + const SPUnit *unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(unit_selector->gobj())); return sp_units_get_pixels (value, *unit); } // end of sp_export_value_get_px() -- cgit v1.2.3 From b2103acf1da407e1bef705d9f6ee26cb896c43a2 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 18 Nov 2012 14:08:41 +0100 Subject: UI. Fix for Bug #1071104 (Failure to open a browse window when choosing Export As...). (bzr r11882) --- src/ui/dialog/export.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ui/dialog/export.cpp') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index c073375a2..f267c5ae9 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -1260,6 +1260,14 @@ void Export::onBrowse () WCHAR* title_string = (WCHAR*)g_utf8_to_utf16(_("Select a filename for exporting"), -1, NULL, NULL, NULL); WCHAR* extension_string = (WCHAR*)g_utf8_to_utf16("*.png", -1, NULL, NULL, NULL); // Copy the selected file name, converting from UTF-8 to UTF-16 + std::string dirname = Glib::path_get_dirname(filename.raw()); + if ( !Glib::file_test(dirname, Glib::FILE_TEST_EXISTS) || + Glib::file_test(filename, Glib::FILE_TEST_IS_DIR) || + dirname.empty() ) + { + Glib::ustring tmp; + filename = create_filepath_from_id(tmp, tmp); + } WCHAR _filename[_MAX_PATH + 1]; memset(_filename, 0, sizeof(_filename)); gunichar2* utf16_path_string = g_utf8_to_utf16(filename.c_str(), -1, NULL, NULL, NULL); -- cgit v1.2.3