#!/bin/sh
# the next line restarts using wish \
exec wish "$0" ${1+"$@"}
#############################################################################
# Visual Tcl v1.20 Project
#
if {$tk_version >= 8.4} {
tk::unsupported::ExposePrivateCommand tkListboxBeginSelect
tk::unsupported::ExposePrivateCommand tkTabToWindow
}
#################################
# GLOBAL VARIABLES
#
global p4;
global p4tooltips;
global widget;
# Cygwin usrers should use the ".exe" version of the reference
# set p4(exec) "/usr/local/bin/p4.exe";
set p4(exec) "p4";
set widget(AutoResolve) {.top63}
set widget(AutoResolve_ok) {.top63.fra64.fra67.but86}
set widget(AutoResolve_optionFrame) {.top63.fra64.fra66}
set widget(AutoResolve_preview) {.top63.fra64.fra67.but87}
set widget(Change) {.top18}
set widget(ChangeFileType) {.top31}
set widget(Change_Change_entry) {.top18.fra19.fra22.cpd24.02}
set widget(Change_Client_entry) {.top18.fra19.fra22.fra26.02}
set widget(Change_Date_entry) {.top18.fra19.fra22.fra25.02}
set widget(Change_Description_frame) {.top18.cpd38.01.fra39}
set widget(Change_Description_frame2) {.top18.fra42}
set widget(Change_Description_text) {.top18.cpd38.01.fra39.02.05}
set widget(Change_Description_text2) {.top18.fra42.02.05}
set widget(Change_Files_frame) {.top18.cpd38.02.fra41}
set widget(Change_Files_label) {.top18.cpd38.02.fra41.01}
set widget(Change_Files_text) {.top18.cpd38.02.fra41.02.05}
set widget(Change_Split_frame) {.top18.cpd38}
set widget(Change_Status_entry) {.top18.fra19.fra22.fra28.02}
set widget(Change_Submit) {.top18.fra19.fra23.but29}
set widget(Change_Update) {.top18.fra19.fra23.but30}
set widget(Change_User_entry) {.top18.fra19.fra22.fra27.02}
set widget(ConnectionEdit) {.top120}
set widget(ConnectionEditSave) {.top120.fra126.but127}
set widget(Describe) {.top17}
set widget(DescribeButtonFrame) {.top17.fra21.fra22}
set widget(DescribeButtonFrame2) {.top17.fra21.fra23}
set widget(DescribeCancel) {.top17.fra21.fra22.04}
set widget(DescribeClose) {.top17.fra21.fra22.01}
set widget(DescribeEdit) {.top17.fra21.fra22.02}
set widget(DescribeHelp) {.top24}
set widget(DescribeHelpButton) {.top17.fra21.fra22.06}
set widget(DescribeHelpText) {.top24.fra25.01.04}
set widget(DescribeNext) {.top17.fra21.fra23.but25}
set widget(DescribePrev) {.top17.fra21.fra23.but24}
set widget(DescribeReset) {.top17.fra21.fra22.05}
set widget(DescribeShowDiffs) {.top17.fra21.fra23.but17}
set widget(DescribeText) {.top17.fra18.cpd20.03}
set widget(DescribeUpdate) {.top17.fra21.fra22.03}
set widget(EntryDialog) {.top37}
set widget(EntryDialogEntry) {.top37.fra38.fra39.cpd43.02}
set widget(EntryDialogLabel) {.top37.fra38.fra39.cpd43.01}
set widget(FileInfo) {.top51}
set widget(FileInfo_ClientPath) {.top51.fra52.fra54.02}
set widget(FileInfo_DepotPath) {.top51.fra52.cpd53.02}
set widget(FileInfo_Describe) {.top51.fra52.fra59.fra38.but40}
set widget(FileInfo_FileType) {.top51.fra52.fra55.02}
set widget(FileInfo_HaveRevision) {.top51.fra52.fra56.fra64.02}
set widget(FileInfo_HeadAction) {.top51.fra52.fra65.01.03}
set widget(FileInfo_HeadChange) {.top51.fra52.fra65.04.06}
set widget(FileInfo_HeadRevision) {.top51.fra52.fra56.fra63.02}
set widget(FileInfo_LastModTime) {.top51.fra52.fra58.02}
set widget(FileInfo_LockedBy) {.top51.fra52.fra60.02}
set widget(FileInfo_OpenedBy) {.top51.fra52.fra59.cpd67.01}
set widget(HostsFrame) {.top104.fra105.08.fra114}
set widget(Menu_Edit) {.top40.fra47.cpd48.03}
set widget(Menu_File) {.top40.fra47.cpd48.01}
set widget(Menu_Help) {.top40.fra47.cpd48.05}
set widget(Menu_View) {.top40.fra47.cpd48.men18.01}
set widget(Rename_EdittedFiles) {.top36}
set widget(Rename_EdittedFilesListbox) {.top36.fra37.010.011}
set widget(Rename_EdittedFiles_label) {.top36.fra37.lab42}
set widget(Rename_EdittedFiles_message) {.top36.fra37.01.02.mes38}
set widget(Rename_GetNewName) {.top21}
set widget(Rename_GetNewName_ButtonFrame) {.top21.fra22.fra27}
set widget(Rename_GetNewName_Heading) {.top21.fra22.fra23.lab28}
set widget(Rename_GetNewName_OptionFrame) {.top21.fra22.fra39}
set widget(Rename_Rename) {.top33}
set widget(Rename_RenameLabel) {.top33.fra34.fra35.01.02}
set widget(Rename_RenameListbox) {.top33.fra34.01.02}
set widget(Rename_RenameRemoveButton) {.top33.fra34.05.06}
set widget(RevertUnchanged) {.top43}
set widget(RevertUnchanged_Frame) {.top43.fra44}
set widget(RevertUnchanged_Listbox) {.top43.fra44.cpd45.01}
set widget(RevertUnchanged_ListboxFrame) {.top43.fra44.cpd45}
set widget(RevertUnchanged_RemoveButton) {.top43.fra44.fra46.but47}
set widget(RevertUnchanged_RevertButton) {.top43.fra44.fra46.but49}
set widget(RevisionHistory) {.top81}
set widget(RevisionHistoryButtonBrowse) {.top81.fra91.01}
set widget(RevisionHistoryButtonDiffClient) {.top81.fra91.04}
set widget(RevisionHistoryButtonDiffRevs) {.top81.fra91.03}
set widget(RevisionHistoryButtonSync) {.top81.fra91.02}
set widget(RevisionHistoryLabel) {.top81.fra82.cpd84.02.fra87.01}
set widget(RevisionHistoryMcFrame) {.top81.fra82.cpd84.01.fra86}
set widget(RevisionHistoryText) {.top81.fra82.cpd84.02.fra88.01.04}
set widget(SyncLabel) {.top50}
set widget(SyncLabel_entry) {.top50.fra51.ent56}
set widget(SyncLabel_number) {.top50.fra51.fra62.03.05}
set widget(SyncLabel_other) {.top50.fra51.fra62.06.08}
set widget(TemplateName) {.top132}
set widget(ToolbarFrame) {.top40.fra17}
set widget(changeSync) {.top22}
set widget(connectionButton) {.top104.fra105.01.03}
set widget(connectionOptions) {.top104}
set widget(diffmergeButton) {.top108.fra109.01.05}
set widget(diffmergeOptions) {.top108}
set widget(displayButton) {.top110.fra111.01.06}
set widget(displayOptions) {.top110}
set widget(editviewButton) {.top106.fra107.01.04}
set widget(editviewOptions) {.top106}
set widget(filesButton) {.top92.fra93.fra94.rad97}
set widget(filesOptions) {.top92}
set widget(fontButton) {.top112.fra113.01.07}
set widget(fontOptions) {.top112}
set widget(grabWidget) {.top40.fra129.lab130}
set widget(integrate) {.top19}
set widget(integrate_BranchMcFrame) {.top20.fra21.fra23}
set widget(integrate_back) {.top19.fra20.fra61.but62}
set widget(integrate_branchFrame) {.top19.fra20.fra24.fra26}
set widget(integrate_branchSpec) {.top20}
set widget(integrate_branchText) {.top19.fra20.fra31.cpd34.03}
set widget(integrate_branchTextFrame) {.top19.fra20.fra31.cpd34}
set widget(integrate_changelistComboFrame) {.top19.fra20.fra35.fra37}
set widget(integrate_endnumber) {.top19.fra20.fra60.03.05}
set widget(integrate_endother) {.top19.fra20.fra60.06.08}
set widget(integrate_filespecEntry) {.top19.fra20.fra31.ent33}
set widget(integrate_filespecFrame) {.top19.fra20.fra24.fra25}
set widget(integrate_ok) {.top19.fra20.fra61.but63}
set widget(integrate_optRename) {.top19.fra20.fra39.fra42.fra43.che47}
set widget(integrate_reverse) {.top19.fra20.fra30.che32}
set widget(integrate_sourceText) {.top19.fra20.cpd23.03}
set widget(integrate_startnumber) {.top19.fra20.fra50.fra53.ent55}
set widget(integrate_startother) {.top19.fra20.fra50.fra58.02}
set widget(integrate_targetFrame1) {.top19.fra20.fra24}
set widget(integrate_targetFrame2) {.top19.fra20.fra31}
set widget(integrate_usingFrame) {.top19.fra20.fra24.fra33}
set widget(mcListboxFrame) {.top40.fra41.cpd42.01.cpd44.02.fra17}
set widget(p4cmdListbox) {.top40.fra41.cpd42.02.cpd43.01}
set widget(rev,.top104) {connectionOptions}
set widget(rev,.top104.fra105.01.03) {connectionButton}
set widget(rev,.top104.fra105.08.fra114) {HostsFrame}
set widget(rev,.top106) {editviewOptions}
set widget(rev,.top106.fra107.01.04) {editviewButton}
set widget(rev,.top108) {diffmergeOptions}
set widget(rev,.top108.fra109.01.05) {diffmergeButton}
set widget(rev,.top110) {displayOptions}
set widget(rev,.top110.fra111.01.06) {displayButton}
set widget(rev,.top112) {fontOptions}
set widget(rev,.top112.fra113.01.07) {fontButton}
set widget(rev,.top120) {ConnectionEdit}
set widget(rev,.top120.fra126.but127) {ConnectionEditSave}
set widget(rev,.top132) {TemplateName}
set widget(rev,.top17) {Describe}
set widget(rev,.top17.fra18.cpd20.03) {DescribeText}
set widget(rev,.top17.fra19) {DescribeButtonFrame}
set widget(rev,.top17.fra19.but21) {DescribeClose}
set widget(rev,.top17.fra19.but22) {DescribeEdit}
set widget(rev,.top17.fra19.but23) {DescribeHelpButton}
set widget(rev,.top17.fra19.but28) {DescribeUpdate}
set widget(rev,.top17.fra19.but29) {DescribeCancel}
set widget(rev,.top17.fra19.but30) {DescribeReset}
set widget(rev,.top17.fra21.fra22) {DescribeButtonFrame}
set widget(rev,.top17.fra21.fra22.01) {DescribeClose}
set widget(rev,.top17.fra21.fra22.02) {DescribeEdit}
set widget(rev,.top17.fra21.fra22.03) {DescribeUpdate}
set widget(rev,.top17.fra21.fra22.04) {DescribeCancel}
set widget(rev,.top17.fra21.fra22.05) {DescribeReset}
set widget(rev,.top17.fra21.fra22.06) {DescribeHelpButton}
set widget(rev,.top17.fra21.fra23) {DescribeButtonFrame2}
set widget(rev,.top17.fra21.fra23.but17) {DescribeShowDiffs}
set widget(rev,.top17.fra21.fra23.but24) {DescribePrev}
set widget(rev,.top17.fra21.fra23.but25) {DescribeNext}
set widget(rev,.top18) {Change}
set widget(rev,.top18.cpd38) {Change_Split_frame}
set widget(rev,.top18.cpd38.01.fra39) {Change_Description_frame}
set widget(rev,.top18.cpd38.01.fra39.02.05) {Change_Description_text}
set widget(rev,.top18.cpd38.02.fra41) {Change_Files_frame}
set widget(rev,.top18.cpd38.02.fra41.01) {Change_Files_label}
set widget(rev,.top18.cpd38.02.fra41.02.05) {Change_Files_text}
set widget(rev,.top18.fra19.fra22.cpd24.02) {Change_Change_entry}
set widget(rev,.top18.fra19.fra22.fra25.02) {Change_Date_entry}
set widget(rev,.top18.fra19.fra22.fra26.02) {Change_Client_entry}
set widget(rev,.top18.fra19.fra22.fra27.02) {Change_User_entry}
set widget(rev,.top18.fra19.fra22.fra28.02) {Change_Status_entry}
set widget(rev,.top18.fra19.fra23.but29) {Change_Submit}
set widget(rev,.top18.fra19.fra23.but30) {Change_Update}
set widget(rev,.top18.fra20) {Change_Description_frame}
set widget(rev,.top18.fra20.cpd33.03) {Change_Description_text}
set widget(rev,.top18.fra21) {Change_Files_frame}
set widget(rev,.top18.fra21.cpd34.03) {Change_Files_text}
set widget(rev,.top18.fra21.lab36) {Change_Files_label}
set widget(rev,.top18.fra42) {Change_Description_frame2}
set widget(rev,.top18.fra42.02.05) {Change_Description_text2}
set widget(rev,.top19) {integrate}
set widget(rev,.top19.fra20.cpd23.03) {integrate_sourceText}
set widget(rev,.top19.fra20.fra24) {integrate_targetFrame1}
set widget(rev,.top19.fra20.fra24.fra25) {integrate_filespecFrame}
set widget(rev,.top19.fra20.fra24.fra26) {integrate_branchFrame}
set widget(rev,.top19.fra20.fra24.fra33) {integrate_usingFrame}
set widget(rev,.top19.fra20.fra30.che32) {integrate_reverse}
set widget(rev,.top19.fra20.fra31) {integrate_targetFrame2}
set widget(rev,.top19.fra20.fra31.cpd34) {integrate_branchTextFrame}
set widget(rev,.top19.fra20.fra31.cpd34.03) {integrate_branchText}
set widget(rev,.top19.fra20.fra31.ent33) {integrate_filespecEntry}
set widget(rev,.top19.fra20.fra35.fra37) {integrate_changelistComboFrame}
set widget(rev,.top19.fra20.fra39.fra42.fra43.che47) {integrate_optRename}
set widget(rev,.top19.fra20.fra50.fra53.ent55) {integrate_startnumber}
set widget(rev,.top19.fra20.fra50.fra58.02) {integrate_startother}
set widget(rev,.top19.fra20.fra60.03.05) {integrate_endnumber}
set widget(rev,.top19.fra20.fra60.06.08) {integrate_endother}
set widget(rev,.top19.fra20.fra61.but62) {integrate_back}
set widget(rev,.top19.fra20.fra61.but63) {integrate_ok}
set widget(rev,.top20) {integrate_branchSpec}
set widget(rev,.top20.fra21.fra23) {integrate_BranchMcFrame}
set widget(rev,.top21) {Rename_GetNewName}
set widget(rev,.top21.fra22.fra23.lab28) {Rename_GetNewName_Heading}
set widget(rev,.top21.fra22.fra27) {Rename_GetNewName_ButtonFrame}
set widget(rev,.top21.fra22.fra39) {Rename_GetNewName_OptionFrame}
set widget(rev,.top22) {changeSync}
set widget(rev,.top24) {DescribeHelp}
set widget(rev,.top24.fra25.01.04) {DescribeHelpText}
set widget(rev,.top31) {ChangeFileType}
set widget(rev,.top33) {Rename_Rename}
set widget(rev,.top33.fra34.01.02) {Rename_RenameListbox}
set widget(rev,.top33.fra34.05.06) {Rename_RenameRemoveButton}
set widget(rev,.top33.fra34.fra35.01.02) {Rename_RenameLabel}
set widget(rev,.top36) {Rename_EdittedFiles}
set widget(rev,.top36.fra37.01.02.mes38) {Rename_EdittedFiles_message}
set widget(rev,.top36.fra37.010.011) {Rename_EdittedFilesListbox}
set widget(rev,.top36.fra37.lab42) {Rename_EdittedFiles_label}
set widget(rev,.top37) {EntryDialog}
set widget(rev,.top37.fra38.fra39.cpd43.01) {EntryDialogLabel}
set widget(rev,.top37.fra38.fra39.cpd43.02) {EntryDialogEntry}
set widget(rev,.top40) {tkp4}
set widget(rev,.top40.fra129.lab130) {grabWidget}
set widget(rev,.top40.fra17) {ToolbarFrame}
set widget(rev,.top40.fra41.cpd42.01.cpd44.01) {treeFrame}
set widget(rev,.top40.fra41.cpd42.01.cpd44.01.cpd17.03) {treeCanvas}
set widget(rev,.top40.fra41.cpd42.01.cpd44.02.fra17) {mcListboxFrame}
set widget(rev,.top40.fra41.cpd42.02.cpd43.01) {p4cmdListbox}
set widget(rev,.top40.fra47.cpd48.01) {Menu_File}
set widget(rev,.top40.fra47.cpd48.03) {Menu_Edit}
set widget(rev,.top40.fra47.cpd48.05) {Menu_Help}
set widget(rev,.top40.fra47.cpd48.men18.01) {Menu_View}
set widget(rev,.top43) {RevertUnchanged}
set widget(rev,.top43.fra44) {RevertUnchanged_Frame}
set widget(rev,.top43.fra44.cpd45) {RevertUnchanged_ListboxFrame}
set widget(rev,.top43.fra44.cpd45.01) {RevertUnchanged_Listbox}
set widget(rev,.top43.fra44.fra46.but47) {RevertUnchanged_RemoveButton}
set widget(rev,.top43.fra44.fra46.but49) {RevertUnchanged_RevertButton}
set widget(rev,.top50) {SyncLabel}
set widget(rev,.top50.fra51.ent56) {SyncLabel_entry}
set widget(rev,.top50.fra51.fra62.03.05) {SyncLabel_number}
set widget(rev,.top50.fra51.fra62.06.08) {SyncLabel_other}
set widget(rev,.top51) {FileInfo}
set widget(rev,.top51.fra52.cpd53.02) {FileInfo_DepotPath}
set widget(rev,.top51.fra52.fra54.02) {FileInfo_ClientPath}
set widget(rev,.top51.fra52.fra55.02) {FileInfo_FileType}
set widget(rev,.top51.fra52.fra56.fra63.02) {FileInfo_HeadRevision}
set widget(rev,.top51.fra52.fra56.fra64.02) {FileInfo_HaveRevision}
set widget(rev,.top51.fra52.fra58.02) {FileInfo_LastModTime}
set widget(rev,.top51.fra52.fra59.cpd67.01) {FileInfo_OpenedBy}
set widget(rev,.top51.fra52.fra59.fra38.but40) {FileInfo_Describe}
set widget(rev,.top51.fra52.fra60.02) {FileInfo_LockedBy}
set widget(rev,.top51.fra52.fra65.01.03) {FileInfo_HeadAction}
set widget(rev,.top51.fra52.fra65.04.06) {FileInfo_HeadChange}
set widget(rev,.top63) {AutoResolve}
set widget(rev,.top63.fra64.fra66) {AutoResolve_optionFrame}
set widget(rev,.top63.fra64.fra67.but86) {AutoResolve_ok}
set widget(rev,.top63.fra64.fra67.but87) {AutoResolve_preview}
set widget(rev,.top81) {RevisionHistory}
set widget(rev,.top81.fra82.cpd84.01.fra86) {RevisionHistoryMcFrame}
set widget(rev,.top81.fra82.cpd84.02.fra87.01) {RevisionHistoryLabel}
set widget(rev,.top81.fra82.cpd84.02.fra88.01.04) {RevisionHistoryText}
set widget(rev,.top81.fra91.01) {RevisionHistoryButtonBrowse}
set widget(rev,.top81.fra91.02) {RevisionHistoryButtonSync}
set widget(rev,.top81.fra91.03) {RevisionHistoryButtonDiffRevs}
set widget(rev,.top81.fra91.04) {RevisionHistoryButtonDiffClient}
set widget(rev,.top92) {filesOptions}
set widget(rev,.top92.fra93.fra94.rad97) {filesButton}
set widget(tkp4) {.top40}
set widget(treeCanvas) {.top40.fra41.cpd42.01.cpd44.01.cpd17.03}
set widget(treeFrame) {.top40.fra41.cpd42.01.cpd44.01}
#################################
# USER DEFINED PROCEDURES
#
proc init {argc argv} {
global widget p4tooltips
. config -bg grey85
option add *foreground black user
option add *background grey85 user
option add *highlightBackground grey85 user
set p4tooltips(butd) "View Entire Perforce Depot"
set p4tooltips(butdclient) "Client View of Perforce Depot"
set p4tooltips(butdisk) "View Client Workspace Root Directory"
set p4tooltips(butpending) "View Pending Changelists"
set p4tooltips(butsubmitted) "View Submitted Changelists"
set p4tooltips(butbranch) "View BranchSpecs"
set p4tooltips(butlabel) "View Labels"
set p4tooltips(butclient) "View ClientSpecs"
set p4tooltips(butuser) "View Users"
set p4tooltips(butjob) "View Jobs"
set p4tooltips(butsetup) "Set Perforce Options"
set p4tooltips(butinfo) "Show Connection Info"
set p4tooltips(butnone) ""
set p4tooltips(ftypetext) ""
set p4tooltips(ftypebinary) ""
set p4tooltips(ftypeltext) "(text stored uncompressed at server for each revision)"
set p4tooltips(ftypektext) {(supports $Id:$ expansion)}
set p4tooltips(ftypextext) "(executable text)"
set p4tooltips(ftypekxtext) {(executable text, supports $Id:$ expansion)}
set p4tooltips(ftypectext) "(text stored compressed by server)"
set p4tooltips(ftypecxtext) "(executable text, stored compressed by server)"
set p4tooltips(ftypeubinary) "(binary, stored uncompressed by server for each revision)"
set p4tooltips(ftypexbinary) "(executable binary)"
set p4tooltips(ftypetempobj) "(server stores only head revision)"
set p4tooltips(ftypextempobj) "(executable, server stores only head revision)"
image create photo butd -data {
R0lGODdhFQATAMIAANjc2ICAgAAAAPj8+Pj8AAAAAAAAAAAAACwAAAAAFQAT
AAADPwi63P4wykmrhUHoULMIAzF4nEOGqCiSi6Cm8EsIihDHxEsDASmnmg2j
Fwyogp9eaUhEKnuT5/OivFiv2OwjAQA7
}
image create photo butdclient -data {
R0lGODdhFQATAMIAANjc2AAAAICAgLi8uAAAgAAA+Pj8+AAAACwAAAAAFQAT
AAADVgi63P4wrkCrDQKGwbvH2kCMJCEM4LMRResaaKaK7huHbF3AqbPqu9tM
YCgaeTKfZylkCC7QSlIROFqPz0aVyakMsowt1wOeCM7odDrQeEahU4l8/kgA
ADs=
}
image create photo butdisk -data {
R0lGODdhFQATAMIAANjc2ICAgAAAALi8uPj8+PgAAAAAAAAAACwAAAAAFQAT
AAADRAi63P4wyhmqvTi0zO0SwSCOZBkIQEWsbOtWaFXOQyHCaUhi5pn3ll4s
IygWgwOcjEZTdjrFj3FKnTKqWOtky+16v40EADs=
}
image create photo butnone -data {
R0lGODdhFQATAIAAANjc2AAAACwAAAAAFQATAAACEYSPqcvtD6OctNqLs968
+58VADs=
}
image create photo butpending -data {
R0lGODdhFQATAKEAANjc2AAAAPgAAAAA+CwAAAAAFQATAAACN4SPqcvtD2OI
ax4Lg8D4aRsMHaMJGxCOlbmFg+iUrAs38vbmqnHjea0ICIc/XWaI3FGWzKYT
UAAAOw==
}
image create photo butsubmitted -data {
R0lGODdhFQATAKEAANjc2AAAAICAgAAAACwAAAAAFQATAAACNISPqcvtD6NE
IcxTLasqa8BhoZiBgvB5S3aelvclbFs2AXq749r2FbrpCWkdmFF1SSqXlwIA
Ow==
}
image create photo butbranch -data {
R0lGODdhFQATAMIAANjc2AAAAAAA+PgAAICAgAAAAAAAAAAAACwAAAAAFQAT
AAADRgi63P4wghCigJQ+wV3ODSc+2jIwAoFVyuAu6dq6LxCTbKsqt5cDg51N
2CjpYEQGheYScZILCmFKrUIVRolPK+NuveAwOAEAOw==
}
image create photo butlabel -data {
R0lGODdhFQATAKEAANjc2AAAAAD8+AAAACwAAAAAFQATAAACOYSPqcsNAYNT
UFg5TY0Cz9BpoNeMzxU649qlZSuNLiPH8HebWX2Sr6nDAWe/EPEHOr46vh0k
AzUUAAA7
}
image create photo butclient -data {
R0lGODdhFQATAMIAANjc2AAAAICAgAAAgAAA+AAAAAAAAAAAACwAAAAAFQAT
AAADPwi63P4wvkCrZMHlW6sAWxQu2ah1wVeKGuhC2SAPbgcDA6HX5ITrBJDn
1TARKRNUR+UTGRXPnlOJvFiv2CwjAQA7
}
image create photo butuser -data {
R0lGODdhFQATAMIAANjc2IAAAAAAAICAgAAA+Li8uAD8+AAAACwAAAAAFQAT
AAADUAi63P4wqkCDuFjASrN3nOUNgAZSZEYuJlMpH9wubxkTZcPZVzGfFN6l
8QMEWUMkEPkrHjOyJFGKYT0uBoMmaaoysgIwTJZrZLUzqmTNbicAADs=
}
image create photo butjob -data {
R0lGODdhFQATAMIAANjc2AAAgAAAAPj8+ICAgLi8uAAAAAAAACwAAAAAFQAT
AAADYwi63P4wqkCFlSyMvQPBgFYQlGedgpMCJOEK3CZ8TNoq8FjSNRvgipar
sFrYPICjCzcoJn0VHw9W/DGaUibx4SLYUIORM0gaA8JeHjng7L6WCxeb8TrB
121ht1Gmp9UggYIPCQA7
}
image create photo butsetup -data {
R0lGODdhFQATAKEAANjc2AAAAICAAPj8ACwAAAAAFQATAAACQISPqRvtsVQQ
VIQxYDSz0rd13odp0liBjCde2Zo2cXPOaVl/sk4n4sfC5UaqYfAFQ7lMRotj
wzkyQ48e9IrNAgoAOw==
}
image create photo butinfo -data {
R0lGODdhFQATAMIAANjc2ICAgLi8uPj8+AAAAAAA+AAAAAAAACwAAAAAFQAT
AAADUAi63P4wskBrkIqKwTuNwdYJIkdAQccVhXo6qSp37ySzrXvZd07vi5iK
JSMAg0Pc75iZFZnBkkpghC4I0gGhitmWuBhAYGuyoghac3jNViQAADs=
}
}
init $argc $argv
proc {busy_cursor} {opt} {
global BusyCursor
switch $opt {
set {
if {![info exists BusyCursor]} {
set BusyCursor ""
} elseif {$BusyCursor != ""} {
return
}
set BusyCursor [list {. left_ptr}]
set list [winfo children .]
while {$list != ""} {
set next {}
foreach w $list {
set cursor [lindex [$w config -cursor] 4]
set class [winfo class $w]
if {$class == "Toplevel" || $cursor != ""} {
lappend BusyCursor [list $w $cursor]
}
set next [concat $next [winfo children $w]]
}
set list $next
}
foreach w $BusyCursor {
catch {[lindex $w 0] config -cursor watch}
}
update idletasks
}
clear {
foreach w $BusyCursor {
catch {[lindex $w 0] config -cursor [lindex $w 1]}
}
set BusyCursor ""
}
}
}
proc {clipboard_create} {} {
event add <<Cut>> <Control-Key-X>
event add <<Copy>> <Control-Key-C>
event add <<Paste>> <Control-Key-V>
set m .clipboardmenu
menu $m -tearoff 0
$m add command -label "Cut" -accel "Ctrl+X"
$m add command -label "Copy" -accel "Ctrl+C"
$m add command -label "Paste" -accel "Ctrl+V"
$m add command -label "Delete" -accel "Delete"
$m add separator
$m add command -label "Select All" -accel "Ctrl+/"
}
proc {clipboard_doit} {w opt} {
event generate $w <$opt>
}
proc {clipboard_post} {w x y} {
set m .clipboardmenu
if {[winfo class $w] == "Text"} {
set sel [$w tag ranges sel]
} {
if {[$w selection present]} {
set sel "1"
} {
set sel ""
}
}
if {$sel == ""} {
set selstate disabled
} {
set selstate normal
}
set editstate [$w cget -state]
if {$editstate == "disabled"} {
set cutstate $editstate
} {
set cutstate $selstate
}
if {[catch {selection get -displayof $w -selection CLIPBOARD} sel] || $sel == ""} {
set pastestate disabled
} {
set pastestate $editstate
}
$m entryconfig "Cut" -command "clipboard_doit $w <Cut>" -state $cutstate
$m entryconfig "Copy" -command "clipboard_doit $w <Copy>" -state $selstate
$m entryconfig "Paste" -command "clipboard_doit $w <Paste>" -state $pastestate
$m entryconfig "Delete" -command "clipboard_doit $w Delete" -state $cutstate
$m entryconfig "Select All" -command "clipboard_doit $w Control-slash"
tk_popup $m $x $y
}
proc {p4_autoResolve} {opt args} {
global p4 widget env p4pending
switch $opt {
cancel {
Window hide $widget(AutoResolve)
grab release $widget(AutoResolve)
}
help {
p4_help AutoResolve
}
ok {
set p4(AutoResolvePreview) ""
p4_autoResolve run
p4_autoResolve cancel
}
preview {
set p4(AutoResolvePreview) "Auto-merge preview: "
p4_autoResolve run
}
run {
if {$p4(AutoResolve_mode) == "selected"} {
set files $p4(AutoResolve_files)
} {
set files ""
}
set parms $p4(AutoResolve_type)
if {$p4(AutoResolvePreview) != ""} {
append parms " -n"
}
foreach o {f t} {
if {$p4(AutoResolve_$o)} {
append parms " -$o"
}
}
#p4_runCommand checkout resolve "$p4(AutoResolve_files)" [list [Tree:joinnodes $widget(pendingCanvas) $p4pending(Changelists_myclient) $p4(integrate_changelist)]] $parms
p4_runCommand checkout resolve $files {} $parms
tkwait variable p4(runcmdDone)
p4_debugMsg "resolve output: [array get p4 runcmd*]"
return 0
}
setmode {
if {$p4(AutoResolve_mode) == "selected" && ! $p4(AutoResolve_haveSome)} {
set state disabled
set color #a3a3a3
} {
set state normal
set color black
}
foreach w {optionFrame ok preview} {
p4_ToggleDisabled $state $widget(AutoResolve_$w) $color
}
}
show {
set parent [lindex [lindex $args 1] 0]
set p4(AutoResolve_mode) selected
set p4(AutoResolve_list) [lindex $args 0]
#puts p4(AutoResolve_list)=$p4(AutoResolve_list)
set p4(AutoResolve_files) ""
set p4(AutoResolve_haveSome) 0
foreach file $p4(AutoResolve_list) {
#puts "$file unresolved=$p4pending($parent$file:unresolved)"
regexp {(.*)#([0-9])* <(.*)><(.*)>} $file match file2 have type action
if {$p4pending($parent$file:unresolved)} {
set p4(AutoResolve_haveSome) 1
}
lappend p4(AutoResolve_files) [string trim [lindex [split $file2 #] 0]]
}
#puts "haveSome=$p4(AutoResolve_haveSome) p4(AutoResolve_files)=$p4(AutoResolve_list)"
Window show $widget(AutoResolve)
grab $widget(AutoResolve)
p4_autoResolve setmode
}
}
}
proc {p4_branchOptions} {opt args} {
global p4 widget
switch $opt {
createListbox {
return [p4_mcListbox $widget(mcListboxFrame).branch {{branch Branch 24} {date Date 11} {desc Description 24}} desc]
}
selection {
#puts "selection has changed: $args"
}
setTitle {
set p4(mcListboxTitle) "Perforce Branches"
}
show {
if {$args == ""} {
set w $p4(mcListbox)
} {
set w [lindex $args 0]
}
busy_cursor set
$w delete 0 end
if {![info exists p4(cache_branch)]} {
p4_runCommand run "$p4(exec) branches"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
set p4(cache_branch) $p4(runcmdOutput)
p4_logOptions note "Number of branches: [llength $p4(cache_branch)]"
}
foreach line $p4(cache_branch) {
regexp {[^ ]* ([^ ]*) ([^ ]*) '(.*)'} $line match b d desc
$w insert end [list $b $d $desc]
}
p4_mcOptions sort $w branch increasing branch
busy_cursor clear
}
}
}
proc {p4_changeOptions} {opt args} {
global p4 p4change widget Tree
switch $opt {
createListbox {
return [p4_mcListbox $widget(mcListboxFrame).change {{change Changelist 15} {date Date 11} {user User 24} {desc Description 36}} desc]
}
edit {
set itemname [lindex $args 0]
set status [lindex $args 1]
p4_pendingChangeOptions editChangelist edit $itemname $status
# In case we were called from the Describe window's Edit button.
p4_itemOptions viewhide
}
setTitle {
set p4(mcListboxTitle) "Submitted Perforce Changelists$p4(SubmittedFiltered)"
}
show {
busy_cursor set
set filter [lindex $args 0]
$p4(mcListbox) delete 0 end
if {$filter == "" || $Tree(curselection) == "{} {}"} {
set filter ""
set p4(SubmittedFiltered) ""
} {
set p4(SubmittedFiltered) " (filtered)"
set node [eval Tree:joinnodes $widget(treeCanvas) $Tree(curselection)]
if {$Tree($node:isdir)} {
set filter [list $node/...]
} {
set filter [list [string trim [lindex [split $node #] 0]]]
}
catch {unset p4(cache_change)}
}
p4_changeOptions setTitle
if {![info exists p4(cache_change)]} {
p4_runCommand run "$p4(exec) changes -m 100 -l -s submitted $filter"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
set p4(cache_change) [join $p4(runcmdOutput) \n]
}
set data $p4(cache_change)
set next [string first "Change " $data]
set left [string range $data [incr next 7] end]
while {$left != ""} {
set next [string first "\nChange " $left]
if {$next < 0} {
set this $left
set left ""
} {
set this [string range $left 0 [expr $next - 1]]
set left [string range $left [incr next 8] end]
}
#puts this=$this
set lines [split $this \n]
set p4revs([lindex [lindex $lines 0] 0]) "$this"
regexp {([^ ]*) on ([^ ]*) by ([^ ]*)} [lindex $lines 0] match c d u
#set desc [string trim [lindex $lines 1]]
set desc [string trim [lindex $lines 2]]
$p4(mcListbox) insert end [list "$c" $d $u $desc]
}
p4_mcOptions sort $p4(mcListbox) change decreasing change
busy_cursor clear
}
submit {
p4_pendingChangeOptions update submit
}
sync {
p4_runCommand sync {} {} [p4_changeOptions syncRevisions]
p4_changeOptions syncCancel
}
syncActive {
if {[winfo exists $widget(changeSync)]} {
return 1
}
return 0
}
syncCancel {
Window hide $widget(changeSync)
}
syncHelp {
bell
}
syncPreview {
p4_runCommand sync {} -n [p4_changeOptions syncRevisions]
}
syncRevisions {
if {$p4(Change_syncOpt) == "all"} {
set rev @$p4(Change_syncChangelist)
} {
set rev @$p4(Change_syncChangelist),$p4(Change_syncChangelist)
}
return $rev
}
syncShow {
set p4(Change_syncChangelist) [lindex $args 0]
set p4(Change_syncOpt) all
Window show $widget(changeSync)
wm title $widget(changeSync) "TkP4 - Sync to Changelist $p4(Change_syncChangelist)"
}
update {
p4_pendingChangeOptions update update
}
view {
set itemname [lindex $args 0]
set filelist [lindex $args 1]
set status [lindex $args 2]
set editbutton [lindex $args 3]
set prevnext [lindex $args 4]
set showdiffs [lindex $args 5]
if {$showdiffs == "doshowdiffs"} {
set flag ""
} {
set flag " -s"
}
p4_runCommand run "$p4(exec) describe$flag $itemname"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
#busy_cursor clear
return -1
}
set p4(itemText) [join $p4(runcmdOutput) \n]
set p4(describeText) $p4(itemText)
set p4(describeHelp) "\n\nNo help available."
Window show $widget(Describe)
raise $widget(Describe)
p4_itemOptions insert
# Add the affected files manually.
if {$filelist != ""} {
$widget(DescribeText) insert end "\n\nAffected files ...\n\n\n[join $filelist \n]"
}
if {$prevnext == "noprevnext"} {
$widget(DescribePrev) config -state disabled
$widget(DescribeNext) config -state disabled
} {
p4_itemOptions viewlimits $prevnext $itemname
}
if {$editbutton == "editbutton"} {
$widget(DescribeEdit) config -state normal -command "p4_changeOptions edit $itemname $status"
} {
$widget(DescribeEdit) config -state disabled
}
if {$showdiffs == "showdiffs"} {
pack $widget(DescribeShowDiffs) -anchor w -expand 0 -fill none -side left
$widget(DescribeShowDiffs) config -command "p4_changeOptions view $itemname {} $status $editbutton $prevnext doshowdiffs"
} {
pack forget $widget(DescribeShowDiffs)
}
$widget(DescribeText) config -state disabled -background grey85
}
}
}
proc {p4_clientOptions} {opt args} {
global p4 widget env
switch $opt {
createListbox {
return [p4_mcListbox $widget(mcListboxFrame).client {{client Client 20} {date Date 11} {root Root 24} {desc Description 24}} desc]
}
setClientInfo {
busy_cursor set
p4_runCommand run "$p4(exec) client -o $env(P4CLIENT)"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
set lines $p4(runcmdOutput)
set idx [lsearch -regexp $lines ^Update:]
if {$idx < 0} {
set p4(clientView) ""
set p4(clientOwner) ""
set p4(clientRoot) ""
} {
foreach field {Owner Root} {
set idx [lsearch -regexp $lines ^$field:]
# There is a tab separating the field and value.
regexp {^[^:]*:([^ ]*)} [lindex $lines $idx] match p4(client$field)
set p4(client$field) [string trim $p4(client$field)]
}
# The view is used to determine which depots to show in the Client Depot view.
set p4(clientView) ""
set idx [lsearch -regexp $lines ^View:]
foreach line [lrange $lines $idx end] {
lappend p4(clientView) [string trim $line]
}
}
busy_cursor clear
return 0
}
show {
busy_cursor set
$p4(mcListbox) delete 0 end
if {![info exists p4(cache_client)]} {
p4_runCommand run "$p4(exec) clients"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) <0} {
# TTD How to handle error returns here and generally from run/read/stop?
#set p4(cache_client) ""
busy_cursor clear
return -1
}
set p4(cache_client) $p4(runcmdOutput)
}
foreach line $p4(cache_client) {
regexp {[^ ]* ([^ ]*) ([^ ]*) ([^ ]*) (.*) '(.*)'} $line match c d a r desc
$p4(mcListbox) insert end [list $c $d $r [string trim $desc]]
}
p4_mcOptions sort $p4(mcListbox) client increasing client
p4_clientOptions switch $env(P4CLIENT)
busy_cursor clear
}
selection {
#puts "selection has changed: $args"
}
setTitle {
set p4(mcListboxTitle) "Perforce Clients"
}
switch {
set client [lindex $args 0]
if {$p4(mcItem) == "client"} {
set data [$p4(mcListbox) get 0 end]
set idx [lsearch -regexp $data "^$client "]
if {$idx >= 0} {
$p4(mcListbox) selection clear 0 end
$p4(mcListbox) selection set $idx
$p4(mcListbox) see $idx
}
} {
set idx 0
}
if {$idx >= 0} {
set env(P4CLIENT) $client
set prevroot $p4(clientRoot)
# This sets p4(clientOwner) and p4(clientRoot)
if {[p4_clientOptions setClientInfo] != 0} {
return
}
# Even the Entire Depot view has client-specific info (have revision), so
# we must always refresh the tree pane when the client changes.
if {$p4(prevClient) != $client} {
p4_refresh pendingPane ;# switch client
}
set p4(prevClient) $client
p4_setTitle
}
}
switchOLD {
# this was before refresh does both depot and pending panes.
set client [lindex $args 0]
if {$p4(mcItem) == "client"} {
set data [$p4(mcListbox) get 0 end]
set idx [lsearch -regexp $data "^$client "]
if {$idx >= 0} {
$p4(mcListbox) selection clear 0 end
$p4(mcListbox) selection set $idx
$p4(mcListbox) see $idx
}
} {
set idx 0
}
if {$idx >= 0} {
set env(P4CLIENT) $client
set prevroot $p4(clientRoot)
#set p4(clientRoot) [lindex [lindex $data $idx] 2]
# This sets p4(clientOwner) and p4(clientRoot)
if {[p4_clientOptions setClientInfo] != 0} {
return
}
# Even the Entire Depot view has client-specific info (have revision), so
# we must always refresh the tree pane when the client changes.
if {$p4(prevClient) != $client} {
if {$p4(treeView) == "workspace"} {
if {$prevroot != $p4(clientRoot)} {
p4_treeOptions switch force
}
} {
p4_treeOptions refresh ;# switch client (OLD)
}
p4_pendingChangeOptions invalidate
# Update the Pending pane but don't switch to it
if {$p4(mcItem) == "pending"} {
set force force
} {
set force noshow
}
p4_pendingChangeOptions show $force
}
set p4(prevClient) $client
p4_setTitle
}
}
templateedit {
set msg ""
set p4(templateTarget) [string trim $p4(templateTarget)]
if {[regexp {^[0-9]*$} $p4(templateTarget) match]} {
set msg "Purely numeric client names not allowed!"
}
if {$p4(templateTarget) == ""} {
set msg "You must enter a value for client target name!"
}
if {[string first " " $p4(templateTarget)] >= 0} {
set msg "Blanks in client name not allowed!"
}
if {$msg != ""} {
bell
tk_dialog .tkp4err "TkP4 Error" $msg "error" 0 "OK"
return
}
grab release $widget(TemplateName)
Window hide $widget(TemplateName)
set client $p4(templateTarget)
set template $p4(templateName)
p4_runCommand run "$p4(exec) client -o -t $template $client"
tkwait variable p4(runcmdDone)
set p4(itemSpec) client
set p4(itemText) [join $p4(runcmdOutput) \n]
if {$p4(runcmdDone) < 0} {
return -1
}
p4_itemOptions split
p4_itemOptions edit client $client doneget
}
templateget {
# Get new/existing client name
set t $widget(TemplateName)
if {![winfo exists $t]} {
# We create and hide the window to ensure the wm title is updated.
# (to get around a bug in Hummingbird eXceed).
Window show $t
wm withdraw $t
update
}
set p4(templateName) [lindex $args 0]
if {$p4(templateName) == $env(P4CLIENT)} {
wm title $widget(TemplateName) "Create Client from Template"
set p4(templateTarget) ""
} {
wm title $widget(TemplateName) "Create or Update Client from Template"
set p4(templateTarget) $env(P4CLIENT)
}
Window show $widget(TemplateName)
grab $widget(TemplateName)
}
templatecancel {
grab release $widget(TemplateName)
Window hide $widget(TemplateName)
}
}
}
proc {p4_connectionOptions} {opt args} {
global p4 widget env
switch $opt {
add {
grab release $widget(connectionOptions)
Window show $widget(ConnectionEdit)
grab $widget(ConnectionEdit)
foreach field {Host Port IP User Client Desc} {
set p4(serverEdit$field) ""
}
$widget(ConnectionEditSave) config -command {p4_connectionOptions editadd}
}
delete {
set hostlist [$p4(hostListbox) get [$p4(hostListbox) curselection]]
foreach {Host Port IP User Client Desc} $hostlist { break }
bell
if {[tk_dialog .tkp4 "TkP4 - Delete Server" "Delete Perforce server $Host?" questhead -1 "Delete" "Cancel"] != 0} {
return
}
set idx [$p4(hostListbox) curselection]
$p4(hostListbox) delete $idx $idx
$p4(hostListbox) select set 0
}
edit {
grab release $widget(connectionOptions)
Window show $widget(ConnectionEdit)
grab $widget(ConnectionEdit)
set hostlist [$p4(hostListbox) get [$p4(hostListbox) curselection]]
foreach {Host Port IP User Client Desc} $hostlist { break }
foreach field {Host Port IP User Client Desc} {
set p4(serverEdit$field) [set $field]
}
$widget(ConnectionEditSave) config -command {p4_connectionOptions editsave}
}
editadd {
if {![p4_connectionOptions editcheck]} {
return
}
Window hide $widget(ConnectionEdit)
grab release $widget(ConnectionEdit)
grab $widget(connectionOptions)
$p4(hostListbox) insert end [list $p4(serverEditHost) $p4(serverEditPort) $p4(serverEditIP) $p4(serverEditUser) $p4(serverEditClient) $p4(serverEditDesc)]
$p4(hostListbox) selection clear 0 end
$p4(hostListbox) select set end
p4_mcOptions sort $p4(hostListbox) name increasing
}
editcancel {
Window hide $widget(ConnectionEdit)
grab release $widget(ConnectionEdit)
grab $widget(connectionOptions)
}
editcheck {
foreach field {Host Port IP User Client Desc} {
set p4(serverEdit$field) [string trim $p4(serverEdit$field)]
}
if {"$p4(serverEditHost)$p4(serverEditIP)" == "" || $p4(serverEditPort) == ""} {
bell
tk_dialog .tkp4 "TkP4 - Perforce Server Fields" "You must enter a Host Name or IP address, and a Port." error 0 "OK"
return 0
}
return 1
}
editsave {
if {![p4_connectionOptions editcheck]} {
return
}
Window hide $widget(ConnectionEdit)
grab release $widget(ConnectionEdit)
grab $widget(connectionOptions)
set idx [$p4(hostListbox) curselection]
set hosts [$p4(hostListbox) get 0 end]
set hosts [lreplace $hosts $idx $idx [list $p4(serverEditHost) $p4(serverEditPort) $p4(serverEditIP) $p4(serverEditUser) $p4(serverEditClient) $p4(serverEditDesc)]]
$p4(hostListbox) delete 0 end
foreach host $hosts {
$p4(hostListbox) insert end $host
}
$p4(hostListbox) select set $idx
p4_mcOptions sort $p4(hostListbox) name increasing
}
gethost {
set hostlist [lindex $args 0]
foreach {host port ip user client desc} $hostlist { break }
# Use the IP address (faster), if supplied.
if {$ip != ""} {
set port ${ip}:$port
} {
set port ${host}:$port
}
return $port
}
init {
busy_cursor set
set startup [lindex $args 0]
set p4(mcItem) ""
set p4(prevmcItem) ""
if {[info exists env(P4PORT)] && $env(P4PORT) != ""} {
# Check to see if this server is in our list; add it if not.
foreach {newname newport} [split $env(P4PORT) :] { break }
if {[regexp {[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+} $newname]} {
# IP address
set index 2
set newserver [list {} $newport $newname $env(P4CLIENT) $env(P4USER) {}]
} {
# host name
set index 0
set newserver [list $newname $newport {} $env(P4CLIENT) $env(P4USER) {}]
}
set found 0
foreach server $p4(servers) {
if {$env(P4PORT) == "[lindex $server $index]:[lindex $server 1]"} {
set found 1
# Reset P4PORT using IP address, if possible. It's a bit quicker.
set env(P4PORT) [p4_connectionOptions gethost $server]
p4_connectionOptions sethost $server $startup
break
}
}
if {!$found} {
lappend p4(servers) $newserver
p4_options save
}
} {
# No P4PORT: check tkp4rc servers list.
if {[llength $p4(servers)] == 1} {
# Just one server defined; use it.
p4_connectionOptions sethost [lindex $p4(servers) 0] $startup
} {
if {[llength $p4(servers)] == 0} {
set msg "Please add a Perforce server and click \"Switch To\"."
} {
set msg "Please select a Perforce server and click \"Switch To\"."
}
set env(P4PORT) ""
while {$env(P4PORT) == ""} {
set p4(HelpSection) connection
p4_options show
bell
tk_dialog .tkp4 "TkP4 - Set Perforce Server" "P4PORT environment variable not set.\n\n$msg" error 0 "OK"
tkwait variable env(P4PORT)
}
return
}
}
set p4(prevClient) $env(P4CLIENT)
set p4(prevUser) $env(P4USER)
p4_setTitle
# TTD: exec $p4(exec) client -o and parse to get the client root (and check if the client even exists).
# Or, p4 resolve -n will error-exit if the client doesn't exist.
set msg ""
if {$env(P4CLIENT) == ""} {
set msg "P4CLIENT not defined."
} {
#p4_logOptions log "Executing p4 resolve -n"
#if {[catch {exec $p4(exec) resolve -n} data] && [string first "unknown" $data] >= 0} {
# set msg "P4CLIENT \"$env(P4CLIENT)\" does not exist on this server."
#}
# p4(clientOwner) and p4(clientRoot) are set to blank if this client doesn't exist.
if {[p4_clientOptions setClientInfo] != 0} {
return
}
if {$p4(clientOwner) == ""} {
set msg "P4CLIENT \"$env(P4CLIENT)\" does not exist on this server."
}
}
set p4(treeViewPrev) ""
if {$msg == ""} {
# The current client exists.
set p4(treeView) client
if {[p4_treeOptions switch] < 0} {
return -1
}
p4_pendingChangeOptions show
p4_options save
} {
set p4(treeView) depot
if {[p4_treeOptions switch] < 0} {
return -1
}
p4_itemOptions show client force
# When we first start, p4_clientOptions selects the current client.
if {[$p4(mcListbox) curselection] == ""} {
set env(P4CLIENT) ""
p4_setTitle
}
p4_options save
bell
tk_dialog .tkp4warn "TkP4 - no client specified" "$msg\n\nPlease create a new client or switch to an existing one." error 0 "OK"
}
busy_cursor clear
}
save -
hide {
Window hide $widget(connectionOptions)
}
selection {
}
sethost {
set hostlist [lindex $args 0]
set startup [lindex $args 1]
set env(P4PORT) [p4_connectionOptions gethost $hostlist]
# Use the saved username and client, if supplied and this isn't the initial startup.
foreach {host port ip user client desc} $hostlist { break }
if {$startup == ""} {
foreach {var val} {P4USER user P4CLIENT client} {
if {[set $val] != ""} {
set env($var) [set $val]
}
}
} {
# Initial startup: let env values override the saved values.
foreach {var val} {P4USER user P4CLIENT client} {
if {$env($var) == "" && [set $val] != ""} {
set env($var) [set $val]
}
}
}
}
setStartupClient {
set force [lindex $args 0]
if {![info exists env(P4PORT)] || $env(P4PORT) == ""} {
return
}
foreach {newname newport} [split $env(P4PORT) :] { break }
if {[regexp {[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+} $newname]} {
# IP address
set index 2
} {
# host name
set index 0
}
set found 0
foreach server $p4(servers) {
if {$env(P4PORT) == "[lindex $server $index]:[lindex $server 1]"} {
set found 1
break
}
}
if {$found} {
set msg ""
set olduser [lindex $server 3]
set oldclient [lindex $server 4]
if {$env(P4USER) != "" && $olduser != $env(P4USER)} {
set msg1 " startup user from \"$olduser\" to \"$env(P4USER)\""
set newuser $env(P4USER)
} {
set msg1 ""
set newuser $olduser
}
if {$env(P4CLIENT) != "" && $oldclient != $env(P4CLIENT)} {
set msg2 " startup client from \"$oldclient\" to \"$env(P4CLIENT)\""
set newclient $env(P4CLIENT)
} {
set msg2 ""
set newclient $oldclient
}
if {"$msg1$msg2" == ""} {
return
}
if {$msg1 == "" || $msg2 == ""} {
set and ""
} {
set and "and"
}
if {$force == ""} {
bell
if {[tk_dialog .tkp4 "TkP4 - Update Startup Client " "Would you like to update the server $env(P4PORT)$msg1$and$msg2?" questhead -1 "Yes" "No"] != 0} {
return
}
}
set idx [lsearch -exact $p4(servers) $server]
set server [lreplace $server 3 4 $newuser $newclient]
set p4(servers) [lreplace $p4(servers) $idx $idx $server]
if {[winfo exists $p4(hostListbox)]} {
set idx [$p4(hostListbox) curselection]
$p4(hostListbox) delete 0 end
foreach host $p4(servers) {
$p4(hostListbox) insert end $host
}
if {$idx != ""} {
$p4(hostListbox) select set $idx
}
}
# TTD are there other instances where this should change from save to saveToFile?
p4_options saveToFile
}
}
show {
Window show $widget(connectionOptions)
if {![winfo exists $widget(HostsFrame).hosts]} {
set p4(hostListbox) [p4_mcListbox $widget(HostsFrame).hosts {{name "Host Name" 16} {port Port 9} {ip "IP Address" 17} {user User 11} {client Client 20} {desc Description 36}} desc]
}
busy_cursor set
$p4(hostListbox) delete 0 end
set p4(servers) [lsort -dictionary $p4(servers)]
set idx -1
foreach server $p4(servers) {
$p4(hostListbox) insert end $server
foreach {host port ip user client desc} $server { break }
if {"${ip}:$port" == $env(P4PORT) || "${host}:$port" == $env(P4PORT)} {
set idx [lsearch $p4(servers) $server]
}
}
if {$idx < 0} {
$p4(hostListbox) selection set 0
} {
$p4(hostListbox) selection set $idx
}
$p4(hostListbox) see $idx
busy_cursor clear
}
showContextMenu {
bell
#puts "not yet!"
}
switch {
p4_connectionOptions setStartupClient
set hostlist [$p4(hostListbox) get [$p4(hostListbox) curselection]]
p4_connectionOptions sethost $hostlist
foreach var [array names p4 cache_*] {
catch {unset p4($var)}
set item [lindex [split $var _] 1]
destroy $widget(mcListboxFrame).$item
}
p4_pendingChangeOptions invalidate
p4_connectionOptions init
}
}
}
proc {p4_createFileIcon} {icon} {
global p4files
if {[lsearch -exact [image names] $icon] >= 0} {
return $icon
}
image create photo $icon -width 24 -height 17
foreach {prefix notinclient text binary myedit myadd mydelete otheredit otheradd otherdelete mylock otherlock havehead nothead} [split $icon {}] { break }
foreach {photo x y} {notinclient 7 3 text 7 3 binary 7 3 myedit 1 1 myadd 0 1 mydelete 0 1 otheredit 18 1 otheradd 17 1 otherdelete 17 1 mylock 0 8 otherlock 18 8 havehead 10 8 nothead 11 0} {
if {[set $photo]} {
$icon copy p$photo -to $x $y
}
}
return $icon
}
proc {p4_createGetFileIcon} {opt args} {
global p4files
switch $opt {
dfile {
set dfile [lindex $args 0]
return [p4_createFileIcon [p4_getFileIconName $p4files($dfile:type) $p4files($dfile:OpenAct) $p4files($dfile:other) $p4files($dfile:ourLock) $p4files($dfile:othLock) $p4files($dfile:have) $p4files($dfile:head)]]
}
pending {
return [p4_createFileIcon [eval p4_getFileIconName $args]]
}
}
}
proc {p4_createIcons} {} {
image create photo pdepot -data {
R0lGODdhGAAMAKEAAPj8+ICAgAAAAPj8ACwAAAAAGAAMAAACPISPIRLof5YA
Q0KnVhi0Z4ZpHUeOVNYI5Wqy3NLGLsVkciyBQMBLs8QLJoI+QC4ohCCByMZl
2OQ9n0lIAQA7
}
image create photo idepot -width 24 -height 17
idepot copy pdepot -to 0 3
image create photo pfolder -data {
R0lGODdhEAANAMIAAPj8+AAAALi8uPgAAICAgAAAAAAAAAAAACwAAAAAEAAN
AAADMwgQzPpwiTFFiC+QsXtzSiCMZElqIqVWK7q+LMrOLRHAuIzPLk3rvtri
Q/wQFISkcrlMAAA7
}
image create photo ifolder -width 24 -height 17
ifolder copy pfolder -to 4 1
image create photo ptext -data {
R0lGODdhCgAMAKEAAAAAAPj8+ICAgAAAACwAAAAACgAMAAACHoR/AcGtsoSU
bzkGYJg02+ttXHVh2tSEpYcggshNBQA7
}
image create photo pbinary -data {
R0lGODdhCgAMAKEAAAAAAPj8+ICAgAAAACwAAAAACgAMAAACIIR/AcGtskQQ
9MWJAcRU6uUw31R5m4RaZDqGFoKg3SwUADs=
}
image create photo pnotinclient -data {
R0lGODdhCgAMAKEAAAAAAPj8+ICAgAAAACwAAAAACgAMAAACH0RgeBvt1kSQ
ckLX0twSVIwZ1OZdoTNWgvksyptyUwEAOw==
}
image create photo pmyadd -data {
R0lGODdhBwAIAKEAAPj8+PgAAICAgAAAACwAAAAABwAIAAACEIRjCSG6vYKc
QAhmE3PbwQIAOw==
}
image create photo potheradd -data {
R0lGODdhBwAIAKEAAPj8+AAA+ICAgAAAACwAAAAABwAIAAACEIRjCSG6vYKc
QAhmE3PbwQIAOw==
}
image create photo pmyedit -data {
R0lGODdhBgAGAKEAAPj8+PgAAICAgAAAACwAAAAABgAGAAACC4QRcokWHthS
h4ICADs=
}
image create photo potheredit -data {
R0lGODdhBgAGAKEAAPj8+AAA+ICAgAAAACwAAAAABgAGAAACC4QRcokWHthS
h4ICADs=
}
image create photo pmylock -data {
R0lGODdhBgAIAIAAAPj8+AAAACwAAAAABgAIAAACCwQSdpbrnZCctM4CADs=
}
image create photo potherlock -data {
R0lGODdhBgAIAIAAAPj8+ICAgCwAAAAABgAIAAACCwQSdpbrnZCctM4CADs=
}
image create photo pmydelete -data {
R0lGODdhBwAHAKEAAPj8+PgAAICAgAAAACwAAAAABwAHAAACD4QdEIm5GkSL
Z1Eo3pIKFAA7
}
image create photo potherdelete -data {
R0lGODdhBwAHAKEAAPj8+AAA+ICAgAAAACwAAAAABwAHAAACD4QdEIm5GkSL
Z1Eo3pIKFAA7
}
image create photo phavehead -data {
R0lGODdhBgAGAKEAAPj8+AAAAICAgAD8ACwAAAAABgAGAAACDAQSJzGD3Bxs
Cb4bCgA7
}
image create photo pnothead -data {
R0lGODdhBAANAKEAAPj8+AAAAPj8AICAgCwAAAAABAANAAACEERiIqe80eBr
44B7K5JuowIAOw==
}
image create photo pmypending -data {
R0lGODdhDgANAKEAAPj8+AAAAPgAAICAgCwAAAAADgANAAACKIQfpxsSs1QT
LiLqYJz4bUx5EthpBgeKAEqKbAq96RPU9m1Dw873fAEAOw==
}
image create photo pyourpending -data {
R0lGODdhDgANAMIAAPj8+AAAAAAA+ICAgPgAAPgA+AAAAAAAACwAAAAADgAN
AAADLgi6sf5BhPFcJLIyTKYOnNBRkGh6lhmiCqiKrFu8Y0uf1HV3U+D/wB9l
QCwaiwkAOw==
}
image create photo potherpending -data {
R0lGODdhDgANAKEAAPj8+AAAAAAA+ICAgCwAAAAADgANAAACKIQfpxsSs1QT
LiLqYJz4bUx5EthpBgeKAEqKbAq96RPU9m1Dw873fAEAOw==
}
image create photo pthispending -data {
R0lGODdhGAAOAMIAAPj8+AAAALi8uPgAAICAgAAAAAAAAAAAACwAAAAAGAAO
AAADUAgKsf7wNTWjZWJWdl3IzFBt2/IJWSBSIBWd2SA3n7Z6KKrOMH2buZ1M
FBSOcrEhTKc0BZ7CGTL6AxAIUCgy2YxcsVnqrKP4hrME8uPLJiQAADs=
}
image create photo pthosepending -data {
R0lGODdhGAAOAMIAAPj8+AAAAAD8+AAA+ICAgAAAAAAAAAAAACwAAAAAGAAO
AAADUAgKsf7wNTWjZWJWdl3IzFBt2/IJWSBSIBWd2SA3n7Z6KKrOMH2buZ1M
FBSOcrEhTKc0BZ7CGTL6AxAIUCgy2YxcsVnqrKP4hrME8uPLJiQAADs=
}
}
proc {p4_debugMsg} {msg} {
global env
if {[info exists env(TKP4DEBUG)]} {
puts $msg
}
}
proc {p4_diffDepot} {vv {rev {}}} {
global p4 widget env
busy_cursor set
set file [string trim [lindex [split $vv #] 0]]
p4_runCommand run "$p4(exec) diff $file$rev"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
set text [join $p4(runcmdOutput) \n]
p4_viewDialog show "Diff editted client with depot version for $file" $text
busy_cursor clear
}
proc {p4_diffmergeOptions} {opt args} {
global p4 widget env
switch $opt {
save -
hide {
Window hide $widget(diffmergeOptions)
}
show {
Window show $widget(diffmergeOptions)
}
}
}
proc {p4_displayOptions} {opt args} {
global p4 widget env
switch $opt {
save -
hide {
Window hide $widget(displayOptions)
}
show {
Window show $widget(displayOptions)
}
}
}
proc {p4_editviewOptions} {opt args} {
global p4 widget env
switch $opt {
save -
hide {
Window hide $widget(editviewOptions)
}
show {
Window show $widget(editviewOptions)
}
}
}
proc {p4_entryDialog} {label {cancel Cancel} {initial_value {}} {blankok 1} {master .}} {
global p4_entryDialog_Done p4 widget
set p4_entryDialog_Done 0
set t $widget(EntryDialog)
if {![winfo exists $t]} {
# We create and hide the window to do the geometry calculations below.
# (also to get around a bug in Hummingbird eXceed to update the wm title)
Window show $t
bind $widget(EntryDialogEntry) <KeyPress-Return> "set p4_entryDialog_Done 1"
wm withdraw $t
update
}
$widget(EntryDialogLabel) config -text $label
wm title $widget(EntryDialog) "TkP4 - New $label name"
# Center the dialog over the master
wm geometry $t +[expr [winfo rootx $master] + ([winfo width $master] - [winfo reqwidth $t]) / 2]+[expr [winfo rooty $master] + ([winfo height $master] - [winfo reqheight $t]) / 2]
wm deiconify $t
wm transient $t $master
grab $t
focus $widget(EntryDialogEntry)
$widget(EntryDialogEntry) delete 0 end
$widget(EntryDialogEntry) insert 0 $initial_value
set done 0
while {$done == 0} {
# The raise causes a few seconds delay second time through the loop (when blank entered).
# The combination of the update and after commands seems to get around this wierdness.
#grab $t
update idletasks
after 10
raise $t
tkwait variable p4_entryDialog_Done
#grab release $t
set text [string trim [$widget(EntryDialogEntry) get]]
if {$p4_entryDialog_Done != -1 && !$blankok && $text == ""} {
$widget(EntryDialogEntry) delete 0 end
set msg "Blank entered!\n\nYou must enter a value."
bell
tk_dialog .tkp4err "TkP4 Error" $msg "error" 0 "OK"
set done 0
} {
set done 1
}
}
grab release $t
Window hide $t
update idletasks
if {$p4_entryDialog_Done == -1} {
error "$text"
}
return $text
}
proc {p4_exit} {} {
p4_connectionOptions setStartupClient
exit
}
proc {p4_externalCommand} {opt args} {
global p4
switch $opt {
commandPrompt {
#puts "args=$args clientRoot=$p4(clientRoot)"
if {[lindex $args 0] == $p4(clientRoot)} {
set dir $p4(clientRoot)
} {
p4_runCommand run "$p4(exec) where [lrange $args 0 0]"
tkwait variable p4(runcmdDone)
#puts cmdout=$p4(runcmdOutput)
set loc [lindex $p4(runcmdOutput) end]
#puts loc=$loc
if {[string first "not in client" $loc] >= 0} {
set dir $p4(clientRoot)
} {
set dir [file dirname [lindex [split $loc] end]]
}
}
#puts dir=$dir
cd $dir
exec xterm -ls &
}
}
}
proc {p4_fileGetText} {file} {
if {[catch {open $file r} fin]} {
return ""
}
set text [read $fin]
close $fin
return [string trimright $text "\n"]
}
proc {p4_fileInfo} {opt args} {
global p4 p4files widget env
switch $opt {
openedDescribe {
}
openedSelection {
set c1 ""
set c2 ""
set idx [$widget(FileInfo_OpenedBy) curselection]
if {$idx != ""} {
regexp {([^ ]*)@([^ ]*) - ([^ ]*) ([^ ]*)} [$widget(FileInfo_OpenedBy) get $idx] match user client c1 c2
}
if {$c1 != "change"} {
$widget(FileInfo_Describe) config -state disabled
} {
if {"$user@$client" == "$env(P4USER)@$env(P4CLIENT)"} {
set editbutton editbutton
} {
set editbutton noeditbutton
}
$widget(FileInfo_Describe) config -state normal -command "p4_changeOptions view $c2 {} pending $editbutton noprevnext noshowdiffs"
}
}
show {
set v [lindex $args 0]
set file [string trim [lindex [split $v #] 0]]
Window show $widget(FileInfo)
$widget(FileInfo_Describe) config -state disabled
$widget(FileInfo_LockedBy) config -state normal
$widget(FileInfo_LockedBy) delete 0 end
$widget(FileInfo_OpenedBy) delete 0 end
# This is for Properties enabled in pending pane.
if {![info exists p4files($file:cfile)]} {
p4_runCommand fstat [list $file]
tkwait variable p4(runcmdDone)
}
p4_runCommand run "$p4(exec) opened -a [list $file]"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
# No need to return; just keep going!
} {
set rep $p4(runcmdOutput)
if {[string first "not opened" $rep] < 0} {
set openedby ""
foreach line $rep {
regexp {[^ ]* - ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) by ([^ ]*)(.*)} $line match a b c d user l
lappend openedby "$user - $b $c ($a)"
if {[string first "locked" $l] >= 0} {
$widget(FileInfo_LockedBy) insert 0 $user
}
}
eval $widget(FileInfo_OpenedBy) insert end [lsort -dictionary $openedby]
}
}
$widget(FileInfo_LockedBy) config -state disabled
foreach {var alias} {dfile DepotPath cfile ClientPath act HeadAction head HeadRevision type FileType have HaveRevision chng HeadChange} {
$widget(FileInfo_$alias) config -state normal
$widget(FileInfo_$alias) delete 0 end
# The trim is for Window backslashes in the cfile name, which causes quoting.
$widget(FileInfo_$alias) insert 0 [string trim $p4files($file:$var) "\{\}"]
$widget(FileInfo_$alias) config -state disabled
}
if {$p4files($file:cfile) == ""} {
$widget(FileInfo_ClientPath) config -state normal
$widget(FileInfo_ClientPath) insert 0 "not in client view"
$widget(FileInfo_ClientPath) config -state disabled
}
$widget(FileInfo_LastModTime) config -state normal
$widget(FileInfo_LastModTime) delete 0 end
if {$p4files($file:time) != 0} {
$widget(FileInfo_LastModTime) insert 0 [clock format $p4files($file:time) -format "%Y/%m/%d %H:%M:%S"]
}
$widget(FileInfo_LastModTime) config -state disabled
}
hide {
Window hide $widget(FileInfo)
}
}
}
proc {p4_findFiles} {parent specs} {
set files ""
foreach file $specs {
set path [file join $parent $file]
if {[file isdirectory $path]} {
set files [concat $files [p4_findFiles $path [glob -nocomplain [file join $path "*"]]]]
} {
if {[string first "@" $path] < 0} {
# Perforce assumes "@" is a changelist number, so we can't have them in file names.
set files [concat $files [list $path]]
}
}
}
return $files
}
proc {p4_fontOptions} {opt args} {
global p4 widget env
switch $opt {
save -
hide {
Window hide $widget(fontOptions)
}
show {
Window show $widget(fontOptions)
}
}
}
proc {p4_getFileIconName} {type OpenAct other ourLock othLock have head} {
global p4files
# fields: notinclient, text, binary,
# myedit, myadd, mydelete, otheredit, otheradd, otherdelete,
# mylock, otherlock, havehead, nothead.
#puts "type=$type OpenAct=$OpenAct other=$other ourLock=$ourLock othLock=$othLock have=$have head=$head"
set icon i
if {$type == "unknown"} {
append icon 100
} {
append icon 0
if {[string first "text" $type] >= 0} {
append icon 10
} {
append icon 01
}
}
if {[lsearch -exact "edit integrate" $OpenAct] >= 0} {
append icon 1
} {
append icon 0
}
if {[lsearch -exact "add branch" $OpenAct] >= 0} {
append icon 1
} {
append icon 0
}
if {$OpenAct == "delete"} {
append icon 1
} {
append icon 0
}
if {[lsearch -regexp $other {otherAction[0-9]* edit}] >= 0 || [lsearch -regexp $other {otherAction[0-9]* integrate}] >= 0} {
append icon 1
} {
append icon 0
}
if {[lsearch -regexp $other {otherAction[0-9]* add}] >= 0 || [lsearch -regexp $other {otherAction[0-9]* branch}] >= 0} {
append icon 1
} {
append icon 0
}
if {[lsearch -regexp $other {otherAction[0-9]* delete}] >= 0} {
append icon 1
} {
append icon 0
}
if {$ourLock} {
append icon 1
} {
append icon 0
}
if {$othLock} {
append icon 1
} {
append icon 0
}
if {$have == 0} {
append icon 00
} elseif {$have == $head} {
append icon 10
} {
append icon 01
}
return $icon
}
proc {p4_getNewName} {item} {
global p4 widget
set done 0
set itemname ""
while {!$done} {
if {[catch {p4_entryDialog $item Cancel $itemname 0 $widget(tkp4)} itemname]} {
# User cancel
return ""
}
# Make sure this itemname doesn't already exist
p4_itemOptions get $item $itemname
if {[string first \nUpdate: $p4(itemText)] < 0} {
set done 1
} {
set rep [tk_dialog .tkp4name "TkP4 - $item name conflict" "$item $itemname already exists." info -1 "Cancel" "Choose another name" "Edit existing $item: $itemname"]
switch $rep {
0 {
return ""
}
2 {
set done 1
}
}
}
}
return $itemname
}
proc {p4_help} {opt args} {
global p4 widget
switch $opt {
about {
if {[catch {info nameofexecutable} nameofexecutable]} {
set nameofexecutable wish
}
set text "\n Tkp4 version $p4(TkP4version) by Rick Macdonald <rickm@vsl.com>\n\n $p4(usage)\n\n You are running $nameofexecutable patchlevel [info patchlevel].\n\n Perforce p4 client version:\n\n [join [split [exec $p4(exec) -V] \n] "\n "]"
p4_viewDialog show "TkP4 - About" $text
}
AutoResolve {
p4_viewDialog show "TkP4 - Auto Resolve Help" {
===============
Resolving Files (from P4Win 2001.1/23704)
===============
File conflicts can occur when a user attempts to integrate a file or
to submit a changelist containing a file that another user has
edited. When the conflict occurs, Perforce schedules the file for
resolve. Conflicts must be resolved before the changelist that
contains the conflicting file can be successfully submitted.
The files you work with when resolving are described in PERFORCE as follows:
yours: your changes to the file 1n the client workspace
theirs: the parallel changes that have been made in the depot
base: the common ancestor file
To resolve files manually:
=========================
1. Click the file and choose File>Resolve>Interactively. The Resolve
File (3-way merge) dialog is displayed.
2. Select the file you want to submit, or use the merge utility to
compare the two file versions with their common ancestor. The merge
utility enables you to select specific passages or edit the results to
create a merged version of the file.
3. To edit Your file, click the Edit button under the file name.
4. To select the file you want to submit to the depot, click the
corresponding button, as follows:
- To accept the merged file, click Accept Merged.
- If you edited Your file, click Accept Edited to submit the edited
version. (This button is enabled only if you edited Your file.)
To resolve files automatically:
==============================
1. Click the file and choose File>Resolve> Auto-Resolve.... The
Auto-Resolve... dialog is displayed.
2. Click the Resolve Type radio button that specifies how you want to
resolve the files, as follows:
Option Description
------------- -----------
Accept Theirs Accept their file as the head revision of the file.
(-at) Note that this option overwrites your file on the
client workspace.
Accept Yours Accept your file as the most current version of the
(-ay) file.
Safe Automatic If either your file, or their file (but not both files)
Resolve are different from the base file, accept the differing
(-as) version of the file as the head revision. If both files
are different from base file, do not perform a resolve
on this file.
Automatic Resolve If their file is identical to the base file, accept
(-am) your file as the head revision. If your file is
identical to the base file, accept their file as the
head revision. If your file and their file are both
different from the base file, but there are no
conflicts between yours and their file, accept a merge
of the two files as the head revision. Otherwise, if
there are conflicts between your file and their file,
do not perform resolve on this file.
Automatic Resolve, Accept the merged file as the head revision regardless
Including Conflict of the status of yours and their files. If conflicts
Markers are found in the two file versions, the conflicts are
(-af) marked and retained. The file must then be edited
manually to eliminate the conflicts.
Re-resolve previously resolved but unsubmitted files (-f)
The -f flag allows previously resolved files to be resolved again.
Normally, once files have been resolved then 'p4 resolve' won't
display them again. This is the proper way to re-edit files if the
results of an initial 'p4 resolve' are not satisfactory.
Attempt textual merge of binary files (-t)
The -t flag forces 'p4 resolve' to attempt a textual merge, even
for files with non-text (binary) types.
3. Click OK to perform the resolve.
To manually schedule a file for resolve:
=======================================
1. Display the changelist that contains the file.
2. In the changelist's file list, right-click the file and choose
File>Resolve>Schedule for Resolve from the context menu.
Note: you only need to manually schedule resolve if you have a file
open at a previous (non-head) revision. Manually scheduling resolve
reopens files at their head revision.
} $widget(AutoResolve)
#p4_help resolve $widget(AutoResolve)
}
changes {
p4_viewDialog show "TkP4 - Changes" [p4_fileGetText [file join $p4(libdir) CHANGES]]
}
filetypes {
eval p4_help gethelp filetypes $args
}
gethelp {
set grab [grab current]
set help [lindex $args 0]
set top [lindex $args 1]
set temp [lindex $args 2]
p4_runCommand run "$p4(exec) help $help"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
return
}
if {$grab != ""} {
grab $grab
}
p4_viewDialog show "TkP4 - $help Help" [join $p4(runcmdOutput) \n] $top $temp
}
getintegrating {
return {
===========================================
Integrating files into codelines (branches)
===========================================
Integration enables you to branch new files from existing ones and to
merge changes between branched files. There are two ways to integrate
files:
File specification: you specify the source and target files when
you open files for integrate.
Branch specification: you select a branch specification when you open
files for integrate. The branch specification
identifies the source and target files.
If you open existing files to integrate to merge changes into them,
you must resolve the files before you can submit them. For details,
see Resolving files.
To branch new files using a file specification:
==============================================
1. In the left pane, select the folders and files you want to
integrate.
2. Right-click and choose Integrate>Using Filespec... from the context
menu.
3. In the Target Filespec field, specify the location where you want
the branched files to be created.
4. Using the Open file(s) under Changelist field, specify the
changelist you want to use for the opened files.
5. Click OK. The files are added to the specified changelist.
6. To branch the files, submit the changelist.
For details about integration options, see Specifying file integration
options.
To branch new files using a branch specification:
================================================
1. In the left pane, select the folders and files you want to
integrate.
2. Right-click and choose Integrate>Using Branchspec... from the
context menu. The File Integrate - Select Branchspec dialog is
displayed.
3. Click the branch specification you want to use, then click
Next. The File Integrate using Branchspec dialog is displayed.
4. To restrict the list of files to be integrated, edit the entries in
the File Specifications list.
5. Using the Open file(s) under Changelist field, specify the
changelist you want to use for the opened files.
6. Click Finish. The files are added to the specified changelist.
7. To branch the files, submit the changelist.
}
}
getintegrateOptions {
return {
===================================
Specifying file integration options
===================================
You can specify the following options:
Integration options
-------------------
Force reintegration of all source files even if some are already integrated:
Requires all revisions of the source files to be resolved,
regardless of whether the revision has already been integrated.
Do not copy new files to workspace:
Create virtual copies in your workspace when creating a codeline
(branch).
Delete source file(s), for rename operation:
Open source file for delete at the same time as opening the target
file for integration from the source file.
Permit deletes/re-adds:
Allow an integration that opens the target file for delete when
the source file has been deleted, and allow an integration that
branches a new target files that was previously deleted.
Enable baseless merges:
Allow merging to target files that were not branched from the
selected source files.
Revision range options
----------------------
Enables you to specify the range of source file revisions to be
integrated. You can specify a revision number, changelist number,
label, or date.
}
}
integrateOptions {
p4_viewDialog show "TkP4 - Integrate Options Help" "[p4_help getintegrateOptions]\n[p4_help getintegrating]"
}
integrating {
p4_viewDialog show "TkP4 - Integrating Help" [p4_help getintegrating]
}
p4winDifferences {
p4_viewDialog show "TkP4 - P4Win Differences" [p4_fileGetText [file join $p4(libdir) P4WINdifferences]]
}
resolve {
eval p4_help gethelp resolve $args
}
using {
p4_viewDialog show "TkP4 - Using" [p4_fileGetText [file join $p4(libdir) UsingTkP4]]
}
}
}
proc {p4_integrate} {opt args} {
global p4 widget env p4pending
switch $opt {
allsubset {
$widget(integrate_branchText) config -state normal
if {[lindex $args 0] == "clear"} {
$widget(integrate_branchText) delete 1.0 end
}
if {$p4(integrate_branchAllSubset) == "all"} {
$widget(integrate_branchText) config -background grey85 -state disabled
} {
$widget(integrate_branchText) config -background white -state normal
}
}
back {
Window hide $widget(integrate)
Window show $widget(integrate_branchSpec)
}
branchCancel {
Window hide $widget(integrate_branchSpec)
}
branchHelp {
p4_help integrating
}
branchNext {
set idx [$p4(bsListbox) curselection]
if {$idx == ""} {
bell
tk_dialog .tkp4 "TkP4 - Integrate Branch" "Please select a Branch." error 0 "OK"
return
}
set p4(integrate_branchName) [lindex [$p4(bsListbox) get $idx] 0]
if {[p4_integrate getBranchSpec] < 0} {
return
}
Window hide $widget(integrate_branchSpec)
eval p4_integrate showbranch2 $p4(integrate_branchargs)
}
cancel {
Window hide $widget(integrate)
}
getBranchSpec {
if {[p4_itemOptions get branch $p4(integrate_branchName)] < 0} {
return -1
}
if {[p4_itemOptions getSpec branch] < 0} {
return -1
}
return 0
}
help {
p4_help integrateOptions
}
isActive {
if {([winfo exists $widget(integrate_branchSpec)] && [winfo viewable $widget(integrate_branchSpec)]) || ([winfo exists $widget(integrate)] && [winfo viewable $widget(integrate)])} {
return 1
} {
return 0
}
}
ok {
set p4(integratePreview) ""
if {[p4_integrate run] == 0} {
Window hide $widget(integrate)
}
}
preview {
set p4(integratePreview) "Integrate preview: "
p4_integrate run
}
run {
if {$p4(integrate_mode) == "branch"} {
set sourcefilestemp [string trim [$widget(integrate_branchText) get 1.0 end]]
foreach file $sourcefilestemp {
lappend files1 "//..."
lappend files2 [string trim $file]
}
if {$p4(integrate_branchToFrom) == "to"} {
set sourcefiles $files1
set targetfiles $files2
} {
set sourcefiles $files2
set targetfiles $files1
}
} elseif {$p4(integrate_mode) == "using"} {
if {$p4(integrate_branchAllSubset) == "all"} {
set sourcefiles "."
set targetfiles "."
} {
set sourcefiles ""
set targetfiles ""
set sourcefilestemp [string trim [$widget(integrate_branchText) get 1.0 end]]
if {$sourcefilestemp == ""} {
bell
tk_dialog .tkp4 "TkP4 - Integrate Branch" "Please enter something for \"Subset of Files\" or choose \"All Files\"." error 0 "OK"
return -1
}
foreach file $sourcefilestemp {
lappend sourcefiles [string trim $file]
lappend targetfiles ""
}
}
} {
set sourcefilestemp [split [string trim [$widget(integrate_sourceText) get 1.0 end]] \n]
set targetfilestemp [string trim [$widget(integrate_filespecEntry) get]]
#puts sourcefilestemp=$sourcefilestemp
#puts targetfilestemp=$targetfilestemp
if {[string range $targetfilestemp [expr [string length $targetfilestemp] - 4] end] == "/..."} {
set targetspecbase [string range $targetfilestemp 0 [expr [string length $targetfilestemp] - 5]]
set wildcardtarget 1
} {
set wildcardtarget 0
}
if {[llength $sourcefilestemp] > 1} {
if {! $wildcardtarget} {
bell
tk_dialog .tkp4 "TkP4 - Integrate Options" "Target Filespec must end in wildcard '/...' when multiple source filespecs are provided." error 0 "OK"
return -1
}
}
foreach file $sourcefilestemp {
lappend sourcefiles [string trim $file]
if {! $wildcardtarget} {
lappend targetfiles [string trim $targetfilestemp]
} {
# [file join] doesn't like the double slash in //depot...
#lappend targetfiles [file join $targetspecbase [file tail [string trim $file]]]
lappend targetfiles "$targetspecbase/[file tail [string trim $file]]"
}
}
}
foreach {which title1} {start Starting end Ending} {
foreach {o title2} {number "Revision Number" other "Other"} {
set p4(integrate_${which}$o) [string trim $p4(integrate_${which}$o)]
if {$p4(integrate_${which}Mode) == $o && $p4(integrate_${which}$o) == ""} {
bell
tk_dialog .tkp4 "TkP4 - Integrate Options" "You must enter a value for \"$title1 $title2\"." error 0 "OK"
return -1
}
}
}
if {$p4(integrate_startMode) == "first"} {
if {$p4(integrate_endMode) == "last"} {
set rev ""
} elseif {$p4(integrate_endMode) == "number"} {
set rev "#$p4(integrate_endnumber)"
} {
set rev "@$p4(integrate_endother)"
}
} elseif {$p4(integrate_startMode) == "number"} {
if {$p4(integrate_endMode) == "last"} {
set rev "#$p4(integrate_startnumber),#head"
} elseif {$p4(integrate_endMode) == "number"} {
set rev "#$p4(integrate_startnumber),#$p4(integrate_endnumber)"
} {
set rev "#$p4(integrate_startnumber),@$p4(integrate_endother)"
}
} {
if {$p4(integrate_endMode) == "last"} {
set rev "@$p4(integrate_startother),#head"
} elseif {$p4(integrate_endMode) == "number"} {
set rev "@$p4(integrate_startother),#$p4(integrate_endnumber)"
} {
set rev "@$p4(integrate_startother),@$p4(integrate_endother)"
}
}
set done 0
set syncfirst 0
if {$p4(integratePreview) == "" && $p4(integrate_syncFirst)} {
set p4(integratePreview) "Integrate preview: "
set syncfirst 1
}
while {! $done} {
set parms ""
if {[string first "Change " $p4(integrate_changelist)] == 0} {
regexp {Change ([0-9]*)} $p4(integrate_changelist) match chng
append parms "-c $chng"
}
if {$p4(integrate_mode) == "using" && $p4(integrate_reverse)} {
append parms " -r"
}
foreach o {v d i f} {
if {$p4(integrate_opt_$o)} {
append parms " -$o"
}
}
if {$p4(integratePreview) != ""} {
append parms " -n"
}
if {$p4(integrate_mode) == "branch" || $p4(integrate_mode) == "using"} {
append parms " -b $p4(integrate_branchName)"
}
if {$p4(integrate_mode) == "branch"} {
append parms " -s"
}
set parms [string trim $parms]
set p4(integrate_files) ""
foreach file $sourcefiles target $targetfiles {
if {$file == "."} {
set file ""
set target ""
}
p4_runCommand checkout integrate "$file$rev $target" [list [Tree:joinnodes $widget(pendingCanvas) $p4pending(Changelists_myclient) $p4(integrate_changelist)]] $parms
tkwait variable p4(runcmdDone)
p4_debugMsg "integrate output: [array get p4 runcmd*]"
#if {$p4(runcmdWarning) > 0 || $p4(runcmdDone) < 0 } {
# bell
# tk_dialog .tkp4 "TkP4 - integrate error" "Errors occurred trying to integrate:\n\n[join [lrange $p4(runcmdErrors) 0 3] \n\n]" error 0 "OK"
# return -1
#}
}
if {$syncfirst} {
set p4(integratePreview) ""
set syncfirst 0
if {$p4(integrate_files) != ""} {
busy_cursor set
p4_runCommand sync {} {} {} $p4(integrate_files)
tkwait variable p4(runcmdDone)
busy_cursor clear
}
} {
set done 1
}
}
return 0
}
setrevision {
set which [lindex $args 0]
foreach w {number other} {
$widget(integrate_$which$w) config -background grey85 -state disabled
}
if {[lsearch {first last} $p4(integrate_${which}Mode)] < 0} {
$widget(integrate_${which}$p4(integrate_${which}Mode)) config -background white -state normal
}
}
show {
Window show $widget(integrate)
set cb $widget(integrate_changelistComboFrame).combo
if {![winfo exists $cb]} {
combobox $cb -textvariable p4(integrate_changelist) -editable 0
pack $cb -side left
}
$cb list delete 0 end
#puts changelists=$p4pending(Changelists)
#puts args=$args
eval $cb list insert end $p4pending(Changelists)
set p4(integrate_changelist) [lindex $p4pending(Changelists) 0]
$cb config -width $p4pending(Changelists_width)
# p4win resets all these values, but let's not for now!
#foreach {which o} {start first end last} {
# set p4(integrate_${which}Mode) $o
# p4_integrate setrevision $which
#}
#set p4(integrate_startnumber) ""
#set p4(integrate_startother) ""
#set p4(integrate_endnumber) ""
#set p4(integrate_endother) ""
}
showbranch {
set p4(integrate_branchargs) $args
set p4(integrate_mode) branch
Window show $widget(integrate_branchSpec)
if {![winfo exists $widget(integrate_BranchMcFrame).branches]} {
set p4(bsListbox) [p4_mcListbox $widget(integrate_BranchMcFrame).branches {{branch Branch 24} {date Date 11} {desc Description 24}} desc]
}
p4_branchOptions show $p4(bsListbox)
$p4(bsListbox) selection set 0
$p4(bsListbox) see 0
}
showbranch2 {
array set fields [lindex $p4(itemSpecs) [lsearch $p4(itemSpecs) "name View*"]]
set view $fields(data)
set p4(integrate_sourceHeading) "Branch View"
eval p4_integrate show $args
wm title $widget(integrate) "TkP4 - File Integrate using Branchspec $p4(integrate_branchName)"
pack forget $widget(integrate_reverse)
pack $widget(integrate_targetFrame2) -expand 1 -fill both
$widget(integrate_sourceText) config -state normal
$widget(integrate_sourceText) delete 1.0 end
$widget(integrate_sourceText) insert end $view
$widget(integrate_sourceText) config -state disabled -background grey85
pack forget $widget(integrate_filespecFrame)
pack forget $widget(integrate_branchFrame)
pack forget $widget(integrate_usingFrame)
pack $widget(integrate_branchFrame) -side left
set p4(integrate_branchToFrom) to
pack forget $widget(integrate_filespecEntry)
pack forget $widget(integrate_branchTextFrame)
pack $widget(integrate_branchTextFrame) -side left -expand 1 -fill both
$widget(integrate_branchText) config -background white -state normal
$widget(integrate_branchText) delete 1.0 end
set vv [string trim [lindex [split [lindex [lindex $args 0] 0] #] 0]]
$widget(integrate_branchText) insert end $vv
pack forget $widget(integrate_optRename)
#pack $widget(integrate_back) -before $widget(integrate_ok) -side left
$widget(integrate_back) config -relief raised -text "< Back" -state normal
}
showUsingBranch {
set p4(integrate_branchargs) ""
set p4(integrate_mode) using
set p4(integrate_branchName) [lindex $args 0]
if {[p4_integrate getBranchSpec] < 0} {
return
}
p4_integrate showbranch2
wm title $widget(integrate) "TkP4 - File Integrate using Branchspec $p4(integrate_branchName)"
pack $widget(integrate_reverse) -side left -padx 64
pack forget $widget(integrate_branchFrame)
pack $widget(integrate_usingFrame) -side left
set p4(integrate_branchAllSubset) all
p4_integrate allsubset clear
$widget(integrate_back) config -relief flat -text "" -state disabled
#TTD ...etc...
}
showfile {
set p4(integrate_mode) file
set p4(integrate_sourceHeading) "Source Filespec"
eval p4_integrate show $args
wm title $widget(integrate) "TkP4 - File Integrate - Edit Filespecs"
pack forget $widget(integrate_reverse)
pack $widget(integrate_targetFrame2) -expand 0 -fill x
$widget(integrate_sourceText) config -state normal -background white
pack forget $widget(integrate_filespecFrame)
pack forget $widget(integrate_branchFrame)
pack forget $widget(integrate_usingFrame)
pack $widget(integrate_filespecFrame) -side left
$widget(integrate_sourceText) delete 1.0 end
foreach f [lindex $args 1] {
$widget(integrate_sourceText) insert end [string trim [lindex [split $f #] 0]]
}
pack forget $widget(integrate_filespecEntry)
pack forget $widget(integrate_branchTextFrame)
pack $widget(integrate_filespecEntry) -side left -expand 1 -fill both
pack $widget(integrate_optRename) -anchor nw
$widget(integrate_filespecEntry) delete 0 end
$widget(integrate_filespecEntry) insert 0 [lindex [lindex $args 0] 0]/...
$widget(integrate_back) config -relief flat -text "" -state disabled
}
}
}
proc {p4_itemOptions} {opt {item {}} {itemname {}} args} {
global p4 widget env
switch $opt {
cancel {
# Check for changes before cancelling.
if {[p4_itemOptions checkIfChanged] > 0} {
bell
if {[tk_dialog .tkp4 "TkP4 - Cancel edit" "Discard changes?" questhead -1 "Discard" "Return to edit"] != 0} {
update idletasks
after 10
raise $widget(itemSpecWindow)
return
}
}
grab release $widget(itemSpecWindow)
p4_itemOptions hide
}
checkIfChanged {
foreach spec $p4(itemSpecs) {
catch {unset fields}
array set fields $spec
if {$fields(inform) >= 0} {
if {$fields(widget) == "entry"} {
if {$fields(data) != [string trim $p4($p4(itemSpec)Edit_$fields(name)_value)]} {
return 1
}
} elseif {$fields(widget) == "checkbutton"} {
foreach option $fields(options) val [split $fields(data)] {
foreach {onvalue offvalue} [split $option] { break }
if {$val != $p4($p4(itemSpec)Edit_$fields(name)_${onvalue}_value)} {
return 1
}
}
} elseif {$fields(widget) == "radiobutton"} {
if {$fields(data) != $p4($p4(itemSpec)Edit_$fields(name)_value)} {
return 1
}
} elseif {$fields(widget) == "text"} {
if {$fields(name) == "Files"} {
set text ""
foreach file [array names p4 changeEdit_Files_b*] {
if {$p4($file) != ""} {
append text "$p4($file)\n"
}
}
set text [string trim $text]
} {
set text [string trim [$widget($p4(itemSpec)Edit_$fields(name)_text) get 1.0 end]]
}
if {$fields(data) != $text} {
return 1
}
} {
bell
tk_dialog .tkp4 "TkP4 - edit error" "Internal error; can't continue. No cancel check for $fields(widget)." error 0 "OK"
return -1
}
}
}
return 0
}
delete {
if {[tk_dialog .tkp4 "TkP4 - Delete $item $itemname" "Delete $item $itemname?" questhead -1 "Delete" "Cancel"] != 0} {
return
}
busy_cursor set
if {$item == "user"} {
# Don't use -f; it only works for superusers.
set f " -f"
set f ""
} {
set f ""
}
p4_runCommand run "$p4(exec) $item$f -d $itemname"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
p4_logOptions note "[join $p4(runcmdOutput) \n]"
p4_mcOptions refresh $p4(mcListbox)
busy_cursor clear
}
describe {
# This is for double-clicking in the mcListboxes.
# x,y are the coordinates relative to the upper-left corner of the
# listbox; rootx,rooty are screen coordinates (for knowing where
# to place the menu). w is the name of the mclistbox widget that was
# clicked on.
foreach {w x y rootx rooty} $args { break }
# ask the widget what row this is
set idx [$w nearest $y]
if {$idx < 0} {
return
}
if {$item == "" || $item == "dummy"} {
set item $p4(mcItem)
}
set itemname [lindex [$w get $idx] 0]
#puts "$itemname (idx $idx): [$w get $idx]"
p4_itemOptions view $item $itemname
}
edit {
if {$item == "change"} {
p4_changeOptions edit $itemname submitted
return
}
set doneget [lindex $args 0]
if {$doneget == "" && [p4_itemOptions get $item $itemname] < 0} {
return
}
if {[p4_itemOptions getSpec $item] < 0} {
return
}
# Just in case we were called from the view window.
p4_itemOptions viewhide
set widget(itemSpecWindow) .s_${item}
if {$item == "user"} {
set editable {Email FullName JobView Reviews}
} {
set editable {Description Files Host LineEnd Options Owner Root Status User View}
}
p4_itemSpecEditWindow $widget(itemSpecWindow) $item $p4(itemSpecs) $editable
catch {grab $widget(itemSpecWindow)}
}
get {
busy_cursor set
set force [lindex $args 0]
p4_runCommand run "$p4(exec) $item -o$force $itemname"
tkwait variable p4(runcmdDone)
set p4(itemSpec) $item
set p4(itemText) [join $p4(runcmdOutput) \n]
if {$p4(runcmdDone) < 0 || [string first "You don't have permission" $p4(itemText)] >= 0} {
busy_cursor clear
return -1
}
p4_itemOptions split
busy_cursor clear
return 0
}
getEditState {
switch $item {
client {
if {$itemname != $env(P4CLIENT)} {
set state disabled
} {
set state normal
}
}
user {
if {$itemname != $env(P4USER)} {
set state disabled
} {
set state normal
}
}
default {
set state normal
}
}
if {[p4_integrate isActive]} {
set state disabled
}
return $state
}
getFormFields {
set text ""
foreach spec $p4(itemSpecs) {
catch {unset fields}
array set fields $spec
if {$fields(inform) >= 0} {
if {$fields(widget) == "entry"} {
append text "$fields(name): $p4($p4(itemSpec)Edit_$fields(name)_value)\n"
} elseif {$fields(widget) == "checkbutton"} {
append text "$fields(name):"
foreach option $fields(options) val [split $fields(data)] {
foreach {onvalue offvalue} [split $option] { break }
append text " $p4($p4(itemSpec)Edit_$fields(name)_${onvalue}_value)"
}
append text "\n"
} elseif {$fields(widget) == "radiobutton"} {
append text "$fields(name): $p4($p4(itemSpec)Edit_$fields(name)_value)\n"
} elseif {$fields(widget) == "text"} {
if {$fields(name) == "Files"} {
set nfiles 0
append text "$fields(name):\n"
foreach file [array names p4 changeEdit_Files_b*] {
if {$p4($file) != ""} {
append text "\t$p4($file)\n"
incr nfiles
}
}
set p4(changeEdit_Files_newnfiles) $nfiles
} {
append text "$fields(name):\n\t[join [split [string trim [$widget($p4(itemSpec)Edit_$fields(name)_text) get 1.0 end]] \n] \n\t]\n"
}
} {
bell
tk_dialog .tkp4 "TkP4 - edit error" "Internal error; can't continue. No getFormFields for $fields(widget)." error 0 "OK"
return -1
}
}
}
return $text
}
getSpec {
set entries {Access Branch Change Client Date Email FullName Host Job JobView Label Owner Root Update User}
set texts {Description Files Reviews View}
set checkbuttons {Options}
set radiobuttons1 {Status}
set radiobuttons2 {LineEnd}
set omits {Jobs Password}
set spec [split $p4(itemText) \n]
set next [lsearch -regexp $spec {^# }]
set field [lrange $spec $next $next]
set left [lrange $spec [incr next] end]
while {$left != ""} {
# Append any description continuation lines to field list.
while {[lsearch -regexp $left {^# }] == 0} {
lappend field [lindex $left 0]
set left [lrange $left 1 end]
}
#puts "field=$field"
# Extract the field name and first line of description.
regexp {\# ([^:]*): *(.*)} [lindex $field 0] match name desc
# Append any description continuation lines to make one single line.
if {[llength $field] > 1} {
foreach line [lrange $field 1 end] {
append desc " [string trim [string trimleft $line #]]"
}
}
# Find the actual field data.
if {[regexp "\[^ \]$name:(.*)" $p4(itemText) match val]} {
set val [split $val \n]
set data [lindex $val 0]
# Append any data continuation lines.
foreach line [lrange $val 1 end] {
#puts "name=$name line=$line data=$data index0=[string index $line 0]x"
if {[string index $line 0] != "\t"} {
break
} {
append data "\n[string trim [string trimleft $line #]]"
}
}
set inform 1
} {
set data ""
set inform 0
}
# The following covers editting submitted Changelists.
if {$item == "change" && $name == "Files" && $inform == 0} {
set inform -1
}
# Check for fields to omit from the edit dialog.
if {[lsearch -exact {Jobs Password} $name] >= 0} {
set inform -1
}
# Get field widget type.
set options ""
if {[lsearch -exact $texts $name] >= 0} {
set type text
} elseif {[lsearch -exact $entries $name] >= 0} {
set type entry
} elseif {[lsearch -exact $checkbuttons $name] >= 0} {
set type checkbutton
# Build a list of option pairs (eg: {allwrite noallwrite}).
foreach option [split [string trim $data]] {
if {[lsearch -exact {no un} [string range $option 0 1]] < 0} {
set opt $option
} {
set opt [string range $option 2 end]
}
if {$opt == "locked"} {
set prefix un
} {
set prefix no
}
lappend options "$opt $prefix$opt"
}
} elseif {[lsearch -exact $radiobuttons1 $name] >= 0} {
set type radiobutton
# Build a list of valid values (eg: open closed suspended).
set line $desc
while {[regexp {[^']*'([^']*)'} $line match opt]} {
#puts "line=$line match=$match opt=$opt"
lappend options $opt
set line [string range $line [string length $match] end]
}
} elseif {[lsearch -exact $radiobuttons2 $name] >= 0} {
set type radiobutton
# Build a list of valid values (eg: local unix mac win share).
set options [split [string trim [lindex [split $desc :] 1] " ."] /]
} {
set type entry
}
# Add this field and its values to the spec list.
lappend specs [list name [string trim $name] desc [string trim $desc] data [string trim $data] inform $inform widget $type options $options]
# Find the next field.
set next [lsearch -regexp $left {^# }]
if {$next < 0} {
set left ""
} {
set field [lrange $left $next $next]
set left [lrange $left [incr next] end]
}
}
set p4(itemSpecs) $specs
}
helpshow {
set parent [lindex $args 0]
if {$parent == ""} {
set parent $widget(itemSpecWindow)
}
p4_viewDialog show "TkP4 - Help" $p4(describeHelp) $parent temp
}
helphide {
p4_viewDialog deleteTemp
}
helprefresh {
if {[winfo exists $widget(DescribeHelp)]} {
#$widget(DescribeHelpText) config -state normal
#$widget(DescribeHelpText) delete 1.0 end
#$widget(DescribeHelpText) insert end $p4(describeHelp)
#$widget(DescribeHelpText) config -state disabled
}
}
hide {
destroy $widget(itemSpecWindow)
p4_itemOptions helphide
}
insert {
$widget(DescribeText) config -state normal
$widget(DescribeText) delete 1.0 end
$widget(DescribeText) insert end $p4(describeText)
}
new {
# TTD: For Job, a name of "new" is special: it generates a sequence number. Support this somehow!
set itemname [p4_getNewName $item]
if {$itemname == ""} {
return
}
p4_itemOptions edit $item $itemname doneget
}
show {
p4_tooltips leave
set filter ""
if {$item == "changeFiltered"} {
set item change
set filter filter
}
set force $itemname
if {$force == "" && $p4(prevmcItem) == $item} {
return
}
if {$p4(prevmcItem) != $item} {
p4_${item}Options setTitle
set f $widget(mcListboxFrame)
pack forget $f.$p4(prevmcItem)
set p4(mcItem) $item
set p4(prevmcItem) $p4(mcItem)
set p4(mcListbox) $f.$item.lb
if {[winfo exists $p4(mcListbox)]} {
pack $f.$item -side top -fill both -expand y
} {
set p4(mcListbox) [p4_${item}Options createListbox]
set force force
}
}
if {[info exists p4(cache_$item)] && $force == ""} {
return
}
eval p4_${item}Options show $filter
}
showContextMenu {
# x,y are the coordinates relative to the upper-left corner of the
# listbox; rootx,rooty are screen coordinates (for knowing where
# to place the menu). w is the name of the mclistbox widget that was
# clicked on.
foreach {w x y rootx rooty} $args { break }
catch {destroy .contextMenu}
menu .contextMenu -tearoff false
# ask the widget what column this is
set column [$w column nearest $x]
set columnLabel [string trimright [$w column cget $column -label] " v^"]
# ask the widget what row this is
set idx [$w nearest $y]
.contextMenu configure -title "$columnLabel"
if {$item == "" || $item == "dummy"} {
set item $p4(mcItem)
}
if {$item != "change" && ! [p4_integrate isActive]} {
.contextMenu add command -label "New $item..." -command [list p4_itemOptions new $item]
}
if {$idx < 0} {
set itemname ""
} elseif {[p4_integrate isActive]} {
set itemname [lindex [$w get $idx] 0]
.contextMenu add command -label "Describe $itemname..." -command [list p4_itemOptions view $item $itemname]
} {
set itemname [lindex [$w get $idx] 0]
######puts "$itemname (idx $idx): [$w get $idx]"
set state [p4_itemOptions getEditState $item $itemname]
.contextMenu add command -label "Edit $itemname..." -command [list p4_itemOptions edit $item $itemname] -state $state
.contextMenu add command -label "Describe $itemname..." -command [list p4_itemOptions view $item $itemname]
if {$item == "change"} {
.contextMenu add command -label "(Add Job Fix...)" -state disabled
.contextMenu add command -label "Sync to Changelist $itemname..." -command [list p4_changeOptions syncShow $itemname]
} {
.contextMenu add command -label "Delete $itemname..." -command [list p4_itemOptions delete $item $itemname] -state $state
}
switch $item {
branch {
.contextMenu add separator
.contextMenu add command -label "Integrate Using $itemname..." -command [list p4_integrate showUsingBranch $itemname]
}
client {
.contextMenu add separator
if {$itemname != $env(P4CLIENT)} {
.contextMenu add command -label "Switch to $itemname" -command [list p4_clientOptions switch $itemname]
.contextMenu add command -label "Create/Update Client Using $itemname as Template" -command [list p4_clientOptions templateget $itemname]
} {
.contextMenu add command -label "(Set Default Client to $itemname)" -command [list p4_clientOptions templateget $itemname] -state disabled
.contextMenu add command -label "Create Client Using $itemname as Template" -command [list p4_clientOptions templateget $itemname]
}
}
job {
.contextMenu add separator
.contextMenu add command -label "(Filter...)" -command [list p4_itemOptions integrate $item $itemname] -state disabled
.contextMenu add command -label "(Clear Filter)" -command [list p4_itemOptions integrate $item $itemname] -state disabled
.contextMenu add command -label "(Set job list columns...)" -command [list p4_itemOptions integrate $item $itemname] -state disabled
}
label {
.contextMenu add separator
.contextMenu add command -label "(List Files at $itemname))" -command [list p4_itemOptions integrate $item $itemname] -state disabled
.contextMenu add command -label "(Replace Files in Label $itemname with Client $env(P4CLIENT) Files)" -command [list p4_itemOptions integrate $item $itemname] -state disabled
.contextMenu add command -label "Sync Client $env(P4CLIENT) to Label $itemname" -command [list p4_labelOptions sync $itemname $env(P4CLIENT)]
.contextMenu add command -label "(Create/Update Label Using $itemname as Template)" -command [list p4_itemOptions integrate $item $itemname] -state disabled
}
user {
.contextMenu add separator
if {$itemname == $env(P4USER)} {
.contextMenu add command -label "(Set Password for $itemname...)" -command [list p4_userOptions xxx $itemname] -state disabled
} {
.contextMenu add command -label "Switch to $itemname" -command [list p4_userOptions switch $itemname]
}
.contextMenu add command -label "(Set Default User to $itemname)" -command [list p4_userOptions xxx $itemname] -state disabled
}
}
}
if {$idx >= 0} {
.contextMenu add separator
.contextMenu add command -label "Sort by $columnLabel" -command "p4_mcOptions sort $w $column {} $item"
.contextMenu add command -label "Hide $columnLabel" -command [list $w column configure $column -visible false]
.contextMenu add command -label "Show All Hidden Columns" -command "p4_mcOptions showAllColumns $w"
}
if {! [p4_integrate isActive]} {
.contextMenu add separator
.contextMenu add command -label "Refresh" -command "p4_mcOptions refresh $w"
}
tk_popup .contextMenu $rootx $rooty
}
split {
set p4(describeHelp) ""
set p4(describeText) ""
foreach line [split $p4(itemText) \n] {
if {[string index $line 0] == "#"} {
append p4(describeHelp) $line\n
} {
append p4(describeText) $line\n
}
}
set p4(describeHelp) [string trim $p4(describeHelp)]
set p4(describeText) [string trim $p4(describeText)]
#p4_itemOptions helprefresh
p4_itemOptions helphide
}
submit {
set item $p4(itemSpec)
p4_changeOptions submit
#grab release $widget(itemSpecWindow)
#p4_itemOptions hide
}
update {
set item $p4(itemSpec)
if {$item == "change"} {
p4_changeOptions update $itemname $args
return
}
# TTD: will this ever get called when mcItem isn't the current view?
# (otherwise, refreshing the mcItem listbox is wrong)
busy_cursor set
# Check for changes before cancelling.
# TTD: new labels and clients don't need any edits done.
# TTD: creating a new user requires -i -f (superuser)
if {[p4_itemOptions checkIfChanged] == 0} {
bell
tk_dialog .tkp4 "TkP4 - No edit changes" "No changes have been made." info 0 "OK"
update idletasks
after 10
raise $widget(itemSpecWindow)
busy_cursor clear
return
}
set text [p4_itemOptions getFormFields]
if {$text == -1} {
update idletasks
after 10
raise $widget(itemSpecWindow)
busy_cursor clear
return
}
if {$item == "user"} {
# Don't use -f; it only works for superusers.
set f " -f"
set f ""
} {
set f ""
}
p4_runCommand run "$p4(exec) $item$f -i" nolog [list << $text]
tkwait variable p4(runcmdDone)
set rep [join $p4(runcmdOutput) \n]
if {$p4(runcmdDone) < 0 || [string first "Error in " $rep] >= 0 || [string first "to force update" $rep] >= 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - update $item error" $rep error 0 "OK"
update idletasks
after 10
raise $widget(itemSpecWindow)
} {
p4_logOptions note "$rep"
grab release $widget(itemSpecWindow)
p4_itemOptions hide
if {[string first "not changed" $rep] < 0} {
p4_mcOptions refresh $p4(mcListbox)
}
}
busy_cursor clear
}
view {
if {$item == "change" || $item == "revisionHistory"} {
p4_changeOptions view $itemname {} submitted editbutton $item showdiffs
return
}
if {[p4_itemOptions get $item $itemname] < 0} {
return
}
Window show $widget(Describe)
raise $widget(Describe)
pack forget $widget(DescribeShowDiffs)
$widget(DescribeEdit) config -command "p4_itemOptions edit $item $itemname"
p4_itemOptions viewlimits $item $itemname
p4_itemOptions insert
$widget(DescribeText) config -state disabled -background grey85
}
viewhelphide {
p4_viewDialog deleteTemp
}
viewhelpshow {
p4_viewDialog show "TkP4 - Help" $p4(describeHelp) $widget(DescribeHelp) temp
}
viewhide {
Window hide $widget(Describe)
p4_itemOptions viewhelphide
}
viewlimits {
if {![info exists p4(cache_${item}_index)]} {
return
}
set idx [lsearch -exact $p4(cache_${item}_index) $itemname]
set maxidx [llength $p4(cache_${item}_index)]
if {$idx == 0} {
set state disabled
} {
set state normal
}
$widget(DescribePrev) config -command "p4_itemOptions viewprev $item $itemname" -state $state
if {$idx == $maxidx - 1} {
set state disabled
} {
set state normal
}
$widget(DescribeNext) config -command "p4_itemOptions viewnext $item $itemname" -state $state
$widget(DescribeEdit) config -state [p4_itemOptions getEditState $item $itemname]
}
viewnext {
if {![info exists p4(cache_${item}_index)]} {
return
}
set inc [lindex $args 0]
if {$inc == ""} {
set inc 1
}
set idx [lsearch -exact $p4(cache_${item}_index) $itemname]
# This can happen if the listbox is resorted putting the current item at the beginning or end.
if {($inc < 0 && $idx > 0) || ($inc > 0 && $idx < [llength $p4(cache_${item}_index)] - 1)} {
incr idx $inc
}
set newname [lindex $p4(cache_${item}_index) $idx]
if {$item == "revisionHistory"} {
set w $p4(rhListbox)
} elseif {[p4_integrate isActive]} {
set w $p4(bsListbox)
} {
set w $widget(mcListboxFrame).$item.lb
}
p4_mcOptions setselection $w $idx
p4_itemOptions view $item $newname
}
viewprev {
p4_itemOptions viewnext $item $itemname -1
}
}
}
proc {p4_itemSpecEditWindow} {base item specs {editable {}} {addSubmitButton {}}} {
global p4 widget
# Get the number of text widgets required.
# Also, the Client spec field "Jobs" and User spec field "Password" aren't put in the edit dialog.
# Also, remove the Change spec "Files" field if it's not in the form, otherwise add a Submit button.
set oldspecs $specs
set textspecs ""
set specs ""
foreach spec $oldspecs {
catch {unset fields}
array set fields $spec
# Check for fields to omit from the edit dialog.
if {$fields(inform) < 0} {
continue
}
lappend specs $spec
if {$fields(widget) == "text"} {
lappend textspecs $fields(name)
}
}
#puts "nTexts=[llength $textspecs] textspecs=$textspecs"
if {$item == "change"} {
foreach var [array names p4 changeEdit_Files_*] { unset p4($var) }
set p4(changeEdit_Files_nfiles) 0
set p4(changeEdit_Files_newnfiles) 0
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 580x550+256+125
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - [string toupper [string index $item 0]][string range $item 1 end] Specification"
# This frame contains buttons on the right and labels/entries on the left.
frame $base.f0 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
pack $base.f0 -anchor center -expand 0 -fill x -side top
# This frame contains labels/entries and goes on the left.
frame $base.f0.f1 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
pack $base.f0.f1 -anchor center -expand 1 -fill x -side left
# This frame contains buttons and goes on the right.
frame $base.f0.f2 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 134
pack $base.f0.f2 -anchor center -expand 0 -fill y -side left -padx 20
set fieldnum 0
set spec [lindex $specs $fieldnum]
array set fields $spec
set buildEntry {
frame $frames.f$fieldnum -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $frames.f$fieldnum.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text $fields(name): -width 10
pack $frames.f$fieldnum -anchor center -expand 0 -fill x -side top -padx $padx
pack $frames.f$fieldnum.01 -anchor center -expand 0 -fill none -side left -padx 2 -pady 2
if {[lsearch -exact $editable $fields(name)] >= 0} {
set type $fields(widget)
} {
set type entry
}
if {$type == "entry"} {
entry $frames.f$fieldnum.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(${item}Edit_$fields(name)_value)
pack $frames.f$fieldnum.02 -anchor center -expand 1 -fill x -side right -padx 2 -pady 2
set p4(${item}Edit_$fields(name)_value) $fields(data)
if {[lsearch -exact $editable $fields(name)] >= 0} {
$frames.f$fieldnum.02 config -state normal -background white
}
} elseif {$type == "radiobutton"} {
foreach option $fields(options) {
radiobutton $frames.f$fieldnum.o_$option -text $option -value $option -variable p4(${item}Edit_$fields(name)_value)
pack $frames.f$fieldnum.o_$option -side left
}
set p4(${item}Edit_$fields(name)_value) $fields(data)
} {
# checkbutton
foreach option $fields(options) val [split $fields(data)] {
foreach {onvalue offvalue} [split $option] { break }
checkbutton $frames.f$fieldnum.o_$onvalue -text $onvalue -onvalue $onvalue -offvalue $offvalue -variable p4(${item}Edit_$fields(name)_${onvalue}_value)
pack $frames.f$fieldnum.o_$onvalue -side left
set p4(${item}Edit_$fields(name)_${onvalue}_value) $val
}
}
}
# First set of entries.
set frames $base.f0.f1
set padx 0
while {$fields(widget) == "entry" || $fields(widget) == "checkbutton" || $fields(widget) == "radiobutton"} {
eval $buildEntry
catch {unset fields}
incr fieldnum
set spec [lindex $specs $fieldnum]
array set fields $spec
}
# Buttons
set buttons ""
if {$addSubmitButton != ""} {
lappend buttons submit Submit
}
lappend buttons update Update cancel Cancel helpshow "Form Info" formEditor Editor
foreach {cmd text} $buttons {
button $base.f0.f2.$cmd -background grey85 -command "p4_itemOptions $cmd" -foreground black -highlightbackground grey85 -highlightthickness 0 -width 9 -text $text
pack $base.f0.f2.$cmd -anchor center -expand 1 -fill x -side top
}
# Form Editor not implemented.
$base.f0.f2.$cmd config -state disabled
# The next field should be a text field.
if {$fields(widget) != "text"} {
bell
tk_dialog .tkp4 "TkP4 - edit error" "Internal error; can't continue. The next field should be a widget 'text':\n\n[array get fields]." error 0 "OK"
catch {destroy $base}
return -1
}
if {[llength $textspecs] == 1} {
# This frame is for a single text widget.
frame $base.f1 -background grey85 -borderwidth 2 -highlightbackground grey85 -height 65 -relief groove -width 125
label $base.f1.01 -background grey85 -borderwidth 1 -highlightbackground grey85 -foreground black -text $fields(name):
frame $base.f1.02 -background grey85 -borderwidth 2 -highlightbackground grey85 -height 30 -width 30
scrollbar $base.f1.02.03 -background grey85 -borderwidth 1 -command "$base.f1.02.05 xview" -highlightbackground grey85 -highlightthickness 0 -width 10 -orient horizontal
scrollbar $base.f1.02.04 -background grey85 -borderwidth 1 -command "$base.f1.02.05 yview" -highlightbackground grey85 -highlightthickness 0 -width 10
text $base.f1.02.05 -background white -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 1 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand "$base.f1.02.03 set" -yscrollcommand "$base.f1.02.04 set"
pack $base.f1 -anchor center -expand 1 -fill both -side top
pack $base.f1.01 -anchor w -expand 0 -fill none -side top -padx 6
pack $base.f1.02 -anchor center -expand 1 -fill both -side top
grid columnconf $base.f1.02 0 -weight 1
grid rowconf $base.f1.02 0 -weight 1
grid $base.f1.02.03 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.f1.02.04 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.f1.02.05 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
# Don't place Change spec Files into text widget.
if {$fields(name) != "Files"} {
foreach line [split $fields(data) \n] {
$base.f1.02.05 insert end [string trim $line]\n
}
$base.f1.02.05 mark set insert 1.0
$base.f1.02.05 see 1.0
}
if {[lsearch -exact $editable $fields(name)] < 0} {
$base.f1.02.05 config -state disabled -background grey85
}
set widget(${item}Edit_$fields(name)_text) $base.f1.02.05
catch {unset fields}
incr fieldnum
set spec [lindex $specs $fieldnum]
array set fields $spec
} elseif {[llength $textspecs] == 2} {
# This frame is for two text widgets in a resizeable split panel.
# Any entries between the two texts are placed at the bottom of the top split panel.
frame $base.f2 -background grey85 -highlightbackground grey85 -height 100 -highlightcolor grey85 -width 200
pack $base.f2 -anchor center -expand 1 -fill both -side top
# This is the little square controller for the split panel.
frame $base.f2.03 -background grey85 -borderwidth 2 -cursor sb_v_double_arrow -highlightbackground grey85 -highlightcolor grey85 -relief raised
bind $base.f2.03 <B1-Motion> {
set root [split %W .]
set nb [llength $root]
incr nb -1
set root [lreplace $root $nb $nb]
set root [join $root .]
set height [winfo height $root].0
set val [expr (%Y - [winfo rooty $root]) / $height]
if {$val >= 0 && $val <= 1.0} {
place $root.t_1 -relheight $val
place $root.03 -rely $val
place $root.t_2 -relheight [expr 1.0 - $val]
}
}
set ntext 1
while {$fieldnum < [llength $specs]} {
catch {unset fields}
set spec [lindex $specs $fieldnum]
array set fields $spec
if {$fields(widget) != "text"} {
# These entries, checkbuttons and radiobuttons go at the bottom of the top split panel.
set frames $base.f2.t_1
set padx 3
eval $buildEntry
} {
# This is a complete text unit.
set t t_$ntext
frame $base.f2.$t -background grey85 -highlightbackground grey85
frame $base.f2.$t.f1 -background grey85 -highlightbackground grey85 -borderwidth 2 -height 75 -relief groove -width 125
if {$fields(name) == "Files"} {
set text "$fields(name): (excluded files will remain in the Default Changelist)"
} {
set text "$fields(name)"
}
label $base.f2.$t.f1.01 -background grey85 -highlightbackground grey85 -borderwidth 1 -foreground black -text $text
frame $base.f2.$t.f1.02 -background grey85 -highlightbackground grey85 -borderwidth 2 -height 30 -width 30
scrollbar $base.f2.$t.f1.02.03 -background grey85 -borderwidth 1 -highlightthickness 0 -highlightbackground grey85 -width 10 -orient horizontal -command "$base.f2.$t.f1.02.05 xview"
scrollbar $base.f2.$t.f1.02.04 -background grey85 -borderwidth 1 -highlightbackground grey85 -command "$base.f2.$t.f1.02.05 yview" -highlightthickness 0 -width 10
text $base.f2.$t.f1.02.05 -background white -foreground black -height 1 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand "$base.f2.$t.f1.02.03 set" -yscrollcommand "$base.f2.$t.f1.02.04 set"
if {$ntext == 1} {
place $base.f2.$t -x 0 -y 0 -relwidth 1 -height -1 -relheight 0.5336 -anchor nw -bordermode ignore
} {
place $base.f2.$t -x 0 -y 0 -relwidth 1 -height -1 -relheight 0.4664 -anchor sw -bordermode ignore -rely 1
}
pack $base.f2.$t.f1 -anchor center -expand 1 -fill both -side top
pack $base.f2.$t.f1.01 -anchor w -expand 0 -fill none -side top -padx 6
pack $base.f2.$t.f1.02 -anchor center -expand 1 -fill both -side top
grid columnconf $base.f2.$t.f1.02 0 -weight 1
grid rowconf $base.f2.$t.f1.02 0 -weight 1
grid $base.f2.$t.f1.02.03 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.f2.$t.f1.02.04 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.f2.$t.f1.02.05 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
# Don't place Change spec Files into text widget.
if {$fields(name) != "Files"} {
foreach line [split $fields(data) \n] {
$base.f2.$t.f1.02.05 insert end [string trim $line]\n
}
$base.f2.$t.f1.02.05 mark set insert 1.0
$base.f2.$t.f1.02.05 see 1.0
} {
set nfiles 0
foreach line [split [string trim $fields(data)] \n] {
incr nfiles
set file [string trim $line]
$base.f2.$t.f1.02.05 window create end -create [list checkbutton $base.f2.$t.f1.02.05.b$nfiles -variable p4(changeEdit_Files_b$nfiles) -offvalue {} -onvalue $file -background white -text $file]
$base.f2.$t.f1.02.05 insert end \n
set p4(changeEdit_Files_b$nfiles) $file
lappend p4(changeEdit_Files_files) $file
}
set p4(changeEdit_Files_nfiles) [llength $p4(changeEdit_Files_files)]
}
if {[lsearch -exact $editable $fields(name)] < 0} {
$base.f2.$t.f1.02.05 config -state disabled -background grey85
}
set widget(${item}Edit_$fields(name)_text) $base.f2.$t.f1.02.05
incr ntext
}
incr fieldnum
}
place $base.f2.03 -x 0 -relx 0.98 -y 0 -rely 0.5336 -width 10 -height 10 -anchor e -bordermode ignore
raise $base.f2.03
} elseif {[llength $textspecs] > 2} {
bell
tk_dialog .tkp4 "TkP4 - edit error" "Internal error; can't continue. More than 2 text fields in $item spec." error 0 "OK"
catch {destroy $base}
return -1
}
# If the Description text starts with "<" (<enter description here>), highlight it.
if {[info exists widget(${item}Edit_Description_text)] && [$widget(${item}Edit_Description_text) get 1.0] == "<"} {
$widget(${item}Edit_Description_text) tag add sel 1.0 "end - 2 chars"
}
return 0
}
proc {p4_jobOptions} {opt args} {
global p4 widget
switch $opt {
createListbox {
return [p4_mcListbox $widget(mcListboxFrame).job {{job Job 24} {status Status 11} {user User 11} {date Date 11} {desc Description 24}} desc]
}
setTitle {
set p4(mcListboxTitle) "Perforce Jobs"
}
selection {
#puts "selection has changed: $args"
}
show {
busy_cursor set
$p4(mcListbox) delete 0 end
if {![info exists p4(cache_job)]} {
p4_runCommand run "$p4(exec) jobs"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
set p4(cache_job) $p4(runcmdOutput)
}
foreach line $p4(cache_job) {
regexp {([^ ]*) [^ ]* ([^ ]*) [^ ]* ([^ ]*) ([^ ]*) '(.*)'} $line match j d u s desc
$p4(mcListbox) insert end [list $j [string trim $s *] $u $d $desc]
}
p4_mcOptions sort $p4(mcListbox) job decreasing job
busy_cursor clear
}
}
}
proc {p4_labelOptions} {opt args} {
global p4 widget
switch $opt {
createListbox {
return [p4_mcListbox $widget(mcListboxFrame).label {{label Label 24} {date Date 11} {desc Description 24}} desc]
}
selection {
#puts "selection has changed: $args"
}
setTitle {
set p4(mcListboxTitle) "Perforce Labels"
}
show {
busy_cursor set
$p4(mcListbox) delete 0 end
if {![info exists p4(cache_label)]} {
p4_runCommand run "$p4(exec) labels"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
set p4(cache_label) $p4(runcmdOutput)
}
foreach line $p4(cache_label) {
regexp {[^ ]* ([^ ]*) ([^ ]*) '(.*)'} $line match l d desc
$p4(mcListbox) insert end [list $l $d $desc]
}
p4_mcOptions sort $p4(mcListbox) label increasing label
busy_cursor clear
}
sync {
set label [lindex $args 0]
set client [lindex $args 1]
bell
set rep [tk_dialog .tkp4 "TkP4 - Sync Client to Label" "Synchronizing client \"$client\" to label \"$label\" will make the client reflect the set o files last synced to the label's view, at the revision that existed when synced.\n\nProceed with sync?" questhead -1 "Sync" "Sync Preview" "Cancel"]
switch $rep {
0 {
p4_runCommand sync {} {} @$label "//..."
}
1 {
p4_runCommand sync {} -n @$label "//..."
}
}
}
}
}
proc {p4_logOptions} {opt args} {
global p4 widget
set lb $widget(p4cmdListbox)
switch $opt {
error {
set errors [split [lindex $args 0] \n]
$lb insert end " !!!! [lindex $errors 0]"
foreach error [lrange $errors 1 end] {
$lb insert end " $error"
}
$lb see end
}
log {
$lb insert end " o [lindex $args 0]"
$lb see end
}
note {
$lb insert end " >> [lindex $args 0]"
$lb see end
}
warn -
warning {
$lb insert end " === [lindex $args 0]"
$lb see end
}
}
update idletasks
}
proc {p4_mcListbox} {f cols fillcol} {
global p4 widget
catch {namespace import mclistbox::*}
set l $f.lb
frame $f -background grey85 -borderwidth 0
# frame so they look like a single widget
scrollbar $f.vsb -orient vertical -command [list $l yview] -width 10 -borderwidth 1 -background grey85
scrollbar $f.hsb -orient horizontal -command [list $l xview] -width 10 -borderwidth 1 -background grey85
mclistbox $l -background white -exportselection 0 -font $p4(font) -bd 0 -height 10 -width 60 -selectcommand "p4_mcOptions selection $l" -columnrelief flat -labelanchor w -columnborderwidth 0 -selectmode browse -labelborderwidth 2 -fillcolumn $fillcol -xscrollcommand [list $f.hsb set] -yscrollcommand [list $f.vsb set]
# add the columns we want to see
foreach col $cols {
foreach {name label width} $col { break }
$l column add $name -label $label -width $width
$l label bind $name <ButtonPress-1> "p4_mcOptions sort %W $name {} \$p4(mcItem)"
}
grid $f.vsb -in $f -row 0 -column 1 -sticky ns
grid $f.hsb -in $f -row 1 -column 0 -sticky ew
grid $l -in $f -row 0 -column 0 -sticky nsew -padx 0 -pady 0
grid columnconfigure $f 0 -weight 1
grid columnconfigure $f 1 -weight 0
grid rowconfigure $f 0 -weight 1
grid rowconfigure $f 1 -weight 0
pack $f -side top -fill both -expand y
# bind the right click to pop up a context-sensitive menu
# we can use the proc ::mclistbox::convert to convert the
# binding substitutions we need. I've included two examples
# to illustrate. Either method should give identical results. The
# first method is slightly more efficient since it calls the
# conversion routine only once. The second method calls the
# procedure once for each of %W, %x and %y.
# bind $l <ButtonPress-3> {eval p4_${item}Options showContextMenu [::mclistbox::convert %W -W -x %x -y %y] %X %Y}
bind $l <ButtonPress-3> {
if {[winfo exists [::mclistbox::convert %W -W]]} {
tkListboxBeginSelect [::mclistbox::convert %W -W] [[::mclistbox::convert %W -W] index @[::mclistbox::convert %W -x %x],[::mclistbox::convert %W -y %y]]
}
p4_mcOptions showContextMenu [::mclistbox::convert %W -W] [::mclistbox::convert %W -x %x] [::mclistbox::convert %W -y %y] %X %Y
}
bind $l <Double-ButtonPress-1> {
if {[winfo exists [::mclistbox::convert %W -W]]} {
tkListboxBeginSelect [::mclistbox::convert %W -W] [[::mclistbox::convert %W -W] index @[::mclistbox::convert %W -x %x],[::mclistbox::convert %W -y %y]]
}
p4_mcOptions describe [::mclistbox::convert %W -W] [::mclistbox::convert %W -x %x] [::mclistbox::convert %W -y %y] %X %Y
}
return $l
}
proc {p4_mcOptions} {opt w args} {
global p4 widget
switch $opt {
describe {
# This is for double-clicking in the mcListboxes.
#puts "opt=$opt w=$w args=$args"
if {$w == $p4(mcListbox)} {
eval p4_itemOptions describe dummy dummy $w $args
} elseif {$w == $p4(bsListbox)} {
eval p4_itemOptions describe branch dummy $w $args
} elseif {$w == $p4(rhListbox)} {
eval p4_revisionHistory describe $w $args
}
}
getSortedIndex {
if {$w == $p4(rhListbox)} {
set item revisionHistory
set idx 1
} {
set item [lindex $args 0]
set idx 0
}
set p4(cache_${item}_index) ""
if {[winfo exists $w]} {
set rows [$w get 0 end]
foreach row $rows {
lappend p4(cache_${item}_index) [lindex $row $idx]
}
}
}
refresh {
# This is only valid for the item listbox (Clients, Branches, etc)
unset p4(cache_$p4(mcItem))
set idx [$w curselection]
if {$idx < 0} {
set rowname ""
} {
set rowname [lindex [$w get $idx] 0]
}
p4_itemOptions show $p4(mcItem) force
if {$rowname != ""} {
p4_mcOptions setselectionByName $w [list $rowname]
}
}
selection {
if {$w == $p4(hostListbox)} {
} elseif {$w == $p4(mcListbox)} {
} elseif {$w == $p4(bsListbox)} {
} {
eval p4_revisionHistory selection $w $args
}
}
setselection {
set idx [lindex $args 0]
$w selection clear 0 end
if {$idx >= 0} {
$w selection set $idx
$w see $idx
}
}
setselectionByName {
set data [$w get 0 end]
set idx [lsearch -regexp $data "^[lindex $args 0] "]
p4_mcOptions setselection $w $idx
}
showAllColumns {
foreach column [$w column names] {
$w column configure $column -visible true
}
}
showContextMenu {
if {$w == $p4(mcListbox)} {
eval p4_itemOptions showContextMenu dummy dummy $w $args
} elseif {$w == $p4(bsListbox)} {
#eval p4_integrate showContextMenu dummy dummy $w $args
eval p4_itemOptions showContextMenu branch dummy $w $args
} elseif {$w == $p4(hostListbox)} {
eval p4_connectionOptions showContextMenu $w $args
} elseif {$w == $p4(rhListbox)} {
eval p4_revisionHistory showContextMenu $w $args
}
}
sort {
upvar ::mclistbox::${w}::sortopts sortopts
set id [lindex $args 0]
set sortdir [lindex $args 1]
set cache [lindex $args 2]
if {$sortdir == ""} {
if {[info exists sortopts(sortfield)]} {
if {$sortopts(sortfield) == $id} {
if {$sortopts(sortdir) == "increasing"} {
set sortdir decreasing
} {
set sortdir increasing
}
} {
set sortdir $sortopts(sortdir)
}
} {
set sortdir increasing
}
}
if {$sortdir == "increasing"} {
set sortarrow "v"
} {
set sortarrow "^"
}
foreach name [$w column names] {
set title [string trimright [$w column cget $name -label] " v^"]
if {$name == $id} {
$w column configure $name -label "$title $sortarrow"
} {
$w column configure $name -label "$title"
}
}
set idx [lindex [$w curselection] 0]
if {$idx < 0} {
set rowname ""
} {
set rowname [lindex [$w get $idx] 0]
}
set data [$w get 0 end]
set index [lsearch -exact [$w column names] $id]
set sortopts(sortdir) $sortdir
set sortopts(sortfield) $id
set result [lsort -$sortdir -dictionary -index $index $data]
$w delete 0 end
# ... and add our sorted data in
eval $w insert end $result
p4_mcOptions getSortedIndex $w $cache
if {$rowname != ""} {
p4_mcOptions setselectionByName $w [list $rowname]
}
}
}
}
proc {p4_miscellaneousOptions} {opt args} {
global p4 widget env
switch $opt {
save -
hide {
Window hide $widget(filesOptions)
}
show {
Window show $widget(filesOptions)
}
}
}
proc {p4_options} {opt args} {
global p4 widget env
set sections [list connection editview diffmerge display font miscellaneous]
switch $opt {
save {
catch {grab release $widget($p4(HelpSection)Options)}
Window hide $widget($p4(HelpSection)Options)
set p4(prevHelpSection) ""
catch {set p4(servers) [$p4(hostListbox) get 0 end]}
p4_options saveToFile
# This exits the while loop in p4_connectionOptions init.
set env(P4PORT) $env(P4PORT)
}
saveToFile {
catch {set p4(servers) [$p4(hostListbox) get 0 end]}
set ofp [open $p4(tkp4rc) "w"]
foreach var $p4(configVars) {
puts $ofp "set p4($var) \{$p4($var)\}"
}
close $ofp
}
show {
p4_$p4(HelpSection)Options show
p4_options switch
tkwait visibility $widget($p4(HelpSection)Options)
catch {grab release $widget($p4(prevHelpSection)Options)}
catch {Window hide $widget($p4(prevHelpSection)Options)}
grab $widget($p4(HelpSection)Options)
set p4(prevHelpSection) $p4(HelpSection)
}
switch {
$widget($p4(HelpSection)Button) config -activebackground grey70
}
}
}
proc {p4_pendingChangeOptions} {opt args} {
global p4 p4pending p4changes p4files p4tooltips Pend widget env
switch $opt {
changeFileType {
set copt [lindex $args 0]
switch $copt {
cancel {
Window hide $widget(ChangeFileType)
grab release $widget(ChangeFileType)
}
help {
p4_help filetypes $widget(ChangeFileType)
}
ok {
set newtype "-t $p4(ChangeFileType_basetype)"
set mods $p4(ChangeFileType_storage)
foreach mod {x w k o m l} {
append mods $p4(ChangeFileType_mod_$mod)
}
if {$mods != ""} {
append newtype +$mods
}
set p4pending(ReopenTarget) ""
eval p4_runCommand checkout reopen $p4(ChangeFileType_args) {$newtype}
p4_pendingChangeOptions changeFileType cancel
}
show {
set files [lrange $args 1 1]
foreach file $files {
lappend chgfiles [string trim [lindex [split $file #] 0]]
}
set p4(ChangeFileType_args) [list $chgfiles [lrange $args 2 end]]
#puts chgfiles=$chgfiles
set type ""
regexp {<(.*)><.*>} [lindex $files 0] match type
switch $type {
ctext {
set basetype text
set mods C
}
cxtext {
set basetype text
set mods Cx
}
ktext {
set basetype text
set mods k
}
kxtext {
set basetype text
set mods kx
}
ltext {
set basetype text
set mods F
}
tempobj {
set basetype binary
set mods Sw
}
ubinary {
set basetype binary
set mods F
}
uresource {
set basetype resource
set mods F
}
uxbinary {
set basetype binary
set mods Fx
}
xbinary {
set basetype binary
set mods x
}
xltext {
set basetype text
set mods Fx
}
xtempobj {
set basetype binary
set mods Swx
}
xtext {
set basetype text
set mods x
}
default {
foreach {basetype mods} [split $type +] { break }
}
}
set p4(ChangeFileType_storage) {}
foreach mod {x w k o m l} {
set p4(ChangeFileType_mod_$mod) {}
}
foreach mod [split $mods {}] {
if {[lsearch -exact {C D F S} $mod] >= 0} {
set p4(ChangeFileType_storage) $mod
} elseif {[lsearch -exact {x w k o m l} $mod] >= 0} {
set p4(ChangeFileType_mod_$mod) $mod
}
}
set p4(ChangeFileType_file) $chgfiles
set p4(ChangeFileType_basetype) $basetype
set p4(ChangeFileType_type) $type
Window show $widget(ChangeFileType)
grab $widget(ChangeFileType)
}
}
}
delete {
set chng [lindex $args 0]
set v [lindex $args 1]
bell
if {[tk_dialog .tkp4 "TkP4 - Delete Empty Changelist" "Are you sure you want to delete Changelist #$chng?" questhead -1 "Yes" "No"] != 0} {
return
}
p4_runCommand run "$p4(exec) change -d $chng"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
p4_logOptions error [join $p4(runcmdOutput) \n]
return -1
} {
set rep $p4(runcmdOutput)
foreach line $rep {
p4_logOptions note "$line"
}
# Remove the empty changelist from the pending tree.
eval Tree:delitem $widget(pendingCanvas) $v
# Remove the empty changelist from the p4pending array.
set names [array names p4pending "$p4pending(Changelists_myclient)Change $chng {TkP4 - RENAME...}:*"]
foreach name $names {
unset p4pending($name)
}
}
}
dragable {
#puts "dragable opts=$args"
#foreach {w v } $args { break }
set v [lindex $args 0]
#puts "v=$v"
#foreach {v1 v2} $v { break }
#puts "Pend1=[array get Pend $v*]"
#puts "CLs=$p4pending(Changelists)"
#puts "parent=$p4pending($v:parent)"
#puts "icon=$Pend($p4pending($v:parent):icon)"
#set vv [eval Tree:joinnodes $w $v]
if {$v == "" || $Pend($v:isdir) || $Pend($p4pending($v:parent):icon) != "pmypending"} {
return 0
}
return 1
}
drop {
foreach {w source target} $args { break }
#puts "args=$args w=$w source=$source target=$target"
#puts "drop $source into $target"
set n3 [string range $source $p4pending($source:diridx) end]
set file [lindex [split $n3 #] 0]
set chng default
regexp {Change ([0-9]*) } [lindex $target 1] match chng
#puts "drop $file into $chng n3=$n3"
# These are used to delete the source node in the Pending tree and add the target.
set p4pending(dropFile) ""
lappend p4pending(dropFile) $n3
set p4pending(dropSourceDir) $p4pending($source:parent)
set p4pending(dropTargetDir) [eval Tree:joinnodes $widget(pendingCanvas) $target]
#puts "dropFile=$p4pending(dropFile) dropSourceDir=$p4pending(dropSourceDir) dropTargetDir=$p4pending(dropTargetDir)"
## This reopentarget is now done by runCmdUpdates: (v1.11i)
## set p4pending(ReopenTarget) [list [lindex $target 1]]
set p4pending(ReopenTarget) ""
p4_runCommand checkout reopen [list $file] [list $p4pending($source:parent)] "-c $chng"
}
dropable {
if {!$Pend(PointerInCanvas)} {
return -1
}
#puts "dropable opts=$args"
#foreach {w v } $args { break }
set v [lindex $args 0]
#puts "v=$v"
#foreach {v1 v2} $v { break }
#puts "Pend1=[array get Pend $v:*]"
#puts "CLs=$p4pending(Changelists)"
#puts "icon=$Pend($p4pending($v:parent):icon)"
#set vv [eval Tree:joinnodes $w $v]
if {$v == "" || !$Pend($v:isdir) || $Pend($v:icon) != "pmypending" || $v == $p4pending($Pend(dragv):parent)} {
return 0
}
#puts "parent=$p4pending($v:parent)"
#puts "dropitemparent=$p4pending($Pend(dragv):parent)"
return 1
}
editChangelist {
busy_cursor set
set mode [lindex $args 0]
set chng [lindex $args 1]
set stat [lindex $args 2]
if {$chng == "new"} {
set changelist ""
} {
set changelist $chng
}
if {$stat == "submitted"} {
# This -f is OK. It only works for superusers, but the error message for non-superusers is OK.
set force " -f"
} {
set force ""
}
if {[p4_itemOptions get change $changelist $force] < 0} {
if {[string first "You don't have permission" $p4(itemText)] >= 0} {
bell
p4_logOptions error "$p4(itemText)"
tk_dialog .tkp4 "TkP4 - change error" $p4(itemText) error 0 "OK"
}
update idletasks
after 10
busy_cursor clear
return -1
}
if {[p4_itemOptions getSpec change] < 0} {
return
}
# Just in case we were called from the view window.
p4_itemOptions viewhide
set widget(itemSpecWindow) .s_change
set editable {Description Files}
if {$mode == "submit"} {
set addSubmitButton addSubmitButton
} {
set addSubmitButton ""
}
if {[p4_itemSpecEditWindow $widget(itemSpecWindow) change $p4(itemSpecs) $editable $addSubmitButton] < 0} {
return -1
}
catch {grab $widget(itemSpecWindow)}
busy_cursor clear
}
fileMenuAdd {
bell
set msg "Adding files to the Depot is implemented in the right mouse button popup menu in the \"View/Client Workspace Root\" pane.\n\nI'll switch you to it when you click OK."
if {[tk_dialog .tkp4 "TkP4 - Add Files to Depot" $msg info 0 "OK" "Cancel"]} {
return
}
set p4(treeView) workspace
#puts treecreate4
p4_treeOptions switch
}
getOpened {
# 1) get the opened files (p4 opened)
# 2) get the unresolved files (p4 resolve -n)
# 3) map unresolved files from client to depot names (p4 opened file [file...])
# 4) get resolved files (p4 resolved)
# 5) map resolved files from client to depot names (p4 opened file [file...])
set w $widget(pendingCanvas)
set myclient $p4pending(Changelists_myclient)
set others $p4pending(Changelists_others)
set mode [lindex $args 0]
set parents [lindex $args 1]
#puts "getopened parents=$parents"
if {$mode == "all" || $mode == "justOtherClients"} {
set cmd "opened -a"
} {
set cmd "opened"
}
# TTD: put a progress meter here?
p4_logOptions log "Executing p4 $cmd"
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
set openeds "s"
set resolves "s"
set resolveds "s"
set openedLines ""
set nopened 0
set resolveLines ""
set nresolve 0
set resolvedLines ""
set nresolved 0
set unresolvedfiles ""
set resolvedfiles ""
if {[catch {eval exec $p4(exec) $cmd} rep]} {
# Don't show the "File(s) not opened on this client" error message.
if {[string first "not opened" $rep] < 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 $cmd error" $rep error 0 "OK"
}
} {
set openedLines [split $rep \n]
set nopened [llength $openedLines]
if {$nopened == 1} {
set openeds ""
}
#puts "openedLines=$openedLines"
}
if {$nopened > 0} {
set cmd "resolve -n"
p4_logOptions log "Executing p4 $cmd"
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
if {[catch {eval exec $p4(exec) $cmd} rep]} {
# Don't show the "No file(s) to resolve" error message.
if {[string first "No file" $rep] < 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 $cmd error" $rep error 0 "OK"
}
} {
set resolveLines [split $rep \n]
set nresolve [llength $resolveLines]
if {$nresolve == 1} {
set resolves ""
}
#puts "resolveLines=$resolveLines"
set resolvefilelist ""
foreach line $resolveLines {
if {![regexp {(.*) - } $line match n]} {
bell
tk_dialog .tkp4warn "TkP4 - p4 resolve -n parse error" "Can't parse this line from p4 resolve -n:\n\n$line" error 0 "OK"
continue
}
lappend resolvefilelist [list $n]
}
#puts "resolvefilelist=$resolvefilelist"
set cmd "opened $resolvefilelist"
p4_logOptions log "Executing p4 $cmd"
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
if {[catch {eval exec $p4(exec) $cmd} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 $cmd error" $rep error 0 "OK"
} {
set openedLines2 [split $rep \n]
set nopened2 [llength $openedLines2]
#puts "openedLines2=$openedLines2"
set unresolvedfiles ""
foreach line $openedLines2 {
if {![regexp {(.*)#([^ ]*) - } $line match n]} {
bell
tk_dialog .tkp4warn "TkP4 - p4 opened parse error" "Can't parse this line from p4 opened:\n\n$line" error 0 "OK"
continue
}
lappend unresolvedfiles [list $n]
}
#puts "unresolvedfiles=$unresolvedfiles"
}
}
if {$nopened - $nresolved > 0} {
set cmd "resolved"
p4_logOptions log "Executing p4 $cmd"
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
if {[catch {eval exec $p4(exec) $cmd} rep]} {
# Don't show the "No file(s) resolved" error message.
if {[string first "No file" $rep] < 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 $cmd error" $rep error 0 "OK"
}
} {
set resolvedLines [split $rep \n]
#puts "resolvedLines=$resolvedLines"
set resolvedfilelist ""
foreach line $resolvedLines {
if {![regexp {(.*) - } $line match n]} {
bell
tk_dialog .tkp4warn "TkP4 - p4 resolved parse error" "Can't parse this line from p4 resolved:\n\n$line" error 0 "OK"
continue
}
lappend resolvedfilelist [list $n]
}
#puts "resolvedfilelist=$resolvedfilelist"
set cmd "opened $resolvedfilelist"
p4_logOptions log "Executing p4 $cmd"
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
if {[catch {eval exec $p4(exec) $cmd} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 $cmd error" $rep error 0 "OK"
} {
set openedLines3 [split $rep \n]
set nopened3 [llength $openedLines3]
#puts "openedLines3=$openedLines3"
set resolvedfiles ""
foreach line $openedLines3 {
if {![regexp {(.*)#([^ ]*) - ([^ ]*) } $line match n r a]} {
bell
tk_dialog .tkp4warn "TkP4 - p4 opened parse error" "Can't parse this line from p4 opened:\n\n$line" error 0 "OK"
continue
}
#puts "n=$n r=$r a=$a"
if {$a != "branch"} {
lappend resolvedfiles [list $n]
}
}
# puts "resolvedfiles=$resolvedfiles"
set nresolved [llength $resolvedfiles]
if {$nresolved == 1} {
set resolveds ""
}
}
}
}
}
p4_logOptions log " Found $nopened opened file$openeds with $nresolve unresolved file$resolves and $nresolved resolved file$resolveds"
foreach line $openedLines {
if {![regexp {(.*)#([^ ]*) - ([^ ]*) ([^ ]*) ([^ ]*) \(([^ ]*)\)( by ([^ ]*)@([^ ]*))?(.*)?} $line match n r a c1 c2 t match2 u c l]} {
bell
tk_dialog .tkp4warn "TkP4 - p4 opened parse error" "Can't parse this line from p4 opened:\n\n$line" error 0 "OK"
continue
}
if {$u == ""} {
set u $env(P4USER)
set c $env(P4CLIENT)
}
#puts "line=$line l=$l"
set f "$n#$r"
set n3 "$f <$t><$a>"
set h1 0
if {$c == $env(P4CLIENT) && $u == $env(P4USER)} {
#puts "n=$n unresolved=[lsearch $unresolvedfiles $n]"
if {[lsearch $unresolvedfiles $n] < 0} {
set h1 0
set h2 0
} {
set h1 1
set h2 2
}
set fileicon [p4_createGetFileIcon pending $t $a "" [expr {[string first "locked" $l] >= 0}] 0 $h1 $h2]
set n1 $myclient
set image pmypending
if {$c1 == "default"} {
set n2 " Default"
} {
set n2 "Change $c2 \{$p4changes($c2)...\}"
}
} {
if {$c == $env(P4CLIENT)} {
set fileicon [p4_createGetFileIcon pending $t $a "" [expr {[string first "locked" $l] >= 0}] 0 0 0]
set n1 $myclient
set image pyourpending
} {
set fileicon [p4_createGetFileIcon pending $t "" [list "otherAction0 $a"] 0 [expr {[string first "locked" $l] >= 0}] 0 0]
set n1 $others
set image potherpending
}
if {$c1 == "default"} {
set n2 " Default - $u@$c"
} elseif {![info exists p4changes($c2)]} {
# Changelist is not pending! Could be already submitted?
set n2 "Change $c2 - $u@$c (TkP4 WARNING: inconsistant data - please REFRESH ASAP)"
} {
set n2 "Change $c2 - $u@$c \{$p4changes($c2)...\}"
}
}
#puts "getOpened: n1=$n1 n2=$n2 n3=$n3 parents=$parents"
if {$mode == "all" || ($mode == "justOtherClients" && [string first "Pending Changelists (other " $n1] == 0) || ($mode == "justThisClient" && [string first "Pending Changelists (client " $n1] == 0) || ($mode == "justTheseClients" && [lsearch -exact $parents $n2] >= 0)} {
#puts "updating in pend tree: $n1$n2$n3"
catch {Tree:newitem $w $n1 $n2 -image $image -type dir -sortdic 1}
set p4pending($n1$n2:diridx) [string length $n1]
set p4pending($n1$n2:parent) $n1
Tree:newitem $w "$n1$n2" $n3 -image $fileicon -type file -sortdic 1
# This allows us to find a file in the Pending tree given the depot name:
set p4pending($n1$n2$n3:diridx) [string length $n1$n2]
set p4pending($n1$n2$n3:parent) $n1$n2
# This allows us to know if a file is locked:
set p4pending($n1$n2$n3:locked) [expr {[string first "locked" $l] >= 0}]
# This allows us to know if a file is unresolved:
set p4pending($n1$n2$n3:unresolved) $h1
}
}
# This list is used for the Add Files dialog, and eventual drag-n-drop.
set p4pending(Changelists) ""
set p4pending(Changelists_width) 0
foreach icon [array names Pend *:icon] {
if {$Pend($icon) == "pmypending"} {
#puts "icon=$Pend($icon) v=$icon"
set changelist [lindex [split $icon :] 0]
set changelist [string range $changelist [expr [string first ")" $changelist] + 1] end]
#puts changelist=$changelist
lappend p4pending(Changelists) $changelist
if {[set length [string length $changelist]] > $p4pending(Changelists_width)} {
set p4pending(Changelists_width) $length
}
}
}
set p4pending(Changelists) [lsort -dictionary $p4pending(Changelists)]
#puts "changelists=[array get p4pending Changelists*]"
p4_runCommand grabCancel
}
XXXhelp {
XXXp4_viewDialog show "TkP4 - Help" $p4(describeHelp) $widget(Change) temp
}
invalidate {
destroy $widget(mcListboxFrame).pending
catch {unset Pend}
catch {unset p4pending}
}
refresh {
if {$p4(mcItem) == "pending"} {
set force force
} {
set force noshow
}
# OLD: We don't try to detect Pending changes to automatically refresh the depot as well.
###### array set oldP [array get Pend *:icon]
# It's OK to keep nested dirs open even if the parent is currently closed (unlike
# the Depot tree) because all data is actually retrieved for all levels.
set p4(refreshOpened) ""
foreach dir [array names Pend *isdir] {
if {$Pend($dir)} {
#foreach {w v} [split $dir :] { break }
set v dummy
regexp {(.*):isdir} $dir match v
if {[info exists Pend($v:open)] && $Pend($v:open)} {
lappend p4(refreshOpened) $v
}
}
}
if {[info exists Pend(curselection)]} {
set current $Pend(curselection)
} {
set current ""
}
p4_pendingChangeOptions show $force
if {$current != ""} {
eval Tree:setselection $widget(pendingCanvas) $current
}
}
refreshOLD {
# OLD: This code used to be at the end of the actual "refresh" above.
# OLD: We don't try to detect Pending changes to automatically refresh the depot as well.
######
# Check if the Depot pane needs refreshing as well.
array set newP [array get Pend *:icon]
set refresh 0
foreach l [lsort [array names oldP]] {
if {![info exists newP($l)]} {
if {[string index $oldP($l) 0] == "i"} {
p4_debugMsg "deleted: ${l}:: $oldP($l)"
unset oldP($l)
set refresh 1
#TTD put breaks back in when done debugging.
break
}
} {
if {$oldP($l) != $newP($l)} {
if {![string match *:isdir $l]} {
p4_debugMsg "changed: ${l}:: $oldP($l) != $newP($l)"
set refresh 1
break
}
}
unset oldP($l)
unset newP($l)
}
}
if {!$refresh || $refresh} {
foreach l [lsort [array names newP]] {
if {![info exists oldP($l)] && [string index $newP($l) 0] == "i"} {
p4_debugMsg "added : ${l}:: $newP($l)"
set refresh 1
break
}
}
}
if {$refresh} {
p4_debugMsg "Calling auto refresh on Depot pane..."
p4_treeOptions refresh ;# auto-refresh from pending pane changes (OLD)
}
}
revert {
# This is called for single files from the Depot and Pending panes.
if {[p4_pendingChangeOptions revertConfirm force] == 0} {
set p4pending(ReopenTarget) ""
eval p4_runCommand checkout revert $args
}
}
revertConfirm {
set force [lindex $args 0]
if {$force == "" && [string first "Unchanged" [$widget(RevertUnchanged_RevertButton) cget -text]] >= 0} {
return 0
} {
bell
return [tk_dialog .tkp4 "TkP4 - revert files" "Reverting file(s) will overwrite any edits to the file(s). Proceed with Revert?" questhead -1 "Revert" "Cancel"]
}
}
revertUnchanged {
set opt [lindex $args 0]
switch $opt {
add {
if {[string first "Change " $p4(RevertUnchanged_ComboValue)] == 0} {
regexp {Change ([0-9]*)} $p4(RevertUnchanged_ComboValue) match chng
set parms "-c $chng"
} {
set parms ""
}
p4_runCommand checkout add [$widget(RevertUnchanged_Listbox) get 0 end] [list [Tree:joinnodes $widget(pendingCanvas) $p4pending(Changelists_myclient) $p4(RevertUnchanged_ComboValue)]] $parms
p4_pendingChangeOptions revertUnchanged cancel
}
cancel {
Window hide $widget(RevertUnchanged)
}
remove {
set idxs [$widget(RevertUnchanged_Listbox) curselection]
set list [$widget(RevertUnchanged_Listbox) get 0 end]
set files ""
for {set idx 0} {$idx < [llength $list]} {incr idx} {
if {[lsearch -exact $idxs $idx] < 0} {
lappend files [lindex $list $idx]
}
}
$widget(RevertUnchanged_Listbox) delete 0 end
eval $widget(RevertUnchanged_Listbox) insert end $files
p4_pendingChangeOptions revertUnchanged selection
}
revert {
# Revert files in listbox. Can be called from:
# Depot pane: "Revert Files..." and setParents != "".
# Pending Pane: "Revert Files..." or "Revert Unchanged Files..."
# and p4(RevertUnchanged_parent) is pre-set.
set setParents [lindex $args 1]
set files [$widget(RevertUnchanged_Listbox) get 0 end]
set revfiles ""
set refreshes ""
set p4pending(ReopenTarget) ""
foreach file $files {
lappend revfiles [string trim [lindex [split $file #] 0]]
}
#TTD widget exist not the right test. Fails after changing clients until you switch back to the Pending pane.
if {$setParents != "" && [info exists p4pending(Changelists_myclient)]} {
# Build a list of parents for Pending pane refresh.
foreach file $files {
if {[regexp {(.*)#([0-9])* - [^ ]* ([^ ]*) ([^ ]*)} $file match x have c1 c2]} {
set changelist ""
if {$c1 == "default"} {
set changelist " Default"
} {
set idx [lsearch -regexp $p4pending(Changelists) "^Change $c2"]
if {$idx >= 0} {
set changelist [lindex $p4pending(Changelists) $idx]
}
}
if {$changelist != "" && [lsearch -exact $refreshes $changelist] < 0} {
lappend refreshes $changelist
#puts "refreshes=$refreshes"
}
}
}
set p4(RevertUnchanged_parent) [list $p4pending(Changelists_myclient)[lindex $refreshes 0]]
set refreshes [lrange $refreshes 1 end]
set p4pending(ReopenTarget) $refreshes
}
if {[p4_pendingChangeOptions revertConfirm] == 0} {
p4_runCommand checkout revert $revfiles $p4(RevertUnchanged_parent)
}
p4_pendingChangeOptions revertUnchanged cancel
}
selection {
if {[$widget(RevertUnchanged_Listbox) curselection] == ""} {
$widget(RevertUnchanged_RemoveButton) config -state disabled
} {
$widget(RevertUnchanged_RemoveButton) config -state normal
}
}
show {
busy_cursor set
set v2 [lindex $args 1]
set v1 [lindex $args 2]
set mode [lindex $args 3]
#puts "v1=$v1 v2=$v2"
set p4(RevertUnchanged_mode) $mode
set p4(RevertUnchanged_parent) $v1
if {$mode == "revert"} {
# Pending Pane: "Revert Unchanged Files..."
set files ""
set revfiles ""
foreach file $v2 {
lappend files [string trim [lindex [split $file #] 0]]
}
p4_logOptions log "Executing p4 diff -sr $files"
set stat [catch {eval exec $p4(exec) -s diff -sr $files} rep]
if {$stat != 0 && [string first "not opened" $rep] < 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 diff -sr error" $rep error 0 "OK"
busy_cursor clear
return
} {
foreach line [split $rep \n] {
#puts "line1: $line"
regexp {^([^:]*): } $line match type
set file [string range $line [string length $match] end]
#puts "file1: $file"
if {$type == "info"} {
lappend revfiles $file
} elseif {$type == "error"} {
p4_logOptions error "$file"
}
}
}
if {$revfiles == ""} {
p4_logOptions note "Reverted 0 files"
set msg "No files will be reverted because all files\n1) have been changed or deleted or\n2) are new (ADD or BRANCH) files."
tk_dialog .tkp4 "TkP4 - No Unchanged Files" $msg info 0 "OK"
} {
Window show $widget(RevertUnchanged)
pack forget $widget(RevertUnchanged_Frame).combo
$widget(RevertUnchanged_RemoveButton) config -state disabled
$widget(RevertUnchanged_Listbox) delete 0 end
wm title $widget(RevertUnchanged) "TkP4 - Unchanged Files for Revert"
$widget(RevertUnchanged_RevertButton) config -text "Revert Unchanged Files" -command [list p4_pendingChangeOptions revertUnchanged revert]
foreach file $revfiles {
#puts "unchanged file: $file
$widget(RevertUnchanged_Listbox) insert end $file
}
}
} elseif {$mode == "revertAll"} {
# Pending Pane: "Revert Files..."
set revfiles $v2
Window show $widget(RevertUnchanged)
pack forget $widget(RevertUnchanged_Frame).combo
$widget(RevertUnchanged_RemoveButton) config -state disabled
$widget(RevertUnchanged_Listbox) delete 0 end
wm title $widget(RevertUnchanged) "TkP4 - Choose Files for Revert"
$widget(RevertUnchanged_RevertButton) config -text "Revert Files" -command [list p4_pendingChangeOptions revertUnchanged revert]
eval $widget(RevertUnchanged_Listbox) insert end $revfiles
} elseif {$mode == "revertAllDepot"} {
# Depot pane: "Revert Files..."
set revfiles ""
set p4(RevertUnchanged_parent) $v1
p4_logOptions log "Executing p4 opened $v2"
set stat [catch {eval exec $p4(exec) -s opened $v2 } rep]
if {$stat != 0 && [string first "not opened" $rep] < 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 p4 opened error" [join [lrange [split $rep \n] 0 10] \n] error 0 "OK"
busy_cursor clear
return
} {
foreach line [split $rep \n] {
regexp {^([^:]*): } $line match type
set file [string range $line [string length $match] end]
if {$type == "info"} {
lappend revfiles $file
} elseif {$type == "error" && [string first "not opened" $rep] < 0} {
p4_logOptions error "$file"
}
}
}
if {$revfiles == ""} {
#p4_logOptions note "Reverted 0 files"
set msg "No open files found to revert."
tk_dialog .tkp4 "TkP4 - No open Files" $msg info 0 "OK"
} {
Window show $widget(RevertUnchanged)
pack forget $widget(RevertUnchanged_Frame).combo
$widget(RevertUnchanged_RemoveButton) config -state disabled
$widget(RevertUnchanged_Listbox) delete 0 end
wm title $widget(RevertUnchanged) "TkP4 - Choose Files for Revert"
$widget(RevertUnchanged_RevertButton) config -text "Revert Files" -command [list p4_pendingChangeOptions revertUnchanged revert setParents]
eval $widget(RevertUnchanged_Listbox) insert end $revfiles
}
} {
# add files to depot mode
if {![info exists Pend]} {
# We haven't built the Pending tree yet!
p4_pendingChangeOptions refresh ;# add files to depot - We haven't built the Pending tree yet
}
set dir [lindex $v2 0]
set newfiles [p4_findFiles $dir $v1]
#puts "dir=$dir v1=$v1 newfiles=$newfiles"
if {$newfiles != ""} {
# Remove files that are already in the Depot.
p4_logOptions log "Executing p4 files $newfiles"
if {[catch {eval exec $p4(exec) -s files $newfiles} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 files error" $rep error 0 "OK"
busy_cursor clear
return
} {
set newfiles ""
foreach line [split $rep \n] {
#puts "line: $line"
regexp {^([^:]*): } $line match type
set line [string range $line [string length $match] end]
#puts "line: $line"
if {$type == "error"} {
if {[regexp {^(.*) - no such file} $line match file]} {
#puts "file: $file"
lappend newfiles $file
} {
# Covers:
# - file(s) not in client view.
# - no mappings in client view.
p4_logOptions error "$line"
bell
tk_dialog .tkp4 "TkP4 - p4 files error" $line error 0 "OK"
busy_cursor clear
return
}
}
}
}
}
set addfiles ""
if {$newfiles != ""} {
# Remove files that are already opened for add.
p4_logOptions log "Executing p4 opened $newfiles"
if {[catch {eval exec $p4(exec) -s opened $newfiles} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - p4 opened error" $rep error 0 "OK"
busy_cursor clear
return
} {
set addfiles ""
foreach line [split $rep \n] {
#puts "line: $line"
regexp {^([^:]*): } $line match type
set line [string range $line [string length $match] end]
#puts "line: $line"
if {$type == "error"} {
regexp {^(.*) - file\(s\) not opened} $line match file
#puts "file: $file"
lappend addfiles $file
} elseif {$type == "info"} {
set file [string trim [lindex [split $line #] 0]]
p4_logOptions error "$file - already opened for add"
}
}
}
}
if {$addfiles == ""} {
p4_logOptions note "Added 0 files"
set msg "No files found to add to Depot."
tk_dialog .tkp4 "TkP4 - No New Files" $msg info 0 "OK"
} {
Window show $widget(RevertUnchanged)
$widget(RevertUnchanged_RemoveButton) config -state disabled
$widget(RevertUnchanged_Listbox) delete 0 end
wm title $widget(RevertUnchanged) "TkP4 - Add new files to Changelist"
$widget(RevertUnchanged_RevertButton) config -text "Add Files" -command [list p4_pendingChangeOptions revertUnchanged add]
foreach file $addfiles {
$widget(RevertUnchanged_Listbox) insert end $file
}
set cf $widget(RevertUnchanged_Frame).combo
if {![winfo exists $cf]} {
frame $cf
label $cf.lab -text "Add to Changelist: "
combobox $cf.cb -textvariable p4(RevertUnchanged_ComboValue) -editable 0
pack $cf.cb $cf.lab -side right
}
pack $cf -side top -before $widget(RevertUnchanged_ListboxFrame) -anchor e -pady 10
$cf.cb list delete 0 end
#puts changelists=$p4pending(Changelists)
eval $cf.cb list insert end $p4pending(Changelists)
set p4(RevertUnchanged_ComboValue) [lindex $p4pending(Changelists) 0]
$cf.cb config -width $p4pending(Changelists_width)
}
}
busy_cursor clear
}
}
}
setTypeHelp {
set type [lindex [.treeContextMenu.type entrycget active -label] 2]
if {$type == ""} {
set p4(FileInfoText) ""
} {
set p4(FileInfoText) "Reopen file as $type $p4tooltips(ftype$type)"
}
}
show {
set force [lindex $args 0]
if {$force == "" && $p4(prevmcItem) == "pending"} {
return
}
if {$env(P4CLIENT) == ""} {
bell
tk_dialog .tkp4warn "TkP4 - no clientspec selected" "Can't show changelists; no Clientspec is selected." error 0 "OK"
set p4(mcItem) $p4(prevmcItem)
return
}
set base $widget(mcListboxFrame).pending
if {$force != ""} {
destroy $base
}
set widget(pendingCanvas) $base.c
if {$force != "noshow" && $p4(prevmcItem) != "pending"} {
# Unpack the current mcListbox and show the Pending pane.
pack forget $widget(mcListboxFrame).$p4(prevmcItem)
set p4(mcListboxTitle) "Pending Perforce Changelists"
set p4(mcItem) pending
set p4(prevmcItem) $p4(mcItem)
}
if {[winfo exists $base]} {
pack $base -anchor center -expand 1 -fill both -side top
return
}
Tree:deltree $widget(pendingCanvas)
destroy $base
busy_cursor set
# Only need this if we make it global:
catch {unset p4changes}
p4_logOptions log "Executing p4 changes -s pending"
#set data [exec $p4(exec) changes -s pending]
if {[catch {exec $p4(exec) changes -s pending} data]} {
bell
tk_dialog .tkp4RunCommandError "TkP4 - Run P4 Command Error" "Error running command:\n\np4 changes -s pending\n\n$data" error 0 OK
busy_cursor clear
return
}
frame $base -background grey85 -borderwidth 0 -height 30 -highlightbackground grey85 -relief flat -width 30
scrollbar $base.sx -background grey85 -borderwidth 1 -command "$base.c xview" -highlightbackground grey85 -highlightthickness 0 -orient horiz -width 10
scrollbar $base.sy -background grey85 -borderwidth 1 -command "$base.c yview" -highlightbackground grey85 -highlightthickness 0 -orient vert -width 10
canvas $base.c -background white -borderwidth 1 -height 100 -highlightbackground grey85 -highlightthickness 0 -relief sunken -width 100 -xscrollcommand "$base.sx set" -yscrollcommand "$base.sy set"
bind $base.c <B2-Motion> {
set curx [%W canvasx [winfo x %W]]
set cury [%W canvasy [winfo y %W]]
foreach {minx miny a b} [%W bbox all] { break }
if {$curx - ((%x - $p4(pendx)) * 10) < $minx} {
set p4(pendx) [expr {int(($curx - $minx) / 10.0 + $p4(pendx))}]
} {
set p4(pendx) %x
}
if {$cury - ((%y - $p4(pendy)) * 10) < $miny} {
set p4(pendy) [expr {int(($cury - $miny) / 10.0 + $p4(pendy))}]
} {
set p4(pendy) %y
}
%W scan dragto $p4(pendx) $p4(pendy)
}
bind $base.c <Button-2> {
set p4(pendx) %x
set p4(pendy) %y
%W scan mark %x %y
}
bind $base.c <Enter> { set Pend(PointerInCanvas) 1 }
bind $base.c <Leave> { set Pend(PointerInCanvas) 0 }
if {$force != "noshow"} {
pack $base -anchor center -expand 1 -fill both -side top
}
grid columnconf $base 0 -weight 1
grid rowconf $base 0 -weight 1
grid $base.sx -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.sy -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.c -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
set Pend(opencmd) "p4_pendingChangeOptionsOpen"
set Pend(contextcmd) "p4_pendingChangeOptions showContextMenu"
set Pend(dragablecmd) "p4_pendingChangeOptions dragable"
set Pend(dropablecmd) "p4_pendingChangeOptions dropable"
set Pend(dropcmd) "p4_pendingChangeOptions drop"
set w $widget(pendingCanvas)
Tree:create $w Pend ""
Tree:buildafter $w 5000
set Pend(colapseEmptyDirs) 1
set Pend(dragndrop) 1
# Grab a copy of the refresh info.
set opened [lsort $p4(refreshOpened)]
set p4(refreshOpened) ""
set otherOpened [lsort $p4(otherRefreshOpened)]
set p4(otherRefreshOpened) ""
if {[info exists p4pending]} {
array set dirs [array get p4pending]
unset p4pending
}
#catch {unset p4files}
set myclient "Pending Changelists (client `$env(P4CLIENT)')"
set p4pending(Changelists_myclient) $myclient
set others "Pending Changelists (other clients)"
set p4pending(Changelists_others) $others
set default [Tree:joinnodes $w $myclient " Default"]
Tree:newitem $w {} $myclient -image pthispending -type dir -sortdic 1
Tree:newitem $w {} $others -image pthosepending -type dir -sortdic 1
Tree:newitem $w $myclient " Default" -image pmypending -type dir -sortdic 1
set p4pending($myclient:diridx) 0
set p4pending($myclient:parent) {}
set p4pending($others:diridx) 0
set p4pending($others:parent) {}
set p4pending($default:diridx) [string length $myclient]
set p4pending($default:parent) $myclient
set p4pending(dropFile) {}
if {[lsearch -exact $opened $others] < 0} {
#puts "others not open"
set whichones "justThisClient"
set p4pending(Changelists_others_valid) 0
} {
#puts "others open"
set whichones "all"
set p4pending(Changelists_others_valid) 1
}
foreach line [split $data \n] {
regexp {[^ ]* ([^ ]*) on ([^ ]*) by ([^ ]*)@([^ ]*) \*([^ ]*)\* '(.*)'} $line match c2 d u c s desc
set p4changes($c2) [string trim $desc]
# This is necessary because empty numbered Changelists only show up in "p4 changes".
if {$c == $env(P4CLIENT) && $u == $env(P4USER)} {
set n1 $myclient
set n2 "Change $c2 \{$p4changes($c2)...\}"
set image pmypending
} {
if {$c == $env(P4CLIENT)} {
set n1 $myclient
set image pyourpending
} {
set n1 $others
set image potherpending
}
set n2 "Change $c2 - $u@$c \{$p4changes($c2)...\}"
}
catch {Tree:newitem $w $n1 $n2 -image $image -type dir -sortdic 1}
set p4pending($n1$n2:diridx) [string length $n1]
set p4pending($n1$n2:parent) $n1
}
# foreach n [lsort -dictionary [array names p4pending $p4pending(Changelists_others)*]] {
# if {![string match "$p4pending(Changelists_others):*" $n]} {
# puts "REMOVING pending other names=$n"
# unset p4pending($n)
# }
# }
p4_pendingChangeOptions getOpened $whichones
# Open the dirs that were open before (if they still exist).
foreach ddir $otherOpened {
# This is the new changelist created for the failed submission.
if {[string index $ddir 0] == "*"} {
set dirname [lindex [split [lindex [array names Pend $ddir] 0] :] 0]
lappend opened $dirname
array set dirs [array get p4pending $dirname:*]
}
}
foreach ddir $opened {
if {$ddir != "" && [info exists Pend($ddir:isdir)] && !$Pend($ddir:open)} {
#puts "reopening Tree:open $w $dirs($ddir:parent) [string range $ddir $dirs($ddir:diridx) end]"
Tree:open $w $dirs($ddir:parent) [string range $ddir $dirs($ddir:diridx) end]
}
}
Tree:buildafter $w idle
busy_cursor clear
}
showContextMenu {
foreach {w v rootx rooty} $args { break }
#puts "w=$w v=$v rootx=$rootx rooty=$rooty"
set m .treeContextMenu
catch {destroy $m}
menu $m -tearoff false
if {$v == [list {} {}]} {
$m add command -label "New Changelist..." -command "p4_pendingChangeOptions editChangelist edit new"
$m add checkbutton -label "(Sort Files by Extension)" -command "p4_pendingChangeOptions refresh" -offvalue 0 -onvalue 1 -variable p4(disp_sortPendingByExtension) -state disabled
$m add command -label "Refresh" -command "p4_refresh pendingPane"
tk_popup $m $rootx $rooty
return
}
foreach {v1 v2} $v { break }
set vv [eval Tree:joinnodes $w $v]
#puts " v=$v len=[llength $v]"
#puts "vv=$vv len=[llength $vv]"
#puts "v1=$v1"
#puts "v2=$v2"
# TTD This is temporary until the Tree supports multiple selections.
if {[llength $v] != 2} {
set type ""
} {
set type ""
regexp {<(.*)><.*>} $v match type
}
if {$Pend($vv:isdir)} {
# icons: pthispending, pmypending, pyourpending; pthosepending, potherpending.
set icon $Pend($vv:icon)
if {$icon == "pmypending"} {
if {[llength $Pend($vv:children)] > 0} {
set chng ""
regexp {Change( [0-9]*)} $v2 match chng
$m add command -label "Submit Changelist$chng..." -command "p4_pendingChangeOptions editChangelist submit $chng"
$m add separator
}
if {[string first "Change " $v2] == 0} {
# Add the affected files manually if the changelist is still pending.
if {[llength $Pend($vv:children)] > 0} {
set files $Pend($vv:children)
} {
set files [list "(empty changelist)"]
}
regexp {Change ([0-9]*)} $v2 match chng
$m add command -label "Edit Changelist $chng" -command "p4_pendingChangeOptions editChangelist edit $chng"
$m add command -label "Describe Changelist $chng" -command "p4_changeOptions view $chng [list $files] pending editbutton noprevnext noshowdiffs"
$m add command -label "(Add Job Fix...)" -state disabled
}
if {[llength $Pend($vv:children)] > 0} {
$m add command -label "Revert Files..." -command [list p4_pendingChangeOptions revertUnchanged show $Pend($vv:children) [list $vv] revertAll]
$m add command -label "Revert Unchanged Files..." -command [list p4_pendingChangeOptions revertUnchanged show $Pend($vv:children) [list $vv] revert]
$m add command -label "Lock" -command [list p4_runCommand checkout lock $Pend($vv:children) [list $vv]]
$m add command -label "Unlock" -command [list p4_runCommand checkout unlock $Pend($vv:children) [list $vv]]
$m add cascade -label "Resolve Files" -menu $m.resolve
menu $m.resolve -tearoff no
$m.resolve add command -label "(Interactively)" -state disabled
$m.resolve add command -label "Auto-Resolve Files..." -command [list p4_autoResolve show $Pend($vv:children) [list [Tree:joinnodes $w $v1 $v2]]]
$m.resolve add command -label "Schedule Files for Resolve" -command [list p4_runCommand sync {} {} {} $Pend($vv:children)]
$m add separator
} {
if {[string first "Change " $v2] == 0} {
regexp {Change ([0-9]*)} $v2 match chng
$m add command -label "Delete Empty Changelist $chng" -command "p4_pendingChangeOptions delete $chng [list $v]"
$m add separator
}
}
#elseif {[string first "other clients" $v1] >= 0}
} elseif {$icon == "pyourpending" || $icon == "potherpending"} {
if {[string first "Change " $v2] == 0} {
# Add the affected files manually if the changelist is still pending.
if {[llength $Pend($vv:children)] > 0} {
set files $Pend($vv:children)
} {
set files [list "(empty changelist)"]
}
regexp {Change ([0-9]*)} $v2 match chng
$m add command -label "Describe Changelist $chng" -command "p4_changeOptions view $chng [list $files] pending noeditbutton noprevnext noshowdiffs"
} {
$m add command -label "Describe" -state disabled
}
$m add separator
}
} {
#puts "files parent icon=$Pend($v1:icon) file=$v2"
#puts "v1=$v1 v2=$v2"
#set file [string trim [lindex [split $v2 #] 0]]
regexp {(.*)#([0-9])* <(.*)><(.*)>} $v2 match file2 have type action
#puts "v2=$v2 file=$file file2=$file2 have=$have type=$type action=$action"
set diffState normal
set histState normal
set propState normal
if {$action != "edit"} {
set diffState disabled
}
if {[lsearch -exact {add branch} $action] >= 0} {
set histState disabled
set propState disabled
}
set needAddExplore 0
set icon $Pend($v1:icon)
if {$icon == "pmypending"} {
set needAddExplore 1
$m add cascade -label "Edit File Using" -menu $m.edit
menu $m.edit -tearoff no
$m.edit add command -label "(Associated Editor)" -command "p4_ $w $v" -state disabled
$m.edit add command -label "(Other Editor...)" -command "p4_ $w $v" -state disabled
if {$action == "branch"} {
# P4Win says Reopen for Edit for both branch and integrate. :-(
$m add command -label "Reopen for Add" -command [list p4_runCommand checkout edit [list $v2] [list $v1]]
}
if {$action == "integrate"} {
$m add command -label "Reopen for Edit" -command [list p4_runCommand checkout edit [list $v2] [list $v1]]
}
$m add command -label "Diff File Against Depot" -command "p4_diffDepot [list $v2]" -state $diffState
$m add command -label "Change File Type..." -command "p4_pendingChangeOptions changeFileType show [list $v2] [list $v1]"
if {$p4pending([Tree:joinnodes $w $v1 $v2]:locked)} {
$m add command -label "Unlock" -command [list p4_runCommand checkout unlock [list $v2] [list $v1]]
} {
$m add command -label "Lock" -command [list p4_runCommand checkout lock [list $v2] [list $v1]]
}
$m add cascade -label "Resolve" -menu $m.resolve
menu $m.resolve -tearoff no
$m.resolve add command -label "(Interactively)" -state disabled
$m.resolve add command -label "Auto-Resolve..." -command [list p4_autoResolve show [list $v2] [list $v1]]
$m.resolve add command -label "Schedule File for Resolve" -command [list p4_runCommand sync {} {} {} [list $v2]]
$m add separator
$m add command -label "Revert" -command [list p4_pendingChangeOptions revert [list $v2] [list $v1]]
$m add separator
}
$m add command -label "Properties..." -command "p4_fileInfo show [list $v2]" -state $propState
$m add command -label "Revision History..." -command "p4_revisionHistory show [list $v2]" -state $histState
$m add command -label "(Find in Depot)" -command "p4_xxx xxx [list $v2]" -state disabled
$m add command -label "(Explore...)" -command "p4_xxx xxx [list $v2]" -state disabled
set commandPromptFile [string trim [lindex [split $v2 #] 0]]
$m add command -label "Command Prompt..." -command "p4_externalCommand commandPrompt $commandPromptFile"
$m add separator
}
$m add command -label "New Changelist..." -command "p4_pendingChangeOptions editChangelist edit new"
$m add checkbutton -label "(Sort Files by Extension)" -command "p4_pendingChangeOptions refresh" -offvalue 0 -onvalue 1 -variable p4(disp_sortPendingByExtension) -state disabled
if {$Pend($vv:isdir)} {
set user ""
set client ""
regexp {([^ ]*)@([^ ]*)} $v2 match user client
if {$user != ""} {
if {$user != $env(P4USER)} {
set userstate normal
} {
set userstate disabled
}
if {$client != $env(P4CLIENT)} {
set clientstate normal
} {
set clientstate disabled
}
$m add command -label "Switch to User $user" -state $userstate -command [list p4_userOptions switch $user]
$m add command -label "Switch to Client $client" -state $clientstate -command [list p4_clientOptions switch $client]
}
}
$m add command -label "Refresh" -command "p4_refresh pendingPane"
tk_popup $m $rootx $rooty
}
update {
set item $p4(itemSpec)
# puts "p4(itemSpec)=$p4(itemSpec) p4(mcItem)=$p4(mcItem)"
busy_cursor set
set mode [lindex $args 0]
if {$mode != "submit"} {
# Check for changes before updating.
if {[p4_itemOptions checkIfChanged] == 0} {
bell
tk_dialog .tkp4 "TkP4 - No edit changes" "No changes have been made." info 0 "OK"
update idletasks
after 10
raise $widget(itemSpecWindow)
busy_cursor clear
return
}
}
set text [p4_itemOptions getFormFields]
if {$text == -1} {
update idletasks
after 10
raise $widget(itemSpecWindow)
busy_cursor clear
return
}
set item $p4(itemSpec)
set f ""
if {$mode == "submit"} {
set cmd "submit"
} {
# update mode
set cmd "change"
if {$p4(changeEdit_Status_value) == "submitted"} {
# This is an update to a submitted changelist.
# This -f is OK. It only works for superusers, but the error message for non-superusers is OK.
set f " -f"
}
}
# Check if attempt to submit with no files.
if {$mode == "submit" && $p4(changeEdit_Files_newnfiles) == 0} {
bell
tk_dialog .tkp4 "TkP4 - Submit Changelist error" "You cannot submit a changelist unless there are files selected to be included in the submission." error 0 "OK"
busy_cursor clear
return
}
set mustResolve 0
p4_logOptions log "Executing p4 $cmd -i$f"
if {[set stat [catch {eval exec $p4(exec) $cmd -i$f {<< $text}} rep]]} {
if {[string first "- must resolve" $rep] < 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - $cmd Changelist error" $rep error 0 "OK"
} {
set mustResolve 1
}
}
#TTD Any other errors here that might need to force refresh and close edit dialog?
if {$stat == 0 || [string first "No files to submit" $rep] >= 0 || $mustResolve} {
grab release $widget(itemSpecWindow)
p4_itemOptions hide
foreach line [split $rep \n] {
if {$mustResolve} {
if {[string first "Submitting change " $line] >= 0} {
continue
}
if {[string first "Submit failed -- fix " $line] >= 0} {
set line "Submit failed - Correct problems above and then re-submit."
}
set type error
} elseif {[string first "created" $line] >= 0 || [string first "submitted" $line] >= 0 || [string first "updated" $line] >= 0 } {
set type note
} {
set type log
}
p4_logOptions $type "$line"
if {[string first "created" $line] >= 0} {
# Grab a copy of the new changelist created for the failed submission.
set changelist ""
regexp {(Change [0-9]*)} $line match changelist
if {$changelist != ""} {
lappend p4(otherRefreshOpened) "*$changelist *\}:isdir"
}
}
}
if {[string first "- must resolve" $rep] >= 0} {
set msg "Merges still pending - use 'resolve' to merge files.\nSubmit failed - Correct problems above and then re-submit."
bell
tk_dialog .tkp4 "TkP4 - $cmd Changelist error" $msg error 0 "OK"
# TTD: it would be nice to set a flag here to open the changelist that contains the unresolved files.
}
# if {$mode == "submit" || $p4(changeEdit_Files_nfiles) != $p4(changeEdit_Files_newnfiles)}
# if {$p4(mcItem) == "pending"} {
# if {$mode == "submit" || $p4(changeEdit_Files_nfiles) != $p4(changeEdit_Files_newnfiles)} {
# # This refreshes both the Pending tree and the Depot pane.
# p4_refresh pendingPane
# } {
# }
# } {
# # This was a submitted changelist.
# # We don't need to refresh if we only editted a submitted changelist.
# # It would be nice to update the description in the listbox, but the edit may have originated from other than the main submitted changelist pane.
# }
if {$p4(changeEdit_Status_value) == "submitted"} {
# This was a submitted changelist.
# We don't need to refresh if we only editted a submitted changelist.
# It would be nice to update the description in the listbox, but the edit may have originated from other than the main submitted changelist pane.
} {
# This refreshes both the Pending tree and the Depot pane (overkill if just the description changed).
p4_refresh pendingPane
}
}
busy_cursor clear
}
}
}
proc {p4_pendingChangeOptionsOpen} {args} {
global p4pending
if {!$p4pending(Changelists_others_valid) && [lindex $args 2] == $p4pending(Changelists_others)} {
busy_cursor set
p4_pendingChangeOptions getOpened justOtherClients
set p4pending(Changelists_others_valid) 1
busy_cursor clear
}
}
proc {p4_postMenu} {opt args} {
global p4 Tree widget
switch $opt {
view {
if {$Tree(curselection) == "{} {}"} {
$widget(Menu_View) entryconfig "Changelists - Submitted / Filtered" -state disabled
} {
$widget(Menu_View) entryconfig "Changelists - Submitted / Filtered" -state normal
}
}
}
}
proc {p4_refresh} {opt args} {
global p4pending
switch $opt {
depotPane {
p4_treeOptions refresh ;# p4_refresh
p4_pendingChangeOptions refresh ;# p4_refresh
}
pendingPane {
p4_treeOptions refresh ;# p4_refresh
p4_pendingChangeOptions refresh ;# p4_refresh
#foreach n [lsort -dictionary [array names p4pending]] {
# puts "pending=p4pending($n)"
#}
#puts p4pending(Changelists_others_valid)=$p4pending(Changelists_others_valid)
}
}
}
proc {p4_rename} {opt args} {
global widget p4 p4files Tree p4pending Pend env
switch $opt {
renameRemove {
set idxs [$widget(Rename_RenameListbox) curselection]
set list [$widget(Rename_RenameListbox) get 0 end]
set files ""
for {set idx 0} {$idx < [llength $list]} {incr idx} {
if {[lsearch -exact $idxs $idx] < 0} {
lappend files [lindex $list $idx]
}
}
$widget(Rename_RenameListbox) delete 0 end
eval $widget(Rename_RenameListbox) insert end $files
p4_rename renameSelection
}
renameSelection {
if {[$widget(Rename_RenameListbox) curselection] == ""} {
$widget(Rename_RenameRemoveButton) config -state disabled
} {
$widget(Rename_RenameRemoveButton) config -state normal
}
}
show {
#TTD add more comments
#TTD remove unnecessary refreshes.
set mode [lindex $args 0]
set vv [string trim [lindex [split [lindex [lindex $args 1] 0] #] 0]]
set vv [string trimright $vv "/."]
#puts vv=$vv
set p4(RenameOldName) $vv
set p4(RenameNewName) $vv
set p4(RenameGotNewname) ""
if {![winfo exists $widget(Rename_GetNewName)]} {
Window show $widget(Rename_GetNewName)
Window hide $widget(Rename_GetNewName)
}
if {$mode == "file"} {
set p4(RenameEntireDirectory) ""
pack forget $widget(Rename_GetNewName_OptionFrame)
} {
set p4(RenameEntireDirectory) dir
pack $widget(Rename_GetNewName_OptionFrame) -anchor center -expand 0 -fill x -pady 10 -side top -before $widget(Rename_GetNewName_ButtonFrame)
}
wm geometry $widget(Rename_GetNewName) ""
update idletasks
Window show $widget(Rename_GetNewName)
while {$p4(RenameGotNewname) != "cancel" && $p4(RenameOldName) == $p4(RenameNewName)} {
tkwait variable p4(RenameGotNewname)
if {$p4(RenameGotNewname) != "cancel" && $p4(RenameOldName) == $p4(RenameNewName)} {
bell
tk_dialog .tkp4 "TkP4 - error" "Please enter a valid name for the rename" error 0 "OK"
}
}
Window hide $widget(Rename_GetNewName)
if {$p4(RenameGotNewname) == "cancel"} {
return
}
if {![info exists Pend]} {
# We haven't built the Pending tree yet!
p4_pendingChangeOptions refresh ;# rename We haven't built the Pending tree yet!
}
# TTD: this fails if another user has a rename changelist using our client!
set names [array names p4pending "$p4pending(Changelists_myclient)Change * {TkP4 - RENAME...}:diridx"]
set idx [lsearch -regexp $names {.*Change [0-9]* {TkP4 - RENAME...}:diridx}]
set renameChange [lindex $names $idx]
p4_debugMsg "names=$names idx=$idx name=$renameChange"
if {$renameChange == ""} {
p4_debugMsg "No current rename changelist; creating one..."
set text "Change: new\nClient: $env(P4CLIENT)\nUser: $env(P4USER)\nStatus: new\nDescription:\n\tTkP4 - RENAME"
p4_logOptions log "Executing p4 change -i"
if {[catch {eval exec $p4(exec) change -i {<< $text}} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - change error" [join [lrange [split $rep \n] 0 10] \n] error 0 "OK"
return
}
foreach line [split $rep \n] {
if {[string first "submitted" $line] >= 0} {
set type note
} {
set type log
}
p4_logOptions $type "$line"
}
p4_pendingChangeOptions refresh ;# rename
set names [array names p4pending "$p4pending(Changelists_myclient)Change * {TkP4 - RENAME...}:diridx"]
set idx [lsearch -regexp $names {.*Change [0-9]* {TkP4 - RENAME...}:diridx}]
set renameChange [lindex $names $idx]
p4_debugMsg "names=$names idx=$idx name=$renameChange"
}
regexp {Change ([0-9]*) } $renameChange match chng
set changelist [string range $renameChange $p4pending($renameChange) end]
set changelist [lindex [split $changelist :] 0]
p4_debugMsg "chng=$chng changelist=$changelist"
if {$mode == "file"} {
set filespec $vv
} {
set filespec $vv/...
}
p4_logOptions log "Executing p4 files $filespec"
if {[catch {exec $p4(exec) files $filespec} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - files error" [join [lrange [split $rep \n] 0 10] \n] error 0 "OK"
return
}
p4_debugMsg allfilesRep=$rep
set allfiles ""
foreach line [split $rep \n] {
# Omit deleted files from rename
if {[string first " - delete " $line] < 0} {
lappend allfiles [lindex [split $line #] 0]
}
}
p4_debugMsg allfiles=$allfiles
p4_logOptions log "Executing p4 opened -a $filespec"
if {[catch {exec $p4(exec) opened -a $filespec} rep]} {
if {[string first "not opened" $rep] < 0} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - opened error" [join [lrange [split $rep \n] 0 10] \n] error 0 "OK"
return
} {
set rep ""
}
}
p4_debugMsg openedRep=$rep
set opened ""
foreach line [split $rep \n] {
set file [lindex [split $line #] 0]
if {[lsearch -glob $opened ${file}#*] < 0} {
lappend opened $file
}
}
p4_debugMsg opened:$opened
set files ""
if {[llength $opened] == 0} {
set files $allfiles
} {
if {$mode == "file"} {
# You can't normally get here from the Depot Pane, since the Rename option
# is disabled if the file is open. However, this assumes that the Pane is
# up-to-date. Somebody else may have recently opened the file!
bell
tk_dialog .tkp4 "TkP4 - Cannot Rename Open Files" "You cannot rename open files.\n\nThis source file is open.\n\n(Perhaps you need to refresh the Depot pane)" error 0 "OK"
return
}
Window show $widget(Rename_EdittedFiles)
$widget(Rename_EdittedFiles_label) config -text "Open Source Files"
$widget(Rename_EdittedFiles_message) config -text {You probably shouldn't rename files that are currently checked out for edit, and you certainly cannot rename files that are locked. The following files are currently checked out.}
$widget(Rename_EdittedFilesListbox) delete 0 end
eval $widget(Rename_EdittedFilesListbox) insert end [split $rep \n]
tkwait variable p4(RenameEdittedFilesOpt)
Window hide $widget(Rename_EdittedFiles)
if {$p4(RenameEdittedFilesOpt) == "cancel"} {
return
}
# Remove these opened files from the list of files to rename.
foreach file $allfiles {
if {[set idx [lsearch -exact $opened $file]] < 0} {
lappend files $file
}
}
if {$files == ""} {
bell
tk_dialog .tkp4 "TkP4 - no files" "No unopened files remain for rename!" error 0 "OK"
return
}
}
p4_debugMsg openreducedFiles:$files
# Now check if any of the target files exist.
if {$mode == "file"} {
set sourcefiles $p4(RenameOldName)
set targetfiles [list $p4(RenameNewName)]
set targetfilespec $p4(RenameNewName)
} {
set targetfilespec $p4(RenameNewName)/...
set targetfiles ""
set idx [string length $p4(RenameOldName)]
foreach file $files {
lappend targetfiles $p4(RenameNewName)[string range $file $idx end]
}
}
p4_debugMsg targetfiles:$targetfiles
p4_logOptions log "Executing p4 files $targetfiles"
if {[catch {eval exec $p4(exec) files $targetfiles 2>@ stdout} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - files error" [join [lrange [split $rep \n] 0 10] \n] error 0 "OK"
return
}
p4_debugMsg existingtargetsRep=$rep
set existingfiles ""
foreach line [split $rep \n] {
if {[string first " no such file" $line] < 0} {
lappend existingfiles [lindex [split $line #] 0]
}
}
p4_debugMsg existingfiles=$existingfiles
set sourcefiles $files
set omitfiles $opened
if {[llength $existingfiles] > 0} {
if {$mode == "file"} {
bell
set ans [tk_dialog .tkp4 "TkP4 - no files" "You cannot rename files to existing target names. The target file already exists:\n\n$rep" error 0 "OK" "Revision History"]
if {$ans == "1"} {
p4_revisionHistory show [lindex $existingfiles 0]
}
return
}
Window show $widget(Rename_EdittedFiles)
$widget(Rename_EdittedFiles_label) config -text "Existing Target Files"
$widget(Rename_EdittedFiles_message) config -text {You cannot rename files to existing target names. The following target files already exist. (Revision History is available on the right mouse button)}
$widget(Rename_EdittedFilesListbox) delete 0 end
eval $widget(Rename_EdittedFilesListbox) insert end $existingfiles
tkwait variable p4(RenameEdittedFilesOpt)
Window hide $widget(Rename_EdittedFiles)
if {$p4(RenameEdittedFilesOpt) == "cancel"} {
return
}
# Remove these existing files from the list of files to rename and add to the omit list.
set sourcefiles ""
set targetfiles ""
set idx [string length $p4(RenameOldName)]
foreach file $files {
p4_debugMsg file=$file
set targetfile $p4(RenameNewName)[string range $file $idx end]
p4_debugMsg targetfile=$targetfile
if {[lsearch -exact $existingfiles $targetfile] < 0} {
lappend sourcefiles $file
lappend targetfiles $targetfile
} {
lappend omitfiles $file
}
}
if {$sourcefiles == ""} {
bell
tk_dialog .tkp4 "TkP4 - no files" "No unopened files remain for rename!" error 0 "OK"
return
}
}
p4_debugMsg sourcefiles=$sourcefiles
p4_debugMsg targetfiles=$targetfiles
p4_debugMsg afterExistingCheckomitfiles=$omitfiles
if {$p4(RenameEntireDirectory) == "choose"} {
# Choose files from directory for rename.
Window show $widget(Rename_Rename)
$widget(Rename_RenameLabel) config -text "Rename Files (Changelist: $changelist)"
$widget(Rename_RenameRemoveButton) config -state disabled
$widget(Rename_RenameListbox) delete 0 end
eval $widget(Rename_RenameListbox) insert end $sourcefiles
tkwait variable p4(RenameRenameOpt)
Window hide $widget(Rename_Rename)
if {$p4(RenameRenameOpt) == "cancel"} {
return
}
set files $sourcefiles
set sourcefiles [$widget(Rename_RenameListbox) get 0 end]
# The diff between $files and $sourcefiles gets added to omitfiles.
foreach file $files {
if {[set idx [lsearch -exact $sourcefiles $file]] < 0} {
lappend omitfiles $file
}
}
set targetfiles ""
set idx [string length $p4(RenameOldName)]
foreach file $sourcefiles {
p4_debugMsg file=$file
set targetfile $p4(RenameNewName)[string range $file $idx end]
p4_debugMsg targetfile=$targetfile
lappend targetfiles $targetfile
}
p4_debugMsg afterchoosesourcefiles=$sourcefiles
p4_debugMsg afterchoosetargetfiles=$targetfiles
p4_debugMsg afterchooseomitfiles=$omitfiles
}
if {$omitfiles == ""} {
# Rename single file or entire directory.
set integratefiles [list $filespec $targetfilespec]
# This deletes the single file or entire old directory.
set deletefiles [list $filespec]
} {
#TTD Some files are open or otherwise omitted: need branch spec with omissions for integrate.
set branchspec "TkP4-RENAME-$chng"
set text "Branch: $branchspec\nOwner: $env(P4USER)\nDescription: TkP4 - RENAME\nOptions: locked\nView:"
for {set idx 0} {$idx < [llength $sourcefiles]} {incr idx} {
append text "\n\t\"[lindex $sourcefiles $idx]\" \"[lindex $targetfiles $idx]\""
}
p4_debugMsg branchtext:$text
p4_logOptions log "Executing p4 branch -i"
if {[catch {eval exec $p4(exec) branch -i {<< $text}} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - opened error" [join [lrange [split $rep \n] 0 10] \n] error 0 "OK"
return
}
set integratefiles [list -b $branchspec]
# This deletes the individual files that are being renamed.
set deletefiles $sourcefiles
}
p4_debugMsg "integratefiles:$integratefiles"
p4_debugMsg "omit files:$omitfiles"
p4_debugMsg "delete files:$deletefiles"
set p4(integratePreview) ""
p4_runCommand checkout integrate $integratefiles {} "-c $chng"
tkwait variable p4(runcmdDone)
p4_debugMsg "integrate output: [array get p4 runcmd*]"
if {$p4(runcmdWarning) > 0 || $p4(runcmdDone) < 0 } {
bell
tk_dialog .tkp4 "TkP4 - rename error" "Errors occurred trying to integrate from the old to new names:\n\n[join [lrange $p4(runcmdErrors) 0 3] \n\n]" error 0 "OK"
# It's not too late to return
return -1
}
p4_runCommand checkout delete $deletefiles {} "-c $chng"
tkwait variable p4(runcmdDone)
if {$omitfiles != ""} {
# RickM: removed the -f flag; it only works for superusers.
p4_logOptions log "Executing p4 branch -d $branchspec"
if {[catch {exec $p4(exec) branch -d $branchspec} rep]} {
p4_logOptions error "$rep"
bell
tk_dialog .tkp4 "TkP4 - branch delete error" [join [lrange [split $rep \n] 0 10] \n] error 0 "OK"
# Too late to return...we need to do the refreshes anyway.
#return
}
}
# Refreshing the Pending tree will also refresh the Depot pane, if needed.
#p4_pendingChangeOptions refresh ;# rename (OLD)
p4_refresh pendingPane ;# rename
#p4_treeOptions refresh ;# rename (OLD)
p4_pendingChangeOptions editChangelist submit $chng
}
showContextMenu {
foreach {w x y rootx rooty} $args { break }
set l [$w nearest $y]
$w selection clear 0 end
$w selection set $l
set file [string trim [lindex [split [$w get $l] #] 0]]
set m .contextMenu
catch {destroy $m}
menu $m -tearoff false
$m add command -label "Revision History..." -command "p4_revisionHistory show [list $file]"
tk_popup $m $rootx $rooty
}
}
}
proc {p4_revisionHistory} {opt args} {
global p4 p4files p4revs widget
switch $opt {
describe {
# This is for double-clicking in the mcListboxes.
set idx [$p4(rhListbox) curselection]
#set rev [lindex [lindex [$p4(rhListbox) get $idx] 0] 1]
set chng [lindex [$p4(rhListbox) get $idx] 1]
#set type [lindex [$p4(rhListbox) get $idx] 4]
#set file $p4(RevisionHistoryFile)
#foreach {w x y rootx rooty} $args { break }
p4_changeOptions view $chng {} submitted editbutton revisionHistory showdiffs
}
hide {
Window hide $widget(RevisionHistory)
}
show {
set v [lindex $args 0]
set file [string trim [lindex [split $v #] 0]]
Window show $widget(RevisionHistory)
wm title $widget(RevisionHistory) "TkP4 - Revsion History for $file"
raise $widget(RevisionHistory)
set p4(RevisionHistoryFile) $file
if {![winfo exists $widget(RevisionHistoryMcFrame).revision]} {
set p4(rhListbox) [p4_mcListbox $widget(RevisionHistoryMcFrame).revision {{rev Revision 13} {change Changelist 15} {date Date 11} {user User 24} {type Type 11} {action Action 36}} action]
$p4(rhListbox) config -selectmode extended
global tkPriv
bind $p4(rhListbox) <B1-Motion> {
foreach {x y w} [::mclistbox::convert %W -x %x -y %y -w] { break }
set el [$w index @$x,$y]
if {$el != $tkPriv(listboxPrev)} {
$w selection clear 0 end
$w selection set $el
set tkPriv(listboxPrev) $el
}
}
}
busy_cursor set
$p4(rhListbox) delete 0 end
if {![info exists p4files($file:cfile)]} {
p4_runCommand fstat [list $file]
tkwait variable p4(runcmdDone)
}
if {![info exists p4files($file:cfile)] || $p4files($file:cfile) == ""} {
set rev "not in client view"
} elseif {$p4files($file:have) == 0} {
set rev "not synced in client"
} {
set rev "have revision #$p4files($file:have)"
}
$widget(RevisionHistoryLabel) config -text "Change Summary - $file ($rev)"
p4_logOptions log "Executing p4 filelog -l $file"
set data [exec $p4(exec) filelog -l $file]
set next [string first "... #" $data]
set left [string range $data [incr next 5] end]
while {$left != ""} {
set next [string first "... #" $left]
if {$next < 0} {
set this $left
set left ""
} {
set this [string range $left 0 [expr $next - 1]]
set left [string range $left [incr next 5] end]
}
set lines [split $this \n]
set p4revs([lindex [lindex $lines 0] 0]) "$this"
#puts this=$this
regexp {([^ ]*) [^ ]* ([^ ]*) ([^ ]*) on ([^ ]*) by ([^ ]*) \(([^ ]*)\).*} $this match r c a d u t
$p4(rhListbox) insert end [list "Rev $r" $c $d $u $t $a]
}
p4_mcOptions sort $p4(rhListbox) rev decreasing revisionHistory
$p4(rhListbox) select set 0
busy_cursor clear
}
showContextMenu {
set idx [$p4(rhListbox) curselection]
set rev [lindex [lindex [$p4(rhListbox) get $idx] 0] 1]
set chng [lindex [$p4(rhListbox) get $idx] 1]
#set type [lindex [$p4(rhListbox) get $idx] 4]
#set file $p4(RevisionHistoryFile)
foreach {w x y rootx rooty} $args { break }
set m .contextMenu
catch {destroy $m}
menu $m -tearoff false
$m add cascade -label "View File Using" -menu $m.view
menu $m.view -tearoff no
$m.view add command -label "Associated Viewer" -command "p4_revisionHistory browse"
$m.view add command -label "(Other Viewer...)" -command "p4_" -state disabled
if {![info exists p4files($p4(RevisionHistoryFile):cfile)] || $p4files($p4(RevisionHistoryFile):cfile) == "" || $rev == $p4files($p4(RevisionHistoryFile):have)} {
set state disabled
} {
set state normal
}
$m add command -label "Sync To This Revision" -command "p4_revisionHistory sync" -state $state
$m add command -label "Edit Changelist $chng" -command "p4_changeOptions edit $chng submitted"
$m add command -label "Describe Changelist $chng" -command "p4_changeOptions view $chng {} submitted editbutton revisionHistory showdiffs"
tk_popup $m $rootx $rooty
}
selection {
set idx [lrange $args 1 end]
if {$idx == ""} {
return
}
$widget(RevisionHistoryButtonBrowse) config -state disabled
$widget(RevisionHistoryButtonSync) config -state disabled
$widget(RevisionHistoryButtonDiffRevs) config -state disabled
$widget(RevisionHistoryButtonDiffClient) config -state disabled
$widget(RevisionHistoryText) config -state normal
$widget(RevisionHistoryText) delete 1.0 end
if {[llength $idx] == 1} {
set rev [lindex [lindex [$p4(rhListbox) get $idx] 0] 1]
$widget(RevisionHistoryButtonBrowse) config -state normal
if {[info exists p4files($p4(RevisionHistoryFile):cfile)] && $p4files($p4(RevisionHistoryFile):cfile) != "" && $rev != $p4files($p4(RevisionHistoryFile):have)} {
$widget(RevisionHistoryButtonSync) config -state normal
}
$widget(RevisionHistoryText) insert end $p4revs($rev)
if {[info exists p4files($p4(RevisionHistoryFile):cfile)] && $p4files($p4(RevisionHistoryFile):have) != 0 && $rev != $p4files($p4(RevisionHistoryFile):have) && [lindex [$p4(rhListbox) get $idx] 5] != "delete"} {
$widget(RevisionHistoryButtonDiffClient) config -state normal
}
}
if {[llength $idx] == 2 && [lindex [$p4(rhListbox) get [lindex $idx 0]] 5] != "delete" && [lindex [$p4(rhListbox) get [lindex $idx 1]] 5] != "delete"} {
$widget(RevisionHistoryButtonDiffRevs) config -state normal
}
$widget(RevisionHistoryText) config -state disabled
}
browse {
busy_cursor set
set idx [$p4(rhListbox) curselection]
set rev [lindex [lindex [$p4(rhListbox) get $idx] 0] 1]
set type [lindex [$p4(rhListbox) get $idx] 4]
p4_viewFile "$p4(RevisionHistoryFile) #0/$rev <$type>"
busy_cursor clear
}
diffClient {
busy_cursor set
set rev [lindex [lindex [$p4(rhListbox) get [$p4(rhListbox) curselection]] 0] 1]
set text [exec $p4(exec) diff $p4files($p4(RevisionHistoryFile):dfile)#$rev]
p4_viewDialog show "Diff client revision #$p4files($p4(RevisionHistoryFile):have) with $p4files($p4(RevisionHistoryFile):dfile)#$rev" $text
busy_cursor clear
}
diffRevs {
busy_cursor set
set idx [$p4(rhListbox) curselection]
set rev1 [lindex [lindex [$p4(rhListbox) get [lindex $idx 0]] 0] 1]
set rev2 [lindex [lindex [$p4(rhListbox) get [lindex $idx 1]] 0] 1]
set text [exec $p4(exec) diff2 $p4(RevisionHistoryFile)#$rev1 $p4(RevisionHistoryFile)#$rev2]
p4_viewDialog show "Diff $p4(RevisionHistoryFile)#$rev1 with $p4(RevisionHistoryFile)#$rev2" $text
busy_cursor clear
}
sync {
busy_cursor set
set rev [lindex [lindex [$p4(rhListbox) get [$p4(rhListbox) curselection]] 0] 1]
set file $p4(RevisionHistoryFile)
p4_runCommand sync {} {} #$rev [list $file]
#p4_runCommand sync {} {} #$rev $file
tkwait variable p4(runcmdDone)
set el [$p4(rhListbox) curselection]
$p4(rhListbox) selection clear 0 end
$p4(rhListbox) selection set $el
if {$p4files($file:cfile) == ""} {
set rev "not in client view"
} elseif {$p4files($file:have) == 0} {
set rev "not synced in client"
} {
set rev "have revision #$p4files($file:have)"
}
$widget(RevisionHistoryLabel) config -text "Change Summary - $file ($rev)"
busy_cursor clear
}
}
}
proc {p4_runCommand} {opt args} {
global p4 p4files p4pending widget Tree Pend env
switch $opt {
checkout {
set type [lindex $args 0]
set v2 [lindex $args 1]
set v1 [lindex $args 2]
set parms [lindex $args 3]
#puts "args=$args v1=$v1 v2=$v2 parms=$parms lenv2=[llength $v2]"
#set file [string trim [lindex [split $v2 #] 0]]
set files ""
if {$type == "integrate"} {
set files $v2
} {
foreach file $v2 {
lappend files [string trim [lindex [split $file #] 0]]
}
}
#puts files=$files
# Integrating using a branch from the Branch pane and resolving all files can have no files in the list.
if {[llength $files] == 0 && $type != "integrate" && $type != "resolve"} {
return
}
busy_cursor set
set p4(runcmdDone) 0
set p4(runcmdKilled) 0
set p4(runcmdRefresh) 0
set p4(runcmdAlsoOpened) 0
set p4(runcmdLocked) 0
set p4(runcmdOpened) 0
set p4(runcmdWarning) 0
set p4(runcmdErrors) {}
set p4(runcmdUpdates) {}
set p4(runcmdType) $type
set p4(runcmdV1) $v1
set p4(runcmdV2) $v2
#p4_logOptions log "Executing p4 [string trim "$type $parms"] $file"
#set cmd "|$p4(exec) -s $type $parms \"$file\""
p4_logOptions log "Executing p4 [string trim "$type $parms"] $files"
set cmd "|$p4(exec) -v0 -s $type $parms $files"
set p4(runcmd) "p4 -s $type $parms $files"
#puts cmd=$cmd
if {[catch {open $cmd r} p4(runcmdfp)]} {
p4_logOptions error $p4(runcmdfp)
set p4(runcmdDone) -1
} else {
fileevent $p4(runcmdfp) readable [list p4_runCommand checkoutread]
fconfigure $p4(runcmdfp) -blocking 0
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
set p4(runcmdAfter) [after 6000 "p4_runCommand runCancel"]
}
}
checkoutread {
if [eof $p4(runcmdfp)] {
p4_runCommand stop
} else {
if {[gets $p4(runcmdfp) line] < 0 || $line == ""} {
return
}
#puts "line: $line"
regexp {^([^:]*): } $line match type
#puts "match=$match type=$type"
set line [string range $line [string length $match] end]
if {[string first " locked by" $line] > 0} {
set type warning
} elseif {[string first " - currently opened for add" $line] > 0} {
set type warning
} elseif {[string first " - also opened" $line] > 0} {
set type warning
} elseif {[string first " - can't " $line] > 0} {
set type warning
} elseif {[string first " - must sync/resolve " $line] > 0} {
# This needs to force a refresh of depot and pending.
set p4(runcmdRefresh) 1
set type error
} elseif {[string first " - resolve skipped" $line] > 0} {
# TTD: this currently does p4 opened followed by p4 resolve/opened/resolved. The first open isn't required.
incr p4(runcmdOpened) -1
# This needs to force a refresh of depot and pending.
#if {$p4(runcmdType) == "resolve"} {
# if {$p4(AutoResolvePreview) == ""} {
# set p4(runcmdRefresh) 1
# }
#}
set type error
}
switch $type {
"Diff chunks" {
# P4Win doesn't print these messages.
#puts "skipping $type"
}
error -
warning {
incr p4(runcmdWarning)
lappend p4(runcmdErrors) $line
p4_logOptions error $line
}
exit {
# TTD p4win doesn't log this:
if {$p4(runcmdType) != "integrate"} {
if {$p4(runcmdWarning) == 0} {
p4_logOptions note "[string toupper $p4(runcmdType)] completed with no warnings or errors"
} {
p4_logOptions warn "[string toupper $p4(runcmdType)] OPERATION WARNING SUMMARY:"
foreach error $p4(runcmdErrors) {
p4_logOptions error $error
}
set number [llength $p4(runcmdErrors)]
if {$number == 1} {
set s ""
} {
set s "s"
}
p4_logOptions warn "Total of $number warning$s reported"
}
if {$p4(runcmdOpened) == 1} {
set s ""
} {
set s "s"
}
if {$p4(runcmdType) == "revert"} {
p4_logOptions note "Reverted $p4(runcmdOpened) file$s"
} elseif {$p4(runcmdType) == "lock"} {
p4_logOptions note "Locked $p4(runcmdOpened) file$s"
} elseif {$p4(runcmdType) == "unlock"} {
p4_logOptions note "Unlocked $p4(runcmdOpened) file$s"
} elseif {$p4(runcmdType) == "reopen"} {
p4_logOptions note "Reopened $p4(runcmdOpened) file$s"
} elseif {$p4(runcmdType) == "resolve"} {
if {$p4(AutoResolvePreview) == ""} {
p4_logOptions note "$p4(runcmdOpened) file$s resolved"
# Multiple changelists could be affected so we have to refresh.
if {$p4(runcmdOpened) > 0} {
set p4(runcmdRefresh) 1
}
} {
p4_logOptions note "$p4(runcmdOpened) file$s would be resolved"
}
} {
p4_logOptions note "Opened $p4(runcmdOpened) file$s for $p4(runcmdType)"
}
}
# Refresh this dir in the Pending tree. Bypass the refresh if:
# - we were doing an integrate preview.
# - we were doing a resolve preview.
# - the Pending pane isn't created yet.
# - we have to refresh anyway.
# - no files were opened.
if {$p4(runcmdType) == "integrate" && $p4(integratePreview) != ""} {
p4_logOptions note "Integrate preview completed"
return
}
if {$p4(runcmdType) == "resolve" && $p4(AutoResolvePreview) != ""} {
return
}
if {$p4(runcmdRefresh) || ![info exists p4pending(Changelists_myclient)] || $p4(runcmdOpened) == 0} {
return
}
set w $widget(pendingCanvas)
#puts p4(runcmdV1)=$p4(runcmdV1)
#puts p4(runcmdV2)=$p4(runcmdV2)
if {$p4(runcmdV1) != ""} {
# This section is used when called from the PendingChanges pane and
# the pending tree dir IS known (p4(runcmdV1)).
set v1 [lindex $p4(runcmdV1) 0]
#puts namesv1=[array get p4pending *:parent]
#puts namev1=[array get p4pending $v1*]
set grandparent $p4pending($v1:parent)
#puts grandparent=$grandparent
set parent [string range $v1 [string length $p4pending($v1:parent)] end]
#puts parent=$parent
} elseif {$p4(runcmdV2) != ""} {
# This section is used when called from the Depot pane and
# the pending tree dir is NOT known (p4(runcmdV1) is blank).
set file [string trim [lindex [split [lindex $p4(runcmdV2) 0] #] 0]]
#puts PENDING:
#set pnames [lsort -dictionary [array names p4pending]]
#foreach pname $pnames { puts "$pname=====$p4pending($pname)" }
#puts file=$file
#puts names1=[array names p4pending "Pending Changelists (client*$file*:parent"]
set l [lindex [array names p4pending "Pending Changelists (client*$file*:parent"] 0]
#puts l1=$l
if {$l == ""} {
set parent " Default"
#puts names2=[array names p4pending "Pending Changelists (client* Default:parent"]
set l [lindex [array names p4pending "Pending Changelists (client* Default:parent"] 0]
#puts l2=$l
set grandparent $p4pending($l)
#set changelist default
} {
set parent $p4pending($l)
#puts parent3=$p4pending($l)
#puts names3=[array names p4pending "$parent:parent"]
set l [lindex [array names p4pending "$parent:parent"] 0]
#puts l3=$l
set grandparent $p4pending($l)
set parent [string range $parent $p4pending($parent:diridx) end]
#set changelist [string trim [string tolower [lindex [split $parent] 1]]]
}
} else {
set parent ""
set grandparent ""
}
#puts " parent=$parent"
#puts "grandparent=$grandparent"
##puts " changelist=$changelist"
# Reopen is drag-n-drop, which "moves" files from the source to target changelist itself.
if {$p4(runcmdType) != "reopen" && $parent != ""} {
if {$p4(runcmdType) == "reopen" || $p4(runcmdType) == "revert"} {
set parents [concat [list $parent] $p4pending(ReopenTarget)]
} {
set parents [list $parent]
}
set opened ""
Tree:buildafter $w 5000
set myclientOpened $Pend($p4pending(Changelists_myclient):open)
foreach parent $parents {
lappend opened $Pend([Tree:joinnodes $w $grandparent $parent]:open)
#puts "DELETING: Tree:delitem $w $grandparent $parent"
Tree:delitem $w $grandparent $parent
set pnames [array names p4pending [Tree:joinnodes $w $grandparent $parent]//*]
foreach pname $pnames {
#puts "unsetting p4pending $pname"
unset p4pending($pname)
}
set pnames [array names Pend $grandparent$parent[lindex $p4(runcmdV2) 0]:*]
foreach pname $pnames {
#puts "unsetting Pend $pname"
unset Pend($pname)
}
# Recreate the dir in case it's now empty:
Tree:newitem $w $grandparent $parent -image pmypending -type dir -sortdic 1
}
p4_pendingChangeOptions getOpened justTheseClients $parents
if {$myclientOpened && !$Pend($p4pending(Changelists_myclient):open)} {
Tree:open $w {} $p4pending(Changelists_myclient)
}
foreach open $opened parent $parents {
# TTD: make this configurable.
if {!$Pend([Tree:joinnodes $w $grandparent $parent]:open) && \
($open || $p4(runcmdType) != "revert")} {
Tree:open $w $grandparent $parent
}
}
Tree:buildafter $w idle
}
}
info -
info1 {
set dfile ""
set have ""
if {[string first " currently opened for " $line] > 0} {
# TTD p4win doesn't log this:
p4_logOptions log "$line"
regexp {(^[^#]*)#([0-9]*) } $line match dfile have
set p4files($dfile:OpenAct) $p4(runcmdType)
} elseif {[string first " opened for " $line] > 0} {
incr p4(runcmdOpened)
# TTD p4win doesn't log this:
p4_logOptions log "$line"
regexp {(^[^#]*)#([0-9]*) } $line match dfile have
set p4files($dfile:OpenAct) $p4(runcmdType)
} elseif {[string first " - branch/sync " $line] > 0 || [string first " - branch from " $line] > 0 || [string first " - integrate from " $line] > 0 || [string first " - sync/integrate from " $line] > 0} {
incr p4(runcmdOpened)
p4_logOptions log "$p4(integratePreview)$line"
regexp {(^[^#]*)#([0-9]*) } $line match dfile have
if {$p4(integratePreview) == ""} {
#set p4files($dfile:OpenAct) $p4(runcmdType)
#TTD This is true when renaming files; what about other integration possibilities?
if {[string first " - integrate" $line] > 0} {
set p4files($dfile:OpenAct) integrate
} {
set p4files($dfile:OpenAct) branch
}
} {
# This list of files is for the "Sync target files first" option (p4(integrate_syncFirst)).
lappend p4(integrate_files) $dfile
}
} elseif {[string first " - merging " $line] > 0} {
incr p4(runcmdOpened)
p4_logOptions log "$p4(AutoResolvePreview)$line"
} elseif {[string first " - copy from " $line] > 0 || [string first " - merge from " $line] > 0} {
# These are just info from successful resolve.
p4_logOptions log "$p4(AutoResolvePreview)$line"
} elseif {[string first " reverted" $line] > 0 || [string first " abandoned" $line] > 0 || [string first " was branch, deleted" $line] > 0 || [string first " was branch, cleared" $line] > 0 || [string first " was integrate, deleted" $line] > 0} {
incr p4(runcmdOpened)
p4_logOptions log "$line"
regexp {(^[^#]*)#([0-9]*) } $line match dfile have
set p4files($dfile:OpenAct) ""
set p4files($dfile:ourLock) 0
} elseif {[set idx [string first " - locking" $line]] > 0} {
incr p4(runcmdOpened)
p4_logOptions log "$line"
set dfile [string range $line 0 [incr idx -1]]
set p4files($dfile:ourLock) 1
#} elseif {[set idx [string first " - already locked" $line]] > 0} {
# p4_logOptions log "$line"
# set dfile [string range $line 0 [incr idx -1]]
# if {[string first " - already locked by " $line] < 0} {
# set p4files($dfile:ourLock) 0
# }
} elseif {[set idx [string first " - unlocking" $line]] > 0} {
incr p4(runcmdOpened)
p4_logOptions log "$line"
set dfile [string range $line 0 [incr idx -1]]
set p4files($dfile:ourLock) 0
} elseif {[set idx [string first " - already unlocked" $line]] > 0} {
# This is OK; we don't need to count these as warnigs.
p4_logOptions log "$line"
set dfile [string range $line 0 [incr idx -1]]
set p4files($dfile:ourLock) 0
} elseif {[set idx [string first " - reopened" $line]] > 0} {
incr p4(runcmdOpened)
p4_logOptions log "$line"
set dfile "DoNotUpdateDepot"
# Reopen moves files between changelists with runCmdUpdates:
#puts "dropFile=$p4pending(dropFile) dropSourceDir=$p4pending(dropSourceDir) dropTargetDir=$p4pending(dropTargetDir)"
foreach f $p4pending(dropFile) {
catch {unset pends}
set src [Tree:joinnodes $widget(pendingCanvas) $p4pending(dropSourceDir) $f]
set trg [Tree:joinnodes $widget(pendingCanvas) $p4pending(dropTargetDir) $f]
array set pends [array get p4pending $src*]
foreach n [array names pends] {
set ext [lindex [split $n :] end]
set p4pending($trg:$ext) $pends($n)
}
#puts PendTreeParentBefore=[array get Pend $p4pending(dropSourceDir):*]
set p4pending($trg:diridx) [string length $p4pending(dropTargetDir)]
set p4pending($trg:parent) $p4pending(dropTargetDir)
# No need to keep growing this list if we're refreshing anyway.
if {!$p4(runcmdRefresh)} {
# Remove the file from the sourcedir and add to the targetdir.
lappend p4(runcmdUpdates) [list Tree:delitem $widget(pendingCanvas) $p4pending(dropSourceDir) $f]
lappend p4(runcmdUpdates) [list Tree:newitem $widget(pendingCanvas) $p4pending(dropTargetDir) $f -image $Pend($src:icon) -type file -sortdic 1]
# TTD: make configurable:
if {!$Pend($p4pending(dropTargetDir):open)} {
lappend p4(runcmdUpdates) [list Tree:open $widget(pendingCanvas) $p4pending($p4pending(dropTargetDir):parent) [string range $p4pending(dropTargetDir) $p4pending($p4pending(dropTargetDir):diridx) end]]
}
}
#puts PendTreeParentAfter=[array get Pend $p4pending(dropSourceDir):*]
}
} {
p4_logOptions log "$line (NOTE new p4 checkout info)"
}
if {[info exists p4files($dfile:diridx)]} {
set dir [string range $dfile 0 $p4files($dfile:diridx)]
set n [string range $dfile [expr $p4files($dfile:diridx) + 2] end]
if {$p4files($dfile:act) == "delete"} {
if {$have != "" && $have > 0 && $have < $p4files($dfile:head)} {
set del " <-head rev deleted->"
} {
set del " <-deleted->"
}
} {
set del ""
}
# No need to keep growing this list if we're refreshing anyway.
if {!$p4(runcmdRefresh)} {
# Find the old file in the tree and remove and replace it.
set oldn [lindex $Tree($dir:children) [lsearch -regexp $Tree($dir:children) "^$n #*"]]
lappend p4(runcmdUpdates) [list Tree:delitem $widget(treeCanvas) $dir "$oldn"]
if {$have != ""} {
set p4files($dfile:have) $have
}
lappend p4(runcmdUpdates) [list Tree:newitem $widget(treeCanvas) $dir "$n #$p4files($dfile:have)/$p4files($dfile:head) <$p4files($dfile:type)>$del" -image [p4_createGetFileIcon dfile $dfile] -type file -sortdic 1]
}
if {$p4files($dfile:have) > $p4files($dfile:head)} {
# If we just got a rev greater then the head, we need to refresh.
set p4(runcmdRefresh) 1
}
}
}
default {
p4_logOptions log "$line (NOTE new p4 checkout type: $type)"
}
}
}
}
fstat {
set argstr [lindex $args 0]
set dir [lindex $args 1]
set len [expr [string len $dir] + 1]
set diridx [expr $len - 2]
#puts "args=$args dir=$dir len=$len diridx=$diridx"
if {$argstr == ""} {
return
}
busy_cursor set
set p4(runcmdDone) 0
set p4(runcmdKilled) 0
set p4(runcmdRefresh) 0
set p4(runDonefile) 0
set p4(runcmdUpdates) ""
set p4(runFstatLen) $len
set p4(runFstatDir) $dir
set p4(runFstatDiridx) $diridx
set p4(runcmd) "p4 fstat $argstr"
p4_logOptions log "Executing $p4(runcmd)"
set cmd "|$p4(exec) -v0 -s fstat $argstr"
#puts "open \"$cmd\" r"
if {[catch {eval open \"$cmd\" r} p4(runcmdfp)]} {
p4_logOptions error $p4(runcmdfp)
set p4(runcmdDone) -1
} else {
set p4(runFstatTags) {runFstatcfile {} runFstatdfile {} runFstatact none runFstatchng 0 runFstathead 0 runFstattype unknown runFstattime 0 runFstathave 0 runFstatOpenAct {} runFstatOpenChng {} runFstatunres {} runFstatothOpen 0 runFstatothLock 0 runFstatourLock 0 runFstatother {}}
array set p4 $p4(runFstatTags)
fileevent $p4(runcmdfp) readable [list p4_runCommand fstatread]
fconfigure $p4(runcmdfp) -blocking 0
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
set p4(runcmdAfter) [after 6000 "p4_runCommand runCancel"]
}
}
fstatread {
if [eof $p4(runcmdfp)] {
p4_runCommand stop
} else {
if {[gets $p4(runcmdfp) line] < 0 || $line == ""} {
return
}
#puts "line: $line"
foreach {junk key val} "{} {} {}" { break }
foreach {junk key val} [split $line] { break }
#puts key=$key
if {($key == "depotFile" || $junk == "exit:") && $p4(runDonefile)} {
#puts other=$p4(runFstatother)
if {$p4(runFstatOpenAct) != "add" && $p4(runFstatOpenAct) != "branch" && ($p4(runFstatact) != "delete" || ($p4(runFstatact) == "delete" && $p4(disp_showDeleted)))} {
foreach var {cfile dfile act chng head type time have OpenAct OpenChng unres othOpen othLock ourLock other} {
set p4files($p4(runFstatdfile):$var) [set p4(runFstat$var)]
}
#puts \n[array get p4files]\n
if {$p4(runFstatDir) != ""} {
set n [file tail $p4(runFstatdfile)]
set diridx [expr [string length $p4(runFstatdfile)] - [string length $n] - 2]
set dir [string range $p4(runFstatdfile) 0 $diridx]
#puts "args=$args dir=$dir diridx=$diridx"
set p4files($p4(runFstatdfile):diridx) $diridx
if {$p4(runFstatact) == "delete"} {
if {$p4(runFstathave) != "" && $p4(runFstathave) > 0 && $p4(runFstathave) < $p4(runFstathead)} {
set del " <-head rev deleted->"
} {
set del " <-deleted->"
}
} {
set del ""
}
Tree:newitem $widget(treeCanvas) $dir "$n #$p4(runFstathave)/$p4(runFstathead) <$p4(runFstattype)>$del" -image [p4_createGetFileIcon dfile $p4(runFstatdfile)] -type file -sortdic 1
}
}
array set p4 $p4(runFstatTags)
}
if {$junk == "error:" || $junk == "exit:"} {
return
}
switch -glob $key {
depotFile {
#set dfile $val
set p4(runFstatdfile) [lrange [split $line] 2 end]
set p4(runDonefile) 1
}
clientFile {
#set cfile $val
set p4(runFstatcfile) [lrange [split $line] 2 end]
}
headAction {
set p4(runFstatact) $val
}
headChange {
set p4(runFstatchng) $val
}
headRev {
set p4(runFstathead) $val
}
headType {
set p4(runFstattype) $val
}
headTime {
set p4(runFstattime) $val
}
haveRev {
set p4(runFstathave) $val
}
action {
set p4(runFstatOpenAct) $val
}
change {
set p4(runFstatOpenChng) $val
}
unresolved {
set p4(runFstatunres) $val
}
otherOpen {
set p4(runFstatothOpen) 1
}
otherLock {
set p4(runFstatothLock) 1
}
ourLock {
set p4(runFstatourLock) 1
}
other* {
lappend p4(runFstatother) [lrange [split $line] 1 end]
}
default {
puts "UNKNOWN fstat tag: $line"
}
}
}
}
grabCancel {
after cancel $p4(runcmdGrab)
grab release $widget(grabWidget)
}
read {
set mode [lindex $args 0]
if [eof $p4(runcmdfp)] {
p4_runCommand stop
} else {
#if {[gets $p4(runcmdfp) line] < 0 || $line == ""}
if {[gets $p4(runcmdfp) line] < 0} {
return
}
if {$mode == "log"} {
p4_logOptions log $line
} {
lappend p4(runcmdOutput) $line
}
}
}
run {
busy_cursor set
set cmd [lindex $args 0]
set mode [lindex $args 1]
set cargs [lindex $args 2]
set p4(runcmd) $cmd
set p4(runcmdDone) 0
set p4(runcmdKilled) 0
set p4(runcmdRefresh) 0
set p4(runcmdOutput) ""
set p4(runcmdUpdates) ""
p4_logOptions log "Executing $cmd"
if {[catch {eval open \"| $cmd $cargs |& cat\" r} p4(runcmdfp)]} {
#puts ERRORp4(runcmdfp)=$p4(runcmdfp)
p4_logOptions error $p4(runcmdfp)
set p4(runcmdDone) -1
} else {
fileevent $p4(runcmdfp) readable [list p4_runCommand read $mode]
fconfigure $p4(runcmdfp) -blocking 0
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
set p4(runcmdAfter) [after 6000 "p4_runCommand runCancel"]
}
}
runCancel {
set ans ""
if {[string length $p4(runcmd)] > 1001} {
set msg "[string range $p4(runcmd) 0 1000](...)"
} {
set msg $p4(runcmd)
}
set ans [tk_dialog .tkp4RunCommandWait "TkP4 - Run P4 Command Waiting" "Running command:\n\n$msg\n\nPlease wait..." info 0 "Cancel Command"]
# This avoids the stop being run when the window is destroyed in the stop command!
if {$ans == 0} {
set p4(runcmdKilled) 1
catch {eval exec kill [pid $p4(runcmdfp)]}
p4_runCommand stop
}
}
stop {
#puts "In STOP..."
p4_runCommand grabCancel
after cancel $p4(runcmdAfter)
update idletasks
#after 2000
#puts destroying...
catch {destroy .tkp4RunCommandWait}
#puts "closing fd=$p4(runcmdfp)..."
if {[catch {close $p4(runcmdfp)} rep] && [string first "child process exited abnormally" $rep] < 0} {
#puts "caught close error"
if {!$p4(runcmdKilled)} {
#puts "caught close error (not killed)"
puts "Run Command close error:\n\n$rep"
}
}
#puts "rep=$rep"
#puts "p4(runcmdOutput)=$p4(runcmdOutput)"
#puts updating...
#puts "p4(runcmdRefresh)=$p4(runcmdRefresh) p4(runcmdUpdates)=$p4(runcmdUpdates)"
if {$p4(runcmdRefresh) || [llength $p4(runcmdUpdates)] > 0} {
# No need to run the updates if we're going to refresh anyway.
if {$p4(runcmdKilled) || $p4(runcmdRefresh)} {
# Refresh the Depot tree since some updates could have been lost in unflushed p4 client buffer.
#TTD this will eventually auto-refresh the PendingTree if required.
# Is this overkill?
#p4_treeOptions refresh ;# runCmd stop (OLD)
#p4_pendingChangeOptions refresh;# runCmd stop (OLD)
# This refreshes both the depot and pending panes:
p4_refresh depotPane
} {
foreach cmd $p4(runcmdUpdates) {
eval $cmd
}
}
}
#puts DONE!\n
busy_cursor clear
if {$p4(runcmdKilled)} {
set p4(runcmdDone) -1
} elseif {[lsearch -regexp $p4(runcmdOutput) "Perforce client error:"] < 0 && [lsearch -regexp $p4(runcmdOutput) "Can't create a new user"] < 0} {
set p4(runcmdDone) 0
} {
if {[lsearch -regexp $p4(runcmdOutput) "Can't create a new user"] >= 0} {
p4_logOptions error "Perforce license quota exceeded!\n Delete an existing user and try again."
}
bell
tk_dialog .tkp4RunCommandError "TkP4 - Run P4 Command Error" "Error running command:\n\n$p4(runcmd)\n\n[join $p4(runcmdOutput) \n]" error 0 OK
set p4(runcmdDone) -1
}
}
sync {
set force [lindex $args 0]
set preview [lindex $args 1]
set have [lindex $args 2]
set v [lindex $args 3]
#set file [string trim [lindex [split $v #] 0]]
set files ""
foreach file $v {
lappend files [string trim [lindex [split $file #] 0]]$have
}
if {[llength $files] == 0} {
if {![p4_changeOptions syncActive]} {
return
}
set files $have
}
busy_cursor set
set p4(syncPreview) ""
set cmd "sync"
if {$force != ""} {
append cmd " $force"
}
if {$preview != ""} {
append cmd " $preview"
set p4(syncPreview) "Sync preview: "
}
set p4(runcmdDone) 0
set p4(runcmdKilled) 0
set p4(runcmdRefresh) 0
set p4(runcmdCopy) 0
set p4(runcmdRemove) 0
set p4(runcmdWarning) 0
set p4(runcmdErrors) {}
set p4(runcmdUpdates) {}
#p4_logOptions log "Executing p4 $cmd $file$have"
#set cmd "|$p4(exec) -s $cmd \"$file$have\""
set p4(runcmd) "$p4(exec) $cmd $files"
p4_logOptions log "Executing $p4(runcmd)"
set cmd "|$p4(exec) -v0 -s $cmd $files"
if {[catch {open $cmd r} p4(runcmdfp)]} {
p4_logOptions error $p4(runcmdfp)
set p4(runcmdDone) -1
} else {
fileevent $p4(runcmdfp) readable [list p4_runCommand syncread]
fconfigure $p4(runcmdfp) -blocking 0
grab $widget(grabWidget)
set p4(runcmdGrab) [after 6000 "p4_runCommand grabCancel"]
set p4(runcmdAfter) [after 6000 "p4_runCommand runCancel"]
#puts fconfig=[fconfigure $p4(runcmdfp)]
}
}
syncread {
if [eof $p4(runcmdfp)] {
p4_runCommand stop
} else {
if {[gets $p4(runcmdfp) line] < 0 || $line == ""} {
return
}
regexp {^([^:]*): } $line match type
set line [string range $line [string length $match] end]
if {[string first "up-to-date" $line] > 0} {
set type info
}
if {[string first " - is opened for" $line] > 0} {
set type error
}
if {[string first " - must resolve " $line] > 0} {
# This needs to force a refresh of depot and pending.
set p4(runcmdRefresh) 1
set type error
}
switch $type {
error -
warning {
# Don't show certain errors if doing integrate "Sync target files first" (p4(integrate_syncFirst).
if {![p4_integrate isActive] || [string first "no such file" $line] < 0} {
incr p4(runcmdWarning)
lappend p4(runcmdErrors) $line
p4_logOptions error $line
}
}
exit {
if {$p4(syncPreview) == ""} {
set Copy copied
set Remove removed
} {
set Copy "would copy"
set Remove "would remove"
}
foreach {action number prep} [list Copy $p4(runcmdCopy) to Remove $p4(runcmdRemove) from] {
if {$number == 0} {
set number no
}
if {$number == 1} {
set s ""
} {
set s "s"
}
p4_logOptions note "Sync [set $action] $number file$s $prep Client"
}
if {$p4(runcmdWarning) == 0} {
p4_logOptions note "Sync completed with no warnings or errors"
} {
p4_logOptions warn "SYNC OPERATION WARNING SUMMARY:"
foreach error $p4(runcmdErrors) {
p4_logOptions error $error
}
set number [llength $p4(runcmdErrors)]
if {$number == 1} {
set s ""
} {
set s "s"
}
p4_logOptions warn "Total of $number warning$s reported"
}
}
info {
set dfile ""
set have ""
if {[string first " - delet" $line] > 0} {
incr p4(runcmdRemove)
regexp {(^[^#]*)#([0-9]*) } $line match dfile have
set have 0
} elseif {[string first " - refresh" $line] > 0} {
incr p4(runcmdCopy)
} elseif {[string first " - add" $line] > 0 || [string first " - updat" $line] > 0} {
incr p4(runcmdCopy)
regexp {(^[^#]*)#([0-9]*) } $line match dfile have
}
p4_logOptions log "$p4(syncPreview)$line"
if {$p4(syncPreview) == "" && [info exists p4files($dfile:diridx)]} {
set dir [string range $dfile 0 $p4files($dfile:diridx)]
set n [string range $dfile [expr $p4files($dfile:diridx) + 2] end]
if {$p4files($dfile:act) == "delete"} {
if {$have != "" && $have > 0 && $have < $p4files($dfile:head)} {
set del " <-head rev deleted->"
} {
set del " <-deleted->"
}
} {
set del ""
}
# No need to keep growing this list if we're refreshing anyway.
if {!$p4(runcmdRefresh)} {
# Find the old file in the tree and remove it.
set oldn [lindex $Tree($dir:children) [lsearch -regexp $Tree($dir:children) "^$n #*"]]
lappend p4(runcmdUpdates) [list Tree:delitem $widget(treeCanvas) $dir "$oldn"]
# Don't put the file back in the tree if it was just deleted.
if {$have != ""} {
set p4files($dfile:have) $have
lappend p4(runcmdUpdates) [list Tree:newitem $widget(treeCanvas) $dir "$n #$have/$p4files($dfile:head) <$p4files($dfile:type)>$del" -image [p4_createGetFileIcon dfile $dfile] -type file -sortdic 1]
}
}
if {$p4files($dfile:have) > $p4files($dfile:head)} {
# If we just got a rev greater then the head, we need to refresh.
set p4(runcmdRefresh) 1
}
}
}
default {
p4_logOptions log $line (NOTE new p4 sync type: $type)
}
}
}
}
}
}
proc {p4_serverInfo} {opt args} {
global p4 widget
switch $opt {
fromHostListbox {
set hostlist [$p4(hostListbox) get [$p4(hostListbox) curselection]]
p4_serverInfo show [p4_connectionOptions gethost $hostlist]
}
show {
busy_cursor set
if {$args == ""} {
set parms ""
set title ""
} {
set parms " -p [lindex $args 0]"
set title " for [lindex $args 0]"
}
p4_logOptions log "Executing p4$parms info"
set data [eval exec $p4(exec)$parms info]
p4_viewDialog show "TkP4 - Server Info$title" $data $widget($p4(HelpSection)Options)
busy_cursor clear
}
}
}
proc {p4_setTitle} {} {
global p4 widget env
if {$env(P4CLIENT) == ""} {
set client ""
} {
set client " Client: $env(P4CLIENT)"
}
if {$env(P4USER) == ""} {
set user ""
} {
set user " User: $env(P4USER)"
}
if {$env(P4HOST) == ""} {
set host ""
} {
set host " Host: $env(P4HOST)"
}
wm title $widget(tkp4) "TkP4 v$p4(TkP4version) - Perforce Server: $env(P4PORT)$host$user$client"
if {$p4(wm_title_bug)} {
update idletasks
Window hide $widget(tkp4)
Window show $widget(tkp4)
update idletasks
}
}
proc {p4_syncLabel} {opt args} {
global p4 widget
set w $widget(SyncLabel)
switch $opt {
cancel {
Window hide $w
p4_itemOptions helphide
}
check {
foreach {o title2} {number "Revision Number" other "Other"} {
set p4(SyncLabel_$o) [string trim $p4(SyncLabel_$o)]
if {$p4(SyncLabel_mode) == $o && $p4(SyncLabel_$o) == ""} {
bell
tk_dialog .tkp4 "TkP4 - Sync Options" "You must enter a value for \"$title2\"." error 0 "OK"
return -1
}
}
return 0
}
help {
p4_runCommand run "$p4(exec) help revisions"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
return -1
}
set p4(describeHelp) [join $p4(runcmdOutput) \n]
p4_itemOptions helpshow {} {} $w
}
preview {
set p4(SyncLabel_preview) "-n"
p4_syncLabel run
}
run {
if {[p4_syncLabel check]} {
return
}
if {$p4(SyncLabel_mode) == "number"} {
set symbol "#"
} {
set symbol "@"
}
p4_runCommand sync {} $p4(SyncLabel_preview) $symbol$p4(SyncLabel_$p4(SyncLabel_mode)) $p4(SyncLabel_files)
}
setrevision {
foreach w {number other} {
$widget(SyncLabel_$w) config -background grey85 -state disabled
}
$widget(SyncLabel_$p4(SyncLabel_mode)) config -background white -state normal
}
show {
Window show $w
p4_syncLabel setrevision
set p4(SyncLabel_files) [lindex $args 0]
}
sync {
set p4(SyncLabel_preview) ""
p4_syncLabel run
p4_syncLabel cancel
}
}
}
proc {p4_ToggleDisabled} {state wtop disabledfg} {
global p4
if {[winfo class $wtop] == "Frame"} {
set children [winfo children $wtop]
} {
set children $wtop
}
set ro_entry_bg green
set ro_entry_fg black
foreach w $children {
if {[winfo class $w] == "Frame"} {
p4_ToggleDisabled $state $w $disabledfg
continue
}
if {[lsearch -exact "Entry Label Message" [winfo class $w]] >= 0} {
if {$state == "disabled"} {
$w config -foreground $disabledfg
} {
if {[$w cget -background] != $ro_entry_bg} {
$w config -foreground black
} {
$w config -foreground $ro_entry_fg
}
}
}
if {[lsearch -exact "Button Checkbutton Entry Radiobutton" [winfo class $w]] >= 0} {
if {$state == "disabled"} {
$w config -state disabled
} {
if {[$w cget -background] != $ro_entry_bg} {
$w config -state normal
}
}
}
if {[lsearch -exact "Entry Text" [winfo class $w]] >= 0} {
if {[$w cget -background] != $ro_entry_bg} {
if {$state == "disabled"} {
$w config -background grey85
} {
$w config -background white
}
}
}
}
}
proc {p4_tooltipSetup} {} {
global p4 widget
set list [winfo children $widget(ToolbarFrame)]
while {$list != ""} {
set next {}
foreach w $list {
set class [winfo class $w]
if {$class == "Button" || $class == "Radiobutton"} {
bind $w <Enter> "p4_tooltips enter $w [$w cget -image]"
bind $w <Leave> "p4_tooltips leave"
}
set next [concat $next [winfo children $w]]
}
set list $next
}
}
proc {p4_tooltips} {opt {w {}} {button {}}} {
global p4 p4tooltips widget
switch $opt {
enter {
set p4(FileInfoText) $p4tooltips($button)
if {[expr {[clock seconds] - $p4(tooltipExitTime)}] > 0} {
set p4(tooltipAfterID) [after 750 p4_tooltips show $w $button]
} {
p4_tooltips show $w $button
}
}
leave {
after cancel $p4(tooltipAfterID)
catch {destroy .tooltip}
if {$p4(TooltipText) != ""} {
set p4(tooltipExitTime) [clock seconds]
}
set p4(FileInfoText) ""
set p4(TooltipText) ""
}
show {
set p4(TooltipText) $p4tooltips($button)
if {$button == "butnone"} {
return
}
set x [expr {[winfo rootx $w] + ([winfo width $w]/2)}]
set y [expr {[winfo rooty $w] + [winfo height $w] + 1}]
toplevel .tooltip -bg black
wm overrideredirect .tooltip 1
label .tooltip.l -text $p4(TooltipText) -font {Helvetica -12} -relief flat -bg #ffffaa -fg black -padx 2 -pady 0 -anchor w
pack .tooltip.l -side left -padx 1 -pady 1
wm geometry .tooltip +${x}+${y}
}
}
}
proc {p4_treeOpen} {w dir {n {}}} {
global p4 Tree widget p4dirs p4files
set v [Tree:joinnodes $w $dir $n]
if {$v == ""} {
return
}
set dir $v
#puts "w=$w dir=$dir n=$n v=$v Tree=[array get Tree]"
if {[info exists Tree($v:children)] && $Tree($v:children) != ""} {
return
}
if {[info exists Tree($v:isdir)] && $Tree($v:isdir)} {
busy_cursor set
set len [expr [string len $dir] + 1]
set diridx [expr $len - 2]
switch $p4(treeType) {
depot {
# Use -D if the user selects "Show Deleted Depot Files"
if {$p4(disp_showDeleted)} {
set dirsw " -D"
} {
set dirsw ""
}
p4_logOptions log "Executing p4 dirs$dirsw $p4(p4clientOpt)$dir/%1"
if {![catch {eval exec $p4(exec) dirs$dirsw $p4(p4clientOpt)\"$dir/%1\"} data]} {
foreach line [split $data \n] {
set n [string range $line $len end]
Tree:newitem $w $dir $n -image ifolder -type dir -sortdic 1
set p4dirs($line:diridx) $len
set p4dirs($line:parent) $dir
}
}
p4_runCommand fstat $p4(p4clientOpt)[list "$dir/%1"] $dir
tkwait variable p4(runcmdDone)
}
dir {
set files [glob -nocomplain $dir/*]
foreach file $files {
set n [string range $file $len end]
if {[file isdirectory $file]} {
Tree:newitem $w $dir $n -image idir -type dir -sortdic 1
set p4dirs($file:diridx) $len
set p4dirs($file:parent) $dir
} {
Tree:newitem $w $dir $n -image ifile -type file -sortdic 1
}
}
}
}
busy_cursor clear
}
# fstat output
# TTD delete the old syntax (from p4 without the -s option).
# In client that has the file open:
# sys4:/prg/rickm/SRC/DMUXNT/work/src/DmuxNT> p4 -c RickMonJuraj fstat //dev/dmuxnt/Direct...
# ... clientFile c:\RickM/dmuxnt/Directories.readme
# ... depotFile //dev/dmuxnt/Directories.readme
# ... headAction add
# ... headChange 1114
# ... headRev 1
# ... headType text
# ... headTime 936902828
# ... haveRev 1
# ... action edit
# ... change default
# ... ourLock
# p4 v99.1
#info1: clientFile /home/rickm/tkgnats/Number
#info1: depotFile //depot/tkgnats/sort/Number
#info1: headAction add
#info1: headChange 25
#info1: headRev 6
#info1: headType text
#info1: headTime 935465261
#info1: haveRev 6
#info1: action edit
#info1: change 46
#info1: otherOpen 1
#info1: ourLock
#info2: otherOpen0 rickm@tkgnats
#info2: otherAction0 edit
# p4 v99.2
#info1: depotFile //depot/tkgnats/sort/Number
#info1: clientFile /home/rickm/tkgnats/Number
#info1: headAction add
#info1: headType text
#info1: headTime 935465261
#info1: headRev 6
#info1: headChange 25
#info1: haveRev 6
#info1: action edit
#info1: change 46
#info2: otherOpen0 rickm@tkgnats
#info2: otherAction0 edit
#info2: otherOpen 1
#info1: ourLock
# In client that DOES NOT have the file open:
# sys4:/prg/rickm/SRC/DMUXNT/work/src/DmuxNT> p4 fstat //dev/dmuxnt/Direct...
# ... clientFile /prg/rickm/SRC/DMUXNT/work/Directories.readme
# ... depotFile //dev/dmuxnt/Directories.readme
# ... headAction add
# ... headChange 1114
# ... headRev 1
# ... headType text
# ... headTime 936902828
# ... haveRev 1
# ... otherOpen 1
# ... otherLock
# ... ... otherOpen0 rickm@RickMonJuraj
# ... ... otherAction0 edit
# p4 99.1
#info1: clientFile /home/rickm/tkgnats2/tkgnats/sort/Number
#info1: depotFile //depot/tkgnats/sort/Number
#info1: headAction add
#info1: headChange 25
#info1: headRev 6
#info1: headType text
#info1: headTime 935465261
#info1: haveRev 6
#info1: otherOpen 2
#info1: otherLock
#info2: otherOpen0 rickm@narrow
#info2: otherAction0 edit
#info2: otherOpen1 rickm@tkgnats
#info2: otherAction1 edit
# p4 v99.2
#info1: clientFile /home/rickm/tkgnats2/tkgnats/sort/Number
#info1: headAction add
#info1: headType text
#info1: headTime 935465261
#info1: headRev 6
#info1: headChange 25
#info1: haveRev 6
#info2: otherOpen0 rickm@narrow
#info2: otherAction0 edit
#info2: otherOpen1 rickm@tkgnats
#info2: otherAction1 edit
#info2: otherOpen 2
#info2: otherLock
}
proc {p4_treeOptions} {opt args} {
global p4 p4dirs p4files widget Tree env
switch $opt {
create {
busy_cursor set
set w $widget(treeCanvas)
set Tree(opencmd) p4_treeOpen
set Tree(contextcmd) p4_treePopup
set Tree(fileinfocmd) "p4_treeOptions fileinfo"
set Tree(dragndrop) 0
Tree:create $w Tree "/"
Tree:buildafter $w 5000
# Grab a copy of the refresh info.
set opened [lsort $p4(refreshOpened)]
set p4(refreshOpened) ""
if {[info exists p4dirs]} {
array set dirs [array get p4dirs]
unset p4dirs
}
catch {unset p4files}
switch $p4(treeType) {
depot {
p4_runCommand run "$p4(exec) depots"
tkwait variable p4(runcmdDone)
busy_cursor set
if {$p4(runcmdDone) < 0} {
# TTD How to handle error returns here and generally from run/read/stop?
set depots ""
busy_cursor clear
return -1
}
set depots $p4(runcmdOutput)
if {$depots == ""} {
Tree:newitem $w {} //depot -image idepot -type dir -sortdic 1
set p4dirs(//depot:diridx) 0
set p4dirs(//depot:parent) {}
} {
foreach depot $depots {
set dep //[lindex $depot 1]
# For Client View, don't show depots that aren't in the client view.
if {$p4(treeView) == "client" && [lsearch -regexp $p4(clientView) "^$dep/*"] < 0} {
continue
}
Tree:newitem $w {} $dep -image idepot -type dir -sortdic 1
set p4dirs($dep:diridx) 0
set p4dirs($dep:parent) {}
}
}
#p4_debugMsg "opened= $opened"
#p4_debugMsg "p4dirs(dirs)= [array get dirs]"
set opendirs ""
foreach ddir $opened {
lappend opendirs $ddir/%1
}
if {$opendirs != ""} {
# Use -D if the user selects "Show Deleted Depot Files"
if {$p4(disp_showDeleted)} {
set dirsw " -D"
} {
set dirsw ""
}
# TTD: is there any reason this doesn't use p4_runCommand?
p4_logOptions log "Executing p4 dirs$dirsw $p4(p4clientOpt)$opendirs"
set stat [catch {eval exec $p4(exec) dirs$dirsw $p4(p4clientOpt)$opendirs} data]
#p4_debugMsg "opendirs ($opendirs) data=$data"
set openfstat ""
foreach line [split $data \n] {
if { [string first "- no such file" $line] < 0 && [string first "- no mappings " $line] < 0 && [string first "- file(s) not in client " $line] < 0} {
set n [file tail $line]
set len [expr [string length $line] - [string length $n] - 2]
set dir [string range $line 0 $len]
incr len 2
Tree:newitem $w $dir $n -image ifolder -type dir -sortdic 1
set p4dirs($line:diridx) $len
set p4dirs($line:parent) $dir
}
}
p4_runCommand fstat $p4(p4clientOpt)$opendirs StoreInDirs
tkwait variable p4(runcmdDone)
# Open the dirs that were open before (if they still exist).
foreach ddir $opened {
if {[info exists Tree($ddir:isdir)]} {
Tree:open $w $dirs($ddir:parent) [string range $ddir $dirs($ddir:diridx) end]
}
}
}
}
dir {
Tree:newitem $w {} $p4(clientRoot) -image idir -type dir -sortdic 1
set p4dirs($p4(clientRoot):diridx) 0
set p4dirs($p4(clientRoot):parent) {}
if {[llength $opened] == 0} {
Tree:open $w {} $p4(clientRoot)
}
# Open the dirs that were open before (if they still exist).
foreach ddir $opened {
if {[info exists Tree($ddir:isdir)]} {
Tree:open $w $dirs($ddir:parent) [string range $ddir $dirs($ddir:diridx) end]
}
}
}
}
Tree:buildafter $w idle
busy_cursor clear
return 0
}
fileinfo {
#foreach {w v} $args { break }
set v [lindex $args 0]
#puts "fileinfo args=$args v=$v"
set v [eval Tree:joinnodes $widget(treeCanvas) $v]
#puts "fileinfo v=$v"
set file [string trim [lindex [split $v #] 0]]
if {$file == "" || $p4(treeView) == "workspace" || ([info exists Tree($v:isdir)] && $Tree($v:isdir))} {
set p4(FileInfoText) ""
return
}
set time [clock format $p4files($file:time) -format "%Y/%m/%d %H:%M:%S"]
if {$p4files($file:cfile) == ""} {
set p4(FileInfoText) "Last ModTime: $time (File not in client view)"
} {
# The trim is for Window backslashes in the file name, which causes quoting.
set p4(FileInfoText) "Last ModTime: $time Local path: [string trim $p4files($file:cfile) "\{\}"]"
}
}
refresh {
set p4(refreshOpened) ""
# We can't keep nested dirs open if the parent is currently closed (unlike
# the Pend tree).
foreach dir [array names Tree *isdir] {
if {$Tree($dir)} {
#foreach {w v} [split $dir :] { break }
set v dummy
regexp {(.*):isdir} $dir match v
if {$Tree($v:open)} {
set open 1
set parent $p4dirs($v:parent)
while {$parent != ""} {
if {!$Tree($parent:open)} {
set open 0
break
}
set parent $p4dirs($parent:parent)
}
if {$open} {
lappend p4(refreshOpened) $v
}
}
}
}
set current $Tree(curselection)
Tree:deltree $widget(treeCanvas)
p4_treeOptions create $widget(treeCanvas)
if {$current != ""} {
#TTD: if the have/head values change, this doesn't work because the filename includes have/head.
eval Tree:setselection $widget(treeCanvas) $current
}
}
switch {
if {$env(P4CLIENT) == "" && ($p4(treeView) == "client" || $p4(treeView) == "workspace")} {
bell
tk_dialog .tkp4warn "TkP4 - no clientspec selected" "Can't change views; no Clientspec is selected." error 0 "OK"
set p4(treeView) depot
return
}
switch $p4(treeView) {
depot {
set p4(treeType) depot
set p4(treeTitle) "Entire Perforce Depot"
set p4(p4clientOpt) ""
if {$p4(treeViewPrev) == "client"} {
# We can reopen the opened dirs since the previous client view is a subset
# of the entire depot.
set p4(treeViewPrev) $p4(treeView)
p4_treeOptions refresh ;# switch depot view to entire depot
return
}
}
client {
set p4(treeType) depot
set p4(treeTitle) "Client View of Perforce Depot"
set p4(p4clientOpt) "-C "
if {$p4(treeViewPrev) == "depot"} {
# We can reopen the intersection of the client with the opened depot dirs.
set p4(treeViewPrev) $p4(treeView)
p4_treeOptions refresh ;# switch depot view to client view
return
}
}
workspace {
set root $p4(clientRoot)
if {![file exists $root]} {
if {$p4(treeView) == $p4(treeViewPrev)} {
set p4(treeView) depot
#puts treecreate5
p4_treeOptions switch
set msg "\n\nThe current view has been changed to Entire Depot."
} {
set p4(treeView) $p4(treeViewPrev)
set msg ""
}
bell
tk_dialog .tkp4warn "TkP4 - root workspace not found" "The root workspace $root is not available on this machine.$msg" error 0 "OK"
return
}
set p4(treeType) dir
set p4(treeTitle) "Client Workspace Root"
set p4(p4clientOpt) ""
}
}
set force [lindex $args 0]
if {$force == "" && $p4(treeViewPrev) == $p4(treeView)} {
#puts "returning - no tree switch"
return
}
set p4(treeViewPrev) $p4(treeView)
#puts "calling: (tree(topdir)=$Tree(topdir) Tree:deltree $widget(treeCanvas)"
Tree:deltree $widget(treeCanvas)
p4_treeOptions create $widget(treeCanvas)
}
}
}
proc {p4_treePopup} {w v rootx rooty} {
global p4 p4files Tree p4pending env widget
if {$v == ""} {
return
}
foreach {v1 v2} $v { break }
set vv [eval Tree:joinnodes $w $v]
#puts "popup v=$v v1=$v1 v2=$v2 vv=$vv"
set m .treeContextMenu
catch {destroy $m}
menu $m -tearoff false
#puts "file type isdir for context: $Tree($vv:isdir) ($vv)"
set file [string trim [lindex [split $vv #] 0]]
if {$file == "" || $p4(treeView) == "workspace"} {
if {$p4(treeView) == "workspace"} {
$m add command -label "Add to Source Control..." -command [list p4_pendingChangeOptions revertUnchanged show [list $v1] [list $v2] add]
$m add separator
}
$m add checkbutton -label "Show Deleted Depot Files" -command "p4_treeOptions refresh" -offvalue 0 -onvalue 1 -variable p4(disp_showDeleted)
$m add checkbutton -label "(Sort Depot Files by Extension)" -command "p4_treeOptions refresh" -offvalue 0 -onvalue 1 -variable p4(disp_sortDepotByExtension) -state disabled
$m add command -label "(Explore...)" -command "p4_xxx xxx" -state disabled
$m add command -label "Command Prompt..." -command "p4_externalCommand commandPrompt [list $p4(clientRoot)]"
$m add command -label "Refresh" -command "p4_refresh depotPane"
tk_popup $m $rootx $rooty
return
}
if {$Tree($vv:isdir)} {
set commandPromptFile $vv/dummyFile
$m add cascade -label "Sync" -menu $m.sync
menu $m.sync -tearoff no
$m.sync add command -label "Sync to Head Revision" -command [list p4_runCommand sync {} {} {} [list $vv/...]]
$m.sync add command -label "Sync to Head Revision (Preview Only)" -command [list p4_runCommand sync {} -n {} [list $vv/...]]
$m.sync add command -label "Sync to Revision, Label, Changelist or Date..." -command [list p4_syncLabel show [list $vv/...]]
$m.sync add command -label "Redo Sync to the Same Revision" -command [list p4_runCommand sync -f {} #have [list $vv/...]]
$m add command -label "Open for Edit" -command [list p4_runCommand checkout edit [list $vv/...]]
if {[p4_integrate isActive]} {
$m add cascade -label "Integrate" -menu $m.integ -state disabled
} {
$m add cascade -label "Integrate" -menu $m.integ
menu $m.integ -tearoff no
$m.integ add command -label "Using Filespec..." -command [list p4_integrate showfile [list $vv] [list $vv/...]]
$m.integ add command -label "Using Branchspec..." -command [list p4_integrate showbranch [list $vv/...]]
}
$m add command -label "Rename..." -command [list p4_rename show dir [list $vv]]
$m add separator
$m add command -label "Open for Delete" -command [list p4_runCommand checkout delete [list $vv/...]]
$m add command -label "Remove from Client" -command [list p4_runCommand sync {} {} #none [list $vv/...]]
$m add command -label "Lock" -command [list p4_runCommand checkout lock [list $vv/...]]
$m add command -label "UnLock" -command [list p4_runCommand checkout unlock [list $vv/...]]
$m add command -label "Revert..." -command [list p4_pendingChangeOptions revertUnchanged show [list $vv/...] {} revertAllDepot]
} {
set commandPromptFile [string trim [lindex [split $vv #] 0]]
regexp {#([0-9]+)/([0-9]+) } $vv match have head
#puts [array get p4files]
#puts $vv
if {$p4files(${file}:cfile) != ""} {
$m add cascade -label "Sync" -menu $m.sync
menu $m.sync -tearoff no
if {$head != $have} {
$m.sync add command -label "Sync to Head Revision" -command [list p4_runCommand sync {} {} {} [list $vv]]
$m.sync add command -label "Sync to Head Revision (Preview Only)" -command [list p4_runCommand sync {} -n {} [list $vv]]
}
$m.sync add command -label "Sync to Revision, Label, Changelist or Date..." -command [list p4_syncLabel show [list $vv]]
$m.sync add command -label "Redo Sync to the Same Revision" -command [list p4_runCommand sync -f {} #have [list $vv]]
if {$have != 0 && $p4files(${file}:OpenAct) == ""} {
$m add command -label "Open for Edit" -command [list p4_runCommand checkout edit [list $vv]]
}
if {[p4_integrate isActive]} {
$m add cascade -label "Integrate" -menu $m.integ -state disabled
} {
$m add cascade -label "Integrate" -menu $m.integ
menu $m.integ -tearoff no
$m.integ add command -label "Using Filespec..." -command [list p4_integrate showfile [list $v1] [list $vv]]
$m.integ add command -label "Using Branchspec..." -command [list p4_integrate showbranch [list $vv] [list $vv]]
}
if {$have != 0 && $p4files(${file}:OpenAct) == "" && [lsearch -regexp $p4files(${file}:other) otherOpen] < 0} {
set renamestate normal
} {
set renamestate disabled
}
$m add command -label "Rename..." -command [list p4_rename show file [list $vv]] -state $renamestate
$m add separator
set needSeparator 0
if {$have != 0 && $p4files(${file}:OpenAct) == ""} {
set needSeparator 1
$m add command -label "Open for Delete" -command [list p4_runCommand checkout delete [list $vv]]
$m add command -label "Remove from Client" -command [list p4_runCommand sync {} {} #none [list $vv]]
}
if {[lsearch -exact {delete edit integrate} $p4files(${file}:OpenAct)] >= 0} {
set needSeparator 1
if {!$p4files(${file}:ourLock) && !$p4files(${file}:othLock)} {
$m add command -label "Lock" -command [list p4_runCommand checkout lock [list $vv]]
}
if {$p4files(${file}:ourLock)} {
$m add command -label "UnLock" -command [list p4_runCommand checkout unlock [list $vv]]
}
$m add command -label "Revert" -command [list p4_pendingChangeOptions revert [list $vv]]
}
if {$p4files(${file}:act) == "delete"} {
set needSeparator 1
$m add command -label "(Recover Deleted File)" -command [list p4_]
}
if {$needSeparator} {
$m add separator
}
if {$have != 0} {
if {[lsearch -exact {edit integrate} $p4files(${file}:OpenAct)] >= 0} {
$m add command -label "Diff vs Depot File" -command "p4_diffDepot [list $vv]"
}
if {$head != $have} {
$m add command -label "Diff vs Head Revision" -command "p4_diffDepot [list $vv] #$head"
}
}
}
$m add cascade -label "View File Using" -menu $m.view
menu $m.view -tearoff no
$m.view add command -label "Associated Viewer" -command "p4_viewFile [list $vv]"
$m.view add command -label "(Other Viewer...)" -command "p4_ $w $vv" -state disabled
if {$have != 0 && $p4files(${file}:cfile) != ""} {
$m add cascade -label "Edit File Using" -menu $m.edit
menu $m.edit -tearoff no
$m.edit add command -label "(Associated Editor)" -command "p4_ $w $vv" -state disabled
$m.edit add command -label "(Other Editor...)" -command "p4_ $w $vv" -state disabled
}
$m add command -label "Properties..." -command "p4_fileInfo show [list $vv]"
$m add command -label "Revision History..." -command "p4_revisionHistory show [list $vv]"
$m add command -label "Describe Last Changelist ($p4files(${file}:chng))..." -command "p4_changeOptions view $p4files(${file}:chng) {} submitted editbutton noprevnext showdiffs"
}
$m add separator
$m add checkbutton -label "Show Deleted Depot Files" -command "p4_treeOptions refresh" -offvalue 0 -onvalue 1 -variable p4(disp_showDeleted)
$m add checkbutton -label "(Sort Depot Files by Extension)" -command "p4_treeOptions refresh" -offvalue 0 -onvalue 1 -variable p4(disp_sortDepotByExtension) -state disabled
$m add command -label "(Explore...)" -command "p4_xxx xxx [list $v2]" -state disabled
#puts "popup v=$v v1=$v1 v2=$v2 vv=$vv"
$m add command -label "Command Prompt..." -command "p4_externalCommand commandPrompt [list $commandPromptFile]"
$m add command -label "Refresh" -command "p4_refresh depotPane"
tk_popup $m $rootx $rooty
}
proc {p4_usage} {{msg {}}} {
global p4 widget
bell
wm withdraw $widget(tkp4)
tk_dialog .tkp4Error "TkP4 - Command Line Error" "${msg}$p4(usage)" "error" 0 "OK"
exit
}
proc {p4_userOptions} {opt args} {
global p4 widget env
switch $opt {
createListbox {
return [p4_mcListbox $widget(mcListboxFrame).user {{name Name 20} {email E-mail 24} {full "Full Name" 14} {access Access 11}} email]
}
selection {
#puts "selection has changed: $args"
}
setTitle {
set p4(mcListboxTitle) "Perforce Users"
}
show {
busy_cursor set
$p4(mcListbox) delete 0 end
if {![info exists p4(cache_user)]} {
#p4_logOptions log "Executing p4 users"
#set p4(cache_user) [exec $p4(exec) users]
p4_runCommand run "$p4(exec) users"
tkwait variable p4(runcmdDone)
if {$p4(runcmdDone) < 0} {
busy_cursor clear
return -1
}
set p4(cache_user) $p4(runcmdOutput)
}
foreach line $p4(cache_user) {
regexp {([^ ]*) <([^ ]*)> \((.*)\) .* (.*)} $line match n e f a
$p4(mcListbox) insert end [list $n $e $f $a]
}
p4_mcOptions sort $p4(mcListbox) name increasing user
p4_userOptions switch $env(P4USER)
busy_cursor clear
}
switch {
set user [lindex $args 0]
if {$p4(mcItem) == "user"} {
set data [$p4(mcListbox) get 0 end]
set idx [lsearch -regexp $data "^$user "]
if {$idx >= 0} {
$p4(mcListbox) selection clear 0 end
$p4(mcListbox) selection set $idx
$p4(mcListbox) see $idx
}
} {
set idx 0
}
if {$idx >= 0} {
set env(P4USER) $user
if {$p4(prevUser) != $user} {
set p4(prevUser) $user
p4_setTitle
p4_refresh pendingPane ;# switch user
}
}
}
switchOLD {
# this was before refresh does both depot and pending panes.
set user [lindex $args 0]
if {$p4(mcItem) == "user"} {
set data [$p4(mcListbox) get 0 end]
set idx [lsearch -regexp $data "^$user "]
if {$idx >= 0} {
$p4(mcListbox) selection clear 0 end
$p4(mcListbox) selection set $idx
$p4(mcListbox) see $idx
}
} {
set idx 0
}
if {$idx >= 0} {
set env(P4USER) $user
if {$p4(prevUser) != $user} {
if {$p4(treeView) != "workspace"} {
p4_treeOptions refresh ;# switch user (OLD)
}
p4_pendingChangeOptions invalidate
set p4(prevUser) $user
p4_setTitle
# Update the Pending pane but don't switch to it
if {$p4(mcItem) == "pending"} {
set force force
} {
set force noshow
}
p4_pendingChangeOptions show $force
}
}
}
}
}
proc {p4_viewDialog} {opt args} {
global p4
switch $opt {
deleteTemp {
catch {destroy $p4(ViewTempWindows)}
catch {unset p4(ViewTempWindows)}
}
show {
set title [lindex $args 0]
set text [lindex $args 1]
set top [lindex $args 2]
set temp [lindex $args 3]
if {![winfo exists $top]} {
set top ""
}
set w $top.view_[incr p4(viewToplevel)]
if {$temp != ""} {
p4_viewDialog deleteTemp
set p4(ViewTempWindows) $w
}
toplevel $w
wm title $w $title
frame $w.opts
pack $w.opts -side top
button $w.opts.quit -text "Close" -command "destroy $w"
pack $w.opts.quit -side left -pady 2 -padx 20
# Create a scrollbar and a text box in the main window.
scrollbar $w.scrollx -orient horiz -command "$w.text xview"
pack $w.scrollx -side bottom -fill x
scrollbar $w.scrolly -command "$w.text yview"
pack $w.scrolly -side right -fill y
text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scrolly set" -xscrollcommand "$w.scrollx set" -setgrid 1 -height 24 -width 82 -background [$w.opts.quit cget -background]
pack $w.text -side left -fill both -expand yes
$w.text insert end $text
$w.text config -state disabled
$w.text see 1.0
return $w
}
}
}
proc {p4_viewFile} {v} {
global p4
set type ""
regexp { #(.*)/(.*) <(.*)>} $v match have head type
#if {[lsearch -exact [list text xtext] $type] < 0}
if {[string first text $type] < 0} {
set msg "Viewing \"$type\" files is not currently supported."
bell
tk_dialog .tkp4err "TkP4 Error" $msg "error" 0 "OK"
return
}
busy_cursor set
#puts viewv=$v
set file [string trim [lindex [split $v #] 0]]
if {$have == 0} {
set rev $head
} {
set rev $have
}
p4_logOptions log "Executing p4 print -q $file#$rev"
set text [exec $p4(exec) print -q $file#$rev]
p4_logOptions note "Retrieved $file#$rev, [string length $text] bytes"
p4_viewDialog show "Viewing $file#$rev <$type>" $text
busy_cursor clear
}
proc {main} {argc argv} {
global p4 widget tcl_platform env Tree
# TTD add info button (p4 info) to host list window (and elsewhere?).
# TTD server connect errors not caught can leave busy cursor.
# TTD some server commands aren't wrapped in catch.
if {[info exists ::vTcl]} {
# This isn't meant to be runable within vTcl
return
}
set p4(TkP4version) 1.12
# Development pre-releases get a letter appended. Remove for final releases.
append p4(TkP4version) ""
wm protocol $widget(tkp4) WM_DELETE_WINDOW p4_exit
wm maxsize $widget(tkp4) [winfo screenwidth .] [winfo screenheight .]
p4_createIcons
# Variables that are saved in tkp4rc
set p4(configVars) [lsort [list servers]]
foreach var $p4(configVars) {
set p4($var) {}
}
# Clipboard popup memu
clipboard_create
bind Text <3> "clipboard_post %W %X %Y"
bind Entry <3> "clipboard_post %W %X %Y"
bind Text <Enter> "+focus %W"
bind Entry <Enter> "+focus %W"
set p4(wm_title_bug) 0
switch $tcl_platform(platform) {
unix {
catch {exec xdpyinfo} xdpyinfo
if {[string first "Hummingbird" $xdpyinfo] >= 0} {
set p4(wm_title_bug) 1
}
set p4(font) -adobe-helvetica-medium-r-normal-*-11-80-100-100-p-56-iso8859-1
}
windows {
set p4(font) -adobe-helvetica-medium-r-normal-*-14-100-100-100-p-76-iso8859-1
}
}
$widget(p4cmdListbox) config -font $p4(font)
set p4(libdir) [file dirname [info script]]
source [file join $p4(libdir) tree.tcl]
source [file join $p4(libdir) mclistbox.tcl]
source [file join $p4(libdir) combobox.tcl]
namespace import ::combobox::*
if {![info exists env(P4USER)] || [string trim $env(P4USER)] == ""} {
catch {unset env(P4USER)}
if {[info exists env(LOGNAME)]} {
set env(P4USER) $env(LOGNAME)
} elseif {[info exists env(USER)]} {
set env(P4USER) $env(USER)
} elseif {[info exists env(USERNAME)]} {
set env(P4USER) $env(USERNAME)
}
}
if {![info exists env(P4USER)] || [lsearch [list nobody nouser root] $env(P4USER)] >= 0} {
catch {unset env(P4USER)}
if {![catch {exec id} id]} {
set u ""
if {[regexp {uid[^(]*\(([^)]*)\)} $id match u]} {
set env(P4USER) $u
}
}
}
if {![info exists env(P4HOST)]} {
if {[info exists env(HOSTNAME)]} {
set env(P4HOST) $env(HOSTNAME)
} elseif {[info exists env(HOST)]} {
set env(P4HOST) $env(HOST)
} {
set env(P4HOST) [lindex [split [info hostname] .] 0]
}
}
foreach var {P4CLIENT P4HOST P4PASSWD P4PORT P4USER} {
if {![info exists env($var)]} {
set env($var) ""
}
}
set p4(usage) "Usage: tkp4 -p P4PORT -c P4CLIENT -u P4USER -P P4PASSWD -H P4HOST"
if {$argc != 0} {
if {$argc%2 != 0} {
p4_usage
exit
}
for {set x 0} {$x < $argc} {incr x 2} {
set opt [lindex $argv $x]
set val [lindex $argv [expr $x+1]]
switch -exact -- $opt -c {
set env(P4CLIENT) $val
} -H {
set env(P4HOST) $val
} -P {
set env(P4PASSWD) $val
} -p {
set env(P4PORT) $val
} -u {
set env(P4USER) $val
} default {
set msg "Illegal option pair:\n\n$opt $val\n\n"
p4_usage $msg
exit
}
}
}
if {$tcl_platform(platform) == "unix"} {
set p4(tkp4rc) [glob ~]/.tkp4rc
} {
# Windows
if {$env(P4USER) != ""} {
set p4(tkp4rc) $p4(libdir)/tkp4rc.$env(P4USER)
} {
set p4(tkp4rc) $p4(libdir)/tkp4rc
}
}
# Setup Options
set p4(disp_showDeleted) 0
set p4(disp_sortPendingByExtension) 0
set p4(disp_sortDepotByExtension) 0
catch {source $p4(tkp4rc)}
# Update the server entries to include startup clients, if required.
set newservers ""
if {$p4(servers) != "" && [llength [lindex $p4(servers) 0]] == 5} {
foreach server $p4(servers) {
lappend newservers [linsert $server 4 {}]
}
set p4(servers) $newservers
}
set p4(FileInfoText) ""
set p4(HelpSection) connection
set p4(StatusInfoText) ""
set p4(SubmittedFiltered) ""
set p4(TooltipText) ""
set p4(clientRoot) ""
set p4(bsListbox) ""
set p4(hostListbox) ""
set p4(mcListbox) ""
set p4(rhListbox) ""
set p4(prevHelpSection) ""
set p4(refreshOpened) ""
set p4(otherRefreshOpened) ""
set p4(tooltipAfterID) 0
set p4(tooltipExitTime) 0
set p4(viewToplevel) 0
set p4(treeType) depot
set p4(treeView) depot
set p4(treeViewPrev) ""
set p4(integratePreview) ""
set p4(integrate_startMode) "first"
set p4(integrate_endMode) "last"
set p4(SyncLabel_mode) "number"
set p4(AutoResolve_type) "-am"
set Tree(curselection) "{} {}"
p4_tooltipSetup
tkwait visibility $widget(tkp4)
p4_connectionOptions init startup
}
proc {Window} {args} {
global vTcl
set cmd [lindex $args 0]
set name [lindex $args 1]
set newname [lindex $args 2]
set rest [lrange $args 3 end]
if {$name == "" || $cmd == ""} {return}
if {$newname == ""} {
set newname $name
}
set exists [winfo exists $newname]
switch $cmd {
show {
if {$exists == "1" && $name != "."} {wm deiconify $name; return}
if {[info procs vTclWindow(pre)$name] != ""} {
eval "vTclWindow(pre)$name $newname $rest"
}
if {[info procs vTclWindow$name] != ""} {
eval "vTclWindow$name $newname $rest"
}
if {[info procs vTclWindow(post)$name] != ""} {
eval "vTclWindow(post)$name $newname $rest"
}
}
hide { if $exists {wm withdraw $newname; return} }
iconify { if $exists {wm iconify $newname; return} }
destroy { if $exists {destroy $newname; return} }
}
}
#################################
# VTCL GENERATED GUI PROCEDURES
#
proc vTclWindow. {base} {
if {$base == ""} {
set base .
}
###################
# CREATING WIDGETS
###################
wm focusmodel $base passive
wm geometry $base 1x1+0+0
wm maxsize $base 1137 870
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm withdraw $base
wm title $base "vt.tcl"
###################
# SETTING GEOMETRY
###################
}
proc vTclWindow.top104 {base} {
if {$base == ""} {
set base .top104
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 822x465+56+119
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Connection Settings"
frame $base.fra105 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra105.01 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief sunken -width 125
radiobutton $base.fra105.01.03 -background grey85 -command {p4_options show} -disabledforeground black -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text Connection -value connection -variable p4(HelpSection)
radiobutton $base.fra105.01.04 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Edit / View)} -value editview -variable p4(HelpSection)
radiobutton $base.fra105.01.05 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Diff / Merge)} -value diffmerge -variable p4(HelpSection)
radiobutton $base.fra105.01.06 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Display) -value display -variable p4(HelpSection)
radiobutton $base.fra105.01.07 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Font) -value font -variable p4(HelpSection)
radiobutton $base.fra105.01.02 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Miscellaneous) -value miscellaneous -variable p4(HelpSection)
frame $base.fra105.08 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
frame $base.fra105.08.fra114 -background grey85 -height 138 -highlightbackground grey85 -width 163
frame $base.fra105.08.fra115 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
button $base.fra105.08.fra115.but116 -background grey85 -command {p4_connectionOptions add} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Add -width 10
button $base.fra105.08.fra115.but117 -background grey85 -command {p4_connectionOptions delete} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Delete -width 10
button $base.fra105.08.fra115.but118 -background grey85 -command {p4_connectionOptions edit} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Edit -width 10
button $base.fra105.08.fra115.but119 -background grey85 -command {p4_serverInfo fromHostListbox} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Server Info} -width 10
button $base.fra105.08.fra115.but18 -background grey85 -command {p4_connectionOptions switch} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Switch To} -width 10
frame $base.fra105.09 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra105.09.010 -background grey85 -command {p4_options save} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra105 -in .top104 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra105.01 -in .top104.fra105 -anchor center -expand 0 -fill x -side top
pack $base.fra105.01.03 -in .top104.fra105.01 -anchor center -expand 1 -fill x -side left
pack $base.fra105.01.04 -in .top104.fra105.01 -anchor center -expand 1 -fill x -side left
pack $base.fra105.01.05 -in .top104.fra105.01 -anchor center -expand 1 -fill x -side left
pack $base.fra105.01.06 -in .top104.fra105.01 -anchor center -expand 1 -fill x -side left
pack $base.fra105.01.07 -in .top104.fra105.01 -anchor center -expand 1 -fill x -side left
pack $base.fra105.01.02 -in .top104.fra105.01 -anchor center -expand 1 -fill x -side left
pack $base.fra105.08 -in .top104.fra105 -anchor center -expand 1 -fill both -side top
pack $base.fra105.08.fra114 -in .top104.fra105.08 -anchor center -expand 0 -fill x -side top
pack $base.fra105.08.fra115 -in .top104.fra105.08 -anchor center -expand 0 -fill x -side top
pack $base.fra105.08.fra115.but116 -in .top104.fra105.08.fra115 -anchor center -expand 1 -fill none -side left
pack $base.fra105.08.fra115.but117 -in .top104.fra105.08.fra115 -anchor center -expand 1 -fill none -side left
pack $base.fra105.08.fra115.but118 -in .top104.fra105.08.fra115 -anchor center -expand 1 -fill none -side left
pack $base.fra105.08.fra115.but119 -in .top104.fra105.08.fra115 -anchor center -expand 1 -fill none -side left
pack $base.fra105.08.fra115.but18 -in .top104.fra105.08.fra115 -anchor center -expand 1 -fill none -side left
pack $base.fra105.09 -in .top104.fra105 -anchor center -expand 0 -fill x -pady 5 -side top
pack $base.fra105.09.010 -in .top104.fra105.09 -anchor center -expand 0 -fill none -side top
}
proc vTclWindow.top106 {base} {
if {$base == ""} {
set base .top106
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 822x467+57+120
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Edit / View Options"
frame $base.fra107 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra107.01 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief sunken -width 125
radiobutton $base.fra107.01.03 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -text Connection -value connection -variable p4(HelpSection)
radiobutton $base.fra107.01.04 -background grey85 -command {p4_options show} -disabledforeground black -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Edit / View)} -value editview -variable p4(HelpSection)
radiobutton $base.fra107.01.05 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Diff / Merge)} -value diffmerge -variable p4(HelpSection)
radiobutton $base.fra107.01.06 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Display) -value display -variable p4(HelpSection)
radiobutton $base.fra107.01.07 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Font) -value font -variable p4(HelpSection)
radiobutton $base.fra107.01.02 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Miscellaneous) -value miscellaneous -variable p4(HelpSection)
frame $base.fra107.08 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
frame $base.fra107.09 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra107.09.010 -background grey85 -command {p4_options save} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra107 -in .top106 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra107.01 -in .top106.fra107 -anchor center -expand 0 -fill x -side top
pack $base.fra107.01.03 -in .top106.fra107.01 -anchor center -expand 1 -fill x -side left
pack $base.fra107.01.04 -in .top106.fra107.01 -anchor center -expand 1 -fill x -side left
pack $base.fra107.01.05 -in .top106.fra107.01 -anchor center -expand 1 -fill x -side left
pack $base.fra107.01.06 -in .top106.fra107.01 -anchor center -expand 1 -fill x -side left
pack $base.fra107.01.07 -in .top106.fra107.01 -anchor center -expand 1 -fill x -side left
pack $base.fra107.01.02 -in .top106.fra107.01 -anchor center -expand 1 -fill x -side left
pack $base.fra107.08 -in .top106.fra107 -anchor center -expand 1 -fill both -side top
pack $base.fra107.09 -in .top106.fra107 -anchor center -expand 0 -fill x -pady 5 -side top
pack $base.fra107.09.010 -in .top106.fra107.09 -anchor center -expand 0 -fill none -side top
}
proc vTclWindow.top108 {base} {
if {$base == ""} {
set base .top108
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 819x461+58+120
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Diff / Merge Options"
frame $base.fra109 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra109.01 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief sunken -width 125
radiobutton $base.fra109.01.03 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -text Connection -value connection -variable p4(HelpSection)
radiobutton $base.fra109.01.04 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Edit / View)} -value editview -variable p4(HelpSection)
radiobutton $base.fra109.01.05 -background grey85 -command {p4_options show} -disabledforeground black -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Diff / Merge)} -value diffmerge -variable p4(HelpSection)
radiobutton $base.fra109.01.06 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Display) -value display -variable p4(HelpSection)
radiobutton $base.fra109.01.07 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Font) -value font -variable p4(HelpSection)
radiobutton $base.fra109.01.02 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Miscellaneous) -value miscellaneous -variable p4(HelpSection)
frame $base.fra109.08 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
frame $base.fra109.09 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra109.09.010 -background grey85 -command {p4_options save} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra109 -in .top108 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra109.01 -in .top108.fra109 -anchor center -expand 0 -fill x -side top
pack $base.fra109.01.03 -in .top108.fra109.01 -anchor center -expand 1 -fill x -side left
pack $base.fra109.01.04 -in .top108.fra109.01 -anchor center -expand 1 -fill x -side left
pack $base.fra109.01.05 -in .top108.fra109.01 -anchor center -expand 1 -fill x -side left
pack $base.fra109.01.06 -in .top108.fra109.01 -anchor center -expand 1 -fill x -side left
pack $base.fra109.01.07 -in .top108.fra109.01 -anchor center -expand 1 -fill x -side left
pack $base.fra109.01.02 -in .top108.fra109.01 -anchor center -expand 1 -fill x -side left
pack $base.fra109.08 -in .top108.fra109 -anchor center -expand 1 -fill both -side top
pack $base.fra109.09 -in .top108.fra109 -anchor center -expand 0 -fill x -pady 5 -side top
pack $base.fra109.09.010 -in .top108.fra109.09 -anchor center -expand 0 -fill none -side top
}
proc vTclWindow.top110 {base} {
if {$base == ""} {
set base .top110
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 818x461+58+119
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Display Options"
frame $base.fra111 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra111.01 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief sunken -width 125
radiobutton $base.fra111.01.03 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -text Connection -value connection -variable p4(HelpSection)
radiobutton $base.fra111.01.04 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Edit / View)} -value editview -variable p4(HelpSection)
radiobutton $base.fra111.01.05 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Diff / Merge)} -value diffmerge -variable p4(HelpSection)
radiobutton $base.fra111.01.06 -background grey85 -command {p4_options show} -disabledforeground black -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Display) -value display -variable p4(HelpSection)
radiobutton $base.fra111.01.07 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Font) -value font -variable p4(HelpSection)
radiobutton $base.fra111.01.02 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Miscellaneous) -value miscellaneous -variable p4(HelpSection)
frame $base.fra111.08 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
frame $base.fra111.09 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra111.09.010 -background grey85 -command {p4_options save} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra111 -in .top110 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra111.01 -in .top110.fra111 -anchor center -expand 0 -fill x -side top
pack $base.fra111.01.03 -in .top110.fra111.01 -anchor center -expand 1 -fill x -side left
pack $base.fra111.01.04 -in .top110.fra111.01 -anchor center -expand 1 -fill x -side left
pack $base.fra111.01.05 -in .top110.fra111.01 -anchor center -expand 1 -fill x -side left
pack $base.fra111.01.06 -in .top110.fra111.01 -anchor center -expand 1 -fill x -side left
pack $base.fra111.01.07 -in .top110.fra111.01 -anchor center -expand 1 -fill x -side left
pack $base.fra111.01.02 -in .top110.fra111.01 -anchor center -expand 1 -fill x -side left
pack $base.fra111.08 -in .top110.fra111 -anchor center -expand 1 -fill both -side top
pack $base.fra111.09 -in .top110.fra111 -anchor center -expand 0 -fill x -pady 5 -side top
pack $base.fra111.09.010 -in .top110.fra111.09 -anchor center -expand 0 -fill none -side top
}
proc vTclWindow.top112 {base} {
if {$base == ""} {
set base .top112
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 819x464+57+119
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Fonts"
frame $base.fra113 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra113.01 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief sunken -width 125
radiobutton $base.fra113.01.03 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -text Connection -value connection -variable p4(HelpSection)
radiobutton $base.fra113.01.04 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Edit / View)} -value editview -variable p4(HelpSection)
radiobutton $base.fra113.01.05 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text {(Diff / Merge)} -value diffmerge -variable p4(HelpSection)
radiobutton $base.fra113.01.06 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Display) -value display -variable p4(HelpSection)
radiobutton $base.fra113.01.07 -background grey85 -command {p4_options show} -disabledforeground black -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Font) -value font -variable p4(HelpSection)
radiobutton $base.fra113.01.02 -background grey85 -command {p4_options show} -foreground black -highlightbackground grey85 -highlightthickness 0 -indicatoron 0 -selectcolor grey70 -state disabled -text (Miscellaneous) -value miscellaneous -variable p4(HelpSection)
frame $base.fra113.08 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
frame $base.fra113.09 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra113.09.010 -background grey85 -command {p4_options save} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra113 -in .top112 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra113.01 -in .top112.fra113 -anchor center -expand 0 -fill x -side top
pack $base.fra113.01.03 -in .top112.fra113.01 -anchor center -expand 1 -fill x -side left
pack $base.fra113.01.04 -in .top112.fra113.01 -anchor center -expand 1 -fill x -side left
pack $base.fra113.01.05 -in .top112.fra113.01 -anchor center -expand 1 -fill x -side left
pack $base.fra113.01.06 -in .top112.fra113.01 -anchor center -expand 1 -fill x -side left
pack $base.fra113.01.07 -in .top112.fra113.01 -anchor center -expand 1 -fill x -side left
pack $base.fra113.01.02 -in .top112.fra113.01 -anchor center -expand 1 -fill x -side left
pack $base.fra113.08 -in .top112.fra113 -anchor center -expand 1 -fill both -side top
pack $base.fra113.09 -in .top112.fra113 -anchor center -expand 0 -fill x -pady 5 -side top
pack $base.fra113.09.010 -in .top112.fra113.09 -anchor center -expand 0 -fill none -side top
}
proc vTclWindow.top120 {base} {
if {$base == ""} {
set base .top120
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 387x240+313+303
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Perforce Server"
frame $base.fra121 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra121.cpd122 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra121.cpd122.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Host Name:} -width 12
entry $base.fra121.cpd122.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -textvariable p4(serverEditHost)
frame $base.fra121.fra124 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra121.fra124.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text Port: -width 12
entry $base.fra121.fra124.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -textvariable p4(serverEditPort)
frame $base.fra121.fra123 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra121.fra123.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {IP Address:} -width 12
entry $base.fra121.fra123.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -textvariable p4(serverEditIP)
frame $base.fra121.fra17 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra121.fra17.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {User Name:} -width 12
entry $base.fra121.fra17.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -textvariable p4(serverEditUser)
frame $base.fra121.fra18 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra121.fra18.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text Client: -width 12
entry $base.fra121.fra18.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -textvariable p4(serverEditClient)
frame $base.fra121.fra125 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra121.fra125.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text Description: -width 12
entry $base.fra121.fra125.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -textvariable p4(serverEditDesc)
frame $base.fra126 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra126.but127 -background grey85 -command {p4_connectionOptions editsave} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 10
button $base.fra126.but128 -background grey85 -command {p4_connectionOptions editcancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra121 -in .top120 -anchor center -expand 0 -fill x -padx 10 -pady 10 -side top
pack $base.fra121.cpd122 -in .top120.fra121 -anchor center -expand 0 -fill x -side top
pack $base.fra121.cpd122.01 -in .top120.fra121.cpd122 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra121.cpd122.02 -in .top120.fra121.cpd122 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra121.fra124 -in .top120.fra121 -anchor center -expand 0 -fill x -side top
pack $base.fra121.fra124.01 -in .top120.fra121.fra124 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra121.fra124.02 -in .top120.fra121.fra124 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra121.fra123 -in .top120.fra121 -anchor center -expand 0 -fill x -side top
pack $base.fra121.fra123.01 -in .top120.fra121.fra123 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra121.fra123.02 -in .top120.fra121.fra123 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra121.fra17 -in .top120.fra121 -anchor center -expand 0 -fill x -side top
pack $base.fra121.fra17.01 -in .top120.fra121.fra17 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra121.fra17.02 -in .top120.fra121.fra17 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra121.fra18 -in .top120.fra121 -anchor center -expand 0 -fill x -side top
pack $base.fra121.fra18.01 -in .top120.fra121.fra18 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra121.fra18.02 -in .top120.fra121.fra18 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra121.fra125 -in .top120.fra121 -anchor center -expand 0 -fill x -side top
pack $base.fra121.fra125.01 -in .top120.fra121.fra125 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra121.fra125.02 -in .top120.fra121.fra125 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra126 -in .top120 -anchor center -expand 0 -fill x -padx 10 -pady 10 -side top
pack $base.fra126.but127 -in .top120.fra126 -anchor center -expand 1 -fill none -side left
pack $base.fra126.but128 -in .top120.fra126 -anchor center -expand 1 -fill none -side left
}
proc vTclWindow.top132 {base} {
if {$base == ""} {
set base .top132
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel \
-background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 384x131+339+320
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Create or Update Client from Template"
frame $base.fra133 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
frame $base.fra133.01 \
-background grey85 -borderwidth 1 -height 30 \
-highlightbackground grey85 -width 30
label $base.fra133.01.02 \
-anchor w -background grey85 -foreground black \
-highlightbackground grey85 -text {Name of Template:} -width 18
entry $base.fra133.01.03 \
-background grey85 -cursor {} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -state disabled \
-textvariable p4(templateName)
frame $base.fra133.04 \
-background grey85 -borderwidth 1 -height 30 \
-highlightbackground grey85 -width 30
label $base.fra133.04.05 \
-anchor w -background grey85 -foreground black \
-highlightbackground grey85 -text {Target Name:} -width 18
entry $base.fra133.04.06 \
-background white -cursor {} -foreground black \
-highlightbackground grey85 -highlightthickness 0 \
-textvariable p4(templateTarget)
frame $base.fra134 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
button $base.fra134.01 \
-background grey85 -command {p4_clientOptions templateedit} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-padx 9 -pady 3 -text OK -width 10
button $base.fra134.02 \
-background grey85 -command {p4_clientOptions templatecancel} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-padx 9 -pady 3 -text Cancel -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra133 \
-in .top132 -anchor center -expand 0 -fill x -padx 10 -pady 10 \
-side top
pack $base.fra133.01 \
-in .top132.fra133 -anchor center -expand 0 -fill x -side top
pack $base.fra133.01.02 \
-in .top132.fra133.01 -anchor center -expand 0 -fill none -padx 2 \
-pady 2 -side left
pack $base.fra133.01.03 \
-in .top132.fra133.01 -anchor center -expand 1 -fill x -padx 2 \
-pady 2 -side right
pack $base.fra133.04 \
-in .top132.fra133 -anchor center -expand 0 -fill x -side top
pack $base.fra133.04.05 \
-in .top132.fra133.04 -anchor center -expand 0 -fill none -padx 2 \
-pady 2 -side left
pack $base.fra133.04.06 \
-in .top132.fra133.04 -anchor center -expand 1 -fill x -padx 2 \
-pady 2 -side right
pack $base.fra134 \
-in .top132 -anchor center -expand 0 -fill x -padx 10 -pady 10 \
-side top
pack $base.fra134.01 \
-in .top132.fra134 -anchor center -expand 1 -fill none -side left
pack $base.fra134.02 \
-in .top132.fra134 -anchor center -expand 1 -fill none -side left
}
proc vTclWindow.top17 {base} {
if {$base == ""} {
set base .top17
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 801x499+197+115
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Describe"
frame $base.fra18 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra18.cpd20 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -relief groove -width 30
scrollbar $base.fra18.cpd20.01 -background grey85 -borderwidth 1 -command {.top17.fra18.cpd20.03 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra18.cpd20.02 -background grey85 -borderwidth 1 -command {.top17.fra18.cpd20.03 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
text $base.fra18.cpd20.03 -background grey85 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 1 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand {.top17.fra18.cpd20.01 set} -yscrollcommand {.top17.fra18.cpd20.02 set}
frame $base.fra21 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra21.fra23 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra21.fra23.but24 -background grey85 -command {p4_itemOptions viewprev} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Prev -width 6
button $base.fra21.fra23.but25 -background grey85 -command {p4_itemOptions viewnext} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Next -width 6
button $base.fra21.fra23.but17 -background grey85 -command {p4_changeOptions view} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Show Diffs}
frame $base.fra21.fra22 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra21.fra22.01 -background grey85 -command {p4_itemOptions viewhide} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Close -width 6
button $base.fra21.fra22.02 -background grey85 -command {p4_itemOptions edit} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Edit -width 6
button $base.fra21.fra22.06 -background grey85 -command {p4_itemOptions viewhelpshow} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Help -width 6
###################
# SETTING GEOMETRY
###################
pack $base.fra18 -in .top17 -anchor center -expand 1 -fill both -side top
pack $base.fra18.cpd20 -in .top17.fra18 -anchor center -expand 1 -fill both -side top
grid columnconf $base.fra18.cpd20 0 -weight 1
grid rowconf $base.fra18.cpd20 0 -weight 1
grid $base.fra18.cpd20.01 -in .top17.fra18.cpd20 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra18.cpd20.02 -in .top17.fra18.cpd20 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.fra18.cpd20.03 -in .top17.fra18.cpd20 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
pack $base.fra21 -in .top17 -anchor center -expand 0 -fill x -side top
pack $base.fra21.fra23 -in .top17.fra21 -anchor center -expand 1 -fill x -side left
pack $base.fra21.fra23.but24 -in .top17.fra21.fra23 -anchor w -expand 0 -fill none -side left
pack $base.fra21.fra23.but25 -in .top17.fra21.fra23 -anchor w -expand 0 -fill none -side left
pack $base.fra21.fra23.but17 -in .top17.fra21.fra23 -anchor w -expand 0 -fill none -side left
pack $base.fra21.fra22 -in .top17.fra21 -anchor center -expand 1 -fill x -pady 10 -side right
pack $base.fra21.fra22.01 -in .top17.fra21.fra22 -anchor w -expand 0 -fill none -padx 10 -side left
pack $base.fra21.fra22.02 -in .top17.fra21.fra22 -anchor w -expand 0 -fill none -padx 10 -side left
pack $base.fra21.fra22.06 -in .top17.fra21.fra22 -anchor w -expand 0 -fill none -padx 10 -side left
}
proc vTclWindow.top18 {base} {
if {$base == ""} {
set base .top18
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 536x547+256+125
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Change Specification"
frame $base.fra19 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra19.fra22 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra19.fra22.cpd24 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra19.fra22.cpd24.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text Change: -width 10
entry $base.fra19.fra22.cpd24.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(Change_Change_value)
frame $base.fra19.fra22.fra25 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra19.fra22.fra25.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text Date: -width 10
entry $base.fra19.fra22.fra25.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(Change_Date_value)
frame $base.fra19.fra22.fra26 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra19.fra22.fra26.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text Client: -width 10
entry $base.fra19.fra22.fra26.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(Change_Client_value)
frame $base.fra19.fra22.fra27 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra19.fra22.fra27.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text User: -width 10
entry $base.fra19.fra22.fra27.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(Change_User_value)
frame $base.fra19.fra22.fra28 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra19.fra22.fra28.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text Status: -width 10
entry $base.fra19.fra22.fra28.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(Change_Status_value)
frame $base.fra19.fra23 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 134
button $base.fra19.fra23.but29 -background grey85 -command {p4_pendingChangeOptions submit} -foreground black -highlightbackground grey85 -highlightthickness 0 -text Submit -width 7
button $base.fra19.fra23.but30 -background grey85 -command {p4_pendingChangeOptions update} -foreground black -highlightbackground grey85 -highlightthickness 0 -text Update -width 7
button $base.fra19.fra23.but31 -background grey85 -command {p4_pendingChangeOptions cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -text Cancel -width 7
button $base.fra19.fra23.but32 -background grey85 -command {p4_pendingChangeOptions help} -foreground black -highlightbackground grey85 -highlightthickness 0 -text Help -width 7
frame $base.fra42 -background grey85 -borderwidth 2 -height 65 -highlightbackground grey85 -relief groove -width 125
label $base.fra42.01 -background grey85 -borderwidth 1 -foreground black -highlightbackground grey85 -text Description:
frame $base.fra42.02 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -width 30
scrollbar $base.fra42.02.03 -background grey85 -borderwidth 1 -command {.top18.fra42.02.05 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra42.02.04 -background grey85 -borderwidth 1 -command {.top18.fra42.02.05 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
text $base.fra42.02.05 -background white -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 1 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand {.top18.fra42.02.03 set} -yscrollcommand {.top18.fra42.02.04 set}
frame $base.cpd38 -background grey85 -height 100 -highlightbackground grey85 -highlightcolor grey85 -width 200
frame $base.cpd38.01 -background grey85 -highlightbackground grey85
frame $base.cpd38.01.fra39 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.cpd38.01.fra39.01 -background grey85 -borderwidth 1 -foreground black -highlightbackground grey85 -text Description:
frame $base.cpd38.01.fra39.02 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -width 30
scrollbar $base.cpd38.01.fra39.02.03 -background grey85 -borderwidth 1 -command {.top18.cpd38.01.fra39.02.05 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.cpd38.01.fra39.02.04 -background grey85 -borderwidth 1 -command {.top18.cpd38.01.fra39.02.05 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
text $base.cpd38.01.fra39.02.05 -background white -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 1 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand {.top18.cpd38.01.fra39.02.03 set} -yscrollcommand {.top18.cpd38.01.fra39.02.04 set}
frame $base.cpd38.02 -background grey85 -highlightbackground grey85 -highlightcolor grey85
frame $base.cpd38.02.fra41 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -highlightcolor grey85 -relief groove -width 125
label $base.cpd38.02.fra41.01 -background grey85 -borderwidth 1 -foreground black -highlightbackground grey85 -text Files:
frame $base.cpd38.02.fra41.02 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -width 30
scrollbar $base.cpd38.02.fra41.02.03 -background grey85 -borderwidth 1 -command {.top18.cpd38.02.fra41.02.05 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.cpd38.02.fra41.02.04 -background grey85 -borderwidth 1 -command {.top18.cpd38.02.fra41.02.05 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
text $base.cpd38.02.fra41.02.05 -background white -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 1 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand {.top18.cpd38.02.fra41.02.03 set} -yscrollcommand {.top18.cpd38.02.fra41.02.04 set}
frame $base.cpd38.03 -background grey85 -borderwidth 2 -cursor sb_v_double_arrow -highlightbackground grey85 -highlightcolor grey85 -relief raised
bind $base.cpd38.03 <B1-Motion> {
set root [ split %W . ]
set nb [ llength $root ]
incr nb -1
set root [ lreplace $root $nb $nb ]
set root [ join $root . ]
set height [ winfo height $root ].0
set val [ expr (%Y - [winfo rooty $root]) /$height ]
if { $val >= 0 && $val <= 1.0 } {
place $root.01 -relheight $val
place $root.03 -rely $val
place $root.02 -relheight [ expr 1.0 - $val ]
}
}
###################
# SETTING GEOMETRY
###################
pack $base.fra19 -in .top18 -anchor center -expand 0 -fill x -side top
pack $base.fra19.fra22 -in .top18.fra19 -anchor center -expand 1 -fill x -side left
pack $base.fra19.fra22.cpd24 -in .top18.fra19.fra22 -anchor center -expand 0 -fill x -side top
pack $base.fra19.fra22.cpd24.01 -in .top18.fra19.fra22.cpd24 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra19.fra22.cpd24.02 -in .top18.fra19.fra22.cpd24 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra19.fra22.fra25 -in .top18.fra19.fra22 -anchor center -expand 0 -fill x -side top
pack $base.fra19.fra22.fra25.01 -in .top18.fra19.fra22.fra25 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra19.fra22.fra25.02 -in .top18.fra19.fra22.fra25 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra19.fra22.fra26 -in .top18.fra19.fra22 -anchor center -expand 0 -fill x -side top
pack $base.fra19.fra22.fra26.01 -in .top18.fra19.fra22.fra26 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra19.fra22.fra26.02 -in .top18.fra19.fra22.fra26 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra19.fra22.fra27 -in .top18.fra19.fra22 -anchor center -expand 0 -fill x -side top
pack $base.fra19.fra22.fra27.01 -in .top18.fra19.fra22.fra27 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra19.fra22.fra27.02 -in .top18.fra19.fra22.fra27 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra19.fra22.fra28 -in .top18.fra19.fra22 -anchor center -expand 0 -fill x -side top
pack $base.fra19.fra22.fra28.01 -in .top18.fra19.fra22.fra28 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra19.fra22.fra28.02 -in .top18.fra19.fra22.fra28 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra19.fra23 -in .top18.fra19 -anchor center -expand 0 -fill y -padx 20 -side left
pack $base.fra19.fra23.but29 -in .top18.fra19.fra23 -anchor center -expand 1 -fill x -side top
pack $base.fra19.fra23.but30 -in .top18.fra19.fra23 -anchor center -expand 1 -fill x -side top
pack $base.fra19.fra23.but31 -in .top18.fra19.fra23 -anchor center -expand 1 -fill x -side top
pack $base.fra19.fra23.but32 -in .top18.fra19.fra23 -anchor center -expand 1 -fill x -side top
pack $base.fra42 -in .top18 -anchor center -expand 1 -fill both -side top
pack $base.fra42.01 -in .top18.fra42 -anchor w -expand 0 -fill none -padx 6 -side top
pack $base.fra42.02 -in .top18.fra42 -anchor center -expand 1 -fill both -side top
grid columnconf $base.fra42.02 0 -weight 1
grid rowconf $base.fra42.02 0 -weight 1
grid $base.fra42.02.03 -in .top18.fra42.02 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra42.02.04 -in .top18.fra42.02 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.fra42.02.05 -in .top18.fra42.02 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
pack $base.cpd38 -in .top18 -anchor center -expand 1 -fill both -side top
place $base.cpd38.01 -x 0 -y 0 -relwidth 1 -height -1 -relheight 0.5336 -anchor nw -bordermode ignore
pack $base.cpd38.01.fra39 -in .top18.cpd38.01 -anchor center -expand 1 -fill both -side top
pack $base.cpd38.01.fra39.01 -in .top18.cpd38.01.fra39 -anchor w -expand 0 -fill none -padx 6 -side top
pack $base.cpd38.01.fra39.02 -in .top18.cpd38.01.fra39 -anchor center -expand 1 -fill both -side top
grid columnconf $base.cpd38.01.fra39.02 0 -weight 1
grid rowconf $base.cpd38.01.fra39.02 0 -weight 1
grid $base.cpd38.01.fra39.02.03 -in .top18.cpd38.01.fra39.02 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.cpd38.01.fra39.02.04 -in .top18.cpd38.01.fra39.02 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.cpd38.01.fra39.02.05 -in .top18.cpd38.01.fra39.02 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
place $base.cpd38.02 -x 0 -y 0 -rely 1 -relwidth 1 -height -1 -relheight 0.4664 -anchor sw -bordermode ignore
pack $base.cpd38.02.fra41 -in .top18.cpd38.02 -anchor center -expand 1 -fill both -side top
pack $base.cpd38.02.fra41.01 -in .top18.cpd38.02.fra41 -anchor w -expand 0 -fill none -padx 6 -side top
pack $base.cpd38.02.fra41.02 -in .top18.cpd38.02.fra41 -anchor center -expand 1 -fill both -side top
grid columnconf $base.cpd38.02.fra41.02 0 -weight 1
grid rowconf $base.cpd38.02.fra41.02 0 -weight 1
grid $base.cpd38.02.fra41.02.03 -in .top18.cpd38.02.fra41.02 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.cpd38.02.fra41.02.04 -in .top18.cpd38.02.fra41.02 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.cpd38.02.fra41.02.05 -in .top18.cpd38.02.fra41.02 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
place $base.cpd38.03 -x 0 -relx 0.9 -y 0 -rely 0.5336 -width 10 -height 10 -anchor e -bordermode ignore
}
proc vTclWindow.top19 {base} {
if {$base == ""} {
set base .top19
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 669x695+186+43
wm maxsize $base 1009 738
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - File Integrate"
frame $base.fra20 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra20.fra30 -background grey85 -height 75 -highlightbackground grey85 -width 125
checkbutton $base.fra20.fra30.che31 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Sync target files first} -variable p4(integrate_syncFirst) -offvalue 0 -onvalue 1
checkbutton $base.fra20.fra30.che32 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Reverse Integration (-r)} -variable p4(integrate_reverse)
label $base.fra20.lab22 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Source Filespec} -textvariable p4(integrate_sourceHeading)
frame $base.fra20.cpd23 -background grey85 -borderwidth 2 -height 77 -highlightbackground grey85 -relief groove -width 30
scrollbar $base.fra20.cpd23.01 -background grey85 -borderwidth 1 -command {.top19.fra20.cpd23.03 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra20.cpd23.02 -background grey85 -borderwidth 1 -command {.top19.fra20.cpd23.03 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
text $base.fra20.cpd23.03 -background white -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 6 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand {.top19.fra20.cpd23.01 set} -yscrollcommand {.top19.fra20.cpd23.02 set}
frame $base.fra20.fra17 -background grey85 -height 10 -highlightbackground grey85 -width 125
frame $base.fra20.fra24 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra20.fra24.fra25 -background grey85 -height 75 -highlightbackground grey85 -width 125
label $base.fra20.fra24.fra25.lab27 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Target Filespec}
frame $base.fra20.fra24.fra26 -background grey85 -height 75 -highlightbackground grey85 -width 125
label $base.fra20.fra24.fra26.lab28 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {File Specifications - }
radiobutton $base.fra20.fra24.fra26.rad29 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text To -value to -variable p4(integrate_branchToFrom)
radiobutton $base.fra20.fra24.fra26.rad30 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {From Selected Files} -value from -variable p4(integrate_branchToFrom)
frame $base.fra20.fra24.fra33 -background grey85 -height 75 -highlightbackground grey85 -width 125
label $base.fra20.fra24.fra33.01 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Integrate - }
radiobutton $base.fra20.fra24.fra33.02 -background grey85 -command {p4_integrate allsubset} -foreground black -highlightbackground grey85 -highlightthickness 0 -text {All Files} -value all -variable p4(integrate_branchAllSubset)
radiobutton $base.fra20.fra24.fra33.03 -background grey85 -command {p4_integrate allsubset} -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Subset of Files} -value subset -variable p4(integrate_branchAllSubset)
frame $base.fra20.fra31 -background grey85 -height 75 -highlightbackground grey85 -width 125
entry $base.fra20.fra31.ent33 -background white -foreground black -highlightbackground grey85 -highlightthickness 0
frame $base.fra20.fra31.cpd34 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -relief groove -width 30
scrollbar $base.fra20.fra31.cpd34.01 -background grey85 -borderwidth 1 -command {.top19.fra20.fra31.cpd34.03 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra20.fra31.cpd34.02 -background grey85 -borderwidth 1 -command {.top19.fra20.fra31.cpd34.03 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
text $base.fra20.fra31.cpd34.03 -background white -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 6 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand {.top19.fra20.fra31.cpd34.01 set} -yscrollcommand {.top19.fra20.fra31.cpd34.02 set}
frame $base.fra20.fra35 -background grey85 -height 75 -highlightbackground grey85 -width 125
label $base.fra20.fra35.lab36 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Open file(s) under Changelist}
frame $base.fra20.fra35.fra37 -background grey85 -height 23 -highlightbackground grey85 -width 125
frame $base.fra20.fra39 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.fra20.fra39.lab40 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text Options
frame $base.fra20.fra39.fra41 -background grey85 -height 75 -highlightbackground grey85 -width 125
checkbutton $base.fra20.fra39.fra41.che45 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Force re-integration on all revisions even if some are already integrated (-f)} -variable p4(integrate_opt_f)
frame $base.fra20.fra39.fra42 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra20.fra39.fra42.fra43 -background grey85 -height 75 -highlightbackground grey85 -width 125
checkbutton $base.fra20.fra39.fra42.fra43.che46 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Do not copy new files to workspace (-v)} -variable p4(integrate_opt_v)
checkbutton $base.fra20.fra39.fra42.fra43.che47 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -text {(Delete source file(s), for rename operation)} -variable p4(integrate_opt_rename)
frame $base.fra20.fra39.fra42.fra44 -background grey85 -height 75 -highlightbackground grey85 -width 125
checkbutton $base.fra20.fra39.fra42.fra44.che48 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Permit deletes/re-adds (-d)} -variable p4(integrate_opt_d)
checkbutton $base.fra20.fra39.fra42.fra44.che49 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Enable baseless merges (-i)} -variable p4(integrate_opt_i)
frame $base.fra20.fra50 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.fra20.fra50.lab51 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Starting with}
radiobutton $base.fra20.fra50.rad52 -background grey85 -command {p4_integrate setrevision start} -foreground black -highlightbackground grey85 -highlightthickness 0 -text {First Unintegrated Revision} -value first -variable p4(integrate_startMode)
frame $base.fra20.fra50.fra53 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra20.fra50.fra53.rad54 -anchor w -background grey85 -command {p4_integrate setrevision start} -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Revison Number} -value number -variable p4(integrate_startMode) -width 14
entry $base.fra20.fra50.fra53.ent55 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(integrate_startnumber) -width 24
frame $base.fra20.fra50.fra58 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra20.fra50.fra58.01 -anchor w -background grey85 -command {p4_integrate setrevision start} -foreground black -highlightbackground grey85 -highlightthickness 0 -text Other -value other -variable p4(integrate_startMode) -width 14
entry $base.fra20.fra50.fra58.02 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(integrate_startother) -width 24
label $base.fra20.fra50.lab59 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Label, Changelist Number, Client or Date (yyyy/mm/dd or yyyy/mm/dd:hh:mm:ss)}
frame $base.fra20.fra60 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.fra20.fra60.01 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Ending with}
radiobutton $base.fra20.fra60.02 -background grey85 -command {p4_integrate setrevision end} -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Last Unintegrated Revision} -value last -variable p4(integrate_endMode)
frame $base.fra20.fra60.03 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra20.fra60.03.04 -anchor w -background grey85 -command {p4_integrate setrevision end} -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Revison Number} -value number -variable p4(integrate_endMode) -width 14
entry $base.fra20.fra60.03.05 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(integrate_endnumber) -width 24
frame $base.fra20.fra60.06 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra20.fra60.06.07 -anchor w -background grey85 -command {p4_integrate setrevision end} -foreground black -highlightbackground grey85 -highlightthickness 0 -text Other -value other -variable p4(integrate_endMode) -width 14
entry $base.fra20.fra60.06.08 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(integrate_endother) -width 24
label $base.fra20.fra60.09 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Label, Changelist Number, Client or Date (yyyy/mm/dd or yyyy/mm/dd:hh:mm:ss)}
frame $base.fra20.fra61 -background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra20.fra61.but62 -background grey85 -command {p4_integrate back} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {< Back} -width 8
button $base.fra20.fra61.but63 -background grey85 -command {p4_integrate ok} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 8
button $base.fra20.fra61.but17 -background grey85 -command {p4_integrate preview} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Preview -width 8
button $base.fra20.fra61.but64 -background grey85 -command {p4_integrate cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 8
button $base.fra20.fra61.but65 -background grey85 -command {p4_integrate help} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Help -width 8
frame $base.fra20.fra18 -background grey85 -height 10 -highlightbackground grey85 -width 125
###################
# SETTING GEOMETRY
###################
pack $base.fra20 -in .top19 -anchor center -expand 1 -fill both -side top
pack $base.fra20.fra30 -in .top19.fra20 -anchor center -expand 0 -fill x -side top
pack $base.fra20.fra30.che31 -in .top19.fra20.fra30 -anchor w -expand 0 -fill none -pady 10 -side left
pack $base.fra20.fra30.che32 -in .top19.fra20.fra30 -anchor w -expand 0 -fill none -padx 64 -pady 10 -side left
pack $base.fra20.lab22 -in .top19.fra20 -anchor w -expand 0 -fill none -side top
pack $base.fra20.cpd23 -in .top19.fra20 -anchor center -expand 1 -fill both -side top
grid columnconf $base.fra20.cpd23 0 -weight 1
grid rowconf $base.fra20.cpd23 0 -weight 1
grid $base.fra20.cpd23.01 -in .top19.fra20.cpd23 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra20.cpd23.02 -in .top19.fra20.cpd23 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.fra20.cpd23.03 -in .top19.fra20.cpd23 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
pack $base.fra20.fra17 -in .top19.fra20 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra24 -in .top19.fra20 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra24.fra25 -in .top19.fra20.fra24 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra25.lab27 -in .top19.fra20.fra24.fra25 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra26 -in .top19.fra20.fra24 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra26.lab28 -in .top19.fra20.fra24.fra26 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra26.rad29 -in .top19.fra20.fra24.fra26 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra26.rad30 -in .top19.fra20.fra24.fra26 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra33 -in .top19.fra20.fra24 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra33.01 -in .top19.fra20.fra24.fra33 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra33.02 -in .top19.fra20.fra24.fra33 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra24.fra33.03 -in .top19.fra20.fra24.fra33 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra31 -in .top19.fra20 -anchor center -expand 1 -fill both -side top
pack $base.fra20.fra31.ent33 -in .top19.fra20.fra31 -anchor w -expand 1 -fill x -side left
pack $base.fra20.fra31.cpd34 -in .top19.fra20.fra31 -anchor w -expand 1 -fill both -side top
grid columnconf $base.fra20.fra31.cpd34 0 -weight 1
grid rowconf $base.fra20.fra31.cpd34 0 -weight 1
grid $base.fra20.fra31.cpd34.01 -in .top19.fra20.fra31.cpd34 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra20.fra31.cpd34.02 -in .top19.fra20.fra31.cpd34 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.fra20.fra31.cpd34.03 -in .top19.fra20.fra31.cpd34 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
pack $base.fra20.fra35 -in .top19.fra20 -anchor w -expand 0 -fill x -pady 10 -side top
pack $base.fra20.fra35.lab36 -in .top19.fra20.fra35 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra35.fra37 -in .top19.fra20.fra35 -anchor w -expand 0 -fill none -padx 10 -side left
pack $base.fra20.fra39 -in .top19.fra20 -anchor w -expand 0 -fill x -pady 10 -side top
pack $base.fra20.fra39.lab40 -in .top19.fra20.fra39 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra39.fra41 -in .top19.fra20.fra39 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra39.fra41.che45 -in .top19.fra20.fra39.fra41 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra39.fra42 -in .top19.fra20.fra39 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra39.fra42.fra43 -in .top19.fra20.fra39.fra42 -anchor nw -expand 0 -fill y -side left
pack $base.fra20.fra39.fra42.fra43.che46 -in .top19.fra20.fra39.fra42.fra43 -anchor nw -expand 0 -fill none -side top
pack $base.fra20.fra39.fra42.fra43.che47 -in .top19.fra20.fra39.fra42.fra43 -anchor nw -expand 0 -fill none -side top
pack $base.fra20.fra39.fra42.fra44 -in .top19.fra20.fra39.fra42 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra39.fra42.fra44.che48 -in .top19.fra20.fra39.fra42.fra44 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra39.fra42.fra44.che49 -in .top19.fra20.fra39.fra42.fra44 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra50 -in .top19.fra20 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra50.lab51 -in .top19.fra20.fra50 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra50.rad52 -in .top19.fra20.fra50 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra50.fra53 -in .top19.fra20.fra50 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra50.fra53.rad54 -in .top19.fra20.fra50.fra53 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra50.fra53.ent55 -in .top19.fra20.fra50.fra53 -anchor center -expand 0 -fill none -padx 20 -side left
pack $base.fra20.fra50.fra58 -in .top19.fra20.fra50 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra50.fra58.01 -in .top19.fra20.fra50.fra58 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra50.fra58.02 -in .top19.fra20.fra50.fra58 -anchor center -expand 0 -fill none -padx 20 -side left
pack $base.fra20.fra50.lab59 -in .top19.fra20.fra50 -anchor w -expand 0 -fill none -padx 23 -side top
pack $base.fra20.fra60 -in .top19.fra20 -anchor w -expand 0 -fill x -pady 10 -side top
pack $base.fra20.fra60.01 -in .top19.fra20.fra60 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra60.02 -in .top19.fra20.fra60 -anchor w -expand 0 -fill none -side top
pack $base.fra20.fra60.03 -in .top19.fra20.fra60 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra60.03.04 -in .top19.fra20.fra60.03 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra60.03.05 -in .top19.fra20.fra60.03 -anchor center -expand 0 -fill none -padx 20 -side left
pack $base.fra20.fra60.06 -in .top19.fra20.fra60 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra60.06.07 -in .top19.fra20.fra60.06 -anchor w -expand 0 -fill none -side left
pack $base.fra20.fra60.06.08 -in .top19.fra20.fra60.06 -anchor center -expand 0 -fill none -padx 20 -side left
pack $base.fra20.fra60.09 -in .top19.fra20.fra60 -anchor w -expand 0 -fill none -padx 23 -side top
pack $base.fra20.fra61 -in .top19.fra20 -anchor w -expand 0 -fill x -side top
pack $base.fra20.fra61.but62 -in .top19.fra20.fra61 -anchor e -expand 1 -fill none -padx 12 -side left
pack $base.fra20.fra61.but63 -in .top19.fra20.fra61 -anchor center -expand 0 -fill none -padx 12 -side left
pack $base.fra20.fra61.but17 -in .top19.fra20.fra61 -anchor center -expand 0 -fill none -padx 12 -side left
pack $base.fra20.fra61.but64 -in .top19.fra20.fra61 -anchor center -expand 0 -fill none -padx 12 -side left
pack $base.fra20.fra61.but65 -in .top19.fra20.fra61 -anchor w -expand 1 -fill none -padx 12 -side left
pack $base.fra20.fra18 -in .top19.fra20 -anchor w -expand 0 -fill x -side top
}
proc vTclWindow.top20 {base} {
if {$base == ""} {
set base .top20
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 596x374+191+140
wm maxsize $base 1009 738
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - File Integrate - Specify Branch"
frame $base.fra21 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra21.fra22 -background grey85 -height 75 -highlightbackground grey85 -width 125
label $base.fra21.fra22.lab25 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Choose the PERFORCE Branch definition that will be used to map source files to target files.}
frame $base.fra21.fra23 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
frame $base.fra21.fra24 -background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra21.fra24.but26 -background grey85 -command {p4_integrate branchBack} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -state disabled -text {< Back} -width 8
button $base.fra21.fra24.but27 -background grey85 -command {p4_integrate branchNext} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Next >} -width 8
button $base.fra21.fra24.but28 -background grey85 -command {p4_integrate branchCancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 8
button $base.fra21.fra24.but29 -background grey85 -command {p4_integrate branchHelp} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Help -width 8
###################
# SETTING GEOMETRY
###################
pack $base.fra21 -in .top20 -anchor center -expand 1 -fill both -side top
pack $base.fra21.fra22 -in .top20.fra21 -anchor center -expand 0 -fill none -pady 10 -side top
pack $base.fra21.fra22.lab25 -in .top20.fra21.fra22 -anchor center -expand 0 -fill none -side top
pack $base.fra21.fra23 -in .top20.fra21 -anchor center -expand 1 -fill both -side top
pack $base.fra21.fra24 -in .top20.fra21 -anchor center -expand 0 -fill x -pady 10 -side top
pack $base.fra21.fra24.but26 -in .top20.fra21.fra24 -anchor e -expand 1 -fill none -padx 20 -side left
pack $base.fra21.fra24.but27 -in .top20.fra21.fra24 -anchor center -expand 0 -fill none -padx 20 -side left
pack $base.fra21.fra24.but28 -in .top20.fra21.fra24 -anchor center -expand 0 -fill none -padx 20 -side left
pack $base.fra21.fra24.but29 -in .top20.fra21.fra24 -anchor w -expand 1 -fill none -padx 20 -side left
}
proc vTclWindow.top21 {base} {
if {$base == ""} {
set base .top21
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 620x201+237+262
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Rename Files"
frame $base.fra22 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra22.fra23 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
label $base.fra22.fra23.lab28 -background grey85 -borderwidth 1 -font {Helvetica -16 bold} -foreground black -highlightbackground grey85 -text {Rename Files}
frame $base.fra22.cpd29 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra22.cpd29.01 -anchor e -background grey85 -foreground black -highlightbackground grey85 -text From: -width 6
entry $base.fra22.cpd29.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(RenameOldName) -width 64
frame $base.fra22.fra30 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra22.fra30.01 -anchor e -background grey85 -foreground black -highlightbackground grey85 -text To: -width 6
entry $base.fra22.fra30.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -textvariable p4(RenameNewName) -width 64
frame $base.fra22.fra39 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra22.fra39.rad40 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Rename entire directory} -value dir -variable p4(RenameEntireDirectory)
radiobutton $base.fra22.fra39.rad41 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Choose files in directory} -value choose -variable p4(RenameEntireDirectory)
frame $base.fra22.fra27 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra22.fra27.but31 -background grey85 -command {set p4(RenameGotNewname) save} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 12
button $base.fra22.fra27.but32 -background grey85 -command {set p4(RenameGotNewname) cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 12
###################
# SETTING GEOMETRY
###################
pack $base.fra22 -in .top21 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra22.fra23 -in .top21.fra22 -anchor center -expand 0 -fill none -side top
pack $base.fra22.fra23.lab28 -in .top21.fra22.fra23 -anchor center -expand 0 -fill none -side top
pack $base.fra22.cpd29 -in .top21.fra22 -anchor center -expand 0 -fill x -pady 10 -side top
pack $base.fra22.cpd29.01 -in .top21.fra22.cpd29 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra22.cpd29.02 -in .top21.fra22.cpd29 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra22.fra30 -in .top21.fra22 -anchor center -expand 0 -fill x -side top
pack $base.fra22.fra30.01 -in .top21.fra22.fra30 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra22.fra30.02 -in .top21.fra22.fra30 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra22.fra39 -in .top21.fra22 -anchor center -expand 0 -fill x -pady 10 -side top
pack $base.fra22.fra39.rad40 -in .top21.fra22.fra39 -anchor center -expand 0 -fill none -padx 30 -side left
pack $base.fra22.fra39.rad41 -in .top21.fra22.fra39 -anchor center -expand 0 -fill none -side left
pack $base.fra22.fra27 -in .top21.fra22 -anchor center -expand 0 -fill x -side top
pack $base.fra22.fra27.but31 -in .top21.fra22.fra27 -anchor e -expand 1 -fill none -padx 10 -side left
pack $base.fra22.fra27.but32 -in .top21.fra22.fra27 -anchor w -expand 1 -fill none -padx 10 -side left
}
proc vTclWindow.top22 {base} {
if {$base == ""} {
set base .top22
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 314x117+396+335
wm maxsize $base 1265 994
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Sync to Selected Changelist"
frame $base.fra23 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra23.rad24 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -justify left -text {Sync all client files to selected changelist} -value all -variable p4(Change_syncOpt)
radiobutton $base.fra23.rad25 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -justify left -text {Sync file in selected changelist only} -value changelist -variable p4(Change_syncOpt)
frame $base.fra23.fra26 -background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra23.fra26.but27 -background grey85 -command {p4_changeOptions sync} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 -text Sync -width 6
button $base.fra23.fra26.but28 -background grey85 -command {p4_changeOptions syncPreview} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 -text Preview -width 6
button $base.fra23.fra26.but29 -background grey85 -command {p4_changeOptions syncCancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 -text Cancel -width 6
button $base.fra23.fra26.but30 -background grey85 -command {p4_changeOptions syncHelp} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 -text Help -width 6 -state disabled
###################
# SETTING GEOMETRY
###################
pack $base.fra23 -in .top22 -anchor center -expand 1 -fill both -padx 8 -pady 4 -side top
pack $base.fra23.rad24 -in .top22.fra23 -anchor w -expand 0 -fill none -pady 10 -side top
pack $base.fra23.rad25 -in .top22.fra23 -anchor w -expand 0 -fill none -side top
pack $base.fra23.fra26 -in .top22.fra23 -anchor w -expand 0 -fill none -pady 10 -side top
pack $base.fra23.fra26.but27 -in .top22.fra23.fra26 -anchor center -expand 0 -fill none -padx 4 -side left
pack $base.fra23.fra26.but28 -in .top22.fra23.fra26 -anchor center -expand 0 -fill none -padx 4 -side left
pack $base.fra23.fra26.but29 -in .top22.fra23.fra26 -anchor center -expand 0 -fill none -padx 4 -side left
pack $base.fra23.fra26.but30 -in .top22.fra23.fra26 -anchor center -expand 0 -fill none -padx 4 -side left
}
proc vTclWindow.top24 {base} {
if {$base == ""} {
set base .top24
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 700x373+101+203
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Describe Help"
frame $base.fra25 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra25.01 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -relief groove -width 30
scrollbar $base.fra25.01.02 -background grey85 -borderwidth 1 -command {.top24.fra25.01.04 xview} -highlightbackground grey85 -highlightthickness 0 -orient horiz -width 10
scrollbar $base.fra25.01.03 -background grey85 -borderwidth 1 -command {.top24.fra25.01.04 yview} -highlightbackground grey85 -highlightthickness 0 -orient vert -width 10
text $base.fra25.01.04 -background grey85 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 1 -highlightbackground grey85 -highlightthickness 0 -takefocus 1 -width 8 -xscrollcommand {.top24.fra25.01.02 set} -yscrollcommand {.top24.fra25.01.03 set}
frame $base.fra27 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra27.01 -background grey85 -command {p4_itemOptions helphide} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Close -width 6
###################
# SETTING GEOMETRY
###################
pack $base.fra25 -in .top24 -anchor center -expand 1 -fill both -side top
pack $base.fra25.01 -in .top24.fra25 -anchor center -expand 1 -fill both -side top
grid columnconf $base.fra25.01 0 -weight 1
grid rowconf $base.fra25.01 0 -weight 1
grid $base.fra25.01.02 -in .top24.fra25.01 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra25.01.03 -in .top24.fra25.01 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.fra25.01.04 -in .top24.fra25.01 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
pack $base.fra27 -in .top24 -anchor center -expand 0 -fill none -pady 10 -side top
pack $base.fra27.01 -in .top24.fra27 -anchor center -expand 0 -fill none -padx 10 -side left
}
proc vTclWindow.top31 {base} {
if {$base == ""} {
set base .top31
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 432x379+363+256
wm maxsize $base 1265 994
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Change File Type"
frame $base.fra32 -background grey85 -borderwidth 4 -height 75 -highlightbackground grey85 -width 125
frame $base.fra32.fra33 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.fra32.fra33.lab37 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Base File Type}
frame $base.fra32.fra33.fra38 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra32.fra33.fra38.rad39 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text Text -value text -variable p4(ChangeFileType_basetype)
radiobutton $base.fra32.fra33.fra38.rad40 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text Binary -value binary -variable p4(ChangeFileType_basetype)
radiobutton $base.fra32.fra33.fra38.rad41 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text Symlink -value Symlink -variable p4(ChangeFileType_basetype)
radiobutton $base.fra32.fra33.fra38.rad42 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text Resource -value resource -variable p4(ChangeFileType_basetype)
radiobutton $base.fra32.fra33.fra38.rad43 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text Apple -value apple -variable p4(ChangeFileType_basetype)
frame $base.fra32.fra34 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.fra32.fra34.lab44 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {File Type Modifiers}
checkbutton $base.fra32.fra34.che45 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -offvalue {} -onvalue x -text {+x exec bit set on client} -variable p4(ChangeFileType_mod_x)
checkbutton $base.fra32.fra34.che46 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -offvalue {} -onvalue w -text {+w always writeable on client} -variable p4(ChangeFileType_mod_w)
frame $base.fra32.fra34.fra49 -background grey85 -highlightbackground grey85
checkbutton $base.fra32.fra34.fra49.che50 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -offvalue {} -onvalue k -text {+k $keyword:$ expansion} -variable p4(ChangeFileType_mod_k)
checkbutton $base.fra32.fra34.fra49.che51 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -offvalue {} -onvalue o -text {+o only $Id:$ & $Header:$} -variable p4(ChangeFileType_mod_o)
checkbutton $base.fra32.fra34.che47 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -offvalue {} -onvalue m -text {+m preserve file modification times} -variable p4(ChangeFileType_mod_m)
checkbutton $base.fra32.fra34.che52 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -offvalue {} -onvalue l -text {+l disallow multiple opens of this file} -variable p4(ChangeFileType_mod_l)
frame $base.fra32.fra35 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.fra32.fra35.lab53 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -justify left -text {Server Storage Method}
radiobutton $base.fra32.fra35.rad54 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {server stores using default method} -value {} -variable p4(ChangeFileType_storage)
radiobutton $base.fra32.fra35.rad55 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {+C server stores compressed file per revision} -value C -variable p4(ChangeFileType_storage)
radiobutton $base.fra32.fra35.rad56 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {+D server stores deltas in RCS format} -value D -variable p4(ChangeFileType_storage)
radiobutton $base.fra32.fra35.rad57 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {+F server stores full file per revision} -value F -variable p4(ChangeFileType_storage)
radiobutton $base.fra32.fra35.rad58 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -text {+S server stores only single head revision} -value S -variable p4(ChangeFileType_storage)
frame $base.fra32.fra36 -background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra32.fra36.but59 -background grey85 -command {p4_pendingChangeOptions changeFileType ok} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 -text OK -width 8
button $base.fra32.fra36.but60 -background grey85 -command {p4_pendingChangeOptions changeFileType cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 -text Cancel -width 8
button $base.fra32.fra36.but61 -background grey85 -command {p4_pendingChangeOptions changeFileType help} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 -text Help -width 8
###################
# SETTING GEOMETRY
###################
pack $base.fra32 -in .top31 -anchor center -expand 1 -fill both -side top
pack $base.fra32.fra33 -in .top31.fra32 -anchor center -expand 0 -fill x -side top
pack $base.fra32.fra33.lab37 -in .top31.fra32.fra33 -anchor nw -expand 0 -fill none -pady 4 -side top
pack $base.fra32.fra33.fra38 -in .top31.fra32.fra33 -anchor center -expand 0 -fill x -side top
pack $base.fra32.fra33.fra38.rad39 -in .top31.fra32.fra33.fra38 -anchor w -expand 0 -fill none -side left
pack $base.fra32.fra33.fra38.rad40 -in .top31.fra32.fra33.fra38 -anchor w -expand 0 -fill none -padx 4 -side left
pack $base.fra32.fra33.fra38.rad41 -in .top31.fra32.fra33.fra38 -anchor w -expand 0 -fill none -padx 4 -side left
pack $base.fra32.fra33.fra38.rad42 -in .top31.fra32.fra33.fra38 -anchor w -expand 0 -fill none -padx 4 -side left
pack $base.fra32.fra33.fra38.rad43 -in .top31.fra32.fra33.fra38 -anchor w -expand 0 -fill none -side left
pack $base.fra32.fra34 -in .top31.fra32 -anchor center -expand 0 -fill x -pady 10 -side top
pack $base.fra32.fra34.lab44 -in .top31.fra32.fra34 -anchor nw -expand 0 -fill none -pady 4 -side top
pack $base.fra32.fra34.che45 -in .top31.fra32.fra34 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra34.che46 -in .top31.fra32.fra34 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra34.fra49 -in .top31.fra32.fra34 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra34.fra49.che50 -in .top31.fra32.fra34.fra49 -anchor center -expand 0 -fill none -side left
pack $base.fra32.fra34.fra49.che51 -in .top31.fra32.fra34.fra49 -anchor center -expand 0 -fill none -padx 20 -side left
pack $base.fra32.fra34.che47 -in .top31.fra32.fra34 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra34.che52 -in .top31.fra32.fra34 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra35 -in .top31.fra32 -anchor center -expand 0 -fill x -side top
pack $base.fra32.fra35.lab53 -in .top31.fra32.fra35 -anchor nw -expand 0 -fill none -pady 4 -side top
pack $base.fra32.fra35.rad54 -in .top31.fra32.fra35 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra35.rad55 -in .top31.fra32.fra35 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra35.rad56 -in .top31.fra32.fra35 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra35.rad57 -in .top31.fra32.fra35 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra35.rad58 -in .top31.fra32.fra35 -anchor w -expand 0 -fill none -side top
pack $base.fra32.fra36 -in .top31.fra32 -anchor center -expand 0 -fill x -pady 10 -side top
pack $base.fra32.fra36.but59 -in .top31.fra32.fra36 -anchor e -expand 1 -fill none -side left
pack $base.fra32.fra36.but60 -in .top31.fra32.fra36 -anchor center -expand 1 -fill none -side left
pack $base.fra32.fra36.but61 -in .top31.fra32.fra36 -anchor w -expand 1 -fill none -side left
}
proc vTclWindow.top33 {base} {
if {$base == ""} {
set base .top33
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 699x541+169+135
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Rename Files"
frame $base.fra34 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra34.fra35 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra34.fra35.01 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
label $base.fra34.fra35.01.02 -background grey85 -borderwidth 1 -font {Helvetica -16 bold} -foreground black -highlightbackground grey85 -text {Rename Files}
frame $base.fra34.fra35.03 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra34.fra35.03.04 -anchor e -background grey85 -foreground black -highlightbackground grey85 -text From: -width 6
entry $base.fra34.fra35.03.05 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(RenameOldName)
frame $base.fra34.fra35.06 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra34.fra35.06.07 -anchor e -background grey85 -foreground black -highlightbackground grey85 -text To: -width 6
entry $base.fra34.fra35.06.08 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(RenameNewName)
frame $base.fra34.01 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -relief groove -width 30
listbox $base.fra34.01.02 -background grey85 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -highlightbackground grey85 -highlightthickness 0 -selectmode extended -xscrollcommand {.top33.fra34.01.03 set} -yscrollcommand {.top33.fra34.01.04 set}
bind $base.fra34.01.02 <ButtonRelease-1> {
p4_rename renameSelection
}
bind $base.fra34.01.02 <ButtonPress-3> {
p4_rename showContextMenu %W %x %y %X %Y
p4_rename renameSelection
}
scrollbar $base.fra34.01.03 -background grey85 -borderwidth 1 -command {.top33.fra34.01.02 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra34.01.04 -background grey85 -borderwidth 1 -command {.top33.fra34.01.02 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
frame $base.fra34.05 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra34.05.06 -background grey85 -command {p4_rename renameRemove} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Remove Selected Items}
button $base.fra34.05.07 -background grey85 -command {set p4(RenameRenameOpt) cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 12
button $base.fra34.05.08 -background grey85 -command {set p4(RenameRenameOpt) rename} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Rename Files} -width 12
###################
# SETTING GEOMETRY
###################
pack $base.fra34 -in .top33 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra34.fra35 -in .top33.fra34 -anchor center -expand 0 -fill x -padx 10 -side top
pack $base.fra34.fra35.01 -in .top33.fra34.fra35 -anchor center -expand 0 -fill none -side top
pack $base.fra34.fra35.01.02 -in .top33.fra34.fra35.01 -anchor center -expand 0 -fill none -side top
pack $base.fra34.fra35.03 -in .top33.fra34.fra35 -anchor center -expand 1 -fill x -pady 10 -side top
pack $base.fra34.fra35.03.04 -in .top33.fra34.fra35.03 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra34.fra35.03.05 -in .top33.fra34.fra35.03 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra34.fra35.06 -in .top33.fra34.fra35 -anchor center -expand 1 -fill x -side top
pack $base.fra34.fra35.06.07 -in .top33.fra34.fra35.06 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra34.fra35.06.08 -in .top33.fra34.fra35.06 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra34.01 -in .top33.fra34 -anchor center -expand 1 -fill both -pady 10 -side top
grid columnconf $base.fra34.01 0 -weight 1
grid rowconf $base.fra34.01 0 -weight 1
grid $base.fra34.01.02 -in .top33.fra34.01 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
grid $base.fra34.01.03 -in .top33.fra34.01 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra34.01.04 -in .top33.fra34.01 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
pack $base.fra34.05 -in .top33.fra34 -anchor center -expand 0 -fill x -side top
pack $base.fra34.05.06 -in .top33.fra34.05 -anchor center -expand 1 -fill none -side left
pack $base.fra34.05.07 -in .top33.fra34.05 -anchor center -expand 1 -fill none -side left
pack $base.fra34.05.08 -in .top33.fra34.05 -anchor center -expand 1 -fill none -side left
}
proc vTclWindow.top36 {base} {
if {$base == ""} {
set base .top36
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 800x500+188+163
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Rename Files"
frame $base.fra37 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
label $base.fra37.lab42 -background grey85 -borderwidth 1 -font {Helvetica -24 bold} -foreground black -highlightbackground grey85 -text {Open Source Files}
frame $base.fra37.01 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra37.01.02 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
message $base.fra37.01.02.mes38 -aspect 1200 -background grey85 -foreground black -highlightbackground grey85 -padx 5 -pady 2 -text {You probably shouldn't rename files that are currently checked out for edit, and you certainly cannot rename files that are locked. The following files are currently checked out.}
frame $base.fra37.010 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -relief groove -width 30
listbox $base.fra37.010.011 -background grey85 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -highlightbackground grey85 -highlightthickness 0 -xscrollcommand {.top36.fra37.010.012 set} -yscrollcommand {.top36.fra37.010.013 set}
bind $base.fra37.010.011 <ButtonPress-3> {
p4_rename showContextMenu %W %x %y %X %Y
}
scrollbar $base.fra37.010.012 -background grey85 -borderwidth 1 -command {.top36.fra37.010.011 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra37.010.013 -background grey85 -borderwidth 1 -command {.top36.fra37.010.011 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
frame $base.fra37.014 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra37.014.015 -background grey85 -command {set p4(RenameEdittedFilesOpt) omit} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Omit these files and Continue}
button $base.fra37.014.017 -background grey85 -command {set p4(RenameEdittedFilesOpt) cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 12
###################
# SETTING GEOMETRY
###################
pack $base.fra37 -in .top36 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra37.lab42 -in .top36.fra37 -anchor center -expand 0 -fill none -pady 10 -side top
pack $base.fra37.01 -in .top36.fra37 -anchor center -expand 0 -fill x -padx 10 -side top
pack $base.fra37.01.02 -in .top36.fra37.01 -anchor center -expand 1 -fill x -side top
pack $base.fra37.01.02.mes38 -in .top36.fra37.01.02 -anchor center -expand 1 -fill x -side top
pack $base.fra37.010 -in .top36.fra37 -anchor center -expand 1 -fill both -pady 10 -side top
grid columnconf $base.fra37.010 0 -weight 1
grid rowconf $base.fra37.010 0 -weight 1
grid $base.fra37.010.011 -in .top36.fra37.010 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
grid $base.fra37.010.012 -in .top36.fra37.010 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra37.010.013 -in .top36.fra37.010 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
pack $base.fra37.014 -in .top36.fra37 -anchor center -expand 0 -fill x -side top
pack $base.fra37.014.015 -in .top36.fra37.014 -anchor center -expand 1 -fill none -side left
pack $base.fra37.014.017 -in .top36.fra37.014 -anchor center -expand 1 -fill none -side left
}
proc vTclWindow.top37 {base} {
if {$base == ""} {
set base .top37
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 316x122+282+296
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - New client name"
frame $base.fra38 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra38.fra39 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra38.fra39.cpd43 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -relief raised -width 30
label $base.fra38.fra39.cpd43.01 -background grey85 -foreground black -highlightbackground grey85 -relief groove -text Client -width 8
entry $base.fra38.fra39.cpd43.02 -background white -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -width 30
frame $base.fra38.fra40 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra38.fra40.but41 -background grey85 -command {set p4_entryDialog_Done 1} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 8
button $base.fra38.fra40.but42 -background grey85 -command {set p4_entryDialog_Done -1} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 8
###################
# SETTING GEOMETRY
###################
pack $base.fra38 -in .top37 -anchor center -expand 0 -fill none -padx 10 -pady 10 -side top
pack $base.fra38.fra39 -in .top37.fra38 -anchor center -expand 0 -fill none -pady 10 -side top
pack $base.fra38.fra39.cpd43 -in .top37.fra38.fra39 -anchor center -expand 0 -fill none -side top
pack $base.fra38.fra39.cpd43.01 -in .top37.fra38.fra39.cpd43 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra38.fra39.cpd43.02 -in .top37.fra38.fra39.cpd43 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra38.fra40 -in .top37.fra38 -anchor center -expand 0 -fill none -pady 10 -side top
pack $base.fra38.fra40.but41 -in .top37.fra38.fra40 -anchor center -expand 0 -fill none -padx 10 -side left
pack $base.fra38.fra40.but42 -in .top37.fra38.fra40 -anchor center -expand 0 -fill none -padx 10 -side left
}
proc vTclWindow.top40 {base} {
if {$base == ""} {
set base .top40
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel \
-background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 1006x679+16+4
wm maxsize $base 1137 870
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm deiconify $base
wm title $base "Tkp4"
frame $base.fra47 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra47.cpd48 \
-background grey85 -borderwidth 1 -height 30 \
-highlightbackground grey85 -width 30
menubutton $base.fra47.cpd48.01 \
-anchor w -background grey85 -foreground black \
-highlightbackground grey85 -menu .top40.fra47.cpd48.01.02 -padx 4 \
-pady 3 -text File -width 4
menu $base.fra47.cpd48.01.02 \
-background grey85 -cursor {} -foreground black -tearoff 0
$base.fra47.cpd48.01.02 add command \
-command {p4_pendingChangeOptions fileMenuAdd} \
-label {Add to Source Control...}
$base.fra47.cpd48.01.02 add separator
$base.fra47.cpd48.01.02 add command \
-command p4_exit -label Exit
menubutton $base.fra47.cpd48.03 \
-anchor w -background grey85 -foreground black \
-highlightbackground grey85 -menu .top40.fra47.cpd48.03.04 -padx 4 \
-pady 3 -text Edit -width 4
menu $base.fra47.cpd48.03.04 \
-background grey85 -cursor {} -foreground black -tearoff 0
$base.fra47.cpd48.03.04 add command \
-command {p4_options show} -label Options...
menubutton $base.fra47.cpd48.05 \
-anchor w -background grey85 -foreground black \
-highlightbackground grey85 -menu .top40.fra47.cpd48.05.06 -padx 4 \
-pady 3 -text Help -width 4
menu $base.fra47.cpd48.05.06 \
-background grey85 -cursor {} -foreground black -tearoff 0
$base.fra47.cpd48.05.06 add command \
-command {p4_help using} -label {Using TkP4}
$base.fra47.cpd48.05.06 add command \
-command {p4_help p4winDifferences} -label {P4Win Differences}
$base.fra47.cpd48.05.06 add command \
-command {p4_help changes} -label Changes
$base.fra47.cpd48.05.06 add separator
$base.fra47.cpd48.05.06 add command \
-command {p4_help about} -label {About TkP4}
menubutton $base.fra47.cpd48.men18 \
-anchor w -background grey85 -foreground black \
-highlightbackground grey85 -menu .top40.fra47.cpd48.men18.01 -padx 4 \
-pady 3 -text View -width 4
menu $base.fra47.cpd48.men18.01 \
-background grey85 -cursor {} -foreground black \
-postcommand {p4_postMenu view} -tearoff 0
$base.fra47.cpd48.men18.01 add command \
-command {p4_itemOptions show branch} -label Branches
$base.fra47.cpd48.men18.01 add command \
-command {p4_pendingChangeOptions show} \
-label {Changelists - Pending}
$base.fra47.cpd48.men18.01 add command \
-command {p4_itemOptions show change} \
-label {Changelists - Submitted}
$base.fra47.cpd48.men18.01 add command \
-command {p4_itemOptions show changeFiltered force} \
-label {Changelists - Submitted / Filtered}
$base.fra47.cpd48.men18.01 add command \
-command {p4_itemOptions show client} -label ClientSpecs
$base.fra47.cpd48.men18.01 add command \
-command {p4_itemOptions show job} -label Jobs
$base.fra47.cpd48.men18.01 add command \
-command {p4_itemOptions show label} -label Labels
$base.fra47.cpd48.men18.01 add command \
-command {p4_itemOptions show user} -label Users
$base.fra47.cpd48.men18.01 add separator
$base.fra47.cpd48.men18.01 add radiobutton \
-command {p4_treeOptions switch} -label {Entire Depot} -value depot \
-variable p4(treeView)
$base.fra47.cpd48.men18.01 add radiobutton \
-command {p4_treeOptions switch} -label {Client View of Depot} \
-value client -variable p4(treeView)
$base.fra47.cpd48.men18.01 add radiobutton \
-command {p4_treeOptions switch} -label {Client Workspace Root} \
-value workspace -variable p4(treeView)
frame $base.fra17 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -relief groove -width 125
frame $base.fra17.fra51 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra17.fra51.01 \
-background grey85 -command {p4_treeOptions switch} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -image butd \
-indicatoron 0 -selectcolor grey85 -value depot \
-variable p4(treeView)
radiobutton $base.fra17.fra51.rad52 \
-background grey85 -command {p4_treeOptions switch} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -image butdclient \
-indicatoron 0 -selectcolor grey85 -value client \
-variable p4(treeView)
radiobutton $base.fra17.fra51.rad53 \
-background grey85 -command {p4_treeOptions switch} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -image butdisk \
-indicatoron 0 -selectcolor grey85 -value workspace \
-variable p4(treeView)
frame $base.fra17.fra18 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra17.fra18.but26 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
frame $base.fra17.fra19 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra17.fra19.but27 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
button $base.fra17.fra19.but28 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
button $base.fra17.fra19.but29 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
frame $base.fra17.fra20 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra17.fra20.but30 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
frame $base.fra17.fra21 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra17.fra21.but31 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
button $base.fra17.fra21.but32 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
button $base.fra17.fra21.but33 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
frame $base.fra17.fra22 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra17.fra22.but34 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
frame $base.fra17.fra23 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra17.fra23.but35 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
button $base.fra17.fra23.but36 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
button $base.fra17.fra23.but37 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
button $base.fra17.fra23.but38 \
-background grey85 -foreground black -height 17 \
-highlightbackground grey85 -highlightthickness 0 -image butnone \
-padx 9 -pady 3 -width 19
frame $base.fra17.fra24 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra17.fra24.rad39 \
-background grey85 -command {p4_pendingChangeOptions show} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-image butpending -indicatoron 0 -selectcolor grey85 -value pending \
-variable p4(mcItem)
radiobutton $base.fra17.fra24.rad40 \
-background grey85 -command {p4_itemOptions show change} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-image butsubmitted -indicatoron 0 -selectcolor grey85 -value change \
-variable p4(mcItem)
radiobutton $base.fra17.fra24.rad41 \
-background grey85 -command {p4_itemOptions show branch} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-image butbranch -indicatoron 0 -selectcolor grey85 -value branch \
-variable p4(mcItem)
radiobutton $base.fra17.fra24.rad42 \
-background grey85 -command {p4_itemOptions show label} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-image butlabel -indicatoron 0 -selectcolor grey85 -value label \
-variable p4(mcItem)
radiobutton $base.fra17.fra24.rad43 \
-background grey85 -command {p4_itemOptions show client} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-image butclient -indicatoron 0 -selectcolor grey85 -value client \
-variable p4(mcItem)
radiobutton $base.fra17.fra24.rad44 \
-background grey85 -command {p4_itemOptions show user} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-image butuser -indicatoron 0 -selectcolor grey85 -value user \
-variable p4(mcItem)
radiobutton $base.fra17.fra24.rad45 \
-background grey85 -command {p4_itemOptions show job} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-image butjob -indicatoron 0 -selectcolor grey85 -value job \
-variable p4(mcItem)
frame $base.fra17.fra25 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra17.fra25.but46 \
-background grey85 -command {p4_options show} -foreground black \
-height 17 -highlightbackground grey85 -highlightthickness 0 \
-image butsetup -padx 9 -pady 3 -width 19
button $base.fra17.fra25.but47 \
-background grey85 -command {p4_serverInfo show} -foreground black \
-height 17 -highlightbackground grey85 -highlightthickness 0 \
-image butinfo -padx 9 -pady 3 -width 19
frame $base.fra41 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra41.cpd42 \
-background grey85 -height 100 -highlightbackground grey85 -width 200
frame $base.fra41.cpd42.01 \
-background #9900991B99FE -highlightbackground grey85
frame $base.fra41.cpd42.01.cpd44 \
-background grey85 -height 100 -highlightbackground grey85 -width 200
frame $base.fra41.cpd42.01.cpd44.01 \
-background grey85 -highlightbackground grey85
entry $base.fra41.cpd42.01.cpd44.01.ent49 \
-background grey85 -font {Helvetica -16 bold} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -state disabled \
-textvariable p4(treeTitle)
frame $base.fra41.cpd42.01.cpd44.01.cpd17 \
-background grey85 -borderwidth 2 -height 30 \
-highlightbackground grey85 -relief groove -width 30
scrollbar $base.fra41.cpd42.01.cpd44.01.cpd17.01 \
-background grey85 -borderwidth 1 \
-command {.top40.fra41.cpd42.01.cpd44.01.cpd17.03 xview} \
-highlightbackground grey85 -highlightthickness 0 -orient horizontal \
-width 10
scrollbar $base.fra41.cpd42.01.cpd44.01.cpd17.02 \
-background grey85 -borderwidth 1 \
-command {.top40.fra41.cpd42.01.cpd44.01.cpd17.03 yview} \
-highlightbackground grey85 -highlightthickness 0 -width 10
canvas $base.fra41.cpd42.01.cpd44.01.cpd17.03 \
-background white -borderwidth 1 -height 100 \
-highlightbackground grey85 -highlightthickness 0 -relief sunken \
-width 100 \
-xscrollcommand {.top40.fra41.cpd42.01.cpd44.01.cpd17.01 set} \
-yscrollcommand {.top40.fra41.cpd42.01.cpd44.01.cpd17.02 set}
bind $base.fra41.cpd42.01.cpd44.01.cpd17.03 <B2-Motion> {
set curx [%W canvasx [winfo x %W]]
set cury [%W canvasy [winfo y %W]]
foreach {minx miny a b} [%W bbox all] { break }
if {$curx - ((%x - $p4(treex)) * 10) < $minx} {
set p4(treex) [expr {int(($curx - $minx) / 10.0 + $p4(treex))}]
} {
set p4(treex) %x
}
if {$cury - ((%y - $p4(treey)) * 10) < $miny} {
set p4(treey) [expr {int(($cury - $miny) / 10.0 + $p4(treey))}]
} {
set p4(treey) %y
}
%W scan dragto $p4(treex) $p4(treey)
}
bind $base.fra41.cpd42.01.cpd44.01.cpd17.03 <Button-2> {
set p4(treex) %x
set p4(treey) %y
%W scan mark %x %y
}
frame $base.fra41.cpd42.01.cpd44.02 \
-background grey85 -highlightbackground grey85
entry $base.fra41.cpd42.01.cpd44.02.ent50 \
-background grey85 -font {Helvetica -16 bold} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -state disabled \
-textvariable p4(mcListboxTitle)
frame $base.fra41.cpd42.01.cpd44.02.fra17 \
-background white -borderwidth 2 -height 75 \
-highlightbackground grey85 -relief groove -width 125
frame $base.fra41.cpd42.01.cpd44.03 \
-background grey85 -borderwidth 2 -cursor sb_h_double_arrow \
-highlightbackground grey85 -relief raised
bind $base.fra41.cpd42.01.cpd44.03 <B1-Motion> {
set root [ split %W . ]
set nb [ llength $root ]
incr nb -1
set root [ lreplace $root $nb $nb ]
set root [ join $root . ]
set width [ winfo width $root ].0
set val [ expr (%X - [winfo rootx $root]) /$width ]
if { $val >= 0 && $val <= 1.0 } {
place $root.01 -relwidth $val
place $root.03 -relx $val
place $root.02 -relwidth [ expr 1.0 - $val ]
}
}
frame $base.fra41.cpd42.02 \
-background #9900991B99FE -highlightbackground grey85
frame $base.fra41.cpd42.02.cpd43 \
-background grey85 -borderwidth 2 -height 30 \
-highlightbackground grey85 -relief groove -width 30
listbox $base.fra41.cpd42.02.cpd43.01 \
-background white -borderwidth 1 \
-font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-selectmode extended \
-xscrollcommand {.top40.fra41.cpd42.02.cpd43.02 set} \
-yscrollcommand {.top40.fra41.cpd42.02.cpd43.03 set}
scrollbar $base.fra41.cpd42.02.cpd43.02 \
-background grey85 -borderwidth 1 \
-command {.top40.fra41.cpd42.02.cpd43.01 xview} \
-highlightbackground grey85 -highlightthickness 0 -orient horizontal \
-width 10
scrollbar $base.fra41.cpd42.02.cpd43.03 \
-background grey85 -borderwidth 1 \
-command {.top40.fra41.cpd42.02.cpd43.01 yview} \
-highlightbackground grey85 -highlightthickness 0 -width 10
frame $base.fra41.cpd42.03 \
-background grey85 -borderwidth 2 -cursor sb_v_double_arrow \
-highlightbackground grey85 -relief raised
bind $base.fra41.cpd42.03 <B1-Motion> {
set root [ split %W . ]
set nb [ llength $root ]
incr nb -1
set root [ lreplace $root $nb $nb ]
set root [ join $root . ]
set height [ winfo height $root ].0
set val [ expr (%Y - [winfo rooty $root]) /$height ]
if { $val >= 0 && $val <= 1.0 } {
place $root.01 -relheight $val
place $root.03 -rely $val
place $root.02 -relheight [ expr 1.0 - $val ]
}
}
frame $base.fra129 \
-background grey85 -borderwidth 1 -height 75 \
-highlightbackground grey85 -width 125
label $base.fra129.lab130 \
-anchor w -background grey85 -borderwidth 0 -font {Helvetica -12} \
-foreground black -highlightbackground grey85 -text {file info} \
-textvariable p4(FileInfoText)
label $base.fra129.lab131 \
-anchor w -background grey85 -borderwidth 1 -font {Helvetica -12} \
-foreground black -highlightbackground grey85 -relief sunken \
-text status -textvariable p4(StatusInfoText) -width 30
###################
# SETTING GEOMETRY
###################
pack $base.fra47 \
-in .top40 -anchor center -expand 0 -fill x -side top
pack $base.fra47.cpd48 \
-in .top40.fra47 -anchor center -expand 0 -fill x -side top
pack $base.fra47.cpd48.01 \
-in .top40.fra47.cpd48 -anchor center -expand 0 -fill none -side left
pack $base.fra47.cpd48.03 \
-in .top40.fra47.cpd48 -anchor center -expand 0 -fill none -side left
pack $base.fra47.cpd48.05 \
-in .top40.fra47.cpd48 -anchor center -expand 0 -fill none \
-side right
pack $base.fra47.cpd48.men18 \
-in .top40.fra47.cpd48 -anchor center -expand 0 -fill none -side left
pack $base.fra17 \
-in .top40 -anchor center -expand 0 -fill x -side top
pack $base.fra17.fra51 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra51.01 \
-in .top40.fra17.fra51 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra51.rad52 \
-in .top40.fra17.fra51 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra51.rad53 \
-in .top40.fra17.fra51 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra18 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra18.but26 \
-in .top40.fra17.fra18 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra19 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra19.but27 \
-in .top40.fra17.fra19 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra19.but28 \
-in .top40.fra17.fra19 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra19.but29 \
-in .top40.fra17.fra19 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra20 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra20.but30 \
-in .top40.fra17.fra20 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra21 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra21.but31 \
-in .top40.fra17.fra21 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra21.but32 \
-in .top40.fra17.fra21 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra21.but33 \
-in .top40.fra17.fra21 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra22 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra22.but34 \
-in .top40.fra17.fra22 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra23 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra23.but35 \
-in .top40.fra17.fra23 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra23.but36 \
-in .top40.fra17.fra23 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra23.but37 \
-in .top40.fra17.fra23 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra23.but38 \
-in .top40.fra17.fra23 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra24 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra24.rad39 \
-in .top40.fra17.fra24 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra24.rad40 \
-in .top40.fra17.fra24 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra24.rad41 \
-in .top40.fra17.fra24 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra24.rad42 \
-in .top40.fra17.fra24 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra24.rad43 \
-in .top40.fra17.fra24 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra24.rad44 \
-in .top40.fra17.fra24 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra24.rad45 \
-in .top40.fra17.fra24 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra25 \
-in .top40.fra17 -anchor center -expand 0 -fill none -padx 4 -pady 2 \
-side left
pack $base.fra17.fra25.but46 \
-in .top40.fra17.fra25 -anchor center -expand 0 -fill none -side left
pack $base.fra17.fra25.but47 \
-in .top40.fra17.fra25 -anchor center -expand 0 -fill none -side left
pack $base.fra41 \
-in .top40 -anchor center -expand 1 -fill both -side top
pack $base.fra41.cpd42 \
-in .top40.fra41 -anchor center -expand 1 -fill both -side top
place $base.fra41.cpd42.01 \
-x 0 -y 0 -relwidth 1 -height -1 -relheight 0.8035 -anchor nw \
-bordermode ignore
pack $base.fra41.cpd42.01.cpd44 \
-in .top40.fra41.cpd42.01 -anchor center -expand 1 -fill both \
-side top
place $base.fra41.cpd42.01.cpd44.01 \
-x 0 -y 0 -width -1 -relwidth 0.3063 -relheight 1 -anchor nw \
-bordermode ignore
pack $base.fra41.cpd42.01.cpd44.01.ent49 \
-in .top40.fra41.cpd42.01.cpd44.01 -anchor center -expand 0 -fill x \
-padx 2 -side top
pack $base.fra41.cpd42.01.cpd44.01.cpd17 \
-in .top40.fra41.cpd42.01.cpd44.01 -anchor center -expand 1 \
-fill both -side top
grid columnconf $base.fra41.cpd42.01.cpd44.01.cpd17 0 -weight 1
grid rowconf $base.fra41.cpd42.01.cpd44.01.cpd17 0 -weight 1
grid $base.fra41.cpd42.01.cpd44.01.cpd17.01 \
-in .top40.fra41.cpd42.01.cpd44.01.cpd17 -column 0 -row 1 \
-columnspan 1 -rowspan 1 -sticky ew
grid $base.fra41.cpd42.01.cpd44.01.cpd17.02 \
-in .top40.fra41.cpd42.01.cpd44.01.cpd17 -column 1 -row 0 \
-columnspan 1 -rowspan 1 -sticky ns
grid $base.fra41.cpd42.01.cpd44.01.cpd17.03 \
-in .top40.fra41.cpd42.01.cpd44.01.cpd17 -column 0 -row 0 \
-columnspan 1 -rowspan 1 -sticky nesw
place $base.fra41.cpd42.01.cpd44.02 \
-x 0 -relx 1 -y 0 -width -1 -relwidth 0.6937 -relheight 1 -anchor ne \
-bordermode ignore
pack $base.fra41.cpd42.01.cpd44.02.ent50 \
-in .top40.fra41.cpd42.01.cpd44.02 -anchor center -expand 0 -fill x \
-padx 2 -side top
pack $base.fra41.cpd42.01.cpd44.02.fra17 \
-in .top40.fra41.cpd42.01.cpd44.02 -anchor center -expand 1 \
-fill both -side top
place $base.fra41.cpd42.01.cpd44.03 \
-x 0 -relx 0.3063 -y 0 -rely 0.9 -width 10 -height 10 -anchor s \
-bordermode ignore
place $base.fra41.cpd42.02 \
-x 0 -y 0 -rely 1 -relwidth 1 -height -1 -relheight 0.1965 -anchor sw \
-bordermode ignore
pack $base.fra41.cpd42.02.cpd43 \
-in .top40.fra41.cpd42.02 -anchor center -expand 1 -fill both \
-side top
grid columnconf $base.fra41.cpd42.02.cpd43 0 -weight 1
grid rowconf $base.fra41.cpd42.02.cpd43 0 -weight 1
grid $base.fra41.cpd42.02.cpd43.01 \
-in .top40.fra41.cpd42.02.cpd43 -column 0 -row 0 -columnspan 1 \
-rowspan 1 -sticky nesw
grid $base.fra41.cpd42.02.cpd43.02 \
-in .top40.fra41.cpd42.02.cpd43 -column 0 -row 1 -columnspan 1 \
-rowspan 1 -sticky ew
grid $base.fra41.cpd42.02.cpd43.03 \
-in .top40.fra41.cpd42.02.cpd43 -column 1 -row 0 -columnspan 1 \
-rowspan 1 -sticky ns
place $base.fra41.cpd42.03 \
-x 0 -relx 0.9 -y 0 -rely 0.8035 -width 10 -height 10 -anchor e \
-bordermode ignore
pack $base.fra129 \
-in .top40 -anchor center -expand 0 -fill x -side top
pack $base.fra129.lab130 \
-in .top40.fra129 -anchor center -expand 1 -fill x -padx 6 -side left
pack $base.fra129.lab131 \
-in .top40.fra129 -anchor center -expand 0 -fill none -side right
}
proc vTclWindow.top43 {base} {
if {$base == ""} {
set base .top43
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 760x489+200+154
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Unchanged Files for Revert"
frame $base.fra44 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra44.cpd45 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -relief groove -width 30
listbox $base.fra44.cpd45.01 -background grey85 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -highlightbackground grey85 -highlightthickness 0 -selectmode extended -xscrollcommand {.top43.fra44.cpd45.02 set} -yscrollcommand {.top43.fra44.cpd45.03 set}
bind $base.fra44.cpd45.01 <ButtonRelease-1> {
p4_pendingChangeOptions revertUnchanged selection
}
scrollbar $base.fra44.cpd45.02 -background grey85 -borderwidth 1 -command {.top43.fra44.cpd45.01 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra44.cpd45.03 -background grey85 -borderwidth 1 -command {.top43.fra44.cpd45.01 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
frame $base.fra44.fra46 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra44.fra46.but47 -background grey85 -command {p4_pendingChangeOptions revertUnchanged remove} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Remove Selected Items}
button $base.fra44.fra46.but48 -background grey85 -command {p4_pendingChangeOptions revertUnchanged cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 12
button $base.fra44.fra46.but49 -background grey85 -command {p4_pendingChangeOptions revertUnchanged revert} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Revert Files} -width 0
###################
# SETTING GEOMETRY
###################
pack $base.fra44 -in .top43 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra44.cpd45 -in .top43.fra44 -anchor center -expand 1 -fill both -pady 10 -side top
grid columnconf $base.fra44.cpd45 0 -weight 1
grid rowconf $base.fra44.cpd45 0 -weight 1
grid $base.fra44.cpd45.01 -in .top43.fra44.cpd45 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
grid $base.fra44.cpd45.02 -in .top43.fra44.cpd45 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra44.cpd45.03 -in .top43.fra44.cpd45 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
pack $base.fra44.fra46 -in .top43.fra44 -anchor center -expand 0 -fill x -side top
pack $base.fra44.fra46.but47 -in .top43.fra44.fra46 -anchor center -expand 1 -fill none -side left
pack $base.fra44.fra46.but48 -in .top43.fra44.fra46 -anchor center -expand 1 -fill none -side left
pack $base.fra44.fra46.but49 -in .top43.fra44.fra46 -anchor center -expand 1 -fill none -side left
}
proc vTclWindow.top50 {base} {
if {$base == ""} {
set base .top50
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -cursor xterm -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 569x140+299+456
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Sync File to Revision, Label, Changelist or Date"
frame $base.fra51 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra51.fra62 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra51.fra62.03 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra51.fra62.03.04 -anchor w -background grey85 -command {p4_syncLabel setrevision} -foreground black -highlightbackground grey85 -highlightthickness 0 -text {Revison Number} -value number -variable p4(SyncLabel_mode) -width 14
entry $base.fra51.fra62.03.05 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(SyncLabel_number) -width 24
frame $base.fra51.fra62.06 -background grey85 -height 75 -highlightbackground grey85 -width 125
radiobutton $base.fra51.fra62.06.07 -anchor w -background grey85 -command {p4_syncLabel setrevision} -foreground black -highlightbackground grey85 -highlightthickness 0 -text Other -value other -variable p4(SyncLabel_mode) -width 14
entry $base.fra51.fra62.06.08 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -textvariable p4(SyncLabel_other) -width 24
label $base.fra51.fra62.09 -background grey85 -borderwidth 0 -foreground black -highlightbackground grey85 -text {Label, Changelist Number, Client or Date (yyyy/mm/dd or yyyy/mm/dd:hh:mm:ss)}
frame $base.fra51.fra52 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra51.fra52.fra54 -background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra51.fra52.fra54.but58 -background grey85 -command {p4_syncLabel sync} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Sync FIle(s)} -width 14
button $base.fra51.fra52.fra54.but59 -background grey85 -command {p4_syncLabel preview} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Sync (Preview)} -width 14
button $base.fra51.fra52.fra54.but61 -background grey85 -command {p4_syncLabel help} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Help -width 14
button $base.fra51.fra52.fra54.but60 -background grey85 -command {p4_syncLabel cancel} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Cancel -width 14
###################
# SETTING GEOMETRY
###################
pack $base.fra51 -in .top50 -anchor center -expand 0 -fill both -padx 10 -side top
pack $base.fra51.fra62 -in .top50.fra51 -anchor w -expand 0 -fill x -pady 10 -side top
pack $base.fra51.fra62.03 -in .top50.fra51.fra62 -anchor w -expand 0 -fill x -side top
pack $base.fra51.fra62.03.04 -in .top50.fra51.fra62.03 -anchor w -expand 0 -fill none -side left
pack $base.fra51.fra62.03.05 -in .top50.fra51.fra62.03 -anchor center -expand 1 -fill x -padx 20 -side left
pack $base.fra51.fra62.06 -in .top50.fra51.fra62 -anchor w -expand 0 -fill x -side top
pack $base.fra51.fra62.06.07 -in .top50.fra51.fra62.06 -anchor w -expand 0 -fill none -side left
pack $base.fra51.fra62.06.08 -in .top50.fra51.fra62.06 -anchor center -expand 1 -fill x -padx 20 -side left
pack $base.fra51.fra62.09 -in .top50.fra51.fra62 -anchor w -expand 0 -fill none -padx 23 -side top
pack $base.fra51.fra52 -in .top50.fra51 -anchor center -expand 0 -fill x -pady 10 -side top
pack $base.fra51.fra52.fra54 -in .top50.fra51.fra52 -anchor center -expand 0 -fill x -ipadx 5 -side top
pack $base.fra51.fra52.fra54.but58 -in .top50.fra51.fra52.fra54 -anchor ne -expand 1 -fill none -side left
pack $base.fra51.fra52.fra54.but59 -in .top50.fra51.fra52.fra54 -anchor ne -expand 1 -fill none -side left
pack $base.fra51.fra52.fra54.but61 -in .top50.fra51.fra52.fra54 -anchor ne -expand 1 -fill none -side left
pack $base.fra51.fra52.fra54.but60 -in .top50.fra51.fra52.fra54 -anchor ne -expand 1 -fill none -side left
}
proc vTclWindow.top51 {base} {
if {$base == ""} {
set base .top51
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 601x408+205+255
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - File Information"
frame $base.fra52 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra52.cpd53 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.cpd53.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Depot Path:} -width 15
entry $base.fra52.cpd53.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled
frame $base.fra52.fra54 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra54.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Client Path:} -width 15
entry $base.fra52.fra54.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled
frame $base.fra52.fra55 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra55.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {File Type:} -width 15
entry $base.fra52.fra55.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled
frame $base.fra52.fra56 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra52.fra56.fra63 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra56.fra63.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Head Revision:} -width 15
entry $base.fra52.fra56.fra63.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -width 12
frame $base.fra52.fra56.fra64 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra56.fra64.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Have Revision:} -width 15
entry $base.fra52.fra56.fra64.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -width 12
frame $base.fra52.fra65 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra52.fra65.01 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra65.01.02 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Head Action:} -width 15
entry $base.fra52.fra65.01.03 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -width 12
frame $base.fra52.fra65.04 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra65.04.05 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Head Change:} -width 15
entry $base.fra52.fra65.04.06 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled -width 12
frame $base.fra52.fra58 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra58.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Last ModTime:} -width 15
entry $base.fra52.fra58.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled
frame $base.fra52.fra59 -background grey85 -borderwidth 1 -height 75 -highlightbackground grey85 -width 125
frame $base.fra52.fra59.fra38 -background grey85 -height 75 -highlightbackground grey85 -relief groove -width 125
label $base.fra52.fra59.fra38.lab39 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Opened By:} -width 15
button $base.fra52.fra59.fra38.but40 -background grey85 -command {p4_fileInfo} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -state disabled -text Describe
frame $base.fra52.fra59.cpd67 -background grey85 -borderwidth 2 -height 30 -highlightbackground grey85 -width 30
listbox $base.fra52.fra59.cpd67.01 -background grey85 -font {Helvetica -12} -foreground black -height 4 -highlightbackground grey85 -highlightthickness 0 -xscrollcommand {.top51.fra52.fra59.cpd67.02 set} -yscrollcommand {.top51.fra52.fra59.cpd67.03 set}
bind $base.fra52.fra59.cpd67.01 <ButtonRelease-1> {
p4_fileInfo openedSelection
}
scrollbar $base.fra52.fra59.cpd67.02 -background grey85 -borderwidth 1 -command {.top51.fra52.fra59.cpd67.01 xview} -highlightbackground grey85 -highlightthickness 0 -orient horizontal -width 10
scrollbar $base.fra52.fra59.cpd67.03 -background grey85 -borderwidth 1 -command {.top51.fra52.fra59.cpd67.01 yview} -highlightbackground grey85 -highlightthickness 0 -width 10
frame $base.fra52.fra60 -background grey85 -borderwidth 1 -height 30 -highlightbackground grey85 -width 30
label $base.fra52.fra60.01 -anchor w -background grey85 -foreground black -highlightbackground grey85 -text {Locked By:} -width 15
entry $base.fra52.fra60.02 -background grey85 -cursor {} -foreground black -highlightbackground grey85 -highlightthickness 0 -state disabled
frame $base.fra52.fra61 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra52.fra61.but62 -background grey85 -command {p4_fileInfo hide} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra52 -in .top51 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra52.cpd53 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.cpd53.01 -in .top51.fra52.cpd53 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.cpd53.02 -in .top51.fra52.cpd53 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra52.fra54 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.fra54.01 -in .top51.fra52.fra54 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra54.02 -in .top51.fra52.fra54 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra52.fra55 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.fra55.01 -in .top51.fra52.fra55 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra55.02 -in .top51.fra52.fra55 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra52.fra56 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.fra56.fra63 -in .top51.fra52.fra56 -anchor center -expand 0 -fill none -side left
pack $base.fra52.fra56.fra63.01 -in .top51.fra52.fra56.fra63 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra56.fra63.02 -in .top51.fra52.fra56.fra63 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra56.fra64 -in .top51.fra52.fra56 -anchor center -expand 0 -fill none -side right
pack $base.fra52.fra56.fra64.01 -in .top51.fra52.fra56.fra64 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra56.fra64.02 -in .top51.fra52.fra56.fra64 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra52.fra65 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.fra65.01 -in .top51.fra52.fra65 -anchor center -expand 0 -fill none -side left
pack $base.fra52.fra65.01.02 -in .top51.fra52.fra65.01 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra65.01.03 -in .top51.fra52.fra65.01 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra65.04 -in .top51.fra52.fra65 -anchor center -expand 0 -fill none -side right
pack $base.fra52.fra65.04.05 -in .top51.fra52.fra65.04 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra65.04.06 -in .top51.fra52.fra65.04 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra52.fra58 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.fra58.01 -in .top51.fra52.fra58 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra58.02 -in .top51.fra52.fra58 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra52.fra59 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.fra59.fra38 -in .top51.fra52.fra59 -anchor nw -expand 0 -fill none -side left
pack $base.fra52.fra59.fra38.lab39 -in .top51.fra52.fra59.fra38 -anchor nw -expand 0 -fill none -padx 2 -side top
pack $base.fra52.fra59.fra38.but40 -in .top51.fra52.fra59.fra38 -anchor nw -expand 0 -fill none -padx 2 -pady 2 -side top
pack $base.fra52.fra59.cpd67 -in .top51.fra52.fra59 -anchor center -expand 1 -fill x -side top
grid columnconf $base.fra52.fra59.cpd67 0 -weight 1
grid rowconf $base.fra52.fra59.cpd67 0 -weight 1
grid $base.fra52.fra59.cpd67.01 -in .top51.fra52.fra59.cpd67 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
grid $base.fra52.fra59.cpd67.02 -in .top51.fra52.fra59.cpd67 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra52.fra59.cpd67.03 -in .top51.fra52.fra59.cpd67 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
pack $base.fra52.fra60 -in .top51.fra52 -anchor center -expand 1 -fill x -side top
pack $base.fra52.fra60.01 -in .top51.fra52.fra60 -anchor center -expand 0 -fill none -padx 2 -pady 2 -side left
pack $base.fra52.fra60.02 -in .top51.fra52.fra60 -anchor center -expand 1 -fill x -padx 2 -pady 2 -side right
pack $base.fra52.fra61 -in .top51.fra52 -anchor s -expand 0 -fill none -pady 10 -side bottom
pack $base.fra52.fra61.but62 -in .top51.fra52.fra61 -anchor center -expand 0 -fill none -side top
}
proc vTclWindow.top63 {base} {
if {$base == ""} {
set base .top63
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel \
-background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 407x292+361+340
wm maxsize $base 1265 994
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Auto Resolve"
frame $base.fra64 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra64.fra65 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -relief groove -width 125
label $base.fra64.fra65.lab74 \
-background grey85 -borderwidth 0 -foreground black \
-highlightbackground grey85 -text Auto-resolve
frame $base.fra64.fra65.fra73 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
radiobutton $base.fra64.fra65.fra73.rad75 \
-background grey85 -command {p4_autoResolve setmode} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-text {Selected Files} -value selected -variable p4(AutoResolve_mode)
radiobutton $base.fra64.fra65.fra73.rad77 \
-background grey85 -command {p4_autoResolve setmode} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-text {All files requiring resolution} -value all \
-variable p4(AutoResolve_mode)
frame $base.fra64.fra66 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
frame $base.fra64.fra66.fra70 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
checkbutton $base.fra64.fra66.fra70.che78 \
-background grey85 -foreground black -highlightbackground grey85 \
-highlightthickness 0 \
-text {Re-resolve previously resolved but unsubmitted files (-f)} \
-variable p4(AutoResolve_f)
frame $base.fra64.fra66.fra71 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -relief groove -width 125
label $base.fra64.fra66.fra71.lab79 \
-background grey85 -borderwidth 0 -foreground black \
-highlightbackground grey85 -text {Resolve Type}
radiobutton $base.fra64.fra66.fra71.rad80 \
-background grey85 -foreground black -highlightbackground grey85 \
-highlightthickness 0 -text {Accept Theirs (-at)} -value -at \
-variable p4(AutoResolve_type)
radiobutton $base.fra64.fra66.fra71.rad81 \
-background grey85 -foreground black -height 1 \
-highlightbackground grey85 -highlightthickness 0 \
-text {Accept Tours (-ay)} -value -ay -variable p4(AutoResolve_type)
radiobutton $base.fra64.fra66.fra71.rad82 \
-background grey85 -foreground black -highlightbackground grey85 \
-highlightthickness 0 -text {Safe Automatic Resolve (-as)} -value -as \
-variable p4(AutoResolve_type)
radiobutton $base.fra64.fra66.fra71.rad83 \
-background grey85 -foreground black -highlightbackground grey85 \
-highlightthickness 0 -text {Automatic Resolve (-am)} -value -am \
-variable p4(AutoResolve_type)
radiobutton $base.fra64.fra66.fra71.rad84 \
-background grey85 -foreground black -highlightbackground grey85 \
-highlightthickness 0 \
-text {Automatic Resolve, including conflict markers (-af)} \
-value -af -variable p4(AutoResolve_type)
frame $base.fra64.fra66.fra72 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
checkbutton $base.fra64.fra66.fra72.che85 \
-background grey85 -foreground black -highlightbackground grey85 \
-highlightthickness 0 \
-text {Attempt textual merge of binary files (-t)} \
-variable p4(AutoResolve_t)
frame $base.fra64.fra67 \
-background grey85 -height 75 -highlightbackground grey85 -width 125
button $base.fra64.fra67.but86 \
-background grey85 -command {p4_autoResolve ok} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 \
-text OK -width 8
button $base.fra64.fra67.but87 \
-background grey85 -command {p4_autoResolve preview} \
-foreground black -highlightbackground grey85 -highlightthickness 0 \
-padx 10 -pady 3 -text Preview -width 8
button $base.fra64.fra67.but88 \
-background grey85 -command {p4_autoResolve cancel} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 \
-text Cancel -width 8
button $base.fra64.fra67.but89 \
-background grey85 -command {p4_autoResolve help} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -padx 10 -pady 3 \
-text Help -width 8
###################
# SETTING GEOMETRY
###################
pack $base.fra64 \
-in .top63 -anchor center -expand 1 -fill both -padx 10 -pady 10 \
-side top
pack $base.fra64.fra65 \
-in .top63.fra64 -anchor center -expand 0 -fill x -side top
pack $base.fra64.fra65.lab74 \
-in .top63.fra64.fra65 -anchor w -expand 0 -fill none -pady 2 \
-side top
pack $base.fra64.fra65.fra73 \
-in .top63.fra64.fra65 -anchor sw -expand 0 -fill none -side top
pack $base.fra64.fra65.fra73.rad75 \
-in .top63.fra64.fra65.fra73 -anchor center -expand 0 -fill none \
-side left
pack $base.fra64.fra65.fra73.rad77 \
-in .top63.fra64.fra65.fra73 -anchor center -expand 0 -fill none \
-side left
pack $base.fra64.fra66 \
-in .top63.fra64 -anchor center -expand 0 -fill x -side top
pack $base.fra64.fra66.fra70 \
-in .top63.fra64.fra66 -anchor center -expand 0 -fill x -padx 2 \
-pady 6 -side top
pack $base.fra64.fra66.fra70.che78 \
-in .top63.fra64.fra66.fra70 -anchor w -expand 0 -fill none -side top
pack $base.fra64.fra66.fra71 \
-in .top63.fra64.fra66 -anchor center -expand 0 -fill x -side top
pack $base.fra64.fra66.fra71.lab79 \
-in .top63.fra64.fra66.fra71 -anchor w -expand 0 -fill none -pady 2 \
-side top
pack $base.fra64.fra66.fra71.rad80 \
-in .top63.fra64.fra66.fra71 -anchor w -expand 0 -fill none -side top
pack $base.fra64.fra66.fra71.rad81 \
-in .top63.fra64.fra66.fra71 -anchor w -expand 0 -fill none -side top
pack $base.fra64.fra66.fra71.rad82 \
-in .top63.fra64.fra66.fra71 -anchor w -expand 0 -fill none -side top
pack $base.fra64.fra66.fra71.rad83 \
-in .top63.fra64.fra66.fra71 -anchor w -expand 0 -fill none -side top
pack $base.fra64.fra66.fra71.rad84 \
-in .top63.fra64.fra66.fra71 -anchor w -expand 0 -fill none -side top
pack $base.fra64.fra66.fra72 \
-in .top63.fra64.fra66 -anchor center -expand 0 -fill x -pady 6 \
-side top
pack $base.fra64.fra66.fra72.che85 \
-in .top63.fra64.fra66.fra72 -anchor center -expand 0 -fill none \
-padx 2 -side left
pack $base.fra64.fra67 \
-in .top63.fra64 -anchor center -expand 0 -fill x -side top
pack $base.fra64.fra67.but86 \
-in .top63.fra64.fra67 -anchor center -expand 1 -fill none -side left
pack $base.fra64.fra67.but87 \
-in .top63.fra64.fra67 -anchor center -expand 1 -fill none -side left
pack $base.fra64.fra67.but88 \
-in .top63.fra64.fra67 -anchor center -expand 1 -fill none -side left
pack $base.fra64.fra67.but89 \
-in .top63.fra64.fra67 -anchor center -expand 1 -fill none -side left
}
proc vTclWindow.top81 {base} {
if {$base == ""} {
set base .top81
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel -background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 772x544+313+115
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Revision History"
frame $base.fra91 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
button $base.fra91.01 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {View Selected Revision} -width 22 -command {p4_revisionHistory browse}
button $base.fra91.02 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text Sync -width 8 -command {p4_revisionHistory sync}
button $base.fra91.03 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Diff Revs} -width 8 -command {p4_revisionHistory diffRevs}
button $base.fra91.04 -background grey85 -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text {Diff vs ClientFile} -width 18 -command {p4_revisionHistory diffClient}
button $base.fra91.05 -background grey85 -command {p4_revisionHistory hide} -foreground black -highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 -text OK -width 8
frame $base.fra82 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
frame $base.fra82.cpd84 -background grey85 -height 100 -highlightbackground grey85 -width 200
frame $base.fra82.cpd84.01 -background grey85 -borderwidth 2 -highlightbackground grey85 -relief groove
frame $base.fra82.cpd84.01.fra86 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra82.cpd84.02 -background grey85 -borderwidth 2 -highlightbackground grey85 -relief groove
frame $base.fra82.cpd84.02.fra87 -background grey85 -borderwidth 2 -height 75 -highlightbackground grey85 -width 125
label $base.fra82.cpd84.02.fra87.01 -background grey85 -borderwidth 1 -foreground black -highlightbackground grey85 -text {Change Summary}
frame $base.fra82.cpd84.02.fra88 -background grey85 -height 75 -highlightbackground grey85 -width 125
frame $base.fra82.cpd84.02.fra88.01 -background grey85 -height 30 -highlightbackground grey85 -width 30
scrollbar $base.fra82.cpd84.02.fra88.01.02 -background grey85 -borderwidth 1 -command {.top81.fra82.cpd84.02.fra88.01.04 xview} -highlightbackground grey85 -highlightthickness 0 -orient horiz -width 10
scrollbar $base.fra82.cpd84.02.fra88.01.03 -background grey85 -borderwidth 1 -command {.top81.fra82.cpd84.02.fra88.01.04 yview} -highlightbackground grey85 -highlightthickness 0 -orient vert -width 10
text $base.fra82.cpd84.02.fra88.01.04 -background grey85 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -foreground black -height 1 -highlightbackground grey85 -highlightthickness 0 -width 8 -xscrollcommand {.top81.fra82.cpd84.02.fra88.01.02 set} -yscrollcommand {.top81.fra82.cpd84.02.fra88.01.03 set}
frame $base.fra82.cpd84.03 -background grey85 -borderwidth 2 -cursor sb_v_double_arrow -highlightbackground grey85 -relief raised
bind $base.fra82.cpd84.03 <B1-Motion> {
set root [ split %W . ]
set nb [ llength $root ]
incr nb -1
set root [ lreplace $root $nb $nb ]
set root [ join $root . ]
set height [ winfo height $root ].0
set val [ expr (%Y - [winfo rooty $root]) /$height ]
if { $val >= 0 && $val <= 1.0 } {
place $root.01 -relheight $val
place $root.03 -rely $val
place $root.02 -relheight [ expr 1.0 - $val ]
}
}
###################
# SETTING GEOMETRY
###################
pack $base.fra91 -in .top81 -anchor center -expand 0 -fill x -padx 10 -pady 10 -side top
pack $base.fra91.01 -in .top81.fra91 -anchor center -expand 0 -fill none -side left
pack $base.fra91.02 -in .top81.fra91 -anchor center -expand 0 -fill none -side left
pack $base.fra91.03 -in .top81.fra91 -anchor center -expand 0 -fill none -side left
pack $base.fra91.04 -in .top81.fra91 -anchor center -expand 0 -fill none -side left
pack $base.fra91.05 -in .top81.fra91 -anchor center -expand 0 -fill none -side right
pack $base.fra82 -in .top81 -anchor center -expand 1 -fill both -padx 10 -pady 10 -side top
pack $base.fra82.cpd84 -in .top81.fra82 -anchor center -expand 1 -fill both -side top
place $base.fra82.cpd84.01 -x 0 -y 0 -relwidth 1 -height -1 -relheight 0.4343 -anchor nw -bordermode ignore
pack $base.fra82.cpd84.01.fra86 -in .top81.fra82.cpd84.01 -anchor center -expand 1 -fill both -side top
place $base.fra82.cpd84.02 -x 0 -y 0 -rely 1 -relwidth 1 -height -1 -relheight 0.5657 -anchor sw -bordermode ignore
pack $base.fra82.cpd84.02.fra87 -in .top81.fra82.cpd84.02 -anchor center -expand 0 -fill x -pady 6 -side top
pack $base.fra82.cpd84.02.fra87.01 -in .top81.fra82.cpd84.02.fra87 -anchor w -expand 0 -fill none -side top
pack $base.fra82.cpd84.02.fra88 -in .top81.fra82.cpd84.02 -anchor center -expand 1 -fill both -side top
pack $base.fra82.cpd84.02.fra88.01 -in .top81.fra82.cpd84.02.fra88 -anchor center -expand 1 -fill both -side top
grid columnconf $base.fra82.cpd84.02.fra88.01 0 -weight 1
grid rowconf $base.fra82.cpd84.02.fra88.01 0 -weight 1
grid $base.fra82.cpd84.02.fra88.01.02 -in .top81.fra82.cpd84.02.fra88.01 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew
grid $base.fra82.cpd84.02.fra88.01.03 -in .top81.fra82.cpd84.02.fra88.01 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns
grid $base.fra82.cpd84.02.fra88.01.04 -in .top81.fra82.cpd84.02.fra88.01 -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw
place $base.fra82.cpd84.03 -x 0 -relx 0.9 -y 0 -rely 0.4343 -width 10 -height 10 -anchor e -bordermode ignore
}
proc vTclWindow.top92 {base} {
if {$base == ""} {
set base .top92
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
###################
# CREATING WIDGETS
###################
toplevel $base -class Toplevel \
-background grey85 -highlightbackground grey85
wm focusmodel $base passive
wm geometry $base 821x465+57+120
wm maxsize $base 1137 834
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm title $base "TkP4 - Miscellaneous Options"
frame $base.fra93 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
frame $base.fra93.fra94 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -relief sunken -width 125
radiobutton $base.fra93.fra94.rad98 \
-background grey85 -command {p4_options show} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -indicatoron 0 \
-selectcolor grey70 -text Connection -value connection \
-variable p4(HelpSection)
radiobutton $base.fra93.fra94.rad99 \
-background grey85 -command {p4_options show} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -indicatoron 0 \
-selectcolor grey70 -state disabled -text {(Edit / View)} \
-value editview -variable p4(HelpSection)
radiobutton $base.fra93.fra94.rad100 \
-background grey85 -command {p4_options show} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -indicatoron 0 \
-selectcolor grey70 -state disabled -text {(Diff / Merge)} \
-value diffmerge -variable p4(HelpSection)
radiobutton $base.fra93.fra94.rad102 \
-background grey85 -command {p4_options show} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -indicatoron 0 \
-selectcolor grey70 -state disabled -text (Font) -value font \
-variable p4(HelpSection)
radiobutton $base.fra93.fra94.rad101 \
-background grey85 -command {p4_options show} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -indicatoron 0 \
-selectcolor grey70 -state disabled -text (Display) -value display \
-variable p4(HelpSection)
radiobutton $base.fra93.fra94.rad97 \
-background grey85 -command {p4_options show} \
-disabledforeground black -foreground black \
-highlightbackground grey85 -highlightthickness 0 -indicatoron 0 \
-selectcolor grey70 -state disabled -text (Miscellaneous) \
-value miscellaneous -variable p4(HelpSection)
frame $base.fra93.fra95 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -relief groove -width 125
frame $base.fra93.fra96 \
-background grey85 -borderwidth 2 -height 75 \
-highlightbackground grey85 -width 125
button $base.fra93.fra96.but103 \
-background grey85 -command {p4_options save} -foreground black \
-highlightbackground grey85 -highlightthickness 0 -padx 9 -pady 3 \
-text OK -width 10
###################
# SETTING GEOMETRY
###################
pack $base.fra93 \
-in .top92 -anchor center -expand 1 -fill both -padx 10 -pady 10 \
-side top
pack $base.fra93.fra94 \
-in .top92.fra93 -anchor center -expand 0 -fill x -side top
pack $base.fra93.fra94.rad98 \
-in .top92.fra93.fra94 -anchor center -expand 1 -fill x -side left
pack $base.fra93.fra94.rad99 \
-in .top92.fra93.fra94 -anchor center -expand 1 -fill x -side left
pack $base.fra93.fra94.rad100 \
-in .top92.fra93.fra94 -anchor center -expand 1 -fill x -side left
pack $base.fra93.fra94.rad102 \
-in .top92.fra93.fra94 -anchor center -expand 1 -fill x -side left
pack $base.fra93.fra94.rad101 \
-in .top92.fra93.fra94 -anchor center -expand 1 -fill x -side left
pack $base.fra93.fra94.rad97 \
-in .top92.fra93.fra94 -anchor center -expand 1 -fill x -side left
pack $base.fra93.fra95 \
-in .top92.fra93 -anchor center -expand 1 -fill both -side top
pack $base.fra93.fra96 \
-in .top92.fra93 -anchor center -expand 0 -fill x -pady 5 -side top
pack $base.fra93.fra96.but103 \
-in .top92.fra93.fra96 -anchor center -expand 0 -fill none -side top
}
Window show .
Window show .top40
main $argc $argv