[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r19652 - in gnunet-gtk: contrib src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r19652 - in gnunet-gtk: contrib src/fs |
Date: |
Thu, 2 Feb 2012 20:00:24 +0100 |
Author: grothoff
Date: 2012-02-02 20:00:24 +0100 (Thu, 02 Feb 2012)
New Revision: 19652
Modified:
gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade
gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
Log:
-fix
Modified: gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade 2012-02-02 18:53:02 UTC
(rev 19651)
+++ gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade 2012-02-02 19:00:24 UTC
(rev 19652)
@@ -351,7 +351,7 @@
<property name="use_action_appearance">False</property>
<property name="image_position">right</property>
<signal name="toggled"
handler="GNUNET_FS_GTK_search_namespace_dropdown_button_toggled_cb"
swapped="no"/>
- <signal name="leave-notify-event"
handler="GNUNET_FS_GTK_namespace_selector_window_leave_notify_event_cb"
swapped="no"/>
+ <signal name="leave-notify-event"
handler="GNUNET_FS_GTK_search_namespace_selector_window_leave_notify_event_cb"
swapped="no"/>
<signal name="enter-notify-event"
handler="GNUNET_FS_GTK_search_namespace_dropdown_button_enter_notify_event_cb"
swapped="no"/>
<child>
<object class="GtkArrow" id="arrow1">
@@ -845,8 +845,8 @@
<property name="deletable">False</property>
<property name="transient_for">GNUNET_GTK_main_window</property>
<property name="mnemonics_visible">False</property>
- <signal name="leave-notify-event"
handler="namespace_selector_window_leave_notify_event_cb" swapped="no"/>
- <signal name="enter-notify-event"
handler="main_window_search_namespace_dropdown_button_enter_notify_event_cb"
swapped="no"/>
+ <signal name="leave-notify-event"
handler="GNUNET_FS_GTK_search_namespace_selector_window_leave_notify_event_cb"
swapped="no"/>
+ <signal name="enter-notify-event"
handler="GNUNET_FS_GTK_search_namespace_dropdown_button_enter_notify_event_cb"
swapped="no"/>
<child>
<object class="GtkTreeView" id="namespace_selector_treeview">
<property name="visible">True</property>
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
2012-02-02 18:53:02 UTC (rev 19651)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
2012-02-02 19:00:24 UTC (rev 19652)
@@ -36,67 +36,6 @@
*
* @param user_data the builder for the main window
*/
-void
-GNUNET_FS_GTK_search_namespace_dropdown_button_toggled_cb (GtkToggleButton *
- togglebutton,
- gpointer user_data)
-{
- GtkBuilder *builder = GTK_BUILDER (user_data);
- gboolean active;
- GtkWidget *namespace_selector_window;
- GtkWidget *namespace_selector_treeview;
-
- namespace_selector_window =
- GTK_WIDGET (gtk_builder_get_object
- (builder, "namespace_selector_window"));
- namespace_selector_treeview =
- GTK_WIDGET (gtk_builder_get_object
- (builder, "namespace_selector_treeview"));
- g_object_get (G_OBJECT (togglebutton), "active", &active, NULL);
- if (active)
- {
- GtkAllocation togglebutton_allocation;
- GdkWindow *main_window_gdk;
- gint mwg_x;
- gint mwg_y;
- gint tgb_x;
- gint tgb_y;
- gint popup_x;
- gint popup_y;
-
- gtk_widget_get_allocation (GTK_WIDGET (togglebutton),
- &togglebutton_allocation);
-
- main_window_gdk = gtk_widget_get_window (GTK_WIDGET (togglebutton));
-
- gdk_window_get_origin (main_window_gdk, &mwg_x, &mwg_y);
-
- /* FIXME: this might become a problem in other window managers,
- * where reference point is not in the top-left corner.
- * We want to show the window below the button.
- */
- tgb_x = mwg_x + togglebutton_allocation.x;
- tgb_y = mwg_y + togglebutton_allocation.y;
- popup_x = tgb_x;
- popup_y = tgb_y + togglebutton_allocation.height;
-
- gtk_window_move (GTK_WINDOW (namespace_selector_window), popup_x, popup_y);
-
- gtk_widget_show_all (namespace_selector_window);
- gtk_widget_grab_focus (namespace_selector_treeview);
- }
- else
- {
- gtk_widget_hide (namespace_selector_window);
- gtk_widget_grab_focus (GTK_WIDGET (togglebutton));
- }
-}
-
-
-/**
- *
- * @param user_data the builder for the main window
- */
gboolean
GNUNET_FS_GTK_search_namespace_dropdown_button_enter_notify_event_cb
(GtkWidget *widget,
GdkEvent
*event,
@@ -128,9 +67,9 @@
* @param user_data the builder for the main window
*/
gboolean
-GNUNET_FS_GTK_namespace_selector_window_leave_notify_event_cb (GtkWidget *
widget,
- GdkEvent * event,
- gpointer
user_data)
+GNUNET_FS_GTK_search_namespace_selector_window_leave_notify_event_cb
(GtkWidget * widget,
+ GdkEvent
* event,
+ gpointer
user_data)
{
GtkBuilder *builder;
GtkToggleButton *toggle_button;
@@ -440,7 +379,68 @@
}
+
+
/**
+ * The toggle button that changes the visibility of the namespace dropdown
+ * list was toggled.
+ *
+ * @param togglebutton the button that toggles the namespace dropdown list
+ * @param user_data the builder for the main window
+ */
+void
+GNUNET_FS_GTK_search_namespace_dropdown_button_toggled_cb (GtkToggleButton *
+ togglebutton,
+ gpointer user_data)
+{
+ GtkBuilder *builder = GTK_BUILDER (user_data);
+ gboolean active;
+ GtkWidget *namespace_selector_window;
+ GtkWidget *namespace_selector_treeview;
+ GtkAllocation togglebutton_allocation;
+ GdkWindow *main_window_gdk;
+ gint mwg_x;
+ gint mwg_y;
+ gint tgb_x;
+ gint tgb_y;
+ gint popup_x;
+ gint popup_y;
+
+ namespace_selector_window =
+ GTK_WIDGET (gtk_builder_get_object
+ (builder, "namespace_selector_window"));
+ g_object_get (G_OBJECT (togglebutton), "active", &active, NULL);
+ if (! active)
+ {
+ gtk_widget_hide (namespace_selector_window);
+ gtk_widget_grab_focus (GTK_WIDGET (togglebutton));
+ return;
+ }
+ namespace_selector_treeview =
+ GTK_WIDGET (gtk_builder_get_object
+ (builder, "namespace_selector_treeview"));
+ gtk_widget_get_allocation (GTK_WIDGET (togglebutton),
+ &togglebutton_allocation);
+ main_window_gdk = gtk_widget_get_window (GTK_WIDGET (togglebutton));
+ gdk_window_get_origin (main_window_gdk, &mwg_x, &mwg_y);
+
+ /* FIXME: this might become a problem in other window managers,
+ * where reference point is not in the top-left corner.
+ * We want to show the window below the button.
+ */
+ tgb_x = mwg_x + togglebutton_allocation.x;
+ tgb_y = mwg_y + togglebutton_allocation.y;
+ popup_x = tgb_x;
+ popup_y = tgb_y + togglebutton_allocation.height;
+
+ gtk_window_move (GTK_WINDOW (namespace_selector_window), popup_x, popup_y);
+
+ gtk_widget_show_all (namespace_selector_window);
+ gtk_widget_grab_focus (namespace_selector_treeview);
+}
+
+
+/**
* Startup hook to initialize the namespace dropdown widget.
*
* @param widget the main window
@@ -481,14 +481,14 @@
0, "Any", 1, NULL, 2, "", 3,
"Do not search in any particular
namespace",
-1);
- /* FIXME: when do we unregister? */
+ /* FIXME-BUG: when do we unregister? */
GNUNET_PSEUDONYM_discovery_callback_register
(GNUNET_FS_GTK_get_configuration (),
&add_namespace_to_ts,
namespace_treestore);
}
/* select the first item and update the label */
- /* FIXME: is this even necessary? If the first item is "Any", we can
+ /* FIXME-STYLE: is this even necessary? If the first item is "Any", we can
just have the label have the right default, or not? */
if (gtk_tree_model_get_iter_first
(GTK_TREE_MODEL (namespace_treestore), &iter))
@@ -512,6 +512,7 @@
}
/* show the window (to trigger certain events) and immediately hide it */
+ /* FIXME: yuck, can't we trigger these events by other means? */
{
GtkWidget *namespace_selector_window;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r19652 - in gnunet-gtk: contrib src/fs,
gnunet <=