]> git.0d.be Git - empathy.git/commitdiff
[darcs-to-svn @ contact list now displays accounts dialog]
authorXavier Claessens <xclaesse@src.gnome.org>
Wed, 2 May 2007 06:13:46 +0000 (06:13 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Wed, 2 May 2007 06:13:46 +0000 (06:13 +0000)
svn path=/trunk/; revision=21

README
accounts/empathy-accounts-main.c
contact-list/empathy-contact-list-main.c
libempathy-gtk/empathy-main-window.c
libempathy-gtk/empathy-main-window.h

diff --git a/README b/README
index db1535d06a9ea088c43a6aeabe061193659ca539..ab94d8f1b8e8da78c492ff4a709637188ae4aa9e 100644 (file)
--- a/README
+++ b/README
@@ -4,15 +4,12 @@ How to use empathy ?
 $ ./autogen
 $ make && make install
 
-2) Setup and enable some accounts
-$ empathy-accounts
-
-3) Start the MC
+2) Start the MC
 $ empathy-launcher
 This will start MC and connect all enabled accounts. If you start a private chat
 or someone is saying something to you, empathy-chat will be started
 automagicaly and display a chat UI for your conversation.
 
-4) To see the contact list
+3) To see the contact list and setting accounts
 $ empathy-contact-list
 
index 10b85a2224c6d5c78001b942fd0bc092f11c361b..e65620342bfcb5ffe915e4df150713e343f184d8 100644 (file)
@@ -48,7 +48,6 @@ main (int argc, char *argv[])
 
        dialog = gossip_accounts_dialog_show ();
 
-       gtk_widget_show (dialog);
        g_signal_connect (dialog, "destroy",
                          G_CALLBACK (destroy_cb),
                          NULL);
index dfa7695e3b9569ce00a937ec2f040c37f02e4466..b43b1c20a60d241b1d7224ecf9b0f70b0f68e3f8 100644 (file)
 #include <glib.h>
 #include <gtk/gtk.h>
 
+#include <libmissioncontrol/mc-account.h>
+
 #include <libempathy/empathy-session.h>
 #include <libempathy-gtk/empathy-main-window.h>
 #include <libempathy-gtk/gossip-stock.h>
+#include <libempathy-gtk/gossip-accounts-dialog.h>
 
 static void
 destroy_cb (GtkWidget *window,
@@ -44,17 +47,24 @@ int
 main (int argc, char *argv[])
 {
        GtkWidget *window;
+       GList     *accounts;
 
        gtk_init (&argc, &argv);
 
-       window = empathy_main_window_new ();
+       window = empathy_main_window_show ();
        gossip_stock_init (window);
 
        g_signal_connect (window, "destroy",
                          G_CALLBACK (destroy_cb),
                          NULL);
 
-       gtk_widget_show (window);
+       /* Show the accounts dialog if there is no enabled accounts */
+       accounts = mc_accounts_list_by_enabled (TRUE);
+       if (accounts) {
+               mc_accounts_list_free (accounts);
+       } else {
+               gossip_accounts_dialog_show ();
+       }
 
        gtk_main ();
 
index 257ade9bd9380e1ba042407e172bd5021d31cab4..f3d3a3add88a412b67d1f89f4195243d2ac73d62 100644 (file)
@@ -39,6 +39,7 @@
 #include "gossip-status-presets.h"
 #include "gossip-geometry.h"
 #include "gossip-preferences.h"
+#include "gossip-accounts-dialog.h"
 
 #define DEBUG_DOMAIN "EmpathyMainWindow"
 
@@ -155,20 +156,25 @@ static void     main_window_notify_compact_contact_list_cb (GossipConf
                                                            EmpathyMainWindow   *window);
 
 GtkWidget *
-empathy_main_window_new (void)
-{
-       EmpathyMainWindow *window;
-       GladeXML          *glade;
-       GossipConf        *conf;
-       GtkWidget         *sw;
-       GtkWidget         *show_offline_widget;
-       GtkWidget         *ebox;
-       GtkToolItem       *item;
-       gchar             *str;
-       gboolean           show_offline;
-       gboolean           show_avatars;
-       gboolean           compact_contact_list;
-       gint               x, y, w, h;
+empathy_main_window_show (void)
+{
+       static EmpathyMainWindow *window = NULL;
+       GladeXML                 *glade;
+       GossipConf               *conf;
+       GtkWidget                *sw;
+       GtkWidget                *show_offline_widget;
+       GtkWidget                *ebox;
+       GtkToolItem              *item;
+       gchar                    *str;
+       gboolean                  show_offline;
+       gboolean                  show_avatars;
+       gboolean                  compact_contact_list;
+       gint                      x, y, w, h;
+
+       if (window) {
+               gtk_window_present (GTK_WINDOW (window->window));
+               return window->window;
+       }
 
        window = g_new0 (EmpathyMainWindow, 1);
 
@@ -332,6 +338,8 @@ empathy_main_window_new (void)
                      "is-compact", compact_contact_list,
                      NULL);
 
+       gtk_widget_show (window->window);
+
        return window->window;
 }
 
@@ -509,7 +517,7 @@ static void
 main_window_edit_accounts_cb (GtkWidget         *widget,
                              EmpathyMainWindow *window)
 {
-       //gossip_accounts_dialog_show (NULL);
+       gossip_accounts_dialog_show ();
 }
 
 static void
@@ -550,7 +558,7 @@ main_window_throbber_button_press_event_cb (GtkWidget      *throbber_ebox,
                return FALSE;
        }
 
-       //gossip_accounts_dialog_show (NULL);
+       gossip_accounts_dialog_show ();
 
        return FALSE;
 }
index 91d2df20542ccdb06e89157010954a0426d6a393..eca78da1e3cd05499faa84c81dcaf1d0bea99730 100644 (file)
@@ -27,7 +27,7 @@
 
 G_BEGIN_DECLS
 
-GtkWidget *empathy_main_window_new (void);
+GtkWidget *empathy_main_window_show (void);
 
 G_END_DECLS