[gnome-disk-utility] Don't use two lines in device selection combobox
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] Don't use two lines in device selection combobox
- Date: Wed, 22 May 2013 04:37:59 +0000 (UTC)
commit 725d3ed8c3d9bd17b1f39cc773d99f39b1fb4c78
Author: David Zeuthen <zeuthen gmail com>
Date: Tue May 21 21:35:45 2013 -0700
Don't use two lines in device selection combobox
Signed-off-by: David Zeuthen <zeuthen gmail com>
src/disks/gdudevicetreemodel.c | 24 ++++++++++++++++++------
src/disks/gduenums.h | 5 +++--
src/disks/gdurestorediskimagedialog.c | 3 ++-
3 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/src/disks/gdudevicetreemodel.c b/src/disks/gdudevicetreemodel.c
index a3e51b5..dd86d44 100644
--- a/src/disks/gdudevicetreemodel.c
+++ b/src/disks/gdudevicetreemodel.c
@@ -998,17 +998,21 @@ update_drive (GduDeviceTreeModel *model,
/* TODO: once https://bugzilla.gnome.org/show_bug.cgi?id=657194 is resolved, use that instead
* of hard-coding the color
*/
- s = g_strdup_printf ("<span foreground=\"#ff0000\">%s</span>\n"
+ s = g_strdup_printf ("<span foreground=\"#ff0000\">%s</span>"
+ "%s"
"<small><span foreground=\"#ff0000\">%s%s</span></small>",
udisks_object_info_get_description (info),
+ model->flags & GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME ? " — " : "\n",
udisks_object_info_get_name (info),
included_device_name != NULL ? included_device_name : "");
}
else
{
- s = g_strdup_printf ("%s\n"
+ s = g_strdup_printf ("%s"
+ "%s"
"<small>%s%s</small>",
udisks_object_info_get_description (info),
+ model->flags & GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME ? " — " : "\n",
udisks_object_info_get_name (info),
included_device_name != NULL ? included_device_name : "");
}
@@ -1200,16 +1204,20 @@ update_mdraid (GduDeviceTreeModel *model,
/* TODO: once https://bugzilla.gnome.org/show_bug.cgi?id=657194 is resolved, use that instead
* of hard-coding the color
*/
- s = g_strdup_printf ("<span foreground=\"#ff0000\">%s</span>\n"
+ s = g_strdup_printf ("<span foreground=\"#ff0000\">%s</span>"
+ "%s"
"<small><span foreground=\"#ff0000\">%s</span></small>",
desc,
+ model->flags & GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME ? " — " : "\n",
desc2);
}
else
{
- s = g_strdup_printf ("%s\n"
+ s = g_strdup_printf ("%s"
+ "%s"
"<small>%s</small>",
desc,
+ model->flags & GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME ? " — " : "\n",
desc2);
}
@@ -1442,17 +1450,21 @@ update_block (GduDeviceTreeModel *model,
{
gchar *backing_file_unfused;
backing_file_unfused = gdu_utils_unfuse_path (loop_backing_file);
- s = g_strdup_printf ("%s\n"
+ s = g_strdup_printf ("%s"
+ "%s"
"<small>%s</small>",
udisks_object_info_get_description (info),
+ model->flags & GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME ? " — " : "\n",
backing_file_unfused);
g_free (backing_file_unfused);
}
else
{
- s = g_strdup_printf ("%s\n"
+ s = g_strdup_printf ("%s"
+ "%s"
"<small>%s</small>",
udisks_object_info_get_description (info),
+ model->flags & GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME ? " — " : "\n",
preferred_device);
}
diff --git a/src/disks/gduenums.h b/src/disks/gduenums.h
index b520be8..8e362ae 100644
--- a/src/disks/gduenums.h
+++ b/src/disks/gduenums.h
@@ -36,8 +36,9 @@ typedef enum
GDU_DEVICE_TREE_MODEL_FLAGS_FLAT = (1<<0),
GDU_DEVICE_TREE_MODEL_FLAGS_UPDATE_POWER_STATE = (1<<1),
GDU_DEVICE_TREE_MODEL_FLAGS_UPDATE_PULSE = (1<<2),
- GDU_DEVICE_TREE_MODEL_FLAGS_INCLUDE_DEVICE_NAME = (1<<3),
- GDU_DEVICE_TREE_MODEL_FLAGS_INCLUDE_NONE_ITEM = (1<<4),
+ GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME = (1<<3),
+ GDU_DEVICE_TREE_MODEL_FLAGS_INCLUDE_DEVICE_NAME = (1<<4),
+ GDU_DEVICE_TREE_MODEL_FLAGS_INCLUDE_NONE_ITEM = (1<<5),
} GduDeviceTreeModelFlags;
G_END_DECLS
diff --git a/src/disks/gdurestorediskimagedialog.c b/src/disks/gdurestorediskimagedialog.c
index 181cbf0..5f64273 100644
--- a/src/disks/gdurestorediskimagedialog.c
+++ b/src/disks/gdurestorediskimagedialog.c
@@ -443,6 +443,7 @@ populate_destination_combobox (DialogData *data)
combobox = GTK_COMBO_BOX (data->selectable_destination_combobox);
model = gdu_device_tree_model_new (gdu_window_get_application (data->window),
GDU_DEVICE_TREE_MODEL_FLAGS_FLAT |
+ GDU_DEVICE_TREE_MODEL_FLAGS_ONE_LINE_NAME |
GDU_DEVICE_TREE_MODEL_FLAGS_INCLUDE_DEVICE_NAME |
GDU_DEVICE_TREE_MODEL_FLAGS_INCLUDE_NONE_ITEM);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model),
@@ -453,7 +454,7 @@ populate_destination_combobox (DialogData *data)
renderer = gtk_cell_renderer_pixbuf_new ();
g_object_set (G_OBJECT (renderer),
- "stock-size", GTK_ICON_SIZE_DND,
+ "stock-size", GTK_ICON_SIZE_MENU,
NULL);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), renderer, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]