Changes in / [316b9c1:9258c43c] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasview/sasview.py
r1270e3c r20fa5fe 43 43 from sas.sasgui.guiframe.gui_manager import SasViewApp 44 44 self.gui = SasViewApp(0) 45 if sys.platform == "darwin":46 self.check_sasmodels_compiler()47 45 # Set the application manager for the GUI 48 46 self.gui.set_manager(self) … … 132 130 self.gui.MainLoop() 133 131 134 def check_sasmodels_compiler(self):135 """136 Checking c compiler for sasmodels and raises xcode command line137 tools for installation138 """139 #wx should be importable at this stage140 import wx141 import subprocess142 #Generic message box created becuase standard MessageBox is not moveable143 class GenericMessageBox(wx.Dialog):144 def __init__(self, parent, text, title = ''):145 146 wx.Dialog.__init__(self, parent, -1, title = title,147 size = (360,200), pos=(20,60),148 style = wx.STAY_ON_TOP | wx.DEFAULT_DIALOG_STYLE)149 panel = wx.Panel(self, -1)150 top_row_sizer = wx.BoxSizer(wx.HORIZONTAL)151 152 error_bitmap = wx.ArtProvider.GetBitmap(153 wx.ART_ERROR, wx.ART_MESSAGE_BOX154 )155 error_bitmap_ctrl = wx.StaticBitmap(panel, -1)156 error_bitmap_ctrl.SetBitmap(error_bitmap)157 label = wx.StaticText(panel, -1, text)158 top_row_sizer.Add(error_bitmap_ctrl, flag=wx.ALL, border=10)159 top_row_sizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL)160 161 #Create the OK button in the bottom row.162 ok_button = wx.Button(panel, wx.ID_OK )163 self.Bind(wx.EVT_BUTTON, self.on_ok, source=ok_button)164 ok_button.SetFocus()165 ok_button.SetDefault()166 167 sizer = wx.BoxSizer(wx.VERTICAL)168 sizer.Add(top_row_sizer)169 sizer.Add(ok_button, flag=wx.ALIGN_CENTER | wx.ALL, border=5)170 panel.SetSizer(sizer)171 172 def on_ok(self, event):173 self.Destroy()174 175 logger = logging.getLogger(__name__)176 try:177 subprocess.check_output(["cc","--version"], stderr=subprocess.STDOUT)178 except subprocess.CalledProcessError as exc:179 dlg = GenericMessageBox(parent=None,180 text='No compiler installed. Please install command line\n'181 'developers tools by clicking \"Install\" in another winodw\n\n'182 'Alternatively click \"Not Now\" and use OpenCL\n'183 'compiler, which can be set up from menu Fitting->OpenCL Options\n\n',184 title = 'Compiler Info')185 dlg.Show()186 logger.error("No compiler installed. %s\n"%(exc))187 logger.error(traceback.format_exc())188 132 189 133 def setup_logging():
Note: See TracChangeset
for help on using the changeset viewer.