📄 xdeview
字号:
pack .mime.top.lt.ent -side right -padx 4 -pady 4 -expand true -fill x pack .mime.top.gc.lab -side left -padx 4 -pady 4 pack .mime.top.gc.but -side right -padx 4 pack .mime.top.gc.ent -side right -padx 4 -pady 4 -expand true -fill x pack .mime.top.lc.lab -side left -padx 4 -pady 4 pack .mime.top.lc.but -side right -padx 4 pack .mime.top.lc.ent -side right -padx 4 -pady 4 -expand true -fill x pack .mime.top.gt .mime.top.lt .mime.top.gc .mime.top.lc \ -side top -expand true -fill both frame .mime.but -relief raised -bd 2 frame .mime.but.b button .mime.but.b.ok -text "Ok" -width 8 -command { if { $MIMEGlobalTypes != "" && \ ! [ file readable $MIMEGlobalTypes ] } { tk_dialog ._Dialog "File Does not Exist" "Global Types File\ $MIMEGlobalTypes does not exist or is not readable." \ error 0 OK } elseif { $MIMELocalTypes != "" && \ ! [ file readable $MIMELocalTypes ] } { tk_dialog ._Dialog "File Does not Exist" "Local Types File\ $MIMELocalTypes does not exist or is not readable." \ error 0 OK } elseif { $MIMEGlobalCap != "" && \ ! [ file readable $MIMEGlobalCap ] } { tk_dialog ._Dialog "File Does not Exist" "Global Mailcap File\ $MIMEGlobalCap does not exist or is not readable." \ error 0 OK } elseif { $MIMELocalCap != "" && \ ! [ file readable $MIMELocalCap ] } { tk_dialog ._Dialog "File Does not Exist" "Local Mailcap File\ $MIMELocalCap does not exist or is not readable." \ error 0 OK } else { set MSFinish ok } } button .mime.but.b.cancel -text "Cancel" -width 8 \ -command { set MSFinish cancel } pack .mime.but.b.ok .mime.but.b.cancel -side left -ipadx 4 -ipady 4 \ -padx 4 -pady 4 -expand true pack .mime.but.b -fill both -expand true -fill both pack .mime.top -side top -fill x pack .mime.but -side bottom -fill both -expand true bind .mime.top.gt.ent <Return> { if { $MIMEGlobalTypes != "" } { if { ! [ file readable $MIMEGlobalTypes ] } { tk_dialog ._Dialog "File Does not Exist" "Global Types File\ $MIMEGlobalTypes does not exist or is not readable." \ error 0 OK } } } bind .mime.top.lt.ent <Return> { if { $MIMELocalTypes != "" } { if { ! [ file readable $MIMELocalTypes ] } { tk_dialog ._Dialog "File Does not Exist" "Local Types File\ $MIMELocalTypes does not exist or is not readable." \ error 0 OK } } } bind .mime.top.gc.ent <Return> { if { $MIMEGlobalCap != "" } { if { ! [ file readable $MIMEGlobalCap ] } { tk_dialog ._Dialog "File Does not Exist" "Global Mailcap File\ $MIMEGlobalCap does not exist or is not readable." \ error 0 OK } } } bind .mime.top.lc.ent <Return> { if { $MIMELocalCap != "" } { if { ! [ file readable $MIMELocalCap ] } { tk_dialog ._Dialog "File Does not Exist" "Local Mailcap File\ $MIMELocalCap does not exist or is not readable." \ error 0 OK } } } . config -cursor watch tkwait visibility .mime ._Status._Text config -text "Waiting for Configuration" grab set .mime focus .mime set MSFinish {} tkwait variable MSFinish if { $MSFinish != "ok" } { set MIMEGlobalTypes $tempGlobalTypes set MIMELocalCap $tempLocalCap set MIMEGlobalCap $tempGlobalCap set MIMELocalTypes $tempLocalTypes } . config -cursor $oldCursor ._Status._Text config -text $oldText focus $oldFocus destroy .mime}## Menu Command File->Save Setup#proc SaveSetup {} { global OptionFast OptionBracket OptionOverwrite global OptionDesperate OptionVerbose OptionAutoInfo global SaveFilePath EncodeMaxLines EncodeEncoding global EncodeFilePath NNTPServer MIMELocalTypes global MIMEGlobalTypes MIMELocalCap MIMEGlobalCap global OptionDumbness OptionUsetext OptionRemove global OptionMoreMime EncodeFrom EncodeReplyTo global env set oldCursor [ lindex [ . config -cursor ] 4 ] set oldText [ lindex [ ._Status._Text config -text ] 4 ] . config -cursor watch ._Status._Text config -text "Saving Setup" if { [ catch { set env(HOME) } ] || $env(HOME) == "" } { tk_dialog ._Dialog "OOps" "Could not find your home directory." \ error 0 OK . config -cursor $oldCursor ._Status._Text config -text $oldText return } # # need temp file # if { ! [ catch { set $env(TEMP) } ] } { set tempname "$env(TEMP)/xdeview[pid]" } else { set tempname "/tmp/xdeview.[pid]" } if { [ file exists $tempname ] } { foreach ext { 001 002 003 004 005 006 007 008 009 010 042 } { if { ! [ catch { set $env(TEMP) } ] } { set tempname "$env(TEMP)/xdeview.$ext" } else { set tempname "/tmp/xdeview.$ext" } if { [ file exists $tempname ] } { break } } if { [ file exits $tempname] } { tk_dialog ._Dialog "OOps" "Could not save your setup. Couldn't\ find suitable temporary file" error 0 OK . config -cursor $oldCursor ._Status._Text config -text $oldText return } } if { [ catch { open $tempname w } writeID ] } { tk_dialog ._Dialog "OOps" "Cannot write to temp file $tempname.\ Setup not saved." error 0 OK . config -cursor $oldCursor ._Status._Text config -text $oldText return } set rcfile $env(HOME)/.xdeviewrc if { ! [ catch { open $rcfile r } readID ] } { # # copy existing resouce file # while { ! [ eof $readID ] } { if { [ gets $readID TheLine ] < 0 } { break } puts $writeID $TheLine if { [ string first "--xdeview--" $TheLine ] != -1 } { break } } if { [ eof $readID ] } { puts $writeID "#" puts $writeID "# --xdeview-- auto-generated do not add code below" } close $readID } else { puts $writeID "#" puts $writeID "# --xdeview-- auto-generated do not add code below" } # # save configuration information # puts $writeID "#" puts $writeID "# options for decoding" puts $writeID "#" puts $writeID "ifndef OptionFast $OptionFast" puts $writeID "ifndef OptionBracket $OptionBracket" puts $writeID "ifndef OptionOverwrite $OptionOverwrite" puts $writeID "ifndef OptionDesperate $OptionDesperate" puts $writeID "ifndef OptionVerbose $OptionVerbose" puts $writeID "ifndef OptionDumbness $OptionDumbness" puts $writeID "ifndef OptionAutoInfo $OptionAutoInfo" puts $writeID "ifndef OptionUsetext $OptionUsetext" puts $writeID "ifndef SaveFilePath \"$SaveFilePath\"" puts $writeID "ifndef OptionRemove $OptionRemove" puts $writeID "ifndef OptionMoreMime $OptionMoreMime" puts $writeID "#" puts $writeID "# encoding options" puts $writeID "#" puts $writeID "ifndef EncodeMaxLines $EncodeMaxLines" puts $writeID "ifndef EncodeEncoding $EncodeEncoding" puts $writeID "ifndef EncodeFilePath \"$EncodeFilePath\"" puts $writeID "ifndef EncodeFrom \"$EncodeFrom\"" puts $writeID "ifndef EncodeReplyTo \"$EncodeReplyTo\"" puts $writeID "ifndef NNTPServer \"$NNTPServer\"" puts $writeID "#" puts $writeID "# MIME capabilities" puts $writeID "#" puts $writeID "ifndef MIMELocalTypes \"$MIMELocalTypes\"" puts $writeID "ifndef MIMEGlobalTypes \"$MIMEGlobalTypes\"" puts $writeID "ifndef MIMELocalCap \"$MIMELocalCap\"" puts $writeID "ifndef MIMEGlobalCap \"$MIMEGlobalCap\"" puts $writeID "#" puts $writeID "" close $writeID # # copy temp file back to real ./xdeviewrc # if { [ catch { open $tempname r } readID ] } { tk_dialog ._Dialog "This is weird" "Could not re-open the temp\ file $tempname. Setup not saved." error 0 OK . config -cursor $oldCursor ._Status._Text config -text $oldText exec -- rm -f $tempname return } if { [ catch { open $rcfile w } writeID ] } { tk_dialog ._Dialog "OOps" "Cannot write to setup file $rcfile.\ Setup not saved." error 0 OK . config -cursor $oldCursor ._Status._Text config -text $oldText close $readID exec -- rm -f $tempname return } while { ! [ eof $readID ] } { if { [ gets $readID TheLine ] < 0 } { break } puts $writeID $TheLine } close $writeID close $readID exec -- rm -f $tempname . config -cursor $oldCursor ._Status._Text config -text $oldText tk_dialog ._Dialog "OK" "Setup successfully saved to $rcfile." \ "" 0 OK} ## Menu Command File->Encode#proc Encode {} { global EncodeFileName global EncodeMaxLines global EncodeEncoding global EncodeSubject global EncodeFrom global EncodeReplyTo global EncodeFileYes global EncodeFilePath global EncodeMailYes global EncodeMailAddr global EncodeNewsYes global EncodeNewsGroup global SaveFilePath global EncodeButton global HaveNNTPServer global NNTPServer global env ifndef EncodeMaxLines 0 ifndef EncodeEncoding 0 ifndef EncodeSubject "" ifndef EncodeFrom "" ifndef EncodeReplyTo "" ifndef EncodeFileYes 1 ifndef EncodeFilePath $SaveFilePath ifndef EncodeMailYes 0 ifndef EncodeMailAddr "" ifndef EncodeNewsYes 0 ifndef EncodeNewsGroup "" ifndef NNTPServer "" set oldCursor [ lindex [ . config -cursor ] 4 ] set oldText [ lindex [ ._Status._Text config -text ] 4 ] set oldFocus [ focus ] set have_mail [ lindex [ lindex [ uu_Info have_mail ] 0 ] 1 ] set have_news [ lindex [ lindex [ uu_Info have_news ] 0 ] 1 ] set need_nntp [ lindex [ lindex [ uu_Info need_nntpserver ] 0 ] 1 ] if { $have_news && $need_nntp && $NNTPServer == "" } { if { [ catch { set NNTPServer $env(NNTPSERVER) } ] } { set NNTPServer "" } } ._Status._Text config -text "Waiting for you to Select Files for Encoding" set EncodeFileList [ tk_SelectFiles "Select Files for Encoding" 1 0 ] if { $EncodeFileList == {} } { ._Status._Text config -text $oldText return } set EncodeFileCount [ llength $EncodeFileList ] # # what to do with these files? # toplevel ._Encode wm title ._Encode "Encode Files" # # first section: How many files left? # frame ._Encode._Toplab -relief raised -bd 2 label ._Encode._Toplab.lab -text "0 Files left to Encode" pack ._Encode._Toplab.lab -padx 2 -pady 2 -anchor w # # second section: file names of source and sent file # frame ._Encode._Names -relief raised -bd 2 frame ._Encode._Names.top frame ._Encode._Names.bot label ._Encode._Names.top.lab -text "Filename:" -width 12 \ -justify left -anchor w entry ._Encode._Names.top.nam -relief sunken -width 30 label ._Encode._Names.bot.lab -text "Send as:" -width 12 \ -justify left -anchor w entry ._Encode._Names.bot.nam -relief sunken -width 30 \ -textvariable EncodeFileName pack ._Encode._Names.top.lab -side left -padx 2 -pady 2 pack ._Encode._Names.top.nam -side right -padx 2 -pady 2 \ -fill x -expand true pack ._Encode._Names.bot.lab -side left -padx 2 -pady 2 pack ._Encode._Names.bot.nam -side right -padx 2 -pady 2 \ -fill x -expand true pack ._Encode._Names.top ._Encode._Names.bot \ -padx 4 -pady 4 -side top -fill x -expand true frame ._Encode._Header -relief raised -bd 2 frame ._Encode._Header.from frame ._Encode._Header.replyto frame ._Encode._Header.subject label ._Encode._Header.from.msg -text "From:" -width 12 \ -justify left -anchor w entry ._Encode._Header.from.ent -relief sunken -width 30 \ -textvariable EncodeFrom label ._Encode._Header.replyto.msg -text "Reply To:" -width 12 \ -justify left -anchor w entry ._Encode._Header.replyto.ent -relief sunken -width 30 \ -textvariable EncodeReplyTo label ._Encode._Header.subject.msg -text "Subject:" -width 12 \ -justify left -anchor w entry ._Encode._Header.subject.ent -relief sunken -width 30 \ -textvariable EncodeSubject pack ._Encode._Header.from.msg -side left -padx 2 -pady 2 pack ._Encode._Header.from.ent -side right -padx 2 -pady 2 \ -expand true -fill x pack ._Encode._Header.replyto.msg -side left -padx 2 -pady 2 pack ._Encode._Header.replyto.ent -side right -padx 2 -pady 2 \ -expand true -fill x pack ._Encode._Header.subject.msg -side left -padx 2 -pady 2 pack ._Encode._Header.subject.ent -side right -padx 2 -pady 2 \ -expand true -fill x pack ._Encode._Header.from ._Encode._Header.replyto \ ._Encode._Header.subject \ -padx 4 -pady 4 -side top -fill x -expand true # # third section: encoding options # frame ._Encode._Options -relief raised -bd 2 frame ._Encode._Options.left frame ._Encode._Options.right frame ._Encode._Options.righter frame ._Encode._Options.left.top frame ._Encode._Options.left.empty frame ._Encode._Options.left.bot label ._Encode._Options.left.top.msg -text "Encoding Options:" entry ._Encode._Options.left.bot.lines -relief sunken -width 5 \ -textvariable EncodeMaxLines label ._Encode._Options.left.bot.msg -text "Lines per File" \ -justify left radiobutton ._Encode._Options.right.uue -text "UU Encoding" \ -variable EncodeEncoding -value 0 -relief flat -anchor w \ -selectcolor black radiobutton ._Encode._Options.right.xxe -text "XX Encoding" \ -variable EncodeEncoding -value 1 -relief flat -anchor w \ -selectcolor black radiobutton ._Encode._Options.right.b64 -text "Base64 Encoding" \ -variable EncodeEncoding -value 2 -relief flat -anchor w \ -selectcolor black radiobutton ._Encode._Options.righter.pt -text "Plain Text" \ -variable EncodeEncoding -value 3 -relief flat -anchor w \ -selectcolor black radiobutton ._Encode._Options.righter.qp -text "Quoted Printable" \ -variable EncodeEncoding -value 4 -relief flat -anchor w \ -selectcolor black radiobutton ._Encode._Options.righter.ye -text "yEnc Encoding" \ -variable EncodeEncoding -value 5 -relief flat -anchor w \ -selectcolor black pack ._Encode._Options.left.bot.lines ._Encode._Options.left.bot.msg \ -padx 4 -pady 4 -side left pack ._Encode._Options.left.top.msg -padx 2 -pady 2 -anchor nw pack ._Encode._Options.left.top -fill x -side top pack ._Encode._Options.left.bot -anchor sw -side bottom -padx 4 -pady 4 pack ._Encode._Options.left.empty -fill both -expand true
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -