Show
Ignore:
Timestamp:
07/19/09 00:21:28 (3 years ago)
Author:
Leo Antunes <leo@…>
Children:
c5606aa8a15998dd28faee8a3141cb8ac83b8d24
Parents:
ebf9132bb918ff995e2b561867be329ec3e9a9ee
git-committer:
Leo Antunes <leo@…> (07/19/09 00:21:28)
Message:

add option to activate only if Available

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • awayonlock.c

    rebf9132 reac542b  
    22 awayonlock - plugin to set away status on screensaver activation 
    33 Copyright (C) 2009  Leo Antunes <leo@costela.net> 
    4   
     4 
    55 This program is free software; you can redistribute it and/or 
    66 modify it under the terms of the GNU General Public License 
    77 as published by the Free Software Foundation; either version 2 
    88 of the License, or (at your option) any later version. 
    9   
     9 
    1010 This program is distributed in the hope that it will be useful, 
    1111 but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1212 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1313 GNU General Public License for more details. 
    14   
     14 
    1515 You should have received a copy of the GNU General Public License 
    1616 along with this program; if not, write to the Free Software 
     
    2121#define PURPLE_PLUGINS 
    2222 
    23 #define AWAYONLOCK_VERSION "0.2.2" 
     23#define AWAYONLOCK_VERSION "0.3" 
    2424#define AWAYONLOCK_PLUGIN_ID "core-costela-awayonlock" 
    2525 
     
    5454 
    5555        purple_debug(PURPLE_DEBUG_INFO, PACKAGE, N_("plugin_load called\n")); 
    56          
     56 
    5757        dbus_conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error); 
    58          
    59         if(dbus_conn == NULL) {  
     58 
     59        if(dbus_conn == NULL) { 
    6060                purple_debug(PURPLE_DEBUG_ERROR, PACKAGE, N_("failed to get DBus connection\n")); 
    6161                purple_notify_error(plugin, "Away-on-lock", _("Failed to get a DBus connection."), g_strdup_printf("DBus error: %s\n",error->message)); 
    6262                return FALSE; 
    6363        } 
    64          
     64 
    6565 
    6666        /* 
     
    136136        0, 
    137137        N_("http://costela.net/projects/awayonlock"), 
    138          
     138 
    139139        plugin_load, 
    140140        plugin_unload, 
     
    154154{ 
    155155        bindtextdomain(PACKAGE, LOCALEDIR); 
    156          
     156 
    157157        info.name = _("Away-on-lock"); 
    158158        info.summary = _("Sets you as away when your screensaver is activated"); 
     
    160160        info.author = _("Leo Antunes <leo@costela.net>"); 
    161161 
    162         purple_prefs_add_none("/plugins/core/awayonlock"); 
    163         purple_prefs_add_string("/plugins/core/awayonlock/status", NULL); 
     162        purple_prefs_add_none(AWAYONLOCK_PREF_ROOT); 
     163        purple_prefs_add_string(AWAYONLOCK_PREF_STATUS, NULL); 
     164        purple_prefs_add_bool(AWAYONLOCK_PREF_AVAILABLE_ONLY, 0); 
    164165} 
    165166