-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetIP_List_func2.py
55 lines (36 loc) · 1.54 KB
/
getIP_List_func2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import netifaces
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QHBoxLayout, \
QGroupBox, QBoxLayout, QListView, QLabel
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5.QtGui import QStandardItemModel, QStandardItem
class FindAdapter(QDialog):
def __init__(self, *args, **kwargs):
super(FindAdapter, self).__init__(*args, **kwargs)
self.IPselected = ""
self.setWindowTitle("Choose an IP Address")
self.setGeometry(500, 200, 600, 250)
QBtn = QDialogButtonBox.Apply | QDialogButtonBox.Cancel
self.buttonBox = QDialogButtonBox(QBtn)
self.buttonBox.clicked.connect(self.accept)
self.buttonBox.rejected.connect(self.reject)
self.layout = QVBoxLayout()
group = QGroupBox()
box = QBoxLayout(QBoxLayout.TopToBottom)
group.setLayout(box)
group.setTitle("Adapters list")
self.layout.addWidget(group)
# view = QListView(self)
# self.model = QStandardItemModel()
# view.clicked.connect(self.treeView_ItemSelected)
# self.list_IP = self.listAddrs()
# view.setModel(self.model)
# box.addWidget(view)
self.HLayout = QHBoxLayout()
self.label1 = QLabel(self)
# self.label1.setFont(QtGui.QFont("Sanserif", 15))
self.label1.setText("Select an adapter then click Apply")
self.HLayout.addWidget(self.label1)
self.layout.addWidget(self.label1)
self.layout.addWidget(self.buttonBox)
self.setLayout(self.layout)