gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis-gtk] branch master updated: finish GtkComboBox


From: gnunet
Subject: [taler-anastasis-gtk] branch master updated: finish GtkComboBox
Date: Mon, 05 Jul 2021 00:05:57 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis-gtk.

The following commit(s) were added to refs/heads/master by this push:
     new f02d6b7  finish GtkComboBox
f02d6b7 is described below

commit f02d6b72f46295a9e92caf5b5aebfc839ce02fa3
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Mon Jul 5 00:05:53 2021 +0200

    finish GtkComboBox
---
 src/anastasis/anastasis-gtk_pe-edit-policy.c | 35 ++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/src/anastasis/anastasis-gtk_pe-edit-policy.c 
b/src/anastasis/anastasis-gtk_pe-edit-policy.c
index 358a959..f0ac3fb 100644
--- a/src/anastasis/anastasis-gtk_pe-edit-policy.c
+++ b/src/anastasis/anastasis-gtk_pe-edit-policy.c
@@ -279,6 +279,7 @@ ap_matches (const char *type,
 
   methods = json_object_get (ap,
                             "methods");
+  GNUNET_break (NULL != methods);
   json_array_foreach (methods, index, method)
   {
     const char *offer;
@@ -327,9 +328,6 @@ make_model (const char *type)
     if (ap_matches (type,
                    ap))
     {
-      fprintf (stderr,
-              "adding %s to model\n",
-              url);
       gtk_list_store_insert_with_values (ls,
                                         NULL,
                                         -1,
@@ -372,6 +370,7 @@ select_by_url (const char *url,
     {
       gtk_combo_box_set_active_iter (lctx->cb,
                                     &iter);
+      lctx->on = true;
       g_free (have);
       return;
     }
@@ -395,7 +394,16 @@ select_by_policy (const json_t *methods,
 {
   size_t index;
   json_t *method;
+  GtkTreeIter iter;
 
+  if (! gtk_tree_model_get_iter_first (lctx->model,
+                                      &iter))
+  {
+    GNUNET_break (0);
+    return;
+  }
+  gtk_combo_box_set_active_iter (lctx->cb,
+                                &iter);
   json_array_foreach (methods, index, method) {
     json_int_t am = json_integer_value (json_object_get (method,\
                                                         
"authentication_method"));
@@ -487,6 +495,18 @@ AG_edit_policy (guint pindex)
       lctx->model = make_model (type);
       cb = gtk_combo_box_new_with_model (lctx->model);
       lctx->cb = GTK_COMBO_BOX (cb);
+      {
+       GtkCellRenderer *renderer;
+
+       renderer = gtk_cell_renderer_text_new ();
+       gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cb),
+                                   renderer,
+                                   true);
+       gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (cb),
+                                      renderer,
+                                      "text",
+                                      0);
+      }
       lctx->edc = edc;
       GNUNET_CONTAINER_DLL_insert (edc->lc_head,
                                   edc->lc_tail,
@@ -510,8 +530,6 @@ AG_edit_policy (guint pindex)
       g_object_set (cb,
                    "expand",
                    TRUE,
-                   "entry-text-column",
-                   0,
                    NULL);
       gtk_widget_show (cb);
       gtk_grid_attach (grid,
@@ -527,11 +545,18 @@ AG_edit_policy (guint pindex)
     GtkWidget *toplevel;
     GtkWidget *ad;
     GtkWidget *anchor;
+    GtkRequisition req;
 
     anchor = GTK_WIDGET (GCG_get_main_window_object 
("anastasis_gtk_main_window_quit_button"));
     toplevel = gtk_widget_get_toplevel (anchor);
     ad = GTK_WIDGET (gtk_builder_get_object (edc->builder,
                                             
"anastasis_gtk_policy_edit_dialog"));
+    gtk_widget_get_preferred_size (ad,
+                                  NULL,
+                                  &req);
+    gtk_window_resize (GTK_WINDOW (ad),
+                      req.width,
+                      req.height);
     gtk_window_set_transient_for (GTK_WINDOW (ad),
                                   GTK_WINDOW (toplevel));
     gtk_window_present (GTK_WINDOW (ad));

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]