Code

Adding non-labeled default entries
authorjoncruz <joncruz@users.sourceforge.net>
Thu, 22 Mar 2007 04:43:20 +0000 (04:43 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Thu, 22 Mar 2007 04:43:20 +0000 (04:43 +0000)
src/ege-adjustment-action.cpp
src/widgets/toolbox.cpp

index 2d303c63d6a21dfecf67711b697b1cef5759da87..54cde1d1d71e87937533ba96e0dcb6e1bee2c931 100644 (file)
@@ -453,10 +453,8 @@ void ege_adjustment_action_set_descriptions( EgeAdjustmentAction* action, gchar
         guint i = 0;
         for ( i = 0; i < count; i++ ) {
             EgeAdjustmentDescr* descr = g_new0( EgeAdjustmentDescr, 1 );
-            if ( descriptions[i] ) {
-                descr->descr = g_strdup( descriptions[i] );
-                descr->value = values[i];
-            }
+            descr->descr = descriptions[i] ? g_strdup( descriptions[i] ) : 0;
+            descr->value = values[i];
             action->private_data->descriptions = g_list_insert_sorted( action->private_data->descriptions, (gpointer)descr, egeAct_compare_descriptions );
         }
     }
@@ -540,7 +538,7 @@ static void create_single_menu_item( GCallback toggleCb, int val, GtkWidget* men
         cur = g_list_next( cur );
     }
 
-    str = g_strdup_printf( act->private_data->format, num, (marker?" ":""), (marker?marker->descr:"") );
+    str = g_strdup_printf( act->private_data->format, num, (marker?" ":""), ( (marker && marker->descr) ? marker->descr:"") );
 
     *dst = gtk_radio_menu_item_new_with_label( *group, str );
     if ( !*group) {
index fa2f171382181f3d7f77c6b896fb40089d3c6ae7..b22f9c97013b6f262afadf0bdaff5a841b75f6e0 100644 (file)
@@ -2257,8 +2257,8 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop)
         gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
 
         /* Angle */
-        gchar const* labels3[] = {_("(left edge up)"), _("(horizontal)"), _("(default)"), _("(right edge up)")};
-        gdouble values3[] = {-90, 0, 30, 90};
+        gchar const* labels3[] = {_("(left edge up)"), 0, 0, _("(horizontal)"), _("(default)"), 0, _("(right edge up)")};
+        gdouble values3[] = {-90, -60, -30, 0, 30, 60, 90};
         eact = create_adjustment_action( "AngleAction",
                                          _("Angle:"), _("The angle of the pen's nib (in degrees; 0 = horizontal; has no effect if fixation = 0)"),
                                          "tools.calligraphic", "angle", 30,