Merge lp:~bluesabre/ubuntu/trusty/light-locker-settings/trusty-1.2.1 into lp:ubuntu/trusty/light-locker-settings

Proposed by Sean Davis
Status: Merged
Approved by: Logan Rosen
Approved revision: 6
Merged at revision: 6
Proposed branch: lp:~bluesabre/ubuntu/trusty/light-locker-settings/trusty-1.2.1
Merge into: lp:ubuntu/trusty/light-locker-settings
Diff against target: 1202 lines (+563/-229)
18 files modified
Makefile.in.in (+1/-0)
NEWS (+5/-0)
debian/changelog (+7/-0)
light-locker-settings/light-locker-settings.py (+320/-191)
light-locker-settings/light_locker_xfsync.py (+190/-0)
po/ca.po (+1/-1)
po/de.po (+1/-1)
po/en_AU.po (+1/-1)
po/es.po (+1/-1)
po/fi.po (+1/-1)
po/fr.po (+6/-6)
po/ja.po (+6/-6)
po/nl.po (+7/-7)
po/pl.po (+12/-10)
po/pt.po (+1/-1)
po/pt_BR.po (+1/-1)
po/pt_PT.po (+1/-1)
po/ru.po (+1/-1)
To merge this branch: bzr merge lp:~bluesabre/ubuntu/trusty/light-locker-settings/trusty-1.2.1
Reviewer Review Type Date Requested Status
Logan Rosen Approve
Chris J Arges Approve
Pasi Lallinaho (community) community Approve
Review via email: mp+214362@code.launchpad.net

Description of the change

light-locker-settings (1.2.1-0ubuntu1) trusty; urgency=medium

  * New upstream release. (LP: #1302484)
    - Fixes XFCE Power Manager setttings sync (LP: #1290737)

 -- Sean Davis <email address hidden> Fri, 04 Apr 2014 06:46:52 -0400

To post a comment you must log in.
Revision history for this message
Pasi Lallinaho (knome) wrote :

Approve with my Xubuntu Project lead hat on; the Xubuntu team wants this change.

review: Approve (community)
Revision history for this message
Chris J Arges (arges) wrote :

This is a bugfix only update.

review: Approve
Revision history for this message
Logan Rosen (logan) wrote :

Uploaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.in.in'
2--- Makefile.in.in 2014-03-12 07:23:04 +0000
3+++ Makefile.in.in 2014-04-05 00:57:27 +0000
4@@ -21,6 +21,7 @@
5
6 install -d $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/light-locker-settings
7 install light-locker-settings/light-locker-settings.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/light-locker-settings
8+ install light-locker-settings/light_locker_xfsync.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/light-locker-settings
9 install light-locker-settings/light-locker-settings.glade $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/light-locker-settings
10
11 install -d $(DESTDIR)/$(PREFIX)/share/doc/$(APPNAME)
12
13=== modified file 'NEWS'
14--- NEWS 2014-03-24 22:31:55 +0000
15+++ NEWS 2014-04-05 00:57:27 +0000
16@@ -1,5 +1,10 @@
17 Light Locker Settings NEWS
18 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19+04 Apr 2014, Light Locker Settings 1.2.1
20+
21+- Support for external power management tools
22+ . Added support for xfce4-session and xfce4-power-manager (fixes LP:1290737)
23+
24 24 Mar 2014, Light Locker Settings 1.2.0
25
26 - light-locker settings:
27
28=== modified file 'debian/changelog'
29--- debian/changelog 2014-03-24 22:31:55 +0000
30+++ debian/changelog 2014-04-05 00:57:27 +0000
31@@ -1,3 +1,10 @@
32+light-locker-settings (1.2.1-0ubuntu1) trusty; urgency=medium
33+
34+ * New upstream release. (LP: #1302484)
35+ - Fixes XFCE Power Manager setttings sync (LP: #1290737)
36+
37+ -- Sean Davis <smd.seandavis@gmail.com> Fri, 04 Apr 2014 06:46:52 -0400
38+
39 light-locker-settings (1.2.0-0ubuntu1) trusty; urgency=medium
40
41 * New upstream release. (LP: #1297058)
42
43=== modified file 'light-locker-settings/light-locker-settings.py'
44--- light-locker-settings/light-locker-settings.py 2014-03-24 22:31:55 +0000
45+++ light-locker-settings/light-locker-settings.py 2014-04-05 00:57:27 +0000
46@@ -30,6 +30,8 @@
47
48 import psutil
49
50+import light_locker_xfsync
51+
52 ''' Settings window for the light-locker '''
53
54 username = GLib.get_user_name()
55@@ -40,7 +42,8 @@
56
57 def __init__(self):
58 '''Initialize the Light Locker Settings application.'''
59- self.systemwide_desktop_file = "/etc/xdg/autostart/light-locker.desktop"
60+ self.systemwide_desktop_file = \
61+ "/etc/xdg/autostart/light-locker.desktop"
62 self.user_desktop_file = os.path.join(os.path.expanduser('~'),
63 '.config',
64 'autostart',
65@@ -91,32 +94,9 @@
66 self.screenoff_timeout.add_mark(i * 10, 3, None)
67 self.lock_delay.add_mark(i * 10, 3, None)
68
69- ''' if there is a file exists in ~/.config/autostart/ parse that
70- for current settings picked by the user else load in the
71- systemwide '''
72- if os.path.isfile(self.user_desktop_file):
73- self.read_in_desktop(self.user_desktop_file)
74- else:
75- self.read_in_desktop(self.systemwide_desktop_file)
76-
77- ''' read in the X11 screensaver settings from bash '''
78- screensaver_output = self.run_command('xset q', check_output=True)
79- screenblank_timeout_grep = re.search(
80- "timeout: *(\d+)", screensaver_output)
81- if screenblank_timeout_grep:
82- screenblank_timeout = re.findall(
83- '\d+', screenblank_timeout_grep.group(1))
84- self.screenblank_timeout.set_value(
85- int(screenblank_timeout[0]) / 60)
86- screenoff_timeout_grep = re.search(
87- "Standby: *(\d+)", screensaver_output)
88- if screenoff_timeout_grep:
89- screenoff_timeout = re.findall(
90- '\d+', screenoff_timeout_grep.group(1))
91- self.screenoff_timeout.set_value(int(screenoff_timeout[0]) / 60)
92+ self.init_settings()
93
94 ''' Monitor changes to the settings '''
95-
96 self.apply.set_sensitive(False)
97 self.locksettings_changed = False
98 self.screenblank_timeout.connect(
99@@ -126,6 +106,115 @@
100 self.lock_delay.connect(
101 "value-changed", self.lock_delay_value_changed_cb)
102
103+# Application Callbacks
104+ def screenblank_value_changed_cb(self, gparam):
105+ '''Sync screenblank and screenoff settings when values are modified.'''
106+ self.apply.set_sensitive(True)
107+
108+ blank_timeout = int(self.screenblank_timeout.get_value())
109+ off_timeout = int(self.screenoff_timeout.get_value())
110+
111+ ''' screenoff can never be shorter than screenblank-timeout '''
112+ if (blank_timeout >= off_timeout) and (off_timeout != 0):
113+ self.screenoff_timeout.set_value(blank_timeout)
114+
115+ def screenoff_value_changed_cb(self, gparam):
116+ '''Sync screenblank and screenoff settings when values are modified.'''
117+ self.apply.set_sensitive(True)
118+
119+ blank_timeout = int(self.screenblank_timeout.get_value())
120+ off_timeout = int(self.screenoff_timeout.get_value())
121+
122+ ''' screenoff can never be shorter than screenblank-timeout '''
123+ if off_timeout <= blank_timeout:
124+ self.screenblank_timeout.set_value(off_timeout)
125+
126+ def use_lightlocker_cb(self, switch, gparam):
127+ '''Update the displayed lock controls when light-locker is enabled or
128+ disabled.'''
129+ ''' if on then allow for the timeout to be set '''
130+ self.locksettings_changed = True
131+ self.apply.set_sensitive(True)
132+ if switch.get_active():
133+ self.lock_delay.set_sensitive(False)
134+ self.session_lock_combo.set_sensitive(False)
135+ self.lock_on_suspend.set_sensitive(False)
136+ else:
137+ self.session_lock_combo.set_sensitive(True)
138+ self.lock_on_suspend.set_sensitive(True)
139+ if self.session_lock_combo.get_active() != 2:
140+ self.lock_delay.set_sensitive(True)
141+
142+ def on_session_lock_combo_changed(self, widget):
143+ '''Update the displayed screen blanking controls when locking is
144+ enabled or disabled.'''
145+ self.locksettings_changed = True
146+ self.apply.set_sensitive(True)
147+
148+ # Check the session lock combo:
149+ # 0. lock when screensaver is activated
150+ # 1. lock when screensaver is deactivated
151+ # 2. never lock
152+ active = widget.get_active()
153+ self.lock_delay.set_sensitive(active != 2)
154+
155+ def lock_delay_value_changed_cb(self, gparam):
156+ '''Enable saving of lock setting when the delay has been modified.'''
157+ self.locksettings_changed = True
158+ self.apply.set_sensitive(True)
159+
160+ def lock_on_suspend_cb(self, widget, gparam):
161+ '''Enable saving when locking on suspend is changed.'''
162+ self.locksettings_changed = True
163+ self.apply.set_sensitive(True)
164+
165+ def apply_cb(self, button, data=None):
166+ '''Apply changes and update the relevant setting files.'''
167+ ''' Check whether the autostart-directory exists and if not
168+ create it '''
169+ autostart_dir = os.path.dirname(self.user_desktop_file)
170+ if not os.path.exists(autostart_dir):
171+ os.makedirs(autostart_dir)
172+
173+ self.apply_settings()
174+ self.apply.set_sensitive(False)
175+
176+ def on_window_destroy(self, *args):
177+ '''Exit the application when the window is closed.'''
178+ Gtk.main_quit()
179+
180+ def on_close_clicked(self, *args):
181+ '''Exit the application when the window is closed.'''
182+ Gtk.main_quit()
183+
184+# Process Management
185+ def check_running_process(self, process_name):
186+ """Return True if the specified process is active."""
187+ # Find the process...
188+ for pid in psutil.get_pid_list():
189+ p = psutil.Process(pid)
190+ if p.username == username:
191+ # When found, end the light-locker process.
192+ try:
193+ if os.path.basename(p.exe) == process_name:
194+ return True
195+ except psutil._error.AccessDenied:
196+ pass
197+ return False
198+
199+ def stop_light_locker(self):
200+ """Safely stop the light-locker process."""
201+ # Find the process...
202+ for pid in psutil.get_pid_list():
203+ p = psutil.Process(pid)
204+ if p.username == username:
205+ # When found, end the light-locker process.
206+ try:
207+ if os.path.basename(p.exe) == 'light-locker':
208+ p.terminate()
209+ except psutil._error.AccessDenied:
210+ pass
211+
212 def run_command(self, cmd, check_output=False):
213 '''Run a shell command, return its output.'''
214 if len(cmd) == 0:
215@@ -137,18 +226,62 @@
216 subprocess.Popen(cmd.split(" "))
217 return None
218
219- def stop_light_locker(self):
220- """Safely stop the light-locker process."""
221- # Find the process...
222- for pid in psutil.get_pid_list():
223- p = psutil.Process(pid)
224- if p.username == username:
225- # When found, end the light-locker process.
226- try:
227- if os.path.basename(p.exe) == 'light-locker':
228- p.terminate()
229- except psutil._error.AccessDenied:
230- pass
231+# Settings Parsing
232+ def init_settings(self):
233+ # Get the Settings, first from light-locker, then override as needed
234+ ''' if there is a file exists in ~/.config/autostart/ parse that
235+ for current settings picked by the user else load in the
236+ systemwide '''
237+ if os.path.isfile(self.user_desktop_file):
238+ desktop_file = self.user_desktop_file
239+ else:
240+ desktop_file = self.systemwide_desktop_file
241+ settings = self.read_in_desktop(desktop_file)
242+ use_light_locker = settings['light-locker-enabled']
243+ lock_after_screensaver = settings['lock-after-screensaver']
244+ late_locking = settings['late-locking']
245+ lock_on_suspend = settings['lock-on-suspend']
246+ lock_time = settings['lock-time']
247+ screen_blank_timeout, screen_off_timeout = \
248+ self.get_screen_blank_timeout()
249+
250+ # Replace settings with xfce4-session
251+ if self.check_running_process("xfce4-session"):
252+ session_sync = light_locker_xfsync.XfceSessionSync()
253+ lock_on_suspend = session_sync.get_lock()
254+
255+ # Replace settings with xfce4-power-manager
256+ if self.check_running_process("xfce4-power-manager"):
257+ xfpm_sync = light_locker_xfsync.XfpmSync()
258+ screen_blank_timeout, screen_off_timeout = xfpm_sync.get_dpms()
259+ screen_blank_timeout = self.light_locker_time_down_scaler(
260+ screen_blank_timeout)
261+ screen_off_timeout = self.light_locker_time_down_scaler(
262+ screen_off_timeout)
263+
264+ # Apply the settings
265+ self.use_lightlocker.set_active(use_light_locker)
266+ self.session_lock_combo.set_sensitive(use_light_locker)
267+ self.lock_on_suspend.set_sensitive(use_light_locker)
268+
269+ self.lock_delay.set_value(lock_time)
270+
271+ if lock_after_screensaver:
272+ self.lock_delay.set_sensitive(True)
273+ if late_locking:
274+ self.session_lock_combo.set_active(1)
275+ else:
276+ self.session_lock_combo.set_active(0)
277+ else:
278+ self.lock_delay.set_sensitive(False)
279+ self.session_lock_combo.set_active(2)
280+
281+ self.lock_on_suspend.set_active(lock_on_suspend)
282+
283+ blank = self.light_locker_time_down_scaler(screen_blank_timeout)
284+ off = self.light_locker_time_down_scaler(screen_off_timeout)
285+ self.screenblank_timeout.set_value(blank)
286+ self.screenoff_timeout.set_value(off)
287
288 def read_in_desktop(self, filepath):
289 '''Parse the .desktop file for light-locker settings.'''
290@@ -156,7 +289,7 @@
291 self.content = f.readlines()
292 for line in self.content:
293 if line.startswith("Exec="):
294- self.parse_options(line)
295+ return self.parse_options(line)
296
297 def parse_options(self, options_line):
298 '''Parse command-line arguments from the Exec line.'''
299@@ -197,107 +330,44 @@
300 if args.lock_on_suspend:
301 lock_on_suspend = True
302
303- # Apply the settings
304- self.use_lightlocker.set_active(use_light_locker)
305- self.session_lock_combo.set_sensitive(use_light_locker)
306- self.lock_on_suspend.set_sensitive(use_light_locker)
307-
308- self.lock_delay.set_value(lock_time)
309-
310- if lock_after_screensaver:
311- self.lock_delay.set_sensitive(True)
312- if late_locking:
313- self.session_lock_combo.set_active(1)
314- else:
315- self.session_lock_combo.set_active(0)
316- else:
317- self.lock_delay.set_sensitive(False)
318- self.session_lock_combo.set_active(2)
319-
320- self.lock_on_suspend.set_active(lock_on_suspend)
321-
322- def write_light_locker_file(self, filepath, light_locker_command):
323- '''Write the updated light-locker settings to its .desktop file.'''
324- exec_str = "Exec=%s\n" % light_locker_command
325- with open(filepath, 'w') as f:
326- for line in self.content:
327- if line.startswith("Exec="):
328- f.write(exec_str)
329- else:
330- f.write(line)
331-
332- def write_screensaver_file(self, filepath, screensaver_command):
333- '''Write the updated screensaver settings to its .desktop file.'''
334- with open(filepath, 'w') as f:
335- f.write(
336- "[Desktop Entry]\n"
337- "Name=%s\n"
338- "Comment=%s\n"
339- "Exec=%s\n"
340- % (_("Screensaver"), _("Set screensaver timeouts"),
341- screensaver_command))
342-
343- def use_lightlocker_cb(self, switch, gparam):
344- '''Update the displayed lock controls when light-locker is enabled or
345- disabled.'''
346- ''' if on then allow for the timeout to be set '''
347- self.locksettings_changed = True
348- self.apply.set_sensitive(True)
349- if switch.get_active():
350- self.lock_delay.set_sensitive(False)
351- self.session_lock_combo.set_sensitive(False)
352- self.lock_on_suspend.set_sensitive(False)
353- else:
354- self.session_lock_combo.set_sensitive(True)
355- self.lock_on_suspend.set_sensitive(True)
356- if self.session_lock_combo.get_active() != 2:
357- self.lock_delay.set_sensitive(True)
358-
359- def on_session_lock_combo_changed(self, widget):
360- '''Update the displayed screen blanking controls when locking is
361- enabled or disabled.'''
362- self.locksettings_changed = True
363- self.apply.set_sensitive(True)
364-
365- # Check the session lock combo:
366- # 0. lock when screensaver is activated
367- # 1. lock when screensaver is deactivated
368- # 2. never lock
369- active = widget.get_active()
370- self.lock_delay.set_sensitive(active != 2)
371-
372- def lock_on_suspend_cb(self, widget, gparam):
373- '''Enable saving when locking on suspend is changed.'''
374- self.locksettings_changed = True
375- self.apply.set_sensitive(True)
376-
377- def screenblank_value_changed_cb(self, gparam):
378- '''Sync screenblank and screenoff settings when values are modified.'''
379- self.apply.set_sensitive(True)
380-
381- blank_timeout = int(self.screenblank_timeout.get_value())
382- off_timeout = int(self.screenoff_timeout.get_value())
383-
384- ''' screenoff can never be shorter than screenblank-timeout '''
385- if (blank_timeout >= off_timeout) and (off_timeout != 0):
386- self.screenoff_timeout.set_value(blank_timeout)
387-
388- def screenoff_value_changed_cb(self, gparam):
389- '''Sync screenblank and screenoff settings when values are modified.'''
390- self.apply.set_sensitive(True)
391-
392- blank_timeout = int(self.screenblank_timeout.get_value())
393- off_timeout = int(self.screenoff_timeout.get_value())
394-
395- ''' screenoff can never be shorter than screenblank-timeout '''
396- if off_timeout <= blank_timeout:
397- self.screenblank_timeout.set_value(off_timeout)
398-
399- def lock_delay_value_changed_cb(self, gparam):
400- '''Enable saving of lock setting when the delay has been modified.'''
401- self.locksettings_changed = True
402- self.apply.set_sensitive(True)
403-
404+ settings = dict()
405+ settings['light-locker-enabled'] = use_light_locker
406+ settings['lock-after-screensaver'] = lock_after_screensaver
407+ settings['late-locking'] = late_locking
408+ settings['lock-on-suspend'] = lock_on_suspend
409+ settings['lock-time'] = lock_time
410+
411+ return settings
412+
413+ def get_screen_blank_timeout(self):
414+ ''' read in the X11 screensaver settings from bash '''
415+ # Defaults
416+ screen_blank = 10
417+ screen_off = 15
418+
419+ # Get the xset output to parse.
420+ screensaver_output = self.run_command('xset q', check_output=True)
421+
422+ # Get the Screen-Blank timeout
423+ screenblank_timeout_grep = re.search(
424+ "timeout: *(\d+)", screensaver_output)
425+ if screenblank_timeout_grep:
426+ screenblank_timeout = re.findall(
427+ '\d+', screenblank_timeout_grep.group(1))
428+ screen_blank = int(screenblank_timeout[0]) / 60
429+
430+ # Get the Screen-Off timeout
431+ screenoff_timeout_grep = re.search(
432+ "Standby: *(\d+)", screensaver_output)
433+ if screenoff_timeout_grep:
434+ screenoff_timeout = re.findall(
435+ '\d+', screenoff_timeout_grep.group(1))
436+ screen_off = int(screenoff_timeout[0]) / 60
437+
438+ # Return the current timeout settings
439+ return screen_blank, screen_off
440+
441+# Label Formatters
442 def screensaver_label_formatter(self, screenblank_timeout, max_value):
443 '''Convert timeout values to a more friendly format.'''
444 value = int(screenblank_timeout.get_value())
445@@ -316,6 +386,15 @@
446 formatted_string = self.secs_to_readable(value)
447 return formatted_string
448
449+ def secs_to_readable(self, seconds):
450+ '''Convert seconds to a more friendly format.'''
451+ if seconds >= 60:
452+ minutes = seconds / 60
453+ return ngettext("%d minute", "%d minutes", minutes) % (minutes,)
454+ else:
455+ return ngettext("%d second", "%d seconds", seconds) % (seconds,)
456+
457+# Time Scalers
458 def light_locker_time_up_scaler(self, time):
459 '''Scale times up.'''
460 if time > 60:
461@@ -328,49 +407,99 @@
462 time = time / 60 + 60
463 return time
464
465- def apply_cb(self, button, data=None):
466- '''Apply changes and update the relevant setting files.'''
467- ''' Check whether the autostart-directory exists and if not
468- create it '''
469- autostart_dir = os.path.dirname(self.user_desktop_file)
470- if not os.path.exists(autostart_dir):
471- os.makedirs(autostart_dir)
472-
473- # Apply changes.
474- self.apply_light_locker_settings()
475- self.apply_screen_blank_settings()
476-
477- self.apply.set_sensitive(False)
478-
479- def apply_light_locker_settings(self):
480- '''Apply the light-locker settings'''
481- # Stop any running light-locker processes.
482- self.stop_light_locker()
483-
484+# Settings Writing
485+ def get_updated_settings(self):
486+ """Return a dictionary with the updated settings from the GUI."""
487 # Get the lock-after-screensaver timeout.
488 session_lock = self.session_lock_combo.get_active()
489 if session_lock == 2: # never lock with screensaver
490- late_locking = ""
491- timeout = "0"
492+ late_locking = False
493+ lock_delay = 0
494 else:
495 if session_lock == 0: # lock when screensaver is activated
496- late_locking = "--no-late-locking"
497+ late_locking = False
498 if session_lock == 1: # lock when screensaver is deactivated
499- late_locking = "--late-locking"
500- lock_delay_scaled = self.light_locker_time_up_scaler(
501+ late_locking = True
502+ lock_delay = self.light_locker_time_up_scaler(
503 int(self.lock_delay.get_value()))
504- timeout = str(lock_delay_scaled)
505- lock_after_screensaver = "--lock-after-screensaver=" + timeout
506+
507+ # Lock Enabled?
508+ lock_enabled = self.use_lightlocker.get_active()
509
510 # Get the suspend setting.
511- if self.lock_on_suspend.get_active():
512+ lock_on_suspend = self.lock_on_suspend.get_active()
513+
514+ # Get the screen-blank and screen-off timeout.
515+ screenblank_timeout = \
516+ int(self.screenblank_timeout.get_value()) * 60
517+ screenoff_timeout = int(self.screenoff_timeout.get_value()) * 60
518+
519+ settings = {
520+ "lock-enabled": lock_enabled,
521+ "late-locking": late_locking,
522+ "lock-after-screensaver": lock_delay,
523+ "lock-on-suspend": lock_on_suspend,
524+ "screen-blank-timeout": screenblank_timeout,
525+ "screen-off-timeout": screenoff_timeout
526+ }
527+
528+ return settings
529+
530+ def apply_settings(self):
531+ """Apply updated settings."""
532+ # Get the current settings from the GUI.
533+ settings = self.get_updated_settings()
534+ lock_on_suspend = settings['lock-on-suspend']
535+
536+ # If xfce4-sesssion is running, sync the lock-on-suspend setting.
537+ if self.check_running_process("xfce4-session"):
538+ session_sync = light_locker_xfsync.XfceSessionSync()
539+ session_sync.set_lock(lock_on_suspend)
540+
541+ # If xfce4-session manages locking, disable it for light-locker.
542+ settings['lock-on-suspend'] = False
543+
544+ # If xfce4-power-manager is running, sync the DPMS settings.
545+ if self.check_running_process("xfce4-power-manager"):
546+ xfpm_sync = light_locker_xfsync.XfpmSync()
547+ screen_off = settings['screen-off-timeout'] / 60
548+ screen_blank = settings['screen-blank-timeout'] / 60
549+ xfpm_sync.set_dpms(screen_blank, screen_off)
550+ xfpm_sync.set_lock(lock_on_suspend)
551+
552+ # If xfpm manages locking, disable it for light-locker.
553+ settings['lock-on-suspend'] = False
554+
555+ # Apply the remaining settings to light-locker.
556+ self.apply_light_locker_settings(settings)
557+ self.apply_screen_blank_settings(settings)
558+
559+ def apply_light_locker_settings(self, settings):
560+ '''Apply the light-locker settings'''
561+ # Stop any running light-locker processes.
562+ self.stop_light_locker()
563+
564+ lock_enabled = settings['lock-enabled']
565+ late_locking = settings['late-locking']
566+ lock_on_suspend = settings['lock-on-suspend']
567+ lock_after_screensaver = settings['lock-after-screensaver']
568+
569+ if late_locking:
570+ late_locking = "--late-locking"
571+ else:
572+ late_locking = "--no-late-locking"
573+
574+ if lock_on_suspend:
575 lock_on_suspend = "--lock-on-suspend"
576 else:
577 lock_on_suspend = "--no-lock-on-suspend"
578
579+ lock_after_screensaver = "--lock-after-screensaver=%i" % \
580+ lock_after_screensaver
581+
582 # Build the light-locker command.
583 light_locker_exec = ""
584- if self.use_lightlocker.get_active():
585+ if lock_enabled:
586 light_locker_exec = \
587 "light-locker %s %s %s" % (lock_after_screensaver,
588 lock_on_suspend, late_locking)
589@@ -381,16 +510,14 @@
590 # Execute the updated light-locker command.
591 self.run_command(light_locker_exec)
592
593- def apply_screen_blank_settings(self):
594+ def apply_screen_blank_settings(self, settings):
595 '''Apply the screen blank settings.'''
596- # Get the screen-blank and screen-off timeout.
597- screenblank_timeout = str(
598- int(self.screenblank_timeout.get_value()) * 60)
599- screenoff_timeout = str(int(self.screenoff_timeout.get_value()) * 60)
600+ screenblank_timeout = settings['screen-blank-timeout']
601+ screenoff_timeout = settings['screen-off-timeout']
602
603 # Build the screen-blank/off command.
604 screensaver_exec = \
605- "xset s %s dpms %s 0 0" % (screenblank_timeout, screenoff_timeout)
606+ "xset s %i dpms %i 0 0" % (screenblank_timeout, screenoff_timeout)
607
608 # Execute the updated screensaver command.
609 self.run_command(screensaver_exec)
610@@ -399,24 +526,26 @@
611 self.write_screensaver_file(
612 self.screenblank_timeout_desktop_file, screensaver_exec)
613
614- # Does this command really need to be run after we run the right one?
615- #self.run_command('xset s ' + screenblank_timeout)
616-
617- def secs_to_readable(self, seconds):
618- '''Convert seconds to a more friendly format.'''
619- if seconds >= 60:
620- minutes = seconds / 60
621- return ngettext("%d minute", "%d minutes", minutes) % (minutes,)
622- else:
623- return ngettext("%d second", "%d seconds", seconds) % (seconds,)
624-
625- def on_window_destroy(self, *args):
626- '''Exit the application when the window is closed.'''
627- Gtk.main_quit()
628-
629- def on_close_clicked(self, *args):
630- '''Exit the application when the window is closed.'''
631- Gtk.main_quit()
632+ def write_light_locker_file(self, filepath, light_locker_command):
633+ '''Write the updated light-locker settings to its .desktop file.'''
634+ exec_str = "Exec=%s\n" % light_locker_command
635+ with open(filepath, 'w') as f:
636+ for line in self.content:
637+ if line.startswith("Exec="):
638+ f.write(exec_str)
639+ else:
640+ f.write(line)
641+
642+ def write_screensaver_file(self, filepath, screensaver_command):
643+ '''Write the updated screensaver settings to its .desktop file.'''
644+ with open(filepath, 'w') as f:
645+ f.write(
646+ "[Desktop Entry]\n"
647+ "Name=%s\n"
648+ "Comment=%s\n"
649+ "Exec=%s\n"
650+ % (_("Screensaver"), _("Set screensaver timeouts"),
651+ screensaver_command))
652
653
654 if __name__ == "__main__":
655
656=== added file 'light-locker-settings/light_locker_xfsync.py'
657--- light-locker-settings/light_locker_xfsync.py 1970-01-01 00:00:00 +0000
658+++ light-locker-settings/light_locker_xfsync.py 2014-04-05 00:57:27 +0000
659@@ -0,0 +1,190 @@
660+import subprocess
661+
662+
663+def convert_value(value):
664+ """Make output agreeable to xfconf."""
665+ if isinstance(value, bool):
666+ if value is True:
667+ value = 'true'
668+ else:
669+ value = 'false'
670+ return value
671+
672+
673+def xfconf_init_property(channel, p_name, p_type, initial_value):
674+ """Initialize the specified xfconf property."""
675+ p_type = p_type.__name__
676+ initial_value = str(convert_value(initial_value))
677+ cmd = 'xfconf-query -c %s -p %s -n -s %s -t %s' % (channel, p_name,
678+ initial_value, p_type)
679+ subprocess.call(cmd.split())
680+
681+
682+def xfconf_list_properties(channel):
683+ """List the properties defined for the given channel."""
684+ settings = dict()
685+ cmd = 'xfconf-query -c %s -l -v' % channel
686+ for line in subprocess.check_output(cmd, shell=True).split('\n'):
687+ try:
688+ key, value = line.split(None, 1)
689+ except ValueError:
690+ key = line.strip()
691+ value = ""
692+ if str.isdigit(value):
693+ value = int(value)
694+ elif value.lower() in ['true', 'false']:
695+ value = value.lower() == 'true'
696+ else:
697+ value = str(value)
698+ settings[key] = value
699+ return settings
700+
701+
702+def xfconf_set_property(channel, prop, value):
703+ """Set the specified xfconf property."""
704+ value = str(value).lower()
705+ cmd = 'xfconf-query -c %s -p %s -s %s' % (channel, prop, value)
706+ subprocess.call(cmd.split())
707+
708+
709+class XfceSessionSync():
710+ """
711+ Class to set/get xfce4-session lock settings.
712+ """
713+ def __init__(self):
714+ """Initialize the XfceSessionSync instance."""
715+ self.settings = {'/shutdown/LockScreen': False}
716+ current_settings = self._get_xfce4_session_settings()
717+ self._update_settings(current_settings)
718+ self._init_xfconf_properties(current_settings)
719+
720+ def _init_xfconf_properties(self, current_settings):
721+ """If xfce4-session has not been configured, some of its properties
722+ may not exist. Create any missing properties."""
723+ channel = 'xfce4-session'
724+ for key, value in list(self.settings.items()):
725+ if key not in list(current_settings.keys()):
726+ xfconf_init_property(channel, key, type(value), value)
727+
728+ def _get_xfce4_session_settings(self):
729+ """Return a dictionary of the xfce4-session settings."""
730+ return xfconf_list_properties('xfce4-session')
731+
732+ def _update_settings(self, settings):
733+ """Update the internal settings."""
734+ for key, value in list(settings.items()):
735+ if key in list(self.settings.keys()):
736+ self.settings[key] = value
737+
738+ def get_lock(self):
739+ """Return True if Lock on Sleep is enabled."""
740+ return self.settings['/shutdown/LockScreen']
741+
742+ def set_lock(self, value):
743+ """Set the Lock on Sleep setting."""
744+ xfconf_set_property('xfce4-session', '/shutdown/LockScreen', value)
745+ self.settings['/shutdown/LockScreen'] = value
746+
747+
748+class XfpmSync():
749+ """
750+ Class to set/get xserver dpms timings via xfpm, thus keeping xfpm in sync.
751+ """
752+ def __init__(self):
753+ '''Following settings should concur with xfpm defaults'''
754+ self.settings = {'/xfce4-power-manager/dpms-enabled': True,
755+ '/xfce4-power-manager/dpms-on-battery-sleep': 5,
756+ '/xfce4-power-manager/dpms-on-battery-off': 10,
757+ '/xfce4-power-manager/dpms-on-ac-sleep': 10,
758+ '/xfce4-power-manager/dpms-on-ac-off': 15,
759+ '/xfce4-power-manager/lock-screen-suspend-hibernate':
760+ False
761+ }
762+ current_settings = self._get_xfpm_settings()
763+ self._update_settings(current_settings)
764+ self._init_xfconf_properties(current_settings)
765+
766+ def _init_xfconf_properties(self, current_settings):
767+ """
768+ If xfpm has never been used, some xfconf channel properties may not be
769+ set. Ensures that we don't get complains about missing properties.
770+ """
771+ channel = 'xfce4-power-manager'
772+ for key, value in list(self.settings.items()):
773+ if key not in list(current_settings.keys()):
774+ xfconf_init_property(channel, key, type(value), value)
775+
776+ def _get_power_state(self):
777+ """
778+ Get the power state from /sys/class/power_supply/AC/online if present.
779+ Returns:
780+ 1: AC connected
781+ 0: AC disconnected
782+ (Do we always have this file, if a battery is present?)
783+ """
784+ try:
785+ with open('/sys/class/power_supply/AC/online', 'rb') as f:
786+ pstate = int(f.readline())
787+ except:
788+ pstate = 1
789+
790+ return pstate
791+
792+ def _get_xfpm_settings(self):
793+ """Returns xfpm xfconf settings as string"""
794+ return xfconf_list_properties('xfce4-power-manager')
795+
796+ def _update_settings(self, settings):
797+ """Update the internal settings."""
798+ for key, value in list(settings.items()):
799+ if key in list(self.settings.keys()):
800+ self.settings[key] = value
801+
802+ def _get_timings_scope(self):
803+ """Return the timings scope (Batter or AC)."""
804+ if self._get_power_state() == 0:
805+ sleep = '/xfce4-power-manager/dpms-on-battery-sleep'
806+ off = '/xfce4-power-manager/dpms-on-battery-off'
807+ else: # we assume on ac for all other cases
808+ sleep = '/xfce4-power-manager/dpms-on-ac-sleep'
809+ off = '/xfce4-power-manager/dpms-on-ac-off'
810+
811+ return sleep, off
812+
813+ def set_dpms(self, sleep_time, off_time):
814+ """
815+ For most monitors *_sleep and *_off have probably the same outcome.
816+ So, basically we set the lower value for the corresponding power state.
817+ But xfpm ignores settings not in:
818+ 0 <= *_sleep <= *_off
819+ or
820+ *_off == 0 and *_sleep >= 0
821+ i.e. sometimes we have to adapt both.
822+ """
823+ sleep, off = self._get_timings_scope()
824+
825+ if not (sleep_time == 0 and off_time == 0):
826+ if sleep_time + 1 > off_time:
827+ off_time = sleep_time + 1
828+
829+ xfconf_set_property('xfce4-power-manager', off, off_time)
830+ self.settings[off] = off_time
831+
832+ xfconf_set_property('xfce4-power-manager', sleep, sleep_time)
833+ self.settings[sleep] = sleep_time
834+
835+ def get_dpms(self):
836+ """Return the current DPMS timeouts."""
837+ sleep, off = self._get_timings_scope()
838+ return self.settings[sleep], self.settings[off]
839+
840+ def get_lock(self):
841+ """Return True if Lock on Suspend/Hibernate is enabled."""
842+ prop_name = '/xfce4-power-manager/lock-screen-suspend-hibernate'
843+ return self.settings[prop_name]
844+
845+ def set_lock(self, value):
846+ """Set the Lock on Suspend/Hibernate setting."""
847+ prop_name = '/xfce4-power-manager/lock-screen-suspend-hibernate'
848+ xfconf_set_property('xfce4-power-manager', prop_name, value)
849+ self.settings[prop_name] = value
850
851=== modified file 'po/ca.po'
852--- po/ca.po 2014-03-24 22:31:55 +0000
853+++ po/ca.po 2014-04-05 00:57:27 +0000
854@@ -15,7 +15,7 @@
855 "Content-Type: text/plain; charset=UTF-8\n"
856 "Content-Transfer-Encoding: 8bit\n"
857 "Plural-Forms: nplurals=2; plural=n != 1;\n"
858-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
859+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
860 "X-Generator: Launchpad (build 16967)\n"
861
862 #: ../light-locker-settings.desktop.in.h:1
863
864=== modified file 'po/de.po'
865--- po/de.po 2014-03-24 22:31:55 +0000
866+++ po/de.po 2014-04-05 00:57:27 +0000
867@@ -15,7 +15,7 @@
868 "Content-Type: text/plain; charset=UTF-8\n"
869 "Content-Transfer-Encoding: 8bit\n"
870 "Plural-Forms: nplurals=2; plural=n != 1;\n"
871-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
872+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
873 "X-Generator: Launchpad (build 16967)\n"
874
875 #: ../light-locker-settings.desktop.in.h:1
876
877=== modified file 'po/en_AU.po'
878--- po/en_AU.po 2014-03-24 22:31:55 +0000
879+++ po/en_AU.po 2014-04-05 00:57:27 +0000
880@@ -15,7 +15,7 @@
881 "Content-Type: text/plain; charset=UTF-8\n"
882 "Content-Transfer-Encoding: 8bit\n"
883 "Plural-Forms: nplurals=2; plural=n != 1;\n"
884-"X-Launchpad-Export-Date: 2014-03-24 07:12+0000\n"
885+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
886 "X-Generator: Launchpad (build 16967)\n"
887
888 #: ../light-locker-settings.desktop.in.h:1
889
890=== modified file 'po/es.po'
891--- po/es.po 2014-03-24 22:31:55 +0000
892+++ po/es.po 2014-04-05 00:57:27 +0000
893@@ -15,7 +15,7 @@
894 "Content-Type: text/plain; charset=UTF-8\n"
895 "Content-Transfer-Encoding: 8bit\n"
896 "Plural-Forms: nplurals=2; plural=n != 1;\n"
897-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
898+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
899 "X-Generator: Launchpad (build 16967)\n"
900
901 #: ../light-locker-settings.desktop.in.h:1
902
903=== modified file 'po/fi.po'
904--- po/fi.po 2014-03-24 22:31:55 +0000
905+++ po/fi.po 2014-04-05 00:57:27 +0000
906@@ -15,7 +15,7 @@
907 "Content-Type: text/plain; charset=UTF-8\n"
908 "Content-Transfer-Encoding: 8bit\n"
909 "Plural-Forms: nplurals=2; plural=n != 1;\n"
910-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
911+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
912 "X-Generator: Launchpad (build 16967)\n"
913
914 #: ../light-locker-settings.desktop.in.h:1
915
916=== modified file 'po/fr.po'
917--- po/fr.po 2014-03-24 22:31:55 +0000
918+++ po/fr.po 2014-04-05 00:57:27 +0000
919@@ -8,14 +8,14 @@
920 "Project-Id-Version: light-locker-settings\n"
921 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
922 "POT-Creation-Date: 2014-03-23 23:00-0400\n"
923-"PO-Revision-Date: 2014-03-16 03:52+0000\n"
924+"PO-Revision-Date: 2014-03-24 11:08+0000\n"
925 "Last-Translator: Urien Desterres <urien.desterres@gmail.com>\n"
926 "Language-Team: French <fr@li.org>\n"
927 "MIME-Version: 1.0\n"
928 "Content-Type: text/plain; charset=UTF-8\n"
929 "Content-Transfer-Encoding: 8bit\n"
930 "Plural-Forms: nplurals=2; plural=n > 1;\n"
931-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
932+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
933 "X-Generator: Launchpad (build 16967)\n"
934
935 #: ../light-locker-settings.desktop.in.h:1
936@@ -29,11 +29,11 @@
937
938 #: ../light-locker-settings/light-locker-settings.glade.h:1
939 msgid "When the screensaver is activated"
940-msgstr ""
941+msgstr "Lorsque l’économiseur d’écran est activé"
942
943 #: ../light-locker-settings/light-locker-settings.glade.h:2
944 msgid "When the screensaver is deactivated"
945-msgstr ""
946+msgstr "Lorsque l’économiseur d’écran est désactivé"
947
948 #: ../light-locker-settings/light-locker-settings.glade.h:3
949 #: ../light-locker-settings/light-locker-settings.py:305
950@@ -63,7 +63,7 @@
951
952 #: ../light-locker-settings/light-locker-settings.glade.h:9
953 msgid "Automatically lock the session"
954-msgstr ""
955+msgstr "Verrouiller automatiquement la session"
956
957 #: ../light-locker-settings/light-locker-settings.glade.h:10
958 msgid "Delay locking after screensaver for"
959@@ -80,7 +80,7 @@
960
961 #: ../light-locker-settings/light-locker-settings.glade.h:13
962 msgid "Lock on suspend"
963-msgstr ""
964+msgstr "Verrouiller lors de la mise en veille"
965
966 #: ../light-locker-settings/light-locker-settings.glade.h:14
967 msgid "Apply"
968
969=== modified file 'po/ja.po'
970--- po/ja.po 2014-03-24 22:31:55 +0000
971+++ po/ja.po 2014-04-05 00:57:27 +0000
972@@ -8,14 +8,14 @@
973 "Project-Id-Version: light-locker-settings\n"
974 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
975 "POT-Creation-Date: 2014-03-23 23:00-0400\n"
976-"PO-Revision-Date: 2014-03-20 12:58+0000\n"
977+"PO-Revision-Date: 2014-03-31 11:20+0000\n"
978 "Last-Translator: zriv <Unknown>\n"
979 "Language-Team: Japanese <ja@li.org>\n"
980 "MIME-Version: 1.0\n"
981 "Content-Type: text/plain; charset=UTF-8\n"
982 "Content-Transfer-Encoding: 8bit\n"
983 "Plural-Forms: nplurals=1; plural=0;\n"
984-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
985+"X-Launchpad-Export-Date: 2014-04-01 07:21+0000\n"
986 "X-Generator: Launchpad (build 16967)\n"
987
988 #: ../light-locker-settings.desktop.in.h:1
989@@ -29,11 +29,11 @@
990
991 #: ../light-locker-settings/light-locker-settings.glade.h:1
992 msgid "When the screensaver is activated"
993-msgstr ""
994+msgstr "スクリーンセーバー起動後にする"
995
996 #: ../light-locker-settings/light-locker-settings.glade.h:2
997 msgid "When the screensaver is deactivated"
998-msgstr ""
999+msgstr "スクリーンセーバー終了後にする"
1000
1001 #: ../light-locker-settings/light-locker-settings.glade.h:3
1002 #: ../light-locker-settings/light-locker-settings.py:305
1003@@ -63,7 +63,7 @@
1004
1005 #: ../light-locker-settings/light-locker-settings.glade.h:9
1006 msgid "Automatically lock the session"
1007-msgstr ""
1008+msgstr "自動的にセッションのロックを"
1009
1010 #: ../light-locker-settings/light-locker-settings.glade.h:10
1011 msgid "Delay locking after screensaver for"
1012@@ -79,7 +79,7 @@
1013
1014 #: ../light-locker-settings/light-locker-settings.glade.h:13
1015 msgid "Lock on suspend"
1016-msgstr ""
1017+msgstr "サスペンドする時にロックする"
1018
1019 #: ../light-locker-settings/light-locker-settings.glade.h:14
1020 msgid "Apply"
1021
1022=== modified file 'po/nl.po'
1023--- po/nl.po 2014-03-24 22:31:55 +0000
1024+++ po/nl.po 2014-04-05 00:57:27 +0000
1025@@ -8,14 +8,14 @@
1026 "Project-Id-Version: light-locker-settings\n"
1027 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1028 "POT-Creation-Date: 2014-03-23 23:00-0400\n"
1029-"PO-Revision-Date: 2014-03-16 03:51+0000\n"
1030-"Last-Translator: Light Locker Settings Team <Unknown>\n"
1031+"PO-Revision-Date: 2014-03-29 10:53+0000\n"
1032+"Last-Translator: Pjotr12345 <Unknown>\n"
1033 "Language-Team: Dutch <nl@li.org>\n"
1034 "MIME-Version: 1.0\n"
1035 "Content-Type: text/plain; charset=UTF-8\n"
1036 "Content-Transfer-Encoding: 8bit\n"
1037 "Plural-Forms: nplurals=2; plural=n != 1;\n"
1038-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
1039+"X-Launchpad-Export-Date: 2014-03-30 06:33+0000\n"
1040 "X-Generator: Launchpad (build 16967)\n"
1041
1042 #: ../light-locker-settings.desktop.in.h:1
1043@@ -29,11 +29,11 @@
1044
1045 #: ../light-locker-settings/light-locker-settings.glade.h:1
1046 msgid "When the screensaver is activated"
1047-msgstr ""
1048+msgstr "Wanneer de schermbeveiliging is ingeschakeld"
1049
1050 #: ../light-locker-settings/light-locker-settings.glade.h:2
1051 msgid "When the screensaver is deactivated"
1052-msgstr ""
1053+msgstr "Wanneer de schermbeveiliging is uitgeschakeld"
1054
1055 #: ../light-locker-settings/light-locker-settings.glade.h:3
1056 #: ../light-locker-settings/light-locker-settings.py:305
1057@@ -63,7 +63,7 @@
1058
1059 #: ../light-locker-settings/light-locker-settings.glade.h:9
1060 msgid "Automatically lock the session"
1061-msgstr ""
1062+msgstr "Sessie automatisch vergrendelen"
1063
1064 #: ../light-locker-settings/light-locker-settings.glade.h:10
1065 msgid "Delay locking after screensaver for"
1066@@ -80,7 +80,7 @@
1067
1068 #: ../light-locker-settings/light-locker-settings.glade.h:13
1069 msgid "Lock on suspend"
1070-msgstr ""
1071+msgstr "Vergrendelen bij pauzestand"
1072
1073 #: ../light-locker-settings/light-locker-settings.glade.h:14
1074 msgid "Apply"
1075
1076=== modified file 'po/pl.po'
1077--- po/pl.po 2014-03-24 22:31:55 +0000
1078+++ po/pl.po 2014-04-05 00:57:27 +0000
1079@@ -8,7 +8,7 @@
1080 "Project-Id-Version: light-locker-settings\n"
1081 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1082 "POT-Creation-Date: 2014-03-23 23:00-0400\n"
1083-"PO-Revision-Date: 2014-03-16 03:49+0000\n"
1084+"PO-Revision-Date: 2014-03-28 14:47+0000\n"
1085 "Last-Translator: Piotr Strębski <strebski@o2.pl>\n"
1086 "Language-Team: Polish <pl@li.org>\n"
1087 "MIME-Version: 1.0\n"
1088@@ -16,7 +16,7 @@
1089 "Content-Transfer-Encoding: 8bit\n"
1090 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
1091 "|| n%100>=20) ? 1 : 2;\n"
1092-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
1093+"X-Launchpad-Export-Date: 2014-03-29 07:45+0000\n"
1094 "X-Generator: Launchpad (build 16967)\n"
1095
1096 #: ../light-locker-settings.desktop.in.h:1
1097@@ -30,11 +30,11 @@
1098
1099 #: ../light-locker-settings/light-locker-settings.glade.h:1
1100 msgid "When the screensaver is activated"
1101-msgstr ""
1102+msgstr "Gdy wygaszacz ekranu jest włączony"
1103
1104 #: ../light-locker-settings/light-locker-settings.glade.h:2
1105 msgid "When the screensaver is deactivated"
1106-msgstr ""
1107+msgstr "Gdy wygaszacz ekranu jest wyłączony"
1108
1109 #: ../light-locker-settings/light-locker-settings.glade.h:3
1110 #: ../light-locker-settings/light-locker-settings.py:305
1111@@ -64,7 +64,7 @@
1112
1113 #: ../light-locker-settings/light-locker-settings.glade.h:9
1114 msgid "Automatically lock the session"
1115-msgstr ""
1116+msgstr "Automatycznie blokuj sesję"
1117
1118 #: ../light-locker-settings/light-locker-settings.glade.h:10
1119 msgid "Delay locking after screensaver for"
1120@@ -80,7 +80,7 @@
1121
1122 #: ../light-locker-settings/light-locker-settings.glade.h:13
1123 msgid "Lock on suspend"
1124-msgstr ""
1125+msgstr "Zablokuj po wybudzeniu"
1126
1127 #: ../light-locker-settings/light-locker-settings.glade.h:14
1128 msgid "Apply"
1129@@ -99,15 +99,17 @@
1130 #, python-format
1131 msgid "%d minute"
1132 msgid_plural "%d minutes"
1133-msgstr[0] ""
1134-msgstr[1] ""
1135+msgstr[0] "%d minuta"
1136+msgstr[1] "%d minuty"
1137+msgstr[2] "%d minut"
1138
1139 #: ../light-locker-settings/light-locker-settings.py:411
1140 #, python-format
1141 msgid "%d second"
1142 msgid_plural "%d seconds"
1143-msgstr[0] ""
1144-msgstr[1] ""
1145+msgstr[0] "%d sekunda"
1146+msgstr[1] "%d sekundy"
1147+msgstr[2] "%d sekund"
1148
1149 #~ msgid "Lock automatically after screensaver"
1150 #~ msgstr "Automatycznie zablokuj po wygaszaczu ekranu"
1151
1152=== modified file 'po/pt.po'
1153--- po/pt.po 2014-03-24 22:31:55 +0000
1154+++ po/pt.po 2014-04-05 00:57:27 +0000
1155@@ -15,7 +15,7 @@
1156 "Content-Type: text/plain; charset=UTF-8\n"
1157 "Content-Transfer-Encoding: 8bit\n"
1158 "Plural-Forms: nplurals=2; plural=n != 1;\n"
1159-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
1160+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
1161 "X-Generator: Launchpad (build 16967)\n"
1162
1163 #: ../light-locker-settings.desktop.in.h:1
1164
1165=== modified file 'po/pt_BR.po'
1166--- po/pt_BR.po 2014-03-24 22:31:55 +0000
1167+++ po/pt_BR.po 2014-04-05 00:57:27 +0000
1168@@ -15,7 +15,7 @@
1169 "Content-Type: text/plain; charset=UTF-8\n"
1170 "Content-Transfer-Encoding: 8bit\n"
1171 "Plural-Forms: nplurals=2; plural=n > 1;\n"
1172-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
1173+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
1174 "X-Generator: Launchpad (build 16967)\n"
1175
1176 #: ../light-locker-settings.desktop.in.h:1
1177
1178=== modified file 'po/pt_PT.po'
1179--- po/pt_PT.po 2014-03-24 22:31:55 +0000
1180+++ po/pt_PT.po 2014-04-05 00:57:27 +0000
1181@@ -15,7 +15,7 @@
1182 "Content-Type: text/plain; charset=UTF-8\n"
1183 "Content-Transfer-Encoding: 8bit\n"
1184 "Plural-Forms: nplurals=2; plural=n != 1;\n"
1185-"X-Launchpad-Export-Date: 2014-03-24 07:12+0000\n"
1186+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
1187 "X-Generator: Launchpad (build 16967)\n"
1188
1189 #: ../light-locker-settings.desktop.in.h:1
1190
1191=== modified file 'po/ru.po'
1192--- po/ru.po 2014-03-24 22:31:55 +0000
1193+++ po/ru.po 2014-04-05 00:57:27 +0000
1194@@ -16,7 +16,7 @@
1195 "Content-Transfer-Encoding: 8bit\n"
1196 "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
1197 "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
1198-"X-Launchpad-Export-Date: 2014-03-24 07:11+0000\n"
1199+"X-Launchpad-Export-Date: 2014-03-25 07:33+0000\n"
1200 "X-Generator: Launchpad (build 16967)\n"
1201
1202 #: ../light-locker-settings.desktop.in.h:1

Subscribers

People subscribed via source and target branches

to all changes: