minor fixes

This commit is contained in:
DYefremov
2020-01-18 15:28:46 +03:00
parent 7df7e0b630
commit 136fd118cb
4 changed files with 13 additions and 7 deletions

View File

@@ -289,8 +289,9 @@ class HttpAPI:
def __init__(self, settings):
self._settings = settings
self._base_url = None
self._shutdown = False
self._session_id = 0
self._base_url = None
self._data = None
self.init()
@@ -298,6 +299,9 @@ class HttpAPI:
self._executor = PoolExecutor(max_workers=self.__MAX_WORKERS)
def send(self, req_type, ref, callback=print):
if self._shutdown:
return
url = self._base_url + req_type.value
if req_type is HttpRequestType.ZAP or req_type is HttpRequestType.STREAM:
@@ -320,8 +324,10 @@ class HttpAPI:
if s_id != "0":
self._data = urllib.parse.urlencode({"user": user, "password": password, "sessionid": s_id}).encode("utf-8")
@run_task
def close(self):
self._executor.shutdown(False)
self._shutdown = True
self._executor.shutdown()
def get_response(req_type, url, data=None):

View File

@@ -1677,9 +1677,9 @@ class Application(Gtk.Application):
def on_player_duration_changed(self, duration):
self._player_scale.set_value(0)
self._player_scale.get_adjustment().set_upper(duration)
GLib.idle_add(self._player_rewind_box.set_visible, duration > 0)
GLib.idle_add(self._player_current_time_label.set_text, "0")
GLib.idle_add(self._player_full_time_label.set_text, self.get_time_str(duration))
GLib.idle_add(self._player_rewind_box.set_visible, duration > 0, priority=GLib.PRIORITY_LOW)
GLib.idle_add(self._player_current_time_label.set_text, "0", priority=GLib.PRIORITY_LOW)
GLib.idle_add(self._player_full_time_label.set_text, self.get_time_str(duration), priority=GLib.PRIORITY_LOW)
def on_player_time_changed(self, t):
if not self._full_screen and self._player_rewind_box.get_visible():

View File

@@ -1455,7 +1455,7 @@ Author: Dmitriy Yefremov
<child>
<object class="GtkScale" id="player_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="adjustment">player_scale_adjustment</property>

View File

@@ -69,7 +69,7 @@ class ServiceDetailsDialog:
# Patterns
self._DIGIT_PATTERN = re.compile("\\D")
self._NON_EMPTY_PATTERN = re.compile("(?:^[\\s]*$|\\D)")
self._CAID_PATTERN = re.compile("(?:^[\\s]*$)|(C:[0-9a-z]{4})(,C:[0-9a-z]{4})*")
self._CAID_PATTERN = re.compile("(?:^[\\s]*$)|(C:[0-9a-fA-F]{1,4})(,C:[0-9a-fA-F]{1,4})*")
# Buttons
self._apply_button = builder.get_object("apply_button")
self._create_button = builder.get_object("create_button")