soc.2010.detachablepurple: 2ed2f00e: Added support for remote mode in Pidgin, ...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Wed Aug 4 07:39:08 EDT 2010


----------------------------------------------------------------------
Revision: 2ed2f00ee919f12aef7f543992a9ab4e3f976b7b
Parent:   820de1e4f017885e00a8bb4ee7abb62984c93e32
Author:   gillux at soc.pidgin.im
Date:     08/01/10 21:22:04
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/2ed2f00ee919f12aef7f543992a9ab4e3f976b7b

Changelog: 

Added support for remote mode in Pidgin, since there are some things to play
with now. On the same machine you can run purpled, and then several
pidgin -m -r, and play with the Accounts window. Account authorization requests
are supported too, though I don't belive the prpls are able to produce any.

Changes against parent 820de1e4f017885e00a8bb4ee7abb62984c93e32

  patched  pidgin/gtkmain.c

-------------- next part --------------
============================================================
--- pidgin/gtkmain.c	6fc981b3afd6c8b92b87e057a42cb53442f098d1
+++ pidgin/gtkmain.c	5b20172aba8c710bed8807511cd9a5a58254f133
@@ -463,6 +463,8 @@ show_usage(const char *name, gboolean te
 				_("display this help and exit"));
 		g_string_append_printf(str, "  -m, --multiple      %s\n",
 				_("allow multiple instances"));
+		g_string_append_printf(str, "  -r, --remote        %s\n",
+				_("run in remote mode"));
 		g_string_append_printf(str, "  -n, --nologin       %s\n",
 				_("don't automatically login"));
 		g_string_append_printf(str, "  -l, --login[=%s]  %s\n",
@@ -536,6 +538,7 @@ int main(int argc, char *argv[])
 	gboolean opt_nologin = FALSE;
 	gboolean opt_version = FALSE;
 	gboolean opt_si = TRUE;     /* Check for single instance? */
+	gboolean opt_remote = FALSE; /* Run in remote mode? */
 	char *opt_config_dir_arg = NULL;
 	char *opt_login_arg = NULL;
 	char *opt_session_arg = NULL;
@@ -568,6 +571,7 @@ int main(int argc, char *argv[])
 		{"help",         no_argument,       NULL, 'h'},
 		{"login",        optional_argument, NULL, 'l'},
 		{"multiple",     no_argument,       NULL, 'm'},
+		{"remote",       no_argument,       NULL, 'r'},
 		{"nologin",      no_argument,       NULL, 'n'},
 		{"session",      required_argument, NULL, 's'},
 		{"version",      no_argument,       NULL, 'v'},
@@ -706,9 +710,9 @@ int main(int argc, char *argv[])
 	opterr = 1;
 	while ((opt = getopt_long(argc, argv,
 #ifndef _WIN32
-				  "c:dfhmnl::s:v",
+				  "c:dfhmrnl::s:v",
 #else
-				  "c:dfhmnl::v",
+				  "c:dfhmrnl::v",
 #endif
 				  long_options, NULL)) != -1) {
 		switch (opt) {
@@ -744,6 +748,9 @@ int main(int argc, char *argv[])
 		case 'm':   /* do not ensure single instance. */
 			opt_si = FALSE;
 			break;
+		case 'r':   /* rune in remote mode */
+			opt_remote = TRUE;
+			break;
 		case 'D':   /* --display */
 		case 'S':   /* --sync */
 			/* handled by gtk_init_check below */
@@ -870,6 +877,19 @@ int main(int argc, char *argv[])
 	g_free(search_path);
 	purple_plugins_add_search_path(LIBDIR);
 
+	if (opt_remote) {
+		/* Activate remote mode */
+		purple_core_set_running_mode(PURPLE_RUN_REMOTE_MODE);
+		if (!purple_core_is_remote_mode()) {
+			/* If we are here, purple already printed an error
+			 * message about what went wrong. */
+#ifdef HAVE_SIGNAL_H
+			g_free(segfault_message);
+#endif
+			return 0;
+		}
+	}
+
 	if (!purple_core_init(PIDGIN_UI)) {
 		fprintf(stderr,
 				"Initialization of the libpurple core failed. Dumping core.\n"


More information about the Commits mailing list