[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r32128 - in gnunet-gtk/src: include lib
From: |
gnunet |
Subject: |
[GNUnet-SVN] r32128 - in gnunet-gtk/src: include lib |
Date: |
Thu, 30 Jan 2014 22:09:48 +0100 |
Author: hark
Date: 2014-01-30 22:09:48 +0100 (Thu, 30 Jan 2014)
New Revision: 32128
Modified:
gnunet-gtk/src/include/gnunet_gtk.h
gnunet-gtk/src/lib/trayicon.c
Log:
added GNUNET_GTK_tray_icon_change
Modified: gnunet-gtk/src/include/gnunet_gtk.h
===================================================================
--- gnunet-gtk/src/include/gnunet_gtk.h 2014-01-30 20:51:12 UTC (rev 32127)
+++ gnunet-gtk/src/include/gnunet_gtk.h 2014-01-30 21:09:48 UTC (rev 32128)
@@ -64,8 +64,7 @@
* @return new main window to initialize
*/
GtkWidget *
-GNUNET_GTK_plug_me (const char *env_name,
- GtkWidget *main_window);
+GNUNET_GTK_plug_me (const char *env_name, GtkWidget * main_window);
/**
@@ -117,8 +116,7 @@
* @return NULL on error
*/
GtkBuilder *
-GNUNET_GTK_get_new_builder2 (const char *filename,
- void *user_data,
+GNUNET_GTK_get_new_builder2 (const char *filename, void *user_data,
GtkBuilderConnectFunc cb);
@@ -156,8 +154,7 @@
* @return TRUE on success, FALSE on errors
*/
gboolean
-GNUNET_GTK_get_tree_string (GtkTreeView *treeview,
- GtkTreePath *treepath,
+GNUNET_GTK_get_tree_string (GtkTreeView * treeview, GtkTreePath * treepath,
guint column, gchar ** value);
@@ -170,11 +167,21 @@
* @param tooltip tooltip for the tray icon
*/
void
-GNUNET_GTK_tray_icon_create (struct GNUNET_GTK_MainLoop *ml,
- GtkWindow * main, const char *icon_name,
- const char *tooltip);
+GNUNET_GTK_tray_icon_create (struct GNUNET_GTK_MainLoop *ml, GtkWindow * main,
+ const char *icon_name, const char *tooltip);
+/**
+ * Change our tray icon.
+ *
+ * @param ml main loop
+ * @param main handle to the main window (show or hide)
+ * @param icon_name name of the tray icon file
+ * @param tooltip tooltip for the tray icon
+ */
+void
+GNUNET_GTK_tray_icon_change (const char *icon_name, const char *tooltip);
+
/**
* Destroy the tray icon.
*/
@@ -189,7 +196,7 @@
* @return string in UTF-8, NULL if str_loc was NULL
*/
char *
-GNUNET_GTK_from_loc_to_utf8 (const char * str_loc);
+GNUNET_GTK_from_loc_to_utf8 (const char *str_loc);
/**
@@ -209,8 +216,7 @@
* @param root root of the subtree to remove
*/
void
-GNUNET_FS_GTK_remove_treestore_subtree (GtkTreeStore * ts,
- GtkTreeIter * root);
+GNUNET_FS_GTK_remove_treestore_subtree (GtkTreeStore * ts, GtkTreeIter * root);
/* ******************* main loop ***************** */
@@ -266,9 +272,8 @@
* @param argv set to argument vector
*/
void
-GNUNET_GTK_main_loop_get_args (struct GNUNET_GTK_MainLoop * ml,
- int *argc,
- char *const**argv);
+GNUNET_GTK_main_loop_get_args (struct GNUNET_GTK_MainLoop *ml, int *argc,
+ char *const **argv);
/**
@@ -376,8 +381,8 @@
* @return handle to unregister the tree view later
*/
struct GNUNET_FS_AnimationTreeViewHandle *
-GNUNET_GTK_animation_tree_view_register (GtkTreeView *tv,
- GtkTreeViewColumn *image_col);
+GNUNET_GTK_animation_tree_view_register (GtkTreeView * tv,
+ GtkTreeViewColumn * image_col);
/**
@@ -386,7 +391,9 @@
* @param atv tree view to unregister
*/
void
-GNUNET_GTK_animation_tree_view_unregister (struct
GNUNET_FS_AnimationTreeViewHandle *atv);
+GNUNET_GTK_animation_tree_view_unregister (struct
+ GNUNET_FS_AnimationTreeViewHandle
+ *atv);
/* ********************* generic helpers ******************* */
@@ -396,22 +403,22 @@
* Columns in the anonymity level model.
*/
enum GNUNET_GTK_FS_MAIN_WINDOW_AnonymityLevelModelColumns
- {
+{
/**
* A gchararray.
*/
- GNUNET_GTK_ANONYMITY_LEVEL_MC_NAME = 0,
+ GNUNET_GTK_ANONYMITY_LEVEL_MC_NAME = 0,
/**
* A guint.
*/
- GNUNET_GTK_ANONYMITY_LEVEL_MC_LEVEL = 1,
+ GNUNET_GTK_ANONYMITY_LEVEL_MC_LEVEL = 1,
/**
* A gchararray.
*/
- GNUNET_GTK_ANONYMITY_LEVEL_MC_COLOR = 2
- };
+ GNUNET_GTK_ANONYMITY_LEVEL_MC_COLOR = 2
+};
/**
@@ -459,7 +466,8 @@
* @return TRUE on success, FALSE on failure
*/
gboolean
-GNUNET_GTK_get_selected_anonymity_combo_level (GtkComboBox *combo, guint
*p_level);
+GNUNET_GTK_get_selected_anonymity_combo_level (GtkComboBox * combo,
+ guint * p_level);
#endif
Modified: gnunet-gtk/src/lib/trayicon.c
===================================================================
--- gnunet-gtk/src/lib/trayicon.c 2014-01-30 20:51:12 UTC (rev 32127)
+++ gnunet-gtk/src/lib/trayicon.c 2014-01-30 21:09:48 UTC (rev 32128)
@@ -47,9 +47,7 @@
{
gboolean tlf;
- g_object_get (main_window,
- "visible", &tlf,
- NULL);
+ g_object_get (main_window, "visible", &tlf, NULL);
if (tlf)
{
gtk_widget_hide (GTK_WIDGET (main_window));
@@ -71,8 +69,7 @@
* @param user_data the main loop context
*/
void
-GNUNET_GTK_tray_icon_quit (GtkMenuItem *menuitem,
- gpointer user_data)
+GNUNET_GTK_tray_icon_quit (GtkMenuItem * menuitem, gpointer user_data)
{
/* struct GNUNET_GTK_MainLoop *ml = user_data; */
GNUNET_SCHEDULER_shutdown ();
@@ -96,7 +93,8 @@
event_button = (GdkEventButton *) event;
if (event_button->button == 3)
{
- builder = GNUNET_GTK_get_new_builder
("gnunet_gtk_status_bar_menu.glade", ml);
+ builder =
+ GNUNET_GTK_get_new_builder ("gnunet_gtk_status_bar_menu.glade", ml);
tray_menu =
GTK_MENU (gtk_builder_get_object
(builder, "GNUNET_GTK_status_bar_popup_menu"));
@@ -119,9 +117,8 @@
* @param tooltip tooltip for the tray icon
*/
void
-GNUNET_GTK_tray_icon_create (struct GNUNET_GTK_MainLoop *ml,
- GtkWindow * main, const char *icon_name,
- const char *tooltip)
+GNUNET_GTK_tray_icon_create (struct GNUNET_GTK_MainLoop *ml, GtkWindow * main,
+ const char *icon_name, const char *tooltip)
{
if (NULL != tray_icon)
{
@@ -139,7 +136,29 @@
gtk_status_icon_set_visible (tray_icon, TRUE);
}
+/**
+ * Change our tray icon.
+ *
+ * @param ml main loop
+ * @param main handle to the main window (show or hide)
+ * @param icon_name name of the tray icon file
+ * @param tooltip tooltip for the tray icon
+ */
+void
+GNUNET_GTK_tray_icon_change (const char *icon_name, const char *tooltip)
+{
+ if (NULL == tray_icon)
+ {
+ GNUNET_break (0);
+ return;
+ }
+ gtk_status_icon_set_from_icon_name (tray_icon, icon_name);
+ gtk_status_icon_set_tooltip_text (tray_icon, tooltip);
+ gtk_status_icon_set_visible (tray_icon, TRUE);
+}
+
+
/**
* Destroy the tray icon.
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r32128 - in gnunet-gtk/src: include lib,
gnunet <=