version 2 maybe?
This commit is contained in:
parent
b96074afe0
commit
358968327d
10
interface.ui
10
interface.ui
|
@ -97,7 +97,7 @@
|
||||||
<object class="GtkImage">
|
<object class="GtkImage">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="icon_name">edit-clear-symbolic</property>
|
<property name="icon_name">edit-clear-symbolic</property>
|
||||||
<property name="icon_size">80</property>
|
<property name="icon_size">6</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
@ -105,13 +105,17 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="focus-on-click">False</property>
|
<property name="focus-on-click">False</property>
|
||||||
<signal name="clicked" handler="backspace"/>
|
<signal name="clicked" handler="de_popover"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage">
|
<object class="GtkImage">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="icon_name">applications-system-symbolic</property>
|
<property name="icon_name">applications-system-symbolic</property>
|
||||||
<property name="icon_size">80</property>
|
<property name="icon_size">6</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkPopover" id="de_select">
|
||||||
|
<property name="relative_to">settings_btn</property>
|
||||||
|
<property name="position">GTK_POS_RIGHT</property>
|
||||||
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
|
@ -20,9 +20,28 @@ class Handler:
|
||||||
self.greeter.connect("show-prompt", self.show_prompt)
|
self.greeter.connect("show-prompt", self.show_prompt)
|
||||||
self.pmpt_label = builder.get_object("prompt_label")
|
self.pmpt_label = builder.get_object("prompt_label")
|
||||||
self.msg_label = builder.get_object("message_label")
|
self.msg_label = builder.get_object("message_label")
|
||||||
|
self.de_select = builder.get_object("de_select")
|
||||||
|
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, visible=True)
|
||||||
|
self.de_select.add(vbox)
|
||||||
self.greeter.connect_sync()
|
self.greeter.connect_sync()
|
||||||
self.conf = Config()
|
self.conf = Config()
|
||||||
self.greeter.authenticate(self.conf.user)
|
self.greeter.authenticate(self.conf.user)
|
||||||
|
self.session = self.greeter.get_default_session_hint()
|
||||||
|
sessions = iter([(s.get_name(), s.get_key()) for s in LightDM.get_sessions()])
|
||||||
|
name, key = sessions.__next__()
|
||||||
|
first = Gtk.RadioButton.new_with_label(None, name)
|
||||||
|
first.connect("toggled", self.session_change, key)
|
||||||
|
vbox.add(first)
|
||||||
|
for name, key in sessions:
|
||||||
|
rb = Gtk.RadioButton.new_with_label_from_widget(first, name)
|
||||||
|
rb.connect("toggled", self.session_change, key)
|
||||||
|
vbox.add(rb)
|
||||||
|
if self.session == key:
|
||||||
|
rb.set_active(True)
|
||||||
|
vbox.show_all()
|
||||||
|
|
||||||
|
def session_change(self, rb, key):
|
||||||
|
self.session = key
|
||||||
|
|
||||||
def on_destry(self, window):
|
def on_destry(self, window):
|
||||||
Gtk.main_quit()
|
Gtk.main_quit()
|
||||||
|
@ -39,7 +58,7 @@ class Handler:
|
||||||
|
|
||||||
def auth_complete(self, greeter):
|
def auth_complete(self, greeter):
|
||||||
if greeter.get_is_authenticated():
|
if greeter.get_is_authenticated():
|
||||||
greeter.start_session_sync(None)
|
greeter.start_session_sync(self.session)
|
||||||
else:
|
else:
|
||||||
greeter.authenticate(self.conf.user)
|
greeter.authenticate(self.conf.user)
|
||||||
|
|
||||||
|
@ -49,6 +68,9 @@ class Handler:
|
||||||
def show_prompt(self, greeter, text, type):
|
def show_prompt(self, greeter, text, type):
|
||||||
self.pmpt_label.set_text(text)
|
self.pmpt_label.set_text(text)
|
||||||
|
|
||||||
|
def de_popover(self, settings_btn):
|
||||||
|
self.de_select.popup()
|
||||||
|
|
||||||
|
|
||||||
Handy.Keypad()
|
Handy.Keypad()
|
||||||
builder: Gtk.Builder = Gtk.Builder.new_from_file(
|
builder: Gtk.Builder = Gtk.Builder.new_from_file(
|
||||||
|
|
Loading…
Reference in New Issue