[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20565 - in gnunet-gtk: contrib src/gns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20565 - in gnunet-gtk: contrib src/gns |
Date: |
Fri, 16 Mar 2012 14:50:49 +0100 |
Author: wachs
Date: 2012-03-16 14:50:49 +0100 (Fri, 16 Mar 2012)
New Revision: 20565
Modified:
gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade
gnunet-gtk/src/gns/gnunet-gns-gtk.c
gnunet-gtk/src/gns/gnunet-gns-gtk.h
gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c
Log:
- changes
Modified: gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade 2012-03-16 12:57:33 UTC
(rev 20564)
+++ gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade 2012-03-16 13:50:49 UTC
(rev 20565)
@@ -277,7 +277,6 @@
</object>
<attributes>
<attribute name="text">3</attribute>
- <attribute name="has-entry">2</attribute>
</attributes>
</child>
</object>
Modified: gnunet-gtk/src/gns/gnunet-gns-gtk.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk.c 2012-03-16 12:57:33 UTC (rev 20564)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk.c 2012-03-16 13:50:49 UTC (rev 20565)
@@ -349,6 +349,7 @@
}
gns->builder = GNUNET_GTK_main_loop_get_builder(ml);
gns->ts = GTK_TREE_STORE (gtk_builder_get_object (gns->builder,
"GNUNET_GNS_GTK_treestore"));
+ gns->ls = GTK_LIST_STORE (gtk_builder_get_object (gns->builder,
"GNUNET_GNS_GTK_type_liststore"));
GNUNET_assert (NULL != gns->ts);
zone_as_string = GNUNET_strdup (GNUNET_h2s_full (&gns->zone));
Modified: gnunet-gtk/src/gns/gnunet-gns-gtk.h
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk.h 2012-03-16 12:57:33 UTC (rev 20564)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk.h 2012-03-16 13:50:49 UTC (rev 20565)
@@ -37,6 +37,7 @@
GtkBuilder *builder;
GtkTreeStore *ts;
+ GtkListStore *ls;
struct GNUNET_CRYPTO_RsaPrivateKey *pkey;
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey;
Modified: gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c 2012-03-16 12:57:33 UTC (rev
20564)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c 2012-03-16 13:50:49 UTC (rev
20565)
@@ -42,6 +42,12 @@
TREE_COL_NAME_IS_EDITABLE,
};
+enum
+{
+ TYPE_LIST_TYPE = 0,
+ TYPE_LIST_TYPENAME
+};
+
/**
* The user has selected a new record type. Update the
* model, possibly invalidating (marking 'red') the existing
@@ -54,11 +60,25 @@
*/
void
GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb (GtkCellRendererCombo *combo,
- gchar *path_string,
+ gchar *path,
GtkTreeIter *new_iter,
gpointer user_data)
{
- GNUNET_break (0); // FIXME, not implemented
+ struct GNUNET_GNS_Context *gns = user_data;
+ GtkTreeIter it;
+ GtkTreeModel *tm = GTK_TREE_MODEL(gns->ts);
+ guint value;
+ char * v_name;
+
+ gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, 0, &value, -1);
+
+ gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, TYPE_LIST_TYPENAME,
&v_name, -1);
+ gtk_tree_model_get_iter_from_string(tm, &it, path);
+ gtk_tree_store_set(gns->ts, &it,
+ TREE_COL_RECORD_TYPE, value,
+ TREE_COL_RECORD_TYPE_AS_STR, v_name,
+ -1);
+
}
@@ -137,6 +157,7 @@
&data_size))
{
gtk_tree_model_get_iter_from_string(tm, &it, path);
+ gtk_tree_store_set (gns->ts, &it, TREE_COL_VAL_COLOR, NULL, -1);
gtk_tree_store_set (gns->ts, &it, TREE_COL_VAL_AS_STR, new_text, -1);
}
else
@@ -303,7 +324,7 @@
gtk_tree_store_insert_with_values(zc_ctx->gns->ts, &iter_record ,
&iter_name, 0,
TREE_COL_NAME, "",
TREE_COL_RECORD_TYPE, rd[c].record_type,
- TREE_COL_EXP_TIME_AS_STR,
GNUNET_NAMESTORE_number_to_typename(rd[c].record_type),
+ TREE_COL_RECORD_TYPE_AS_STR,
GNUNET_NAMESTORE_number_to_typename(rd[c].record_type),
TREE_COL_IS_PUBLIC, public,
TREE_COL_EXP_TIME_AS_STR, exp,
TREE_COL_EXP_TIME_IS_REL,
time_is_relative,
@@ -331,8 +352,6 @@
GtkTreeIter toplevel;
/* Append a top level row and leave it empty */
- //gtk_tree_store_append(gns->ts, &toplevel, NULL);
-
gtk_tree_store_insert_with_values(gns->ts, &toplevel, NULL, 0,
TREE_COL_NAME, _(NEW_RECORD_STR),
TREE_COL_RECORD_TYPE, 1,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20565 - in gnunet-gtk: contrib src/gns,
gnunet <=