I got this bug after updating, when right-clicking a user's PD in the properties window:
invalid command name "::abookGui::dp_mypicpopup_menu" while executing "::abookGui::dp_mypicpopup_menu 102 204 /home/scapor/.amsn/mescapec_hotmail_com/displaypic/cache/.png [EMAIL PROTECTED]" (command bound to event) 2007/1/30, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Revision: 7860 > http://svn.sourceforge.net/amsn/?rev=7860&view=rev > Author: dpcris85 > Date: 2007-01-30 07:44:11 -0800 (Tue, 30 Jan 2007) > > Log Message: > ----------- > More improvements to dpBrowser. > > * autoresize: forget the big white space to the right of display pics > * fixed buggy copy-to-clipboard behavior in user display pictures tab > * added popup menu to "standalone" dpbrowser > * implemented deleting display pictures > * added a "viewonly" mode (no selection, no popup menu) > * separated methods to fill the browser and to draw it > * fixed a programming issue in which all "graphical" options > (like -mode, -width and such) would be ignored if put after > the -user option > > By-the-way fixes: > > * commented some very messy puts > * added a -disableselect option to sexytile (needed to implement the > "viewonly" mode in dpbrowser) > * all the occurrences of: > set index [$containing index @${x},$y] > in utils/pixmapmenu/bindings.tcl have been surrounded with catch {} > > This was needed because hovering with the mouse on custom widgets > that haven't an "index" method, like sexytile, while a menu is > activated, would produce an exception. > This is intended as a *temporary* fix, as there are still some > inconsistencies in the pixmapmenu/sexytile behavior (for example, > you can't click on a sexytile widget to close an opened menu) > > Modified Paths: > -------------- > trunk/amsn/abook.tcl > trunk/amsn/gui.tcl > trunk/amsn/utils/dpbrowser/dpbrowser.tcl > trunk/amsn/utils/pixmapmenu/bindings.tcl > trunk/amsn/utils/sexytile/sexytile.tcl > > Modified: trunk/amsn/abook.tcl > =================================================================== > --- trunk/amsn/abook.tcl 2007-01-30 03:31:50 UTC (rev 7859) > +++ trunk/amsn/abook.tcl 2007-01-30 15:44:11 UTC (rev 7860) > @@ -1088,12 +1088,11 @@ > set actions $nbUserDPs.otherdpscontainer.actions > > if { ![winfo exists $browser]} { > - ::dpbrowser $browser -user $email -width 7 -command > [list\ > + ::dpbrowser $browser -user $email -mode "selector" > -width 6 -command [list\ > ::abookGui::activate_dpbrowser_actions > $nbUserDPs.otherdpscontainer $email] > > pack $browser -side left -expand true -fill both\ > - -before $nbUserDPs.otherdpscontainer.actions\ > - > + -before $nbUserDPs.otherdpscontainer.actions > } > } > proc activate_dpbrowser_actions {widget email} { > @@ -1106,7 +1105,7 @@ > if {$filepath != ""} { > $actions.setasmine configure -state normal -command > [list set_displaypic $filepath ] > $actions.setascustom configure -state normal -command > [list ::abookGui::setCustomDp $email $filepath $widget ] > - $actions.copyfileuri configure -state normal -command > [list clipboard clear ; clipboard append $filepath] > + $actions.copyfileuri configure -state normal -command > [list ::abookGui::copyDpToClipboard $filepath] > } else { > $actions.setasmine configure -state disabled > $actions.setascustom configure -state disabled > @@ -1115,24 +1114,6 @@ > } > > > - #menu when right-clicking the user's dp on the first tab > - proc dp_mypicpopup_menu { X Y filename user} { > - > - #if user is self have another menu ? > - > - # Create pop-up menu if it doesn't yet exists > - set the_menu .userDPs_menu > - catch {destroy $the_menu} > - menu $the_menu -tearoff 0 -type normal > - $the_menu add command \ > - -label "[trans copytoclipboard [string tolower [trans > filename]]]" \ > - -command [list clipboard clear ; clipboard append > $filename] > - $the_menu add command -label "[trans setasmydp]" \ > - -command [list set_displaypic $filename] > - tk_popup $the_menu $X $Y > - } > - > - > proc showUserProperties { email } { > global colorval_$email customdp_$email > showcustomsmileys_$email ignorecontact_$email HOME customdp_img_$email > set w ".user_[::md5::md5 $email]_prop" > @@ -1663,7 +1644,12 @@ > $widget.actions.removecustom configure -state disabled > } > > + proc copyDpToClipboard { file } { > + clipboard clear > + clipboard append $file > + } > > + > # These procedures change the custom DP. They need to be launched > from within the properties screen, > # as the actual change is done through the PropOk procedure > #TODO: delete if not more needed > > Modified: trunk/amsn/gui.tcl > =================================================================== > --- trunk/amsn/gui.tcl 2007-01-30 03:31:50 UTC (rev 7859) > +++ trunk/amsn/gui.tcl 2007-01-30 15:44:11 UTC (rev 7860) > @@ -6471,16 +6471,18 @@ > #combobox to choose user which configures the widget with -user $user > > set combo $w.moredpstitle.combo > - combobox::combobox $combo -highlightthickness 0 -width 22 -font > splainf -exportselection true -command "configuredpbrowser $target_user" > -editable false -bg #FFFFFF > + combobox::combobox $combo -highlightthickness 0 -width 22 -font > splainf -exportselection true -command "configureDpBrowser $target_user" > -editable false -bg #FFFFFF > $combo list delete 0 end > $combo list insert end "[trans selectcontact]:" > > + set i 1 > foreach contact $contactlist { > #put the name of the device in the widget > $combo list insert end $contact > if {$contact == $target_user} { > - set selection [expr {[$combo list index end] - 1}] > + set selection $i > } > + incr i > } > > # If we are choosing a custom DP for a contact, show his cache in the > lower pane > @@ -6495,9 +6497,9 @@ > pack $w.moredpstitle.text -side left > pack $w.moredpstitle.combo -side right > > - ::dpbrowser $w.mydps -width 3 -user self -command [list > updateDpBrowserSelection $w.mydps $target_user] -mode selector > + ::dpbrowser $w.mydps -width 3 -user self -command [list > updateDpBrowserSelection $w.mydps $target_user] -mode "both" > > - ::dpbrowser $w.moredps -width 3 -user $selected_user -command [list > updateDpBrowserSelection $w.moredps $target_user] -mode selector > + ::dpbrowser $w.moredps -width 3 -user $selected_user -command [list > updateDpBrowserSelection $w.moredps $target_user] -mode "both" > > ################# > # second column # > @@ -6546,7 +6548,7 @@ > bind $w.dppreview <Destroy> "catch { image delete > displaypicture_pre_$target_user }" > } > > -proc configuredpbrowser {target combowidget selection} { > +proc configureDpBrowser {target combowidget selection} { > #puts "$combowidget $selection" > if {$selection == "[trans selectcontact]:"} {set selection ""} > if {$selection == $target} { > > Modified: trunk/amsn/utils/dpbrowser/dpbrowser.tcl > =================================================================== > --- trunk/amsn/utils/dpbrowser/dpbrowser.tcl 2007-01-30 03:31:50 UTC (rev > 7859) > +++ trunk/amsn/utils/dpbrowser/dpbrowser.tcl 2007-01-30 15:44:11 UTC (rev > 7860) > @@ -3,34 +3,46 @@ > package provide dpbrowser 0.4 > > > - > - > snit::widget dpbrowser { > > + option -user -default "self" -configuremethod setConfig > + option -width -default 5 > > - option -user -default "self" -configuremethod setConfig > - option -width -default 5 -readonly 1 > - > option -bg -default white -readonly 1 > option -bg_hl -default DarkBlue -readonly 1 > - option -mode -default "properties" -readonly 1 > - #modes "properties" where you right-click with actions and mode > "selector" where left click sets as your image preview for new pic browser" > + option -mode -default "viewonly" -readonly 1 > + # Available modes: > + # "viewonly" - no interaction with images > + # "properties" - popup menu on right click > + # "selector" - select the image to update an eventual preview > + # "both" - both behaviors > + # Any other mode will behave as "viewonly". > > - # When using select mode, it's important to pass the name of a > procedure through this option. > + # When using selector mode, it's important to pass the name of a > procedure through this option. > # Otherwise, the parent window will not react to the change of > selection. > option -command > + > option -showcurrent -default 1 > option -padding -default 5 -readonly 1 > option -createtempimg -default 0 > - > + option -autoresize -default 1 -configuremethod setConfig > + > variable selected "" > - variable tempimg > + variable tempimg "" > + variable pic_in_use "" > + variable dps "" > + variable enable_draw 0 > > constructor { args } { > #frame hull is created automatically > > #apply all options > + set enable_draw 0 > $self configurelist $args > + # We are delaying drawing the content to make sure that > + # all options have been correctly stored > + set enable_draw 1 > + $self drawPics > > # $self fillWidgetForUser $options(-user) > bind $self <Destroy> [list $self cleanUp] > @@ -43,24 +55,13 @@ > } > } > > - method fillWidgetForUser { email } { > + method fillWidget { email } { > global HOME > > set selected "" > -puts "filling for user $email" > - #create the scroll-frame > - ScrolledWindow $self.sw -bg $options(-bg) > - ScrollableFrame $self.sw.sf -bg $options(-bg) > - $self.sw setwidget $self.sw.sf > - pack $self.sw -expand true -fill both > - set frame [$self.sw.sf getframe] > +#puts "filling for user $email" > > - set dps_per_row $options(-width) > - > - if {$email == ""} { > - label $frame.nodps -text "\t[trans nouserspecified]" > -bg $options(-bg) > - pack $frame.nodps > - } else { > + if {$email != ""} { > #if no user is specified > if {$email == "all"} { > set email "" > @@ -93,7 +94,7 @@ > } else { > set user_dps [lsort -index 1 -decreasing > [$self getDpsList [glob -nocomplain -directory [file join $HOME displaypic > cache] *.dat] $email]] > } > - set dps [linsert [concat $shipped_dps $user_dps] 0 > [list "" "nopic" "[trans nopic]"]] > + set dps [concat $shipped_dps $user_dps] > > if { $email != "self" } { > if { [::abook::getContactData $email customdp > ""] != "" } { > @@ -108,10 +109,49 @@ > } > } else { > set pic_in_use [displaypicture_std_self cget > -file] > + set dps [linsert $dps 0 [list "" "nopic" > "[trans nopic]"]] > } > + } > + if {$enable_draw} { > + $self drawPics > + } > + } > > - set i 0 > - > + method drawPics { } { > + global HOME > + > + #create the scroll-frame > + catch { destroy $self.sw } > + ScrolledWindow $self.sw -bg $options(-bg) > + ScrollableFrame $self.sw.sf -bg $options(-bg) > + $self.sw setwidget $self.sw.sf > + pack $self.sw -expand true -fill both > + set frame [$self.sw.sf getframe] > + > + if {$options(-autoresize)} { > + $self autoWidth > + bind $self <Configure> [list $self handleResize] > + } > + > + set email $options(-user) > + set dps_per_row $options(-width) > + > + if { $dps_per_row < 1} { > + return > + } > + > + set i 0 > + > + if { $options(-mode) != "both" && $options(-mode) != > "selector" } { > + set isSelectDisabled 1 > + } else { > + set isSelectDisabled 0 > + } > + > + if {$email == ""} { > + label $frame.nodps -text "\t[trans nouserspecified]" > -bg $options(-bg) > + pack $frame.nodps > + } else { > foreach dp $dps { > #exclude the image the user is currently using > if { $options(-showcurrent) != 0 || [string > first $pic_in_use [lindex $dp 0]] == -1 } { > @@ -123,7 +163,7 @@ > set file "" > image create photo > userDP_${email}_$i -file [displaypicture_std_none cget -file] -format cximage > } > - > + > ::picture::ResizeWithRatio > userDP_${email}_$i 96 96 > > set entry $frame.${i}_tile > @@ -134,17 +174,22 @@ > set label [lindex $dp 2] > } > > - sexytile $entry -type filewidget > -text $label\ > - -icon userDP_${email}_$i > -bgcolor $options(-bg) -onpress [list $self onClick $entry $file] > - > - > - bind $entry <Destroy> "catch { image > delete userDP_${email}_$i}" > + sexytile $entry -type filewidget > -text $label -icon userDP_${email}_$i\ > + -bgcolor $options(-bg) > -onpress [list $self onClick $entry $file]\ > + -disableselect > $isSelectDisabled -padding 4 > > + if {[regexp ^$HOME $file]} { > + bind $entry <ButtonRelease-3> > \ > + [list $self popupMenu > %X %Y $file $entry 1] > + } else { > + bind $entry <ButtonRelease-3> > \ > + [list $self popupMenu > %X %Y $file $entry 0] > + } > > + bind $entry <Destroy> "catch { image > delete userDP_${email}_$i}" > grid $entry \ > -row [expr {$i / > $dps_per_row}] -column [expr {$i % $dps_per_row}] \ > - -pady > $options(-padding) -padx $options(-padding) > - > + -pady $options(-padding) > -padx $options(-padding) > incr i > } > } > @@ -152,21 +197,34 @@ > label $frame.nodps -text "\t[trans > nocacheddps]" -bg $options(-bg) > pack $frame.nodps > } > - } > - > - > - > + } > } > > - method onClick { entry filepath} { > - switch $options(-mode) { > - "selector" { > - #special actions for in selector mode > + method autoWidth { } { > + if {$options(-autoresize)} { > + set pixelwidth [winfo width $self.sw.sf] > + set padding $options(-padding) > + set new_width [ expr { > int(floor($pixelwidth/(100+2*$padding))) } ] > + if { $new_width != $options(-width)} { > + if {$new_width > 0} { > + set options(-width) $new_width > + } > } > - default { > - #this is for the "properties" mode > - } > } > + } > + > + method handleResize { } { > + set old_width $options(-width) > + $self autoWidth > + if {$old_width != $options(-width)} { > + $self drawPics > + } > + } > + > + method onClick { entry filepath} { > + if { $options(-mode) != "both" && $options(-mode) != > "selector" } { > + return > + } > # Backups old selected (deSelect erases it) > set oldentry [lindex $selected 0] > $self deSelect > @@ -185,7 +243,7 @@ > } > eval $options(-command) > } > - > + > method deSelect {} { > if {$selected != ""} { > [lindex $selected 0] deSelect > @@ -193,7 +251,6 @@ > set selected "" > } > > - > method getSelected {} { > return $selected > } > @@ -212,9 +269,7 @@ > if {[lindex $greps 0]} { > set date [lindex $greps 1] > set readable_date "" > - status_log "$date" > - catch {set readable_date [clock format $date > -format %x]} error_var > - status_log "$error_var" > + catch {set readable_date [clock format $date > -format %x]} > lappend dps_list [list $file $date > $readable_date] > } > } > @@ -242,17 +297,16 @@ > } > } > } > - > + > method showtooltip {X Y imgfile} { > #to show the full size image > - > + > } > > - method dp_popup_menu { X Y filename widget user} { > -# global selected_image > - > - #if user is self have another menu ? > - > + method popupMenu { X Y filename widget enable_delete} { > + if { $options(-mode) != "both" && $options(-mode) != > "properties" } { > + return > + } > # Create pop-up menu if it doesn't yet exists > set the_menu .userDPs_menu > catch {destroy $the_menu} > @@ -260,53 +314,57 @@ > $the_menu add command \ > -label "[trans copytoclipboard [string tolower [trans > filename]]]" \ > -command [list clipboard clear ; clipboard append > $filename] > - $the_menu add command -label "[trans delete]" \ > - -command [list $self deleteentry $filename $widget] > -# $the_menu add command -label "Set as custom display picture > for this user" \ > - -command [list ::amsn::messageBox "Sorry, not yet > implemented" ok error [trans failed]] > + if { $enable_delete } { > + $the_menu add command -label "[trans delete]" \ > + -command [list $self deleteEntry $filename > $widget] > + } > $the_menu add command -label "[trans setasmydp]" \ > -command [list set_displaypic $filename] > tk_popup $the_menu $X $Y > } > > - > - method deleteentry {filename widget} { > -# global selected > -#TODO: > -puts "Deleting dps isn't implemented yet" > -# if {$selected_path == $filename} { > -# set selected_path "" > -# } > -# pictureDeleteFile $filename $widget > -# $self fill > + method deleteEntry {filename widget} { > + if {[lindex $selected 0] != $widget} { > + $self deSelect > + eval $options(-command) > } > - > + catch { file delete $filename } > + catch { file delete [filenoext $filename].dat } > + # remove the entry from the list > + set i 0 > + foreach dp $dps { > + if {[lindex $dp 0] == $filename} { > + set dps [lreplace $dps $i $i] > + continue > + } > + incr i > + } > + # refill the widget > + $self drawPics > + } > + > method setConfig {option value} { > set options($option) $value > - puts "Altering $option to $value" > +# puts "Altering $option to $value" > > #actions after change or initial setting of options > #the space was added so the option isn't passed to the switch > command > switch " $option" { > " -bgcolor" { > $hull configure -bg $value > - } > + } > " -width" { > $hull configure -width $value > -} > + } > " -height" { > $hull configure -height $value > } > - > " -user" { > #empty the widget and refill it for other user > - destroy $self.sw > - $self fillWidgetForUser $value > - puts "changed to user $value" > + $self fillWidget $value > +# puts "changed to user $value" > } > } > - > } > - > - > + > } > > Modified: trunk/amsn/utils/pixmapmenu/bindings.tcl > =================================================================== > --- trunk/amsn/utils/pixmapmenu/bindings.tcl 2007-01-30 03:31:50 UTC (rev > 7859) > +++ trunk/amsn/utils/pixmapmenu/bindings.tcl 2007-01-30 15:44:11 UTC (rev > 7860) > @@ -97,7 +97,7 @@ > set type [$containing cget -type] > set x [RootXToX $containing %X] > set y [RootYToY $containing %Y] > - set index [$containing index @${x},$y] > + catch {set index [$containing index @${x},$y]} > switch $type { > "menubar" { > if { $::tk::Priv(popup) == "" && $index != "none" } { > @@ -126,7 +126,7 @@ > set type [$containing cget -type] > set x [RootXToX $containing %X] > set y [RootYToY $containing %Y] > - set index [$containing index @${x},$y] > + catch {set index [$containing index @${x},$y]} > switch $type { > "menubar" { > if { $::tk::Priv(popup) == "" && $index != "none" } { > @@ -170,7 +170,7 @@ > set type [$containing cget -type] > set x [RootXToX $containing %X] > set y [RootYToY $containing %Y] > - set index [$containing index @${x},$y] > + catch {set index [$containing index @${x},$y]} > switch $type { > "menubar" { > if { $::tk::Priv(popup) == "" && $index != "none" } { > @@ -219,7 +219,7 @@ > set type [$containing cget -type] > set x [RootXToX $containing %X] > set y [RootYToY $containing %Y] > - set index [$containing index @${x},$y] > + catch {set index [$containing index @${x},$y]} > > set parent [winfo parent [winfo parent %W]] > set ptype {} > @@ -274,7 +274,7 @@ > } > set x [RootXToX $containing %X] > set y [RootYToY $containing %Y] > - set index [$containing index @${x},$y] > + catch {set index [$containing index @${x},$y]} > set type [$containing cget -type] > switch $type { > menubar { > @@ -672,4 +672,4 @@ > } else { > focus . > } > -} > \ No newline at end of file > +} > > Modified: trunk/amsn/utils/sexytile/sexytile.tcl > =================================================================== > --- trunk/amsn/utils/sexytile/sexytile.tcl 2007-01-30 03:31:50 UTC (rev > 7859) > +++ trunk/amsn/utils/sexytile/sexytile.tcl 2007-01-30 15:44:11 UTC (rev > 7860) > @@ -38,6 +38,7 @@ > #boolean value for checkbutton > option -value -default 0 -configuremethod setConfig > > + option -disableselect -default 0 -readonly 1 > > constructor { args } { > > @@ -46,7 +47,7 @@ > > #set the chosen settings > $self configurelist $args > - puts "created sexytile widget $self with arguments $args at > $hull" > +# puts "created sexytile widget $self with arguments $args at > $hull" > > #add the bg image > image create photo bgimage_default > @@ -164,6 +165,9 @@ > } > > method setSelect {} { > + if {$options(-disableselect)} { > + return > + } > set selcolor red > #this is for filewidget type only for now > if {$options(-type) == "filewidget"} { > @@ -178,6 +182,9 @@ > } > > method deSelect {} { > + if {$options(-disableselect)} { > + return > + } > #this is for filewidget type only for now > if {$options(-type) == "filewidget"} { > #remove the selection of the text > > > This was sent by the SourceForge.net collaborative development platform, the > world's largest Open Source development site. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Amsn-commits mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/amsn-commits > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel