summaryrefslogtreecommitdiffstats
path: root/qml/mageiawelcome.py
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2018-12-23 08:32:40 +0100
committerPapoteur <papoteur@mageia.org>2018-12-23 11:01:35 +0100
commit32b24d22e1c20b2c56fe2bb853cf767a8a5b408b (patch)
treeadb567caa4eb3b104f579819805fa39fdc88654d /qml/mageiawelcome.py
parent905b6f6c9ee1b7075afc9776e65f5249904cfb40 (diff)
downloadmageiawelcome-32b24d22e1c20b2c56fe2bb853cf767a8a5b408b.tar
mageiawelcome-32b24d22e1c20b2c56fe2bb853cf767a8a5b408b.tar.gz
mageiawelcome-32b24d22e1c20b2c56fe2bb853cf767a8a5b408b.tar.bz2
mageiawelcome-32b24d22e1c20b2c56fe2bb853cf767a8a5b408b.tar.xz
mageiawelcome-32b24d22e1c20b2c56fe2bb853cf767a8a5b408b.zip
Add info on network connection
Diffstat (limited to 'qml/mageiawelcome.py')
-rw-r--r--qml/mageiawelcome.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py
index c21f930..0870f6b 100644
--- a/qml/mageiawelcome.py
+++ b/qml/mageiawelcome.py
@@ -4,6 +4,7 @@ from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQuick import QQuickView
from PyQt5.QtCore import QUrl, QLocale, QTranslator, QLibraryInfo, QVariant, QAbstractListModel, \
QModelIndex, Qt, QObject, pyqtSlot
+from PyQt5.QtNetwork import QNetworkConfigurationManager, QNetworkConfiguration
import sys
import os
import subprocess
@@ -40,6 +41,14 @@ class ConfList(QAbstractListModel):
if desktop == 'unknown':
desktop = os.getenv("XDG_CURRENT_DESKTOP")
+ # Search active network connections
+ net = QNetworkConfigurationManager()
+ netconfs = ""
+ if net.isOnline():
+ confs = net.allConfigurations(QNetworkConfiguration.Active)
+ for conf in confs:
+ netconfs += ", " + conf.name()
+
self.configuration = [
{'name': self.tr("<b>Congratulations!</b><BR />You have completed the installation of {}").format(release)},
{'name': self.tr("You are using linux kernel: {}").format(kernel)},
@@ -47,6 +56,11 @@ class ConfList(QAbstractListModel):
{'name': self.tr("You are now using the Desktop: {}").format(desktop)},
{'name': self.tr("Your user id is: {}").format(os.getuid())},
]
+ if net.isOnline():
+ self.configuration.append({'name': self.tr("You are connected to a network through {}").format(netconfs)})
+ else:
+ self.configuration.append({'name': self.tr("You have no network connection")})
+
def data(self, index, role=Qt.DisplayRole):
row = index.row()