From 1d33d298c399740e6fb31c68c662dec583cdc8c9 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sat, 11 Feb 2017 22:04:32 +0300 Subject: [PATCH] added check --- toxygen/main.py | 12 +++++++----- toxygen/toxencryptsave.py | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/toxygen/main.py b/toxygen/main.py index 99622a9..a4c3ddc 100644 --- a/toxygen/main.py +++ b/toxygen/main.py @@ -199,9 +199,10 @@ class Toxygen: class Menu(QtGui.QMenu): def newStatus(self, status): - profile.Profile.get_instance().set_status(status) - self.aboutToShow() - self.hide() + if not Settings.get_instance().locked: + profile.Profile.get_instance().set_status(status) + self.aboutToShow() + self.hide() def aboutToShow(self): status = profile.Profile.get_instance().status @@ -256,8 +257,9 @@ class Toxygen: show_window() def close_app(): - settings.closing = True - self.ms.close() + if not Settings.get_instance().locked: + settings.closing = True + self.ms.close() m.connect(show, QtCore.SIGNAL("triggered()"), show_window) m.connect(exit, QtCore.SIGNAL("triggered()"), close_app) diff --git a/toxygen/toxencryptsave.py b/toxygen/toxencryptsave.py index 4af4783..b579e21 100644 --- a/toxygen/toxencryptsave.py +++ b/toxygen/toxencryptsave.py @@ -6,10 +6,12 @@ from toxencryptsave_enums_and_consts import * class ToxEncryptSave: def __init__(self): - super().__init__() self.libtoxencryptsave = libtox.LibToxEncryptSave() def is_data_encrypted(self, data): + """ + Checks if given data is encrypted + """ func = self.libtoxencryptsave.tox_is_data_encrypted func.restype = c_bool result = func(c_char_p(bytes(data)))