forked from Distroshare/distroshare-ubuntu-imager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubiquity_frontend_gtk_dialog_size.patch
45 lines (43 loc) · 1.51 KB
/
ubiquity_frontend_gtk_dialog_size.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- gtk_ui.py 2015-04-21 11:06:44.000000000 -0600
+++ gtk_ui.py 2015-06-10 12:21:50.716649795 -0600
@@ -42,6 +42,7 @@
import sys
import syslog
import traceback
+import textwrap
import dbus
from dbus.mainloop.glib import DBusGMainLoop
@@ -371,6 +372,10 @@
self.live_installer.connect(
'key-press-event', self.a11y_profile_keys)
+ #Re-format error messages so each line is at most 100 characters long
+ def fix_msg_line_len(self, msg):
+ return '\n'.join(textwrap.wrap(msg, 100))
+
def all_children(self, parent):
if isinstance(parent, Gtk.Container):
def recurse(x, y):
@@ -818,6 +823,7 @@
else:
txt = self.finished_label.get_label()
txt = txt.replace('${RELEASE}', misc.get_release().name)
+ txt = self.fix_msg_line_len(txt)
self.finished_label.set_label(txt)
with misc.raised_privileges():
with open('/var/run/reboot-required', "w"):
@@ -1723,6 +1729,7 @@
self.set_busy_cursor(False)
if not msg:
msg = title
+ msg = self.fix_msg_line_len(msg)
dialog = Gtk.MessageDialog(
self.live_installer, Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, msg)
@@ -1771,6 +1778,7 @@
self.set_busy_cursor(False)
if not msg:
msg = title
+ msg = self.fix_msg_line_len(msg)
buttons = []
for option in options:
if use_templates: