aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2006-12-03 20:52:26 +0000
committerChristian Grothoff <christian@grothoff.org>2006-12-03 20:52:26 +0000
commit8756f21468364ed46efee136cc986aa5486db64e (patch)
treec8cad1713b0adad69e9f89dad5f886fbf3b4de9b
parent31a687a6825a135a82cda5c950535f1d24de0359 (diff)
downloadgnunet-gtk-8756f21468364ed46efee136cc986aa5486db64e.tar.gz
gnunet-gtk-8756f21468364ed46efee136cc986aa5486db64e.zip
enable disable buttons in summary dialog
-rw-r--r--TODO2
-rw-r--r--gnunet-gtk.glade6
-rw-r--r--src/plugins/fs/fs.c87
3 files changed, 93 insertions, 2 deletions
diff --git a/TODO b/TODO
index bef98d93..77bc766c 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,4 @@
10.7.1: 10.7.1:
2- disable inactive buttons in summary dialog (if no search/download
3 is selected to operate on) [ medium ] [pre1]
4- highlight active downloads in search list [ easy ] [pre1] 2- highlight active downloads in search list [ easy ] [pre1]
5- highlight completed downloads [ easy ] [pre1] 3- highlight completed downloads [ easy ] [pre1]
6- allow deletion of keywords and metadata [pre1] 4- allow deletion of keywords and metadata [pre1]
diff --git a/gnunet-gtk.glade b/gnunet-gtk.glade
index 2f281d6f..568e3f22 100644
--- a/gnunet-gtk.glade
+++ b/gnunet-gtk.glade
@@ -908,6 +908,7 @@ This release fixes downloads of files from directories. The previous version ha
908 <child> 908 <child>
909 <widget class="GtkButton" id="cancelSearchButton"> 909 <widget class="GtkButton" id="cancelSearchButton">
910 <property name="visible">True</property> 910 <property name="visible">True</property>
911 <property name="sensitive">False</property>
911 <property name="tooltip" translatable="yes">Cancel the selected search</property> 912 <property name="tooltip" translatable="yes">Cancel the selected search</property>
912 <property name="can_focus">True</property> 913 <property name="can_focus">True</property>
913 <property name="label">gtk-cancel</property> 914 <property name="label">gtk-cancel</property>
@@ -926,6 +927,7 @@ This release fixes downloads of files from directories. The previous version ha
926 <child> 927 <child>
927 <widget class="GtkButton" id="stopSearchButton"> 928 <widget class="GtkButton" id="stopSearchButton">
928 <property name="visible">True</property> 929 <property name="visible">True</property>
930 <property name="sensitive">False</property>
929 <property name="tooltip" translatable="yes">Cancel the selected search and remove it from the list</property> 931 <property name="tooltip" translatable="yes">Cancel the selected search and remove it from the list</property>
930 <property name="can_focus">True</property> 932 <property name="can_focus">True</property>
931 <property name="label">gtk-stop</property> 933 <property name="label">gtk-stop</property>
@@ -1230,6 +1232,7 @@ This release fixes downloads of files from directories. The previous version ha
1230 <child> 1232 <child>
1231 <widget class="GtkButton" id="abortDownloadButton"> 1233 <widget class="GtkButton" id="abortDownloadButton">
1232 <property name="visible">True</property> 1234 <property name="visible">True</property>
1235 <property name="sensitive">False</property>
1233 <property name="tooltip" translatable="yes">Cancel the selected download</property> 1236 <property name="tooltip" translatable="yes">Cancel the selected download</property>
1234 <property name="can_focus">True</property> 1237 <property name="can_focus">True</property>
1235 <property name="label">gtk-cancel</property> 1238 <property name="label">gtk-cancel</property>
@@ -1248,6 +1251,7 @@ This release fixes downloads of files from directories. The previous version ha
1248 <child> 1251 <child>
1249 <widget class="GtkButton" id="stopDownloadButton"> 1252 <widget class="GtkButton" id="stopDownloadButton">
1250 <property name="visible">True</property> 1253 <property name="visible">True</property>
1254 <property name="sensitive">False</property>
1251 <property name="tooltip" translatable="yes">Cancel the selected download and remove it from the list</property> 1255 <property name="tooltip" translatable="yes">Cancel the selected download and remove it from the list</property>
1252 <property name="can_focus">True</property> 1256 <property name="can_focus">True</property>
1253 <property name="label">gtk-stop</property> 1257 <property name="label">gtk-stop</property>
@@ -1372,6 +1376,7 @@ This release fixes downloads of files from directories. The previous version ha
1372 <child> 1376 <child>
1373 <widget class="GtkButton" id="cancelUploadButton"> 1377 <widget class="GtkButton" id="cancelUploadButton">
1374 <property name="visible">True</property> 1378 <property name="visible">True</property>
1379 <property name="sensitive">False</property>
1375 <property name="tooltip" translatable="yes">Cancel the selected upload</property> 1380 <property name="tooltip" translatable="yes">Cancel the selected upload</property>
1376 <property name="can_focus">True</property> 1381 <property name="can_focus">True</property>
1377 <property name="label">gtk-cancel</property> 1382 <property name="label">gtk-cancel</property>
@@ -1390,6 +1395,7 @@ This release fixes downloads of files from directories. The previous version ha
1390 <child> 1395 <child>
1391 <widget class="GtkButton" id="stopUploadButton"> 1396 <widget class="GtkButton" id="stopUploadButton">
1392 <property name="visible">True</property> 1397 <property name="visible">True</property>
1398 <property name="sensitive">False</property>
1393 <property name="tooltip" translatable="yes">Cancel the selected upload and remove it from the list</property> 1399 <property name="tooltip" translatable="yes">Cancel the selected upload and remove it from the list</property>
1394 <property name="can_focus">True</property> 1400 <property name="can_focus">True</property>
1395 <property name="label">gtk-stop</property> 1401 <property name="label">gtk-stop</property>
diff --git a/src/plugins/fs/fs.c b/src/plugins/fs/fs.c
index 51e9dc60..082af05d 100644
--- a/src/plugins/fs/fs.c
+++ b/src/plugins/fs/fs.c
@@ -202,6 +202,75 @@ eventProcessor(void * unused,
202} 202}
203 203
204/** 204/**
205 * The selection of the upload summary changed.
206 * Update button status.
207 */
208static void on_upload_summary_selection_changed(gpointer signal,
209 gpointer cls) {
210 GtkTreeSelection * selection;
211 GtkWidget * button;
212
213 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(getMainXML(),
214 "activeUploadsList")));
215 button
216 = glade_xml_get_widget(getMainXML(),
217 "cancelUploadButton");
218 gtk_widget_set_sensitive(button,
219 gtk_tree_selection_count_selected_rows(selection) > 0);
220 button
221 = glade_xml_get_widget(getMainXML(),
222 "stopUploadButton");
223 gtk_widget_set_sensitive(button,
224 gtk_tree_selection_count_selected_rows(selection) > 0);
225}
226
227/**
228 * The selection of the download summary changed.
229 * Update button status.
230 */
231static void on_download_summary_selection_changed(gpointer signal,
232 gpointer cls) {
233 GtkTreeSelection * selection;
234 GtkWidget * button;
235
236 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(getMainXML(),
237 "activeDownloadsList")));
238 button
239 = glade_xml_get_widget(getMainXML(),
240 "abortDownloadButton");
241 gtk_widget_set_sensitive(button,
242 gtk_tree_selection_count_selected_rows(selection) > 0);
243 button
244 = glade_xml_get_widget(getMainXML(),
245 "stopDownloadButton");
246 gtk_widget_set_sensitive(button,
247 gtk_tree_selection_count_selected_rows(selection) > 0);
248}
249
250/**
251 * The selection of the download summary changed.
252 * Update button status.
253 */
254static void on_search_summary_selection_changed(gpointer signal,
255 gpointer cls) {
256 GtkTreeSelection * selection;
257 GtkWidget * button;
258
259 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(getMainXML(),
260 "activeSearchesSummary")));
261 button
262 = glade_xml_get_widget(getMainXML(),
263 "cancelSearchButton");
264 gtk_widget_set_sensitive(button,
265 gtk_tree_selection_count_selected_rows(selection) > 0);
266 button
267 = glade_xml_get_widget(getMainXML(),
268 "stopSearchButton");
269 gtk_widget_set_sensitive(button,
270 gtk_tree_selection_count_selected_rows(selection) > 0);
271}
272
273/**
205 * Setup the summary views (in particular the models 274 * Setup the summary views (in particular the models
206 * and the renderers). 275 * and the renderers).
207 */ 276 */
@@ -243,6 +312,12 @@ static void fs_summary_start() {
243 GTK_TREE_MODEL(search_summary)); 312 GTK_TREE_MODEL(search_summary));
244 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(searchList), 313 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(searchList),
245 GTK_SELECTION_MULTIPLE); 314 GTK_SELECTION_MULTIPLE);
315 g_signal_connect_data(gtk_tree_view_get_selection(searchList),
316 "changed",
317 G_CALLBACK(&on_search_summary_selection_changed),
318 NULL,
319 NULL,
320 0);
246 321
247 renderer = gtk_cell_renderer_text_new(); 322 renderer = gtk_cell_renderer_text_new();
248 col = gtk_tree_view_insert_column_with_attributes(searchList, 323 col = gtk_tree_view_insert_column_with_attributes(searchList,
@@ -289,6 +364,12 @@ static void fs_summary_start() {
289 GTK_TREE_MODEL(download_summary)); 364 GTK_TREE_MODEL(download_summary));
290 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(downloadList), 365 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(downloadList),
291 GTK_SELECTION_MULTIPLE); 366 GTK_SELECTION_MULTIPLE);
367 g_signal_connect_data(gtk_tree_view_get_selection(downloadList),
368 "changed",
369 G_CALLBACK(&on_download_summary_selection_changed),
370 NULL,
371 NULL,
372 0);
292 renderer = gtk_cell_renderer_progress_new(); 373 renderer = gtk_cell_renderer_progress_new();
293 col = gtk_tree_view_insert_column_with_attributes(downloadList, 374 col = gtk_tree_view_insert_column_with_attributes(downloadList,
294 -1, 375 -1,
@@ -349,6 +430,12 @@ static void fs_summary_start() {
349 GTK_TREE_MODEL(upload_summary)); 430 GTK_TREE_MODEL(upload_summary));
350 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(uploadList), 431 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(uploadList),
351 GTK_SELECTION_MULTIPLE); 432 GTK_SELECTION_MULTIPLE);
433 g_signal_connect_data(gtk_tree_view_get_selection(uploadList),
434 "changed",
435 G_CALLBACK(&on_upload_summary_selection_changed),
436 NULL,
437 NULL,
438 0);
352 renderer = gtk_cell_renderer_progress_new(); 439 renderer = gtk_cell_renderer_progress_new();
353 col = gtk_tree_view_insert_column_with_attributes(uploadList, 440 col = gtk_tree_view_insert_column_with_attributes(uploadList,
354 -1, 441 -1,