# Translators: An informational message displayed in the Create Portable NVDA dialog.\r
dialogCaption=wx.StaticText(self,label=_("To create a portable copy of NVDA, please select the path and other options and then press Continue")) \r
mainSizer.Add(dialogCaption)\r
- # Translators: The label of the grouping containing options in the Create Portable NVDA dialog.\r
- optionsSizer = wx.StaticBoxSizer(wx.StaticBox(self, label=_("Portable options")), wx.HORIZONTAL)\r
+ optionsSizer = wx.BoxSizer(wx.HORIZONTAL)\r
# Translators: The label of a grouping containing controls to select the destination directory\r
# in the Create Portable NVDA dialog.\r
sizer = wx.StaticBoxSizer(wx.StaticBox(self, label=_("Portable directory:")), wx.HORIZONTAL)\r
- ctrl = self.portableDirectoryEdit = wx.TextCtrl(self, value='e:\\')\r
+ ctrl = self.portableDirectoryEdit = wx.TextCtrl(self)\r
sizer.Add(ctrl)\r
# Translators: The label of a button to browse for a directory.\r
ctrl = wx.Button(self, label=_("Browse..."))\r
def onBrowseForPortableDirectory(self, evt):\r
# Translators: The title of the dialog presented when browsing for the\r
# destination directory when creating a portable copy of NVDA.\r
- with wx.DirDialog(self, _("Select portable directory"), defaultPath=self.portableDirectoryEdit.Value) as d:\r
+ with wx.DirDialog(self, _("Select portable directory"), defaultPath=self.portableDirectoryEdit.Value or "c:\\") as d:\r
if d.ShowModal() == wx.ID_OK:\r
self.portableDirectoryEdit.Value = d.Path\r
\r
def onCreatePortable(self, evt):\r
+ if not self.portableDirectoryEdit.Value:\r
+ gui.messageBox(_("Please provide a directory to place the portable copy."),\r
+ # Translators: The title of a dialog presented when an error occurs.\r
+ _("Error"))\r
+ return\r
+ drv=os.path.splitdrive(self.portableDirectoryEdit.Value)[0]\r
+ if drv and not os.path.isdir(drv):\r
+ gui.messageBox(_("Invalid drive %s")%drv,\r
+ # Translators: The title of a dialog presented when an error occurs.\r
+ _("Error"))\r
+ return\r
self.Hide()\r
doCreatePortable(self.portableDirectoryEdit.Value,self.createAutorunCheckbox.Value,self.copyUserConfigCheckbox.Value)\r
self.Destroy()\r