some updates and fixes
This commit is contained in:
parent
3db10ead6a
commit
fdfc74521b
4 changed files with 33 additions and 19 deletions
|
@ -6,13 +6,14 @@ import util
|
|||
class LibToxCore:
|
||||
|
||||
def __init__(self):
|
||||
if system() == 'Linux':
|
||||
# libtoxcore and libsodium must be installed in your os
|
||||
self._libtoxcore = CDLL('libtoxcore.so')
|
||||
elif system() == 'Windows':
|
||||
if system() == 'Windows':
|
||||
self._libtoxcore = CDLL(util.curr_directory() + '/libs/libtox.dll')
|
||||
else:
|
||||
raise OSError('Unknown system.')
|
||||
# libtoxcore and libsodium must be installed in your os
|
||||
try:
|
||||
self._libtoxcore = CDLL('libtoxcore.so')
|
||||
except:
|
||||
self._libtoxcore = CDLL(util.curr_directory() + '/libs/libtoxcore.so')
|
||||
|
||||
def __getattr__(self, item):
|
||||
return self._libtoxcore.__getattr__(item)
|
||||
|
@ -21,14 +22,15 @@ class LibToxCore:
|
|||
class LibToxAV:
|
||||
|
||||
def __init__(self):
|
||||
if system() == 'Linux':
|
||||
# that /usr/lib/libtoxav.so must exists
|
||||
self._libtoxav = CDLL('libtoxav.so')
|
||||
elif system() == 'Windows':
|
||||
if system() == 'Windows':
|
||||
# on Windows av api is in libtox.dll
|
||||
self._libtoxav = CDLL(util.curr_directory() + '/libs/libtox.dll')
|
||||
else:
|
||||
raise OSError('Unknown system.')
|
||||
# /usr/lib/libtoxav.so must exists
|
||||
try:
|
||||
self._libtoxav = CDLL('libtoxav.so')
|
||||
except:
|
||||
self._libtoxav = CDLL(util.curr_directory() + '/libs/libtoxav.so')
|
||||
|
||||
def __getattr__(self, item):
|
||||
return self._libtoxav.__getattr__(item)
|
||||
|
@ -37,14 +39,15 @@ class LibToxAV:
|
|||
class LibToxEncryptSave:
|
||||
|
||||
def __init__(self):
|
||||
if system() == 'Linux':
|
||||
# /usr/lib/libtoxencryptsave.so must exists
|
||||
self._lib_tox_encrypt_save = CDLL('libtoxencryptsave.so')
|
||||
elif system() == 'Windows':
|
||||
if system() == 'Windows':
|
||||
# on Windows profile encryption api is in libtox.dll
|
||||
self._lib_tox_encrypt_save = CDLL(util.curr_directory() + '/libs/libtox.dll')
|
||||
else:
|
||||
raise OSError('Unknown system.')
|
||||
# /usr/lib/libtoxencryptsave.so must exists
|
||||
try:
|
||||
self._lib_tox_encrypt_save = CDLL('libtoxencryptsave.so')
|
||||
except:
|
||||
self._lib_tox_encrypt_save = CDLL(util.curr_directory() + '/libs/libtoxencryptsave.so')
|
||||
|
||||
def __getattr__(self, item):
|
||||
return self._lib_tox_encrypt_save.__getattr__(item)
|
||||
|
|
|
@ -265,6 +265,7 @@ class MainWindow(QtGui.QMainWindow, Singleton):
|
|||
self.messages.verticalScrollBar().setValue(1)
|
||||
self.messages.verticalScrollBar().valueChanged.connect(load)
|
||||
self.messages.setVerticalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel)
|
||||
self.messages.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
|
||||
|
||||
def initUI(self, tox):
|
||||
self.setMinimumSize(920, 500)
|
||||
|
@ -325,8 +326,8 @@ class MainWindow(QtGui.QMainWindow, Singleton):
|
|||
self.profile.save_history()
|
||||
self.profile.close()
|
||||
s = Settings.get_instance()
|
||||
s['x'] = self.pos().x()
|
||||
s['y'] = self.pos().y()
|
||||
s['x'] = self.geometry().x()
|
||||
s['y'] = self.geometry().y()
|
||||
s['width'] = self.width()
|
||||
s['height'] = self.height()
|
||||
s.save()
|
||||
|
@ -610,4 +611,3 @@ class MainWindow(QtGui.QMainWindow, Singleton):
|
|||
|
||||
def filtering(self):
|
||||
self.profile.filtration(self.online_contacts.currentIndex() == 1, self.contact_name.text())
|
||||
|
||||
|
|
|
@ -266,7 +266,8 @@ class ProfileSettings(CenteredWidget):
|
|||
Profile.get_instance().set_avatar(bytes(byte_array.data()))
|
||||
|
||||
def export_profile(self):
|
||||
directory = QtGui.QFileDialog.getExistingDirectory(options=QtGui.QFileDialog.DontUseNativeDialog) + '/'
|
||||
directory = QtGui.QFileDialog.getExistingDirectory(options=QtGui.QFileDialog.DontUseNativeDialog,
|
||||
dir=curr_directory()) + '/'
|
||||
if directory != '/':
|
||||
ProfileHelper.get_instance().export_profile(directory)
|
||||
settings = Settings.get_instance()
|
||||
|
|
|
@ -1245,10 +1245,20 @@ QPushButton:hover
|
|||
}
|
||||
|
||||
#messages:item:selected
|
||||
{
|
||||
background-color: #1E90FF;
|
||||
}
|
||||
|
||||
MessageEdit
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#messages:item:selected QListWidgetItem
|
||||
{
|
||||
background-color: #1E90FF;
|
||||
}
|
||||
|
||||
#friends_list:item:selected
|
||||
{
|
||||
background-color: #333333;
|
||||
|
|
Loading…
Reference in a new issue