new smiley pack + fixes
|
@ -7,4 +7,4 @@ Install PyInstaller:
|
||||||
|
|
||||||
``pyinstaller --windowed --icon images/icon.ico main.py``
|
``pyinstaller --windowed --icon images/icon.ico main.py``
|
||||||
|
|
||||||
Don't forget to copy /images/, /sounds/, /translations/, /styles/, to /dist/main/
|
Don't forget to copy /images/, /sounds/, /translations/, /styles/, /smileys/, /stickers/ to /dist/main/
|
||||||
|
|
|
@ -7,7 +7,7 @@ import profile
|
||||||
from file_transfers import TOX_FILE_TRANSFER_STATE, PAUSED_FILE_TRANSFERS, DO_NOT_SHOW_ACCEPT_BUTTON, ACTIVE_FILE_TRANSFERS, SHOW_PROGRESS_BAR
|
from file_transfers import TOX_FILE_TRANSFER_STATE, PAUSED_FILE_TRANSFERS, DO_NOT_SHOW_ACCEPT_BUTTON, ACTIVE_FILE_TRANSFERS, SHOW_PROGRESS_BAR
|
||||||
from util import curr_directory, convert_time, curr_time
|
from util import curr_directory, convert_time, curr_time
|
||||||
from widgets import DataLabel, create_menu
|
from widgets import DataLabel, create_menu
|
||||||
import cgi
|
import html as h
|
||||||
import smileys
|
import smileys
|
||||||
import settings
|
import settings
|
||||||
|
|
||||||
|
@ -70,8 +70,7 @@ class MessageEdit(QtGui.QTextBrowser):
|
||||||
self.setLineWrapColumnOrWidth(self.lineWrapColumnOrWidth())
|
self.setLineWrapColumnOrWidth(self.lineWrapColumnOrWidth())
|
||||||
|
|
||||||
def decoratedText(self, text):
|
def decoratedText(self, text):
|
||||||
text = text.replace("&", "&")
|
text = h.escape(text) # replace < and >
|
||||||
text = cgi.escape(text) # replace < and >
|
|
||||||
exp = QtCore.QRegExp(
|
exp = QtCore.QRegExp(
|
||||||
'('
|
'('
|
||||||
'(?:\\b)((www\\.)|(http[s]?|ftp)://)'
|
'(?:\\b)((www\\.)|(http[s]?|ftp)://)'
|
||||||
|
|
|
@ -423,8 +423,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||||
def send_smiley(self):
|
def send_smiley(self):
|
||||||
self.menu.hide()
|
self.menu.hide()
|
||||||
if self.profile.active_friend + 1:
|
if self.profile.active_friend + 1:
|
||||||
if not hasattr(self, 'smiley'):
|
self.smiley = SmileyWindow(self)
|
||||||
self.smiley = SmileyWindow(self)
|
|
||||||
self.smiley.setGeometry(QtCore.QRect(self.x() if Settings.get_instance()['mirror_mode'] else 270 + self.x(),
|
self.smiley.setGeometry(QtCore.QRect(self.x() if Settings.get_instance()['mirror_mode'] else 270 + self.x(),
|
||||||
self.y() + self.height() - 200,
|
self.y() + self.height() - 200,
|
||||||
self.smiley.width(),
|
self.smiley.width(),
|
||||||
|
|
|
@ -131,11 +131,13 @@ class SmileyWindow(QtGui.QWidget):
|
||||||
inst = smileys.SmileyLoader.get_instance()
|
inst = smileys.SmileyLoader.get_instance()
|
||||||
self.data = inst.get_smileys()
|
self.data = inst.get_smileys()
|
||||||
count = len(self.data)
|
count = len(self.data)
|
||||||
|
if not count:
|
||||||
|
self.close()
|
||||||
self.page_size = int(pow(count / 8, 0.5) + 1) * 8 # smileys per page
|
self.page_size = int(pow(count / 8, 0.5) + 1) * 8 # smileys per page
|
||||||
if count % self.page_size == 0:
|
if count % self.page_size == 0:
|
||||||
self.page_count = count // self.page_size
|
self.page_count = count // self.page_size
|
||||||
else:
|
else:
|
||||||
self.page_count = int(count / float(self.page_size) + 0.5)
|
self.page_count = round(count / self.page_size + 0.5)
|
||||||
self.page = -1
|
self.page = -1
|
||||||
self.radio = []
|
self.radio = []
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
BIN
src/smileys/starwars/ackbar.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
src/smileys/starwars/anim.gif
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
src/smileys/starwars/boba.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/c3p0.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/chewie.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
1
src/smileys/starwars/config.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{":darthmaul:": "darthmaul.png", ":darthsidious:": "darthsidious.png", ":y-wing:": "y-wing.png", ":samjackson:": "samjackson.png", ":confused:": "confused.png", ":sith:": "sith.png", ":sad:": "sad.png", ":jango:": "jango.png", ":tongue:": "tongue.png", ":wink:": "wink.png", ":chewie:": "chewie.png", ":boba:": "boba.png", ":c3p0:": "c3p0.png", ":stormtrooper:": "stormtrooper.png", ":smile:": "smile.png", ":tape:": "tape.png", ":mad:": "mad.png", ":shocked:": "shocked.png", ":jedi:": "jedi.png", ":jarjarbinks:": "jarjarbinks.png", ":dualsith:": "dualsith.png", ":r2d2:": "r2d2.png", ":grin:": "grin.png", ":x-wing:": "x-wing.png", ":leia:": "leia.png", ":happy:": "happy.png", ":jedi2:": "jedi2.png", ":ackbar:": "ackbar.png", ":deathstar:": "deathstar.png", ":darthvader:": "darthvader.png", ":masteryoda:": "masteryoda.png", ":anim:": "anim.gif"}
|
BIN
src/smileys/starwars/confused.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/darthmaul.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
src/smileys/starwars/darthsidious.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/smileys/starwars/darthvader.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/smileys/starwars/deathstar.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/dualsith.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/smileys/starwars/grin.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/happy.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/jango.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/jarjarbinks.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/smileys/starwars/jedi.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
src/smileys/starwars/jedi2.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
src/smileys/starwars/leia.png
Normal file
After Width: | Height: | Size: 1,022 B |
BIN
src/smileys/starwars/mad.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/masteryoda.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
src/smileys/starwars/r2d2.png
Normal file
After Width: | Height: | Size: 958 B |
BIN
src/smileys/starwars/sad.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/samjackson.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/smileys/starwars/shocked.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/sith.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/smileys/starwars/smile.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/stormtrooper.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/tape.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
src/smileys/starwars/tongue.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/wink.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
src/smileys/starwars/x-wing.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
src/smileys/starwars/y-wing.png
Normal file
After Width: | Height: | Size: 2.4 KiB |