Permalink
Browse files

Merge remote branch 'arantes555/master'

Conflicts:
	amsn2/ui/front_ends/gtk/utility.py
  • Loading branch information...
2 parents 4268418 + 91defb3 commit 4da261078b029ed5e7ac1ef3663dfdd4cd7f384e @billiob billiob committed Sep 11, 2010
Showing with 638 additions and 171 deletions.
  1. +2 −0 amsn2/core/amsn.py
  2. +122 −0 amsn2/core/smiley_manager.py
  3. +93 −0 amsn2/core/theme_manager.py
  4. +5 −10 amsn2/core/userinterface_manager.py
  5. BIN amsn2/{ → themes}/smileys/default/airplane.png
  6. BIN amsn2/{ → themes}/smileys/default/angel.png
  7. BIN amsn2/{ → themes}/smileys/default/angry.png
  8. BIN amsn2/{ → themes}/smileys/default/ball.png
  9. BIN amsn2/{ → themes}/smileys/default/bat.png
  10. BIN amsn2/{ → themes}/smileys/default/beer.png
  11. BIN amsn2/{ → themes}/smileys/default/big_smile.png
  12. BIN amsn2/{ → themes}/smileys/default/bowl.png
  13. BIN amsn2/{ → themes}/smileys/default/boy.png
  14. BIN amsn2/{ → themes}/smileys/default/brb.png
  15. BIN amsn2/{ → themes}/smileys/default/broken_heart.png
  16. BIN amsn2/{ → themes}/smileys/default/cake.png
  17. BIN amsn2/{ → themes}/smileys/default/camera.png
  18. BIN amsn2/{ → themes}/smileys/default/car.png
  19. BIN amsn2/{ → themes}/smileys/default/cat.png
  20. BIN amsn2/{ → themes}/smileys/default/cigarette.png
  21. BIN amsn2/{ → themes}/smileys/default/clapping_hands.png
  22. BIN amsn2/{ → themes}/smileys/default/clock.png
  23. BIN amsn2/{ → themes}/smileys/default/coffee.png
  24. BIN amsn2/{ → themes}/smileys/default/computer.png
  25. BIN amsn2/{ → themes}/smileys/default/confused.png
  26. BIN amsn2/{ → themes}/smileys/default/cool_glasses.png
  27. BIN amsn2/{ → themes}/smileys/default/crying.png
  28. BIN amsn2/{ → themes}/smileys/default/dead_rose.png
  29. BIN amsn2/{ → themes}/smileys/default/devil.png
  30. BIN amsn2/{ → themes}/smileys/default/disapointed.png
  31. BIN amsn2/{ → themes}/smileys/default/dog.png
  32. BIN amsn2/{ → themes}/smileys/default/dont_know.png
  33. BIN amsn2/{ → themes}/smileys/default/drink.png
  34. BIN amsn2/{ → themes}/smileys/default/email.png
  35. BIN amsn2/{ → themes}/smileys/default/embarrassed.png
  36. BIN amsn2/{ → themes}/smileys/default/eye_rolling.png
  37. BIN amsn2/{ → themes}/smileys/default/film.png
  38. BIN amsn2/{ → themes}/smileys/default/finger_cross.png
  39. BIN amsn2/{ → themes}/smileys/default/gift.png
  40. BIN amsn2/{ → themes}/smileys/default/girl.png
  41. BIN amsn2/{ → themes}/smileys/default/goat.png
  42. BIN amsn2/{ → themes}/smileys/default/handcuffs.png
  43. BIN amsn2/{ → themes}/smileys/default/heart.png
  44. BIN amsn2/{ → themes}/smileys/default/im.png
  45. BIN amsn2/{ → themes}/smileys/default/island.png
  46. BIN amsn2/{ → themes}/smileys/default/kiss.png
  47. BIN amsn2/{ → themes}/smileys/default/left_hug.png
  48. BIN amsn2/{ → themes}/smileys/default/light.png
  49. BIN amsn2/{ → themes}/smileys/default/mobile.png
  50. BIN amsn2/{ → themes}/smileys/default/money.png
  51. BIN amsn2/{ → themes}/smileys/default/moon.png
  52. BIN amsn2/{ → themes}/smileys/default/msn.png
  53. BIN amsn2/{ → themes}/smileys/default/nerd.png
  54. BIN amsn2/{ → themes}/smileys/default/note.png
  55. BIN amsn2/{ → themes}/smileys/default/party.png
  56. BIN amsn2/{ → themes}/smileys/default/phone.png
  57. BIN amsn2/{ → themes}/smileys/default/pizza.png
  58. BIN amsn2/{ → themes}/smileys/default/plate.png
  59. BIN amsn2/{ → themes}/smileys/default/quiet.png
  60. BIN amsn2/{ → themes}/smileys/default/rabbit.png
  61. BIN amsn2/{ → themes}/smileys/default/rain.png
  62. BIN amsn2/{ → themes}/smileys/default/rainbow.png
  63. BIN amsn2/{ → themes}/smileys/default/right_hug.png
  64. BIN amsn2/{ → themes}/smileys/default/rose.png
  65. BIN amsn2/{ → themes}/smileys/default/sad.png
  66. BIN amsn2/{ → themes}/smileys/default/sarcastic.png
  67. BIN amsn2/{ → themes}/smileys/default/secret.png
  68. BIN amsn2/{ → themes}/smileys/default/sheep.png
  69. BIN amsn2/{ → themes}/smileys/default/shock.png
  70. BIN amsn2/{ → themes}/smileys/default/sick.png
  71. BIN amsn2/{ → themes}/smileys/default/smile.png
  72. BIN amsn2/{ → themes}/smileys/default/snail.png
  73. BIN amsn2/{ → themes}/smileys/default/star.png
  74. BIN amsn2/{ → themes}/smileys/default/storm.png
  75. BIN amsn2/{ → themes}/smileys/default/sun.png
  76. BIN amsn2/{ → themes}/smileys/default/teeth.png
  77. BIN amsn2/{ → themes}/smileys/default/think.png
  78. BIN amsn2/{ → themes}/smileys/default/thumb_down.png
  79. BIN amsn2/{ → themes}/smileys/default/thumb_up.png
  80. BIN amsn2/{ → themes}/smileys/default/tired.png
  81. BIN amsn2/{ → themes}/smileys/default/tongue.png
  82. BIN amsn2/{ → themes}/smileys/default/turtle.png
  83. BIN amsn2/{ → themes}/smileys/default/umbrella.png
  84. BIN amsn2/{ → themes}/smileys/default/wink.png
  85. BIN amsn2/{ → themes}/smileys/default/xbox.png
  86. +1 −1 amsn2/ui/base/choosers.py
  87. +14 −7 amsn2/ui/base/utility.py
  88. +0 −5 amsn2/ui/front_ends/gtk/chat_window.py
  89. +14 −7 amsn2/ui/front_ends/gtk/utility.py
  90. +1 −3 amsn2/ui/front_ends/qt4/chat_window.py
  91. +68 −38 amsn2/ui/front_ends/qt4/choosers.py
  92. +5 −1 amsn2/ui/front_ends/qt4/contact_list.py
  93. +275 −98 amsn2/ui/front_ends/qt4/utility.py
  94. +38 −1 amsn2/views/stringview.py
View
@@ -29,6 +29,7 @@
from conversation_manager import *
from oim_manager import *
from theme_manager import *
+from smiley_manager import *
from personalinfo_manager import *
from event_manager import *
from userinterface_manager import *
@@ -77,6 +78,7 @@ def __init__(self, options = None, extra_args = None):
self._backend_manager = aMSNBackendManager(self)
self._account_manager = aMSNAccountManager(self, options)
self._theme_manager = aMSNThemeManager(self)
+ self._smiley_manager = aMSNSmileyManager(self)
self._contactlist_manager = aMSNContactListManager(self)
self._oim_manager = aMSNOIMManager(self)
self._conversation_manager = aMSNConversationManager(self)
@@ -0,0 +1,122 @@
+# -*- coding: utf-8 -*-
+#
+# amsn - a python client for the WLM Network
+#
+# Copyright (C) 2010 Mehdi KOUHEN <arantes555@hotmail.fr>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+class aMSNSmileyManager:
+ def __init__(self, core): #for now, only a dic of default smileys' shortcuts
+ self._core = core
+ self.default_smileys_shortcuts = {
+ "(ap)": "smiley_airplane",
+ "(a)": "smiley_angel",
+ ":-@": "smiley_angry",
+ ":@": "smiley_angry",
+ "(so)": "smiley_ball",
+ ":-[": "smiley_bat",
+ ":[": "smiley_bat",
+ "(b)": "smiley_beer",
+ ":D": "smiley_big_smile",
+ ":>": "smiley_big_smile",
+ ":->": "smiley_big_smile",
+ ":-D": "smiley_big_smile",
+ "(||)": "smiley_bowl",
+ "(z)": "smiley_boy",
+ "(brb)": "smiley_brb",
+ "(u)": "smiley_broken_heart",
+ "(^)": "smiley_cake",
+ "(p)": "smiley_camera",
+ "(au)": "smiley_car",
+ "(@)": "smiley_cat",
+ "(ci)": "smiley_cigarette",
+ "(h5)": "smiley_clapping_hands",
+ "(o)": "smiley_clock",
+ "(c)": "smiley_coffee",
+ "(co)": "smiley_computer",
+ ":-s": "smiley_confused",
+ ":s": "smiley_confused",
+ "(h)": "smiley_cool_glasses",
+ ":'(": "smiley_crying",
+ "(w)": "smiley_dead_rose",
+ "(6)": "smiley_devil",
+ ":|": "smiley_disapointed",
+ ":-|": "smiley_disapointed",
+ "(&)": "smiley_dog",
+ ":^)": "smiley_dont_know",
+ "(d)": "smiley_drink",
+ "(e)": "smiley_email",
+ ":$": "smiley_embarrassed",
+ ":-$": "smiley_embarrassed",
+ "8-)": "smiley_eye_rolling",
+ "(~)": "smiley_film",
+ "(yn)": "smiley_finger_cross",
+ "(g)": "smiley_gift",
+ "(x)": "smiley_girl",
+ "(nah)": "smiley_goat",
+ "(%)": "smiley_handcuffs",
+ "(l)": "smiley_heart",
+ "*red+u": "smiley_im",
+ "(ip)": "smiley_island",
+ "(k)": "smiley_kiss",
+ "({)": "smiley_left_hug",
+ "(i)": "smiley_light",
+ "(mp)": "smiley_mobile",
+ "(mo)": "smiley_money",
+ "(s)": "smiley_moon",
+ "(m)": "smiley_msn",
+ "8-|": "smiley_nerd",
+ "(8)": "smiley_note",
+ "<:o)": "smiley_party",
+ "(t)": "smiley_phone",
+ "(pi)": "smiley_pizza",
+ "(pl)": "smiley_plate",
+ ":-#": "smiley_quiet",
+ "('.')": "smiley_rabbit",
+ "(st)": "smiley_rain",
+ "(r)": "smiley_rainbow",
+ "(})": "smiley_right_hug",
+ "(f)": "smiley_rose",
+ ":(": "smiley_sad",
+ ":-(": "smiley_sad",
+ ":-<": "smiley_sad",
+ ":<": "smiley_sad",
+ "^o)": "smiley_sarcastic",
+ ":-*": "smiley_secret",
+ "(nah)": "smiley_sheep",
+ ":-o": "smiley_shock",
+ ":o": "smiley_shock",
+ "+o(": "smiley_sick",
+ ":)": "smiley_smile",
+ ":-)": "smiley_smile",
+ "(sn)": "smiley_snail",
+ "(*)": "smiley_star",
+ "(li)": "smiley_storm",
+ "(#)": "smiley_sun",
+ "8o|": "smiley_teeth",
+ "*-)": "smiley_think",
+ "(n)": "smiley_thumb_down",
+ "(y)": "smiley_thumb_up",
+ "|-)": "smiley_tired",
+ ":p": "smiley_tongue",
+ ":-p": "smiley_tongue",
+ "(tu)": "smiley_turtle",
+ "(um)": "smiley_umbrella",
+ ";)": "smiley_wink",
+ ";-)": "smiley_wink",
+ "(xx)": "smiley_xbox",
+ }
@@ -47,6 +47,7 @@ def load(self):
self._statusicons = aMSNStatusIconLoader().load('default')
self._displaypic = aMSNDisplayPicLoader().load('default')
self._emblems = aMSNEmblemLoader().load('default')
+ self._smileys = aMSNSmileyLoader().load('default')
def get_value(self, key):
if (key.startswith('button_')):
@@ -57,6 +58,8 @@ def get_value(self, key):
return self.get_dp(key)
elif (key.startswith('emblem_')):
return self.get_emblem(key)
+ elif (key.startswith('smiley_')):
+ return self.get_smiley(key)
else:
# TODO: This should raise a exception
return (None, None)
@@ -73,6 +76,9 @@ def get_dp(self, key):
def get_emblem(self, key):
return self.__get(self._emblems, key)
+ def get_smiley(self, key):
+ return self.__get(self._smileys, key)
+
class aMSNGenericLoader:
def __init__(self, basedir):
self._theme = 'default'
@@ -151,3 +157,90 @@ def __init__(self):
'emblem_hidden': 'offline_emblem.png',
'emblem_blocked': 'blocked_emblem.png',
}
+
+class aMSNSmileyLoader(aMSNGenericLoader):
+ def __init__(self):
+ aMSNGenericLoader.__init__(self, "smileys")
+ self._keys = {
+ 'smiley_airplane': 'airplane.png',
+ 'smiley_angel': 'angel.png',
+ 'smiley_angry': 'angry.png',
+ 'smiley_ball': 'ball.png',
+ 'smiley_bat': 'bat.png',
+ 'smiley_beer': 'beer.png',
+ 'smiley_big_smile': 'big_smile.png',
+ 'smiley_bowl': 'bowl.png',
+ 'smiley_boy': 'boy.png',
+ 'smiley_brb': 'brb.png',
+ 'smiley_broken_heart': 'broken_heart.png',
+ 'smiley_cake': 'cake.png',
+ 'smiley_camera': 'camera.png',
+ 'smiley_car': 'car.png',
+ 'smiley_cat': 'cat.png',
+ 'smiley_cigarette': 'cigarette.png',
+ 'smiley_clapping_hands': 'clapping_hands.png',
+ 'smiley_clock': 'clock.png',
+ 'smiley_coffee': 'coffee.png',
+ 'smiley_computer': 'computer.png',
+ 'smiley_confused': 'confused.png',
+ 'smiley_cool_glasses': 'cool_glasses.png',
+ 'smiley_crying': 'crying.png',
+ 'smiley_dead_rose': 'dead_rose.png',
+ 'smiley_devil': 'devil.png',
+ 'smiley_disapointed': 'disapointed.png',
+ 'smiley_dog': 'dog.png',
+ 'smiley_dont_know': 'dont_know.png',
+ 'smiley_drink': 'drink.png',
+ 'smiley_email': 'email.png',
+ 'smiley_embarrassed': 'embarrassed.png',
+ 'smiley_eye_rolling': 'eye_rolling.png',
+ 'smiley_film': 'film.png',
+ 'smiley_finger_cross': 'finger_cross.png',
+ 'smiley_gift': 'gift.png',
+ 'smiley_girl': 'girl.png',
+ 'smiley_goat': 'goat.png',
+ 'smiley_handcuffs': 'handcuffs.png',
+ 'smiley_heart': 'heart.png',
+ 'smiley_im': 'im.png',
+ 'smiley_island': 'island.png',
+ 'smiley_kiss': 'kiss.png',
+ 'smiley_left_hug': 'left_hug.png',
+ 'smiley_light': 'light.png',
+ 'smiley_mobile': 'mobile.png',
+ 'smiley_money': 'money.png',
+ 'smiley_moon': 'moon.png',
+ 'smiley_msn': 'msn.png',
+ 'smiley_nerd': 'nerd.png',
+ 'smiley_note': 'note.png',
+ 'smiley_party': 'party.png',
+ 'smiley_phone': 'phone.png',
+ 'smiley_pizza': 'pizza.png',
+ 'smiley_plate': 'plate.png',
+ 'smiley_quiet': 'quiet.png',
+ 'smiley_rabbit': 'rabbit.png',
+ 'smiley_rain': 'rain.png',
+ 'smiley_rainbow': 'rainbow.png',
+ 'smiley_right_hug': 'right_hug.png',
+ 'smiley_rose': 'rose.png',
+ 'smiley_sad': 'sad.png',
+ 'smiley_sarcastic': 'sarcastic.png',
+ 'smiley_secret': 'secret.png',
+ 'smiley_sheep': 'sheep.png',
+ 'smiley_shock': 'shock.png',
+ 'smiley_sick': 'sick.png',
+ 'smiley_smile': 'smile.png',
+ 'smiley_snail': 'snail.png',
+ 'smiley_star': 'star.png',
+ 'smiley_storm': 'storm.png',
+ 'smiley_sun': 'sun.png',
+ 'smiley_teeth': 'teeth.png',
+ 'smiley_think': 'think.png',
+ 'smiley_thumb_down': 'thumb_down.png',
+ 'smiley_thumb_up': 'thumb_up.png',
+ 'smiley_tired': 'tired.png',
+ 'smiley_tongue': 'tongue.png',
+ 'smiley_turtle': 'turtle.png',
+ 'smiley_umbrella': 'umbrella.png',
+ 'smiley_wink': 'wink.png',
+ 'smiley_xbox': 'xbox.png',
+ }
@@ -130,32 +130,27 @@ def load_chat_widget(self, conversation, window, cuids):
def load_contact_input_window(self, callback, groupviews):
win = self._ui.aMSNContactInputWindow(('Contact to add: ', 'Invite message: '),
- callback, groupviews)
- win.set_title("aMSN 2 - Add a Contact")
+ callback, groupviews, "aMSN 2 - Add a Contact")
win.show()
return win
def load_contact_delete_window(self, callback, contactviews):
- win = self._ui.aMSNContactDeleteWindow(('Contact to remove: ',), callback, contactviews)
- win.set_title("aMSN 2 - Delete a Contact")
+ win = self._ui.aMSNContactDeleteWindow(('Contact to remove: ',), callback, contactviews, "aMSN 2 - Delete a Contact")
win.show()
return win
def load_group_input_window(self, callback, contactviews):
- win = self._ui.aMSNGroupInputWindow(('Group to add: ',), callback, contactviews)
- win.set_title("aMSN 2 - Add a Group")
+ win = self._ui.aMSNGroupInputWindow(('Group to add: ',), callback, contactviews, "aMSN 2 - Add a Group")
win.show()
return win
def load_group_delete_window(self, callback, groupviews):
- win = self._ui.aMSNGroupDeleteWindow(('Group to remove: ',), callback, groupviews)
- win.set_title("aMSN 2 - Delete a Group")
+ win = self._ui.aMSNGroupDeleteWindow(('Group to remove: ',), callback, groupviews, "aMSN 2 - Delete a Group")
win.show()
return win
def load_DP_chooser_window(self):
- win = self._ui.aMSNDPChooserWindow(self._core._account.set_dp ,self._core._backend_manager)
- win.set_title("aMSN 2 - Choose a Display Picture")
+ win = self._ui.aMSNDPChooserWindow(self._core._account.set_dp ,self._core._backend_manager, "aMSN 2 - Choose a Display Picture")
win.show()
# Common methods for all UI
@@ -4,7 +4,7 @@ class aMSNFileChooserWindow(object):
This Interface represent a window used to choose a file,
which could be an image for the dp, a file to send, a theme file, etc.
"""
- def __init__(self, filters, directory, callback):
+ def __init__(self, filters, directory, callback, title = "aMSN Display Picture Chooser"):
"""
@type filter: dict of tuple
@param filter: A dict whose keys are the names of the filters,
Oops, something went wrong.

0 comments on commit 4da2610

Please sign in to comment.