| 1 |
ninoborges |
8 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
MCP_CopyUp_Request_UI
|
| 4 |
|
|
|
| 5 |
|
|
Created by
|
| 6 |
|
|
Emanuel Borges
|
| 7 |
|
|
10.25.2010
|
| 8 |
|
|
|
| 9 |
|
|
This is the GUI to the MCP_CopyUp_Request program.
|
| 10 |
|
|
|
| 11 |
|
|
"""
|
| 12 |
|
|
|
| 13 |
nino.borges |
258 |
import wx, MCP_Lib, MCP_CopyUp_Request,os,WorkDirDialog
|
| 14 |
nino.borges |
464 |
import wx.lib.agw.pybusyinfo as PBI
|
| 15 |
nino.borges |
458 |
from math import pi
|
| 16 |
|
|
import wx.lib.agw.speedmeter as SM
|
| 17 |
ninoborges |
8 |
import wx.lib.filebrowsebutton as filebrowse
|
| 18 |
|
|
|
| 19 |
|
|
class MyFrame(wx.Frame):
|
| 20 |
|
|
def __init__(self, parent, ID, title, pos=wx.DefaultPosition):
|
| 21 |
nino.borges |
258 |
self.workDir = os.path.join(os.environ.get("USERPROFILE"),"Desktop\\Working")
|
| 22 |
nino.borges |
540 |
wx.Frame.__init__(self, parent, ID, title, pos, size =(625,490))
|
| 23 |
ninoborges |
8 |
self.panel = wx.Panel(self,-1)
|
| 24 |
|
|
#self.panel.SetBackgroundColour("yellow green")
|
| 25 |
|
|
casesListStaticText = wx.StaticText(self.panel, -1, "Select Case: ",wx.DefaultPosition)
|
| 26 |
nino.borges |
189 |
#casesList,casesDir = MCP_Lib.GetCaseList()
|
| 27 |
nino.borges |
232 |
print "connecting to matter tracking access db..."
|
| 28 |
|
|
self.accessDB = MCP_Lib.AccessDBConnection(r"\\chiads01\app\DS_CaseTrack\TPM_CaseTracking.mdb")
|
| 29 |
|
|
print "connected to DB."
|
| 30 |
nino.borges |
476 |
print "Waiting for Access..."
|
| 31 |
nino.borges |
462 |
self.myCases, self.myActiveCases, self.officeCases, self.allCases, casesDir, self.casePathStyleMatrix = MCP_Lib.GetCaseList('',self.accessDB)
|
| 32 |
nino.borges |
476 |
print "Access done."
|
| 33 |
nino.borges |
189 |
self.casesListChoice = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=self.myCases)
|
| 34 |
ninoborges |
8 |
platformStaticText = wx.StaticText(self.panel, -1, "Select Platform:",wx.DefaultPosition)
|
| 35 |
nino.borges |
464 |
self.platformChoices = ["Concordance DIS","Concordance LN","Relativity"]
|
| 36 |
|
|
self.platformListChoice = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=self.platformChoices)
|
| 37 |
nino.borges |
258 |
|
| 38 |
nino.borges |
453 |
upLoadCatagoryStaticText = wx.StaticText(self.panel, -1, "Upload Type:",wx.DefaultPosition)
|
| 39 |
nino.borges |
458 |
upLoadCatagoriesList = ['Processed Review Data','Hard Copy Review Data','Loose Unprocessed Review Data','Subset Tiffs','Other Party Production Data','Generic (Old Cases Only)',]
|
| 40 |
nino.borges |
453 |
self.upLoadCatagory = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=upLoadCatagoriesList)
|
| 41 |
|
|
self.upLoadCatagory.SetSelection(0)
|
| 42 |
|
|
self.upLoadCatagory.Enable(False)
|
| 43 |
|
|
|
| 44 |
nino.borges |
203 |
#workDirStaticText = wx.StaticText(self.panel, -1, "Select Work Dir:",wx.DefaultPosition)
|
| 45 |
|
|
#self.workDirControl = wx.TextCtrl(self.panel,-1,os.path.join(os.environ.get("USERPROFILE"),"Desktop\\Working"), size=(296,-1))
|
| 46 |
|
|
#workDirBrowseButton = wx.Button(self.panel, -1, "Browse", (10, 10))
|
| 47 |
ninoborges |
8 |
|
| 48 |
|
|
|
| 49 |
|
|
self.radio1 = wx.RadioButton(self.panel, -1, 'Individual File',style=wx.RB_GROUP)
|
| 50 |
|
|
self.fileBowserControl = wx.TextCtrl(self.panel, -1,size=(296,-1))
|
| 51 |
nino.borges |
540 |
self.fileBowserButton = wx.Button(self.panel, -1, "Browse", (10, 10),name = 'IndFile')
|
| 52 |
ninoborges |
8 |
|
| 53 |
|
|
self.requestAssistanceCheckBox = wx.CheckBox(self.panel,-1,": Request Data Analyst Assistance")
|
| 54 |
|
|
self.requestAssistanceCheckBox.Enable(False) ## Change me when you go live with this service.
|
| 55 |
|
|
|
| 56 |
|
|
self.radio2 = wx.RadioButton(self.panel, -1, 'Entire folder of Files')
|
| 57 |
|
|
self.dirBowserControl = wx.TextCtrl(self.panel, -1, size=(296,-1))
|
| 58 |
nino.borges |
540 |
self.dirBowserButton = wx.Button(self.panel, -1, "Browse", (10, 10),name = 'DirOfFiles')
|
| 59 |
ninoborges |
8 |
self.dirBowserControl.Enable(False)
|
| 60 |
|
|
self.dirBowserButton.Enable(False)
|
| 61 |
|
|
|
| 62 |
nino.borges |
203 |
self.radio3 = wx.RadioButton(self.panel, -1, 'From Vendor Folder')
|
| 63 |
|
|
self.vendorBowserControl = wx.TextCtrl(self.panel, -1, size=(296,-1))
|
| 64 |
nino.borges |
540 |
self.vendorBowserButton = wx.Button(self.panel, -1, "Browse", (10, 10),name='VndrFolder')
|
| 65 |
nino.borges |
203 |
self.vendorBowserControl.Enable(False)
|
| 66 |
|
|
self.vendorBowserButton.Enable(False)
|
| 67 |
ninoborges |
8 |
|
| 68 |
nino.borges |
203 |
|
| 69 |
ninoborges |
8 |
self.CreateBoxesSection()
|
| 70 |
|
|
copyUpTypeStaticBox = wx.StaticBox(self.panel, -1, 'Copy Up:')
|
| 71 |
|
|
copyUpTypeStaticBoxSizer = wx.StaticBoxSizer(copyUpTypeStaticBox, wx.VERTICAL)
|
| 72 |
|
|
|
| 73 |
|
|
radio1Sizer = wx.FlexGridSizer(1,3,10,10)
|
| 74 |
|
|
radio1Sizer.Add(self.radio1, 0, 0)
|
| 75 |
|
|
radio1Sizer.Add(self.fileBowserControl, 0)
|
| 76 |
|
|
radio1Sizer.Add(self.fileBowserButton, 0)
|
| 77 |
|
|
copyUpTypeStaticBoxSizer.Add(radio1Sizer, 0, wx.ALL|wx.ALIGN_LEFT,20)
|
| 78 |
nino.borges |
203 |
|
| 79 |
ninoborges |
8 |
radio2Sizer = wx.FlexGridSizer(1,3,10,10)
|
| 80 |
|
|
radio2Sizer.Add(self.radio2, 0)
|
| 81 |
|
|
radio2Sizer.Add(self.dirBowserControl, 0)
|
| 82 |
|
|
radio2Sizer.Add(self.dirBowserButton, 0)
|
| 83 |
nino.borges |
203 |
|
| 84 |
ninoborges |
8 |
copyUpTypeStaticBoxSizer.Add(radio2Sizer, 0, wx.ALL|wx.ALIGN_LEFT,20)
|
| 85 |
nino.borges |
203 |
radio3Sizer = wx.FlexGridSizer(1,3,10,10)
|
| 86 |
|
|
radio3Sizer.Add(self.radio3, 0)
|
| 87 |
|
|
radio3Sizer.Add(self.vendorBowserControl, 0)
|
| 88 |
|
|
radio3Sizer.Add(self.vendorBowserButton, 0)
|
| 89 |
|
|
copyUpTypeStaticBoxSizer.Add(radio3Sizer, 0, wx.ALL|wx.ALIGN_LEFT,20)
|
| 90 |
ninoborges |
8 |
|
| 91 |
nino.borges |
453 |
#casesSizer = wx.FlexGridSizer(2,2,15,5)
|
| 92 |
|
|
#casesSizer.Add(casesListStaticText)
|
| 93 |
|
|
#casesSizer.Add(self.casesListChoice)
|
| 94 |
|
|
#casesSizer.Add(platformStaticText)
|
| 95 |
|
|
#casesSizer.Add(self.platformListChoice)
|
| 96 |
|
|
|
| 97 |
|
|
casesSizer = wx.GridBagSizer(8,12)
|
| 98 |
|
|
casesSizer.Add(casesListStaticText,pos=(0,0))
|
| 99 |
|
|
casesSizer.Add(self.casesListChoice,pos=(0,1), span = (1,3))
|
| 100 |
|
|
casesSizer.Add(platformStaticText,pos=(1,0))
|
| 101 |
|
|
casesSizer.Add(self.platformListChoice,pos=(1,1))
|
| 102 |
|
|
casesSizer.Add(upLoadCatagoryStaticText,pos=(1,2))
|
| 103 |
|
|
casesSizer.Add(self.upLoadCatagory,pos=(1,3))
|
| 104 |
|
|
|
| 105 |
ninoborges |
8 |
#casesSizer = wx.BoxSizer(wx.HORIZONTAL)
|
| 106 |
|
|
#casesSizer.Add(casesListStaticText,0,wx.ALL,5)
|
| 107 |
|
|
#casesSizer.Add(self.casesListChoice,0,wx.ALL,5)
|
| 108 |
|
|
#casesSizer.Add(platformStaticText,0,wx.ALL,5)
|
| 109 |
|
|
#casesSizer.Add(self.platformListChoice,0,wx.ALL,5)
|
| 110 |
nino.borges |
203 |
#workDirSizer = wx.BoxSizer(wx.HORIZONTAL)
|
| 111 |
|
|
#workDirSizer.Add(workDirStaticText,0,wx.ALL,5)
|
| 112 |
|
|
#workDirSizer.Add(self.workDirControl,0,wx.ALL,5)
|
| 113 |
|
|
#workDirSizer.Add(workDirBrowseButton,0,wx.ALL,5)
|
| 114 |
ninoborges |
8 |
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
| 115 |
|
|
mainSizer.Add(casesSizer,0,wx.ALL, 20)
|
| 116 |
nino.borges |
203 |
#mainSizer.Add(workDirSizer,0,wx.ALL, 10)
|
| 117 |
ninoborges |
8 |
mainSizer.Add(copyUpTypeStaticBoxSizer, 0, wx.ALL, 10)
|
| 118 |
|
|
mainSizer.Add(self.requestAssistanceCheckBox,0,wx.ALL|wx.ALIGN_CENTER,5)
|
| 119 |
nino.borges |
203 |
|
| 120 |
|
|
|
| 121 |
ninoborges |
8 |
mainSizer.Add(self.buttonSizer,0, wx.ALL|wx.ALIGN_BOTTOM|wx.ALIGN_CENTER, 10)
|
| 122 |
|
|
|
| 123 |
|
|
self.panel.SetSizer(mainSizer)
|
| 124 |
nino.borges |
189 |
self.CreateMenuBar()
|
| 125 |
nino.borges |
464 |
self.Bind(wx.EVT_CHOICE, self.OnCaseSelect, self.casesListChoice)
|
| 126 |
nino.borges |
453 |
self.Bind(wx.EVT_CHOICE, self.OnPlatformSelect, self.platformListChoice)
|
| 127 |
ninoborges |
8 |
self.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, self.radio1)
|
| 128 |
|
|
self.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, self.radio2)
|
| 129 |
nino.borges |
203 |
self.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, self.radio3)
|
| 130 |
|
|
#self.Bind(wx.EVT_BUTTON, self.OnBrowseClick, workDirBrowseButton)
|
| 131 |
ninoborges |
8 |
self.Bind(wx.EVT_BUTTON, self.OnBrowseClick, self.fileBowserButton)
|
| 132 |
|
|
self.Bind(wx.EVT_BUTTON, self.OnBrowseClick, self.dirBowserButton)
|
| 133 |
nino.borges |
203 |
self.Bind(wx.EVT_BUTTON, self.OnBrowseClick, self.vendorBowserButton)
|
| 134 |
ninoborges |
8 |
self.Bind(wx.EVT_BUTTON, self.OnProcess, self.oKButton)
|
| 135 |
|
|
self.Bind(wx.EVT_BUTTON, self.CloseWindow, self.cancelButton)
|
| 136 |
|
|
|
| 137 |
|
|
def OnRadio(self,event):
|
| 138 |
|
|
radioObj = event.GetEventObject()
|
| 139 |
|
|
selection = radioObj.GetLabel()
|
| 140 |
|
|
if selection == "Individual File":
|
| 141 |
|
|
self.fileBowserControl.Enable(True)
|
| 142 |
|
|
self.fileBowserButton.Enable(True)
|
| 143 |
|
|
|
| 144 |
|
|
self.dirBowserControl.Enable(False)
|
| 145 |
|
|
self.dirBowserButton.Enable(False)
|
| 146 |
nino.borges |
203 |
self.vendorBowserControl.Enable(False)
|
| 147 |
|
|
self.vendorBowserButton.Enable(False)
|
| 148 |
|
|
|
| 149 |
ninoborges |
8 |
self.dirBowserControl.SetValue("")
|
| 150 |
nino.borges |
203 |
self.vendorBowserControl.SetValue("")
|
| 151 |
|
|
|
| 152 |
|
|
elif selection == "Entire folder of Files":
|
| 153 |
|
|
self.dirBowserControl.Enable(True)
|
| 154 |
|
|
self.dirBowserButton.Enable(True)
|
| 155 |
|
|
|
| 156 |
|
|
self.fileBowserControl.Enable(False)
|
| 157 |
|
|
self.fileBowserButton.Enable(False)
|
| 158 |
|
|
self.vendorBowserControl.Enable(False)
|
| 159 |
|
|
self.vendorBowserButton.Enable(False)
|
| 160 |
|
|
|
| 161 |
|
|
self.fileBowserControl.SetValue("")
|
| 162 |
|
|
self.vendorBowserControl.SetValue("")
|
| 163 |
|
|
|
| 164 |
ninoborges |
8 |
else:
|
| 165 |
nino.borges |
203 |
self.vendorBowserControl.Enable(True)
|
| 166 |
|
|
self.vendorBowserButton.Enable(True)
|
| 167 |
|
|
|
| 168 |
ninoborges |
8 |
self.fileBowserControl.Enable(False)
|
| 169 |
|
|
self.fileBowserButton.Enable(False)
|
| 170 |
nino.borges |
203 |
self.dirBowserControl.Enable(False)
|
| 171 |
|
|
self.dirBowserButton.Enable(False)
|
| 172 |
|
|
|
| 173 |
ninoborges |
8 |
self.fileBowserControl.SetValue("")
|
| 174 |
nino.borges |
203 |
self.dirBowserControl.SetValue("")
|
| 175 |
ninoborges |
8 |
|
| 176 |
|
|
#if self.selectedText:
|
| 177 |
|
|
# self.selectedText.Enable(False)
|
| 178 |
|
|
#radioSelected = event.GetEventObject()
|
| 179 |
|
|
#text = self.texts[radioSelected.GetLabel()]
|
| 180 |
|
|
#text.Enable(True)
|
| 181 |
|
|
#self.selectedText = text
|
| 182 |
|
|
|
| 183 |
nino.borges |
464 |
def OnCaseSelect(self,event):
|
| 184 |
|
|
"""They selected a new case, so reset platform choice and disable style"""
|
| 185 |
|
|
self.platformListChoice.SetItems(self.platformChoices)
|
| 186 |
|
|
self.upLoadCatagory.SetSelection(0)
|
| 187 |
|
|
self.upLoadCatagory.Enable(False)
|
| 188 |
|
|
|
| 189 |
nino.borges |
453 |
def OnPlatformSelect(self,event):
|
| 190 |
|
|
platform = self.platformListChoice.GetStringSelection()
|
| 191 |
|
|
if platform == 'Concordance DIS':
|
| 192 |
|
|
self.upLoadCatagory.Enable(False)
|
| 193 |
|
|
else:
|
| 194 |
nino.borges |
464 |
caseName = self.casesListChoice.GetStringSelection()
|
| 195 |
|
|
clientMatter = caseName.split("_(")[1]
|
| 196 |
|
|
clientMatter = clientMatter[:-1]
|
| 197 |
|
|
casePathStyle = self.casePathStyleMatrix[clientMatter]
|
| 198 |
|
|
clientMatter = clientMatter.replace('-','.')
|
| 199 |
|
|
print casePathStyle
|
| 200 |
|
|
if casePathStyle == "NEW":
|
| 201 |
|
|
self.upLoadCatagory.Enable(True)
|
| 202 |
|
|
elif casePathStyle == "OLD":
|
| 203 |
|
|
self.upLoadCatagory.Enable(False)
|
| 204 |
|
|
else:
|
| 205 |
|
|
## Make them pick one now.
|
| 206 |
|
|
dlg = wx.SingleChoiceDialog(
|
| 207 |
|
|
self, """A Case Path Style for this case has not yet been selected.\nPlease choose between using the old case path style\nor the new case path style below.\n\nIf you select the New case path style,\nyour folders on IDS will be created automatically.""", 'Case Path Style',
|
| 208 |
|
|
['New Case Path Style', 'Old Case Path Style'],
|
| 209 |
|
|
wx.CHOICEDLG_STYLE
|
| 210 |
|
|
)
|
| 211 |
|
|
if dlg.ShowModal() == wx.ID_OK:
|
| 212 |
|
|
if dlg.GetStringSelection()[:3] == "New":
|
| 213 |
|
|
if platform == "Concordance LN":
|
| 214 |
|
|
platform = "Concordance"
|
| 215 |
|
|
print "new selected, making folders..."
|
| 216 |
|
|
message = "Please wait while the standard folder structure is created on IDS..."
|
| 217 |
|
|
busy = PBI.PyBusyInfo(message, parent=self, title="MCP: System Busy.")
|
| 218 |
|
|
MCP_Lib.CreateCasePathStyleFolders(platform,clientMatter)
|
| 219 |
|
|
print "folders made."
|
| 220 |
|
|
del busy
|
| 221 |
|
|
doneDlg = wx.MessageDialog(self, "MCP: The standard case folders have been created and your case path style options have been saved.", "MCP: Process Complete",wx.OK, wx.DefaultPosition)
|
| 222 |
|
|
self.accessDB.UpdateCasePathStyle(clientMatter,"NEW")
|
| 223 |
|
|
doneDlg.ShowModal()
|
| 224 |
|
|
doneDlg.Destroy()
|
| 225 |
|
|
self.upLoadCatagory.Enable(True)
|
| 226 |
|
|
else:
|
| 227 |
|
|
self.accessDB.UpdateCasePathStyle(clientMatter,"OLD")
|
| 228 |
|
|
doneDlg = wx.MessageDialog(self, "MCP: Your case path style options have been saved.", "MCP: Process Complete",wx.OK, wx.DefaultPosition)
|
| 229 |
|
|
doneDlg.ShowModal()
|
| 230 |
|
|
doneDlg.Destroy()
|
| 231 |
|
|
self.upLoadCatagory.Enable(False)
|
| 232 |
|
|
else:
|
| 233 |
|
|
self.platformListChoice.SetItems(self.platformChoices)
|
| 234 |
|
|
self.upLoadCatagory.Enable(False)
|
| 235 |
|
|
dlg.Destroy()
|
| 236 |
|
|
|
| 237 |
nino.borges |
453 |
|
| 238 |
|
|
|
| 239 |
ninoborges |
8 |
def OnBrowseClick(self,event):
|
| 240 |
nino.borges |
540 |
## Never use event codes again.
|
| 241 |
ninoborges |
8 |
eventCode = event.GetId()
|
| 242 |
nino.borges |
540 |
eventName = event.GetEventObject().GetName()
|
| 243 |
nino.borges |
476 |
#print "DEBUG: %s" % eventCode
|
| 244 |
nino.borges |
203 |
#if eventCode == -209:
|
| 245 |
|
|
# dlg = wx.DirDialog(self, message = "Working Directory Path: ", defaultPath = os.path.join(os.environ.get("USERPROFILE"),"Desktop\\Working"))
|
| 246 |
|
|
# if dlg.ShowModal() == wx.ID_OK:
|
| 247 |
|
|
# dirPath = dlg.GetPath()
|
| 248 |
|
|
# dlg.Destroy()
|
| 249 |
|
|
# self.workDirControl.SetValue(dirPath)
|
| 250 |
nino.borges |
540 |
if eventName == 'IndFile':
|
| 251 |
|
|
#if eventCode == -214:
|
| 252 |
ninoborges |
8 |
dlg = wx.FileDialog(self, message="Select file to copy up:",defaultDir=os.path.join(os.environ.get("USERPROFILE"),"Desktop\\Working"), defaultFile="",wildcard= "*.*",style=wx.OPEN | wx.CHANGE_DIR)
|
| 253 |
|
|
#dlg = wx.FileDialog(self, message = "Select directory to copy up: ", defaultPath = os.path.join(os.environ.get("USERPROFILE"),"Desktop\\Working"))
|
| 254 |
|
|
if dlg.ShowModal() == wx.ID_OK:
|
| 255 |
|
|
filePath = dlg.GetPath()
|
| 256 |
|
|
dlg.Destroy()
|
| 257 |
nino.borges |
235 |
## Test here to see if it's a zip. if not, give them warning about uncompressed size.
|
| 258 |
nino.borges |
266 |
if os.path.splitext(filePath)[1].upper() in MCP_Lib.GetArchiveFileTypeList():
|
| 259 |
|
|
if os.path.splitext(filePath)[1].upper() == ".ZIP":
|
| 260 |
|
|
pass
|
| 261 |
|
|
else:
|
| 262 |
|
|
warningDlg = wx.MessageDialog(self,"MCP: You are attempting to copy an archive file that is not ZIP. The COMPRESSED SIZE will be gathered only.\nPlease change this size, once uncompressed, in View Edit.","WARNING!",wx.OK | wx.ICON_INFORMATION)
|
| 263 |
|
|
warningDlg.ShowModal()
|
| 264 |
|
|
warningDlg.Destroy()
|
| 265 |
ninoborges |
8 |
self.fileBowserControl.SetValue(filePath)
|
| 266 |
nino.borges |
540 |
elif eventName == 'DirOfFiles':
|
| 267 |
|
|
#elif eventCode == -218:
|
| 268 |
ninoborges |
8 |
dlg = wx.DirDialog(self, message = "Select directory to copy up:", defaultPath = os.path.join(os.environ.get("USERPROFILE"),"Desktop\\Working"))
|
| 269 |
|
|
if dlg.ShowModal() == wx.ID_OK:
|
| 270 |
|
|
dirPath = dlg.GetPath()
|
| 271 |
|
|
dlg.Destroy()
|
| 272 |
|
|
self.dirBowserControl.SetValue(dirPath)
|
| 273 |
nino.borges |
540 |
elif eventName == 'VndrFolder':
|
| 274 |
|
|
#elif eventCode == -221:
|
| 275 |
nino.borges |
232 |
platform = self.platformListChoice.GetStringSelection()
|
| 276 |
|
|
if platform == 'Concordance LN':
|
| 277 |
|
|
platform = 'Concordance'
|
| 278 |
|
|
elif platform == 'Concordance DIS':
|
| 279 |
|
|
platform = None
|
| 280 |
|
|
if platform:
|
| 281 |
nino.borges |
458 |
#expdtObj = MCP_Lib.ExpeDatConnection(platform)
|
| 282 |
nino.borges |
232 |
caseName = self.casesListChoice.GetStringSelection()
|
| 283 |
|
|
clientMatter = caseName.split("_(")[1]
|
| 284 |
|
|
clientMatter = clientMatter[:-1]
|
| 285 |
|
|
clientMatter = clientMatter.replace('-','.')
|
| 286 |
|
|
vendorFolder = self.accessDB.GetVendorFolderPath(clientMatter)
|
| 287 |
|
|
if vendorFolder:
|
| 288 |
nino.borges |
458 |
#waitDlg = WaitingOnDialog(self,"IDS Connection")
|
| 289 |
|
|
#waitDlg.ShowModal()
|
| 290 |
|
|
#waitDlg.Show(True)
|
| 291 |
|
|
#folderMatrix = expdtObj.GatherFullDirListMatrix('Uploads/%s'%vendorFolder)
|
| 292 |
|
|
#waitDlg.Destroy()
|
| 293 |
|
|
dlg = VendorBrowserDialog(self,vendorFolder,'Uploads/%s'%vendorFolder,platform)
|
| 294 |
nino.borges |
232 |
if dlg.ShowModal() == wx.ID_OK:
|
| 295 |
|
|
vendorPath = dlg.GetValues()
|
| 296 |
|
|
dlg.Destroy()
|
| 297 |
nino.borges |
266 |
if os.path.splitext(vendorPath)[1].upper() in MCP_Lib.GetArchiveFileTypeList():
|
| 298 |
|
|
if os.path.splitext(vendorPath)[1].upper() == ".ZIP":
|
| 299 |
|
|
pass
|
| 300 |
|
|
else:
|
| 301 |
|
|
warningDlg = wx.MessageDialog(self,"MCP: You are attempting to copy an archive file that is not ZIP. The COMPRESSED SIZE will be gathered only. Please change this value when you uncompress, in View Edit.","WARNING!",wx.OK | wx.ICON_INFORMATION)
|
| 302 |
|
|
warningDlg.ShowModal()
|
| 303 |
|
|
warningDlg.Destroy()
|
| 304 |
nino.borges |
232 |
self.vendorBowserControl.SetValue(vendorPath)
|
| 305 |
|
|
else:
|
| 306 |
|
|
diag = wx.MessageDialog(self,"MCP: No vendor folder is currently linked to this case.","Does not exist",wx.OK | wx.ICON_INFORMATION)
|
| 307 |
|
|
diag.ShowModal()
|
| 308 |
|
|
diag.Destroy()
|
| 309 |
|
|
else:
|
| 310 |
|
|
diag = wx.MessageDialog(self,"MCP: Copying from LN to DIS is not yet supported.","ERROR",wx.OK | wx.ICON_INFORMATION)
|
| 311 |
|
|
diag.ShowModal()
|
| 312 |
|
|
diag.Destroy()
|
| 313 |
ninoborges |
8 |
|
| 314 |
|
|
def CreateBoxesSection(self):
|
| 315 |
|
|
self.oKButton = wx.Button(self.panel, wx.ID_OK)
|
| 316 |
|
|
self.oKButton.SetDefault()
|
| 317 |
|
|
self.oKButton.SetSize(self.oKButton.GetBestSize())
|
| 318 |
|
|
self.cancelButton = wx.Button(self.panel, wx.ID_CANCEL)
|
| 319 |
|
|
self.cancelButton.SetSize(self.cancelButton.GetBestSize())
|
| 320 |
|
|
self.buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
|
| 321 |
|
|
self.buttonSizer.Add(self.oKButton,0,wx.ALL,10)
|
| 322 |
|
|
self.buttonSizer.Add(self.cancelButton,0,wx.ALL,10)
|
| 323 |
|
|
|
| 324 |
nino.borges |
189 |
def MenuData(self):
|
| 325 |
|
|
return(("View",
|
| 326 |
|
|
("My Cases", "Chooses from your assigned cases.",self.OnChangeCaseView,"RADIO"),
|
| 327 |
nino.borges |
454 |
("My Active Cases", "Chooses from your assigned cases, filtered by Active Cases.",self.OnChangeCaseView,"RADIO"),
|
| 328 |
nino.borges |
189 |
("My Office Cases", "Chooses from cases assigned to everyone in your office.",self.OnChangeCaseView,"RADIO"),
|
| 329 |
|
|
("All Cases", "Chooses from all cases.",self.OnChangeCaseView,"RADIO")),
|
| 330 |
nino.borges |
203 |
("&Settings",
|
| 331 |
|
|
("&Working Directory", "Allows you to change the local Buffer directory.", self.OnChangeWorkDir,"")),
|
| 332 |
nino.borges |
189 |
("&Help",
|
| 333 |
|
|
("&About", "Displays the About Window.", self.OnAbout,"")))
|
| 334 |
|
|
|
| 335 |
|
|
def CreateMenuBar(self):
|
| 336 |
|
|
menuBar = wx.MenuBar()
|
| 337 |
|
|
count = 1
|
| 338 |
|
|
for eachMenuData in self.MenuData():
|
| 339 |
|
|
menuLabel = eachMenuData[0]
|
| 340 |
|
|
menuItems = eachMenuData[1:]
|
| 341 |
|
|
menuBar.Append(self.CreateMenu(menuItems), menuLabel)
|
| 342 |
|
|
count = count + 1
|
| 343 |
|
|
self.SetMenuBar(menuBar)
|
| 344 |
|
|
|
| 345 |
|
|
|
| 346 |
|
|
def CreateMenu(self, menuData):
|
| 347 |
|
|
menu = wx.Menu()
|
| 348 |
|
|
for eachLabel, eachStatus, eachHandler, eachType in menuData:
|
| 349 |
|
|
if not eachLabel:
|
| 350 |
|
|
menu.AppendSeparator()
|
| 351 |
|
|
continue
|
| 352 |
|
|
if eachType == "RADIO":
|
| 353 |
|
|
menuItem = menu.AppendRadioItem(-1,eachLabel,eachStatus)
|
| 354 |
|
|
else:
|
| 355 |
|
|
menuItem = menu.Append(-1, eachLabel, eachStatus)
|
| 356 |
|
|
self.Bind(wx.EVT_MENU, eachHandler, menuItem)
|
| 357 |
|
|
return menu
|
| 358 |
|
|
|
| 359 |
ninoborges |
8 |
def CloseWindow(self, event):
|
| 360 |
|
|
self.Close(True)
|
| 361 |
nino.borges |
189 |
|
| 362 |
|
|
def OnChangeCaseView(self,event):
|
| 363 |
|
|
self.casesListChoice.Clear()
|
| 364 |
nino.borges |
540 |
labID = event.GetEventObject().GetLabel(event.GetId())
|
| 365 |
|
|
#print labID
|
| 366 |
|
|
#eventID = event.GetId().Label
|
| 367 |
|
|
#print eventID
|
| 368 |
|
|
## Never use event ids again.
|
| 369 |
|
|
|
| 370 |
|
|
if labID == 'My Cases':
|
| 371 |
|
|
#if eventID == 100:
|
| 372 |
nino.borges |
189 |
#change it to my cases
|
| 373 |
|
|
self.casesListChoice.SetItems(self.myCases)
|
| 374 |
|
|
|
| 375 |
nino.borges |
540 |
if labID == 'My Active Cases':
|
| 376 |
|
|
#if eventID == 101:
|
| 377 |
nino.borges |
454 |
#change it to my active cases
|
| 378 |
|
|
self.casesListChoice.SetItems(self.myActiveCases)
|
| 379 |
nino.borges |
189 |
|
| 380 |
nino.borges |
540 |
if labID == 'My Office Cases':
|
| 381 |
|
|
#if eventID == 102:
|
| 382 |
nino.borges |
189 |
#change it to office cases
|
| 383 |
|
|
self.casesListChoice.SetItems(self.officeCases)
|
| 384 |
|
|
|
| 385 |
nino.borges |
540 |
if labID == 'All Cases':
|
| 386 |
|
|
#if eventID == 103:
|
| 387 |
nino.borges |
189 |
#change it to all cases
|
| 388 |
|
|
self.casesListChoice.SetItems(self.allCases)
|
| 389 |
|
|
|
| 390 |
|
|
|
| 391 |
nino.borges |
203 |
def OnChangeWorkDir(self,event):
|
| 392 |
nino.borges |
258 |
dlg = WorkDirDialog.WorkDirDialog(self, self.workDir)
|
| 393 |
|
|
if dlg.ShowModal() == wx.ID_OK:
|
| 394 |
|
|
self.workDir = dlg.GetValues()
|
| 395 |
|
|
#print self.workDir
|
| 396 |
|
|
dlg.Destroy()
|
| 397 |
|
|
|
| 398 |
ninoborges |
8 |
|
| 399 |
|
|
def OnProcess(self, event):
|
| 400 |
|
|
caseName = self.casesListChoice.GetStringSelection()
|
| 401 |
|
|
platform = self.platformListChoice.GetStringSelection()
|
| 402 |
nino.borges |
485 |
if self.upLoadCatagory.IsEnabled():
|
| 403 |
|
|
uploadType = self.upLoadCatagory.GetStringSelection()
|
| 404 |
|
|
else:
|
| 405 |
|
|
uploadType = 'Generic (Old Cases Only)'
|
| 406 |
nino.borges |
235 |
## CHANGE to the new place
|
| 407 |
|
|
#workDir = self.workDirControl.GetValue()
|
| 408 |
nino.borges |
258 |
#workDir = os.path.join(os.environ.get("USERPROFILE"),"Desktop\\Working")
|
| 409 |
nino.borges |
235 |
|
| 410 |
ninoborges |
8 |
if self.radio1.GetValue():
|
| 411 |
|
|
startSelection = self.fileBowserControl.GetValue()
|
| 412 |
nino.borges |
236 |
sourceMediaLocation = 'local'
|
| 413 |
|
|
elif self.radio2.GetValue():
|
| 414 |
|
|
startSelection = self.dirBowserControl.GetValue()
|
| 415 |
|
|
sourceMediaLocation = 'local'
|
| 416 |
ninoborges |
8 |
else:
|
| 417 |
nino.borges |
236 |
startSelection = self.vendorBowserControl.GetValue()
|
| 418 |
|
|
sourceMediaLocation = 'remote'
|
| 419 |
ninoborges |
8 |
#startSelection = r"C:\Documents and Settings\eborges\Desktop\Working\Misc_Documents.zip"
|
| 420 |
|
|
self.Show(False)
|
| 421 |
|
|
#print "workdir is %s"%workDir
|
| 422 |
nino.borges |
457 |
MCP_CopyUp_Request.Process(caseName, self.workDir, startSelection, platform, sourceMediaLocation, uploadType)
|
| 423 |
ninoborges |
8 |
|
| 424 |
|
|
#diag = wx.MessageDialog(self,"All Items processed and copied!!", "Complete",wx.OK | wx.ICON_INFORMATION)
|
| 425 |
|
|
#diag.ShowModal()
|
| 426 |
|
|
#diag.Destroy()
|
| 427 |
|
|
self.Destroy()
|
| 428 |
|
|
|
| 429 |
nino.borges |
189 |
def OnAbout(self, event):
|
| 430 |
|
|
"""
|
| 431 |
|
|
OnAbout(self,event) Displays an about dialog with developer and bug reporting info
|
| 432 |
|
|
"""
|
| 433 |
|
|
dlg = wx.MessageDialog(self, "MCP is a case organization program.\n"
|
| 434 |
|
|
"\n\n"
|
| 435 |
|
|
"For questions or comments about this program\n"
|
| 436 |
|
|
"or to report a bug, please email the program\n"
|
| 437 |
|
|
"creator at Nino.Borges@gmail.com\n\n"
|
| 438 |
|
|
"MCP is\n"
|
| 439 |
nino.borges |
540 |
"Copyright (c) 2011 - 2014 Emanuel Borges.\n"
|
| 440 |
nino.borges |
189 |
"All rights reserved.\n"
|
| 441 |
|
|
"(Nino.Borges@gmail.com)\n",
|
| 442 |
|
|
"About MCP", wx.OK | wx.ICON_INFORMATION)
|
| 443 |
|
|
dlg.ShowModal()
|
| 444 |
|
|
dlg.Destroy()
|
| 445 |
ninoborges |
8 |
|
| 446 |
|
|
|
| 447 |
nino.borges |
203 |
class VendorBrowserDialog(wx.Dialog):
|
| 448 |
nino.borges |
458 |
def __init__(self, parent, vendorFolder, rootPath,platform):
|
| 449 |
nino.borges |
203 |
wx.Dialog.__init__(self, parent, -1, "Vendor Folder Browser", style = wx.DEFAULT_DIALOG_STYLE, size = (300,400))
|
| 450 |
|
|
#wx.Dialog.__init__(self, parent,title= "Vendor Folder Browser", size = (300,400))
|
| 451 |
|
|
self.vendorFolder = vendorFolder
|
| 452 |
nino.borges |
458 |
self.rootPath = rootPath
|
| 453 |
|
|
self.expedatObj = MCP_Lib.ExpeDatConnection(platform)
|
| 454 |
nino.borges |
203 |
|
| 455 |
|
|
il = wx.ImageList(16,16)
|
| 456 |
|
|
self.fldridx = il.Add(wx.ArtProvider.GetBitmap(wx.ART_FOLDER,wx.ART_OTHER, (16,16)))
|
| 457 |
|
|
self.fldropenidx = il.Add(wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN,wx.ART_OTHER, (16,16)))
|
| 458 |
|
|
self.fileidx = il.Add(wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE,wx.ART_OTHER, (16,16)))
|
| 459 |
|
|
|
| 460 |
|
|
self.vendorTree = wx.TreeCtrl(self, size=(200,310))
|
| 461 |
|
|
self.vendorTree.AssignImageList(il)
|
| 462 |
|
|
|
| 463 |
|
|
rootVendorFolderId = self.vendorTree.AddRoot(vendorFolder)
|
| 464 |
nino.borges |
458 |
ids = {self.rootPath:rootVendorFolderId}
|
| 465 |
nino.borges |
203 |
|
| 466 |
nino.borges |
458 |
waitDlg = WaitingOnDialog(self,"IDS Connection")
|
| 467 |
|
|
waitDlg.Show(True)
|
| 468 |
|
|
#wx.Yield()
|
| 469 |
|
|
self.AddTreeNodes(ids)
|
| 470 |
|
|
waitDlg.Destroy()
|
| 471 |
|
|
|
| 472 |
nino.borges |
203 |
#childVendorFolderId2 = self.vendorTree.AppendItem(rootVendorFolderId,"test2")
|
| 473 |
|
|
#childVendorFolderId = self.vendorTree.AppendItem(childVendorFolderId2,"test")
|
| 474 |
|
|
self.vendorTree.Expand(rootVendorFolderId)
|
| 475 |
|
|
|
| 476 |
|
|
|
| 477 |
|
|
self.vendorTree.SetItemImage(rootVendorFolderId, self.fldridx, wx.TreeItemIcon_Normal)
|
| 478 |
|
|
self.vendorTree.SetItemImage(rootVendorFolderId, self.fldropenidx, wx.TreeItemIcon_Expanded)
|
| 479 |
|
|
## this will need a if its a file do this else do the previous
|
| 480 |
|
|
#self.vendorTree.SetItemImage(childVendorFolderId, self.fileidx, wx.TreeItemIcon_Normal)
|
| 481 |
|
|
|
| 482 |
|
|
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
| 483 |
|
|
mainSizer.Add(self.vendorTree, 0, wx.EXPAND|wx.ALL, 5)
|
| 484 |
|
|
|
| 485 |
|
|
oKButton = wx.Button(self, wx.ID_OK)
|
| 486 |
|
|
oKButton.SetDefault()
|
| 487 |
|
|
cancelButton = wx.Button(self, wx.ID_CANCEL)
|
| 488 |
|
|
buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
|
| 489 |
|
|
buttonSizer.Add(oKButton,0,wx.ALL,5)
|
| 490 |
|
|
buttonSizer.Add(cancelButton,0,wx.ALL,5)
|
| 491 |
|
|
mainSizer.Add(buttonSizer, 0, wx.ALIGN_CENTER|wx.ALL, 15)
|
| 492 |
|
|
self.SetSizer(mainSizer)
|
| 493 |
|
|
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged, self.vendorTree)
|
| 494 |
ninoborges |
8 |
|
| 495 |
nino.borges |
203 |
|
| 496 |
nino.borges |
458 |
def AddTreeNodes(self, ids):
|
| 497 |
|
|
for (dirpath, dirnames, filenames) in self.expedatObj.ExpeDatWalk(self.rootPath):
|
| 498 |
|
|
for dirname in dirnames:
|
| 499 |
|
|
fullpath = os.path.join(dirpath, dirname)
|
| 500 |
|
|
ids[fullpath] = self.vendorTree.AppendItem(ids[dirpath], dirname)
|
| 501 |
|
|
self.vendorTree.SetItemImage(ids[fullpath], self.fldridx,wx.TreeItemIcon_Normal)
|
| 502 |
|
|
self.vendorTree.SetItemImage(ids[fullpath], self.fldropenidx,wx.TreeItemIcon_Expanded)
|
| 503 |
|
|
for filename in sorted(filenames):
|
| 504 |
|
|
newItem = self.vendorTree.AppendItem(ids[dirpath], filename)
|
| 505 |
|
|
self.vendorTree.SetItemImage(newItem, self.fileidx, wx.TreeItemIcon_Normal)
|
| 506 |
|
|
|
| 507 |
|
|
|
| 508 |
|
|
#def AddTreeNodes(self, parentItem, items):
|
| 509 |
|
|
# """
|
| 510 |
|
|
# Recursively traverses the data structure, adding tree nodes to
|
| 511 |
|
|
# match it.
|
| 512 |
|
|
# """
|
| 513 |
|
|
# for item in items:
|
| 514 |
|
|
# if type(item) == str:
|
| 515 |
|
|
# newItem = self.vendorTree.AppendItem(parentItem, item)
|
| 516 |
|
|
# #self.tree.SetItemText(newItem, "A description of %s" % item, 1)
|
| 517 |
|
|
# self.vendorTree.SetItemImage(newItem, self.fileidx,
|
| 518 |
|
|
# wx.TreeItemIcon_Normal)
|
| 519 |
|
|
# else:
|
| 520 |
|
|
# newItem = self.vendorTree.AppendItem(parentItem, item[0])
|
| 521 |
|
|
# #self.tree.SetItemText(newItem, "A description of %s" % item[0], 1)
|
| 522 |
|
|
# self.vendorTree.SetItemImage(newItem, self.fldridx,
|
| 523 |
|
|
# wx.TreeItemIcon_Normal)
|
| 524 |
|
|
# self.vendorTree.SetItemImage(newItem, self.fldropenidx,
|
| 525 |
|
|
# wx.TreeItemIcon_Expanded)
|
| 526 |
|
|
#
|
| 527 |
|
|
# self.AddTreeNodes(newItem, item[1])
|
| 528 |
|
|
|
| 529 |
nino.borges |
203 |
def OnSelChanged(self, event):
|
| 530 |
|
|
self.item = event.GetItem()
|
| 531 |
|
|
if self.item:
|
| 532 |
|
|
self.vendorFileSelected = self.vendorTree.GetItemText(self.item)
|
| 533 |
|
|
event.Skip()
|
| 534 |
|
|
|
| 535 |
|
|
def GetValues(self):
|
| 536 |
|
|
vendorPath = self.vendorFileSelected
|
| 537 |
|
|
upItem = self.vendorTree.GetItemParent(self.item)
|
| 538 |
|
|
while upItem:
|
| 539 |
|
|
vendorPath = os.path.join(self.vendorTree.GetItemText(upItem),vendorPath)
|
| 540 |
|
|
upItem = self.vendorTree.GetItemParent(upItem)
|
| 541 |
|
|
return vendorPath
|
| 542 |
|
|
|
| 543 |
nino.borges |
458 |
class WaitingOnDialog(wx.Dialog):
|
| 544 |
|
|
def __init__(self, parent, waitingOnThing):
|
| 545 |
|
|
wx.Dialog.__init__(self, parent, -1, "Waiting on %s ..."%waitingOnThing, style = wx.DEFAULT_DIALOG_STYLE, size = (200,200))
|
| 546 |
|
|
self.SpeedWindow2 = SM.SpeedMeter(self,agwStyle=SM.SM_DRAW_HAND |SM.SM_DRAW_SECTORS |SM.SM_DRAW_MIDDLE_TEXT |
|
| 547 |
|
|
SM.SM_DRAW_SECONDARY_TICKS |
|
| 548 |
|
|
SM.SM_DRAW_PARTIAL_FILLER |
|
| 549 |
|
|
SM.SM_DRAW_SHADOW
|
| 550 |
|
|
)
|
| 551 |
|
|
# We Want To Simulate A Clock. Somewhat Tricky, But Did The Job
|
| 552 |
|
|
self.SpeedWindow2.SetAngleRange(pi/2, 5*pi/2)
|
| 553 |
nino.borges |
203 |
|
| 554 |
nino.borges |
458 |
intervals = range(0, 13)
|
| 555 |
|
|
self.SpeedWindow2.SetIntervals(intervals)
|
| 556 |
|
|
|
| 557 |
|
|
colours = [wx.SystemSettings_GetColour(0)]*12
|
| 558 |
|
|
self.SpeedWindow2.SetIntervalColours(colours)
|
| 559 |
|
|
|
| 560 |
|
|
ticks = [str(interval) for interval in intervals]
|
| 561 |
|
|
ticks[-1] = ""
|
| 562 |
|
|
ticks[0] = "12"
|
| 563 |
|
|
self.SpeedWindow2.SetTicks(ticks)
|
| 564 |
|
|
self.SpeedWindow2.SetTicksColour(wx.BLUE)
|
| 565 |
|
|
self.SpeedWindow2.SetTicksFont(wx.Font(11, wx.SCRIPT, wx.NORMAL, wx.BOLD, True))
|
| 566 |
|
|
self.SpeedWindow2.SetNumberOfSecondaryTicks(4)
|
| 567 |
|
|
|
| 568 |
|
|
# Set The Colour For The External Arc
|
| 569 |
|
|
self.SpeedWindow2.SetArcColour(wx.BLUE)
|
| 570 |
|
|
|
| 571 |
|
|
self.SpeedWindow2.SetHandColour(wx.BLACK)
|
| 572 |
|
|
|
| 573 |
|
|
self.SpeedWindow2.SetMiddleText("0 s")
|
| 574 |
|
|
self.SpeedWindow2.SetMiddleTextColour(wx.RED)
|
| 575 |
|
|
|
| 576 |
|
|
# We Set The Background Colour Of The SpeedMeter OutSide The Control
|
| 577 |
|
|
self.SpeedWindow2.SetSpeedBackground(wx.WHITE)
|
| 578 |
|
|
|
| 579 |
|
|
# Set The Colour For The Shadow
|
| 580 |
|
|
self.SpeedWindow2.SetShadowColour(wx.Colour(128, 128, 128))
|
| 581 |
|
|
|
| 582 |
|
|
self.SpeedWindow2.SetSpeedValue(0.0)
|
| 583 |
|
|
|
| 584 |
|
|
|
| 585 |
|
|
# These Are Cosmetics For The Second SpeedMeter Control
|
| 586 |
|
|
|
| 587 |
|
|
# Create The Timer For The Clock
|
| 588 |
|
|
self.timer = wx.PyTimer(self.ClockTimer)
|
| 589 |
|
|
self.currvalue = 0
|
| 590 |
|
|
|
| 591 |
|
|
bsizer2 = wx.BoxSizer(wx.VERTICAL)
|
| 592 |
|
|
|
| 593 |
|
|
#hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
| 594 |
|
|
#stattext2 = wx.StaticText(self, -1, "A Simple Clock", style=wx.ALIGN_CENTER)
|
| 595 |
|
|
|
| 596 |
|
|
#button2 = wx.Button(self, -1, "Stop")
|
| 597 |
|
|
self.stopped = 0
|
| 598 |
|
|
#button2.Bind(wx.EVT_BUTTON, self.OnStopClock)
|
| 599 |
|
|
#button2.SetToolTip(wx.ToolTip("Click To Stop/Resume The Clock"))
|
| 600 |
|
|
|
| 601 |
|
|
#hsizer2.Add(button2, 0, wx.LEFT, 5)
|
| 602 |
|
|
#hsizer2.Add(stattext2, 1, wx.EXPAND)
|
| 603 |
|
|
|
| 604 |
|
|
bsizer2.Add(self.SpeedWindow2, 1, wx.EXPAND)
|
| 605 |
|
|
#bsizer2.Add(hsizer2, 0, wx.EXPAND)
|
| 606 |
|
|
self.SetSizer(bsizer2)
|
| 607 |
|
|
wx.Yield()
|
| 608 |
|
|
self.timer.Start(1000)
|
| 609 |
|
|
#self.timer3.Start(500)
|
| 610 |
|
|
wx.Yield()
|
| 611 |
|
|
|
| 612 |
|
|
|
| 613 |
|
|
#mainSizer = wx.BoxSizer(wx.VERTICAL)
|
| 614 |
|
|
#mainSizer.Add(SpeedWindow2, 0, wx.EXPAND|wx.ALL, 5)
|
| 615 |
|
|
#self.SetSizer(mainSizer)
|
| 616 |
|
|
def ClockTimer(self):
|
| 617 |
|
|
if self.currvalue >= 59:
|
| 618 |
|
|
self.currvalue = 0
|
| 619 |
|
|
else:
|
| 620 |
|
|
self.currvalue = self.currvalue + 1
|
| 621 |
|
|
wx.Yield()
|
| 622 |
|
|
|
| 623 |
|
|
self.SpeedWindow2.SetMiddleText(str(self.currvalue) + " s")
|
| 624 |
|
|
self.SpeedWindow2.SetSpeedValue(self.currvalue/5.0)
|
| 625 |
|
|
|
| 626 |
|
|
|
| 627 |
|
|
def OnStopClock(self, event):
|
| 628 |
|
|
|
| 629 |
|
|
btn = event.GetEventObject()
|
| 630 |
|
|
|
| 631 |
|
|
if self.stopped == 0:
|
| 632 |
|
|
self.stopped = 1
|
| 633 |
|
|
self.timer.Stop()
|
| 634 |
|
|
btn.SetLabel("Resume")
|
| 635 |
|
|
else:
|
| 636 |
|
|
self.stopped = 0
|
| 637 |
|
|
self.timer.Start()
|
| 638 |
|
|
btn.SetLabel("Stop")
|
| 639 |
|
|
|
| 640 |
|
|
|
| 641 |
|
|
|
| 642 |
ninoborges |
8 |
class MyApp(wx.App):
|
| 643 |
|
|
def OnInit(self):
|
| 644 |
nino.borges |
466 |
image = wx.Image("DDSC-LTsmall_2.jpg", wx.BITMAP_TYPE_JPEG)
|
| 645 |
|
|
bmp = image.ConvertToBitmap()
|
| 646 |
|
|
wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_PARENT |wx.SPLASH_TIMEOUT, 2000, None, -1)
|
| 647 |
|
|
wx.Yield()
|
| 648 |
ninoborges |
8 |
prgVersion = MCP_Lib.GetMCPVersion()
|
| 649 |
|
|
self.frame = MyFrame(None, -1, "MCP Copy Up Request %s"%prgVersion)
|
| 650 |
|
|
self.frame.Show(True)
|
| 651 |
|
|
self.SetTopWindow(self.frame)
|
| 652 |
|
|
return True
|
| 653 |
|
|
|
| 654 |
|
|
|
| 655 |
|
|
if __name__ == '__main__':
|
| 656 |
|
|
app = MyApp(0)
|
| 657 |
|
|
app.MainLoop() |