diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-11 08:43:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-11 08:43:57 +0000 |
commit | 5a3b630572a32a32ba432038823fc659fb744bdf (patch) | |
tree | fcb03837ae8b43d2ea620c9e81491f834b0f84c7 | |
parent | affae8c2eb80217a39023ee7f8678b973f6dd076 (diff) | |
download | gnunet-gtk-5a3b630572a32a32ba432038823fc659fb744bdf.tar.gz gnunet-gtk-5a3b630572a32a32ba432038823fc659fb744bdf.zip |
update
-rw-r--r-- | contrib/gnunet_peerinfo_gtk_main_window.glade | 109 | ||||
-rw-r--r-- | src/peerinfo/gnunet-peerinfo-gtk.c | 9 |
2 files changed, 48 insertions, 70 deletions
diff --git a/contrib/gnunet_peerinfo_gtk_main_window.glade b/contrib/gnunet_peerinfo_gtk_main_window.glade index f36555ca..abff82ee 100644 --- a/contrib/gnunet_peerinfo_gtk_main_window.glade +++ b/contrib/gnunet_peerinfo_gtk_main_window.glade | |||
@@ -2,61 +2,44 @@ | |||
2 | <interface> | 2 | <interface> |
3 | <requires lib="gtk+" version="2.20"/> | 3 | <requires lib="gtk+" version="2.20"/> |
4 | <!-- interface-naming-policy project-wide --> | 4 | <!-- interface-naming-policy project-wide --> |
5 | <object class="GtkWindow" id="GNUNET_GTK_PEERINFO_main_window"> | 5 | <object class="GtkWindow" id="GNUNET_PEERINFO_GTK_main_window"> |
6 | <property name="can_focus">False</property> | ||
6 | <property name="title" translatable="yes">gnunet-gtk</property> | 7 | <property name="title" translatable="yes">gnunet-gtk</property> |
7 | <property name="window_position">center</property> | 8 | <property name="window_position">center</property> |
8 | <property name="default_width">700</property> | 9 | <property name="default_width">700</property> |
9 | <property name="default_height">500</property> | 10 | <property name="default_height">500</property> |
10 | <property name="icon_name">gnunet-gtk</property> | 11 | <property name="icon_name">gnunet-gtk</property> |
11 | <signal name="delete-event" handler="GNUNET_GTK_quit_cb" after="yes" swapped="no"/> | 12 | <signal name="delete-event" handler="GNUNET_PEERINFO_GTK_quit_cb" after="yes" swapped="no"/> |
12 | <child> | 13 | <child> |
13 | <object class="GtkVBox" id="GNUNET_GTK_main_window_vbox"> | 14 | <object class="GtkVBox" id="GNUNET_PEERINFO_GTK_main_window_vbox"> |
14 | <property name="visible">True</property> | 15 | <property name="visible">True</property> |
16 | <property name="can_focus">False</property> | ||
15 | <child> | 17 | <child> |
16 | <object class="GtkMenuBar" id="GNUNET_GTK_main_menu"> | 18 | <object class="GtkMenuBar" id="GNUNET_PEERINFO_GTK_main_menu"> |
17 | <property name="visible">True</property> | 19 | <property name="visible">True</property> |
20 | <property name="can_focus">False</property> | ||
18 | <child> | 21 | <child> |
19 | <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_edit"> | 22 | <object class="GtkMenuItem" id="GNUNET_PEERINFO_GTK_main_menu_help"> |
20 | <property name="use_action_appearance">False</property> | ||
21 | <property name="label" translatable="yes">_Edit</property> | ||
22 | <property name="use_underline">True</property> | ||
23 | <child type="submenu"> | ||
24 | <object class="GtkMenu" id="GNUNET_GTK_main_menu_edit_box"> | ||
25 | <property name="visible">True</property> | ||
26 | <child> | ||
27 | <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_edit_preferences"> | ||
28 | <property name="label">gtk-preferences</property> | ||
29 | <property name="visible">True</property> | ||
30 | <property name="tooltip_text" translatable="yes">Edit the system configuration.</property> | ||
31 | <property name="use_action_appearance">False</property> | ||
32 | <property name="accel_path"><gnunet-gtk>/Edit/Preferences</property> | ||
33 | <property name="use_underline">True</property> | ||
34 | <property name="use_stock">True</property> | ||
35 | </object> | ||
36 | </child> | ||
37 | </object> | ||
38 | </child> | ||
39 | </object> | ||
40 | </child> | ||
41 | <child> | ||
42 | <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_help"> | ||
43 | <property name="visible">True</property> | 23 | <property name="visible">True</property> |
24 | <property name="can_focus">False</property> | ||
44 | <property name="use_action_appearance">False</property> | 25 | <property name="use_action_appearance">False</property> |
45 | <property name="label" translatable="yes">_Help</property> | 26 | <property name="label" translatable="yes">_Help</property> |
46 | <property name="use_underline">True</property> | 27 | <property name="use_underline">True</property> |
47 | <child type="submenu"> | 28 | <child type="submenu"> |
48 | <object class="GtkMenu" id="GNUNET_GTK_main_menu_help_abou"> | 29 | <object class="GtkMenu" id="GNUNET_PEERINFO_GTK_main_menu_help_abou"> |
49 | <property name="visible">True</property> | 30 | <property name="visible">True</property> |
31 | <property name="can_focus">False</property> | ||
50 | <child> | 32 | <child> |
51 | <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_help_about"> | 33 | <object class="GtkImageMenuItem" id="GNUNET_PEERINFO_GTK_main_menu_help_about"> |
52 | <property name="label">gtk-about</property> | 34 | <property name="label">gtk-about</property> |
53 | <property name="visible">True</property> | 35 | <property name="visible">True</property> |
36 | <property name="can_focus">False</property> | ||
54 | <property name="tooltip_text" translatable="yes">Display information about this version of gnunet-gtk</property> | 37 | <property name="tooltip_text" translatable="yes">Display information about this version of gnunet-gtk</property> |
55 | <property name="use_action_appearance">False</property> | 38 | <property name="use_action_appearance">False</property> |
56 | <property name="accel_path"><gnunet-gtk>/Help/About</property> | 39 | <property name="accel_path"><gnunet-gtk>/Help/About</property> |
57 | <property name="use_underline">True</property> | 40 | <property name="use_underline">True</property> |
58 | <property name="use_stock">True</property> | 41 | <property name="use_stock">True</property> |
59 | <signal name="activate" handler="GNUNET_GTK_main_menu_help_about_activate_cb" swapped="no"/> | 42 | <signal name="activate" handler="GNUNET_PEERINFO_GTK_main_menu_help_about_activate_cb" swapped="no"/> |
60 | </object> | 43 | </object> |
61 | </child> | 44 | </child> |
62 | </object> | 45 | </object> |
@@ -71,7 +54,7 @@ | |||
71 | </packing> | 54 | </packing> |
72 | </child> | 55 | </child> |
73 | <child> | 56 | <child> |
74 | <object class="GtkScrolledWindow" id="GNUNET_GTK_main_window_peerinfo_scroll"> | 57 | <object class="GtkScrolledWindow" id="GNUNET_PEERINFO_GTK_main_window_scroll"> |
75 | <property name="visible">True</property> | 58 | <property name="visible">True</property> |
76 | <property name="can_focus">True</property> | 59 | <property name="can_focus">True</property> |
77 | <property name="hadjustment">adjustment3</property> | 60 | <property name="hadjustment">adjustment3</property> |
@@ -79,24 +62,25 @@ | |||
79 | <property name="hscrollbar_policy">automatic</property> | 62 | <property name="hscrollbar_policy">automatic</property> |
80 | <property name="vscrollbar_policy">automatic</property> | 63 | <property name="vscrollbar_policy">automatic</property> |
81 | <child> | 64 | <child> |
82 | <object class="GtkTreeView" id="GNUNET_GTK_main_window_peerinfo_treeview"> | 65 | <object class="GtkTreeView" id="GNUNET_PEERINFO_GTK_main_window_treeview"> |
83 | <property name="visible">True</property> | 66 | <property name="visible">True</property> |
84 | <property name="can_focus">True</property> | 67 | <property name="can_focus">True</property> |
85 | <property name="model">GNUNET_GTK_peer_info_list_store</property> | 68 | <property name="model">GNUNET_PEERINFO_GTK_peer_info_list_store</property> |
86 | <property name="hadjustment">adjustment3</property> | 69 | <property name="hadjustment">adjustment3</property> |
87 | <property name="vadjustment">adjustment4</property> | 70 | <property name="vadjustment">adjustment4</property> |
88 | <property name="reorderable">True</property> | 71 | <property name="reorderable">True</property> |
89 | <property name="search_column">0</property> | 72 | <property name="search_column">0</property> |
73 | <property name="fixed_height_mode">True</property> | ||
90 | <child> | 74 | <child> |
91 | <object class="GtkTreeViewColumn" id="GNUNET_GTK_main_window_peerinfo_name_column"> | 75 | <object class="GtkTreeViewColumn" id="GNUNET_PEERINFO_GTK_main_window_name_column"> |
92 | <property name="sizing">autosize</property> | 76 | <property name="sizing">fixed</property> |
93 | <property name="title" translatable="yes">Peer</property> | 77 | <property name="title" translatable="yes">Peer</property> |
94 | <property name="expand">True</property> | 78 | <property name="expand">True</property> |
95 | <property name="clickable">True</property> | 79 | <property name="clickable">True</property> |
96 | <property name="reorderable">True</property> | 80 | <property name="reorderable">True</property> |
97 | <property name="sort_column_id">0</property> | 81 | <property name="sort_column_id">0</property> |
98 | <child> | 82 | <child> |
99 | <object class="GtkCellRendererText" id="GNUNET_GTK_main_window_peerinfo_name_renderer"> | 83 | <object class="GtkCellRendererText" id="GNUNET_PEERINFO_GTK_main_window_name_renderer"> |
100 | <property name="sensitive">False</property> | 84 | <property name="sensitive">False</property> |
101 | <property name="width_chars">16</property> | 85 | <property name="width_chars">16</property> |
102 | </object> | 86 | </object> |
@@ -107,14 +91,14 @@ | |||
107 | </object> | 91 | </object> |
108 | </child> | 92 | </child> |
109 | <child> | 93 | <child> |
110 | <object class="GtkTreeViewColumn" id="GNUNET_GTK_main_window_peerinfo_bandwidth_column"> | 94 | <object class="GtkTreeViewColumn" id="GNUNET_PEERINFO_GTK_main_window_bandwidth_column"> |
111 | <property name="sizing">autosize</property> | 95 | <property name="sizing">fixed</property> |
112 | <property name="title" translatable="yes">Bandwidth</property> | 96 | <property name="title" translatable="yes">Bandwidth</property> |
113 | <property name="clickable">True</property> | 97 | <property name="clickable">True</property> |
114 | <property name="sort_order">descending</property> | 98 | <property name="sort_order">descending</property> |
115 | <property name="sort_column_id">5</property> | 99 | <property name="sort_column_id">5</property> |
116 | <child> | 100 | <child> |
117 | <object class="GtkCellRendererText" id="GNUNET_GTK_main_window_peerinfo_bandwidth_renderer"/> | 101 | <object class="GtkCellRendererText" id="GNUNET_PEERINFO_GTK_main_window_bandwidth_renderer"/> |
118 | <attributes> | 102 | <attributes> |
119 | <attribute name="text">4</attribute> | 103 | <attribute name="text">4</attribute> |
120 | </attributes> | 104 | </attributes> |
@@ -122,21 +106,33 @@ | |||
122 | </object> | 106 | </object> |
123 | </child> | 107 | </child> |
124 | <child> | 108 | <child> |
125 | <object class="GtkTreeViewColumn" id="GNUNET_GTK_main_window_peerinfo_country_column"> | 109 | <object class="GtkTreeViewColumn" id="GNUNET_PEERINFO_GTK_main_window_country_column"> |
126 | <property name="sizing">autosize</property> | 110 | <property name="sizing">fixed</property> |
127 | <property name="title" translatable="yes">Country</property> | 111 | <property name="title" translatable="yes">Country</property> |
128 | <property name="clickable">True</property> | 112 | <property name="clickable">True</property> |
129 | <property name="reorderable">True</property> | 113 | <property name="reorderable">True</property> |
130 | <property name="sort_indicator">True</property> | 114 | <property name="sort_indicator">True</property> |
131 | <property name="sort_column_id">3</property> | 115 | <property name="sort_column_id">3</property> |
132 | <child> | 116 | <child> |
133 | <object class="GtkCellRendererPixbuf" id="GNUNET_GTK_main_window_peerinfo_country_renderer"/> | 117 | <object class="GtkCellRendererPixbuf" id="GNUNET_PEERINFO_GTK_main_window_country_renderer"/> |
134 | <attributes> | 118 | <attributes> |
135 | <attribute name="pixbuf">3</attribute> | 119 | <attribute name="pixbuf">3</attribute> |
136 | </attributes> | 120 | </attributes> |
137 | </child> | 121 | </child> |
138 | </object> | 122 | </object> |
139 | </child> | 123 | </child> |
124 | <child> | ||
125 | <object class="GtkTreeViewColumn" id="GNUNET_PEERINFO_GTK_main_window_address_treeviewcolumn"> | ||
126 | <property name="sizing">fixed</property> | ||
127 | <property name="title" translatable="yes">Addresses</property> | ||
128 | <child> | ||
129 | <object class="GtkCellRendererText" id="GNUNET_PEERINFO_GTK_main_window_addresses_cellrenderertext"/> | ||
130 | <attributes> | ||
131 | <attribute name="text">5</attribute> | ||
132 | </attributes> | ||
133 | </child> | ||
134 | </object> | ||
135 | </child> | ||
140 | </object> | 136 | </object> |
141 | </child> | 137 | </child> |
142 | </object> | 138 | </object> |
@@ -146,33 +142,10 @@ | |||
146 | <property name="position">1</property> | 142 | <property name="position">1</property> |
147 | </packing> | 143 | </packing> |
148 | </child> | 144 | </child> |
149 | <child> | ||
150 | <object class="GtkStatusbar" id="GNUNET_GTK_status_bar"> | ||
151 | <property name="visible">True</property> | ||
152 | <property name="spacing">2</property> | ||
153 | </object> | ||
154 | <packing> | ||
155 | <property name="expand">False</property> | ||
156 | <property name="fill">True</property> | ||
157 | <property name="position">2</property> | ||
158 | </packing> | ||
159 | </child> | ||
160 | </object> | 145 | </object> |
161 | </child> | 146 | </child> |
162 | </object> | 147 | </object> |
163 | <object class="GtkListStore" id="GNUNET_GTK_meta_data_list_store"> | 148 | <object class="GtkListStore" id="GNUNET_PEERINFO_GTK_list_store"> |
164 | <columns> | ||
165 | <!-- column-name extractor_meta_type --> | ||
166 | <column type="guint"/> | ||
167 | <!-- column-name extractor_meta_format --> | ||
168 | <column type="guint"/> | ||
169 | <!-- column-name extractor_meta_type_string --> | ||
170 | <column type="gchararray"/> | ||
171 | <!-- column-name extracotr_meta_value --> | ||
172 | <column type="gchararray"/> | ||
173 | </columns> | ||
174 | </object> | ||
175 | <object class="GtkListStore" id="GNUNET_GTK_peer_info_list_store"> | ||
176 | <columns> | 149 | <columns> |
177 | <!-- column-name peer_identity --> | 150 | <!-- column-name peer_identity --> |
178 | <column type="gchararray"/> | 151 | <column type="gchararray"/> |
@@ -184,6 +157,8 @@ | |||
184 | <column type="GdkPixbuf"/> | 157 | <column type="GdkPixbuf"/> |
185 | <!-- column-name bandwidth --> | 158 | <!-- column-name bandwidth --> |
186 | <column type="guint64"/> | 159 | <column type="guint64"/> |
160 | <!-- column-name addresses --> | ||
161 | <column type="gchararray"/> | ||
187 | </columns> | 162 | </columns> |
188 | </object> | 163 | </object> |
189 | <object class="GtkAdjustment" id="adjustment3"> | 164 | <object class="GtkAdjustment" id="adjustment3"> |
diff --git a/src/peerinfo/gnunet-peerinfo-gtk.c b/src/peerinfo/gnunet-peerinfo-gtk.c index afa27d70..ae7d57f9 100644 --- a/src/peerinfo/gnunet-peerinfo-gtk.c +++ b/src/peerinfo/gnunet-peerinfo-gtk.c | |||
@@ -100,7 +100,7 @@ peerinfo_processor (void *cls, | |||
100 | 100 | ||
101 | GNUNET_CRYPTO_hash_to_enc (&peer->hashPubKey, &enc); | 101 | GNUNET_CRYPTO_hash_to_enc (&peer->hashPubKey, &enc); |
102 | npid = (const char *) &enc; | 102 | npid = (const char *) &enc; |
103 | ls = GTK_LIST_STORE (get_object ("GNUNET_GTK_peer_info_list_store")); | 103 | ls = GTK_LIST_STORE (get_object ("GNUNET_PEERINFO_GTK_list_store")); |
104 | tm = GTK_TREE_MODEL (ls); | 104 | tm = GTK_TREE_MODEL (ls); |
105 | found = GNUNET_NO; | 105 | found = GNUNET_NO; |
106 | if (TRUE == gtk_tree_model_get_iter_first (tm, &iter)) | 106 | if (TRUE == gtk_tree_model_get_iter_first (tm, &iter)) |
@@ -125,9 +125,12 @@ peerinfo_processor (void *cls, | |||
125 | } | 125 | } |
126 | if (found == GNUNET_NO) | 126 | if (found == GNUNET_NO) |
127 | gtk_list_store_append (ls, &iter); | 127 | gtk_list_store_append (ls, &iter); |
128 | gtk_list_store_set (ls, &iter, 0, npid, 1, 0 /* number of known addresses */ , | 128 | gtk_list_store_set (ls, &iter, |
129 | 0, npid, | ||
130 | 1, 0 /* number of known addresses */ , | ||
129 | 2, "" /* country name */ , | 131 | 2, "" /* country name */ , |
130 | 3, NULL /* country flag */ , | 132 | 3, NULL /* country flag */ , |
133 | 4, "" /* addresses as strings */, | ||
131 | -1); | 134 | -1); |
132 | } | 135 | } |
133 | 136 | ||
@@ -166,7 +169,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
166 | 169 | ||
167 | /* setup main window */ | 170 | /* setup main window */ |
168 | main_window = | 171 | main_window = |
169 | GTK_WIDGET (get_object ("GNUNET_GTK_PEERINFO_main_window")); | 172 | GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window")); |
170 | gtk_window_maximize (GTK_WINDOW (main_window)); | 173 | gtk_window_maximize (GTK_WINDOW (main_window)); |
171 | GNUNET_GTK_tray_icon_create (GTK_WINDOW (main_window), | 174 | GNUNET_GTK_tray_icon_create (GTK_WINDOW (main_window), |
172 | "gnunet-gtk" /* FIXME: different icon? */ , | 175 | "gnunet-gtk" /* FIXME: different icon? */ , |