diff options
author | Gian Mario Tagliaretti <gianmt@src.gnome.org> | 2008-06-08 23:41:34 +0000 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@src.gnome.org> | 2008-06-08 23:41:34 +0000 |
commit | ffd814ecfe8bbaeb4b8cec0875313010905d6fdc (patch) | |
tree | f34d08da8d8dbba48b3b881ad031dc7cbbc65497 | |
parent | 356c06e2a8114ad56dd629b92476053daf349d04 (diff) | |
download | pygtk-ffd814ecfe8bbaeb4b8cec0875313010905d6fdc.tar.gz |
Add a gtk.FileChooserDialog get_action method to workaround an issue with the same mothos of gtk.Widget being called. fixes #534042
svn path=/trunk/; revision=2992
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gtk/gtk.override | 16 | ||||
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rw-r--r-- | tests/test_filechooserdialog.py | 13 |
4 files changed, 40 insertions, 1 deletions
@@ -1,3 +1,12 @@ +2008-06-09 Gian Mario Tagliaretti <gianmt@gnome.org> + + * tests/Makefile.am: + * tests/test_filechooserdialog.py: New test + + * gtk/gtk.override: Add a gtk.FileChooserDialog get_action method to + workaround an issue with the same mothos of gtk.Widget being called. + fixes (bug #534042). + 2008-06-06 Johan Dahlin <johan@gnome.org> * gtk/gtk-base.defs: Deprecate gtk.FileSelection diff --git a/gtk/gtk.override b/gtk/gtk.override index 586c6c7b..ca255823 100644 --- a/gtk/gtk.override +++ b/gtk/gtk.override @@ -8547,3 +8547,19 @@ _wrap_gtk_bin__set_child(PyGObject *self, PyGObject *value, void *closure) 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); + +} diff --git a/tests/Makefile.am b/tests/Makefile.am index 27ad44be..c2d40c88 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,8 @@ tests = \ 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 diff --git a/tests/test_filechooserdialog.py b/tests/test_filechooserdialog.py new file mode 100644 index 00000000..4bf6b2ac --- /dev/null +++ b/tests/test_filechooserdialog.py @@ -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() |