--- a/doc/reference/libpurple/libpurple-docs.xml Fri Dec 15 03:03:21 2017 +0000
+++ b/doc/reference/libpurple/libpurple-docs.xml Fri Dec 15 03:52:01 2017 +0000
@@ -58,6 +58,7 @@
<xi:include href="xml/nat-pmp.xml" />
<xi:include href="xml/network.xml" />
<xi:include href="xml/notify.xml" />
+ <xi:include href="xml/options.xml" /> <xi:include href="xml/plugins.xml" />
<xi:include href="xml/prefs.xml" />
<xi:include href="xml/pluginpref.xml" />
--- a/finch/libfinch.c Fri Dec 15 03:03:21 2017 +0000
+++ b/finch/libfinch.c Fri Dec 15 03:52:01 2017 +0000
@@ -29,6 +29,7 @@
@@ -146,9 +147,6 @@
G_OPTION_ARG_FILENAME, &opt_config_dir_arg,
_("use DIR for config files"), _("DIR")},
- G_OPTION_ARG_NONE, &debug_enabled,
- _("print debugging messages to stderr"), NULL},
G_OPTION_ARG_NONE, &opt_nologin,
_("don't automatically login"), NULL},
@@ -170,6 +168,9 @@
g_option_context_set_summary(context, DISPLAY_VERSION);
g_option_context_add_main_entries(context, option_entries, PACKAGE);
+ g_option_context_add_group(context, purple_get_option_group()); + g_option_context_add_group(context, gplugin_get_option_group()); /* Handle Unicode filenames on Windows. See GOptionContext docs. */
args = g_win32_get_command_line();
--- a/libpurple/meson.build Fri Dec 15 03:03:21 2017 +0000
+++ b/libpurple/meson.build Fri Dec 15 03:52:01 2017 +0000
@@ -39,6 +39,7 @@
@@ -118,6 +119,7 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/options.c Fri Dec 15 03:52:01 2017 +0000
@@ -0,0 +1,96 @@
+ * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +/****************************************************************************** + *****************************************************************************/ +debug_cb(const gchar *option_name, const gchar *value, + gpointer data, GError **error) + purple_debug_set_enabled(TRUE); + if (purple_strequal(value, "colored")) { + purple_debug_set_colored(TRUE); +force_online_cb(const gchar *option_name, const gchar *value, + gpointer data, GError **error) + purple_network_force_online(); +/****************************************************************************** + *****************************************************************************/ + * purple_get_option_group: + * Returns a #GOptionGroup for the commandline arguments recognized by + * LibPurple. You should add this option group to your #GOptionContext with + * g_option_context_add_group(), if you are using g_option_context_parse() to + * parse your commandline arguments. + * Return Value: (transfer full): a #GOptionGroup for the commandline arguments + * recognized by LibPurple. +purple_get_option_group(void) { + GOptionGroup *group = NULL; + GOptionEntry entries[] = { + "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG, + G_OPTION_ARG_CALLBACK, &debug_cb, + _("print debugging messages to stdout"), + "force-online", 'f', 0, + G_OPTION_ARG_NONE, &force_online_cb, + _("force online, regardless of network status"), + group = g_option_group_new( + _("LibPurple options"), + _("Show LibPurple Options"), + g_option_group_add_entries(group, entries); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/options.h Fri Dec 15 03:52:01 2017 +0000
@@ -0,0 +1,42 @@
+ * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +#ifndef PURPLE_OPTIONS_H +#define PURPLE_OPTIONS_H + * @section_id: libpurple-options + * @short_description: <filename>options.h</filename> + * The functions defined here are to help in handling command line options. +GOptionGroup *purple_get_option_group(void); +#endif /* PURPLE_OPTIONS_H */ --- a/pidgin/libpidgin.c Fri Dec 15 03:03:21 2017 +0000
+++ b/pidgin/libpidgin.c Fri Dec 15 03:52:01 2017 +0000
@@ -33,6 +33,7 @@
@@ -375,25 +376,10 @@
purple_blist_set_visible(TRUE);
-static gboolean debug_colored = FALSE;
-static gboolean debug_enabled = FALSE;
static gboolean opt_login = FALSE;
static gchar *opt_login_arg = NULL;
-debug_opt_arg_func(const gchar *option_name, const gchar *value,
- gpointer data, GError **error)
- if (purple_strequal(value, "colored")) {
login_opt_arg_func(const gchar *option_name, const gchar *value,
gpointer data, GError **error)
@@ -408,7 +394,6 @@
int pidgin_start(int argc, char *argv[])
- gboolean opt_force_online = FALSE;
gboolean opt_nologin = FALSE;
gboolean opt_version = FALSE;
gboolean opt_si = TRUE; /* Check for single instance? */
@@ -441,13 +426,6 @@
G_OPTION_ARG_FILENAME, &opt_config_dir_arg,
_("use DIR for config files"), _("DIR")},
- {"debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
- G_OPTION_ARG_CALLBACK, &debug_opt_arg_func,
- _("print debugging messages to stdout"),
- {"force-online", 'f', 0,
- G_OPTION_ARG_NONE, &opt_force_online,
- _("force online, regardless of network status"), NULL},
{"login", 'l', G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_CALLBACK, &login_opt_arg_func,
_("enable specified account(s) (optional argument NAME\n"
@@ -468,11 +446,8 @@
+ purple_debug_set_enabled(TRUE); @@ -594,6 +569,8 @@
g_option_context_add_main_entries(context, option_entries, PACKAGE);
+ g_option_context_add_group(context, purple_get_option_group()); + g_option_context_add_group(context, gplugin_get_option_group()); g_option_context_add_group(context, gtk_get_option_group(TRUE));
@@ -646,11 +623,6 @@
- if (g_getenv("PIDGIN_DEBUG_COLORED") != NULL)
- purple_debug_set_enabled(debug_enabled);
- purple_debug_set_colored(debug_colored);
app = G_APPLICATION(gtk_application_new("im.pidgin.Pidgin",
G_APPLICATION_NON_UNIQUE));
@@ -741,11 +713,6 @@
g_free(opt_config_dir_arg);
opt_config_dir_arg = NULL;
- /* This needs to be before purple_blist_show() so the
- * statusbox gets the forced online status. */
- purple_network_force_online();
* We want to show the blist early in the init process so the
* user feels warm and fuzzy (not cold and prickley).
--- a/po/POTFILES.in Fri Dec 15 03:03:21 2017 +0000
+++ b/po/POTFILES.in Fri Dec 15 03:52:01 2017 +0000
@@ -54,6 +54,7 @@
libpurple/media/backend-fs2.c
libpurple/plugins/autoaccept.c
libpurple/plugins/buddynote.c