Changeset 2547


Ignore:
Timestamp:
Oct 3, 2016, 12:38:12 PM (3 years ago)
Author:
jrpelegrina
Message:

WIP in i18n compatibility and fix switch-user semi-light client

Location:
lliurex-session-manager/trunk/fuentes
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • lliurex-session-manager/trunk/fuentes/debian/rules

    r2253 r2547  
    1111
    1212%:
    13         dh $@
     13        dh $@ --with llxdev
  • lliurex-session-manager/trunk/fuentes/install-files/usr/bin/lliurex-session-manager

    r2256 r2547  
    1212import signal
    1313signal.signal(signal.SIGINT,signal.SIG_DFL)
     14
     15import gettext
     16gettext.textdomain('lliurex-session-manager')
     17_ = gettext.gettext
     18
    1419
    1520
     
    2934                self.max_seconds=15.0
    3035                self.current_second=0
    31                 self.progress_txt="%s will %s in %s seconds..."
     36                #self.progress_txt=_("%s will %s in %s seconds...")
    3237                self.can_suspend=True
    3338                self.can_hibernate=True
     39                self.can_switch=True
    3440               
    3541                #DBUS INIT
     
    4753                self.sessman = self.session_bus.get_object("org.gnome.SessionManager","/org/gnome/SessionManager")
    4854                self.lockman = self.session_bus.get_object("org.mate.ScreenSaver","/org/mate/ScreenSaver")
    49                 display_obj = self.system_bus.get_object("org.freedesktop.DisplayManager","/org/freedesktop/DisplayManager/Seat0")
    50                 self.displayman = dbus.Interface(display_obj,"org.freedesktop.DisplayManager.Seat")
     55                try:
     56                        display_obj = self.system_bus.get_object("org.freedesktop.DisplayManager","/org/freedesktop/DisplayManager/Seat0")
     57                        self.displayman = dbus.Interface(display_obj,"org.freedesktop.DisplayManager.Seat")
     58                except:
     59                        self.can_switch=False   
    5160                login_obj=self.system_bus.get_object("org.freedesktop.login1","/org/freedesktop/login1")
    5261                self.sysman=dbus.Interface(login_obj,"org.freedesktop.login1.Manager")
     
    6271               
    6372                builder=Gtk.Builder()
     73                builder.set_translation_domain('lliurex-session-manager')
    6474                builder.add_from_file(GLADE_FILE)
    6575               
     
    117127                self.hibernate_button.set_visible(self.can_hibernate)
    118128                self.suspend_button.set_visible(self.can_suspend)
     129                self.switch_button.set_visible(self.can_switch)
    119130               
    120131               
     
    228239                self.stack.set_visible_child_name("action")
    229240                self.current_action_image.set_from_file(LOGOUT_RSRC)
    230                 self.current_action_label.set_text("Log out now")
     241                self.current_action_label.set_text(_("Log out now"))
    231242                self.execute_now_button.connect("clicked",self.execute_now,self.logout)
    232                 GLib.timeout_add(10,self.wait_to_execute,"Session","close",self.logout)
     243                GLib.timeout_add(10,self.wait_to_execute,_("The session"),_("close"),self.logout)
    233244                self.cancel_button.set_visible(False)
    234245                self.back_button.set_visible(True)
     
    249260                self.stack.set_visible_child_name("action")
    250261                self.current_action_image.set_from_file(SUSPEND_RSRC)
    251                 self.current_action_label.set_text("Suspend now")
     262                self.current_action_label.set_text(_("Suspend now"))
    252263                self.execute_now_button.connect("clicked",self.execute_now,self.suspend)
    253                 GLib.timeout_add(10,self.wait_to_execute,"System","suspend",self.suspend)
     264                GLib.timeout_add(10,self.wait_to_execute,_("The system"),_("suspend"),self.suspend)
    254265                self.cancel_button.set_visible(False)
    255266                self.back_button.set_visible(True)
     
    261272                self.stack.set_visible_child_name("action")
    262273                self.current_action_image.set_from_file(HIBERNATE_RSRC)
    263                 self.current_action_label.set_text("Hibernate now")
     274                self.current_action_label.set_text(_("Hibernate now"))
    264275                self.execute_now_button.connect("clicked",self.execute_now,self.hibernate)
    265                 GLib.timeout_add(10,self.wait_to_execute,"System","hibernate",self.hibernate)
     276                GLib.timeout_add(10,self.wait_to_execute,_("The system"),_("hibernate"),self.hibernate)
    266277                self.cancel_button.set_visible(False)
    267278                self.back_button.set_visible(True)
     
    274285                self.stack.set_visible_child_name("action")
    275286                self.current_action_image.set_from_file(REBOOT_RSRC)
    276                 self.current_action_label.set_text("Reboot now")
     287                self.current_action_label.set_text(_("Reboot now"))
    277288                self.execute_now_button.connect("clicked",self.execute_now,self.reboot)
    278                 GLib.timeout_add(10,self.wait_to_execute,"System","reboot",self.reboot)
     289                GLib.timeout_add(10,self.wait_to_execute,_("The system"),_("reboot"),self.reboot)
    279290                self.cancel_button.set_visible(False)
    280291                self.back_button.set_visible(True)
     
    286297                self.stack.set_visible_child_name("action")
    287298                self.current_action_image.set_from_file(SHUTDOWN_RSRC)
    288                 self.current_action_label.set_text("Shutdown now")
     299                self.current_action_label.set_text(_("Shutdown now"))
    289300                self.execute_now_button.connect("clicked",self.execute_now,self.shutdown)
    290                 GLib.timeout_add(10,self.wait_to_execute,"System","shutdown",self.shutdown)
     301                GLib.timeout_add(10,self.wait_to_execute,_("The system"),_("shutdown"),self.shutdown)
    291302                self.cancel_button.set_visible(False)
    292303                self.back_button.set_visible(True)
     
    300311               
    301312                csecond=int(self.max_seconds+1-self.current_second)
    302                 self.progressbar.set_text(self.progress_txt%(what,how,csecond))
     313                #self.progressbar.set_text(self.progress_txt%(what,how,csecond))
     314                self.progressbar.set_text(_("%s will %s in %s seconds...")%(what,how,csecond))
    303315                self.progressbar.set_fraction(self.current_second/self.max_seconds)
    304316                self.current_second+=0.01
     
    306318                if self.current_second>=self.max_seconds:
    307319                        print "Executing callback..."
    308                         self.progressbar.set_text(self.progress_txt%(what,how,0))
     320                        #self.progressbar.set_text(self.progress_txt%(what,how,0))
     321                        self.progressbar.set_text(_("%s will %s in %s seconds...")%(what,how,0))
    309322                        callback()
    310323                        self.exit(None)
  • lliurex-session-manager/trunk/fuentes/lliurex-po/generate_po.sh

    r2253 r2547  
    11#!/bin/bash
    22
    3 cp ../install-files/usr/sbin/lliurex-owncloud-setup /tmp/lliurex-owncloud.py
     3cp ../install-files/usr/bin/lliurex-session-manager /tmp/lliurex-session-manager.py
    44
    5 xgettext ../install-files/usr/share/lliurex-owncloud/rsrc/lliurex-owncloud-setup.glade /tmp/lliurex-owncloud.py -o lliurex-owncloud/lliurex-owncloud.pot
     5xgettext ../install-files/usr/share/lliurex-session-manager/rsrc/lliurex-session-manager.ui /tmp/lliurex-session-manager.py -o lliurex-session-manager/lliurex-session-manager.pot
    66
Note: See TracChangeset for help on using the changeset viewer.