diff browser_side/dialog.py @ 62:12e889a683ce SàT v0.2.0

server side: misc stuff: - fixed lot of misuse in callbacks - chat history fixed - a visual indicator now appear when we have message waiting from a contact - fixed About dialog size issue in webkit - fixed Drag'n'Drop for webkit - defaut room to join is now libervia@conference.libervia.org
author Goffi <goffi@goffi.org>
date Tue, 31 May 2011 17:06:59 +0200
parents e552a67b933d
children 9d8e79ac4c9c
line wrap: on
line diff
--- a/browser_side/dialog.py	Tue May 31 17:03:37 2011 +0200
+++ b/browser_side/dialog.py	Tue May 31 17:06:59 2011 +0200
@@ -28,6 +28,7 @@
 from pyjamas.ui.TextBox import TextBox
 from pyjamas.ui.Label import Label
 from pyjamas.ui.HTML import HTML
+from pyjamas.ui.Frame import Frame
 from pyjamas.ui import HasAlignment
 from pyjamas.ui.KeyboardListener import KEY_ESCAPE, KEY_ENTER
 
@@ -63,7 +64,7 @@
         self.setHTML(text)
         self.setWidget(content)	
     
-    def onChange(self):
+    def onChange(self, sender):
         if self.nb_contact:
             if len(self.contacts_list.getSelectedValues()) == self.nb_contact:
                 self.choose_button.setEnabled(True)
@@ -80,11 +81,11 @@
                 self.contacts_list.addItem(contact)
         self.show()
 
-    def onChoose(self):
+    def onChoose(self, sender):
         self.hide()
         self.callback(self.contacts_list.getSelectedValues())
 
-    def onCancel(self):
+    def onCancel(self, sender):
         self.hide()
 
 class GenericConfirmDialog(DialogBox):
@@ -109,11 +110,11 @@
         self.setHTML(title)
         self.setWidget(content)	
     
-    def onConfirm(self):
+    def onConfirm(self, sender):
         self.hide()
         self.callback(True)
 
-    def onCancel(self):
+    def onCancel(self, sender):
         self.hide()
         self.callback(False)
 
@@ -141,9 +142,12 @@
         _body.setCellHorizontalAlignment(_close_button, HasAlignment.ALIGN_CENTER)
         self.setHTML(title)
         self.setWidget(_body)
-        self.panel.setWidth('100%')
+        if isinstance(widget, Frame):
+            #Need this hack to have correct size for About box + Social Contract
+            #in Gecko & Webkit
+            self.panel.setWidth('100%')
 
-    def onClose(self):
+    def onClose(self, sender):
         self.hide()
         if self.callback:
             self.callback()