Changeset 161

Show
Ignore:
Timestamp:
05/28/04 19:54:40 (4 years ago)
Author:
asterix
Message:

idle is a C module, not a C++ one

Location:
trunk
Files:
2 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/common/idle.c

    r159 r161  
    77#include <gtk/gtk.h> 
    88 
    9 static PyObject * idle_init(PyObject *self, PyObject *args) { 
     9static PyObject * idle_init(PyObject *self, PyObject *args) 
     10{ 
    1011        gtk_init (NULL, NULL); 
    1112        Py_INCREF(Py_None); 
     
    1314} 
    1415 
    15 static PyObject * idle_getIdleSec(PyObject *self, PyObject *args) { 
     16static PyObject * idle_getIdleSec(PyObject *self, PyObject *args) 
     17{ 
    1618        static XScreenSaverInfo *mit_info = NULL; 
    1719        int idle_time, event_base, error_base; 
    1820 
    1921        gtk_init (NULL, NULL); 
    20         if (XScreenSaverQueryExtension(GDK_DISPLAY(), &event_base, &error_base)) { 
    21                 if (mit_info == NULL) { 
     22        if (XScreenSaverQueryExtension(GDK_DISPLAY(), &event_base, &error_base)) 
     23        { 
     24                if (mit_info == NULL) 
    2225                        mit_info = XScreenSaverAllocInfo(); 
    23                 } 
    2426                XScreenSaverQueryInfo(GDK_DISPLAY(), GDK_ROOT_WINDOW(), mit_info); 
    2527                idle_time = (mit_info->idle) / 1000; 
     
    3032} 
    3133 
    32 static PyObject * idle_close(PyObject *self, PyObject *args) { 
     34static PyObject * idle_close(PyObject *self, PyObject *args) 
     35{ 
    3336        gtk_main_quit (); 
    3437        Py_INCREF(Py_None); 
     
    3639} 
    3740 
    38 static PyMethodDef idleMethods[] = { 
     41static PyMethodDef idleMethods[] = 
     42{ 
    3943        {"init",  idle_init, METH_VARARGS, "init gtk"}, 
    4044        {"getIdleSec",  idle_getIdleSec, METH_VARARGS, "Give the idle time in secondes"}, 
  • trunk/plugins/gtkgui/gtkgui.py

    r160 r161  
    649649                account = model.get_value(acct_iter, 3) 
    650650                menu = gtk.Menu() 
    651                 item = gtk.MenuItem(_(u"Log on")) 
     651                item = gtk.MenuItem(_("Log on")) 
    652652                if self.contacts[account][jid][0].show != 'offline': 
    653653                        item.set_sensitive(FALSE) 
     
    655655                item.connect("activate", self.on_agent_logging, jid, 'available', account) 
    656656 
    657                 item = gtk.MenuItem(_(u"Log off")) 
     657                item = gtk.MenuItem(_("Log off")) 
    658658                if self.contacts[account][jid][0].show == 'offline': 
    659659                        item.set_sensitive(FALSE) 
  • trunk/setup.py

    r159 r161  
    22 
    33module1 = Extension( 'idle', 
    4                      sources = ['common/idle.cpp'], 
     4                     sources = ['common/idle.c'], 
    55#                     extra_compile_args = ['-W'], 
    66                     libraries = ['gtk-x11-2.0','gdk-x11-2.0','glib-2.0','X11','Xext','Xss','atk-1.0'],