From 5cea988c97a9f100a78453bb3d7bc25d4775d656 Mon Sep 17 00:00:00 2001 From: John Smith Date: Fri, 5 Oct 2012 10:41:20 +0900 Subject: Fix for 570695 : show default|fallback autosave path (bzr r11738) --- src/ui/dialog/inkscape-preferences.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index fbaebfbec..57a3e34b6 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1041,10 +1041,14 @@ void InkscapePreferences::initPageIO() // Autosave options _save_autosave_enable.init( _("Enable autosave (requires restart)"), "/options/autosave/enable", false); _page_autosave.add_line(false, "", _save_autosave_enable, "", _("Automatically save the current document(s) at a given interval, thus minimizing loss in case of a crash"), false); + _save_autosave_path.init("/options/autosave/path", true); + if (prefs->getString("/options/autosave/path").empty()) { + // Show the default fallback "tmp dir" if autosave path is not set. + _save_autosave_path.set_text(Glib::get_tmp_dir()); + } + _page_autosave.add_line(false, C_("Filesystem", "Autosave _directory:"), _save_autosave_path, "", _("The directory where autosaves will be written"), false); _save_autosave_interval.init("/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0, true, false); _page_autosave.add_line(false, _("_Interval (in minutes):"), _save_autosave_interval, "", _("Interval (in minutes) at which document will be autosaved"), false); - _save_autosave_path.init("/options/autosave/path", true); - _page_autosave.add_line(false, C_("Filesystem", "_Path:"), _save_autosave_path, "", _("The directory where autosaves will be written"), false); _save_autosave_max.init("/options/autosave/max", 1.0, 100.0, 1.0, 10.0, 10.0, true, false); _page_autosave.add_line(false, _("_Maximum number of autosaves:"), _save_autosave_max, "", _("Maximum number of autosaved files; use this to limit the storage space used"), false); -- cgit v1.2.3 From 88a1d1f28a10bf74e69774baf2010ebe8731aad9 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 6 Oct 2012 20:50:26 +0200 Subject: user message standardisation (bzr r11740) --- src/ui/dialog/inkscape-preferences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 57a3e34b6..bbaaecfd4 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -811,7 +811,7 @@ void InkscapePreferences::initPageIO() _("Maximum mouse drag (in screen pixels) which is considered a click, not a drag"), false); _mouse_grabsize.init("/options/grabsize/value", 1, 7, 1, 2, 3, 0); - _page_mouse.add_line(false, _("_Handle size"), _mouse_grabsize, "", + _page_mouse.add_line(false, _("_Handle size:"), _mouse_grabsize, "", _("Set the relative size of node handles"), true); _mouse_use_ext_input.init( _("Use pressure-sensitive tablet (requires restart)"), "/options/useextinput/value", true); -- cgit v1.2.3 From e95285010790e159177c24b1061047812f5dcf84 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 7 Oct 2012 19:46:44 +0200 Subject: Typo fix by Yuri Chornoivan. (bzr r11750) --- src/ui/dialog/inkscape-preferences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index bbaaecfd4..ce73f47f1 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -480,7 +480,7 @@ void InkscapePreferences::initPageTools() _misc_gradientangle.init("/dialogs/gradienteditor/angle", -359, 359, 1, 90, 0, false, false); _page_gradient.add_line( false, _("Linear gradient _angle:"), _misc_gradientangle, "", - _("Default angle of new linear gradients in degrees (clockwise from horizontal"), false); + _("Default angle of new linear gradients in degrees (clockwise from horizontal)"), false); //Dropper -- cgit v1.2.3 From c2901751674aaf09964bb3d2c0e08de5aefdcd2c Mon Sep 17 00:00:00 2001 From: John Smith Date: Mon, 8 Oct 2012 20:52:24 +0900 Subject: Fix for 1060563 : Swatches : Sort the list of swatch names (bzr r11757) --- src/ui/dialog/swatches.cpp | 47 ++++++++++++++++++++++++++++++---------------- src/ui/widget/panel.cpp | 1 + 2 files changed, 32 insertions(+), 16 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 3baba3460..9d5a2ac28 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -62,10 +62,10 @@ namespace Dialogs { #define VBLOCK 16 #define PREVIEW_PIXBUF_WIDTH 128 -void _loadPaletteFile( gchar const *filename ); +void _loadPaletteFile( gchar const *filename, gboolean user=FALSE ); - -std::vector possible; +std::list userSwatchPages; +std::list systemSwatchPages; static std::map docPalettes; static std::vector docTrackings; static std::map docPerPanel; @@ -391,7 +391,7 @@ static bool parseNum( char*& str, int& val ) { } -void _loadPaletteFile( gchar const *filename ) +void _loadPaletteFile( gchar const *filename, gboolean user/*=FALSE*/ ) { char block[1024]; FILE *f = Inkscape::IO::fopen_utf8name( filename, "r" ); @@ -493,7 +493,10 @@ void _loadPaletteFile( gchar const *filename ) } } while ( result && !hasErr ); if ( !hasErr ) { - possible.push_back(onceMore); + if (user) + userSwatchPages.push_back(onceMore); + else + systemSwatchPages.push_back(onceMore); #if ENABLE_MAGIC_COLORS ColorItem::_wireMagicColors( onceMore ); #endif // ENABLE_MAGIC_COLORS @@ -507,9 +510,16 @@ void _loadPaletteFile( gchar const *filename ) } } +static bool +compare_swatch_names(SwatchPage const *a, SwatchPage const *b) { + + return g_utf8_collate(a->_name.c_str(), b->_name.c_str()) < 0; +} + static void loadEmUp() { static bool beenHere = false; + gboolean userPalete = true; if ( !beenHere ) { beenHere = true; @@ -521,7 +531,6 @@ static void loadEmUp() // Use this loop to iterate through a list of possible document locations. while (!sources.empty()) { gchar *dirname = sources.front(); - if ( Inkscape::IO::file_test( dirname, G_FILE_TEST_EXISTS ) && Inkscape::IO::file_test( dirname, G_FILE_TEST_IS_DIR )) { GError *err = 0; @@ -535,11 +544,13 @@ static void loadEmUp() while ((filename = (gchar *)g_dir_read_name(directory)) != NULL) { gchar* lower = g_ascii_strdown( filename, -1 ); // if ( g_str_has_suffix(lower, ".gpl") ) { + if ( !g_str_has_suffix(lower, "~") ) { gchar* full = g_build_filename(dirname, filename, NULL); if ( !Inkscape::IO::file_test( full, G_FILE_TEST_IS_DIR ) ) { - _loadPaletteFile(full); + _loadPaletteFile(full, userPalete); } g_free(full); + } // } g_free(lower); } @@ -550,15 +561,15 @@ static void loadEmUp() // toss the dirname g_free(dirname); sources.pop_front(); + userPalete = false; } } -} - - - - + // Sort the list of swatches by name, grouped by user/system + userSwatchPages.sort(compare_swatch_names); + systemSwatchPages.sort(compare_swatch_names); +} @@ -592,7 +603,7 @@ SwatchesPanel::SwatchesPanel(gchar const* prefsPath) : } loadEmUp(); - if ( !possible.empty() ) { + if ( !systemSwatchPages.empty() ) { SwatchPage* first = 0; int index = 0; Glib::ustring targetName; @@ -603,8 +614,9 @@ SwatchesPanel::SwatchesPanel(gchar const* prefsPath) : if (targetName == "Auto") { first = docPalettes[0]; } else { - index++; - for ( std::vector::iterator iter = possible.begin(); iter != possible.end(); ++iter ) { + //index++; + std::vector pages = _getSwatchSets(); + for ( std::vector::iterator iter = pages.begin(); iter != pages.end(); ++iter ) { if ( (*iter)->_name == targetName ) { first = *iter; break; @@ -635,6 +647,7 @@ SwatchesPanel::SwatchesPanel(gchar const* prefsPath) : hotItem = single; } _regItem( single, 3, i ); + i++; } } @@ -1027,6 +1040,7 @@ void SwatchesPanel::handleDefsModified(SPDocument *document) } } + std::vector SwatchesPanel::_getSwatchSets() const { std::vector tmp; @@ -1034,7 +1048,8 @@ std::vector SwatchesPanel::_getSwatchSets() const tmp.push_back(docPalettes[_currentDocument]); } - tmp.insert(tmp.end(), possible.begin(), possible.end()); + tmp.insert(tmp.end(), userSwatchPages.begin(), userSwatchPages.end()); + tmp.insert(tmp.end(), systemSwatchPages.begin(), systemSwatchPages.end()); return tmp; } diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 42435f298..dcf5956bf 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -560,6 +560,7 @@ void Panel::_regItem(Gtk::MenuItem* item, int group, int id) _menu->append(*item); item->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &Panel::_bounceCall), group + PANEL_SETTING_NEXTFREE, id)); item->show(); + } void Panel::_handleAction(int /*set_id*/, int /*item_id*/) -- cgit v1.2.3 From 900d1a05ba36f84df3a51188b938a6551a5201d2 Mon Sep 17 00:00:00 2001 From: John Smith Date: Mon, 8 Oct 2012 21:00:57 +0900 Subject: Fix for 490338 : Try to create the autosave directory if that does not exists (bzr r11759) --- src/ui/dialog/inkscape-preferences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index ce73f47f1..2731b6174 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1046,7 +1046,7 @@ void InkscapePreferences::initPageIO() // Show the default fallback "tmp dir" if autosave path is not set. _save_autosave_path.set_text(Glib::get_tmp_dir()); } - _page_autosave.add_line(false, C_("Filesystem", "Autosave _directory:"), _save_autosave_path, "", _("The directory where autosaves will be written"), false); + _page_autosave.add_line(false, C_("Filesystem", "Autosave _directory:"), _save_autosave_path, "", _("The directory where autosaves will be written. This should be an absolute path (starts with / on UNIX or a drive letter such as C: on Windows). "), false); _save_autosave_interval.init("/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0, true, false); _page_autosave.add_line(false, _("_Interval (in minutes):"), _save_autosave_interval, "", _("Interval (in minutes) at which document will be autosaved"), false); _save_autosave_max.init("/options/autosave/max", 1.0, 100.0, 1.0, 10.0, 10.0, true, false); -- cgit v1.2.3