Commit 7d918460 authored by Emmanuel Milou's avatar Emmanuel Milou

test

parent 4c9444ee
......@@ -165,6 +165,13 @@ call_quit ( void * foo)
sflphone_quit();
}
static void
call_minimize ( void * foo)
{
gtk_widget_hide(GTK_WIDGET( get_main_window() ));
set_minimized( !MAIN_WINDOW_SHOW );
}
static void
call_hold (void* foo)
{
......@@ -240,9 +247,23 @@ create_call_menu()
NULL);
gtk_widget_show (menu_items);
// Separator
menu_items = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
// Close menu to minimize the main window to the system tray
menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_CLOSE, get_accel_group());
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
g_signal_connect_swapped (G_OBJECT (menu_items), "activate",
G_CALLBACK (call_minimize),
NULL);
gtk_widget_show (menu_items);
// Separator
menu_items = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
// Quit Menu - quit SFLphone
menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_QUIT, get_accel_group());
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
g_signal_connect_swapped (G_OBJECT (menu_items), "activate",
......
......@@ -25,7 +25,7 @@
GtkStatusIcon* status;
GtkWidget * show_menu_item;
gboolean minimized = FALSE;
gboolean __minimized = MAIN_WINDOW_SHOW;
void
status_quit ( void * foo)
......@@ -39,16 +39,33 @@ status_icon_unminimize()
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE);
}
gboolean
main_widget_minimized()
{
return __minimized;
}
void
show_hide (GtkWidget *menu, void * foo)
show_hide (void)
{
if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item)))
/*if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item)))
{
gtk_widget_show(GTK_WIDGET(get_main_window()));
}
else
{
gtk_widget_hide(GTK_WIDGET(get_main_window()));
}*/
if( main_widget_minimized() )
{
gtk_widget_show(GTK_WIDGET(get_main_window()));
set_minimized(MAIN_WINDOW_SHOW) ;
}
else
{
gtk_widget_hide(GTK_WIDGET(get_main_window()));
set_minimized(!MAIN_WINDOW_SHOW) ;
}
}
......@@ -126,3 +143,9 @@ get_status_icon( void )
{
return status;
}
void
set_minimized( gboolean state)
{
__minimized = state ;
}
......@@ -20,12 +20,17 @@
#ifndef __STATUSICON_H__
#define __STATUSICON_H__
#define MAIN_WINDOW_SHOW TRUE
#include <gtk/gtk.h>
/** @file statusicon.h
* @brief The status icon.
*/
void show_status_icon();
void status_icon_unminimize();
gboolean main_widget_minimized();
void set_minimized( gboolean state );
void status_tray_icon_blink( gboolean active );
GtkStatusIcon* get_status_icon( void );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment