aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2006-12-03 19:21:00 +0000
committerChristian Grothoff <christian@grothoff.org>2006-12-03 19:21:00 +0000
commitf350727f991251cf3bdf90d45321bb31d01247ef (patch)
treed39aab37068b56b0bb1349fd1f5bffeeeabcb134
parentc85e4f6f6a5c046d2d7629123fd8919d51ba0b2c (diff)
downloadgnunet-gtk-f350727f991251cf3bdf90d45321bb31d01247ef.tar.gz
gnunet-gtk-f350727f991251cf3bdf90d45321bb31d01247ef.zip
towards nice buttons
-rw-r--r--TODO2
-rw-r--r--gnunet-gtk.glade5
-rw-r--r--src/plugins/fs/search.c45
-rw-r--r--src/plugins/fs/upload.c37
4 files changed, 88 insertions, 1 deletions
diff --git a/TODO b/TODO
index 6799d288..bef98d93 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,5 @@
10.7.1: 10.7.1:
2- disable inactive buttons (if no search/download 2- disable inactive buttons in summary dialog (if no search/download
3 is selected to operate on) [ medium ] [pre1] 3 is selected to operate on) [ medium ] [pre1]
4- highlight active downloads in search list [ easy ] [pre1] 4- highlight active downloads in search list [ easy ] [pre1]
5- highlight completed downloads [ easy ] [pre1] 5- highlight completed downloads [ easy ] [pre1]
diff --git a/gnunet-gtk.glade b/gnunet-gtk.glade
index 1c1610b5..2f281d6f 100644
--- a/gnunet-gtk.glade
+++ b/gnunet-gtk.glade
@@ -1585,6 +1585,7 @@ This release fixes downloads of files from directories. The previous version ha
1585 <property name="add_tearoffs">False</property> 1585 <property name="add_tearoffs">False</property>
1586 <property name="has_frame">True</property> 1586 <property name="has_frame">True</property>
1587 <property name="focus_on_click">True</property> 1587 <property name="focus_on_click">True</property>
1588 <signal name="changed" handler="on_fssearchKeywordComboBoxEntry_changed_" last_modification_time="Sun, 03 Dec 2006 18:59:17 GMT"/>
1588 </widget> 1589 </widget>
1589 </child> 1590 </child>
1590 </widget> 1591 </widget>
@@ -1598,6 +1599,7 @@ This release fixes downloads of files from directories. The previous version ha
1598 <child> 1599 <child>
1599 <widget class="GtkButton" id="fssearchbutton"> 1600 <widget class="GtkButton" id="fssearchbutton">
1600 <property name="visible">True</property> 1601 <property name="visible">True</property>
1602 <property name="sensitive">False</property>
1601 <property name="tooltip" translatable="yes">Search GNUnet for content under the specified keyword (and, if applicable, restrict the search to the given namespace)</property> 1603 <property name="tooltip" translatable="yes">Search GNUnet for content under the specified keyword (and, if applicable, restrict the search to the given namespace)</property>
1602 <property name="has_default">True</property> 1604 <property name="has_default">True</property>
1603 <property name="can_focus">True</property> 1605 <property name="can_focus">True</property>
@@ -2334,6 +2336,7 @@ This release fixes downloads of files from directories. The previous version ha
2334 <child> 2336 <child>
2335 <widget class="GtkButton" id="fsinsertuploadbutton"> 2337 <widget class="GtkButton" id="fsinsertuploadbutton">
2336 <property name="visible">True</property> 2338 <property name="visible">True</property>
2339 <property name="sensitive">False</property>
2337 <property name="tooltip" translatable="yes">Share the specified file with the selected options (you will then be prompted to enter meta-data and keywords).</property> 2340 <property name="tooltip" translatable="yes">Share the specified file with the selected options (you will then be prompted to enter meta-data and keywords).</property>
2338 <property name="can_focus">True</property> 2341 <property name="can_focus">True</property>
2339 <property name="relief">GTK_RELIEF_NORMAL</property> 2342 <property name="relief">GTK_RELIEF_NORMAL</property>
@@ -2492,6 +2495,7 @@ This release fixes downloads of files from directories. The previous version ha
2492 <property name="add_tearoffs">False</property> 2495 <property name="add_tearoffs">False</property>
2493 <property name="has_frame">True</property> 2496 <property name="has_frame">True</property>
2494 <property name="focus_on_click">True</property> 2497 <property name="focus_on_click">True</property>
2498 <signal name="changed" handler="on_uploadFilenameComboBoxEntry_changed_" last_modification_time="Sun, 03 Dec 2006 19:05:39 GMT"/>
2495 </widget> 2499 </widget>
2496 </child> 2500 </child>
2497 </widget> 2501 </widget>
@@ -4378,6 +4382,7 @@ Press ENTER to add the data.</atkproperty>
4378 <child> 4382 <child>
4379 <widget class="GtkButton" id="downloadButton"> 4383 <widget class="GtkButton" id="downloadButton">
4380 <property name="visible">True</property> 4384 <property name="visible">True</property>
4385 <property name="sensitive">False</property>
4381 <property name="tooltip" translatable="yes">Download selected files.</property> 4386 <property name="tooltip" translatable="yes">Download selected files.</property>
4382 <property name="can_focus">True</property> 4387 <property name="can_focus">True</property>
4383 <property name="relief">GTK_RELIEF_NORMAL</property> 4388 <property name="relief">GTK_RELIEF_NORMAL</property>
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c
index 2fd26f51..f7cc87d4 100644
--- a/src/plugins/fs/search.c
+++ b/src/plugins/fs/search.c
@@ -34,6 +34,26 @@
34#include <GNUnet/gnunet_util_crypto.h> 34#include <GNUnet/gnunet_util_crypto.h>
35#include <GNUnet/gnunet_namespace_lib.h> 35#include <GNUnet/gnunet_namespace_lib.h>
36 36
37
38/**
39 * The user has edited the search entry.
40 * Update search button status.
41 */
42static void on_fssearchSelectionChanged(gpointer signal,
43 gpointer cls) {
44 SearchList * list = cls;
45 GtkTreeSelection * selection;
46 GtkWidget * downloadButton;
47
48 selection = gtk_tree_view_get_selection(list->treeview);
49 downloadButton
50 = glade_xml_get_widget(list->searchXML,
51 "downloadButton");
52 gtk_widget_set_sensitive(downloadButton,
53 gtk_tree_selection_count_selected_rows(selection) > 0);
54}
55
56
37/* **************** FSUI event handling ****************** */ 57/* **************** FSUI event handling ****************** */
38 58
39/** 59/**
@@ -221,6 +241,12 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
221 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(list->treeview), 241 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(list->treeview),
222 GTK_SELECTION_MULTIPLE); 242 GTK_SELECTION_MULTIPLE);
223 243
244 g_signal_connect_data(gtk_tree_view_get_selection(list->treeview),
245 "changed",
246 G_CALLBACK(&on_fssearchSelectionChanged),
247 list,
248 NULL,
249 0);
224 renderer = gtk_cell_renderer_text_new(); 250 renderer = gtk_cell_renderer_text_new();
225 col = gtk_tree_view_insert_column_with_attributes(list->treeview, 251 col = gtk_tree_view_insert_column_with_attributes(list->treeview,
226 -1, 252 -1,
@@ -462,6 +488,25 @@ void fs_search_stopped(SearchList * list) {
462 488
463 489
464/** 490/**
491 * The user has edited the search entry.
492 * Update search button status.
493 */
494void on_fssearchKeywordComboBoxEntry_changed_fs(gpointer dummy2,
495 GtkWidget * searchEntry) {
496 const char * searchString;
497 GtkWidget * searchButton;
498
499 searchString = getEntryLineValue(getMainXML(),
500 "fssearchKeywordComboBoxEntry");
501 searchButton
502 = glade_xml_get_widget(getMainXML(),
503 "fssearchbutton");
504 gtk_widget_set_sensitive(searchButton,
505 strlen(searchString) > 0);
506}
507
508
509/**
465 * The user has clicked the "SEARCH" button. 510 * The user has clicked the "SEARCH" button.
466 * Initiate a search. 511 * Initiate a search.
467 */ 512 */
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c
index 5b14a19f..91114d11 100644
--- a/src/plugins/fs/upload.c
+++ b/src/plugins/fs/upload.c
@@ -442,6 +442,43 @@ clearCompletedUploadCallback(GtkTreeModel * model,
442 } 442 }
443} 443}
444 444
445/**
446 * The user has edited the search entry.
447 * Update search button status.
448 */
449void on_uploadFilenameComboBoxEntry_changed_fs(gpointer dummy2,
450 GtkWidget * searchEntry) {
451 const char * filename;
452 GtkWidget * uploadButton;
453 struct stat buf;
454 int ok;
455 GtkWidget * toggle;
456
457 filename = getEntryLineValue(getMainXML(),
458 "uploadFilenameComboBoxEntry");
459 ok = (0 == stat(filename, &buf));
460 if (ok)
461 ok = (0 == ACCESS(filename, R_OK));
462 if (ok) {
463 if (S_ISDIR(buf.st_mode)) {
464 toggle = glade_xml_get_widget(getMainXML(),
465 "scopeRecursiveButton");
466 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
467 1);
468 } else {
469 toggle = glade_xml_get_widget(getMainXML(),
470 "scopeFileOnlyButton");
471 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
472 1);
473 }
474 }
475 uploadButton
476 = glade_xml_get_widget(getMainXML(),
477 "fsinsertuploadbutton");
478 gtk_widget_set_sensitive(uploadButton,
479 ok);
480}
481
445void on_clearCompletedUploadsButton_clicked_fs(void * unused, 482void on_clearCompletedUploadsButton_clicked_fs(void * unused,
446 GtkWidget * clearButton) { 483 GtkWidget * clearButton) {
447 ggc_tree_model_foreach(GTK_TREE_MODEL(upload_summary), 484 ggc_tree_model_foreach(GTK_TREE_MODEL(upload_summary),