Use python-distro to retrieve distribution information

This commit is contained in:
Silvan Calarco 2022-06-19 11:50:01 +02:00
parent 91dd46e2a6
commit 38f5e7f875
2 changed files with 7 additions and 15 deletions

View File

@ -88,22 +88,12 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="distroInfoLabel">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;mambabase - Copyright (c) 2007-2021 by Silvan Calarco&lt;br/&gt;Released under the terms of the GNU GPL v3 license&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://openmamba.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#2980b9;&quot;&gt;openmamba.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# Copyright (c) 2019-2021 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (c) 2019-2022 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Release under the terms of the GPL version 3 license # Release under the terms of the GPL version 3 license
from PyQt5 import QtGui, QtCore, QtWidgets, uic from PyQt5 import QtGui, QtCore, QtWidgets, uic
@ -9,6 +9,7 @@ from pathlib import Path
import gettext import gettext
import subprocess import subprocess
import os import os
import distro
import gi import gi
gi.require_version('PackageKitGlib', '1.0') gi.require_version('PackageKitGlib', '1.0')
@ -21,6 +22,7 @@ class MambabaseWizard(QtWidgets.QWizard):
def __init__(self, parent=None): def __init__(self, parent=None):
super(MambabaseWizard, self).__init__(parent) super(MambabaseWizard, self).__init__(parent)
self.welcomePage = WelcomePage(self) self.welcomePage = WelcomePage(self)
self.welcomePage.distroInfoLabel.setText(distro.name(pretty=True))
self.addPage(self.welcomePage) self.addPage(self.welcomePage)
self.selectGroupsPage = SelectGroupsPage(self) self.selectGroupsPage = SelectGroupsPage(self)
self.addPage(self.selectGroupsPage) self.addPage(self.selectGroupsPage)
@ -29,7 +31,7 @@ class MambabaseWizard(QtWidgets.QWizard):
self.installationPage = InstallationPage(self) self.installationPage = InstallationPage(self)
self.addPage(self.installationPage) self.addPage(self.installationPage)
self.setWindowTitle(_("openmamba base network installations") + self.setWindowTitle(_("openmamba base network installations") +
" - openmamba.org") " - " + distro.name())
self.setFixedSize(571,465) self.setFixedSize(571,465)
self.currentIdChanged.connect(self.currentIdChangedSlot) self.currentIdChanged.connect(self.currentIdChangedSlot)
self.prepareThread = PrepareThread(self) self.prepareThread = PrepareThread(self)