[opencoffee-devel] Parche workstations ScrollArea y addWorkstations |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opencoffee-devel Archives
]
- To: opencoffee-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [opencoffee-devel] Parche workstations ScrollArea y addWorkstations
- From: "Jose Arcangel Salazar Delgado" <arcangel.salazar@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 6 Oct 2007 11:58:02 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=xXlDDFLqyYcRqLusneLCgkWDmUkV198+Ag06bzlHHeg=; b=s4qW2Uu6ztdDNsd4bgUE+Trdgh/zhjoqasJNPdNVioPfeUZ8AwjzBvt8XRY1HyC2KVCi9n6tKJ4N+FwbGq13dP/VArg18M+e+Q0CjYl4o+xZ1KLAY4Bqu/CFoW9kQoVZUHtiQ80SBMmYSypT1o61hDu/6pflxP//32+Qs//4aWo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=czuFVc20FJxv9hs1IZ86z76ByJV9MrlLZD1W2drNapxHNZOcH7VwEw16attOhS27chb1/4NnRcut5kQscCkO3W/tAevvVurY6nJs28lIdwlvLwuWmkKNfta+to8P1EQFKB5FOMf44OcSiArGvnct3XPBoCC4jgURa6V7+FM6fe4=
hola compañeros.
Con este parche se corrige el tamaño del scrollArea y se implementa la
función que agrega workstations dentro del Tab.
Se aplica con:
patch -p5 < patch.diff
Copiando el archivo en el trunk.
Saludos.
Index: /home/arcangel/workspace/opencoffee/opencoffee-server/core/workstations/workstationsTab.py
===================================================================
--- /home/arcangel/workspace/opencoffee/opencoffee-server/core/workstations/workstationsTab.py (revision 339)
+++ /home/arcangel/workspace/opencoffee/opencoffee-server/core/workstations/workstationsTab.py (working copy)
@@ -38,31 +38,24 @@
self.gbox = QtGui.QGridLayout()
self.setLayout(self.gbox)
- ## Identificamos los templates
- # TODO: usaremos un standars de 9 templates o puestos activos
- self.w1 = WorkstationTemplate()
- self.w2 = WorkstationTemplate()
- self.w3 = WorkstationTemplate()
- self.w4 = WorkstationTemplate()
- self.w5 = WorkstationTemplate()
- self.w6 = WorkstationTemplate()
- self.w7 = WorkstationTemplate()
- self.w8 = WorkstationTemplate()
- self.w9 = WorkstationTemplate()
+ #inicializamos las variables de las coordenadas a cero.
+ self.xAxis = 0
+ self.yAxis = 0
+
+ #creamos una lista vacia para contener a las workstations
+ self.workstations=[]
- ## Agregamos los templates
- # TODO recordemos que usaremos variables para asignar los templates y segun IDs.
- self.gbox.addWidget(self.w1,0,0)
- self.gbox.addWidget(self.w2,0,1)
- self.gbox.addWidget(self.w3,0,2)
- self.gbox.addWidget(self.w4,2,0)
- self.gbox.addWidget(self.w5,2,1)
- self.gbox.addWidget(self.w6,2,2)
- self.gbox.addWidget(self.w7,3,0)
- self.gbox.addWidget(self.w8,3,1)
- self.gbox.addWidget(self.w9,3,2)
+ #Función que agrega las workstations al tab.
+ #TODO: asignar los nombres e ids a las workstations.
+ def addWorkstation(self):
+ if self.xAxis > 2:
+ self.xAxis =0
+ self.yAxis +=1
-
+ self.workstations.append(WorkstationTemplate())
+ self.gbox.addWidget(self.workstations[-1], self.yAxis, self.xAxis)
+ self.xAxis += 1
+
## Se define la clase de ui_workstations.py
class WorkstationTemplate (QWidget, Ui_WorkstationTemplate):
def __init__(self, parent = None):
Index: /home/arcangel/workspace/opencoffee/opencoffee-server/MainApp.py
===================================================================
--- /home/arcangel/workspace/opencoffee/opencoffee-server/MainApp.py (revision 339)
+++ /home/arcangel/workspace/opencoffee/opencoffee-server/MainApp.py (working copy)
@@ -603,7 +603,15 @@
self.scrollArea = QtGui.QScrollArea(self.tab_2)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setWidget(self.workstationsTab)
-
+
+ #Se agregan las 9 workstations usando la función de agregado
+ #TODO: Agregar el nombre e ids a las workstations.
+ for i in range(9):
+ self.workstationsTab.addWorkstation()
+
+ #Se establece un tamaño minimo. Con esto el scrollArea ocupa todo el tab.
+ self.scrollArea.setMinimumSize(610, 410)
+
# Se define la clase de ui_clients.py
class ClientsWidget (QWidget, Ui_clientsWidget):