diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-03-26 16:56:54 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-03-26 16:56:54 +0100 |
commit | 3a582f243a8294ed87f40a7f8e0453a4b0637fcc (patch) | |
tree | 4e52a752c1d01518146a3df4c918a1b1fe0c03d7 /src/frontend/gui/sisyphusconfig.py | |
parent | e9fd0c598c98db90ffd2a71b0a01c72e0dd52c2a (diff) |
merge mirror settings window into main application
Diffstat (limited to 'src/frontend/gui/sisyphusconfig.py')
-rwxr-xr-x | src/frontend/gui/sisyphusconfig.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/frontend/gui/sisyphusconfig.py b/src/frontend/gui/sisyphusconfig.py deleted file mode 100755 index 35e50fe..0000000 --- a/src/frontend/gui/sisyphusconfig.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python3 -import sys -from PyQt5 import QtCore, QtGui, QtWidgets, uic -from libsisyphus import getMirrors, setActiveMirror - -class SisyphusConfig(QtWidgets.QMainWindow): - def __init__(self): - super(SisyphusConfig, self).__init__() - uic.loadUi('ui/sisyphus-config.ui', self) - self.centerOnScreen() - self.MIRRORLIST = getMirrors() - self.updateMirrorList() - self.show() - self.applyButton.pressed.connect(self.SisyphusConfigApply) - self.applyButton.released.connect(self.SisyphusConfigExit) - self.mirrorCombo.activated.connect(self.setMirrorList) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def updateMirrorList(self): - model = QtGui.QStandardItemModel() - for row in self.MIRRORLIST: - indx = self.MIRRORLIST.index(row) - item = QtGui.QStandardItem() - item.setText(row['Url']) - model.setItem(indx, item) - if row['isActive'] : - self.ACTIVEMIRRORINDEX = indx - self.mirrorCombo.setModel(model) - self.mirrorCombo.setCurrentIndex(self.ACTIVEMIRRORINDEX) - - def setMirrorList(self): - self.MIRRORLIST[self.ACTIVEMIRRORINDEX]['isActive'] = False - self.ACTIVEMIRRORINDEX = self.mirrorCombo.currentIndex() - self.MIRRORLIST[self.ACTIVEMIRRORINDEX]['isActive'] = True - - def SisyphusConfigApply(self): - setActiveMirror(self.MIRRORLIST) - - def SisyphusConfigExit(self): - self.close() |