[Xfce4-commits] <thunar:master> Fix -set properties in the renderers.

Nick Schermer noreply at xfce.org
Wed Nov 7 20:10:01 CET 2012


Updating branch refs/heads/master
         to c4d27daa3178488737f202a21a095408985e7fb9 (commit)
       from c48559231c431e82ac71586b885b1ab407b82661 (commit)

commit c4d27daa3178488737f202a21a095408985e7fb9
Author: Nick Schermer <nick at xfce.org>
Date:   Wed Nov 7 18:18:14 2012 +0100

    Fix -set properties in the renderers.
    
    The -set property is not used to enable the setting, but
    a response to the user the property is applied.
    
    See gnome bug 687825.

 thunar/thunar-chooser-dialog.c |    2 --
 thunar/thunar-chooser-model.c  |    8 +++-----
 thunar/thunar-chooser-model.h  |    3 ---
 thunar/thunar-renamer-dialog.c |    6 ++----
 thunar/thunar-renamer-model.c  |    8 ++++++++
 thunar/thunar-renamer-model.h  |   10 ++++++----
 thunar/thunar-shortcuts-view.c |    2 --
 7 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c
index f21ca7c..1ce3f32 100644
--- a/thunar/thunar-chooser-dialog.c
+++ b/thunar/thunar-chooser-dialog.c
@@ -242,9 +242,7 @@ thunar_chooser_dialog_init (ThunarChooserDialog *dialog)
   gtk_tree_view_column_pack_start (column, renderer, TRUE);
   gtk_tree_view_column_set_attributes (column, renderer,
                                        "style", THUNAR_CHOOSER_MODEL_COLUMN_STYLE,
-                                       "style-set", THUNAR_CHOOSER_MODEL_COLUMN_STYLE_SET,
                                        "text", THUNAR_CHOOSER_MODEL_COLUMN_NAME,
-                                       "weight-set", THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT_SET,
                                        "weight", THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT,
                                        NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->tree_view), column);
diff --git a/thunar/thunar-chooser-model.c b/thunar/thunar-chooser-model.c
index ef4721b..e3ae672 100644
--- a/thunar/thunar-chooser-model.c
+++ b/thunar/thunar-chooser-model.c
@@ -116,9 +116,7 @@ thunar_chooser_model_init (ThunarChooserModel *model)
     G_TYPE_ICON,
     G_TYPE_APP_INFO,
     PANGO_TYPE_STYLE,
-    G_TYPE_BOOLEAN,
     PANGO_TYPE_WEIGHT,
-    G_TYPE_BOOLEAN,
   };
 
   /* register the column types */
@@ -219,8 +217,7 @@ thunar_chooser_model_append (ThunarChooserModel *model,
   gtk_tree_store_set (GTK_TREE_STORE (model), &parent_iter,
                       THUNAR_CHOOSER_MODEL_COLUMN_NAME, title,
                       THUNAR_CHOOSER_MODEL_COLUMN_ICON, icon,
-                      THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT, PANGO_WEIGHT_SEMIBOLD,
-                      THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT_SET, TRUE,
+                      THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT, PANGO_WEIGHT_BOLD,
                       -1);
 
   g_object_unref (icon);
@@ -239,6 +236,7 @@ thunar_chooser_model_append (ThunarChooserModel *model,
                               THUNAR_CHOOSER_MODEL_COLUMN_NAME, g_app_info_get_name (lp->data),
                               THUNAR_CHOOSER_MODEL_COLUMN_ICON, g_app_info_get_icon (lp->data),
                               THUNAR_CHOOSER_MODEL_COLUMN_APPLICATION, lp->data,
+                              THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT, PANGO_WEIGHT_NORMAL,
                               -1);
 
           inserted_infos = TRUE;
@@ -252,7 +250,7 @@ thunar_chooser_model_append (ThunarChooserModel *model,
       gtk_tree_store_set (GTK_TREE_STORE (model), &child_iter,
                           THUNAR_CHOOSER_MODEL_COLUMN_NAME, _("None available"),
                           THUNAR_CHOOSER_MODEL_COLUMN_STYLE, PANGO_STYLE_ITALIC,
-                          THUNAR_CHOOSER_MODEL_COLUMN_STYLE_SET, TRUE,
+                          THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT, PANGO_WEIGHT_NORMAL,
                           -1);
     }
 }
diff --git a/thunar/thunar-chooser-model.h b/thunar/thunar-chooser-model.h
index ab50216..c453405 100644
--- a/thunar/thunar-chooser-model.h
+++ b/thunar/thunar-chooser-model.h
@@ -41,7 +41,6 @@ typedef struct _ThunarChooserModel      ThunarChooserModel;
  * @THUNAR_CHOOSER_MODEL_COLUMN_ICON        : the name or absolute path of the application's icon.
  * @THUNAR_CHOOSER_MODEL_COLUMN_APPLICATION : the #GAppInfo object.
  * @THUNAR_CHOOSER_MODEL_COLUMN_STYLE       : custom font style.
- * @THUNAR_CHOOSER_MODEL_COLUMN_STYLE_SET   : whether to actually use the custom font style.
  * @THUNAR_CHOOSER_MODEL_N_COLUMNS          : the number of columns in #ThunarChooserModel.
  *
  * The identifiers for the columns provided by the #ThunarChooserModel.
@@ -52,9 +51,7 @@ typedef enum
   THUNAR_CHOOSER_MODEL_COLUMN_ICON,
   THUNAR_CHOOSER_MODEL_COLUMN_APPLICATION,
   THUNAR_CHOOSER_MODEL_COLUMN_STYLE,
-  THUNAR_CHOOSER_MODEL_COLUMN_STYLE_SET,
   THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT,
-  THUNAR_CHOOSER_MODEL_COLUMN_WEIGHT_SET,
   THUNAR_CHOOSER_MODEL_N_COLUMNS,
 } ThunarChooserModelColumn;
 
diff --git a/thunar/thunar-renamer-dialog.c b/thunar/thunar-renamer-dialog.c
index 14f46f8..8611a74 100644
--- a/thunar/thunar-renamer-dialog.c
+++ b/thunar/thunar-renamer-dialog.c
@@ -426,7 +426,7 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog)
   renderer = g_object_new (THUNAR_TYPE_ICON_RENDERER, "size", 16, NULL);
   gtk_tree_view_column_pack_start (column, renderer, FALSE);
   gtk_tree_view_column_set_attributes (column, renderer, "file", THUNAR_RENAMER_MODEL_COLUMN_FILE, NULL);
-  renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, "ellipsize", PANGO_ELLIPSIZE_END, "ellipsize-set", TRUE, NULL);
+  renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
   gtk_tree_view_column_pack_start (column, renderer, TRUE);
   gtk_tree_view_column_set_attributes (column, renderer, "text", THUNAR_RENAMER_MODEL_COLUMN_OLDNAME, NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (renamer_dialog->tree_view), column);
@@ -439,15 +439,13 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog)
   gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
   renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
                            "ellipsize", PANGO_ELLIPSIZE_END,
-                           "ellipsize-set", TRUE,
                            "foreground", "Red",
-                           "weight", PANGO_WEIGHT_SEMIBOLD,
                            NULL);
   gtk_tree_view_column_pack_start (column, renderer, TRUE);
   gtk_tree_view_column_set_attributes (column, renderer,
                                        "foreground-set", THUNAR_RENAMER_MODEL_COLUMN_CONFLICT,
                                        "text", THUNAR_RENAMER_MODEL_COLUMN_NEWNAME,
-                                       "weight-set", THUNAR_RENAMER_MODEL_COLUMN_CONFLICT,
+                                       "weight", THUNAR_RENAMER_MODEL_COLUMN_CONFLICT_WEIGHT,
                                        NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (renamer_dialog->tree_view), column);
 
diff --git a/thunar/thunar-renamer-model.c b/thunar/thunar-renamer-model.c
index 05c9f79..16ff1d4 100644
--- a/thunar/thunar-renamer-model.c
+++ b/thunar/thunar-renamer-model.c
@@ -399,6 +399,9 @@ thunar_renamer_model_get_column_type (GtkTreeModel *tree_model,
     case THUNAR_RENAMER_MODEL_COLUMN_CONFLICT:
       return G_TYPE_BOOLEAN;
 
+    case THUNAR_RENAMER_MODEL_COLUMN_CONFLICT_WEIGHT:
+      return PANGO_TYPE_WEIGHT;
+
     case THUNAR_RENAMER_MODEL_COLUMN_FILE:
       return THUNAR_TYPE_FILE;
 
@@ -479,6 +482,11 @@ thunar_renamer_model_get_value (GtkTreeModel *tree_model,
       g_value_set_boolean (value, item->conflict);
       break;
 
+    case THUNAR_RENAMER_MODEL_COLUMN_CONFLICT_WEIGHT:
+      g_value_init (value, PANGO_TYPE_WEIGHT);
+      g_value_set_enum (value, item->conflict ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL);
+      break;
+
     case THUNAR_RENAMER_MODEL_COLUMN_FILE:
       g_value_init (value, THUNAR_TYPE_FILE);
       g_value_set_object (value, item->file);
diff --git a/thunar/thunar-renamer-model.h b/thunar/thunar-renamer-model.h
index 2b97b17..0b13fb0 100644
--- a/thunar/thunar-renamer-model.h
+++ b/thunar/thunar-renamer-model.h
@@ -37,16 +37,18 @@ typedef struct _ThunarRenamerModel      ThunarRenamerModel;
 
 /**
  * ThunarRenamerModelColumn:
- * @THUNAR_RENAMER_MODEL_COLUMN_CONFLICT : the column which tells whether there's a name conflict.
- * @THUNAR_RENAMER_MODEL_COLUMN_FILE     : the column with the #ThunarFile.
- * @THUNAR_RENAMER_MODEL_COLUMN_NEWNAME  : the column with the new name.
- * @THUNAR_RENAMER_MODEL_COLUMN_OLDNAME  : the column with the old name.
+ * @THUNAR_RENAMER_MODEL_COLUMN_CONFLICT        : the column which tells whether there's a name conflict.
+ * @THUNAR_RENAMER_MODEL_COLUMN_CONFLICT_WEIGHT : Use to set the text to bold in case of a conflict
+ * @THUNAR_RENAMER_MODEL_COLUMN_FILE            : the column with the #ThunarFile.
+ * @THUNAR_RENAMER_MODEL_COLUMN_NEWNAME         : the column with the new name.
+ * @THUNAR_RENAMER_MODEL_COLUMN_OLDNAME         : the column with the old name.
  *
  * The column ids provided by #ThunarRenamerModel instances.
  **/
 typedef enum
 {
   THUNAR_RENAMER_MODEL_COLUMN_CONFLICT,
+  THUNAR_RENAMER_MODEL_COLUMN_CONFLICT_WEIGHT,
   THUNAR_RENAMER_MODEL_COLUMN_FILE,
   THUNAR_RENAMER_MODEL_COLUMN_NEWNAME,
   THUNAR_RENAMER_MODEL_COLUMN_OLDNAME,
diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index dcd1844..5826f73 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -298,7 +298,6 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
   /* header */
   renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
                            "weight", PANGO_WEIGHT_BOLD,
-                           "weight-set", TRUE,
                            "xpad", 6,
                            "ypad", 6,
                            NULL);
@@ -334,7 +333,6 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
 
   /* allocate the text renderer (ellipsizing as required, but "File System" must fit) */
   renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
-                           "ellipsize-set", TRUE,
                            "ellipsize", PANGO_ELLIPSIZE_END,
                            NULL);
   g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (thunar_shortcuts_view_renamed), view);


More information about the Xfce4-commits mailing list