mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
Allow to cancel a running filter process
This commit is contained in:
parent
313d671fbf
commit
be38bc2906
1 changed files with 7 additions and 10 deletions
|
@ -464,7 +464,6 @@ class FilteredLogModel (FilteredLogModelBase):
|
||||||
YIELD_LIMIT = 10000
|
YIELD_LIMIT = 10000
|
||||||
|
|
||||||
self.logger.debug ("preparing new filter")
|
self.logger.debug ("preparing new filter")
|
||||||
self.filters.append (filter)
|
|
||||||
## del self.line_offsets[:]
|
## del self.line_offsets[:]
|
||||||
## del self.line_levels[:]
|
## del self.line_levels[:]
|
||||||
new_line_offsets = []
|
new_line_offsets = []
|
||||||
|
@ -518,6 +517,8 @@ class FilteredLogModel (FilteredLogModelBase):
|
||||||
if self.__active_process is not None:
|
if self.__active_process is not None:
|
||||||
raise ValueError ("dispatched a filter process already")
|
raise ValueError ("dispatched a filter process already")
|
||||||
|
|
||||||
|
self.filters.append (filter)
|
||||||
|
|
||||||
self.__dispatcher = dispatcher
|
self.__dispatcher = dispatcher
|
||||||
self.__active_process = self.__filter_process (filter)
|
self.__active_process = self.__filter_process (filter)
|
||||||
dispatcher (self.__active_process)
|
dispatcher (self.__active_process)
|
||||||
|
@ -525,12 +526,14 @@ class FilteredLogModel (FilteredLogModelBase):
|
||||||
def abort_process (self):
|
def abort_process (self):
|
||||||
|
|
||||||
if self.__active_process is None:
|
if self.__active_process is None:
|
||||||
return
|
raise ValueError ("no filter process running")
|
||||||
|
|
||||||
self.__dispatcher.cancel ()
|
self.__dispatcher.cancel ()
|
||||||
self.__active_process = None
|
self.__active_process = None
|
||||||
self.__dispatcher = None
|
self.__dispatcher = None
|
||||||
|
|
||||||
|
del self.filters[-1]
|
||||||
|
|
||||||
def get_filter_progress (self):
|
def get_filter_progress (self):
|
||||||
|
|
||||||
if self.__active_process is None:
|
if self.__active_process is None:
|
||||||
|
@ -2004,18 +2007,12 @@ class Window (object):
|
||||||
|
|
||||||
def handle_filter_progress_dialog_cancel (self):
|
def handle_filter_progress_dialog_cancel (self):
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
self.progress_dialog.destroy ()
|
self.progress_dialog.destroy ()
|
||||||
self.progress_dialog = None
|
self.progress_dialog = None
|
||||||
|
|
||||||
# FIXME: Implement filter cancelling correctly; the stuff below does
|
|
||||||
# not work.
|
|
||||||
|
|
||||||
self.log_filter.abort_process ()
|
self.log_filter.abort_process ()
|
||||||
self.log_filter.reset ()
|
self.log_view.props.model = self.log_filter
|
||||||
# FIXME:
|
self.pop_view_state ()
|
||||||
self.actions.show_hidden_lines.activate ()
|
|
||||||
|
|
||||||
def handle_log_filter_process_finished (self):
|
def handle_log_filter_process_finished (self):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue