coding utf-8 Form implementation generated from reading ui file xa4a_t

  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
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'd:\xa4a_table1.ui'
#
# Created: Thu Oct 30 16:45:58 2008
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
import sys
from PyQt4 import QtCore, QtGui
def add_edit_client(parent, ok_cb, cancel_cb, client=None):
dialog = QtGui.QDialog(parent)
dialog.setWindowTitle ("Add client")
layout = QtGui.QGridLayout(dialog)
name_label = QtGui.QLabel(dialog)
layout.addWidget(name_label, 0, 0)
name_label.setText("Client name")
name = QtGui.QLineEdit(dialog)
layout.addWidget(name, 0, 1)
person_label = QtGui.QLabel(dialog)
layout.addWidget(person_label, 1, 0)
person_label.setText("Contact person")
person = QtGui.QLineEdit(dialog)
layout.addWidget(person, 1, 1)
address_frame = QtGui.QFrame(dialog)
layout.addWidget(address_frame,2,0,2,1)
addr_layout = QtGui.QGridLayout(address_frame)
country_label = QtGui.QLabel(address_frame)
addr_layout.addWidget(country_label, 0, 0)
country_label.setText("Country")
country = QtGui.QLineEdit(address_frame)
addr_layout.addWidget(country, 0, 1)
city_label = QtGui.QLabel(address_frame)
addr_layout.addWidget(city_label, 1, 0)
city_label.setText("City")
city = QtGui.QLineEdit(address_frame)
addr_layout.addWidget(city, 1, 1)
address1_label = QtGui.QLabel(address_frame)
addr_layout.addWidget(address1_label, 2, 0)
address1_label.setText("Address1")
address1 = QtGui.QLineEdit(address_frame)
addr_layout.addWidget(address1, 2, 1)
address2_label = QtGui.QLabel(address_frame)
addr_layout.addWidget(address2_label, 3, 0)
address2_label.setText("Address2")
address2 = QtGui.QLineEdit(address_frame)
addr_layout.addWidget(address2, 3, 1)
zip_label = QtGui.QLabel(address_frame)
addr_layout.addWidget(zip_label, 4, 0)
zip_label.setText("Zip")
zip = QtGui.QLineEdit(address_frame)
addr_layout.addWidget(zip, 4, 1)
phone_label = QtGui.QLabel(dialog)
addr_layout.addWidget(phone_label, 5, 0)
phone_label.setText("Phone")
phone = QtGui.QLineEdit(address_frame)
addr_layout.addWidget(phone, 5, 1)
comment_label = QtGui.QLabel(dialog)
layout.addWidget(comment_label, 5, 0, 2, 1)
comment_label.setText("Comment")
comment = QtGui.QPlainTextEdit(dialog)
layout.addWidget(comment, 6, 0, 2, 1)
ok_button = QtGui.QPushButton(dialog)
layout.addWidget(ok_button, 7, 0)
ok_button.setText("Ok")
cancel_button = QtGui.QPushButton(dialog)
layout.addWidget(cancel_button, 7, 1)
cancel_button.setText("Cancel")
QtCore.QObject.connect(ok_button, QtCore.SIGNAL("clicked()"), ok_cb)
QtCore.QObject.connect(cancel_button, QtCore.SIGNAL("clicked()"), cancel_cb)
dialog.show()
parent.dialog = dialog
class client_window_class (object):
def draw_interface(self, workspace):
self.client_window = QtGui.QMainWindow()
self.client_window.setWindowTitle("Clients")
# self.client_window.centralwidget = QtGui.QWidget(self.client_window)
self.client_window.tabWidget = QtGui.QTabWidget(self.client_window)
self.client_window.tab = QtGui.QWidget()
top_layout = self.client_window.top_layout = QtGui.QVBoxLayout(self.client_window.tab)
self.client_window.table_client = QtGui.QTableView(self.client_window.tab)
self.client_window.table_client.setGeometry(QtCore.QRect(10, 0, 81, 20))
top_layout.addWidget(self.client_window.table_client)
self.client_window.button_layout = QtGui.QHBoxLayout()
btn_layout = self.client_window.button_layout
top_layout.addLayout(btn_layout)
self.client_window.tab.add_client = QtGui.QToolButton(self.client_window.tab)
btn_layout.addWidget(self.client_window.tab.add_client)
self.client_window.tab.add_client.setText("Add client")
self.client_window.tab.edit_client = QtGui.QToolButton(self.client_window.tab)
btn_layout.addWidget(self.client_window.tab.edit_client)
self.client_window.tab.edit_client.setText("Edit client")
self.client_window.tab.delete_client = QtGui.QToolButton(self.client_window.tab)
btn_layout.addWidget(self.client_window.tab.delete_client)
self.client_window.tab.delete_client.setText("Delete client")
self.client_window.tab.search_client = QtGui.QToolButton(self.client_window.tab)
btn_layout.addWidget(self.client_window.tab.search_client)
self.client_window.tab.search_client.setText("Search")
self.client_window.tab.refresh_client = QtGui.QToolButton(self.client_window.tab)
btn_layout.addWidget(self.client_window.tab.refresh_client)
self.client_window.tab.refresh_client.setText("Refresh")
self.client_window.tabWidget.addTab(self.client_window.tab, "Clients")
self.client_window.setCentralWidget(self.client_window.tabWidget)
QtCore.QObject.connect(self.client_window.tab.add_client, QtCore.SIGNAL("clicked()"),self.click_add_client)
QtCore.QObject.connect(self.client_window.tab.edit_client, QtCore.SIGNAL("clicked()"),self.click_edit_client)
QtCore.QObject.connect(self.client_window.tab.delete_client, QtCore.SIGNAL("clicked()"),self.click_delete_client)
QtCore.QObject.connect(self.client_window.tab.search_client, QtCore.SIGNAL("clicked()"),self.click_search_client)
QtCore.QObject.connect(self.client_window.tab.refresh_client, QtCore.SIGNAL("clicked()"),self.click_refresh_client)
QtCore.QMetaObject.connectSlotsByName(workspace)
self.client_window.show()
def click_add_client (self):
print "Add client button been pressed"
add_edit_client(self.client_window, self.edit_client_ok, self.edit_client_cancel)
def click_edit_client (self):
print "Edit client button been pressed"
self.client_window.edit_client = QtGui.QDialog(self.client_window)
self.client_window.edit_client.resize(259, 485)
self.client_window.edit_client.setWindowTitle ("Edit client")
self.client_window.edit_client.setMinimumSize(QtCore.QSize(259,485))
self.client_window.edit_client.setMaximumSize(QtCore.QSize(259,485))
self.client_window.edit_client.client_name = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.client_name.setGeometry(QtCore.QRect(100, 10, 141, 20))
self.client_window.edit_client.client_contact_face = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.client_contact_face.setGeometry(QtCore.QRect(100, 50, 141, 20))
self.client_window.edit_client.contact_groupbox = QtGui.QGroupBox(self.client_window.edit_client)
self.client_window.edit_client.contact_groupbox.setGeometry(QtCore.QRect(10, 80, 241, 251))
self.client_window.edit_client.country = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.country.setGeometry(QtCore.QRect(100, 100, 141, 20))
self.client_window.edit_client.city = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.city.setGeometry(QtCore.QRect(100, 140, 141, 20))
self.client_window.edit_client.address1 = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.address1.setGeometry(QtCore.QRect(100, 180, 141, 20))
self.client_window.edit_client.address2 = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.address2.setGeometry(QtCore.QRect(100, 220, 141, 20))
self.client_window.edit_client.zip = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.zip.setGeometry(QtCore.QRect(100, 260, 141, 20))
self.client_window.edit_client.phone = QtGui.QLineEdit(self.client_window.edit_client)
self.client_window.edit_client.phone.setGeometry(QtCore.QRect(100, 300, 141, 20))
self.client_window.edit_client.comment = QtGui.QPlainTextEdit(self.client_window.edit_client)
self.client_window.edit_client.comment.setGeometry(QtCore.QRect(10, 360, 231, 41))
self.client_window.edit_client.name_client_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.name_client_label.setGeometry(QtCore.QRect(10, 10, 61, 16))
self.client_window.edit_client.name_client_label.setText("Client name")
self.client_window.edit_client.contact_face_client_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.contact_face_client_label.setGeometry(QtCore.QRect(10, 50, 81, 20))
self.client_window.edit_client.contact_face_client_label.setText("Contact face")
self.client_window.edit_client.country_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.country_label.setGeometry(QtCore.QRect(20, 100, 46, 14))
self.client_window.edit_client.country_label.setText("Country")
self.client_window.edit_client.city_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.city_label.setGeometry(QtCore.QRect(20, 140, 46, 14))
self.client_window.edit_client.city_label.setText("City")
self.client_window.edit_client.address1_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.address1_label.setGeometry(QtCore.QRect(20, 180, 51, 16))
self.client_window.edit_client.address1_label.setText("Address1")
self.client_window.edit_client.address2_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.address2_label.setGeometry(QtCore.QRect(20, 220, 51, 21))
self.client_window.edit_client.address2_label.setText("Address2")
self.client_window.edit_client.zip_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.zip_label.setGeometry(QtCore.QRect(20, 260, 46, 14))
self.client_window.edit_client.zip_label.setText("Zip")
self.client_window.edit_client.phone_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.phone_label.setGeometry(QtCore.QRect(20, 300, 46, 14))
self.client_window.edit_client.phone_label.setText("Phone")
self.client_window.edit_client.comment_label = QtGui.QLabel(self.client_window.edit_client)
self.client_window.edit_client.comment_label.setGeometry(QtCore.QRect(10, 340, 46, 14))
self.client_window.edit_client.comment_label.setText("Comment")
self.client_window.edit_client.ok_button = QtGui.QPushButton(self.client_window.edit_client)
self.client_window.edit_client.ok_button.setGeometry(QtCore.QRect(30, 420, 75, 23))
self.client_window.edit_client.ok_button.setText("Ok")
self.client_window.edit_client.cancel_button = QtGui.QPushButton(self.client_window.edit_client)
self.client_window.edit_client.cancel_button.setGeometry(QtCore.QRect(150, 420, 75, 23))
self.client_window.edit_client.cancel_button.setText("Cancel")
QtCore.QObject.connect(self.client_window.edit_client.ok_button, QtCore.SIGNAL("clicked()"),self.edit_client_ok_pressed)
QtCore.QObject.connect(self.client_window.edit_client.cancel_button, QtCore.SIGNAL("clicked()"),self.edit_client_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.client_window)
self.client_window.edit_client.show()
def click_delete_client (self):
print "Delete client button been pressed"
self.client_window.delete_client_sure = QtGui.QDialog(self.client_window)
self.client_window.delete_client_sure.setWindowTitle("Delete client")
self.client_window.delete_client_sure.resize(213, 78)
self.client_window.delete_client_sure.setMinimumSize(QtCore.QSize(213, 78))
self.client_window.delete_client_sure.setMaximumSize(QtCore.QSize(213, 78))
self.client_window.delete_client_sure.yes_button = QtGui.QPushButton(self.client_window.delete_client_sure)
self.client_window.delete_client_sure.yes_button.setGeometry(QtCore.QRect(20, 40, 75, 23))
self.client_window.delete_client_sure.yes_button.setText("Yes")
self.client_window.delete_client_sure.no_button = QtGui.QPushButton(self.client_window.delete_client_sure)
self.client_window.delete_client_sure.no_button.setGeometry(QtCore.QRect(120, 40, 75, 23))
self.client_window.delete_client_sure.no_button.setText("No")
self.client_window.delete_client_sure.are_you_sure_label = QtGui.QLabel(self.client_window.delete_client_sure)
self.client_window.delete_client_sure.are_you_sure_label.setGeometry(QtCore.QRect(70, 10, 81, 16))
self.client_window.delete_client_sure.are_you_sure_label.setText("Are you sure???")
self.client_window.delete_client_sure.show()
QtCore.QObject.connect(self.client_window.delete_client_sure.yes_button, QtCore.SIGNAL("clicked()"),self.delete_client_sure_yes_pressed)
QtCore.QObject.connect(self.client_window.delete_client_sure.no_button, QtCore.SIGNAL("clicked()"),self.delete_client_sure_no_pressed)
QtCore.QMetaObject.connectSlotsByName(self.client_window)
def delete_client_sure_yes_pressed (self):
print "'Yes delete client are you sure' button been pressed"
self.client_window.delete_client_sure.hide()
def delete_client_sure_no_pressed (self):
print "'No delete client are yot sure' button been pressed"
self.client_window.delete_client_sure.hide()
def click_search_client (self):
print "Search client button been pressed"
def click_refresh_client (self):
print "Refresh client button been pressed"
def edit_client_ok(self):
print "Ok add client button been pressed"
self.client_window.add_client.hide()
def edit_client_cancel(self):
print "Cancel add client button been pressed"
self.client_window.add_client.hide()
def edit_client_ok_pressed (self):
print "Ok edit client button been pressed"
self.client_window.edit_client.hide()
def edit_client_cancel_pressed (self):
print "Cancel edit client button been pressed"
self.client_window.edit_client.hide()
if __name__=="__main__":
app = QtGui.QApplication(sys.argv)
app.setStyle('Cleanlooks')
my_form = client_window_class()
my_form.draw_interface(app)
app.exec_()