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') 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 28b187deab4fba42e835c5445881bbb10cee1f1c Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 6 Oct 2012 12:55:52 +0900 Subject: Fix for 587019 : Select and transform mouse cursor changes to normal cursor on object duplication (bzr r11739) --- src/select-context.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/select-context.cpp b/src/select-context.cpp index 7fecc7167..bc096d528 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -1140,8 +1140,9 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) } // set cursor to default. if (!desktop->isWaitingCursor()) { - GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); - gdk_window_set_cursor(window, event_context->cursor); + // Do we need to reset the cursor here on key release ? + //GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); + //gdk_window_set_cursor(window, event_context->cursor); } break; default: -- 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') 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 3551e3f9f37481d8532dad92f3b301934414b302 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 6 Oct 2012 22:26:19 +0200 Subject: powerstroke: add arc-extrapolation, but disable it for release (bzr r11742) --- src/live_effects/lpe-powerstroke.cpp | 141 ++++++++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index 69d0808e4..698c09bcf 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -28,6 +28,7 @@ #include <2geom/path-intersection.h> #include <2geom/crossing.h> #include <2geom/ellipse.h> +#include #include "spiro.h" @@ -86,6 +87,70 @@ static Ellipse find_ellipse(Point P, Point Q, Point O) return Ellipse(A, B, C, D, E, F); } +/** + * Refer to: Weisstein, Eric W. "Circle-Circle Intersection." + From MathWorld--A Wolfram Web Resource. + http://mathworld.wolfram.com/Circle-CircleIntersection.html + * + * @return 0 if no intersection + * @return 1 if one circle is contained in the other + * @return 2 if intersections are found (they are written to p0 and p1) + */ +static int circle_circle_intersection(Circle const &circle0, Circle const &circle1, + Point & p0, Point & p1) +{ + Point X0 = circle0.center(); + double r0 = circle0.ray(); + Point X1 = circle1.center(); + double r1 = circle1.ray(); + + /* dx and dy are the vertical and horizontal distances between + * the circle centers. + */ + Point D = X1 - X0; + + /* Determine the straight-line distance between the centers. */ + double d = L2(D); + + /* Check for solvability. */ + if (d > (r0 + r1)) + { + /* no solution. circles do not intersect. */ + return 0; + } + if (d <= fabs(r0 - r1)) + { + /* no solution. one circle is contained in the other */ + return 1; + } + + /* 'point 2' is the point where the line through the circle + * intersection points crosses the line between the circle + * centers. + */ + + /* Determine the distance from point 0 to point 2. */ + double a = ((r0*r0) - (r1*r1) + (d*d)) / (2.0 * d) ; + + /* Determine the coordinates of point 2. */ + Point p2 = X0 + D * (a/d); + + /* Determine the distance from point 2 to either of the + * intersection points. + */ + double h = std::sqrt((r0*r0) - (a*a)); + + /* Now determine the offsets of the intersection points from + * point 2. + */ + Point r = (h/d)*rot90(D); + + /* Determine the absolute intersection points. */ + p0 = p2 + r; + p1 = p2 - r; + + return 2; +} } // namespace Geom @@ -121,7 +186,8 @@ enum LineJoinType { LINEJOIN_ROUND, LINEJOIN_EXTRP_MITER, LINEJOIN_MITER, - LINEJOIN_SPIRO + LINEJOIN_SPIRO, + LINEJOIN_EXTRP_MITER_ARC }; static const Util::EnumData LineJoinTypeData[] = { {LINEJOIN_BEVEL, N_("Beveled"), "bevel"}, @@ -129,6 +195,7 @@ static const Util::EnumData LineJoinTypeData[] = { {LINEJOIN_EXTRP_MITER, N_("Extrapolated"), "extrapolated"}, {LINEJOIN_MITER, N_("Miter"), "miter"}, {LINEJOIN_SPIRO, N_("Spiro"), "spiro"}, +// {LINEJOIN_EXTRP_MITER_ARC, N_("Extrapolated arc"), "extrp_arc"}, }; static const Util::EnumDataConverter LineJoinTypeConverter(LineJoinTypeData, sizeof(LineJoinTypeData)/sizeof(*LineJoinTypeData)); @@ -310,6 +377,78 @@ static Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise derivs = reverse(B[prev_i]).valueAndDerivatives(0.,5); + for (unsigned deriv_n = 1, count = 0; deriv_n < derivs.size(); deriv_n++) { + Geom::Coord length = derivs[deriv_n].length(); + if ( ! Geom::are_near(length, 0) ) { + if (count == 0) { + tang0 = derivs[deriv_n] / length; + curv0 = length; // save the length of the tangent + count++; + } else { + //curv0 = length / curv0; // curvature = tangent' / tangent + break; // break out of for-loop + } + } + } + double r0 = curv0; + Geom::Point center0 = B[prev_i].at1() - r0*tang0.ccw(); + circle0 = Geom::Circle(center0, r0); + } + { + Geom::Point tang1(0.,0.); + Geom::Coord curv1 = 0; + std::vector derivs = B[i].valueAndDerivatives(0.,5); + for (unsigned deriv_n = 1, count = 0; deriv_n < derivs.size(); deriv_n++) { + Geom::Coord length = derivs[deriv_n].length(); + if ( ! Geom::are_near(length, 0) ) { + if (count == 0) { + tang1 = derivs[deriv_n] / length; + curv1 = length; // save the length of the tangent + count++; + } else { + //curv1 = length / curv1; // curvature = tangent' / tangent + break; // break out of for-loop + } + } + } + double r1 = curv1; + Geom::Point center1 = B[i].at0() - r1*tang1.ccw(); + circle1 = Geom::Circle(center1, r1); + } + + Geom::Point points[2]; + int solutions = circle_circle_intersection(circle0, circle1, points[0], points[1]); + if (solutions == 2) { + Geom::EllipticalArc *arc0 = circle0.arc(B[prev_i].at1(), 0.5*(B[prev_i].at1()+B[i].at0()), points[0], true); + Geom::EllipticalArc *arc1 = circle1.arc(points[0], 0.5*(B[prev_i].at1()+B[i].at0()), B[i].at0(), true); + + if (arc0) { + build_from_sbasis(pb,arc0->toSBasis(), tol, false); + delete arc0; + arc0 = NULL; + } + if (arc1) { + build_from_sbasis(pb,arc1->toSBasis(), tol, false); + delete arc1; + arc1 = NULL; + } + } else if (solutions == 1) { // one circle is inside the other + // don't know what to do: default to bevel + pb.lineTo(B[i].at0()); + } else { // no intersections + // don't know what to do: default to bevel + pb.lineTo(B[i].at0()); + } + + break; + } case LINEJOIN_MITER: { boost::optional p = intersection_point( B[prev_i].at1(), tang1, B[i].at0(), tang2 ); -- cgit v1.2.3 From c48285ed644898a01d698ca67b6cfdbbe80573b4 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sat, 6 Oct 2012 16:54:38 -0400 Subject: emf import. support for PATCOPY in EMR_BITBLT (Bug 1060141) Fixed bugs: - https://launchpad.net/bugs/1060141 (bzr r11743) --- src/extension/internal/emf-win32-inout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index 7593a4806..2097402c7 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -1815,7 +1815,7 @@ myEnhMetaFileProc(HDC /*hDC*/, HANDLETABLE * /*lpHTable*/, ENHMETARECORD const * dbg_str << "\n"; PEMRBITBLT pEmr = (PEMRBITBLT) lpEMFR; - if (pEmr->dwRop == DPA) { + if ((pEmr->dwRop == PATCOPY) || (pEmr->dwRop == DPA)) { // should be an application of a DIBPATTERNBRUSHPT, use a solid color instead double l = pix_to_x_point( d, pEmr->xDest, pEmr->yDest); double t = pix_to_y_point( d, pEmr->xDest, pEmr->yDest); -- cgit v1.2.3 From c4e83e0bd3505b0c8d6b3f466ed75394cb34acd2 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 7 Oct 2012 15:03:13 +0200 Subject: i18n. Adding gradient selector widget labels. (bzr r11745) --- src/widgets/gradient-selector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp index 082f04a77..dffda69e3 100644 --- a/src/widgets/gradient-selector.cpp +++ b/src/widgets/gradient-selector.cpp @@ -143,13 +143,13 @@ static void sp_gradient_selector_init(SPGradientSelector *sel) sel->icon_renderer = Gtk::manage(new Gtk::CellRendererPixbuf()); sel->text_renderer = Gtk::manage(new Gtk::CellRendererText()); - sel->treeview->append_column("Gradient", *sel->icon_renderer); + sel->treeview->append_column(_("Gradient"), *sel->icon_renderer); Gtk::TreeView::Column* icon_column = sel->treeview->get_column(0); icon_column->add_attribute(sel->icon_renderer->property_pixbuf(), sel->columns->pixbuf); icon_column->set_sort_column(sel->columns->color); icon_column->set_clickable(true); - sel->treeview->append_column("Name", *sel->text_renderer); + sel->treeview->append_column(_("Name"), *sel->text_renderer); Gtk::TreeView::Column* name_column = sel->treeview->get_column(1); sel->text_renderer->property_editable() = true; name_column->add_attribute(sel->text_renderer->property_text(), sel->columns->name); -- cgit v1.2.3 From 274930257ebf311fe2c5b6d4f06a46ed79669977 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 7 Oct 2012 18:59:42 +0200 Subject: powerstroke: arc extrapolate fix (bzr r11748) --- src/live_effects/lpe-powerstroke.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index 698c09bcf..21fc5c869 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -195,7 +195,9 @@ static const Util::EnumData LineJoinTypeData[] = { {LINEJOIN_EXTRP_MITER, N_("Extrapolated"), "extrapolated"}, {LINEJOIN_MITER, N_("Miter"), "miter"}, {LINEJOIN_SPIRO, N_("Spiro"), "spiro"}, -// {LINEJOIN_EXTRP_MITER_ARC, N_("Extrapolated arc"), "extrp_arc"}, +#ifdef LPE_ENABLE_TEST_EFFECTS + {LINEJOIN_EXTRP_MITER_ARC, N_("Extrapolated arc"), "extrp_arc"}, +#endif }; static const Util::EnumDataConverter LineJoinTypeConverter(LineJoinTypeData, sizeof(LineJoinTypeData)/sizeof(*LineJoinTypeData)); @@ -426,8 +428,8 @@ static Geom::Path path_from_piecewise_fix_cusps( Geom::PiecewisetoSBasis(), tol, false); -- cgit v1.2.3 From c37bac565d73ab069263873307286eb19641b99c Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 7 Oct 2012 19:41:26 +0200 Subject: Translations. Fix for Bug #425202 (Script messages not translated). (bzr r11749) --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index d1e087cac..578279929 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -625,6 +625,8 @@ main(int argc, char **argv) bindtextdomain(GETTEXT_PACKAGE, BR_LOCALEDIR("")); # else bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + // needed by Python/Gettext + g_setenv("PACKAGE_LOCALE_DIR", PACKAGE_LOCALE_DIR, TRUE); # endif #endif -- 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/extension/internal/filter/color.h | 2 +- src/ui/dialog/inkscape-preferences.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/extension/internal/filter/color.h b/src/extension/internal/filter/color.h index 22b77a8cc..785059cca 100644 --- a/src/extension/internal/filter/color.h +++ b/src/extension/internal/filter/color.h @@ -637,7 +637,7 @@ public: "<_item value=\"g\">" N_("Green") "\n" "<_item value=\"b\">" N_("Blue") "\n" "<_item value=\"c\">" N_("Cyan") "\n" - "<_item value=\"m\">" N_("Majenta") "\n" + "<_item value=\"m\">" N_("Magenta") "\n" "<_item value=\"y\">" N_("Yellow") "\n" "\n" "\n" 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 f8f503f3f0150b96d34625ef8c604fb9ed552407 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 7 Oct 2012 20:44:28 +0200 Subject: powerstroke: arc extrp. corner case handling (bzr r11751) --- src/live_effects/lpe-powerstroke.cpp | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index 21fc5c869..df94a761e 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -28,6 +28,7 @@ #include <2geom/path-intersection.h> #include <2geom/crossing.h> #include <2geom/ellipse.h> +#include <2geom/math-utils.h> #include #include "spiro.h" @@ -382,8 +383,9 @@ static Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise derivs = reverse(B[prev_i]).valueAndDerivatives(0.,5); for (unsigned deriv_n = 1, count = 0; deriv_n < derivs.size(); deriv_n++) { @@ -394,17 +396,25 @@ static Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise= 0 ) { + norm0 = tang0.ccw(); + } else { + norm0 = tang0.cw(); + } break; // break out of for-loop } } } double r0 = curv0; - Geom::Point center0 = B[prev_i].at1() - r0*tang0.ccw(); + Geom::Point center0 = B[prev_i].at1() - r0*norm0; circle0 = Geom::Circle(center0, r0); } + Geom::Point tang1(0.,0.); { - Geom::Point tang1(0.,0.); + Geom::Point norm1(0.,0.); Geom::Coord curv1 = 0; std::vector derivs = B[i].valueAndDerivatives(0.,5); for (unsigned deriv_n = 1, count = 0; deriv_n < derivs.size(); deriv_n++) { @@ -416,20 +426,31 @@ static Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise= 0 ) { + norm1 = tang1.ccw(); + } else { + norm1 = tang1.cw(); + } break; // break out of for-loop } } } double r1 = curv1; - Geom::Point center1 = B[i].at0() - r1*tang1.ccw(); + Geom::Point center1 = B[i].at0() - r1*norm1; circle1 = Geom::Circle(center1, r1); } Geom::Point points[2]; int solutions = circle_circle_intersection(circle0, circle1, points[0], points[1]); if (solutions == 2) { - Geom::EllipticalArc *arc0 = circle0.arc(B[prev_i].at1(), 0.5*(B[prev_i].at1()+points[0]), points[0], true); - Geom::EllipticalArc *arc1 = circle1.arc(points[0], 0.5*(points[0]+B[i].at0()), B[i].at0(), true); + Geom::Point sol = points[0]; + if ( dot(tang0,sol-B[prev_i].at1()) > 0 ) { + sol = points[1]; + } + Geom::EllipticalArc *arc0 = circle0.arc(B[prev_i].at1(), 0.5*(B[prev_i].at1()+sol), sol, true); + Geom::EllipticalArc *arc1 = circle1.arc(sol, 0.5*(sol+B[i].at0()), B[i].at0(), true); if (arc0) { build_from_sbasis(pb,arc0->toSBasis(), tol, false); -- 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') 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 aac03ec0fbc29057ed174647df1a735d43f443d2 Mon Sep 17 00:00:00 2001 From: John Smith Date: Mon, 8 Oct 2012 20:58:02 +0900 Subject: Fix for 303527 : GUI glitch on opacity box (bzr r11758) --- src/widgets/gradient-image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/gradient-image.cpp b/src/widgets/gradient-image.cpp index 3c84e606b..94918c614 100644 --- a/src/widgets/gradient-image.cpp +++ b/src/widgets/gradient-image.cpp @@ -127,7 +127,7 @@ static void sp_gradient_image_destroy(GtkObject *object) static void sp_gradient_image_size_request(GtkWidget * /*widget*/, GtkRequisition *requisition) { - requisition->width = 64; + requisition->width = 54; requisition->height = 12; } -- 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/inkscape.cpp | 20 ++++++++++++++++++-- src/ui/dialog/inkscape-preferences.cpp | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index b1cc53b4e..0a94d0742 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -309,8 +309,24 @@ static gint inkscape_autosave(gpointer) GDir *autosave_dir_ptr = g_dir_open(autosave_dir.c_str(), 0, NULL); if( !autosave_dir_ptr ){ - g_warning("Cannot open autosave directory!"); - return TRUE; + // Try to create the autosave directory if it doesn't exist + if (g_mkdir(autosave_dir.c_str(), 0755)) { + // the creation failed + Glib::ustring msg = Glib::ustring::format( + _("Autosave failed! Cannot create directory "), Glib::filename_to_utf8(autosave_dir)); + g_warning("%s", msg.c_str()); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str()); + return TRUE; + } + // Try to read dir again + autosave_dir_ptr = g_dir_open(autosave_dir.c_str(), 0, NULL); + if( !autosave_dir_ptr ){ + Glib::ustring msg = Glib::ustring::format( + _("Autosave failed! Cannot open directory "), Glib::filename_to_utf8(autosave_dir)); + g_warning("%s", msg.c_str()); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str()); + return TRUE; + } } time_t sptime = time(NULL); 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