Exemplo n.º 1
0
    def addRequests(self, macddress, user, status):
        if status:
            ParentMaster = QtGui.QStandardItem('Connected:: {} at {}'.format(
                macddress,
                datetime.now().strftime("%H:%M")))
            ParentMaster.setIcon(QtGui.QIcon('icons/connected.png'))
            ParentMaster.setSizeHint(QtCore.QSize(30, 30))
            info1 = QtGui.QStandardItem('{}'.format(user['device']))
            info2 = QtGui.QStandardItem('{}'.format(user['IP']))
            info3 = QtGui.QStandardItem('{}'.format(
                datetime.now().strftime("%Y-%m-%d %H:%M")))
            ParentMaster.appendRow([QtGui.QStandardItem('Device::'), info1])
            ParentMaster.appendRow([QtGui.QStandardItem('IPAddr::'), info2])
            ParentMaster.appendRow(
                [QtGui.QStandardItem('Current date::'), info3])
            self.model.appendRow(ParentMaster)
            return self.MonitorTreeView.setFirstColumnSpanned(
                ParentMaster.row(), self.MonitorTreeView.rootIndex(), True)

        ParentMaster = QtGui.QStandardItem('Disconnected:: {} at {}'.format(
            macddress,
            datetime.now().strftime("%H:%M")))
        ParentMaster.setIcon(QtGui.QIcon('icons/disconnected.png'))
        ParentMaster.setSizeHint(QtCore.QSize(30, 30))
        info1 = QtGui.QStandardItem('{}'.format(user['device']))
        info2 = QtGui.QStandardItem('{}'.format(user['IP']))
        info3 = QtGui.QStandardItem('{}'.format(
            datetime.now().strftime("%Y-%m-%d %H:%M")))
        ParentMaster.appendRow([QtGui.QStandardItem('Device::'), info1])
        ParentMaster.appendRow([QtGui.QStandardItem('IPAddr::'), info2])
        ParentMaster.appendRow([QtGui.QStandardItem('Current date::'), info3])
        self.model.appendRow(ParentMaster)
        self.MonitorTreeView.setFirstColumnSpanned(
            ParentMaster.row(), self.MonitorTreeView.rootIndex(), True)
Exemplo n.º 2
0
    def __init__(self, main_method, parent=None):
        super(ImageCapture, self).__init__(parent)
        self.mainLayout = QtGui.QVBoxLayout()
        self.main_method = main_method
        #scroll area
        self.scrollwidget = QtGui.QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)
        self.imagesList = []

        self.THUMBNAIL_SIZE = 146
        self.SPACING = 8
        self.IMAGES_PER_ROW = 4
        self.TableImage = QtGui.QTableWidget()
        self.TableImage.setIconSize(QtCore.QSize(146, 146))
        self.TableImage.setColumnCount(self.IMAGES_PER_ROW)
        self.TableImage.setGridStyle(QtCore.Qt.NoPen)

        self.TableImage.verticalHeader().setDefaultSectionSize(
            self.THUMBNAIL_SIZE + self.SPACING)
        self.TableImage.verticalHeader().hide()
        self.TableImage.horizontalHeader().setDefaultSectionSize(
            self.THUMBNAIL_SIZE + self.SPACING)
        self.TableImage.horizontalHeader().hide()

        self.TableImage.setMinimumWidth((self.THUMBNAIL_SIZE + self.SPACING) *
                                        self.IMAGES_PER_ROW +
                                        (self.SPACING * 2))
        self.imageListPath = OrderedDict([('Path', [])])
        self.mainLayout.addWidget(self.TableImage)
        self.layout = QtGui.QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.addLayout(self.layout)
Exemplo n.º 3
0
 def writeModeData(self, data):
     ''' get data output and add on QtableWidgets '''
     item = QtGui.QListWidgetItem()
     item.setText(data)
     item.setSizeHint(QtCore.QSize(27, 27))
     item.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsEditable
                   | QtCore.Qt.ItemIsSelectable)
     self.maindockwidget.insertItem(self.maindockwidget.count() + 1, item)
     self.maindockwidget.scrollToBottom()
Exemplo n.º 4
0
 def set_PumpkinProxy(self):
     items = []
     for index in xrange(self.FSettings.ListRules.count()):
         items.append(str(self.FSettings.ListRules.item(index).text()))
     if self.optionsRules('PumpkinProxy') in items:
         return
     item = QtGui.QListWidgetItem()
     item.setText(self.optionsRules('PumpkinProxy'))
     item.setSizeHint(QtCore.QSize(30, 30))
     self.FSettings.ListRules.addItem(item)
Exemplo n.º 5
0
 def setRules(self, serviceName, includeStockRules = True):
     items = []
     optionRulesResults = self.optionsRules(serviceName)
     if includeStockRules:
         for index in xrange(self.FSettings.ListRules.count()):
             items.append(str(self.FSettings.ListRules.item(index).text()))
     for rule in optionRulesResults:
         if rule in items:
             continue
         item = QtGui.QListWidgetItem()
         item.setText(rule)
         item.setSizeHint(QtCore.QSize(30,30))
         self.FSettings.ListRules.addItem(item) 
Exemplo n.º 6
0
 def set_Dns2proxyRule(self):
     item = QtGui.QListWidgetItem()
     item.setText(self.optionsRules('dns2proxy'))
     item.setSizeHint(QtCore.QSize(30, 30))
     self.FSettings.ListRules.addItem(item)