Changeset caf3a08f in sasview for sansguiframe/src/sans
- Timestamp:
- Sep 10, 2011 7:00:33 PM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 83eb1b52
- Parents:
- 06772f6
- Location:
- sansguiframe/src/sans/guiframe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/data_processor.py
r850525c rcaf3a08f 655 655 selection_sizer = wx.GridBagSizer(5,5) 656 656 button_sizer = wx.BoxSizer(wx.HORIZONTAL) 657 text = "Open with SansView"657 text = "Open with %s" % self.parent.application_name 658 658 self.local_app_selected = wx.RadioButton(self, -1, text, 659 659 style=wx.RB_GROUP) … … 664 664 self.Bind(wx.EVT_RADIOBUTTON, self.onselect, 665 665 id=self.external_app_selected.GetId()) 666 text = "Save to file"666 text = "Save to File" 667 667 self.save_to_file = wx.CheckBox(self, -1, text) 668 668 self.Bind(wx.EVT_CHECKBOX, self.onselect, … … 671 671 self.external_app_selected.SetValue(False) 672 672 self.save_to_file.SetValue(False) 673 button_OK = wx.Button(self, wx.ID_OK, "Ok") 673 button_close = wx.Button(self, wx.ID_OK, "Close") 674 button_OK = wx.Button(self, wx.ID_CANCEL, "Apply") 674 675 button_OK.SetFocus() 675 676 hint = "" … … 689 690 #contruction the sizer contaning button 690 691 button_sizer.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 692 693 button_sizer.Add(button_close, 0, 694 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 691 695 button_sizer.Add(button_OK, 0, 692 696 wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) -
sansguiframe/src/sans/guiframe/gui_manager.py
r06772f6 rcaf3a08f 204 204 self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO)) 205 205 self.path = PATH_APP 206 self.application_name = APPLICATION_NAME 206 207 ## Application manager 207 208 self._input_file = None … … 298 299 ext = ".csv" 299 300 file_name = "Batch_" + str(plugin_name)+ "_" + time_str + ext 300 #Nee ed to save configuration for later301 #Need to save configuration for later 301 302 dlg = BatchOutputDialog(parent=self, data=data, 302 303 file_name=file_name, 303 304 details=details) 304 305 flag = None 305 if dlg.ShowModal() == wx.ID_ OK:306 if dlg.ShowModal() == wx.ID_CANCEL: 306 307 flag = dlg.flag 308 dlg.Show(True) 309 else: 307 310 dlg.Destroy() 308 311 if flag == 1: … … 310 313 self.batch_frame.Show(True) 311 314 elif flag == 2: 315 file_name = self._default_save_location + str(file_name) 312 316 if not os.path.exists(file_name): 313 317 self.write_batch_output(data=data, file_name=file_name, 314 318 details=details) 315 self.deplay_in_external_app(data=data, file_name=file_name) 319 self.deplay_in_external_app(data=data, file_name=file_name, 320 plugin_name=plugin_name) 316 321 317 322 def write_batch_output(self, data, file_name, details=""): … … 352 357 fd.close() 353 358 354 def deplay_in_external_app(self, data, file_name ):359 def deplay_in_external_app(self, data, file_name, plugin_name): 355 360 """ 356 361 Display data in the another application , by default Excel 357 362 """ 363 try: 364 from win32com.client import Dispatch 365 excel_app = Dispatch('Excel.Application') 366 wb = excel_app.Workbooks.Open(file_name) 367 excel_app.Visible = 1 368 except: 369 msg = "Error occured when calling Excel\n" 370 msg += "Check that Excel in installed in this machine or \n" 371 msg += "Check that %s really exists.\n" % str(file_name) 372 wx.PostEvent(self, StatusEvent(status=msg, 373 info="error")) 374 358 375 359 376 def on_batch_selection(self, event):
Note: See TracChangeset
for help on using the changeset viewer.