time delta for time diff view is changeable
This commit is contained in:
@@ -2,15 +2,12 @@ from typing import Optional
|
||||
from src.pluginbase import PluginBase
|
||||
from src.plugins.domain.raction import RAction
|
||||
from src.plugins.logfile.preprocesslineshook import PreProcessLinesHook
|
||||
from src.plugins.timediff.time_diff_pre_process_lines_hook import TimeDiffPreProcessLinesHook
|
||||
from src.plugins.timediff.time_diff_menu_action import TimeDiffMenuAction
|
||||
|
||||
class TimeDiffPlugin(PluginBase):
|
||||
def __init__(self):
|
||||
super(TimeDiffPlugin, self).__init__()
|
||||
self.time_diff_state = False
|
||||
self.time_diff_action = RAction("", lambda: self._toggle_time_diff(),
|
||||
icon_file="icons/myicons/stopwatch.svg", checkable=True)
|
||||
self.time_diff_hook = TimeDiffPreProcessLinesHook()
|
||||
self.time_diff_action = TimeDiffMenuAction()
|
||||
|
||||
def copy(self):
|
||||
return TimeDiffPlugin()
|
||||
@@ -21,11 +18,4 @@ class TimeDiffPlugin(PluginBase):
|
||||
]
|
||||
|
||||
def get_pre_process_lines_hook(self) -> Optional[PreProcessLinesHook]:
|
||||
if self.time_diff_state:
|
||||
return self.time_diff_hook
|
||||
return self.time_diff_hook
|
||||
|
||||
def _toggle_time_diff(self):
|
||||
self.time_diff_state = not self.time_diff_state
|
||||
self.time_diff_action.set_checked(self.time_diff_state)
|
||||
self.time_diff_hook.active = self.time_diff_state
|
||||
return self.time_diff_action.time_diff_hook
|
||||
|
||||
Reference in New Issue
Block a user