From ca7c82299c2a65421078eac4e8a1d7c87e545714 Mon Sep 17 00:00:00 2001 From: Caolan McNamara Date: Dec 09 2009 12:34:58 +0000 Subject: Resolves: rhbz#545711 use GtkComboBoxEntry instead of GtkCombo --- diff --git a/planner-gnome604169-comboboxentry.patch b/planner-gnome604169-comboboxentry.patch new file mode 100644 index 0000000..f755355 --- /dev/null +++ b/planner-gnome604169-comboboxentry.patch @@ -0,0 +1,209 @@ +diff -ru planner-0.14.4.orig/data/glade/add-predecessor.glade planner-0.14.4/data/glade/add-predecessor.glade +--- planner-0.14.4.orig/data/glade/add-predecessor.glade 2009-12-09 11:28:46.000000000 +0000 ++++ planner-0.14.4/data/glade/add-predecessor.glade 2009-12-09 11:34:54.000000000 +0000 +@@ -88,7 +88,6 @@ + 0.5 + 0 + 0 +- combo-entry1 + PANGO_ELLIPSIZE_NONE + -1 + False +@@ -162,6 +161,7 @@ + 0.5 + 0 + 0 ++ lag_entry + PANGO_ELLIPSIZE_NONE + -1 + False +@@ -178,45 +178,6 @@ + + + +- +- True +- False +- True +- False +- True +- False +- +- +- +- True +- True +- True +- True +- 0 +- +- True +- * +- True +- +- +- +- +- +- True +- GTK_SELECTION_BROWSE +- +- +- +- +- 1 +- 2 +- 0 +- 1 +- +- +- +- +- + + True + True +@@ -236,6 +197,23 @@ + + + ++ ++ ++ ++ True ++ False ++ True ++ True ++ ++ ++ 1 ++ 2 ++ 0 ++ 1 ++ fill ++ fill ++ ++ + + + 0 +diff -ru planner-0.14.4.orig/src/planner-task-dialog.c planner-0.14.4/src/planner-task-dialog.c +--- planner-0.14.4.orig/src/planner-task-dialog.c 2009-12-09 11:28:46.000000000 +0000 ++++ planner-0.14.4/src/planner-task-dialog.c 2009-12-09 12:12:55.000000000 +0000 +@@ -350,58 +350,43 @@ + #endif + + static void +-task_dialog_task_combo_select_child_cb (GtkList *list, +- GtkWidget *item, +- GtkCombo *combo) +-{ +- MrpTask *task; +- +- task = g_object_get_data (G_OBJECT (item), "task"); +- fprintf(stderr, "task_dialog_setup_task_combo child %p, had task %p\n", item, task); +- g_object_set_data (G_OBJECT (combo), "selected_task", task); +-} +- +-static void +-task_dialog_setup_task_combo (GtkCombo *combo, ++task_dialog_setup_task_combo (GtkComboBoxEntry *combo, + GList *tasks) + { +- GList *strings; +- GList *children; +- GList *l; +- const gchar *name; ++ GtkListStore *store; ++ GtkTreeIter iter; ++ GtkCellRenderer *renderer; ++ GList *l; ++ const gchar *name; + + if (tasks == NULL) { + return; + } ++ ++ store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); + +- strings = NULL; + for (l = tasks; l; l = l->next) { ++ gtk_list_store_append (store, &iter); + name = mrp_task_get_name (l->data); + if (name == NULL || name[0] == 0) { +- strings = g_list_prepend (strings, +- _("(No name)")); ++ gtk_list_store_set (store, &iter, ++ 0, _("(No name)"), ++ 1, l->data, ++ -1); + } else { +- strings = g_list_prepend (strings, (gchar*) name); ++ gtk_list_store_set (store, &iter, ++ 0, name, ++ 1, l->data, ++ -1); + } + } + +- strings = g_list_reverse (strings); +- gtk_combo_set_popdown_strings (combo, strings); +- g_list_free (strings); +- +- g_object_set_data (G_OBJECT (combo), "selected_task", tasks->data); +- +- children = GTK_LIST (combo->list)->children; +- for (l = children; l; l = l->next) { +- g_object_set_data (G_OBJECT (l->data), "task", tasks->data); +- fprintf(stderr, "child %p, given task %p\n", l, tasks->data); +- tasks = tasks->next; +- } +- +- g_signal_connect (combo->list, +- "select-child", +- G_CALLBACK (task_dialog_task_combo_select_child_cb), +- combo); ++ gtk_combo_box_set_model (GTK_COMBO_BOX (combo), ++ GTK_TREE_MODEL (store)); ++ ++ gtk_combo_box_entry_set_text_column (combo, 0); ++ ++ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); + } + + static gboolean +@@ -1908,7 +1893,7 @@ + + tasks = mrp_project_get_all_tasks (project); + tasks = g_list_remove (tasks, task); +- task_dialog_setup_task_combo (GTK_COMBO (w), tasks); ++ task_dialog_setup_task_combo (GTK_COMBO_BOX_ENTRY (w), tasks); + + w = glade_xml_get_widget (glade, "type_optionmenu"); + g_object_set_data (G_OBJECT (dialog), "type_optionmenu", w); +@@ -1949,10 +1934,11 @@ + GtkWidget *w; + GError *error = NULL; + MrpTask *task_main; +- MrpTask *new_task_pred; ++ MrpTask *new_task_pred=NULL; + MrpProject *project; + gint lag; + gint pred_type; ++ GtkTreeIter iter; + const gchar *str; + + main_window = g_object_get_data (G_OBJECT (dialog), "main_window"); +@@ -1972,7 +1958,11 @@ + /* Predecessor task. */ + w = g_object_get_data (G_OBJECT (dialog), "predecessor_combo"); + +- new_task_pred = g_object_get_data (G_OBJECT (w), "selected_task"); ++ if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (w), &iter)) { ++ gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (w)), ++ &iter, 1, &new_task_pred, -1); ++ } ++ + if (new_task_pred == NULL) { + g_warning (_("Can't add new predecessor. No task selected!")); + return; diff --git a/planner.spec b/planner.spec index c416e09..0fff8a4 100644 --- a/planner.spec +++ b/planner.spec @@ -24,6 +24,7 @@ Patch2: planner-gnome596966-editoninsert.patch Patch3: planner-gnome550559-fitzoom.patch Patch4: planner-buildfix.patch Patch5: planner-gnome603693-planner-calendar-for-edittask.patch +Patch6: planner-gnome604169-comboboxentry.patch %description Planner is a visual project management application which allows users to @@ -59,6 +60,7 @@ This package provides a plugin to integration planner and evolution. %patch3 -p1 -b .fitzoom %patch4 -p1 -b .buildfix %patch5 -p1 -b .edittask +%patch6 -p1 -b .combobox %build rm -rf libegg @@ -159,6 +161,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/* %changelog +* Wed Dec 09 2009 Caolán McNamara - 0.14.4-7 +- Resolves: rhbz#545711 use GtkComboBoxEntry instead of GtkCombo + * Thu Dec 03 2009 Caolán McNamara - 0.14.4-6 - Resolves: rhbz#543741 use PlannerCalander in edit->task