-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconnectdialog.py
More file actions
32 lines (24 loc) · 896 Bytes
/
connectdialog.py
File metadata and controls
32 lines (24 loc) · 896 Bytes
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
from PyQt4 import QtGui
class ConnectDialog(QtGui.QDialog):
def __init__(self):
super(ConnectDialog, self).__init__()
self.setupUi()
def setupUi(self):
self.setWindowTitle("Connect to Quadcopter")
self.hostnameLineEdit = QtGui.QLineEdit()
hostnameLayout = QtGui.QHBoxLayout()
hostnameLayout.addWidget(QtGui.QLabel("Hostname:"))
hostnameLayout.addWidget(self.hostnameLineEdit)
cancelButton = QtGui.QPushButton("Cancel")
cancelButton.clicked.connect(self.reject)
connectButton = QtGui.QPushButton("Connect")
connectButton.clicked.connect(self.accept)
buttonLayout = QtGui.QHBoxLayout()
buttonLayout.addWidget(connectButton)
buttonLayout.addWidget(cancelButton)
mainLayout = QtGui.QVBoxLayout()
mainLayout.addLayout(hostnameLayout)
mainLayout.addLayout(buttonLayout)
self.setLayout(mainLayout)
def hostname(self):
return self.hostnameLineEdit.text()