aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-gns-gtk_zone.c
blob: b7f7c22cf067e417e4369159b65e9a042398c45c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/*
     This file is part of GNUnet
     (C) 2012 Christian Grothoff (and other contributing authors)

     GNUnet is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published
     by the Free Software Foundation; either version 2, or (at your
     option) any later version.

     GNUnet is distributed in the hope that it will be useful, but
     WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with GNUnet; see the file COPYING.  If not, write to the
     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.
*/

/**
 * @file src/gns/gnunet-gns-gtk_zone.c
 * @author Christian Grothoff
 * @brief everything releated to the zone tree view
 */
#include "gnunet_gtk.h"
#include "gnunet-gns-gtk.h"



/**
 * The user has selected a new record type.  Update the
 * model, possibly invalidating (marking 'red') the existing
 * value.
 *
 * @param renderer updated renderer
 * @param path the path identifying the edited cell
 * @param new_iter selected cell in the combo's model (with the record type)
 * @param user_data unused
 */
void
GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb (GtkCellRendererCombo *combo,
						  gchar *path_string,
						  GtkTreeIter *new_iter,
						  gpointer user_data)
{
  GNUNET_break (0); // FIXME, not implemented
}


/**
 * The user has toggled the 'public' checkmark of a cell.  Update the
 * model.
 *
 * @param renderer updated renderer
 * @param path the path identifying the edited cell
 * @param user_data unused
 */
void
GNUNET_GNS_GTK_ispublic_cellrenderertoggle_toggled_cb (GtkCellRendererToggle *cell_renderer,
						       gchar *path,
						       gpointer user_data)
{
  GNUNET_break (0); // FIXME, not implemented
}


/**
 * The user has edited a 'expiration' cell.  Update the model.
 *
 * @param renderer updated renderer
 * @param path the path identifying the edited cell
 * @param new_text the new expiration time
 * @param user_data unused
 */
void
GNUNET_GNS_GTK_expiration_cellrenderertext_edited_cb (GtkCellRendererText *renderer,
						      gchar *path,
						      gchar *new_text,
						      gpointer user_data)
{
  GNUNET_break (0); // FIXME, not implemented
}


/**
 * The user has edited a 'value' cell.  Update the model,
 * including the status on the consistency of the value with
 * the type.
 *
 * @param renderer updated renderer
 * @param path the path identifying the edited cell
 * @param new_text the new value
 * @param user_data unused
 */
void
GNUNET_GNS_GTK_value_cellrenderertext_edited_cb (GtkCellRendererText *renderer,
						 gchar *path,
						 gchar *new_text,
						 gpointer user_data)
{
  GNUNET_break (0); // FIXME, not implemented
}


/**
 * The user has edited a 'name' cell.  Update the model (and if needed
 * create another fresh line for additional records).
 *
 * @param renderer updated renderer
 * @param path the path identifying the edited cell
 * @param new_text the new name
 * @param user_data unused
 */
void
GNUNET_GNS_GTK_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer,
						gchar *path,
						gchar *new_text,
						gpointer user_data)
{
  GNUNET_break (0); // FIXME, not implemented
}


/**
 * The zone treeview pop up menu is supposed to be created.
 * (Note: this is not the only method that might need to be
 * written to handle events to create pop up menus; right-clicks
 * might need to be managed separately).
 *
 * @param widget the widget
 * @param user_data unused
 * @return TRUE if a menu was activated
 */
gboolean
GNUNET_GNS_GTK_main_treeview_popup_menu_cb (GtkWidget *widget,
					    gpointer user_data)
{  
  GNUNET_break (0); // FIXME, not implemented
  return FALSE;
}

enum
{
  COL_FIRST_NAME = 0,
  COL_LAST_NAME,
  COL_YEAR_BORN,
  NUM_COLS
} ;

static void
test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
  struct GNUNET_GNS_Context *gns=cls;
  GtkBuilder *builder = gns->builder;
  GtkTreeStore *ts;
  GtkTreeIter  toplevel, child;

  ts  = GTK_TREE_STORE (gtk_builder_get_object (builder, "GNUNET_GNS_GTK_treestore"));
  GNUNET_assert (ts != NULL);

  GNUNET_break (0);
  /* Append a top level row and leave it empty */
  gtk_tree_store_append(ts, &toplevel, NULL);
  /*
  gtk_tree_store_set(ts, &toplevel,
                     COL_FIRST_NAME, "Maria",
                     COL_LAST_NAME, "Incognito",
                     -1);*/
}

void
GNUNET_GNS_GTK_main_treeview_click_cb (GtkTreeViewColumn *treeviewcolumn,
                                      gpointer user_data)
{

  GNUNET_SCHEDULER_add_now (&test, user_data);
}

/**
 * The zone treeview was realized.   Setup the model.
 *
 * @param widget the widget
 * @param user_data unused
 */
void
GNUNET_GNS_GTK_main_treeview_realize_cb (GtkWidget *widget,
					 gpointer user_data)
{
  /*
  struct GNUNET_GNS_Context *gns=user_data;
  GtkBuilder *builder = gns->builder;
  GNUNET_assert (GTK_IS_BUILDER(user_data));

  GtkTreeModel * tm;
  tm  = GTK_TREE_MODEL(gtk_builder_get_object (builder, "GNUNET_GNS_GTK_treestore"));
  GNUNET_assert (tm != NULL);

  //gtk_tree
*/
  GNUNET_break (0);


}


/* end of gnunet-gns-gtk_zone.c */