Beispiel #1
0
 def authenticate(self, password):
     """
     Authenticates the entered password against the system PAM provider.
     """
     CinnamonDesktop.desktop_check_user_password(self.user_name,
                                                 password,
                                                 self.authenticate_callback)
    def __init__(self, away_message=None, initial_monitor=0):
        super(ClockWidget, self).__init__(initial_monitor)
        self.get_style_context().add_class("clock")
        self.set_halign(Gtk.Align.START)

        self.clock = None

        if not settings.get_show_clock():
            return

        self.away_message = away_message

        self.label = Gtk.Label()
        self.label.show()
        self.add(self.label)

        self.clock = CinnamonDesktop.WallClock()
        self.set_clock_format()

        trackers.con_tracker_get().connect(self.clock,
                                           "notify::clock",
                                           self.on_clock_changed)

        tz = Gio.File.new_for_path(path="/etc/localtime")
        self.tz_monitor = tz.monitor_file(0, None)

        trackers.con_tracker_get().connect(self.tz_monitor,
                                           "changed",
                                           self.on_tz_changed)

        trackers.con_tracker_get().connect(self,
                                           "destroy",
                                           self.on_destroy)

        self.update_clock()
Beispiel #3
0
    def __init__(self, screen, away_message=None, initial_monitor=0):
        super(ClockWidget, self).__init__()
        self.screen = screen
        # self.set_name("clock")
        self.get_style_context().add_class("clock")

        self.set_halign(Gtk.Align.CENTER)
        self.set_valign(Gtk.Align.CENTER)

        self.current_monitor = initial_monitor

        self.away_message = away_message

        self.label = Gtk.Label()
        self.label.show()
        self.add(self.label)

        self.clock_tracker = CinnamonDesktop.WallClock()

        trackers.con_tracker_get().connect(self.clock_tracker, "notify::clock",
                                           self.on_clock_changed)

        tz = Gio.File.new_for_path(path="/etc/localtime")
        self.tz_monitor = tz.monitor_file(0, None)

        trackers.con_tracker_get().connect(self.tz_monitor, "changed",
                                           self.on_tz_changed)

        self.update_clock()
    def load_bindings(self):
        self.shortcut_actions = []

        for action_id in ALLOWED_ACTIONS:
            bindings = self.media_key_settings.get_strv(CinnamonDesktop.desktop_get_media_key_string(action_id))

            action = ShortcutAction(action_id, bindings)

            self.shortcut_actions.append(action)
    def load_bindings(self):
        self.shortcut_actions = []

        for action_id in ALLOWED_ACTIONS:
            bindings = self.media_key_settings.get_strv(CinnamonDesktop.desktop_get_media_key_string(action_id))

            action = ShortcutAction(action_id, bindings)

            self.shortcut_actions.append(action)
    def __init__(self, away_message=None, initial_monitor=0, low_res=False):
        super(ClockWidget, self).__init__(initial_monitor)
        self.get_style_context().add_class("clock")
        self.set_halign(Gtk.Align.START)

        self.set_property("margin", 6)

        self.clock = None
        self.low_res = low_res

        if not settings.get_show_clock():
            return

        self.away_message = away_message

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.add(box)
        box.show()

        self.label = Gtk.Label()
        self.label.show()
        self.label.set_line_wrap(True)
        self.label.set_alignment(0.5, 0.5)

        box.pack_start(self.label, True, False, 6)

        self.msg_label = Gtk.Label()
        self.msg_label.show()
        self.msg_label.set_line_wrap(True)
        self.msg_label.set_alignment(0.5, 0.5)

        if self.low_res:
            self.msg_label.set_max_width_chars(50)
        else:
            self.msg_label.set_max_width_chars(80)

        box.pack_start(self.msg_label, True, True, 6)

        self.clock = CinnamonDesktop.WallClock()
        self.set_clock_format()

        trackers.con_tracker_get().connect(self.clock, "notify::clock",
                                           self.on_clock_changed)

        tz = Gio.File.new_for_path(path="/etc/localtime")
        self.tz_monitor = tz.monitor_file(0, None)

        trackers.con_tracker_get().connect(self.tz_monitor, "changed",
                                           self.on_tz_changed)

        trackers.con_tracker_get().connect(self, "destroy", self.on_destroy)

        self.update_clock()
Beispiel #7
0
KeybindingHandlerClient = _KeybindingHandlerClient()
MediaPlayerWatcher = _MediaPlayerWatcher()
AccountsServiceClient = _AccountsServiceClient()

# The notification watcher is a C introspected class - some of the functions it uses
# don't work well via introspection.
from gi.repository import CScreensaver

NotificationWatcher = CScreensaver.NotificationWatcher()

# We only need one instance of CinnamonDesktop.BG - have it listen to bg gsettings changes
# and we just connect to "changed" on the Backgrounds object from our user (the Stage)
gi.require_version('CinnamonDesktop', '3.0')
from gi.repository import CinnamonDesktop

Backgrounds = CinnamonDesktop.BG()
Backgrounds.load_from_preferences(settings.bg_settings)
settings.bg_settings.connect("changed",
                             lambda s, k: Backgrounds.load_from_preferences(s))

# We use XAppKbdLayoutController as a wrapper around libgnomekbd to supply the icon theme
# with icons, as well as providing correct group names.
gi.require_version('XApp', '1.0')
from gi.repository import XApp

KeyboardLayoutController = XApp.KbdLayoutController()

# The login client is a bit different - we can have either logind or ConsoleKit.
# So, we have to do a bit more work to determine which one we're going to use.
# This doesn't really need to impact the main startup business though - whichever
# one we end up using, all we're doing is connecting to signals from one or the
Beispiel #8
0
 def authenticate(self, password):
     """
     Authenticates the entered password against the system PAM provider.
     """
     CinnamonDesktop.desktop_check_user_password(self.user_name, password,
                                                 self.authenticate_callback)
Beispiel #9
0
 def on_install_complete(self, result, data=None):
     self.progress_bar.set_text(self.checking_text)
     CinnamonDesktop.installer_check_for_packages(self.packages, self.on_check_complete)
Beispiel #10
0
 def on_install_clicked(self, widget):
     self.progress_bar.set_text(_("Installing"))
     self.stack.set_visible_child_name("progress")
     self.start_pulse()
     CinnamonDesktop.installer_install_packages(self.packages, self.on_install_complete)
Beispiel #11
0
 def check(self):
     self.start_pulse()
     CinnamonDesktop.installer_check_for_packages(self.packages, self.on_check_complete)
     return False
Beispiel #12
0
 def authenticate(self, password):
     CinnamonDesktop.desktop_check_user_password(self.user_name, password,
                                                 self.authenticate_callback)
Beispiel #13
0
 def on_install_complete(self, result, data=None):
     self.progress_bar.set_text(self.checking_text)
     CinnamonDesktop.installer_check_for_packages(self.packages,
                                                  self.on_check_complete)
Beispiel #14
0
 def on_install_clicked(self, widget):
     self.progress_bar.set_text(_("Installing"))
     self.stack.set_visible_child_name("progress")
     self.start_pulse()
     CinnamonDesktop.installer_install_packages(self.packages,
                                                self.on_install_complete)
Beispiel #15
0
 def check(self):
     self.start_pulse()
     CinnamonDesktop.installer_check_for_packages(self.packages,
                                                  self.on_check_complete)
     return False