soc.2010.detachablepurple: d407e87d: Added remote mode support to finch (new ...
gillux at soc.pidgin.im
gillux at soc.pidgin.im
Wed Aug 11 15:23:20 EDT 2010
----------------------------------------------------------------------
Revision: d407e87d4303c7db0e638df80a03b4a0f68c001b
Parent: 3174b7bdc08c98205de69bd89a8fdf906753f945
Author: gillux at soc.pidgin.im
Date: 08/11/10 14:24:19
Branch: im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/d407e87d4303c7db0e638df80a03b4a0f68c001b
Changelog:
Added remote mode support to finch (new -r switch).
Changes against parent 3174b7bdc08c98205de69bd89a8fdf906753f945
patched finch/finch.c
-------------- next part --------------
============================================================
--- finch/finch.c e53e67bafb064bd57539c1f5740b3957cca9e02f
+++ finch/finch.c de7e4238378dafc5cdb329d4314c14d8d1b6eb17
@@ -249,6 +249,7 @@ init_libpurple(int argc, char **argv)
int opt;
gboolean opt_help = FALSE;
gboolean opt_nologin = FALSE;
+ gboolean opt_remote = FALSE;
gboolean opt_version = FALSE;
char *opt_config_dir_arg = NULL;
gboolean debug_enabled = FALSE;
@@ -259,6 +260,7 @@ init_libpurple(int argc, char **argv)
{"debug", no_argument, NULL, 'd'},
{"help", no_argument, NULL, 'h'},
{"nologin", no_argument, NULL, 'n'},
+ {"remote", no_argument, NULL, 'r'},
{"version", no_argument, NULL, 'v'},
{0, 0, 0, 0}
};
@@ -277,9 +279,9 @@ init_libpurple(int argc, char **argv)
opterr = 1;
while ((opt = getopt_long(argc, argv,
#ifndef _WIN32
- "c:dhn::v",
+ "c:dhnr::v",
#else
- "c:dhn::v",
+ "c:dhnr::v",
#endif
long_options, NULL)) != -1) {
switch (opt) {
@@ -296,6 +298,9 @@ init_libpurple(int argc, char **argv)
case 'n': /* no autologin */
opt_nologin = TRUE;
break;
+ case 'r': /* remote mode */
+ opt_remote = TRUE;
+ break;
case 'v': /* version */
opt_version = TRUE;
break;
@@ -357,6 +362,16 @@ init_libpurple(int argc, char **argv)
}
}
+ 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. */
+ return 0;
+ }
+ }
+
purple_core_set_ui_ops(gnt_core_get_ui_ops());
purple_eventloop_set_ui_ops(gnt_eventloop_get_ui_ops());
purple_idle_set_ui_ops(finch_idle_get_ui_ops());
More information about the Commits
mailing list