pidgin/purple-plugin-pack

Some tweaks.
org.guifications.plugins.smartear
2007-08-06, rekkanoryo
a994fef3f2ac
Parents 2ea1c4d0f106
Children 213821553f1a
Some tweaks.
--- a/plonkers/plonkers.c Sun Jul 08 07:03:48 2007 -0400
+++ b/plonkers/plonkers.c Mon Aug 06 18:20:10 2007 -0400
@@ -80,9 +80,9 @@
}
plonkers_str = g_string_new("");
if (plonkers_size == 1) {
- format = g_strdup(purple_prefs_get_string("/plugins/core/plugin_pack/plonkers/plonkers/format_singular"));
+ format = g_strdup(purple_prefs_get_string("/plugins/core/plonkers/plonkers/format_singular"));
} else {
- format = g_strdup(purple_prefs_get_string("/plugins/core/plugin_pack/plonkers/plonkers/format_plural"));
+ format = g_strdup(purple_prefs_get_string("/plugins/core/plonkers/plonkers/format_plural"));
}
while(format) {
@@ -232,18 +232,18 @@
frame = pidgin_make_frame(vbox, "Ignored Plonkers");
pidgin_prefs_labeled_entry(frame, "Plonkers singular format:",
- "/plugins/core/plugin_pack/plonkers/plonkers/format_singular",
+ "/plugins/core/plonkers/plonkers/format_singular",
NULL);
pidgin_prefs_labeled_entry(frame, "Plonkers plural format:",
- "/plugins/core/plugin_pack/plonkers/plonkers/format_plural",
+ "/plugins/core/plonkers/plonkers/format_plural",
NULL);
frame = pidgin_make_frame(vbox, "Plonking");
pidgin_prefs_labeled_entry(frame, "Plonked singular plural:",
- "/plugins/core/plugin_pack/plonkers/plonked/format_singular",
+ "/plugins/core/plonkers/plonked/format_singular",
NULL);
pidgin_prefs_labeled_entry(frame, "Plonked plural format:",
- "/plugins/core/plugin_pack/plonkers/plonked/format_plural",
+ "/plugins/core/plonkers/plonked/format_plural",
NULL);
sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -299,19 +299,20 @@
static void
init_plugin(PurplePlugin *plugin) {
- purple_prefs_add_none("/plugins/core/plugin_pack");
- purple_prefs_add_none("/plugins/core/plugin_pack/plonkers");
- purple_prefs_add_none("/plugins/core/plugin_pack/plonkers/plonkers");
- purple_prefs_add_string("/plugins/core/plugin_pack/plonkers/plonkers/format_singular",
- "/me has identified %N plonker: %P.");
- purple_prefs_add_string("/plugins/core/plugin_pack/plonkers/plonkers/format_plural",
- "/me has identified %N plonkers: %P.");
- purple_prefs_add_none("/plugins/core/plugin_pack/plonkers/plonked");
- purple_prefs_add_string("/plugins/core/plugin_pack/plonkers/plonked/format_singular",
- "/me plonks: %P.");
- purple_prefs_add_string("/plugins/core/plugin_pack/plonkers/plonked/format_plural",
- "/me plonks: %P.");
+ purple_prefs_add_none("/plugins/core/plonkers");
+ purple_prefs_add_none("/plugins/core/plonkers/plonkers");
+ purple_prefs_add_string("/plugins/core/plonkers/plonkers/format_singular",
+ "/me has identified %N plonker: %P.");
+ purple_prefs_add_string("/plugins/core/plonkers/plonkers/format_plural",
+ "/me has identified %N plonkers: %P.");
+ purple_prefs_add_none("/plugins/core/plonkers/plonked");
+ purple_prefs_add_string("/plugins/core/plonkers/plonked/format_singular",
+ "/me plonks: %P.");
+ purple_prefs_add_string("/plugins/core/plonkers/plonked/format_plural",
+ "/me plonks: %P.");
+ purple_prefs_rename("/plugins/core/plugin_pack/plonkers",
+ "/plugins/core/plonkers");
}
static PidginPluginUiInfo ui_info = {
--- a/smartear/smartear.c Sun Jul 08 07:03:48 2007 -0400
+++ b/smartear/smartear.c Mon Aug 06 18:20:10 2007 -0400
@@ -86,10 +86,16 @@
static const char *
smartear_sound_get_default(SmartEarEvent event)
{
- /* TODO: Finish me! */
-#warning Finish me!!!
+ const char *prefname = NULL, *prefval = NULL;
+ char *prefpath = NULL;
- return NULL;
+ prefname = smartear_event_get_setting_string(event);
+ prefpath = g_strdup_printf("/plugins/core/smartear/%s", prefname);
+ prefval = purple_prefs_get_string(prefpath);
+
+ g_free(prefpath);
+
+ return prefval;
}
static const char *
@@ -98,11 +104,11 @@
const char *pfile = NULL;
/* if the string is "(Default)" then set the pointer to NULL */
- if(!g_ascii_strcmp(bfile, "(Default)"))
+ if(!g_ascii_strcasecmp(bfile, "(Default)"))
bfile = NULL;
- if(!g_ascii_strcmp(cfile, "(Default)"))
+ if(!g_ascii_strcasecmp(cfile, "(Default)"))
cfile = NULL;
- if(!g_ascii_strcmp(gfile, "(Default)"))
+ if(!g_ascii_strcasecmp(gfile, "(Default)"))
gfile = NULL;
/* determine the sound to play - if the pointer is NULL, try falling back
@@ -125,7 +131,7 @@
static void
smartear_sound_play(PurpleBuddy *buddy, PurpleAccount *account, SmartEarEvent event)
{
- char *bfile = NULL, *cfile = NULL, *gfile = NULL, pfile = NULL, setting = NULL;
+ const char *bfile = NULL, *cfile = NULL, *gfile = NULL, *pfile = NULL, *setting = NULL;
PurpleBlistNode *bnode = (PurpleBlistNode *)buddy,
*cnode = (PurpleBlistNode *)(bnode->parent),
*gnode = (PurpleBlistNode *)(cnode->parent);
@@ -243,7 +249,7 @@
NULL, /* reserved 2 */
NULL, /* reserved 3 */
NULL /* reserved 4 */
-}
+};
static void
smartear_init(PurplePlugin *plugin)
@@ -253,9 +259,9 @@
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
#endif
- info.name = _("Smart Ear - Hidden Core Plugin");
- info.summary = _("The Core component of the Smart Ear plugins");
- info.description = _("The Core component of the Smart Ear plugins");
+ smartear_info.name = _("Smart Ear - Hidden Core Plugin");
+ smartear_info.summary = _("The Core component of the Smart Ear plugins");
+ smartear_info.description = _("The Core component of the Smart Ear plugins");
}
PURPLE_INIT_PLUGIN(smartear, smartear_init, smartear_info)