Skip to content
Snippets Groups Projects
Commit bcdb30a3 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1640] Do not put a system icon tray as default

parent d39124b5
No related branches found
No related tags found
No related merge requests found
Showing
with 5279 additions and 5240 deletions
#Tue Feb 23 14:32:32 EST 2010 #Fri Feb 26 15:32:40 EST 2010
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80 org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80
...@@ -124,8 +124,8 @@ org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert ...@@ -124,8 +124,8 @@ org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert
......
#Thu Mar 26 14:05:05 EDT 2009 #Fri Feb 26 15:30:12 EST 2010
eclipse.preferences.version=1 eclipse.preferences.version=1
formatter_profile=org.eclipse.cdt.ui.default.gnu_profile formatter_profile=_GNU - SFLphone
formatter_settings_version=1 formatter_settings_version=1
This diff is collapsed.
...@@ -461,6 +461,15 @@ ...@@ -461,6 +461,15 @@
<arg type="i" name="posY" direction="in"/> <arg type="i" name="posY" direction="in"/>
</method> </method>
<method name="enableStatusIcon">
<arg type="s" name="value" direction="in"/>
</method>
<method name="isStatusIconEnabled">
<arg type="s" name="value" direction="out"/>
</method>
<!-- Addressbook configuration --> <!-- Addressbook configuration -->
<method name="getAddressbookSettings"> <method name="getAddressbookSettings">
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/> <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/>
......
...@@ -2580,3 +2580,32 @@ void dbus_set_window_position_y (const guint posy) { ...@@ -2580,3 +2580,32 @@ void dbus_set_window_position_y (const guint posy) {
} }
} }
void dbus_enable_status_icon (const gchar *value) {
GError *error = NULL;
org_sflphone_SFLphone_ConfigurationManager_enable_status_icon (configurationManagerProxy, value, &error);
if (error != NULL) {
ERROR ("Failed to call enable_status_icon on ConfigurationManager: %s",
error->message);
g_error_free (error);
}
}
gchar* dbus_is_status_icon_enabled (void) {
GError *error = NULL;
gchar* value = TRUE;
org_sflphone_SFLphone_ConfigurationManager_is_status_icon_enabled (configurationManagerProxy, &value, &error);
if (error != NULL) {
ERROR ("Failed to call is_status_icon_enabled on ConfigurationManager: %s",
error->message);
g_error_free (error);
}
return value;
}
...@@ -606,4 +606,8 @@ guint dbus_get_window_position_y (void); ...@@ -606,4 +606,8 @@ guint dbus_get_window_position_y (void);
void dbus_set_window_position_x (const guint posx); void dbus_set_window_position_x (const guint posx);
void dbus_set_window_position_y (const guint posy); void dbus_set_window_position_y (const guint posy);
void dbus_enable_status_icon (const gchar*);
gchar* dbus_is_status_icon_enabled (void);
#endif #endif
...@@ -59,6 +59,7 @@ main(int argc, char *argv[]) ...@@ -59,6 +59,7 @@ main(int argc, char *argv[])
{ {
// Handle logging // Handle logging
int i; int i;
gboolean statusicon = FALSE;
// Startup logging // Startup logging
startup_logging (); startup_logging ();
...@@ -88,25 +89,25 @@ There is NO WARRANTY, to the extent permitted by law.\n\n"); ...@@ -88,25 +89,25 @@ There is NO WARRANTY, to the extent permitted by law.\n\n");
textdomain ("sflphone-client-gnome"); textdomain ("sflphone-client-gnome");
// Initialises the GNOME libraries // Initialises the GNOME libraries
gnome_program_init ( "sflphone", VERSION, gnome_program_init ("sflphone", VERSION, LIBGNOMEUI_MODULE, argc, argv,
LIBGNOMEUI_MODULE, argc, argv,
GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PROGRAM_STANDARD_PROPERTIES,
NULL) ; NULL) ;
if (sflphone_init ()) if (sflphone_init ())
{ {
#if GTK_CHECK_VERSION(2,10,0)
show_status_icon(); if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0)
#endif statusicon = TRUE;
if (statusicon) show_status_icon ();
create_main_window (); create_main_window ();
#if GTK_CHECK_VERSION(2,10,0) if (statusicon && dbus_is_start_hidden ())
if (dbus_is_start_hidden())
{ {
gtk_widget_hide (GTK_WIDGET( get_main_window() )); gtk_widget_hide (GTK_WIDGET( get_main_window() ));
set_minimized (TRUE); set_minimized (TRUE);
} }
#endif
status_bar_display_account (); status_bar_display_account ();
......
...@@ -47,7 +47,9 @@ GtkWidget * statusBar = NULL; ...@@ -47,7 +47,9 @@ GtkWidget * statusBar = NULL;
GtkWidget * filterEntry = NULL; GtkWidget * filterEntry = NULL;
PidginScrollBook *embedded_error_notebook; PidginScrollBook *embedded_error_notebook;
static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) { static gboolean
window_configure_cb (GtkWidget *win, GdkEventConfigure *event)
{
int pos_x, pos_y; int pos_x, pos_y;
...@@ -61,23 +63,27 @@ static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) { ...@@ -61,23 +63,27 @@ static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) {
return FALSE; return FALSE;
} }
/** /**
* Minimize the main window. * Minimize the main window.
*/ */
static gboolean static gboolean
on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED) on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED)
{ {
#if GTK_CHECK_VERSION(2,10,0)
if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) {
gtk_widget_hide (GTK_WIDGET( get_main_window() )); gtk_widget_hide (GTK_WIDGET( get_main_window() ));
set_minimized (TRUE); set_minimized (TRUE);
#endif }
else {
sflphone_quit ();
}
return TRUE; return TRUE;
} }
/** Ask the user if he wants to hangup current calls */ /** Ask the user if he wants to hangup current calls */
gboolean gboolean
main_window_ask_quit(){ main_window_ask_quit ()
{
guint count = calllist_get_size (current_calls); guint count = calllist_get_size (current_calls);
GtkWidget * dialog; GtkWidget * dialog;
gint response; gint response;
...@@ -93,13 +99,8 @@ main_window_ask_quit(){ ...@@ -93,13 +99,8 @@ main_window_ask_quit(){
} }
dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window), dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window),
GTK_DIALOG_MODAL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s\n%s",
GTK_MESSAGE_QUESTION, question, _("Do you still want to quit?") );
GTK_BUTTONS_YES_NO,
"%s\n%s",
question,
_("Do you still want to quit?") );
response = gtk_dialog_run (GTK_DIALOG (dialog)); response = gtk_dialog_run (GTK_DIALOG (dialog));
...@@ -115,18 +116,16 @@ main_window_ask_quit(){ ...@@ -115,18 +116,16 @@ main_window_ask_quit(){
return TRUE; return TRUE;
} }
static gboolean static gboolean
on_key_released (GtkWidget *widget, GdkEventKey *event, gpointer user_data UNUSED) on_key_released (GtkWidget *widget, GdkEventKey *event, gpointer user_data UNUSED)
{ {
DEBUG("On key released from Main Window : %s", gtk_widget_get_name(widget)); DEBUG("On key released from Main Window : %s", gtk_widget_get_name(widget));
if (focus_is_on_searchbar == FALSE) { if (focus_is_on_searchbar == FALSE)
{
// If a modifier key is pressed, it's a shortcut, pass along // If a modifier key is pressed, it's a shortcut, pass along
if(event->state & GDK_CONTROL_MASK || if (event->state & GDK_CONTROL_MASK || event->state & GDK_MOD1_MASK
event->state & GDK_MOD1_MASK || || event->keyval == 60 || // <
event->keyval == 60 || // <
event->keyval == 62 || // > event->keyval == 62 || // >
event->keyval == 34 || // " event->keyval == 34 || // "
event->keyval == 65289 || // tab event->keyval == 65289 || // tab
...@@ -144,17 +143,18 @@ on_key_released (GtkWidget *widget, GdkEventKey *event, gpointer user_data UNUSE ...@@ -144,17 +143,18 @@ on_key_released (GtkWidget *widget, GdkEventKey *event, gpointer user_data UNUSE
} }
void void
focus_on_mainwindow_out(){ focus_on_mainwindow_out ()
{
// gtk_widget_grab_focus(GTK_WIDGET(window)); // gtk_widget_grab_focus(GTK_WIDGET(window));
} }
void void
focus_on_mainwindow_in(){ focus_on_mainwindow_in ()
{
// gtk_widget_grab_focus(GTK_WIDGET(window)); // gtk_widget_grab_focus(GTK_WIDGET(window));
} }
void void
create_main_window () create_main_window ()
{ {
...@@ -178,8 +178,7 @@ create_main_window () ...@@ -178,8 +178,7 @@ create_main_window ()
gtk_container_set_border_width (GTK_CONTAINER (window), 0); gtk_container_set_border_width (GTK_CONTAINER (window), 0);
gtk_window_set_title (GTK_WINDOW (window), window_title); gtk_window_set_title (GTK_WINDOW (window), window_title);
gtk_window_set_default_size (GTK_WINDOW (window), width, height); gtk_window_set_default_size (GTK_WINDOW (window), width, height);
gtk_window_set_default_icon_from_file (LOGO, gtk_window_set_default_icon_from_file (LOGO, NULL);
NULL);
gtk_window_set_position (GTK_WINDOW( window ), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW( window ), GTK_WIN_POS_MOUSE);
/* Connect the destroy event of the window with our on_destroy function /* Connect the destroy event of the window with our on_destroy function
...@@ -212,46 +211,59 @@ create_main_window () ...@@ -212,46 +211,59 @@ create_main_window ()
} }
/* Create an accel group for window's shortcuts */ /* Create an accel group for window's shortcuts */
gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group (ui_manager)); gtk_window_add_accel_group (GTK_WINDOW(window),
gtk_ui_manager_get_accel_group (ui_manager));
vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/); vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/);
subvbox = gtk_vbox_new (FALSE /*homogeneous*/, 5 /*spacing*/); subvbox = gtk_vbox_new (FALSE /*homogeneous*/, 5 /*spacing*/);
create_menus (ui_manager, &widget); create_menus (ui_manager, &widget);
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/,
0 /*padding*/);
create_toolbar_actions (ui_manager, &widget); create_toolbar_actions (ui_manager, &widget);
// Do not override GNOME user settings // Do not override GNOME user settings
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/,
0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), current_calls->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), current_calls->tree, TRUE /*expand*/,
gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); TRUE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, FALSE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/,
FALSE /*fill*/, 0 /*padding*/);
embedded_error_notebook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new()); embedded_error_notebook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new());
gtk_box_pack_start(GTK_BOX(subvbox), gtk_box_pack_start (GTK_BOX(subvbox), GTK_WIDGET(embedded_error_notebook),
GTK_WIDGET(embedded_error_notebook), FALSE, FALSE, 0); FALSE, FALSE, 0);
if(SHOW_VOLUME){ if (SHOW_VOLUME)
{
speaker_control = create_slider ("speaker"); speaker_control = create_slider ("speaker");
gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (speaker_control); gtk_widget_show_all (speaker_control);
mic_control = create_slider ("mic"); mic_control = create_slider ("mic");
gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (mic_control); gtk_widget_show_all (mic_control);
} }
if(SHOW_DIALPAD){ if (SHOW_DIALPAD)
{
dialpad = create_dialpad (); dialpad = create_dialpad ();
gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (dialpad); gtk_widget_show_all (dialpad);
} }
/* Status bar */ /* Status bar */
statusBar = gtk_statusbar_new (); statusBar = gtk_statusbar_new ();
gtk_box_pack_start (GTK_BOX (vbox), statusBar, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), statusBar, FALSE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_add (GTK_CONTAINER (window), vbox);
/* make sure that everything, window and label, are visible */ /* make sure that everything, window and label, are visible */
...@@ -309,13 +321,12 @@ get_main_window() ...@@ -309,13 +321,12 @@ get_main_window()
} }
void void
main_window_message(GtkMessageType type, gchar * markup){ main_window_message (GtkMessageType type, gchar * markup)
{
GtkWidget * dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(get_main_window()), GtkWidget * dialog = gtk_message_dialog_new_with_markup (
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_WINDOW(get_main_window()), GTK_DIALOG_MODAL
type, | GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_CLOSE, NULL);
GTK_BUTTONS_CLOSE,
NULL);
gtk_window_set_title (GTK_WINDOW(dialog), _("SFLphone Error")); gtk_window_set_title (GTK_WINDOW(dialog), _("SFLphone Error"));
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG(dialog), markup); gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG(dialog), markup);
...@@ -325,43 +336,58 @@ main_window_message(GtkMessageType type, gchar * markup){ ...@@ -325,43 +336,58 @@ main_window_message(GtkMessageType type, gchar * markup){
} }
void void
main_window_error_message(gchar * markup){ main_window_error_message (gchar * markup)
{
main_window_message (GTK_MESSAGE_ERROR, markup); main_window_message (GTK_MESSAGE_ERROR, markup);
} }
void void
main_window_warning_message(gchar * markup){ main_window_warning_message (gchar * markup)
{
main_window_message (GTK_MESSAGE_WARNING, markup); main_window_message (GTK_MESSAGE_WARNING, markup);
} }
void void
main_window_info_message(gchar * markup){ main_window_info_message (gchar * markup)
{
main_window_message (GTK_MESSAGE_INFO, markup); main_window_message (GTK_MESSAGE_INFO, markup);
} }
void main_window_dialpad (gboolean state){ void
main_window_dialpad (gboolean state)
{
g_print ("main_window_dialpad\n"); g_print ("main_window_dialpad\n");
if(state) { if (state)
{
dialpad = create_dialpad (); dialpad = create_dialpad ();
gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (dialpad); gtk_widget_show_all (dialpad);
} else { }
else
{
gtk_container_remove (GTK_CONTAINER (subvbox), dialpad); gtk_container_remove (GTK_CONTAINER (subvbox), dialpad);
} }
} }
void void
main_window_volume_controls( gboolean state ){ main_window_volume_controls (gboolean state)
if(state){ {
if (state)
{
speaker_control = create_slider ("speaker"); speaker_control = create_slider ("speaker");
gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (speaker_control); gtk_widget_show_all (speaker_control);
mic_control = create_slider ("mic"); mic_control = create_slider ("mic");
gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/,
TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (mic_control); gtk_widget_show_all (mic_control);
} else { }
else
{
gtk_container_remove (GTK_CONTAINER(subvbox), speaker_control); gtk_container_remove (GTK_CONTAINER(subvbox), speaker_control);
gtk_container_remove (GTK_CONTAINER(subvbox), mic_control); gtk_container_remove (GTK_CONTAINER(subvbox), mic_control);
} }
...@@ -399,23 +425,35 @@ main_window_zrtp_not_supported(callable_obj_t * c) ...@@ -399,23 +425,35 @@ main_window_zrtp_not_supported(callable_obj_t * c)
gchar* warning_enabled = ""; gchar* warning_enabled = "";
account_details = account_list_get_by_id (c->_accountID); account_details = account_list_get_by_id (c->_accountID);
if(account_details != NULL) { if (account_details != NULL)
warning_enabled = g_hash_table_lookup(account_details->properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING); {
warning_enabled = g_hash_table_lookup (account_details->properties,
ACCOUNT_ZRTP_NOT_SUPP_WARNING);
DEBUG("Warning Enabled %s", warning_enabled); DEBUG("Warning Enabled %s", warning_enabled);
} else { }
else
{
DEBUG("Account is null callID %s", c->_callID); DEBUG("Account is null callID %s", c->_callID);
GHashTable * properties = NULL; GHashTable * properties = NULL;
sflphone_get_ip2ip_properties (&properties); sflphone_get_ip2ip_properties (&properties);
if (properties != NULL) if (properties != NULL)
{ warning_enabled = g_hash_table_lookup(properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING); } {
warning_enabled = g_hash_table_lookup (properties,
ACCOUNT_ZRTP_NOT_SUPP_WARNING);
}
} }
if(g_strcasecmp(warning_enabled,"true") == 0) { if (g_strcasecmp (warning_enabled, "true") == 0)
{
PidginMiniDialog *mini_dialog; PidginMiniDialog *mini_dialog;
gchar *desc = g_markup_printf_escaped(_("ZRTP is not supported by peer %s\n"), c->_peer_number); gchar *desc = g_markup_printf_escaped (
mini_dialog = pidgin_mini_dialog_new(_("Secure Communication Unavailable"), desc, GTK_STOCK_DIALOG_WARNING); _("ZRTP is not supported by peer %s\n"), c->_peer_number);
mini_dialog = pidgin_mini_dialog_new (
_("Secure Communication Unavailable"), desc,
GTK_STOCK_DIALOG_WARNING);
pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL); pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL);
pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, NULL); pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"),
sflphone_hang_up, NULL);
g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c);
...@@ -424,20 +462,28 @@ main_window_zrtp_not_supported(callable_obj_t * c) ...@@ -424,20 +462,28 @@ main_window_zrtp_not_supported(callable_obj_t * c)
} }
void void
main_window_zrtp_negotiation_failed(const gchar* callID, const gchar* reason, const gchar* severity) main_window_zrtp_negotiation_failed (const gchar* callID, const gchar* reason,
const gchar* severity)
{ {
gchar* peer_number = "(number unknown)"; gchar* peer_number = "(number unknown)";
callable_obj_t * c = NULL; callable_obj_t * c = NULL;
c = calllist_get (current_calls, callID); c = calllist_get (current_calls, callID);
if (c != NULL) { if (c != NULL)
{
peer_number = c->_peer_number; peer_number = c->_peer_number;
} }
PidginMiniDialog *mini_dialog; PidginMiniDialog *mini_dialog;
gchar *desc = g_markup_printf_escaped(_("A %s error forced the call with %s to fall under unencrypted mode.\nExact reason: %s\n"), severity, peer_number, reason); gchar
mini_dialog = pidgin_mini_dialog_new(_("ZRTP negotiation failed"), desc, GTK_STOCK_DIALOG_WARNING); *desc =
g_markup_printf_escaped (
_("A %s error forced the call with %s to fall under unencrypted mode.\nExact reason: %s\n"),
severity, peer_number, reason);
mini_dialog = pidgin_mini_dialog_new (_("ZRTP negotiation failed"), desc,
GTK_STOCK_DIALOG_WARNING);
pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL); pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL);
pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, NULL); pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), sflphone_hang_up,
NULL);
g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c);
...@@ -448,13 +494,18 @@ main_window_zrtp_negotiation_failed(const gchar* callID, const gchar* reason, co ...@@ -448,13 +494,18 @@ main_window_zrtp_negotiation_failed(const gchar* callID, const gchar* reason, co
main_window_confirm_go_clear (callable_obj_t * c) main_window_confirm_go_clear (callable_obj_t * c)
{ {
PidginMiniDialog *mini_dialog; PidginMiniDialog *mini_dialog;
gchar *desc = g_markup_printf_escaped(_("%s wants to stop using secure communication. Confirm will resume conversation without SRTP.\n"), c->_peer_number); gchar
mini_dialog = pidgin_mini_dialog_new(_("Confirm Go Clear"), desc, GTK_STOCK_STOP); *desc =
pidgin_mini_dialog_add_button(mini_dialog, _("Confirm"), (PidginMiniDialogCallback)sflphone_set_confirm_go_clear, NULL); g_markup_printf_escaped (
pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, NULL); _("%s wants to stop using secure communication. Confirm will resume conversation without SRTP.\n"),
c->_peer_number);
mini_dialog = pidgin_mini_dialog_new (_("Confirm Go Clear"), desc,
GTK_STOCK_STOP);
pidgin_mini_dialog_add_button (mini_dialog, _("Confirm"),
(PidginMiniDialogCallback) sflphone_set_confirm_go_clear, NULL);
pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), sflphone_hang_up,
NULL);
add_error_dialog (GTK_WIDGET(mini_dialog), c); add_error_dialog (GTK_WIDGET(mini_dialog), c);
} }
...@@ -29,29 +29,35 @@ GtkStatusIcon *status; ...@@ -29,29 +29,35 @@ GtkStatusIcon *status;
GtkWidget *show_menu_item, *hangup_menu_item; GtkWidget *show_menu_item, *hangup_menu_item;
gboolean __minimized = MINIMIZED; gboolean __minimized = MINIMIZED;
void popup_main_window (void) void
popup_main_window(void)
{ {
if (__POPUP_WINDOW) if (__POPUP_WINDOW)
{ {
gtk_widget_show(get_main_window()); gtk_widget_show(get_main_window());
gtk_window_move (GTK_WINDOW (get_main_window ()), dbus_get_window_position_x (), dbus_get_window_position_y ()); gtk_window_move(GTK_WINDOW (get_main_window ()),
dbus_get_window_position_x(), dbus_get_window_position_y());
set_minimized(FALSE); set_minimized(FALSE);
} }
} }
void show_status_hangup_icon() { void
show_status_hangup_icon()
{
if (status) {
DEBUG("Show Hangup in Systray"); DEBUG("Show Hangup in Systray");
gtk_widget_show(GTK_WIDGET(hangup_menu_item)); gtk_widget_show(GTK_WIDGET(hangup_menu_item));
}
} }
void hide_status_hangup_icon() { void
hide_status_hangup_icon()
{
if (status) {
DEBUG("Hide Hangup in Systray"); DEBUG("Hide Hangup in Systray");
gtk_widget_hide(GTK_WIDGET(hangup_menu_item)); gtk_widget_hide(GTK_WIDGET(hangup_menu_item));
} }
}
void void
status_quit(void * foo UNUSED) status_quit(void * foo UNUSED)
...@@ -71,18 +77,20 @@ status_icon_unminimize() ...@@ -71,18 +77,20 @@ status_icon_unminimize()
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE);
} }
gboolean
gboolean main_widget_minimized() main_widget_minimized()
{ {
return __minimized; return __minimized;
} }
void show_hide (void) void
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())); gtk_widget_show(GTK_WIDGET(get_main_window()));
gtk_window_move (GTK_WINDOW (get_main_window ()), dbus_get_window_position_x (), dbus_get_window_position_y ()); gtk_window_move(GTK_WINDOW (get_main_window ()),
dbus_get_window_position_x(), dbus_get_window_position_y());
set_minimized(!MINIMIZED); set_minimized(!MINIMIZED);
} }
else else
...@@ -92,23 +100,23 @@ void show_hide (void) ...@@ -92,23 +100,23 @@ void show_hide (void)
} }
} }
void
void status_click (GtkStatusIcon *status_icon UNUSED, void * foo UNUSED) status_click(GtkStatusIcon *status_icon UNUSED, void * foo UNUSED)
{ {
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item),
!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))); !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item)));
} }
void menu (GtkStatusIcon *status_icon, void
guint button, menu(GtkStatusIcon *status_icon, guint button, guint activate_time,
guint activate_time,
GtkWidget * menu) GtkWidget * menu)
{ {
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, gtk_status_icon_position_menu, gtk_menu_popup(GTK_MENU(menu), NULL, NULL, gtk_status_icon_position_menu,
status_icon, button, activate_time); status_icon, button, activate_time);
} }
GtkWidget* create_menu() GtkWidget*
create_menu()
{ {
GtkWidget * menu; GtkWidget * menu;
GtkWidget * menu_items; GtkWidget * menu_items;
...@@ -116,7 +124,8 @@ GtkWidget* create_menu() ...@@ -116,7 +124,8 @@ GtkWidget* create_menu()
menu = gtk_menu_new(); menu = gtk_menu_new();
show_menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Show main window")); show_menu_item
= gtk_check_menu_item_new_with_mnemonic(_("_Show main window"));
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE);
gtk_menu_shell_append(GTK_MENU_SHELL (menu), show_menu_item); gtk_menu_shell_append(GTK_MENU_SHELL (menu), show_menu_item);
g_signal_connect(G_OBJECT (show_menu_item), "toggled", g_signal_connect(G_OBJECT (show_menu_item), "toggled",
...@@ -134,7 +143,8 @@ GtkWidget* create_menu() ...@@ -134,7 +143,8 @@ GtkWidget* create_menu()
menu_items = gtk_separator_menu_item_new(); menu_items = gtk_separator_menu_item_new();
gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items);
menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_QUIT, get_accel_group()); menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT,
get_accel_group());
g_signal_connect_swapped (G_OBJECT (menu_items), "activate", g_signal_connect_swapped (G_OBJECT (menu_items), "activate",
G_CALLBACK (status_quit), G_CALLBACK (status_quit),
NULL); NULL);
...@@ -159,31 +169,46 @@ show_status_icon() ...@@ -159,31 +169,46 @@ show_status_icon()
statusicon_set_tooltip(); statusicon_set_tooltip();
} }
void statusicon_set_tooltip () { void hide_status_icon (void) {
g_object_unref (status);
status = NULL;
}
void
statusicon_set_tooltip()
{
int count; int count;
gchar *tip; gchar *tip;
// Add a tooltip to the system tray icon // Add a tooltip to the system tray icon
count = account_list_get_registered_accounts(); count = account_list_get_registered_accounts();
tip = g_markup_printf_escaped ("%s - %s" , tip = g_markup_printf_escaped("%s - %s", _("SFLphone"),
_("SFLphone"), g_markup_printf_escaped(
g_markup_printf_escaped(n_("%i active account", "%i active accounts", count),count)); n_("%i active account", "%i active accounts", count), count));
gtk_status_icon_set_tooltip(status, tip); gtk_status_icon_set_tooltip(status, tip);
g_free(tip); g_free(tip);
} }
void
void status_tray_icon_blink (gboolean active) status_tray_icon_blink(gboolean active)
{ {
if (status) {
// Set a different icon to notify of an event // Set a different icon to notify of an event
active ? gtk_status_icon_set_from_file (status, LOGO_NOTIF) : gtk_status_icon_set_from_file (status, LOGO); active ? gtk_status_icon_set_from_file(status, LOGO_NOTIF)
: gtk_status_icon_set_from_file(status, LOGO);
}
} }
void status_tray_icon_online (gboolean online) void
status_tray_icon_online(gboolean online)
{ {
if (status) {
// Set a different icon to notify of an event // Set a different icon to notify of an event
online ? gtk_status_icon_set_from_file (status, LOGO) : gtk_status_icon_set_from_file (status, LOGO_OFFLINE); online ? gtk_status_icon_set_from_file(status, LOGO)
: gtk_status_icon_set_from_file(status, LOGO_OFFLINE);
}
} }
GtkStatusIcon* GtkStatusIcon*
......
...@@ -36,10 +36,16 @@ ...@@ -36,10 +36,16 @@
void popup_main_window (void); void popup_main_window (void);
/** /**
* Create the status icon * Create the system tray icon
*/ */
void show_status_icon (); void show_status_icon ();
/**
* Hide the system tray icon
*/
void hide_status_icon ();
/** /**
* Set the menu active * Set the menu active
*/ */
......
This diff is collapsed.
...@@ -461,6 +461,15 @@ ...@@ -461,6 +461,15 @@
<arg type="i" name="posY" direction="in"/> <arg type="i" name="posY" direction="in"/>
</method> </method>
<method name="enableStatusIcon">
<arg type="s" name="value" direction="in"/>
</method>
<method name="isStatusIconEnabled">
<arg type="s" name="value" direction="out"/>
</method>
<!-- Addressbook configuration --> <!-- Addressbook configuration -->
<method name="getAddressbookSettings"> <method name="getAddressbookSettings">
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/> <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/>
......
...@@ -868,3 +868,13 @@ void ConfigurationManager::setWindowPositionY (const int32_t& posY) { ...@@ -868,3 +868,13 @@ void ConfigurationManager::setWindowPositionY (const int32_t& posY) {
Manager::instance ().setConfig (PREFERENCES, WINDOW_POSITION_Y, posY); Manager::instance ().setConfig (PREFERENCES, WINDOW_POSITION_Y, posY);
} }
void ConfigurationManager::enableStatusIcon (const std::string& value) {
Manager::instance ().setConfig (PREFERENCES, SHOW_STATUSICON, value);
}
std::string ConfigurationManager::isStatusIconEnabled (void) {
return Manager::instance ().getConfigString (PREFERENCES, SHOW_STATUSICON);
}
...@@ -123,6 +123,9 @@ public: ...@@ -123,6 +123,9 @@ public:
void setWindowPositionX (const int32_t& posX); void setWindowPositionX (const int32_t& posX);
void setWindowPositionY (const int32_t& posY); void setWindowPositionY (const int32_t& posY);
void enableStatusIcon (const std::string&);
std::string isStatusIconEnabled (void);
std::map<std::string, int32_t> getAddressbookSettings (void); std::map<std::string, int32_t> getAddressbookSettings (void);
void setAddressbookSettings (const std::map<std::string, int32_t>& settings); void setAddressbookSettings (const std::map<std::string, int32_t>& settings);
std::vector< std::string > getAddressbookList ( void ); std::vector< std::string > getAddressbookList ( void );
......
This diff is collapsed.
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
#define WINDOW_HEIGHT "Window.height" #define WINDOW_HEIGHT "Window.height"
#define WINDOW_POSITION_X "Window.positionX" #define WINDOW_POSITION_X "Window.positionX"
#define WINDOW_POSITION_Y "Window.positionY" #define WINDOW_POSITION_Y "Window.positionY"
#define SHOW_STATUSICON "Statusicon.show"
#define IP2IP_PROFILE "IP2IP" #define IP2IP_PROFILE "IP2IP"
#define SIGNALISATION "VoIPLink" /** Section Signalisation */ #define SIGNALISATION "VoIPLink" /** Section Signalisation */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment