move close button to bottom

master3.3
Denis Spiridonov 12 years ago
parent c6bd05f64b
commit 87abad9edb

@ -219,11 +219,14 @@ class ControlButtonWgt(QtGui.QWidget):
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Maximum)) QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Maximum))
return end_layout return end_layout
def add_clear_cache_button(self, pid): def add_clear_cache_button(self, pid = None):
end_layout = self.pre_add_button() end_layout = self.pre_add_button()
self.pid = pid
self.clear_proc_cache_button = QtGui.QPushButton(_('Close'), self) self.clear_proc_cache_button = QtGui.QPushButton(_('Close'), self)
if pid:
self.pid = pid
self.clear_proc_cache_button.clicked.connect(self.clear_pid_cache) self.clear_proc_cache_button.clicked.connect(self.clear_pid_cache)
else:
self.clear_proc_cache_button.clicked.connect(self._parent.back)
self.clear_proc_cache_button.setMinimumWidth(64) self.clear_proc_cache_button.setMinimumWidth(64)
self.clear_proc_cache_button.setFixedHeight(32) self.clear_proc_cache_button.setFixedHeight(32)
end_layout.addWidget(self.clear_proc_cache_button) end_layout.addWidget(self.clear_proc_cache_button)

@ -339,13 +339,13 @@ class MainFrameRes(QtGui.QWidget):
self._parent.control_button.add_clear_cache_button(self.cur_pid) self._parent.control_button.add_clear_cache_button(self.cur_pid)
self.initUI() self.initUI()
def clear_pid_cache(self): # def clear_pid_cache(self):
self.clear_proc_cache_button.setDisabled(True) # self.clear_proc_cache_button.setDisabled(True)
sid = int(self.ClientObj.sid) # sid = int(self.ClientObj.sid)
res = self.client.service.clear_pid_cache(sid, self.cur_pid) # res = self.client.service.clear_pid_cache(sid, self.cur_pid)
if res: # if res:
_print (_('Error close process')) # _print (_('Error close process'))
self._parent.back() # self._parent.back()
def startGroup(self, item): def startGroup(self, item):
pass pass
@ -611,7 +611,8 @@ class MainFrameRes(QtGui.QWidget):
'get_progress', sid, pid, id, return_except = True, \ 'get_progress', sid, pid, id, return_except = True, \
through_object = (sid, pid, id, temp_progress, \ through_object = (sid, pid, id, temp_progress, \
progressBar)) progressBar))
self.get_Progress_thread.signal_extended.connect(self.get_Progress_cycle) self.get_Progress_thread.signal_extended.connect \
(self.get_Progress_cycle)
self.get_Progress_thread.start() self.get_Progress_thread.start()
def get_Progress_cycle(self, returnProgr, through_object): def get_Progress_cycle(self, returnProgr, through_object):

@ -217,14 +217,14 @@ class ShortFrameRes(QtGui.QWidget):
self._parent.control_button.add_clear_cache_button(self.cur_pid) self._parent.control_button.add_clear_cache_button(self.cur_pid)
self.initUI() self.initUI()
def clear_pid_cache(self): # def clear_pid_cache(self):
self.clear_proc_cache_button.setDisabled(True) # self.clear_proc_cache_button.setDisabled(True)
sid = int(self.ClientObj.sid) # sid = int(self.ClientObj.sid)
res = self.client.service.clear_pid_cache(sid, self.cur_pid) # res = self.client.service.clear_pid_cache(sid, self.cur_pid)
if res: # if res:
show_msg (_('Error clear process cache on server')) # show_msg (_('Error clear process cache on server'))
else: # else:
self._parent.back() # self._parent.back()
def startGroup(self, item): def startGroup(self, item):
pass pass

@ -188,14 +188,9 @@ class MainFrame(QtGui.QWidget):
# add close button if one field # add close button if one field
if len (self.view.groups.GroupField) == 1 \ if len (self.view.groups.GroupField) == 1 \
and len (Group.fields.Field) == 1: and len (Group.fields.Field) == 1:
exit_button = QtGui.QPushButton(_('Close'), self)
exit_button.setFixedWidth(100)
exit_button.clicked.connect \
(self.ClientObj.MainWidget.back)
self.grid.addWidget(exit_button, x, y+1)
x += 1
add_button_flag = True add_button_flag = True
self._parent.control_button.del_button() self._parent.control_button.del_button()
self._parent.control_button.add_clear_cache_button()
elif field.element == 'input': elif field.element == 'input':
if field.name in ['cl_page_count','cl_page_offset']: if field.name in ['cl_page_count','cl_page_offset']:

Loading…
Cancel
Save