aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-05-14 19:25:56 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-14 19:25:56 +0800
commitbc3fac61996f1b403df48bf59826a38540b5d4c2 (patch)
tree59f5f2a590e75706183fa93356172cd0b4ce9764 /src
parent3bb247b7f7eaa730a9f6cdc22ace430dba57ecd8 (diff)
downloadgsoc2013-empathy-bc3fac61996f1b403df48bf59826a38540b5d4c2.tar
gsoc2013-empathy-bc3fac61996f1b403df48bf59826a38540b5d4c2.tar.gz
gsoc2013-empathy-bc3fac61996f1b403df48bf59826a38540b5d4c2.tar.bz2
gsoc2013-empathy-bc3fac61996f1b403df48bf59826a38540b5d4c2.tar.lz
gsoc2013-empathy-bc3fac61996f1b403df48bf59826a38540b5d4c2.tar.xz
gsoc2013-empathy-bc3fac61996f1b403df48bf59826a38540b5d4c2.tar.zst
gsoc2013-empathy-bc3fac61996f1b403df48bf59826a38540b5d4c2.zip
po/POTFILES.in
2006-05-14 Xavier Claessens <xclaesse@gmail.com> * src/empathy-chat-main.c: * src/Makefile.am: * src/empathy-main.c: * po/POTFILES.in * po/LINGUAS: * TODO: Setting up i18n support. * po/Makefile.in.in: Removed, it's generated at build time. svn path=/trunk/; revision=62
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am7
-rw-r--r--src/empathy-chat-main.c36
-rw-r--r--src/empathy-main.c61
3 files changed, 84 insertions, 20 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 40f9e7d1e..05bc6f55a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,9 @@
cppflags = \
- -I. \
- -I$(top_srcdir) \
+ -I$(top_srcdir) \
+ -DPREFIX="\"$(prefix)"\" \
+ -DSYSCONFDIR=\""$(sysconfdir)"\" \
+ -DDATADIR=\""$(datadir)"\" \
+ -DLIBDIR=\""$(libdir)"\" \
$(EMPATHY_CFLAGS) \
$(WARN_CFLAGS)
diff --git a/src/empathy-chat-main.c b/src/empathy-chat-main.c
index 5c3478435..fedc9066a 100644
--- a/src/empathy-chat-main.c
+++ b/src/empathy-chat-main.c
@@ -25,8 +25,12 @@
#include <stdlib.h>
#include <glib.h>
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <libgnome/gnome-program.h>
+#include <libgnomeui/gnome-ui-init.h>
+
#include <libtelepathy/tp-conn.h>
#include <libtelepathy/tp-chan.h>
#include <libmissioncontrol/mc-account.h>
@@ -38,6 +42,7 @@
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-tp-chat.h>
+#include <libempathy/gossip-paths.h>
#include <libempathy-gtk/gossip-private-chat.h>
#define DEBUG_DOMAIN "ChatMain"
@@ -49,9 +54,9 @@
#define EXIT_TIMEOUT 5
-static guint chat_count = 0;
-static guint exit_timeout = 0;
-
+static guint chat_count = 0;
+static guint exit_timeout = 0;
+static gboolean debug_mode = FALSE;
static gboolean
exit_timeout_cb (gpointer user_data)
@@ -66,7 +71,7 @@ exit_timeout_cb (gpointer user_data)
static void
exit_timeout_start (void)
{
- if (exit_timeout) {
+ if (exit_timeout || debug_mode) {
return;
}
@@ -163,8 +168,26 @@ int
main (int argc, char *argv[])
{
EmpathyChandler *chandler;
+ GnomeProgram *program;
+ gchar *localedir;
+
+ localedir = gossip_paths_get_locale_path ();
+ bindtextdomain (GETTEXT_PACKAGE, localedir);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+ g_free (localedir);
+
+ program = gnome_program_init ("empathy-chat",
+ PACKAGE_VERSION,
+ LIBGNOMEUI_MODULE,
+ argc, argv,
+ GNOME_PROGRAM_STANDARD_PROPERTIES,
+ GNOME_PARAM_HUMAN_READABLE_NAME, PACKAGE_NAME,
+ NULL);
- gtk_init (&argc, &argv);
+ if (g_getenv ("EMPATHY_DEBUG")) {
+ debug_mode = TRUE;
+ }
exit_timeout_start ();
chandler = empathy_chandler_new (BUS_NAME, OBJECT_PATH);
@@ -175,6 +198,9 @@ main (int argc, char *argv[])
gtk_main ();
+ g_object_unref (program);
+ g_object_unref (chandler);
+
return EXIT_SUCCESS;
}
diff --git a/src/empathy-main.c b/src/empathy-main.c
index 8dcc52c4b..0804fe817 100644
--- a/src/empathy-main.c
+++ b/src/empathy-main.c
@@ -25,8 +25,12 @@
#include <stdlib.h>
#include <glib.h>
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <libgnome/gnome-program.h>
+#include <libgnomeui/gnome-ui-init.h>
+
#include <libmissioncontrol/mc-account.h>
#include <libmissioncontrol/mc-account-monitor.h>
#include <libmissioncontrol/mission-control.h>
@@ -34,6 +38,7 @@
#include <libempathy/gossip-debug.h>
#include <libempathy/gossip-utils.h>
#include <libempathy/gossip-presence.h>
+#include <libempathy/gossip-paths.h>
#include <libempathy-gtk/empathy-main-window.h>
#include <libempathy-gtk/empathy-status-icon.h>
@@ -41,16 +46,16 @@
#define DEBUG_DOMAIN "EmpathyMain"
-static void error_cb (MissionControl *mc,
- GError *error,
- gpointer data);
-static void service_ended_cb (MissionControl *mc,
- gpointer user_data);
-static void operation_error_cb (MissionControl *mc,
- guint operation_id,
- guint error_code,
- gpointer user_data);
-static void start_mission_control (MissionControl *mc);
+static void error_cb (MissionControl *mc,
+ GError *error,
+ gpointer data);
+static void service_ended_cb (MissionControl *mc,
+ gpointer user_data);
+static void operation_error_cb (MissionControl *mc,
+ guint operation_id,
+ guint error_code,
+ gpointer user_data);
+static void start_mission_control (MissionControl *mc);
static void
error_cb (MissionControl *mc,
@@ -130,11 +135,37 @@ main (int argc, char *argv[])
MissionControl *mc;
McAccountMonitor *monitor;
EmpathyFilter *filter;
-
- gtk_init (&argc, &argv);
+ gchar *localedir;
+ GnomeProgram *program;
+ gboolean no_connect = FALSE;
+ GOptionContext *context;
+ GOptionEntry options[] = {
+ { "no-connect", 'n',
+ 0, G_OPTION_ARG_NONE, &no_connect,
+ N_("Don't connect on startup"),
+ NULL },
+ };
+
+ localedir = gossip_paths_get_locale_path ();
+ bindtextdomain (GETTEXT_PACKAGE, localedir);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+ g_free (localedir);
+
+ context = g_option_context_new (_("- Empathy Instant Messenger"));
+ g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
g_set_application_name (PACKAGE_NAME);
+ program = gnome_program_init ("empathy",
+ PACKAGE_VERSION,
+ LIBGNOMEUI_MODULE,
+ argc, argv,
+ GNOME_PROGRAM_STANDARD_PROPERTIES,
+ "goption-context", context,
+ GNOME_PARAM_HUMAN_READABLE_NAME, PACKAGE_NAME,
+ NULL);
+
/* Setting up channel filter */
filter = empathy_filter_new ();
g_signal_connect (filter, "new-channel",
@@ -153,7 +184,10 @@ main (int argc, char *argv[])
g_signal_connect (mc, "Error",
G_CALLBACK (operation_error_cb),
NULL);
- start_mission_control (mc);
+
+ if (!no_connect) {
+ start_mission_control (mc);
+ }
/* Setting up UI */
window = empathy_main_window_show ();
@@ -168,6 +202,7 @@ main (int argc, char *argv[])
g_object_unref (monitor);
g_object_unref (mc);
g_object_unref (icon);
+ g_object_unref (program);
return EXIT_SUCCESS;
}