Beispiel #1
0
    def addOperationsClick(self):
        self.createNewZone = QLineEdit()
        self.createNewZone.setPlaceholderText('Enter name from New Zone ')
        self.clearMiddel()
        self.task = self.operation.currentItem().text()
        #itemsA = listZones()
        itemsB = listAllServices()
        self.zones = QComboBox(self)
        #self.zones.addItems(itemsA)
        self.zones.addItem(self.parZone)
        self.servies = QComboBox(self)
        self.servies.addItems(itemsB)
        zone = defaultZone()
        zone = zone[0]
        self.interfaces = QComboBox(self)
        self.interfaces.addItems(displayNetworkInterface())

        self.port = QComboBox(self)
        self.selectProtocol = QComboBox()
        self.selectProtocol.addItem('tcp')
        self.selectProtocol.addItem('udp')
        self.selectPort = QLineEdit()

        if self.task in 'Add Service To A Specific Zone':

            self.middelLayout.addRow(QLabel('Select a Service :'),
                                     self.servies)
            self.middelLayout.addRow(QLabel('Selected Zone :'), self.zones)
            self.middelLayout.addRow(QLabel(""), QLabel(""))

        elif self.task in 'Add Interface To Zone':
            self.middelLayout.addRow(QLabel('Select an Interface :'),
                                     self.interfaces)
            self.middelLayout.addRow(QLabel('Selected Zone :'), self.zones)

        elif self.task in 'Add Service To Default Zone':

            self.middelLayout.addRow(QLabel('Select a Service :'),
                                     self.servies)
            self.middelLayout.addRow(QLabel('Default Zone Is:'),
                                     QLabel(f'{zone}'))

        elif self.task in 'Add Protocol and Port':
            self.middelLayout.addRow(QLabel('Selected Zone :'), self.zones)
            self.middelLayout.addRow(QLabel('Select a Service :'),
                                     self.selectProtocol)
            self.middelLayout.addRow(QLabel('Select a Port :'),
                                     self.selectPort)

        elif self.task in 'Add a New Zone':
            self.middelLayout.addRow(QLabel(""), QLabel(""))
            self.middelLayout.addRow(QLabel(''), self.createNewZone)

        self.middelLayout.addRow(QLabel(""), QLabel(""))
        self.middelLayout.addRow(QLabel(""), QLabel(""))
    def addOperationsClick(self):

        self.clearMiddel()
        self.task = self.operation.currentItem().text()

        itemsA = listZones()
        itemsB = listAllServices()
        self.zones = QComboBox(self)
        self.zones.addItems(itemsA)

        self.servies = QComboBox(self)
        self.servies.addItems(itemsB)
        zone = defaultZone()
        zone = zone[0]

        self.interfaces = QComboBox(self)
        self.interfaces.addItems(displayNetworkInterface())

        self.port = QComboBox(self)
        self.selectProtocol = QComboBox()
        self.selectProtocol.addItem('tcp')
        self.selectProtocol.addItem('udp')
        self.selectPort = QLineEdit()


        if self.task in 'Remove Interface To Zone':

            self.middelLayout.addRow(QLabel('Select an Interface :'), self.interfaces)
            self.middelLayout.addRow(QLabel('Select a Zone :'), self.zones)


        elif self.task in 'Remove a Specific Zone':
            self.middelLayout.addRow(QLabel('Select a Zone :'), self.zones)



        elif self.task in 'Remove Service To Default Zone':

            self.middelLayout.addRow(QLabel('Select a Service :'), self.servies)
            self.middelLayout.addRow(QLabel('Default Zone Is:'), QLabel(f'{zone}'))


        elif self.task in 'Remove a Service From A Specific Zone':

            self.middelLayout.addRow(QLabel('Select a Service :'), self.servies)
            self.middelLayout.addRow(QLabel('Select a Zone :'), self.zones)


        elif self.task in 'Remove a protocol and Port':
            self.middelLayout.addRow(QLabel('Select a Protocol :'), self.selectProtocol)
            self.middelLayout.addRow(QLabel('Select a Port :'), self.selectPort)
    def widgets(self):
        self.consName = QComboBox(self)
        self.comboInt = QComboBox()
        consNames = self.index[0]
        self.consName.addItem(consNames)

        interName = displayNetworkInterface()
        self.comboInt.addItem('no change')
        self.comboInt.addItems(interName)
        self.newconNameEdit = QLineEdit()

        self.operation = QComboBox()
        # self.operation.currentIndexChanged.connect(self.clickingEvent)
        self.operation.addItem('Type')
        self.operation.addItem('Change Network name')
        self.operation.addItem('Change Network interface')
        self.operation.addItem('Change IP Address')
        self.operation.addItem('Change Subnet Mask')
        self.operation.addItem('Change Gateway')
        self.operation.addItem('Change DNS')
        self.operation.addItem('Change Mode Addressing')
        self.typeCombo = QComboBox()

        self.typeCombo.addItem("no change")
        self.typeCombo.addItem("ethernet")
        self.typeCombo.addItem("wifi")

        self.newconNameEdit = QLineEdit()
        self.newSSIDEdit = QLineEdit()
        self.ipEdit = QLineEdit()
        self.gatewayEdit = QLineEdit()
        self.dnsEdit = QLineEdit()
        self.dnsEdit2 = QLineEdit()
        self.maskListItem = QComboBox()
        self.maskListItem.addItem("no change")
        self.maskListItem.addItem(" /24:     255.255.255.0      ")
        self.maskListItem.addItem(" /32:     255.255.255.255     ")
        self.maskListItem.addItem(" /31:     255.255.255.254   ")
        self.maskListItem.addItem(" /30:     255.255.255.252    ")
        self.maskListItem.addItem(" /29:     255.255.255.248    ")
        self.maskListItem.addItem(" /28:     255.255.255.240     ")
        self.maskListItem.addItem(" /27:     255.255.255.224    ")
        self.maskListItem.addItem(" /26:     255.255.255.192   ")
        self.maskListItem.addItem(" /25:     255.255.255.128      ")
        self.maskListItem.addItem(" /23:     255.255.254.0    ")
        self.maskListItem.addItem(" /22:     255.255.252.0       ")
        self.maskListItem.addItem(" /21:     255.255.248.255")
        self.maskListItem.addItem(" /20:     255.255.255.240")

        index = str(self.index[0])
        index = index.replace(' ', '\\ ')
        tmpindex = index
        self.ipInfo = DisplayIP(index)
        ipInfoDns = self.ipInfo[2]
        ipInfoDns = ipInfoDns.split(',')
        self.topLayout.addRow(QLabel("Connection for editing is"),
                              self.consName)
        self.topLayout.addRow(QLabel(''), QLabel(''))
        self.topLayout.addRow(QLabel(f'Old infrmation are '), QLabel(''))
        self.topLayout.addRow(QLabel(f'NAME= {self.index[0]}'), QLabel(''))
        if self.index[1] in 'wifi':
            self.topLayout.addRow(QLabel(f'SSID= {displaySSID(tmpindex)}'),
                                  QLabel(''))
        self.topLayout.addRow(QLabel(f'TYPE= {self.index[1]}'), QLabel(''))
        self.topLayout.addRow(QLabel(f'IP ASSIGN METHOD= {self.index[2]}'),
                              QLabel(''))
        self.topLayout.addRow(QLabel(f'AUTO CONNECT = {self.index[3]}'),
                              QLabel(''))
        self.topLayout.addRow(
            QLabel(
                f'INTERFACE ASSOICIATED  = {disInterfaceConnection(index)}'),
            QLabel(''))

        # self.topLayout.addRow(QLabel(f'DNS Two= {ipInfoDns[1]}'), QLabel(''))
        self.topLayout.addRow(QLabel(''), QLabel(''))

        self.topLayout.addRow(QLabel('For New inforamtions Editing '),
                              QLabel(''))
        self.topLayout.addRow(QLabel(''), QLabel(''))
        self.topLayout.addRow(QLabel("Enter New Connection's Name"),
                              self.newconNameEdit)
        thereisSSID = False
        if self.index[1] in 'wifi':
            self.topLayout.addRow(QLabel("Enter New SSID Name"),
                                  self.newSSIDEdit)
            thereisSSID = True

        self.topLayout.addRow(QLabel("Select interface"), self.comboInt)
        self.middelLayout.addRow(QLabel('IP old Informations'), QLabel(''))

        self.middelLayout.addRow(QLabel(f'IP= {self.ipInfo[0]}'), QLabel(''))
        self.middelLayout.addRow(QLabel(f'GATEWAY= {self.ipInfo[1]}'),
                                 QLabel(''))
        self.middelLayout.addRow(QLabel(f'DNS One= {ipInfoDns}'), QLabel(''))
        self.middelLayout.addRow(QLabel(''), QLabel(''))

        self.middelLayout.addRow(QLabel(''), QLabel(''))
        self.middelLayout.addRow(QLabel('New IP inforamtions Editing'),
                                 QLabel(''))
        self.middelLayout.addRow(QLabel(''), QLabel(''))
        self.middelLayout.addRow(QLabel("Enter New IP Address"), self.ipEdit)
        self.middelLayout.addRow(QLabel("Enter New Subnet Mask"),
                                 self.maskListItem)
        self.middelLayout.addRow(QLabel("Enter New GATWAY address"),
                                 self.gatewayEdit)
        self.middelLayout.addRow(QLabel("Add an other  DNS"), self.dnsEdit)
        self.middelLayout.addRow(QLabel(''), QLabel(''))
        self.middelLayout.addRow(QLabel(''), QLabel(''))
Beispiel #4
0
    def widgets(self):
        self.consName = QComboBox(self)
        self.comboInt = QComboBox()
        consNames = displayConnection()
        consNames.pop()
        self.consName.addItems(consNames)

        interName = displayNetworkInterface()
        self.comboInt.addItem('no change')
        self.comboInt.addItems(interName)
        self.newconNameEdit = QLineEdit()

        self.operation = QComboBox()
        self.operation.addItem('Type')
        self.operation.addItem('Change Network name')
        self.operation.addItem('Change Network interface')
        self.operation.addItem('Change IP Address')
        self.operation.addItem('Change Subnet Mask')
        self.operation.addItem('Change Gateway')
        self.operation.addItem('Change DNS')
        self.operation.addItem('Change Mode Addressing')
        self.typeCombo = QComboBox()

        self.typeCombo.addItem("no change")
        self.typeCombo.addItem("ethernet")
        self.typeCombo.addItem("wifi")

        self.newconNameEdit = QLineEdit()
        self.ipEdit = QLineEdit()
        self.gatewayEdit = QLineEdit()
        self.dnsEdit = QLineEdit()
        self.maskListItem = QComboBox()
        self.maskListItem.addItem("no change")
        self.maskListItem.addItem(" /24:     255.255.255.0      ")
        self.maskListItem.addItem(" /32:     255.255.255.255     ")
        self.maskListItem.addItem(" /31:     255.255.255.254   ")
        self.maskListItem.addItem(" /30:     255.255.255.252    ")
        self.maskListItem.addItem(" /29:     255.255.255.248    ")
        self.maskListItem.addItem(" /28:     255.255.255.240     ")
        self.maskListItem.addItem(" /27:     255.255.255.224    ")
        self.maskListItem.addItem(" /26:     255.255.255.192   ")
        self.maskListItem.addItem(" /25:     255.255.255.128      ")
        self.maskListItem.addItem(" /23:     255.255.254.0    ")
        self.maskListItem.addItem(" /22:     255.255.252.0       ")
        self.maskListItem.addItem(" /21:     255.255.248.255")
        self.maskListItem.addItem(" /20:     255.255.255.240")

        self.topLayout.addRow(
            QLabel("Please Select Connection  Name To Applay It "),
            self.consName)
        self.topLayout.addRow(QLabel(''), QLabel(''))

        self.topLayout.addRow(QLabel("Enter New Connection's Name"),
                              self.newconNameEdit)
        self.topLayout.addRow(QLabel("Select interface"), self.comboInt)
        self.topLayout.addRow(QLabel("Enter New IP Address"), self.ipEdit)
        self.topLayout.addRow(QLabel("Enter New Subnet Mask"),
                              self.maskListItem)
        self.topLayout.addRow(QLabel("Change Connection Type"), self.typeCombo)
        self.topLayout.addRow(QLabel("Enter New GATWAY address"),
                              self.gatewayEdit)
        self.topLayout.addRow(QLabel("Change Primary DNS"), self.dnsEdit)