Changeset 161
- Timestamp:
- 05/28/04 19:54:40 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
- 1 moved
-
common/idle.c (moved) (moved from trunk/common/idle.cpp) (4 diffs)
-
plugins/gtkgui/gtkgui.py (modified) (2 diffs)
-
setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/idle.c
r159 r161 7 7 #include <gtk/gtk.h> 8 8 9 static PyObject * idle_init(PyObject *self, PyObject *args) { 9 static PyObject * idle_init(PyObject *self, PyObject *args) 10 { 10 11 gtk_init (NULL, NULL); 11 12 Py_INCREF(Py_None); … … 13 14 } 14 15 15 static PyObject * idle_getIdleSec(PyObject *self, PyObject *args) { 16 static PyObject * idle_getIdleSec(PyObject *self, PyObject *args) 17 { 16 18 static XScreenSaverInfo *mit_info = NULL; 17 19 int idle_time, event_base, error_base; 18 20 19 21 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) 22 25 mit_info = XScreenSaverAllocInfo(); 23 }24 26 XScreenSaverQueryInfo(GDK_DISPLAY(), GDK_ROOT_WINDOW(), mit_info); 25 27 idle_time = (mit_info->idle) / 1000; … … 30 32 } 31 33 32 static PyObject * idle_close(PyObject *self, PyObject *args) { 34 static PyObject * idle_close(PyObject *self, PyObject *args) 35 { 33 36 gtk_main_quit (); 34 37 Py_INCREF(Py_None); … … 36 39 } 37 40 38 static PyMethodDef idleMethods[] = { 41 static PyMethodDef idleMethods[] = 42 { 39 43 {"init", idle_init, METH_VARARGS, "init gtk"}, 40 44 {"getIdleSec", idle_getIdleSec, METH_VARARGS, "Give the idle time in secondes"}, -
trunk/plugins/gtkgui/gtkgui.py
r160 r161 649 649 account = model.get_value(acct_iter, 3) 650 650 menu = gtk.Menu() 651 item = gtk.MenuItem(_( u"Log on"))651 item = gtk.MenuItem(_("Log on")) 652 652 if self.contacts[account][jid][0].show != 'offline': 653 653 item.set_sensitive(FALSE) … … 655 655 item.connect("activate", self.on_agent_logging, jid, 'available', account) 656 656 657 item = gtk.MenuItem(_( u"Log off"))657 item = gtk.MenuItem(_("Log off")) 658 658 if self.contacts[account][jid][0].show == 'offline': 659 659 item.set_sensitive(FALSE) -
trunk/setup.py
r159 r161 2 2 3 3 module1 = Extension( 'idle', 4 sources = ['common/idle.c pp'],4 sources = ['common/idle.c'], 5 5 # extra_compile_args = ['-W'], 6 6 libraries = ['gtk-x11-2.0','gdk-x11-2.0','glib-2.0','X11','Xext','Xss','atk-1.0'],
