summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2025-05-24 11:48:11 +0200
committerPapoteur <papoteur@mageia.org>2025-05-24 11:48:11 +0200
commit52c9c5f3c40a67d6ab015b2da98a49778cafbe62 (patch)
tree9cf5fe1ba5d77ad64fa5dad5220513ce6cea13bb
parent539438669f84689218029cadafb12142d7e3dfc0 (diff)
downloadmageiawelcome-52c9c5f3c40a67d6ab015b2da98a49778cafbe62.tar
mageiawelcome-52c9c5f3c40a67d6ab015b2da98a49778cafbe62.tar.gz
mageiawelcome-52c9c5f3c40a67d6ab015b2da98a49778cafbe62.tar.bz2
mageiawelcome-52c9c5f3c40a67d6ab015b2da98a49778cafbe62.tar.xz
mageiawelcome-52c9c5f3c40a67d6ab015b2da98a49778cafbe62.zip
Provide network interfaces names
-rw-r--r--src/helpers.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/helpers.py b/src/helpers.py
index 7023011..8717bef 100644
--- a/src/helpers.py
+++ b/src/helpers.py
@@ -8,6 +8,7 @@ from PyQt6.QtCore import Qt, QObject, pyqtSlot, QAbstractListModel, QModelIndex,
from PyQt6.QtNetwork import QNetworkInformation
from PyQt6.QtWidgets import QStyledItemDelegate,QLabel
from xdg.DesktopEntry import DesktopEntry
+import netifaces
translate = QCoreApplication.translate
@@ -69,23 +70,7 @@ class Autostart():
self.desktop_file_system = "/etc/xdg/autostart/mageiawelcome.desktop"
# self.conffile = self.home + "/.config/mageiawelcome/norun.flag"
- # @pyqtSlot(bool)
- # def setRunAtLaunch(self, checked):
- # print("Setting", checked)
- # if checked:
- # if os.path.exists(self.conffile):
- # os.remove(self.conffile)
- # else:
- # os.makedirs(self.home + "/.config/mageiawelcome", exist_ok=True)
- # with open(self.conffile, "w"):
- # pass
- #
- # @pyqtSlot(result=bool)
- # def startupcheck(self):
- # return not os.path.exists(self.conffile)
-
def disable(self):
- print("Désactive")
if os.path.exists(self.desktop_file):
desktop = DesktopEntry(self.desktop_file)
else:
@@ -98,7 +83,6 @@ class Autostart():
def enable(self):
# desktop in autostart is already installed in /etc we remove the local one to avoid to hide system one
- print("Active")
if os.path.exists(self.desktop_file):
os.remove(self.desktop_file)
@@ -125,7 +109,7 @@ class NetworkState(QObject):
return self.net.reachability()
def availableBackends(self):
- return self.net.availableBackends()
+ return netifaces.interfaces()
class ConfList():