📄 xdeview
字号:
pack ._Encode._Options.right.uue ._Encode._Options.right.xxe \ ._Encode._Options.right.b64 \ -padx 4 -pady 2 -fill x pack ._Encode._Options.righter.pt ._Encode._Options.righter.qp \ -padx 4 -pady 2 -fill x pack ._Encode._Options.righter.ye \ -padx 4 -pady 2 -fill x pack ._Encode._Options.left ._Encode._Options.right \ ._Encode._Options.righter \ -side left -fill both -expand true # # fourth section: what to do with encoded data # frame ._Encode._Actions -relief raised -bd 2 frame ._Encode._Actions.title frame ._Encode._Actions.file frame ._Encode._Actions.mail frame ._Encode._Actions.news label ._Encode._Actions.title.lab -text "Encoding Actions:" pack ._Encode._Actions.title.lab -padx 2 -pady 2 -anchor w checkbutton ._Encode._Actions.file.but -variable EncodeFileYes \ -text "File In (Path):" -width 12 -justify left -anchor w \ -selectcolor black entry ._Encode._Actions.file.ent -relief sunken -width 30 \ -textvariable EncodeFilePath button ._Encode._Actions.file.bb -text "Browse" -command { set NewPath [ tk_SelectFiles "Encoding Path" 0 2 ] if { $NewPath != "" } { if { [ CheckWritable $NewPath ] } { set EncodeFilePath [ CompressSlashes $NewPath ] } } } checkbutton ._Encode._Actions.mail.but -variable EncodeMailYes \ -text "Email To ..." -width 12 -justify left -anchor w \ -selectcolor black entry ._Encode._Actions.mail.ent -relief sunken -width 30 \ -textvariable EncodeMailAddr checkbutton ._Encode._Actions.news.but -variable EncodeNewsYes \ -text "Post To ..." -width 12 -justify left -anchor w \ -selectcolor black entry ._Encode._Actions.news.ent -relief sunken -width 30 \ -textvariable EncodeNewsGroup # # if we need an NNTP server, add a button # if { $have_news && $need_nntp } { frame ._Encode._Actions.nntp checkbutton ._Encode._Actions.nntp.but -variable HaveNNTPServer \ -text "NNTP Server" -width 12 -justify left -anchor w \ -selectcolor black entry ._Encode._Actions.nntp.ent -relief sunken -width 30 \ -textvariable NNTPServer ._Encode._Actions.nntp.but select } pack ._Encode._Actions.file.but -side left -padx 4 -pady 4 pack ._Encode._Actions.file.bb -side right -padx 4 pack ._Encode._Actions.file.ent -side right -padx 4 -pady 4 \ -expand true -fill x pack ._Encode._Actions.mail.but -side left -padx 4 -pady 4 pack ._Encode._Actions.mail.ent -side right -padx 4 -pady 4 \ -expand true -fill x pack ._Encode._Actions.news.but -side left -padx 4 -pady 4 pack ._Encode._Actions.news.ent -side right -padx 4 -pady 4 \ -expand true -fill x pack ._Encode._Actions.title -side top -fill x -expand true pack ._Encode._Actions.file -side top -fill x -expand true pack ._Encode._Actions.mail -side top -fill x -expand true pack ._Encode._Actions.news -side top -fill x -expand true if { $have_news && $need_nntp } { pack ._Encode._Actions.nntp.but -side left -padx 4 -pady 4 pack ._Encode._Actions.nntp.ent -side right -padx 4 -pady 4 \ -expand true -fill x pack ._Encode._Actions.nntp -side top -fill x -expand true } # # fifth section: the buttons # frame ._Encode._Buttons -relief raised -bd 2 frame ._Encode._Buttons.b button ._Encode._Buttons.b._Ok -text "Ok" -width 8 \ -command { set EncodeButton ok } button ._Encode._Buttons.b._OkAll -text "Ok to All" -width 8 \ -command { set EncodeButton okall } button ._Encode._Buttons.b._Next -text "Next" -width 8 \ -command { set EncodeButton next } button ._Encode._Buttons.b._Cancel -text "Cancel" -width 8 \ -command { set EncodeButton cancel } pack ._Encode._Buttons.b._Ok ._Encode._Buttons.b._OkAll \ ._Encode._Buttons.b._Next ._Encode._Buttons.b._Cancel \ -side left -ipadx 4 -ipady 4 -padx 4 -pady 4 -expand true pack ._Encode._Buttons.b -fill both -expand true pack ._Encode._Toplab ._Encode._Names ._Encode._Header \ ._Encode._Options ._Encode._Actions \ -fill x -side top pack ._Encode._Buttons -fill both -side bottom -expand true # # wow, dialog box is finally drawn. now make it do something # if { $have_mail == 0 } { ._Encode._Actions.mail.but deselect ._Encode._Actions.mail.ent delete 0 end ._Encode._Actions.mail.ent insert 0 "(Email not Available)" ._Encode._Actions.mail.but configure -state disabled ._Encode._Actions.mail.ent configure -state disabled } if { $have_news == 0 } { ._Encode._Actions.news.but deselect ._Encode._Actions.news.ent delete 0 end ._Encode._Actions.news.ent insert 0 "(Posting not Available)" ._Encode._Actions.news.but configure -state disabled ._Encode._Actions.news.ent configure -state disabled } bind ._Encode._Actions.file.ent <Return> { if { $EncodeFilePath == {} } { set EncodeFilePath [ pwd ] } set EncodeFilePath [ CompressSlashes $EncodeFilePath ] CheckWritable $EncodeFilePath } bind ._Encode._Options.left.bot.lines <Return> { if { $EncodeMaxLines < 200 && $EncodeMaxLines != 0 } { tk_dialog ._Dialog { Illegal Number of Lines } "You have\ entered an invalid value for the number of lines\ per encoded file. It must either be 0 (no limit)\ or greater than 200." error 0 OK set EncodeMaxLines 0 } } # # iterate through files # . config -cursor watch tkwait visibility ._Encode grab set ._Encode focus ._Encode set index 0 set EncodeButton {} while { $index < $EncodeFileCount } { set EFPath [ lindex $EncodeFileList $index ] set EFName [ file tail $EFPath ] ._Encode config -cursor {} if { ! [ file readable $EFPath ] || [ file isdirectory $EFPath ] } { tk_dialog ._Dialog { Cannot read File } "Cannot read $EFPath" \ error 0 OK incr index continue } ._Encode._Names.top.nam configure -state normal ._Encode._Names.top.nam delete 0 end ._Encode._Names.top.nam insert 0 $EFPath ._Encode._Names.top.nam configure -state disabled ._Encode._Names.bot.nam delete 0 end ._Encode._Names.bot.nam insert 0 $EFName ._Encode._Toplab.lab config -text \ "[ expr $EncodeFileCount - $index ] Files left to Encode" ._Status._Text config -text "Waiting for action on $EFName" if { $EncodeButton != "okall" } { while { 42 } { set EncodeButton {} tkwait variable EncodeButton if { $EncodeButton == "cancel" } { break } # # check parameter # if { $EncodeFilePath == {} } { set EncodeFilePath [ pwd ] } set EncodeFilePath [ CompressSlashes $EncodeFilePath ] if { $EncodeFileYes && ! [ CheckWritable $EncodeFilePath ] } { continue } if { $EncodeMaxLines < 200 && $EncodeMaxLines != 0 } { tk_dialog ._Dialog { Illegal Number of Lines } "You have\ entered an invalid value for the number of lines\ per encoded file. It must either be 0 (no limit)\ or greater than 200." error 0 OK set EncodeMaxLines 0 continue } if { $have_news && $need_nntp && $EncodeNewsYes } { if { $HaveNNTPServer == 0 || $NNTPServer == {} } { tk_dialog ._Dialog { No NNTP Server } "You must\ provide the address of an NNTP server in\ order to post a file. You can also set\ your environment variable\ \$NNTPSERVER or define the address at\ compile time." error 0 OK continue } } break } } # # check which button was pressed # if { $EncodeButton == "cancel" } { break } elseif { $EncodeButton == "next" } { incr index continue } # # at this point, we want to process the file (either ok or okall) # if { $have_news && $need_nntp && $EncodeNewsYes } { set env(NNTPSERVER) $NNTPServer } ._Encode config -cursor watch if { $EncodeFileYes } { ._Status._Text config -text "Encoding $EFName to File ..." update if { [ catch { uu_EncodeToFile $EFPath \ [ file join $EncodeFilePath $EncodeFileName] \ $EncodeFileName $EncodeSubject "" $EncodeMaxLines \ $EncodeEncoding $EncodeFrom $EncodeReplyTo } message ] } { tk_dialog ._Dialog { Error while Encoding } "The following\ error occured while encoding into a file: $message" \ error 0 OK } } if { $EncodeMailYes } { ._Status._Text config -text "Encoding and Emailing $EFName ..." update if { [ catch { uu_EncodeToMail $EFPath $EncodeMailAddr \ $EncodeFileName $EncodeSubject "" $EncodeMaxLines \ $EncodeEncoding $EncodeFrom $EncodeReplyTo } message ] } { tk_dialog ._Dialog { Error while Encoding } "The following\ error occured while sending the file via mail:\ $message" \ error 0 OK } } if { $EncodeNewsYes } { ._Status._Text config -text "Encoding and Emailing $EFName ..." update if { [ catch { uu_EncodeToNews $EFPath $EncodeNewsGroup \ $EncodeFileName $EncodeSubject "" $EncodeMaxLines \ $EncodeEncoding $EncodeFrom $EncodeReplyTo } message ] } { tk_dialog ._Dialog { Error while Encoding } "The following\ error occured while sending the file via news:\ $message" \ error 0 OK } } # # end of processing # incr index } . config -cursor $oldCursor ._Status._Text config -text $oldText focus $oldFocus destroy ._Encode}## Helper function to decode a bunch of files#proc DecodeProc { DecodeList } { global OptionOverwrite global OptionDesperate global SaveFilePath global FileList set count [ llength $DecodeList ] set oldCursor [ lindex [ . config -cursor ] 4 ] set oldText [ lindex [ ._Status._Text config -text ] 4 ] if { $DecodeList == {} } { return; } if { ! [ CheckWritable $SaveFilePath ] } { return; } . config -cursor watch for { set index 0 } { $index < $count } { incr index } { set ItemNo [ lindex $DecodeList $index ] set FileName [ lindex [ lindex $FileList $ItemNo ] 2 ] set FileNumber [ lindex [ lindex $FileList $ItemNo ] 0 ] set FilePath [ file join $SaveFilePath $FileName ] ._Status._Text configure -text "Decoding $FileName ..." if { [ file exists $FilePath ] && ! [ file writable $FilePath ] } { tk_dialog ._Dialog { File Error } "The File $FilePath exists\ and can not be written" error 0 OK continue } elseif { [ file exists $FilePath ] && ! $OptionOverwrite } { set answer [ tk_dialog ._Dialog "File Exists" "$FileName\ already exists in $SaveFilePath." question 0 \ "Overwrite" "Next File" "Cancel" ] if { $answer == "1" } { continue } elseif { $answer == "2" } { break } } # # At this point, the target file either does not exist or # we want to overwrite it # update set result [ catch { uu_DecodeFile $FileNumber $FilePath } errorMsg ] if { $result } { tk_dialog ._Dialog "Error while Decoding" "The following\ problem occured while decoding: $errorMsg" \ error 0 OK continue } } ._Status._Text config -text $oldText . config -cursor $oldCursor}## Button 'Decode'#proc Decode {} { DecodeProc [ ._MainFrame._FileList._Liste curselection ]}## Button 'Decode All'#proc DecodeAll {} { set count [ ._MainFrame._FileList._Liste size ] set DecodeList {} for { set index 0 } { $index < $count } { incr index } { lappend DecodeList $index } DecodeProc $DecodeList}## Action 'Info'## Info about a file. This displays either the zeroeth part of a file or# the first part up to the first encoded line#proc Info {} { set TheInfoFile [ lindex [ ._MainFrame._FileList._Liste curselection ] 0 ] if { $TheInfoFile == {} } { return } InfoFile $TheInfoFile}proc InfoFile { TheInfoFile } { global FileList set oldCursor [ lindex [ . config -cursor ] 4 ] set oldText [ lindex [ ._Status._Text config -text ] 4 ] set FileName [ lindex [ lindex $FileList $TheInfoFile ] 2 ] set FileNumber [ lindex [ lindex $FileList $TheInfoFile ] 0 ] if { $FileName == "" } { return } . config -cursor watch ._Status._Text config -text "Getting File Info for $FileName" if { [ catch { .info configure } ] } { toplevel .info frame .info.top frame .info.bot text .info.top.text -relief raised -bd 2 -wrap none \ -xscrollcommand ".info.top.sbx set" \ -yscrollcommand ".info.top.sby set" scrollbar .info.top.sbx -command ".info.top.text xview" \ -orient horizontal scrollbar .info.top.sby -command ".info.top.text yview" pack .info.top.sbx -side bottom -fill x pack .info.top.sby -side right -fill y pack .info.top.text -fill both -expand 1 button .info.bot.done -text "Done" -command "destroy .info" pack .info.bot.done -side right -padx 4 -pady 4 pack .info.top -side top -fill both -expand 1 pack .info.bot -side bottom } wm title .info "Info about [ file tail $FileName ]" .info.top.text configure -state normal if { [ catch { uu_InfoFile $FileNumber .info.top.text } errorMsg ] } { tk_dialog ._Dialog "No Info" "The following problem occured\ while trying to get Info: $errorMsg" error 0 OK } .info.top.text configure -state disabled ._Status._Text config -text $oldText . config -cursor $oldCursor}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -