ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/CasePathsDialog.py
Revision: 263
Committed: Fri Feb 1 23:57:16 2013 UTC (13 years, 1 month ago) by nino.borges
Content type: text/x-python
File size: 2162 byte(s)
Log Message:
Added the case directories settings

File Contents

# User Rev Content
1 nino.borges 263 """
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, wx.grid, 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 = (510,340))
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 Path:",wx.DefaultPosition)
23     self.casePathControl = wx.TextCtrl(self,-1,casePath, size=(296,-1))
24    
25     mainSizer = wx.BoxSizer(wx.VERTICAL)
26     altMediaPathSizer = wx.BoxSizer(wx.HORIZONTAL)
27     altMediaPathSizer.Add(altMediaPathStaticText,0,wx.ALL,5)
28     altMediaPathSizer.Add(self.altMediaPathControl,0,wx.ALL,5)
29    
30     casePathSizer = wx.BoxSizer(wx.HORIZONTAL)
31     casePathSizer.Add(casePathStaticText,0,wx.ALL,5)
32     casePathSizer.Add(self.casePathControl,0,wx.ALL,5)
33    
34     mainSizer.Add(altMediaPathSizer,0,wx.ALL, 10)
35     mainSizer.Add(casePathSizer,0,wx.ALL, 10)
36    
37     oKButton = wx.Button(self, wx.ID_OK)
38     oKButton.SetDefault()
39     cancelButton = wx.Button(self, wx.ID_CANCEL)
40     buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
41     buttonSizer.Add(oKButton,0,wx.ALL,5)
42     buttonSizer.Add(cancelButton,0,wx.ALL,5)
43     mainSizer.Add(buttonSizer, 0, wx.ALIGN_CENTER|wx.ALL, 15)
44     self.SetSizer(mainSizer)
45    
46     def GetValues(self):
47     ## check to see if it's a drive letter. if so, convert to unc.
48     ## Do not allow local paths.
49     altMediaPath = self.altMediaPathControl.GetValue()
50     if os.path.splitdrive(altMediaPath)[0]:
51     err = True
52     else:
53     if os.path.exists(altMediaPath):
54     err = False
55     return altmediaPath, err