diff options
Diffstat (limited to 'src/conversation/gnunet-conversation-gtk_egos.c')
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_egos.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/conversation/gnunet-conversation-gtk_egos.c b/src/conversation/gnunet-conversation-gtk_egos.c index 0324ffb7..716d7cdf 100644 --- a/src/conversation/gnunet-conversation-gtk_egos.c +++ b/src/conversation/gnunet-conversation-gtk_egos.c | |||
@@ -102,6 +102,7 @@ identity_cb (void *cls, | |||
102 | const char *name) | 102 | const char *name) |
103 | { | 103 | { |
104 | GtkTreeIter iter; | 104 | GtkTreeIter iter; |
105 | GtkTreeIter iter2; | ||
105 | GtkTreeRowReference *rr; | 106 | GtkTreeRowReference *rr; |
106 | GtkTreePath *path; | 107 | GtkTreePath *path; |
107 | GtkComboBox *cb; | 108 | GtkComboBox *cb; |
@@ -121,17 +122,18 @@ identity_cb (void *cls, | |||
121 | EGO_LS_NAME, name, | 122 | EGO_LS_NAME, name, |
122 | EGO_LS_EGO, ego, | 123 | EGO_LS_EGO, ego, |
123 | -1); | 124 | -1); |
124 | if ( (NULL != default_ego) && | 125 | cb = GTK_COMBO_BOX (GCG_get_main_window_object |
125 | (0 == strcmp (name, | 126 | ("gnunet_conversation_gtk_ego_combobox")); |
126 | default_ego)) ) | 127 | if ( (! gtk_combo_box_get_active_iter (cb, |
128 | &iter2)) && | ||
129 | ( (NULL == default_ego) || | ||
130 | (0 == strcmp (name, | ||
131 | default_ego))) ) | ||
127 | { | 132 | { |
128 | /* found the ego that we were supposed to use by default, select | 133 | /* found the ego that we were supposed to use by default, select |
129 | it! */ | 134 | it! */ |
130 | GNUNET_free (default_ego); | 135 | gtk_combo_box_set_active_iter (cb, |
131 | default_ego = NULL; | 136 | &iter); |
132 | cb = GTK_COMBO_BOX (GCG_get_main_window_object | ||
133 | ("gnunet_conversation_gtk_ego_combobox")); | ||
134 | gtk_combo_box_set_active_iter (cb, &iter); | ||
135 | } | 137 | } |
136 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ego_liststore), | 138 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ego_liststore), |
137 | &iter); | 139 | &iter); |
@@ -213,7 +215,8 @@ gnunet_conversation_gtk_ego_copy_button_clicked_cb (GtkButton *button, | |||
213 | void | 215 | void |
214 | GCG_EGOS_init (const char *ego_name) | 216 | GCG_EGOS_init (const char *ego_name) |
215 | { | 217 | { |
216 | default_ego = GNUNET_strdup (ego_name); | 218 | if (NULL != ego_name) |
219 | default_ego = GNUNET_strdup (ego_name); | ||
217 | ego_liststore | 220 | ego_liststore |
218 | = GTK_LIST_STORE (GCG_get_main_window_object | 221 | = GTK_LIST_STORE (GCG_get_main_window_object |
219 | ("gnunet_conversation_gtk_ego_liststore")); | 222 | ("gnunet_conversation_gtk_ego_liststore")); |