Remove "slash" property from psppire_button_editable, which is not used
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 25 May 2013 16:45:18 +0000 (18:45 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 25 May 2013 17:05:10 +0000 (19:05 +0200)
src/ui/gui/psppire-button-editable.c
src/ui/gui/psppire-button-editable.h
src/ui/gui/psppire-cell-renderer-button.c

index 530a9a4c4ed64de31d45a10b5c2dace06d33ba0d..05cc0057dd736459eb73d04c4e37b4d6be279237 100644 (file)
@@ -41,7 +41,6 @@ enum
   {
     PROP_0,
     PROP_PATH,
-    PROP_SLASH,
     PROP_EDITING_CANCELED
   };
 
@@ -60,10 +59,6 @@ psppire_button_editable_set_property (GObject      *object,
       obj->path = g_value_dup_string (value);
       break;
 
-    case PROP_SLASH:
-      psppire_button_editable_set_slash (obj, g_value_get_boolean (value));
-      break;
-
     case PROP_EDITING_CANCELED:
       break;
 
@@ -87,10 +82,6 @@ psppire_button_editable_get_property (GObject      *object,
       g_value_set_string (value, obj->path);
       break;
 
-    case PROP_SLASH:
-      g_value_set_boolean (value, psppire_button_editable_get_slash (obj));
-      break;
-
     case PROP_EDITING_CANCELED:
       g_value_set_boolean (value, FALSE);
       break;
@@ -123,28 +114,6 @@ psppire_button_editable_button_release (GtkWidget      *widget,
   return TRUE;
 }
 
-static gboolean
-psppire_button_editable_expose_event (GtkWidget      *widget,
-                                      GdkEventExpose *event)
-{
-  GtkWidgetClass *widget_class;
-  GtkStyle *style = gtk_widget_get_style (widget);
-  GtkAllocation allocation;
-  gboolean retval;
-
-  widget_class = GTK_WIDGET_CLASS (psppire_button_editable_parent_class);
-  retval = widget_class->expose_event (widget, event);
-
-  gtk_widget_get_allocation (widget, &allocation);
-  if (PSPPIRE_BUTTON_EDITABLE (widget)->slash)
-    gdk_draw_line (gtk_widget_get_window (widget), style->black_gc,
-                   allocation.x,
-                   allocation.y + allocation.height,
-                   allocation.x + allocation.width,
-                   allocation.y);
-  return retval;
-}
-
 static void
 psppire_button_editable_class_init (PsppireButtonEditableClass *class)
 {
@@ -159,7 +128,6 @@ psppire_button_editable_class_init (PsppireButtonEditableClass *class)
   gobject_class->finalize = psppire_button_editable_finalize;
 
   widget_class->button_release_event = psppire_button_editable_button_release;
-  widget_class->expose_event = psppire_button_editable_expose_event;
 
   g_object_class_install_property (gobject_class,
                                    PROP_PATH,
@@ -169,14 +137,6 @@ psppire_button_editable_class_init (PsppireButtonEditableClass *class)
                                                        "",
                                                        G_PARAM_READWRITE));
 
-  g_object_class_install_property (gobject_class,
-                                   PROP_SLASH,
-                                   g_param_spec_boolean ("slash",
-                                                         _("Diagonal slash"),
-                                                         _("Whether to draw a diagonal slash across the button."),
-                                                         FALSE,
-                                                         G_PARAM_READWRITE));
-
   g_object_class_override_property (gobject_class,
                                    PROP_EDITING_CANCELED,
                                     "editing-canceled");
@@ -186,7 +146,6 @@ static void
 psppire_button_editable_init (PsppireButtonEditable *obj)
 {
   obj->path = g_strdup ("");
-  obj->slash = FALSE;
 }
 
 PsppireButtonEditable *
@@ -195,24 +154,6 @@ psppire_button_editable_new (void)
   return PSPPIRE_BUTTON_EDITABLE (g_object_new (PSPPIRE_TYPE_BUTTON_EDITABLE, NULL));
 }
 
-void
-psppire_button_editable_set_slash (PsppireButtonEditable *button,
-                                   gboolean slash)
-{
-  g_return_if_fail (button != NULL);
-  if ((button->slash != 0) != (slash != 0))
-    {
-      button->slash = slash;
-      gtk_widget_queue_draw (GTK_WIDGET (button));
-    }
-}
-
-gboolean
-psppire_button_editable_get_slash (const PsppireButtonEditable *button)
-{
-  g_return_val_if_fail (button != NULL, FALSE);
-  return button->slash;
-}
 \f
 /* GtkCellEditable interface. */
 
index a0eb3497c4b8b44c3b4b5aaddbdfe44b42f549c9..80b6180d79ea8761f2efe2b88d84a12b9528377c 100644 (file)
@@ -34,7 +34,6 @@ typedef struct _PsppireButtonEditableClass PsppireButtonEditableClass;
 struct _PsppireButtonEditable {
   GtkButton parent;
   gchar *path;
-  gboolean slash;
 };
 
 struct _PsppireButtonEditableClass {
@@ -44,10 +43,6 @@ struct _PsppireButtonEditableClass {
 GType psppire_button_editable_get_type (void) G_GNUC_CONST;
 PsppireButtonEditable* psppire_button_editable_new (void);
 
-void psppire_button_editable_set_slash (PsppireButtonEditable *,
-                                        gboolean slash);
-gboolean psppire_button_editable_get_slash (const PsppireButtonEditable *);
-
 G_END_DECLS
 
 #endif /* PSPPIRE_BUTTON_EDITABLE_H */
index d4071cd71e0bac5cf9cf3a30cf7e2ec9dcdb8f3a..703ff3ddfd3056572b168dbc095cc58199bb2cd4 100644 (file)
@@ -407,7 +407,6 @@ psppire_cell_renderer_button_start_editing (GtkCellRenderer      *cell,
                                       "xalign", xalign,
                                       "yalign", yalign,
                                       "path", path,
-                                      "slash", cell_button->slash,
                                       NULL);
 
   g_signal_connect (G_OBJECT (cell_button->button), "clicked",