Exemplo n.º 1
0
class GeneralSettings(QWidget):
    def __init__(self,parent=None):
        QWidget.__init__(self,parent)
        self.ui = GeneralSettings_Form()
        self.ui.setupUi(self)
        self.initUi()

    def initUi(self):
        self.makeContacts()
        self.makeThreads()
        self.makeChunksize()
        QObject.connect(self.ui.horizontalSlider, SIGNAL('sliderMoved(int)'), self.sliderMoved)
        QObject.connect(self.ui.plainTextEdit, SIGNAL('textChanged()'),self.textchanged)

    def textchanged(self):
        defaultText = """xxx.xxx.xxx.xxx - NAME (xses are IP address)

Each recipient has to be declared in new line. If you understand this than clear this box and fill it with your buddies :)
Example:
212.106.166.37 - Jerzy Spendel"""
        if self.ui.plainTextEdit.toPlainText() == '':
            pass
        elif self.ui.plainTextEdit.toPlainText() != defaultText:
            pass

    def sliderMoved(self,msg):
        self.ui.label_4.setText(str(msg))

    def makeContacts(self):
        text = ''
        for pair in Config.openContacts():
            text = text+pair[0]+' - '+pair[1]+'\n'
        self.ui.plainTextEdit.setPlainText(text)

    def makeThreads(self):
        self.ui.horizontalSlider.setValue(int(Config.data['THREADS']))
        self.ui.label_4.setText(str(Config.data['THREADS']))

    def makeChunksize(self):
        self.ui.lineEdit.setText(str(Config.data['CHUNK_SIZE']))
Exemplo n.º 2
0
 def __init__(self,parent=None):
     QWidget.__init__(self,parent)
     self.ui = GeneralSettings_Form()
     self.ui.setupUi(self)
     self.initUi()