diff --git a/consolegui/application/ControlButton.py b/consolegui/application/ControlButton.py index 383115c..0efb824 100644 --- a/consolegui/application/ControlButton.py +++ b/consolegui/application/ControlButton.py @@ -219,11 +219,14 @@ class ControlButtonWgt(QtGui.QWidget): QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Maximum)) return end_layout - def add_clear_cache_button(self, pid): + def add_clear_cache_button(self, pid = None): end_layout = self.pre_add_button() - self.pid = pid self.clear_proc_cache_button = QtGui.QPushButton(_('Close'), self) - self.clear_proc_cache_button.clicked.connect(self.clear_pid_cache) + if pid: + self.pid = pid + 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.setFixedHeight(32) end_layout.addWidget(self.clear_proc_cache_button) diff --git a/consolegui/application/MainFrameResult.py b/consolegui/application/MainFrameResult.py index d29f47d..0bdde9b 100755 --- a/consolegui/application/MainFrameResult.py +++ b/consolegui/application/MainFrameResult.py @@ -339,13 +339,13 @@ class MainFrameRes(QtGui.QWidget): self._parent.control_button.add_clear_cache_button(self.cur_pid) self.initUI() - def clear_pid_cache(self): - self.clear_proc_cache_button.setDisabled(True) - sid = int(self.ClientObj.sid) - res = self.client.service.clear_pid_cache(sid, self.cur_pid) - if res: - _print (_('Error close process')) - self._parent.back() +# def clear_pid_cache(self): +# self.clear_proc_cache_button.setDisabled(True) +# sid = int(self.ClientObj.sid) +# res = self.client.service.clear_pid_cache(sid, self.cur_pid) +# if res: +# _print (_('Error close process')) +# self._parent.back() def startGroup(self, item): pass @@ -511,9 +511,9 @@ class MainFrameRes(QtGui.QWidget): if self.get_Frame_thread.isRunning(): self.get_Frame_thread.wait() self.get_Frame_thread = ClientServiceThread(self.ClientObj,\ - 'get_frame', sid, pid, return_except = True, \ - sleeptime = int(self.ClientObj.client.frame_period),\ - through_object = (sid, pid)) + 'get_frame', sid, pid, return_except = True, \ + sleeptime = int(self.ClientObj.client.frame_period),\ + through_object = (sid, pid)) self.get_Frame_thread.signal_extended.connect(self.get_Frame_cycle) self.get_Frame_thread.start() @@ -611,14 +611,15 @@ class MainFrameRes(QtGui.QWidget): 'get_progress', sid, pid, id, return_except = True, \ through_object = (sid, pid, id, temp_progress, \ 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() def get_Progress_cycle(self, returnProgr, through_object): if type(returnProgr) == Exception: _print (_('Error get progress from Server.')) # show_msg(_('Error get progress from Server.') +'\n'+ \ -# _('Please, resfesh this Page later.'),'get progress error') +# _('Please, resfesh this Page later.'),'get progress error') return 1 sid, pid, id, temp_progress, progressBar = through_object ######################################## diff --git a/consolegui/application/ShortFrameResult.py b/consolegui/application/ShortFrameResult.py index 9436377..5a01adb 100644 --- a/consolegui/application/ShortFrameResult.py +++ b/consolegui/application/ShortFrameResult.py @@ -217,14 +217,14 @@ class ShortFrameRes(QtGui.QWidget): self._parent.control_button.add_clear_cache_button(self.cur_pid) self.initUI() - def clear_pid_cache(self): - self.clear_proc_cache_button.setDisabled(True) - sid = int(self.ClientObj.sid) - res = self.client.service.clear_pid_cache(sid, self.cur_pid) - if res: - show_msg (_('Error clear process cache on server')) - else: - self._parent.back() +# def clear_pid_cache(self): +# self.clear_proc_cache_button.setDisabled(True) +# sid = int(self.ClientObj.sid) +# res = self.client.service.clear_pid_cache(sid, self.cur_pid) +# if res: +# show_msg (_('Error clear process cache on server')) +# else: +# self._parent.back() def startGroup(self, item): pass diff --git a/consolegui/application/mainframe.py b/consolegui/application/mainframe.py index 726959d..2f73574 100755 --- a/consolegui/application/mainframe.py +++ b/consolegui/application/mainframe.py @@ -187,15 +187,10 @@ class MainFrame(QtGui.QWidget): # add close button if one field if len (self.view.groups.GroupField) == 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 + and len (Group.fields.Field) == 1: add_button_flag = True self._parent.control_button.del_button() + self._parent.control_button.add_clear_cache_button() elif field.element == 'input': if field.name in ['cl_page_count','cl_page_offset']: