[pygobject] add secondary_text apis to MessageDialog
- From: John Palmieri <johnp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] add secondary_text apis to MessageDialog
- Date: Thu, 9 Dec 2010 18:25:01 +0000 (UTC)
commit e76352dd83c8706e68ad57d00d185da9afea99c4
Author: John (J5) Palmieri <johnp redhat com>
Date: Thu Dec 9 13:23:10 2010 -0500
add secondary_text apis to MessageDialog
gi/overrides/Gtk.py | 8 ++++++++
tests/test_overrides.py | 8 ++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 7d594fa..eb9e132 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -399,6 +399,14 @@ class MessageDialog(Gtk.MessageDialog, Dialog):
**kwds)
Dialog.__init__(self, parent=parent, flags=flags)
+ def format_secondary_text(self, message_format):
+ self.set_property('secondary-use-markup', False)
+ self.set_property('secondary-text', message_format)
+
+ def format_secondary_markup(self, message_format):
+ self.set_property('secondary-use-markup', True)
+ self.set_property('secondary-text', message_format)
+
MessageDialog = override(MessageDialog)
__all__.append('MessageDialog')
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 72278a7..0e2d976 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -244,6 +244,14 @@ class TestGtk(unittest.TestCase):
text = dialog.get_property('text')
self.assertEquals('dude!', text)
+ dialog.format_secondary_text('2nd text')
+ self.assertEqual(dialog.get_property('secondary-text'), '2nd text')
+ self.assertFalse(dialog.get_property('secondary-use-markup'))
+
+ dialog.format_secondary_markup('2nd markup')
+ self.assertEqual(dialog.get_property('secondary-text'), '2nd markup')
+ self.assertTrue(dialog.get_property('secondary-use-markup'))
+
# Gtk.ColorSelectionDialog
dialog = Gtk.ColorSelectionDialog("color selection dialog test")
self.assertEquals('color selection dialog test', dialog.get_title())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]