summaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorbionel <ionel.busuioc@gmail.com>2018-03-24 23:06:03 +0200
committerbionel <ionel.busuioc@gmail.com>2018-03-24 23:06:03 +0200
commit9a1341e32e82dd13e7b584e484b169817b4da2c6 (patch)
treef1acad77cfd35e275fee849b8a1da94f097ea2c4 /src/frontend
parent3a9714df4681b5cf022a8c469d0e79fbe9bc677c (diff)
add config gui
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/gui/mirrors.conf.sample13
-rwxr-xr-xsrc/frontend/gui/sisyphus-config.py49
-rw-r--r--src/frontend/gui/ui/sisyphus-config.ui137
3 files changed, 199 insertions, 0 deletions
diff --git a/src/frontend/gui/mirrors.conf.sample b/src/frontend/gui/mirrors.conf.sample
new file mode 100644
index 0000000..6be0b29
--- /dev/null
+++ b/src/frontend/gui/mirrors.conf.sample
@@ -0,0 +1,13 @@
+#######################################################
+# Support for multiple mirrors is somewhat incomplete #
+# Uncomment only one mirror from the list bellow #
+#######################################################
+
+# Princeton University (USA) mirror
+# PORTAGE_BINHOST="http://mirror.math.princeton.edu/pub/redcorelinux/packages/"
+
+# Alpix.eu (Germany) mirror
+PORTAGE_BINHOST="http://mirror.alpix.eu/redcorelinux/packages/"
+
+# Yandex.ru (Russia) mirror
+# PORTAGE_BINHOST="http://mirror.yandex.ru/mirrors/redcorelinux/packages/"
diff --git a/src/frontend/gui/sisyphus-config.py b/src/frontend/gui/sisyphus-config.py
new file mode 100755
index 0000000..35afccc
--- /dev/null
+++ b/src/frontend/gui/sisyphus-config.py
@@ -0,0 +1,49 @@
+#!/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.closeButton.clicked.connect(self.SisyphusConfigExit)
+ self.applyButton.clicked.connect(self.SisyphusConfigApply)
+ 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()
+
+if __name__ == '__main__':
+ app = QtWidgets.QApplication(sys.argv)
+ window = SisyphusConfig()
+ sys.exit(app.exec_())
diff --git a/src/frontend/gui/ui/sisyphus-config.ui b/src/frontend/gui/ui/sisyphus-config.ui
new file mode 100644
index 0000000..0ec2a33
--- /dev/null
+++ b/src/frontend/gui/ui/sisyphus-config.ui
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>640</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>640</width>
+ <height>480</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>640</width>
+ <height>480</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Sisyphus settings</string>
+ </property>
+ <property name="windowIcon">
+ <iconset theme="applications-utilities">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="mirrorGroupBox">
+ <property name="title">
+ <string>Select Mirror</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QComboBox" name="mirrorCombo">
+ <property name="currentText">
+ <string notr="true"/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="aboutGroupBox">
+ <property name="title">
+ <string>About</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QTextBrowser" name="aboutText">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="html">
+ <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Sisyphus is the package manager used in Redcore Linux.&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;In it's essence Sisyphus is a simple wrapper around portage, gentoolkit, and portage-utils&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;that provides an apt-get/yum-alike interface to these commands, to assist newcomer people transitioning from Debian/RedHat-based systems to Gentoo.&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Author:&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Ghiunhan Mamut &amp;lt;v3n3rix&amp;gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;mailto:venerix@redcorelinux.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;venerix@redcorelinux.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Contributors:&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Ionel Busuioc &amp;lt;bionel&amp;gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
+&lt;p align=&quot;right&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Copyleft (ɔ) 2016 - 2018 Redcore Linux Project&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>338</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="closeButton">
+ <property name="text">
+ <string>Close</string>
+ </property>
+ <property name="icon">
+ <iconset theme="dialog-close">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="applyButton">
+ <property name="text">
+ <string>Apply</string>
+ </property>
+ <property name="icon">
+ <iconset theme="dialog-ok-apply">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>