pygtk r2992 - in trunk: . gtk tests
- From: gianmt svn gnome org
- To: svn-commits-list gnome org
- Subject: pygtk r2992 - in trunk: . gtk tests
- Date: Sun, 8 Jun 2008 23:41:34 +0000 (UTC)
Author: gianmt
Date: Sun Jun 8 23:41:34 2008
New Revision: 2992
URL: http://svn.gnome.org/viewvc/pygtk?rev=2992&view=rev
Log:
Add a gtk.FileChooserDialog get_action method to workaround an issue with the same mothos of gtk.Widget being called. fixes #534042
Added:
trunk/tests/test_filechooserdialog.py
Modified:
trunk/ChangeLog
trunk/gtk/gtk.override
trunk/tests/Makefile.am
Modified: trunk/gtk/gtk.override
==============================================================================
--- trunk/gtk/gtk.override (original)
+++ trunk/gtk/gtk.override Sun Jun 8 23:41:34 2008
@@ -8547,3 +8547,19 @@
return 0;
}
+%%
+define GtkFileChooserDialog.get_action noargs
+/* This is a Workaround to solve a problem in the __mro__ of FileChooserDialog,
+ * without this method a gtk.Widget method with the same name will be called
+ * which will always return None, see bug 534042.
+ */
+static PyObject *
+_wrap_gtk_file_chooser_dialog_get_action(PyGObject *self)
+{
+ gint ret;
+
+ ret = gtk_file_chooser_get_action(GTK_FILE_CHOOSER(self->obj));
+
+ return pyg_enum_from_gtype(GTK_TYPE_FILE_CHOOSER_ACTION, ret);
+
+}
Modified: trunk/tests/Makefile.am
==============================================================================
--- trunk/tests/Makefile.am (original)
+++ trunk/tests/Makefile.am Sun Jun 8 23:41:34 2008
@@ -15,7 +15,8 @@
test_radiobutton.py \
test_style.py \
test_textview.py \
- test_treeview.py
+ test_treeview.py \
+ test_filechooserdialog.py
GTK_PY_FILES = __init__.py _lazyutils.py compat.py deprecation.py keysyms.py
Added: trunk/tests/test_filechooserdialog.py
==============================================================================
--- (empty file)
+++ trunk/tests/test_filechooserdialog.py Sun Jun 8 23:41:34 2008
@@ -0,0 +1,13 @@
+import unittest
+
+from common import gtk
+
+class FileChooserDialogTest(unittest.TestCase):
+ def testFileChooserDialog(self):
+ fc = gtk.FileChooserDialog()
+
+ action = fc.get_action()
+ self.assertEqual(action, gtk.FILE_CHOOSER_ACTION_OPEN)
+
+if __name__ == '__main__':
+ unittest.main()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]