[meld] filediff: Improve revert dialog file list display
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Improve revert dialog file list display
- Date: Thu, 8 Feb 2018 21:02:45 +0000 (UTC)
commit 9ecd1d60d5e2f9ccf55621deebdbd5e32119634b
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Feb 9 06:38:12 2018 +1000
filediff: Improve revert dialog file list display
Two changes here: firstly to use the message dialog area that *is* now
available; and secondly to use unicode list bullets.
data/ui/filediff.ui | 3 +--
meld/filediff.py | 11 +++++++----
2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/filediff.ui b/data/ui/filediff.ui
index 39f3454a..3532b3e2 100644
--- a/data/ui/filediff.ui
+++ b/data/ui/filediff.ui
@@ -834,8 +834,7 @@
<property name="skip_taskbar_hint">True</property>
<property name="message_type">question</property>
<property name="text" translatable="yes">Revert unsaved changes to documents?</property>
- <property name="secondary_text" translatable="yes">Changes made to the following documents will be
permanently lost:
-</property>
+ <property name="secondary_text" translatable="yes">Changes made to the following documents will be
permanently lost:</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox2">
<property name="visible">True</property>
diff --git a/meld/filediff.py b/meld/filediff.py
index c349a376..4405b0ff 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1711,10 +1711,13 @@ class FileDiff(MeldDoc, Component):
dialog = Component("filediff.ui", "revert_dialog")
dialog.widget.set_transient_for(self.widget.get_toplevel())
- # FIXME: Should be packed into dialog.widget.get_message_area(),
- # but this is unbound on currently required PyGTK.
- filelist = "\n".join(["\t" + f for f in unsaved])
- dialog.widget.props.secondary_text += filelist
+
+ filelist = Gtk.Label("\n".join(["\t• " + f for f in unsaved]))
+ filelist.props.xalign = 0.0
+ filelist.show()
+ message_area = dialog.widget.get_message_area()
+ message_area.pack_start(filelist, expand=False, fill=True, padding=0)
+
response = dialog.widget.run()
dialog.widget.destroy()
return response == Gtk.ResponseType.OK
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]