added check

This commit is contained in:
ingvar1995 2017-02-11 22:04:32 +03:00
parent 704344fae2
commit 1d33d298c3
2 changed files with 10 additions and 6 deletions

View File

@ -199,9 +199,10 @@ class Toxygen:
class Menu(QtGui.QMenu): class Menu(QtGui.QMenu):
def newStatus(self, status): def newStatus(self, status):
profile.Profile.get_instance().set_status(status) if not Settings.get_instance().locked:
self.aboutToShow() profile.Profile.get_instance().set_status(status)
self.hide() self.aboutToShow()
self.hide()
def aboutToShow(self): def aboutToShow(self):
status = profile.Profile.get_instance().status status = profile.Profile.get_instance().status
@ -256,8 +257,9 @@ class Toxygen:
show_window() show_window()
def close_app(): def close_app():
settings.closing = True if not Settings.get_instance().locked:
self.ms.close() settings.closing = True
self.ms.close()
m.connect(show, QtCore.SIGNAL("triggered()"), show_window) m.connect(show, QtCore.SIGNAL("triggered()"), show_window)
m.connect(exit, QtCore.SIGNAL("triggered()"), close_app) m.connect(exit, QtCore.SIGNAL("triggered()"), close_app)

View File

@ -6,10 +6,12 @@ from toxencryptsave_enums_and_consts import *
class ToxEncryptSave: class ToxEncryptSave:
def __init__(self): def __init__(self):
super().__init__()
self.libtoxencryptsave = libtox.LibToxEncryptSave() self.libtoxencryptsave = libtox.LibToxEncryptSave()
def is_data_encrypted(self, data): def is_data_encrypted(self, data):
"""
Checks if given data is encrypted
"""
func = self.libtoxencryptsave.tox_is_data_encrypted func = self.libtoxencryptsave.tox_is_data_encrypted
func.restype = c_bool func.restype = c_bool
result = func(c_char_p(bytes(data))) result = func(c_char_p(bytes(data)))