From 53d520814f787ccf40a45604cac3120757b6b4e1 Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Mon, 28 Apr 2008 12:25:09 -0400
Subject: [PATCH] Launch account assistant from the main menu + translation

---
 po/es.po                      |  4 ++++
 po/fr.po                      |  8 ++++++--
 po/sflphone.pot               |  4 ++++
 sflphone-gtk/src/assistant.c  |  1 +
 sflphone-gtk/src/mainwindow.c |  1 +
 sflphone-gtk/src/menus.c      | 15 +++++++++++++++
 6 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/po/es.po b/po/es.po
index 0dd48be080..2c6cdd8ba2 100644
--- a/po/es.po
+++ b/po/es.po
@@ -59,6 +59,10 @@ msgstr "_Sostener"
 msgid "_Call"
 msgstr "_Llamar"
 
+#: sflphone-gtk/src/menus.c: 270
+msgid "_Account Assistant"
+msgstr ""
+
 #: sflphone-gtk/src/menus.c: 423
 msgid "_Accounts"
 msgstr "_Cuentas"
diff --git a/po/fr.po b/po/fr.po
index 7ca4057100..2beb3d9eb8 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -59,6 +59,10 @@ msgstr "_Mettre en attente"
 msgid "_Call"
 msgstr "_Actions"
 
+#: sflphone-gtk/src/menus.c: 270
+msgid "_Account Assistant"
+msgstr "_Assistant SFLphone"
+
 #: sflphone-gtk/src/menus.c: 423
 msgid "_Accounts"
 msgstr "Co_mptes"
@@ -401,7 +405,7 @@ msgstr[1] "SFLphone - %i comptes enregistrés"
 
 #: sflphone-gtk/src/assistant.c: 91
 msgid "SFLphone account configuration wizard"
-msgstr " Assistant de configuration de compte pour SFLphone"
+msgstr "Assistant de configuration de compte"
 
 #: sflphone-gtk/src/assistant.c: 122
 msgid "Welcome to SFLphone!"
@@ -433,7 +437,7 @@ msgstr "Configuration d'un compte IAX2"
 
 #: sflphone-gtk/src/assistant.c: 256
 msgid "You should probably enable this if you are behind a firewall."
-msgstr "Vous devriez probablement activer cette option si vous vous trouvez derrière un pare-feu."
+msgstr "Vous devriez probablement activer cette option si \nvous vous trouvez derrière un pare-feu."
 
 #: sflphone-gtk/src/assistant.c: 289
 msgid "Account Registration"
diff --git a/po/sflphone.pot b/po/sflphone.pot
index 5412029b89..95a0deb37b 100644
--- a/po/sflphone.pot
+++ b/po/sflphone.pot
@@ -57,6 +57,10 @@ msgstr ""
 msgid "_Call"
 msgstr ""
 
+#: sflphone-gtk/src/menus.c: 270
+msgid "_Account Assistant"
+msgstr ""
+
 #: sflphone-gtk/src/menus.c: 423
 msgid "_Accounts"
 msgstr ""
diff --git a/sflphone-gtk/src/assistant.c b/sflphone-gtk/src/assistant.c
index 36cb96a521..a318f0d1ad 100644
--- a/sflphone-gtk/src/assistant.c
+++ b/sflphone-gtk/src/assistant.c
@@ -90,6 +90,7 @@ build_wizard( void )
   wiz->assistant = gtk_assistant_new( );
   gtk_window_set_title( GTK_WINDOW(wiz->assistant), _("SFLphone account configuration wizard") );
   gtk_window_set_position(GTK_WINDOW(wiz->assistant), GTK_WIN_POS_CENTER);
+  gtk_window_set_default_size(GTK_WINDOW(wiz->assistant), 200 , 200);
   gtk_assistant_set_forward_page_func( GTK_ASSISTANT( wiz->assistant ), (GtkAssistantPageFunc) forward_page_func , NULL , NULL );
 
   build_intro();
diff --git a/sflphone-gtk/src/mainwindow.c b/sflphone-gtk/src/mainwindow.c
index 59184257fd..2796d6f518 100644
--- a/sflphone-gtk/src/mainwindow.c
+++ b/sflphone-gtk/src/mainwindow.c
@@ -125,6 +125,7 @@ create_main_window ()
   gtk_window_set_default_size (GTK_WINDOW (window), 230, 320);
   gtk_window_set_default_icon_from_file (ICON_DIR "/sflphone.png", 
                                           NULL);
+  gtk_window_set_position( GTK_WINDOW( window ) , GTK_WIN_POS_MOUSE);
 
   /* Connect the destroy event of the window with our on_destroy function
     * When the window is about to be destroyed we get a notificaiton and
diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c
index 163cbf908b..fec4bcb5f1 100644
--- a/sflphone-gtk/src/menus.c
+++ b/sflphone-gtk/src/menus.c
@@ -212,6 +212,12 @@ call_hang_up ( void * foo)
   sflphone_hang_up();
 }
 
+  static void 
+call_wizard ( void * foo)
+{
+  build_wizard();
+}
+
   GtkWidget * 
 create_call_menu()
 {
@@ -261,6 +267,15 @@ create_call_menu()
   menu_items = gtk_separator_menu_item_new ();
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
 
+  menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Account Assistant"));
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
+  g_signal_connect_swapped( G_OBJECT( menu_items ) , "activate" , G_CALLBACK( call_wizard  ) , 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);
-- 
GitLab