ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/CasePathsDialog.py
Revision: 267
Committed: Tue Feb 5 18:41:43 2013 UTC (13 years, 1 month ago) by nino.borges
Content type: text/x-python
File size: 2350 byte(s)
Log Message:
Removed the unneeded import of wx.grid

File Contents

# Content
1 """
2 CasePathsDialog
3
4 Created by
5 Emanuel Borges
6 02.01.2013
7
8 This dialog will show the alternate media path and allow them to change it.
9 It will also show and unchageable case path.
10
11 """
12
13 import wx, os
14
15 class CasePathsDialog(wx.Dialog):
16 def __init__(self, parent,altMediaPath,casePath):
17 #self.CLM = CLM
18 self.parent = parent
19 wx.Dialog.__init__(self, parent, -1, "Case Paths", style = wx.DEFAULT_DIALOG_STYLE, size = (450,190))
20 altMediaPathStaticText = wx.StaticText(self, -1, "Alternate Media Path:",wx.DefaultPosition)
21 self.altMediaPathControl = wx.TextCtrl(self,-1,altMediaPath, size=(296,-1))
22 casePathStaticText = wx.StaticText(self, -1, "Case Files Path:",wx.DefaultPosition)
23 self.casePathControl = wx.TextCtrl(self,-1,casePath, size=(296,-1))
24 self.casePathControl.Enable(False)
25
26 mainSizer = wx.BoxSizer(wx.VERTICAL)
27 altMediaPathSizer = wx.BoxSizer(wx.HORIZONTAL)
28 altMediaPathSizer.Add(altMediaPathStaticText,0,wx.ALL,5)
29 altMediaPathSizer.Add(self.altMediaPathControl,0,wx.ALL,5)
30
31 casePathSizer = wx.BoxSizer(wx.HORIZONTAL)
32 casePathSizer.Add(casePathStaticText,0,wx.ALL,5)
33 casePathSizer.Add(self.casePathControl,0,wx.ALL,5)
34
35 mainSizer.Add(altMediaPathSizer,0,wx.ALL, 10)
36 mainSizer.Add(casePathSizer,0,wx.ALL, 10)
37
38 oKButton = wx.Button(self, wx.ID_OK)
39 oKButton.SetDefault()
40 cancelButton = wx.Button(self, wx.ID_CANCEL)
41 buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
42 buttonSizer.Add(oKButton,0,wx.ALL,5)
43 buttonSizer.Add(cancelButton,0,wx.ALL,5)
44 mainSizer.Add(buttonSizer, 0, wx.ALIGN_CENTER|wx.ALL, 15)
45 self.SetSizer(mainSizer)
46
47 def GetValues(self):
48 ## check to see if it's a drive letter. if so, convert to unc.
49 ## Do not allow local paths.
50 altMediaPath = self.altMediaPathControl.GetValue()
51 if os.path.splitdrive(altMediaPath)[0]:
52 err = True
53 else:
54 if os.path.exists(altMediaPath):
55 err = False
56 else:
57 if altMediaPath == "":
58 err = False
59 else:
60 err = True
61 return altMediaPath, err