Changeset e3cc7b23a6aba21796577ff44a9a3f9d855080cb

Show
Ignore:
Timestamp:
07/22/09 23:26:25 (3 years ago)
Author:
Leo Antunes <leo@…>
Children:
d1a41d2b9e8293b7310d616fd8ccd24ddf38d9be
Parents:
c5606aa8a15998dd28faee8a3141cb8ac83b8d24
git-committer:
Leo Antunes <leo@…> (07/22/09 23:26:25)
Message:

KScreensaver support + close DBus on load error

- support KScreensaver (thanks Daniel Eckl for pointing out

that it indeed DOES use DBus)

- correct description to include current functionality
- avoid dangling DBus connection on error during load

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rc5606aa re3cc7b2  
     1Version 0.4 (2009-07-22): 
     2 
     3        - support KScreensaver (thanks Daniel Eckl for pointing out 
     4          that it indeed DOES use DBus) 
     5        - correct description to include current functionality 
     6        - avoid dangling DBus connection on error during load 
     7 
    18Version 0.3 (2009-07-19): 
    29 
  • awayonlock.c

    reac542b re3cc7b2  
    2121#define PURPLE_PLUGINS 
    2222 
    23 #define AWAYONLOCK_VERSION "0.3" 
     23#define AWAYONLOCK_VERSION "0.4" 
    2424#define AWAYONLOCK_PLUGIN_ID "core-costela-awayonlock" 
    2525 
     
    4848 
    4949static gboolean plugin_load(PurplePlugin *plugin) { 
     50        DBusGProxy *dbus_proxy_gnome = NULL; 
    5051        DBusGProxy *dbus_proxy = NULL; 
    5152        GError *error = NULL; 
     
    6566 
    6667        /* 
    67          * Gnome-screensaver specific stuff 
    68          */ 
    69         dbus_proxy = dbus_g_proxy_new_for_name( dbus_conn, 
     68         * Gnome-screensaver 2.26 specific stuff 
     69         */ 
     70        dbus_proxy_gnome = dbus_g_proxy_new_for_name( dbus_conn, 
    7071                        "org.gnome.ScreenSaver", 
    7172                        "/org/gnome/ScreenSaver", 
     
    7374                        ); 
    7475 
     76        if(dbus_proxy_gnome == NULL) { 
     77                purple_debug(PURPLE_DEBUG_ERROR, PACKAGE, N_("failed to get DBus proxy\n")); 
     78                purple_notify_error(plugin, "Away-on-lock", _("Failed to create a DBus Proxy."), NULL); 
     79                dbus_g_connection_unref(dbus_conn); 
     80                return FALSE; 
     81        } 
     82 
     83        dbus_g_proxy_add_signal( dbus_proxy_gnome, 
     84                        "ActiveChanged", 
     85                        G_TYPE_BOOLEAN, 
     86                        G_TYPE_INVALID 
     87                        ); 
     88 
     89        dbus_g_proxy_connect_signal( dbus_proxy_gnome, 
     90                        "ActiveChanged", 
     91                        G_CALLBACK(awayonlock_idle_changed_callback), 
     92                        NULL, 
     93                        NULL 
     94                        ); 
     95        /* 
     96         * END Gnome-screensaver specific stuff 
     97         */ 
     98 
     99        /* 
     100         * freedesktop stuff 
     101         */ 
     102        dbus_proxy = dbus_g_proxy_new_for_name( dbus_conn, 
     103                        "org.freedesktop.ScreenSaver", 
     104                        "/ScreenSaver", 
     105                        "org.freedesktop.ScreenSaver" 
     106                        ); 
     107 
    75108        if(dbus_proxy == NULL) { 
    76109                purple_debug(PURPLE_DEBUG_ERROR, PACKAGE, N_("failed to get DBus proxy\n")); 
    77110                purple_notify_error(plugin, "Away-on-lock", _("Failed to create a DBus Proxy."), NULL); 
    78  
     111                dbus_g_connection_unref(dbus_conn); 
    79112                return FALSE; 
    80113        } 
     
    93126                        ); 
    94127        /* 
    95          * END Gnome-screensaver specific stuff 
     128         * END freedesktop stuff 
    96129         */ 
    97130 
     
    156189 
    157190        info.name = _("Away-on-lock"); 
    158         info.summary = _("Sets you as away when your screensaver is activated"); 
    159         info.description = _("This plugin sets your status to the default away status whenever your screensaver gets activated."); 
     191        info.summary = _("Changes your status when your screensaver gets activated"); 
     192        info.description = _("This plugin changes your status to a preselected saved status or the default away status whenever your screensaver gets activated. It doesn't interfere if you're already marked as auto-away and can also avoid changing your status if you've manually marked yourself as any non-available status."); 
    160193        info.author = _("Leo Antunes <leo@costela.net>"); 
    161194 
  • i18n/pidgin-awayonlock.pot

    reac542b re3cc7b2  
    99"Project-Id-Version: PACKAGE VERSION\n" 
    1010"Report-Msgid-Bugs-To: \n" 
    11 "POT-Creation-Date: 2009-07-19 00:16+0200\n" 
     11"POT-Creation-Date: 2009-07-22 23:19+0200\n" 
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
     
    1717"Content-Transfer-Encoding: 8bit\n" 
    1818 
    19 #: awayonlock.c:61 
     19#: awayonlock.c:62 
    2020msgid "Failed to get a DBus connection." 
    2121msgstr "" 
    2222 
    23 #: awayonlock.c:77 
     23#: awayonlock.c:78 awayonlock.c:110 
    2424msgid "Failed to create a DBus Proxy." 
    2525msgstr "" 
    2626 
    27 #: awayonlock.c:157 
     27#: awayonlock.c:190 
    2828msgid "Away-on-lock" 
    2929msgstr "" 
    3030 
    31 #: awayonlock.c:158 
    32 msgid "Sets you as away when your screensaver is activated" 
     31#: awayonlock.c:191 
     32msgid "Changes your status when your screensaver gets activated" 
    3333msgstr "" 
    3434 
    35 #: awayonlock.c:159 
     35#: awayonlock.c:192 
    3636msgid "" 
    37 "This plugin sets your status to the default away status whenever your " 
    38 "screensaver gets activated." 
     37"This plugin changes your status to a preselected saved status or the default " 
     38"away status whenever your screensaver gets activated. It doesn't interfere " 
     39"if you're already marked as auto-away and can also avoid changing your " 
     40"status if you've manually marked yourself as any non-available status." 
    3941msgstr "" 
    4042 
    41 #: awayonlock.c:160 
     43#: awayonlock.c:193 
    4244msgid "Leo Antunes <leo@costela.net>" 
    4345msgstr "" 
  • i18n/pt_BR.po

    reac542b re3cc7b2  
    1616"Project-Id-Version: PACKAGE VERSION\n" 
    1717"Report-Msgid-Bugs-To: \n" 
    18 "POT-Creation-Date: 2009-07-19 00:16+0200\n" 
     18"POT-Creation-Date: 2009-07-22 23:19+0200\n" 
    1919"PO-Revision-Date: 2009-01-31 22:13+0100\n" 
    2020"Last-Translator:  <leo@costela.net>\n" 
     
    2626"Plural-Forms: nplurals=2; plural=(n > 1);\n" 
    2727 
    28 #: awayonlock.c:61 
     28#: awayonlock.c:62 
    2929msgid "Failed to get a DBus connection." 
    3030msgstr "Falha ao conseguir uma conexão DBus" 
    3131 
    32 #: awayonlock.c:77 
     32#: awayonlock.c:78 awayonlock.c:110 
    3333msgid "Failed to create a DBus Proxy." 
    3434msgstr "Falha ao criar um Proxy DBus" 
    3535 
    36 #: awayonlock.c:157 
     36#: awayonlock.c:190 
    3737msgid "Away-on-lock" 
    3838msgstr "" 
    3939 
    40 #: awayonlock.c:158 
    41 msgid "Sets you as away when your screensaver is activated" 
     40#: awayonlock.c:191 
     41#, fuzzy 
     42msgid "Changes your status when your screensaver gets activated" 
    4243msgstr "Define status como ausente quando o salva-tela é ativado" 
    4344 
    44 #: awayonlock.c:159 
     45#: awayonlock.c:192 
    4546msgid "" 
    46 "This plugin sets your status to the default away status whenever your " 
    47 "screensaver gets activated." 
     47"This plugin changes your status to a preselected saved status or the default " 
     48"away status whenever your screensaver gets activated. It doesn't interfere " 
     49"if you're already marked as auto-away and can also avoid changing your " 
     50"status if you've manually marked yourself as any non-available status." 
    4851msgstr "" 
    49 "Este plugin define o status atual como o status ausente padrão quando o " 
    50 "salva-tela é ativado" 
     52"Este plugin altera seu status para um status ausente pre-selecionado ou para " 
     53"o status ausente padrão quando o salva-tela é ativado. Ele não interfere caso " 
     54"você já esteja marcado como auto-ausente e pode também evitar alterar seu " 
     55"status caso você tenha manualmente se marcado como qualquer status não-disponível." 
    5156 
    52 #: awayonlock.c:160 
     57#: awayonlock.c:193 
    5358msgid "Leo Antunes <leo@costela.net>" 
    5459msgstr "" 
     
    6570msgid "Activate only if available" 
    6671msgstr "Ativar somente quando disponível" 
     72 
     73#~ msgid "" 
     74#~ "This plugin sets your status to the default away status whenever your " 
     75#~ "screensaver gets activated." 
     76#~ msgstr "" 
     77#~ "Este plugin define o status atual como o status ausente padrão quando o " 
     78#~ "salva-tela é ativado"