Mercurial > pidgin.yaz
view src/dbus-client.c @ 11307:e1c55e65ab8e
[gaim-migrate @ 13507]
Patch #1262343, from Levi Bard
"Allows you to specify, on a per-rule basis, whether
text replacement rules will apply to all text, or only
to entire words (the current method).
It defaults to the old method unless specified otherwise.
It reads the old-format config files ( ~/.gaim/dict ),
and saves to the new format (which is currently very
similar to the old)."
The configuration file format is compatible in both directions. Obviously, subword replacement won't happen with an old copy of this plugin, but it won't fail parsing the configuration file.
Plus, he found that my logic was backwards in the test that I used to remove the g_assert().
I made a few changes as well. A couple that I remember:
- A number of rules weren't doing anything because the plugin didn't support them. With this patch, they are functional now. I enabled all of them to use subword completion.
- Set a size group on the labels in the prefs frame. That's been driving me nuts for a while.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Fri, 19 Aug 2005 04:30:50 +0000 |
parents | 567998f226c1 |
children |
line wrap: on
line source
/* * gaim * * Gaim is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * source distribution. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* Do not use this program. Use gaim-send instead. */ #define DBUS_API_SUBJECT_TO_CHANGE #include <string.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-bindings.h> #include <glib-object.h> #include "dbus-gaim.h" /* #include "dbus-client-bindings.c" */ int main (int argc, char **argv) { DBusGConnection *connection; DBusGProxy *driver; DBusGProxy *proxy; GError *error; guint32 result; int i; g_type_init (); /* Connecting to dbus */ error = NULL; connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (connection == NULL) { g_assert (error != NULL); g_critical("Failed to open connection to dbuso %s.", error->message); g_error_free(error); return 1; } g_message("Connected to dbus"); /* Create a proxy object for the "bus driver" */ driver = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); /* Activate gaim */ error = NULL; org_freedesktop_DBus_start_service_by_name(driver, DBUS_SERVICE_GAIM, 0, &result, &error); if (error) { g_critical("Failed to activate the gaim object: %s.", error->message); g_clear_error(&error); return 1; } g_message("Gaim object activated"); /* Create a proxy object for gaim */ error = NULL; proxy = dbus_g_proxy_new_for_name_owner (connection, DBUS_SERVICE_GAIM, DBUS_PATH_GAIM, DBUS_INTERFACE_GAIM, &error); if (proxy == NULL) { g_assert(error); g_critical("Failed to create proxy for name owner: %s.\n", error->message); g_clear_error(&error); return 1; } g_message("Gaim proxy created"); /* Processing commands */ for(i=1; i<argc; i++) { gboolean success = TRUE; gchar *command = argv[i]; error = NULL; g_print("Executing command: %s ...\n", command); if (!strcmp(command, "quit")) success = org_gaim_GaimInterface_quit(proxy, &error); else if (!strcmp(command, "ping")) success = org_gaim_GaimInterface_ping (proxy, &error); else if (!strcmp(command, "connect")) success = org_gaim_GaimInterface_connect_all (proxy, &error); else g_print("Unknown command: %s.\n", command); if (!success) g_print ("Command %s failed: %s.\n", command, error->message); g_clear_error(&error); } g_object_unref (G_OBJECT (proxy)); g_object_unref (G_OBJECT (driver)); g_print ("Successfully completed (%s).\n", argv[0]); return 0; }