From 889d3d8f9cb99a3e4bc047fd4b523f1a742b24c0 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sun, 22 Jan 2017 00:19:56 +0300 Subject: [PATCH] 2 minor bug fixes --- toxygen/mainscreen.py | 4 ++++ toxygen/util.py | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/toxygen/mainscreen.py b/toxygen/mainscreen.py index 336ba9d..a112db1 100644 --- a/toxygen/mainscreen.py +++ b/toxygen/mainscreen.py @@ -690,6 +690,10 @@ class MainWindow(QtGui.QMainWindow, Singleton): else: super(MainWindow, self).mouseReleaseEvent(event) + def show(self): + super().show() + self.profile.update() + def filtering(self): ind = self.online_contacts.currentIndex() d = {0: 0, 1: 1, 2: 2, 3: 4, 4: 1 | 4, 5: 2 | 4} diff --git a/toxygen/util.py b/toxygen/util.py index e78eca6..b997873 100644 --- a/toxygen/util.py +++ b/toxygen/util.py @@ -37,7 +37,7 @@ def remove(folder): def convert_time(t): - offset = time.timezone + time_offset() * 3600 + offset = time.timezone + time_offset() * 60 sec = int(t) - offset m, s = divmod(sec, 60) h, m = divmod(m, 60) @@ -46,12 +46,17 @@ def convert_time(t): def time_offset(): - hours = time.strftime('%H') + if hasattr(time_offset, 'offset'): + return time_offset.offset + hours = int(time.strftime('%H')) + minutes = int(time.strftime('%M')) sec = int(time.time()) - time.timezone m, s = divmod(sec, 60) h, m = divmod(m, 60) d, h = divmod(h, 24) - return int(hours) - h + result = hours * 60 + minutes - h * 60 - m + time_offset.offset = result + return result def append_slash(s):