#include <stdlib.h>
#include <errno.h>
+#include <string.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <libempathy-gtk/empathy-conf.h>
+#include "empathy-accounts-dialog.h"
#include "empathy-main-window.h"
#include "empathy-status-icon.h"
#include "empathy-call-window.h"
g_object_unref (tp_chat);
}
else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) {
- GtkWidget *window;
-
- window = empathy_call_window_find (channel);
- if (window) {
- gtk_window_present (GTK_WINDOW (window));
- } else {
- empathy_call_window_new (channel);
- }
+ empathy_call_window_new (channel);
}
+
+ g_free (channel_type);
}
static void
switch (error_code) {
case MC_DISCONNECTED_ERROR:
- message = _("Disconnected");
+ message = "Disconnected";
break;
case MC_INVALID_HANDLE_ERROR:
- message = _("Invalid handle");
+ message = "Invalid handle";
break;
case MC_NO_MATCHING_CONNECTION_ERROR:
- message = _("No matching connection");
+ message = "No matching connection";
break;
case MC_INVALID_ACCOUNT_ERROR:
- message = _("Invalid account");
+ message = "Invalid account";
break;
case MC_PRESENCE_FAILURE_ERROR:
- message = _("Presence failure");
+ message = "Presence failure";
break;
case MC_NO_ACCOUNTS_ERROR:
- message = _("No accounts");
+ message = "No accounts";
break;
case MC_NETWORK_ERROR:
- message = _("Network error");
+ message = "Network error";
break;
case MC_CONTACT_DOES_NOT_SUPPORT_VOICE_ERROR:
- message = _("Contact does not support voice");
+ message = "Contact does not support voice";
break;
case MC_LOWMEM_ERROR:
- message = _("Lowmem");
+ message = "Lowmem";
break;
case MC_CHANNEL_REQUEST_GENERIC_ERROR:
- message = _("Channel request generic error");
+ message = "Channel request generic error";
break;
case MC_CHANNEL_BANNED_ERROR:
- message = _("Channel banned");
+ message = "Channel banned";
break;
case MC_CHANNEL_FULL_ERROR:
- message = _("Channel full");
+ message = "Channel full";
break;
case MC_CHANNEL_INVITE_ONLY_ERROR:
- message = _("Channel invite only");
+ message = "Channel invite only";
break;
default:
- message = _("Unknown error code");
+ message = "Unknown error code";
}
DEBUG ("Error during operation %d: %s", operation_id, message);
DEBUG ("Other instance launched, presenting the main window. message='%s'",
message);
- startup_timestamp = atoi (message);
-
- /* Set the proper interaction time on the window.
- * Fall back to roundtripping to the X server when we
- * don't have the timestamp, e.g. when launched from
- * terminal. We also need to make sure that the window
- * has been realized otherwise it will not work. lame. */
- if (startup_timestamp == 0) {
- /* Work if launched from the terminal */
- DEBUG ("Using X server timestamp as a fallback");
+ if (strcmp (message, "accounts") == 0) {
+ /* accounts dialog requested */
+ empathy_accounts_dialog_show (GTK_WINDOW (window), NULL);
+ } else {
+ startup_timestamp = atoi (message);
+
+ /* Set the proper interaction time on the window.
+ * Fall back to roundtripping to the X server when we
+ * don't have the timestamp, e.g. when launched from
+ * terminal. We also need to make sure that the window
+ * has been realized otherwise it will not work. lame. */
+ if (startup_timestamp == 0) {
+ /* Work if launched from the terminal */
+ DEBUG ("Using X server timestamp as a fallback");
+
+ if (!GTK_WIDGET_REALIZED (window)) {
+ gtk_widget_realize (GTK_WIDGET (window));
+ }
- if (!GTK_WIDGET_REALIZED (window)) {
- gtk_widget_realize (GTK_WIDGET (window));
+ startup_timestamp = gdk_x11_get_server_time (window->window);
}
- startup_timestamp = gdk_x11_get_server_time (window->window);
+ gtk_window_present_with_time (GTK_WINDOW (window), startup_timestamp);
}
-
- gtk_window_present_with_time (GTK_WINDOW (window), startup_timestamp);
}
static guint32
EmpathyIdle *idle;
gboolean autoconnect = TRUE;
gboolean no_connect = FALSE;
+ gboolean hide_contact_list = FALSE;
+ gboolean accounts_dialog = FALSE;
GError *error = NULL;
GOptionEntry options[] = {
{ "no-connect", 'n',
0, G_OPTION_ARG_NONE, &no_connect,
N_("Don't connect on startup"),
NULL },
+ { "hide-contact-list", 'h',
+ 0, G_OPTION_ARG_NONE, &hide_contact_list,
+ N_("Don't show the contact list on startup"),
+ NULL },
+ { "accounts", 'a',
+ 0, G_OPTION_ARG_NONE, &accounts_dialog,
+ N_("Show the accounts dialog"),
+ NULL },
{ NULL }
};
if (!bacon_message_connection_get_is_server (connection)) {
gchar *message;
- DEBUG ("Activating existing instance");
+ if (accounts_dialog) {
+ DEBUG ("Showing accounts dialog from existing Empathy instance");
+
+ message = g_strdup ("accounts");
+
+ } else {
+
+ DEBUG ("Activating existing instance");
+
+ message = g_strdup_printf ("%" G_GUINT32_FORMAT,
+ startup_timestamp);
+ }
- message = g_strdup_printf ("%" G_GUINT32_FORMAT,
- startup_timestamp);
bacon_message_connection_send (connection, message);
/* We never popup a window, so tell startup-notification
G_CALLBACK (operation_error_cb),
NULL);
+ if (accounts_dialog) {
+ GtkWidget *dialog;
+
+ dialog = empathy_accounts_dialog_show (NULL, NULL);
+ g_signal_connect (dialog, "destroy",
+ G_CALLBACK (gtk_main_quit),
+ NULL);
+
+ gtk_main ();
+ return 0;
+ }
+
/* Setting up Idle */
idle = empathy_idle_new ();
empathy_idle_set_auto_away (idle, TRUE);
/* Setting up UI */
window = empathy_main_window_show ();
- icon = empathy_status_icon_new (GTK_WINDOW (window));
+ icon = empathy_status_icon_new (GTK_WINDOW (window), hide_contact_list);
if (connection) {
/* We se the callback here because we need window */