aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog11
-rw-r--r--TODO1
-rw-r--r--po/LINGUAS3
-rw-r--r--po/Makefile.in.in218
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/Makefile.am7
-rw-r--r--src/empathy-chat-main.c36
-rw-r--r--src/empathy-main.c61
8 files changed, 99 insertions, 239 deletions
diff --git a/ChangeLog b/ChangeLog
index e32e05793..a032132ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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.
+
2006-05-13 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/gossip-account-widget-jabber.glade: Add an example
diff --git a/TODO b/TODO
index 40c8eb2c9..9c39a4226 100644
--- a/TODO
+++ b/TODO
@@ -5,7 +5,6 @@ Things you can do if you want to help:
- Make a EmpathyTpChatroom object inherited from EmpathyTpChat and adding support for topic, invite, members list, etc.
- Porting various UI widgets from gossip to libempathy-gtk for contact info, adding contact, personal info, etc.
- GtkWidget-ify gossip widgets imported in libempathy-gtk. Actually most window/dialog do not inherit from GtkWindow/GtkDialog...
- - Set up the translation system and import po files from gossip? Or re-translate everything?
- Fix setting subscription for contacts in EmpathyContactList.
- Write a MC plugin to filter channels before dispatching them. For example we need a GtkStatusIcon that blink when an event arrives (text/voip/ft channel) and tells the MC to dispatch the channel only when the user clicked the icon. Like in gossip.
- Make use of NetworkManager and gnome-screensaver to set the presence
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 000000000..5add6c1d6
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,3 @@
+# please keep this list sorted alphabetically
+sv
+
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
deleted file mode 100644
index 40c8833ac..000000000
--- a/po/Makefile.in.in
+++ /dev/null
@@ -1,218 +0,0 @@
-# Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-#
-# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
-# instead of PACKAGE and to look for po2tbl in ./ not in intl/
-#
-# - Modified by jacob berkman <jacob@ximian.com> to install
-# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
-#
-# - Modified by Rodney Dawes <dobey@novell.com> for use with intltool
-#
-# We have the following line for use by intltoolize:
-# INTLTOOL_MAKEFILE
-
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = @top_builddir@
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datadir = @datadir@
-datarootdir = @datarootdir@
-libdir = @libdir@
-DATADIRNAME = @DATADIRNAME@
-itlocaledir = $(prefix)/$(DATADIRNAME)/locale
-subdir = po
-install_sh = @install_sh@
-# Automake >= 1.8 provides @mkdir_p@.
-# Until it can be supposed, use the safe fallback:
-mkdir_p = $(install_sh) -d
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
-INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
-INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
-MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
-GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
-
-ALL_LINGUAS = @ALL_LINGUAS@
-
-PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
-
-USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
-
-USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
-
-POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
-
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
-EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
-
-POTFILES = \
-# This comment gets stripped out
-
-CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
-
-.SUFFIXES:
-.SUFFIXES: .po .pox .gmo .mo .msg .cat
-
-.po.pox:
- $(MAKE) $(GETTEXT_PACKAGE).pot
- $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
-
-.po.mo:
- $(MSGFMT) -o $@ $<
-
-.po.gmo:
- file=`echo $* | sed 's,.*/,,'`.gmo \
- && rm -f $$file && $(GMSGFMT) -o $$file $<
-
-.po.cat:
- sed -f ../intl/po2msg.sed < $< > $*.msg \
- && rm -f $@ && gencat $@ $*.msg
-
-
-all: all-@USE_NLS@
-
-all-yes: $(CATALOGS)
-all-no:
-
-$(GETTEXT_PACKAGE).pot: $(POTFILES)
- $(GENPOT)
-
-install: install-data
-install-data: install-data-@USE_NLS@
-install-data-no: all
-install-data-yes: all
- $(mkdir_p) $(DESTDIR)$(itlocaledir)
- linguas="$(USE_LINGUAS)"; \
- for lang in $$linguas; do \
- dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
- $(mkdir_p) $$dir; \
- if test -r $$lang.gmo; then \
- $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
- echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
- else \
- $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
- echo "installing $(srcdir)/$$lang.gmo as" \
- "$$dir/$(GETTEXT_PACKAGE).mo"; \
- fi; \
- if test -r $$lang.gmo.m; then \
- $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
- echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
- else \
- if test -r $(srcdir)/$$lang.gmo.m ; then \
- $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
- $$dir/$(GETTEXT_PACKAGE).mo.m; \
- echo "installing $(srcdir)/$$lang.gmo.m as" \
- "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
- else \
- true; \
- fi; \
- fi; \
- done
-
-# Empty stubs to satisfy archaic automake needs
-dvi info tags TAGS ID:
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall:
- linguas="$(USE_LINGUAS)"; \
- for lang in $$linguas; do \
- rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
- rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
- done
-
-check: all $(GETTEXT_PACKAGE).pot
- rm -f missing notexist
- srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
- if [ -r missing -o -r notexist ]; then \
- exit 1; \
- fi
-
-mostlyclean:
- rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
- rm -f .intltool-merge-cache
-
-clean: mostlyclean
-
-distclean: clean
- rm -f Makefile Makefile.in POTFILES stamp-it
- rm -f *.mo *.msg *.cat *.cat.m *.gmo
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- rm -f Makefile.in.in
-
-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: $(DISTFILES)
- dists="$(DISTFILES)"; \
- extra_dists="$(EXTRA_DISTFILES)"; \
- for file in $$extra_dists; do \
- test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
- done; \
- for file in $$dists; do \
- test -f $$file || file="$(srcdir)/$$file"; \
- ln $$file $(distdir) 2> /dev/null \
- || cp -p $$file $(distdir); \
- done
-
-update-po: Makefile
- $(MAKE) $(GETTEXT_PACKAGE).pot
- tmpdir=`pwd`; \
- linguas="$(USE_LINGUAS)"; \
- for lang in $$linguas; do \
- echo "$$lang:"; \
- result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
- if $$result; then \
- if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
- rm -f $$tmpdir/$$lang.new.po; \
- else \
- if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
- :; \
- else \
- echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
- rm -f $$tmpdir/$$lang.new.po; \
- exit 1; \
- fi; \
- fi; \
- else \
- echo "msgmerge for $$lang.gmo failed!"; \
- rm -f $$tmpdir/$$lang.new.po; \
- fi; \
- done
-
-Makefile POTFILES: stamp-it
- @if test ! -f $@; then \
- rm -f stamp-it; \
- $(MAKE) stamp-it; \
- fi
-
-stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
- $(SHELL) ./config.status
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 60155497b..42d79f7f3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -26,3 +26,4 @@ libempathy-gtk/gossip-presence-chooser.glade
libempathy-gtk/gossip-private-chat.c
libempathy-gtk/gossip-theme-manager.c
+src/empathy-main.c
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;
}