Support DE-specific welcome apps
This commit is contained in:
committed by
Stefano Capitani
parent
f722229901
commit
2873c0c320
@@ -4,6 +4,8 @@
|
||||
"data_path": "/usr/share/manjaro-hello/data/",
|
||||
"desktop_path": "/usr/share/applications/manjaro-hello.desktop",
|
||||
"installer_path": "/usr/bin/calamares",
|
||||
"plasmawelcome_path": "/usr/bin/plasma-welcome",
|
||||
"gnometour_path": "/usr/bin/gnome-tour",
|
||||
"live_path": "/run/miso/bootmnt/manjaro",
|
||||
"locale_path": "/usr/share/locale/",
|
||||
"logo_path": "/usr/share/icons/hicolor/64x64/apps/manjaro.png",
|
||||
@@ -22,4 +24,4 @@
|
||||
"twitter": "https://twitter.com/ManjaroLinux",
|
||||
"wiki": "https://wiki.manjaro.org"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
-6
@@ -33,12 +33,6 @@ class EmbedManager:
|
||||
def display(self, window: Gtk.Window):
|
||||
for app in self.apps:
|
||||
app.display(window)
|
||||
if app.loaded:
|
||||
btn = window.builder.get_object(app.name)
|
||||
if self.count < 2:
|
||||
btn.set_margin_start(200)
|
||||
btn.set_margin_end(200)
|
||||
#TODO if self.count>2 !!! ???
|
||||
|
||||
|
||||
class Embed:
|
||||
@@ -214,6 +208,14 @@ class Hello(Gtk.Window):
|
||||
manager = EmbedManager(EmbedBrowser(), EmbedLayouts())
|
||||
manager.get_modules(self)
|
||||
manager.display(self)
|
||||
de = os.environ.get("DESKTOP_SESSION", "unknown")
|
||||
|
||||
if de == "plasma" and os.path.isfile(self.preferences["plasmawelcome_path"]):
|
||||
self.builder.get_object("deWelcome").set_visible(True)
|
||||
self.builder.get_object("deWelcome").set_label("Plasma Welcome")
|
||||
elif de == "gnome" and os.path.isfile(self.preferences["gnometour_path"]):
|
||||
self.builder.get_object("deWelcome").set_visible(True)
|
||||
self.builder.get_object("deWelcome").set_label("GNOME Tour")
|
||||
|
||||
self.window.show()
|
||||
|
||||
@@ -363,6 +365,14 @@ class Hello(Gtk.Window):
|
||||
dialog = self.builder.get_object("aboutdialog")
|
||||
dialog.run()
|
||||
dialog.hide()
|
||||
elif name == "deWelcome":
|
||||
de = os.environ.get("DESKTOP_SESSION", "unknown")
|
||||
|
||||
if de == "plasma":
|
||||
subprocess.Popen(["plasma-welcome"])
|
||||
elif de == "gnome":
|
||||
subprocess.Popen(["gnome-tour"])
|
||||
|
||||
|
||||
def on_btn_clicked(self, btn):
|
||||
"""Event for applications button."""
|
||||
|
||||
+18
-5
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkImage" id="abouticon">
|
||||
@@ -399,6 +399,8 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||
<property name="name">boxPlugins</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="spacing">20</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="appBrowser">
|
||||
@@ -407,8 +409,6 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="tooltip-text" translatable="yes">Common application selection</property>
|
||||
<property name="margin-left">15</property>
|
||||
<property name="margin-right">15</property>
|
||||
<signal name="clicked" handler="on_btn_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -424,8 +424,6 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="tooltip-text" translatable="yes">Manjaro Gnome config tool</property>
|
||||
<property name="margin-left">15</property>
|
||||
<property name="margin-right">15</property>
|
||||
<signal name="clicked" handler="on_btn_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -434,6 +432,21 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="deWelcome">
|
||||
<property name="label" translatable="yes"><dewelcome></property>
|
||||
<property name="name">deWelcome</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="tooltip-text" translatable="yes">Desktop Environent-specific Welcome</property>
|
||||
<signal name="clicked" handler="on_action_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
|
||||
Reference in New Issue
Block a user