emesene forum
March 10, 2010, 11:13:14 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: REPORT ANY ISSUE HERE - PLEASE CHECK IF THE PROBLEM HAS ALREADY BEEN REPORTED FIRST -- THANKS
 
  Home   Forum   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Patch to ConversationUI.py  (Read 848 times)
Erik
Newbie
*

l33tness: 0
Offline Offline

Posts: 3


View Profile
« on: August 14, 2008, 10:44:58 AM »

Earlier I posted a patch that enclosed a contact's e-mail with parentheses in conversation windows and then merged the personal message and e-mail lines to conserve space. After I used it a bit, though, I began to think that the change looked somewhat silly.

This patch leaves the e-mail as it is but still merges the personal message line with the e-mail line and separates them with a hyphen. As with last time, the line is truncated along with the e-mail so with long personal messages (or perhaps small windows), the e-mail can't be seen. Like I said before, I don't know how to fix that as I don't actually know Python; I just know how to manipulate code.

Code:
--- ConversationUI.py 2008-08-14 14:37:05.000000000 -0400
+++ ConversationUI-new.py 2008-08-14 14:35:57.000000000 -0400
@@ -503,13 +503,13 @@
                 nick += str(part)
 
             self.text = styleOpen + nick + \
-                styleClose + "<span foreground='%s'>" % personalMessageColor
+                styleClose + "<span foreground='%s'>\n" % personalMessageColor
             
             if contact.personalMessage:
-                self.text += '\n' + \
-                    emesenelib.common.escape(contact.personalMessage)
+                self.text += emesenelib.common.escape(contact.personalMessage) + \
+                ' - '
         
-            self.text += "\n%s</span>" % contact.email
+            self.text += "%s</span>" % contact.email
         elif len(members) > 1:
             self.text = styleOpen + _('Group chat') + styleClose + \
                 "\n<span foreground='%s'>" % personalMessageColor + \
Logged
beford
Newbie
*

l33tness: 0
Offline Offline

Posts: 2


View Profile
« Reply #1 on: September 06, 2008, 09:55:23 AM »

I also believe that the current 'theme' for the conversation header wastes some space, I might be wrong, but I think that a proper patch for this would be in the file Config.py, but this won't overwrite your current config, so you need to delete that manually, or apply the changes in the file /home/USER/.config/emesene1.0/YOURMSN/config on the convHeaderTheme line. As stated by the thread creator, if the personal message is too long, you won't be able to see the email. So probably a better approach would be '<email> Personal message' instead of 'Personal message <email>'.

Code:
--- Config.py (revision 1461)
+++ Config.py (working copy)
@@ -118,7 +118,7 @@
     'receivedFilesDir' : '~/',
     'disableEsc' : False, # disable the esc key to close conversations
     'disableFormat': False,
-    'convHeaderTheme': '%nick%\\n<span foreground="%pmColor%">%pm%\\n%email%</span>',
+    'convHeaderTheme': '%nick%\\n<span foreground="%pmColor%">%pm% &lt;%email%&gt;</span>',
     'autoAcceptTransfer': False
 }
« Last Edit: September 06, 2008, 10:01:02 AM by beford » Logged
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v.1.0.6 beta 2 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!