Hello.
I found the following problem:
Open two or more tabs in a chatwindow then press on X to close them.
You'll see a windows that ask if you want to close all tabs or only the
current tab.
Now click again on the previous X, you'll get another window that ask what
do you want to close.
So now in this window click on Yes then you still have another window click
Yes again, you'll get an error window (amen).

I wrote a possible solution.
In the diff file there are also some code changes, that remove useless set

Then in:
@@ -789,7 +795,7 @@
I changed the padx value from 0 to 3 because buttons aren't separated.

Thanks, bye.
Square87
Index: chatwindow.tcl
===================================================================
--- chatwindow.tcl      (revisione 9066)
+++ chatwindow.tcl      (copia locale)
@@ -265,7 +265,8 @@
                } elseif {[::config::isSet closeChatWindowWithTabs]} {
                        ::ChatWindow::CloseTab $currenttab
                } else {
-                       set result [::amsn::customMessageBox [trans closeall] 
yesnocancel question [trans title] $window 1 1]
+
+                       set result [::amsn::customMessageBox [trans closeall] 
yesnocancel question [trans title] $window 1 1 "ContainerClose"]
                        set answer [lindex $result 0]
                        set rememberAnswer [lindex $result 1]
                        
@@ -280,8 +281,7 @@
                        if { $answer == "yes" } {
                                ::ChatWindow::CloseAll $window
                                destroy $window
-                       }
-                       if { $answer == "no" } {
+                       } elseif { $answer == "no" } {
                                ::ChatWindow::CloseTab $currenttab
                        }
                }
Index: gui.tcl
===================================================================
--- gui.tcl     (revisione 9066)
+++ gui.tcl     (copia locale)
@@ -708,14 +708,20 @@
        
#///////////////////////////////////////////////////////////////////////////////
        
        
#///////////////////////////////////////////////////////////////////////////////
-       proc customMessageBox { message type {icon ""} {title ""} {parent ""} 
{askRememberAnswer 0} {modal 0}} {
+       proc customMessageBox { message type {icon ""} {title ""} {parent ""} 
{askRememberAnswer 0} {modal 0} {block ""} } {
                # This tracker is so we can TkWait. It needs to be global so 
that the buttons can modify it.
                global customMessageBoxAnswerTracker
                # This is the tracker for the checkbox.
                # It needs to be an array because we may have more than one 
message box open (hence the unique index). 
                global customMessageBoxRememberTracker
 
-               set unique [clock seconds]
+               if {$block == ""} {
+                       set unique [clock seconds]
+               } else {
+                       set unique $block
+                       if {[winfo exists ".messagebox_$unique"]} { return }
+               }
+
                set w ".messagebox_$unique"
 
                if { [winfo exists $w] } {
@@ -789,7 +795,7 @@
                        set buttonName [lindex $button 0]
                        set buttonLabel [lindex $button 1]
                        button $w.buttons.$buttonName -text $buttonLabel 
-command [list set customMessageBoxAnswerTracker($unique) $buttonName]
-                       pack $w.buttons.$buttonName -pady 0 -padx 0 -side right
+                       pack $w.buttons.$buttonName -pady 0 -padx 3 -side right
                }
 
                #Pack frames
@@ -1520,8 +1526,7 @@
                                        set t1 [expr {$secleft % 60 }] ;#Seconds
                                        set secleft [expr {int($secleft / 60)}]
                                        set t2 [expr {$secleft % 60 }] ;#Minutes
-                                       set secleft [expr {int($secleft / 60)}]
-                                       set t3 $secleft ;#Hours
+                                       set t3 [expr {int($secleft / 60)}] 
;#Hours
                                        set timeleft [format "%02i:%02i:%02i" 
$t3 $t2 $t1]
                                }
 
@@ -1587,10 +1592,7 @@
 
        #Converts filesize in KBytes or MBytes
        proc sizeconvert {filesize} {
-               #Converts in KBytes
-               set filesizeK [expr {int($filesize/1024)}]
-               #Converts in MBytes
-               set filesizeM [expr {int($filesize/1048576)}]
+               set filesizeM [expr {int($filesize/1048576)}] ;#Converts in 
MBytes
                #If the sizefile is bigger than 1Mo
                if {$filesizeM != 0} {
                        set filesizeM2 [expr {int((($filesize/1048576.) - 
$filesizeM)*100)}]
@@ -1599,8 +1601,11 @@
                        }
                        set filesizeM "$filesizeM,$filesizeM2"
                        return "${filesizeM}M"
-               #Elseif the filesize is bigger than 1Ko
-               } elseif {$filesizeK != 0} {
+               }
+
+               #Elseif the filesize is bigger than 1Ko.Converts in KBytes
+               set filesizeK [expr {int($filesize/1024)}]
+               if {$filesizeK != 0} {
                        return "${filesizeK}K"
                } else {
                        return "$filesize"
@@ -7649,14 +7654,13 @@
                }
     }
 
-    proc GetChatId { user } {
-                       set chatid $user
-                       set win [::ChatWindow::For $chatid]
-                       if {$win != 0 && [winfo exists $win] } {
-                               return $chatid
-                       } else {
-                               return 0
-                       }
+    proc GetChatId { chatid } {
+       set win [::ChatWindow::For $chatid]
+       if {$win != 0 && [winfo exists $win] } {
+               return $chatid
+       } else {
+               return 0
+       }
     }
 
 }
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to