Merge lp:~vorlon/kubuntu-default-settings/lp-553954 into lp:kubuntu-default-settings

Proposed by Steve Langasek
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vorlon/kubuntu-default-settings/lp-553954
Merge into: lp:kubuntu-default-settings
Diff against target: 118 lines (+37/-7)
2 files modified
debian/changelog (+8/-0)
lib/plymouth/themes/kubuntu-logo/kubuntu-logo.script (+29/-7)
To merge this branch: bzr merge lp:~vorlon/kubuntu-default-settings/lp-553954
Reviewer Review Type Date Requested Status
Kubuntu Members Pending
Review via email: mp+23448@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-04-14 11:57:15 +0000
3+++ debian/changelog 2010-04-15 01:42:26 +0000
4@@ -1,3 +1,11 @@
5+kubuntu-default-settings (1:10.04ubuntu21) lucid; urgency=low
6+
7+ [ Alberto Milone ]
8+ * kubuntu-logo: accept a format string from mountall for the disk check
9+ progress, so that localization is possible. LP: #553954.
10+
11+ -- Steve Langasek <steve.langasek@ubuntu.com> Thu, 15 Apr 2010 01:26:11 +0000
12+
13 kubuntu-default-settings (1:10.04ubuntu20) lucid; urgency=low
14
15 [ Harald Sitter ]
16
17=== modified file 'lib/plymouth/themes/kubuntu-logo/kubuntu-logo.script'
18--- lib/plymouth/themes/kubuntu-logo/kubuntu-logo.script 2010-04-10 04:01:54 +0000
19+++ lib/plymouth/themes/kubuntu-logo/kubuntu-logo.script 2010-04-15 01:42:26 +0000
20@@ -132,6 +132,18 @@
21 return local.destination;
22 }
23
24+fun StringReplace (source, pattern, replacement) {
25+ local.found = StringString(source, pattern);
26+ if (local.found == NULL)
27+ return source;
28+
29+ local.new_string = StringCopy (source, 0, local.found - 1) +
30+ replacement +
31+ StringCopy (source, local.found + StringLength(pattern), NULL);
32+
33+ return local.new_string;
34+}
35+
36 # it makes sense to use it only for
37 # numbers up to 100
38 fun StringToInteger (str) {
39@@ -639,11 +651,12 @@
40 # label, the associated
41 # device and the image size of the sprite.
42
43-fun init_progress_label (device) {
44+fun init_progress_label (device, status_string) {
45 # Make the slot unavailable
46 global.progress_label.is_available = 0;
47 progress_label.progress = 0;
48 progress_label.device = device;
49+ progress_label.status_string = status_string;
50 }
51
52 # See if the progress label is keeping track of the fsck
53@@ -676,7 +689,13 @@
54 }
55 }
56 # Update progress label here
57- label = "Checking disk " + global.counter.current + " of " + global.counter.total + " (" + progress_label.progress + "% complete)";
58+ #
59+ # FIXME: the queue logic from this theme should really be moved into mountall
60+ # instead of using string replacement to deal with localised strings.
61+ label = StringReplace (progress_label.status_string[0], "%1$d", global.counter.current);
62+ label = StringReplace (label, "%2$d", global.counter.total);
63+ label = StringReplace (label, "%3$d", progress_label.progress);
64+ label = StringReplace (label, "%%", "%");
65
66 progress_label = get_fsck_label (label, 0);
67 #progress_label.progress = progress;
68@@ -823,7 +842,7 @@
69 #
70 # NOTE: no more than "progress_bar.max_number" bars are allowed
71 #
72-fun fsck_check (device, progress) {
73+fun fsck_check (device, progress, status_string) {
74
75 # The 1st time this will take place
76 if (!global.progress_label) {
77@@ -831,7 +850,7 @@
78 increase_fsck_count ();
79
80 # Set up a new label for the check
81- init_progress_label (device);
82+ init_progress_label (device, status_string);
83 update_progress_label (progress);
84
85 return;
86@@ -867,7 +886,7 @@
87 #Debug("setting new label for device " + device + " progress " + progress);
88
89 # Set up a new label for the check
90- init_progress_label (device);
91+ init_progress_label (device, status_string);
92 update_progress_label (progress);
93
94 }
95@@ -935,10 +954,13 @@
96 # my_string = update_strings[0] + " " + update_strings[1] + " " + update_strings[2];
97 # Debug(my_string);
98 # Let's assume that we're dealing with these strings fsck:sda1:40
99- if ((string_it == 2) && (update_strings[0] == "fsck")) {
100+ if ((string_it >= 2) && (update_strings[0] == "fsck")) {
101
102 device = update_strings[1];
103 progress = update_strings[2];
104+ status_string[0] = update_strings[3]; # "Checking disk %1$d of %2$d (%3$d %% complete)"
105+ if (!status_string[0])
106+ status_string[0] = "Checking disk %1$d of %2$d (%3$d %% complete)";
107
108 if ((device != "") && (progress != "")) {
109 progress = StringToInteger (progress);
110@@ -955,7 +977,7 @@
111 # create_extra_fsck_label ();
112
113 # Keep track of the fsck check
114- fsck_check (device, progress);
115+ fsck_check (device, progress, status_string);
116 }
117
118 }

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: