commit
3d20749685
|
@ -201,10 +201,10 @@ class BreakScreen:
|
|||
"""
|
||||
logging.info("Lock the keyboard")
|
||||
self.lock_keyboard = True
|
||||
|
||||
|
||||
# Grab the keyboard
|
||||
root = self.display.screen().root
|
||||
root.change_attributes(event_mask = X.KeyPressMask|X.KeyReleaseMask)
|
||||
root.change_attributes(event_mask=X.KeyPressMask | X.KeyReleaseMask)
|
||||
root.grab_keyboard(True, X.GrabModeAsync, X.GrabModeAsync, X.CurrentTime)
|
||||
|
||||
# Consume keyboard events
|
||||
|
|
|
@ -26,6 +26,7 @@ from safeeyes import Utility
|
|||
# Global variables
|
||||
APPINDICATOR_ID = 'safeeyes'
|
||||
|
||||
|
||||
class TrayIcon:
|
||||
"""
|
||||
Create and show the tray icon along with the tray menu.
|
||||
|
|
|
@ -40,6 +40,7 @@ about_dialog_glade = os.path.join(Utility.bin_directory, "glade/about_dialog.gla
|
|||
is_active = True
|
||||
SAFE_EYES_VERSION = "1.2.1"
|
||||
|
||||
|
||||
def show_settings():
|
||||
"""
|
||||
Listen to tray icon Settings action and send the signal to Settings dialog.
|
||||
|
@ -51,6 +52,7 @@ def show_settings():
|
|||
settings_dialog = SettingsDialog(config, language, Utility.read_lang_files(), able_to_lock_screen, save_settings, settings_dialog_glade)
|
||||
settings_dialog.show()
|
||||
|
||||
|
||||
def show_about():
|
||||
"""
|
||||
Listen to tray icon About action and send the signal to About dialog.
|
||||
|
@ -59,6 +61,7 @@ def show_about():
|
|||
about_dialog = AboutDialog(about_dialog_glade, SAFE_EYES_VERSION, language)
|
||||
about_dialog.show()
|
||||
|
||||
|
||||
def show_notification():
|
||||
"""
|
||||
Receive the signal from core and pass it to the Notification.
|
||||
|
@ -68,6 +71,7 @@ def show_notification():
|
|||
plugins.pre_notification(context)
|
||||
notification.show(config['pre_break_warning_time'])
|
||||
|
||||
|
||||
def show_alert(message, image_name):
|
||||
"""
|
||||
Receive the break signal from core and pass it to the break screen.
|
||||
|
@ -79,6 +83,7 @@ def show_alert(message, image_name):
|
|||
if config['strict_break'] and is_active:
|
||||
Utility.execute_main_thread(tray_icon.unlock_menu)
|
||||
|
||||
|
||||
def close_alert(audible_alert_on):
|
||||
"""
|
||||
Receive the stop break signal from core and pass it to the break screen.
|
||||
|
@ -92,6 +97,7 @@ def close_alert(audible_alert_on):
|
|||
Utility.play_notification()
|
||||
plugins.post_break(context)
|
||||
|
||||
|
||||
def on_quit():
|
||||
"""
|
||||
Listen to the tray menu quit action and stop the core, notification and the app itself.
|
||||
|
@ -102,6 +108,7 @@ def on_quit():
|
|||
notification.quite()
|
||||
Gtk.main_quit()
|
||||
|
||||
|
||||
def handle_suspend_callback(sleeping):
|
||||
"""
|
||||
If the system goes to sleep, Safe Eyes stop the core if it is already active.
|
||||
|
@ -118,6 +125,7 @@ def handle_suspend_callback(sleeping):
|
|||
core.start()
|
||||
logging.info("Resumed Safe Eyes after system wakeup")
|
||||
|
||||
|
||||
def handle_system_suspend():
|
||||
"""
|
||||
Setup system suspend listener.
|
||||
|
@ -126,6 +134,7 @@ def handle_system_suspend():
|
|||
bus = dbus.SystemBus()
|
||||
bus.add_signal_receiver(handle_suspend_callback, 'PrepareForSleep', 'org.freedesktop.login1.Manager', 'org.freedesktop.login1')
|
||||
|
||||
|
||||
def on_skipped():
|
||||
"""
|
||||
Listen to break screen Skip action and send the signal to core.
|
||||
|
@ -137,6 +146,7 @@ def on_skipped():
|
|||
core.skip_break()
|
||||
plugins.post_break(context)
|
||||
|
||||
|
||||
def on_postponed():
|
||||
"""
|
||||
Listen to break screen Postpone action and send the signal to core.
|
||||
|
@ -147,6 +157,7 @@ def on_postponed():
|
|||
Utility.lock_desktop(system_lock_command)
|
||||
core.postpone_break()
|
||||
|
||||
|
||||
def save_settings(config):
|
||||
"""
|
||||
Listen to Settings dialog Save action and write to the config file.
|
||||
|
@ -178,6 +189,7 @@ def save_settings(config):
|
|||
# 1 sec delay is required to give enough time for core to be stopped
|
||||
Timer(1.0, core.start).start()
|
||||
|
||||
|
||||
def enable_safeeyes():
|
||||
"""
|
||||
Listen to tray icon enable action and send the signal to core.
|
||||
|
@ -186,6 +198,7 @@ def enable_safeeyes():
|
|||
is_active = True
|
||||
core.start()
|
||||
|
||||
|
||||
def disable_safeeyes():
|
||||
"""
|
||||
Listen to tray icon disable action and send the signal to core.
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"meta_info": {
|
||||
"language_name": "Eesti",
|
||||
"language_name_en": "Estonian"
|
||||
},
|
||||
"app_info": {
|
||||
"description": "Safe Eyes aitab vähendada arvutiga töötamisel silmade väsimust, tuletades meelde puhkepause."
|
||||
},
|
||||
"exercises": {
|
||||
"short_break_close_eyes": "Sulge silmad",
|
||||
"short_break_roll_eyes": "Vaata vasakule ja paremale",
|
||||
"short_break_rotate_clockwise": "Liiguta silmi kellaosuti suunas",
|
||||
"short_break_rotate_counter_clockwise": "Liiguta silmi kellaosutile vastupidiselt",
|
||||
"short_break_blink": "Pilguta silmi",
|
||||
"short_break_focus_far_distance": "Vaata kaugusesse",
|
||||
"short_break_drink_water": "Joo vett",
|
||||
"long_break_walk": "Jaluta ringi",
|
||||
"long_break_lean_back": "Toetu seljatoele ja lõõgastu"
|
||||
},
|
||||
"messages": {
|
||||
"audible_alert_disabled": "Helimärguandeid ei tekitata",
|
||||
"ready_for_a_short_break": "Lühike paus {} sekundi pärast",
|
||||
"ready_for_a_long_break": "Pikk paus {} sekundi pärast",
|
||||
"disabled_until_restart": "Peatatud taaskäivituseni",
|
||||
"disabled_until_x": "Peatatud kuni {}",
|
||||
"next_break_at": "Järgmine paus {}",
|
||||
"software_required": "Selle võimaluse jaoks tuleb paigaldada tarkvara {}"
|
||||
},
|
||||
"ui_controls": {
|
||||
"about": "Programmist",
|
||||
"allow_postpone": "Pauside edasilükkamine lubatud",
|
||||
"audible_alert": "Pausi lõpus helimärguanne",
|
||||
"cancel": "Tühista",
|
||||
"close": "Sulge",
|
||||
"disable": "Peata Safe Eyes",
|
||||
"disable_keyboard_shortcut": "Klaviatuurikäskude eiramise aeg, et vältida juhuslikku edasilükkamist (sekundit)",
|
||||
"enable": "Luba Safe Eyes",
|
||||
"enable_screen_lock": "Pikka pausi lõpus ekraani lukustamine",
|
||||
"for_x_hour": "{}-ks tunniks",
|
||||
"for_x_hours": "{}-ks tunniks",
|
||||
"for_x_minutes": "{}-ks minutiks",
|
||||
"idle_time": "Minimaalne pausi aeg (minutites)",
|
||||
"interval_between_two_breaks": "Kahe pausi vaheline aeg (minutites)",
|
||||
"language": "Keel",
|
||||
"license": "Litsents",
|
||||
"long_break_duration": "Pika pausi kestvus (sekundites)",
|
||||
"no_of_short_breaks_between_two_long_breaks": "Kui mitu lühikest pausi tehaks pikkade pauside vahel",
|
||||
"postpone": "Lükka edasi",
|
||||
"postpone_duration": "Edasilükkamise aeg (minutites)",
|
||||
"quit": "Välju",
|
||||
"save": "Salvesta",
|
||||
"settings": "Seaded",
|
||||
"short_break_duration": "Lühikese pausi kestvus (sekundites)",
|
||||
"show_time_in_tray": "Kuvatakse järgmise pausi aega",
|
||||
"skip": "Jäta vahele",
|
||||
"strict_break": "Range paus (vahelejätmise nuppu ei näidata)",
|
||||
"system_language": "Süsteemi keel",
|
||||
"time_to_prepare_for_break": "Kui kaua enne pausi kuvatakse pausi hoiatust (sekundites)",
|
||||
"time_to_screen_lock": "Kui kaua enne ekraani lukustamist saab pausi edasi lükata (sekundites)",
|
||||
"until_restart": "Kuni taaskäivituseni"
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ Comment[ca]=Protegiu-vos els ulls de la fatiga visual
|
|||
Comment[cs]=Chraňte své oči před únavou
|
||||
Comment[de]=Schützt die Augen vor Überanstrengung
|
||||
Comment[es]=Protege tus ojos de la fatiga ocular
|
||||
Comment[et]=Kaitse oma silmi väsimuse eest
|
||||
Comment[fa]=محافظت چشم هااز ضعیف شدن
|
||||
Comment[fr]=Protégez vos yeux de la fatigue
|
||||
Comment[ge]=დაიცავით თქვენი თვალები დაღლილობისაგან
|
||||
|
|
Loading…
Reference in New Issue