[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3867 - in gnunet-gtk: . src/plugins/fs
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3867 - in gnunet-gtk: . src/plugins/fs |
Date: |
Sun, 3 Dec 2006 12:52:31 -0800 (PST) |
Author: grothoff
Date: 2006-12-03 12:52:26 -0800 (Sun, 03 Dec 2006)
New Revision: 3867
Modified:
gnunet-gtk/TODO
gnunet-gtk/gnunet-gtk.glade
gnunet-gtk/src/plugins/fs/fs.c
Log:
enable disable buttons in summary dialog
Modified: gnunet-gtk/TODO
===================================================================
--- gnunet-gtk/TODO 2006-12-03 19:21:46 UTC (rev 3866)
+++ gnunet-gtk/TODO 2006-12-03 20:52:26 UTC (rev 3867)
@@ -1,6 +1,4 @@
0.7.1:
-- disable inactive buttons in summary dialog (if no search/download
- is selected to operate on) [ medium ] [pre1]
- highlight active downloads in search list [ easy ] [pre1]
- highlight completed downloads [ easy ] [pre1]
- allow deletion of keywords and metadata [pre1]
Modified: gnunet-gtk/gnunet-gtk.glade
===================================================================
--- gnunet-gtk/gnunet-gtk.glade 2006-12-03 19:21:46 UTC (rev 3866)
+++ gnunet-gtk/gnunet-gtk.glade 2006-12-03 20:52:26 UTC (rev 3867)
@@ -908,6 +908,7 @@
<child>
<widget class="GtkButton"
id="cancelSearchButton">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="tooltip"
translatable="yes">Cancel the selected search</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
@@ -926,6 +927,7 @@
<child>
<widget class="GtkButton" id="stopSearchButton">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="tooltip"
translatable="yes">Cancel the selected search and remove it from the
list</property>
<property name="can_focus">True</property>
<property name="label">gtk-stop</property>
@@ -1230,6 +1232,7 @@
<child>
<widget class="GtkButton"
id="abortDownloadButton">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="tooltip"
translatable="yes">Cancel the selected download</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
@@ -1248,6 +1251,7 @@
<child>
<widget class="GtkButton"
id="stopDownloadButton">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="tooltip"
translatable="yes">Cancel the selected download and remove it from the
list</property>
<property name="can_focus">True</property>
<property name="label">gtk-stop</property>
@@ -1372,6 +1376,7 @@
<child>
<widget class="GtkButton"
id="cancelUploadButton">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="tooltip"
translatable="yes">Cancel the selected upload</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
@@ -1390,6 +1395,7 @@
<child>
<widget class="GtkButton" id="stopUploadButton">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="tooltip"
translatable="yes">Cancel the selected upload and remove it from the
list</property>
<property name="can_focus">True</property>
<property name="label">gtk-stop</property>
Modified: gnunet-gtk/src/plugins/fs/fs.c
===================================================================
--- gnunet-gtk/src/plugins/fs/fs.c 2006-12-03 19:21:46 UTC (rev 3866)
+++ gnunet-gtk/src/plugins/fs/fs.c 2006-12-03 20:52:26 UTC (rev 3867)
@@ -202,6 +202,75 @@
}
/**
+ * The selection of the upload summary changed.
+ * Update button status.
+ */
+static void on_upload_summary_selection_changed(gpointer signal,
+ gpointer cls) {
+ GtkTreeSelection * selection;
+ GtkWidget * button;
+
+ selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(getMainXML(),
+
"activeUploadsList")));
+ button
+ = glade_xml_get_widget(getMainXML(),
+ "cancelUploadButton");
+ gtk_widget_set_sensitive(button,
+ gtk_tree_selection_count_selected_rows(selection) >
0);
+ button
+ = glade_xml_get_widget(getMainXML(),
+ "stopUploadButton");
+ gtk_widget_set_sensitive(button,
+ gtk_tree_selection_count_selected_rows(selection) >
0);
+}
+
+/**
+ * The selection of the download summary changed.
+ * Update button status.
+ */
+static void on_download_summary_selection_changed(gpointer signal,
+ gpointer cls) {
+ GtkTreeSelection * selection;
+ GtkWidget * button;
+
+ selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(getMainXML(),
+
"activeDownloadsList")));
+ button
+ = glade_xml_get_widget(getMainXML(),
+ "abortDownloadButton");
+ gtk_widget_set_sensitive(button,
+ gtk_tree_selection_count_selected_rows(selection) >
0);
+ button
+ = glade_xml_get_widget(getMainXML(),
+ "stopDownloadButton");
+ gtk_widget_set_sensitive(button,
+ gtk_tree_selection_count_selected_rows(selection) >
0);
+}
+
+/**
+ * The selection of the download summary changed.
+ * Update button status.
+ */
+static void on_search_summary_selection_changed(gpointer signal,
+ gpointer cls) {
+ GtkTreeSelection * selection;
+ GtkWidget * button;
+
+ selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(getMainXML(),
+
"activeSearchesSummary")));
+ button
+ = glade_xml_get_widget(getMainXML(),
+ "cancelSearchButton");
+ gtk_widget_set_sensitive(button,
+ gtk_tree_selection_count_selected_rows(selection) >
0);
+ button
+ = glade_xml_get_widget(getMainXML(),
+ "stopSearchButton");
+ gtk_widget_set_sensitive(button,
+ gtk_tree_selection_count_selected_rows(selection) >
0);
+}
+
+/**
* Setup the summary views (in particular the models
* and the renderers).
*/
@@ -243,6 +312,12 @@
GTK_TREE_MODEL(search_summary));
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(searchList),
GTK_SELECTION_MULTIPLE);
+ g_signal_connect_data(gtk_tree_view_get_selection(searchList),
+ "changed",
+ G_CALLBACK(&on_search_summary_selection_changed),
+ NULL,
+ NULL,
+ 0);
renderer = gtk_cell_renderer_text_new();
col = gtk_tree_view_insert_column_with_attributes(searchList,
@@ -289,6 +364,12 @@
GTK_TREE_MODEL(download_summary));
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(downloadList),
GTK_SELECTION_MULTIPLE);
+ g_signal_connect_data(gtk_tree_view_get_selection(downloadList),
+ "changed",
+ G_CALLBACK(&on_download_summary_selection_changed),
+ NULL,
+ NULL,
+ 0);
renderer = gtk_cell_renderer_progress_new();
col = gtk_tree_view_insert_column_with_attributes(downloadList,
-1,
@@ -349,6 +430,12 @@
GTK_TREE_MODEL(upload_summary));
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(uploadList),
GTK_SELECTION_MULTIPLE);
+ g_signal_connect_data(gtk_tree_view_get_selection(uploadList),
+ "changed",
+ G_CALLBACK(&on_upload_summary_selection_changed),
+ NULL,
+ NULL,
+ 0);
renderer = gtk_cell_renderer_progress_new();
col = gtk_tree_view_insert_column_with_attributes(uploadList,
-1,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3867 - in gnunet-gtk: . src/plugins/fs,
grothoff <=