Changeset dce368f in sasview for src/sas/sasgui/guiframe/aboutbox.py
- Timestamp:
- Jun 16, 2017 1:01:44 PM (7 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 8f1bb6f
- Parents:
- e9df8a5 (diff), f2ea95a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/aboutbox.py
r959eb01 rf2ea95a 31 31 (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))): 32 32 fObj, path, descr = imp.find_module('local_config', [path]) 33 config = imp.load_module('local_config', fObj, path, descr) 33 config = imp.load_module('local_config', fObj, path, descr) 34 34 else: 35 35 # Try simply importing local_config 36 36 import local_config as config 37 37 except: 38 # Didn't find local config, load the default 38 # Didn't find local config, load the default 39 39 import config 40 40 … … 42 42 """ 43 43 Launches browser and opens specified url 44 44 45 45 In some cases may require BROWSER environment variable to be set up. 46 46 47 47 :param url: URL to open 48 48 49 49 """ 50 50 import webbrowser … … 55 55 """ 56 56 "About" Dialog 57 57 58 58 Shows product name, current version, authors, and link to the product page. 59 59 Current version is taken from version.py 60 61 """ 62 60 61 """ 62 63 63 def __init__(self, *args, **kwds): 64 64 … … 66 66 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 67 67 wx.Dialog.__init__(self, *args, **kwds) 68 68 69 69 file_dir = os.path.dirname(__file__) 70 70 71 71 # Mac doesn't display images with transparent background so well, 72 72 # keep it for Windows 73 73 image = file_dir + "/images/angles_flat.png" 74 74 75 75 if os.path.isfile(config._corner_image): 76 76 image = config._corner_image … … 80 80 else: 81 81 self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) 82 82 83 83 self.label_title = wx.StaticText(self, -1, config.__appname__) 84 84 self.label_version = wx.StaticText(self, -1, "") … … 112 112 #self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap) 113 113 self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap) 114 114 115 115 self.bitmap_button_isis = wx.BitmapButton(self, -1, wx.NullBitmap) 116 116 self.bitmap_button_ess = wx.BitmapButton(self, -1, wx.NullBitmap) … … 119 119 self.bitmap_button_tudelft = wx.BitmapButton(self, -1, wx.NullBitmap) 120 120 self.bitmap_button_dls = wx.BitmapButton(self, -1, wx.NullBitmap) 121 121 122 122 self.static_line_3 = wx.StaticLine(self, -1) 123 123 self.button_OK = wx.Button(self, wx.ID_OK, "OK") … … 125 125 self.__set_properties() 126 126 self.__do_layout() 127 127 128 128 self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist) 129 129 self.Bind(wx.EVT_BUTTON, self.onUmdLogo, self.bitmap_button_umd) … … 145 145 random.shuffle(config._authors) 146 146 strLabel = ", ".join(config._authors) 147 147 148 148 # display version and svn revison numbers 149 149 verwords = config.__version__.split('.') … … 157 157 self.label_version.SetLabel(config.__version__)#(version) 158 158 self.label_svnrevision.SetLabel(build_num) 159 159 160 160 # set bitmaps for logo buttons 161 161 image = file_dir + "/images/nist_logo.png" 162 162 if os.path.isfile(config._nist_logo): 163 163 image = config._nist_logo 164 logo = wx.Bitmap(image) 164 logo = wx.Bitmap(image) 165 165 self.bitmap_button_nist.SetBitmapLabel(logo) 166 166 167 167 image = file_dir + "/images/umd_logo.png" 168 168 if os.path.isfile(config._umd_logo): 169 169 image = config._umd_logo 170 logo = wx.Bitmap(image) 170 logo = wx.Bitmap(image) 171 171 self.bitmap_button_umd.SetBitmapLabel(logo) 172 172 … … 174 174 if os.path.isfile(config._ornl_logo): 175 175 image = config._ornl_logo 176 logo = wx.Bitmap(image) 176 logo = wx.Bitmap(image) 177 177 self.bitmap_button_ornl.SetBitmapLabel(logo) 178 178 … … 181 181 if os.path.isfile(config._sns_logo): 182 182 image = config._sns_logo 183 logo = wx.Bitmap(image) 183 logo = wx.Bitmap(image) 184 184 self.bitmap_button_sns.SetBitmapLabel(logo) 185 185 186 186 image = file_dir + "/images/nsf_logo.png" 187 187 if os.path.isfile(config._nsf_logo): 188 188 image = config._nsf_logo 189 logo = wx.Bitmap(image) 189 logo = wx.Bitmap(image) 190 190 self.bitmap_button_nsf.SetBitmapLabel(logo) 191 191 … … 196 196 self.bitmap_button_danse.SetBitmapLabel(logo) 197 197 """ 198 image = file_dir + "/images/utlogo. gif"198 image = file_dir + "/images/utlogo.png" 199 199 if os.path.isfile(config._inst_logo): 200 200 image = config._inst_logo 201 201 logo = wx.Bitmap(image) 202 202 self.bitmap_button_msu.SetBitmapLabel(logo) 203 203 204 204 image = file_dir + "/images/isis_logo.png" 205 205 if os.path.isfile(config._isis_logo): 206 206 image = config._isis_logo 207 logo = wx.Bitmap(image) 207 logo = wx.Bitmap(image) 208 208 self.bitmap_button_isis.SetBitmapLabel(logo) 209 209 … … 213 213 logo = wx.Bitmap(image) 214 214 self.bitmap_button_ess.SetBitmapLabel(logo) 215 215 216 216 image = file_dir + "/images/ill_logo.png" 217 217 if os.path.isfile(config._ill_logo): … … 219 219 logo = wx.Bitmap(image) 220 220 self.bitmap_button_ill.SetBitmapLabel(logo) 221 221 222 222 image = file_dir + "/images/ansto_logo.png" 223 223 if os.path.isfile(config._ansto_logo): … … 225 225 logo = wx.Bitmap(image) 226 226 self.bitmap_button_ansto.SetBitmapLabel(logo) 227 227 228 228 image = file_dir + "/images/tudelft_logo.png" 229 229 if os.path.isfile(config._tudelft_logo): … … 231 231 logo = wx.Bitmap(image) 232 232 self.bitmap_button_tudelft.SetBitmapLabel(logo) 233 233 234 234 image = file_dir + "/images/dls_logo.png" 235 235 if os.path.isfile(config._dls_logo): … … 237 237 logo = wx.Bitmap(image) 238 238 self.bitmap_button_dls.SetBitmapLabel(logo) 239 239 240 240 # resize dialog window to fit version number nicely 241 241 if wx.VERSION >= (2, 7, 2, 0): … … 244 244 size = [self.GetBestFittingSize()[0], self.GetSize()[1]] 245 245 self.Fit() 246 246 247 247 def __set_properties(self): 248 248 """ … … 310 310 sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0) 311 311 312 sizer_logos.Add(self.bitmap_button_msu, 0, 312 sizer_logos.Add(self.bitmap_button_msu, 0, 313 313 wx.LEFT|wx.ADJUST_MINSIZE, 2) 314 314 #sizer_logos.Add(self.bitmap_button_danse, 0, 315 315 # wx.LEFT|wx.ADJUST_MINSIZE, 2) 316 #sizer_logos.Add(self.bitmap_button_nsf, 0, 316 #sizer_logos.Add(self.bitmap_button_nsf, 0, 317 317 # wx.LEFT|wx.ADJUST_MINSIZE, 2) 318 sizer_logos.Add(self.bitmap_button_umd, 0, 319 wx.LEFT|wx.ADJUST_MINSIZE, 2) 320 sizer_logos.Add(self.bitmap_button_nist, 0, 321 wx.LEFT|wx.ADJUST_MINSIZE, 2) 322 #sizer_logos.Add(self.bitmap_button_sns, 0, 318 sizer_logos.Add(self.bitmap_button_umd, 0, 319 wx.LEFT|wx.ADJUST_MINSIZE, 2) 320 sizer_logos.Add(self.bitmap_button_nist, 0, 321 wx.LEFT|wx.ADJUST_MINSIZE, 2) 322 #sizer_logos.Add(self.bitmap_button_sns, 0, 323 323 # wx.LEFT|wx.ADJUST_MINSIZE, 2) 324 sizer_logos.Add(self.bitmap_button_ornl, 0, 325 wx.LEFT|wx.ADJUST_MINSIZE, 2) 326 sizer_logos.Add(self.bitmap_button_isis, 0, 327 wx.LEFT|wx.ADJUST_MINSIZE, 2) 328 sizer_logos.Add(self.bitmap_button_ess, 0, 329 wx.LEFT|wx.ADJUST_MINSIZE, 2) 330 sizer_logos.Add(self.bitmap_button_ill, 0, 331 wx.LEFT|wx.ADJUST_MINSIZE, 2) 332 sizer_logos.Add(self.bitmap_button_ansto, 0, 333 wx.LEFT|wx.ADJUST_MINSIZE, 2) 334 sizer_logos.Add(self.bitmap_button_tudelft, 0, 335 wx.LEFT|wx.ADJUST_MINSIZE, 2) 336 sizer_logos.Add(self.bitmap_button_dls, 0, 337 wx.LEFT|wx.ADJUST_MINSIZE, 2) 338 324 sizer_logos.Add(self.bitmap_button_ornl, 0, 325 wx.LEFT|wx.ADJUST_MINSIZE, 2) 326 sizer_logos.Add(self.bitmap_button_isis, 0, 327 wx.LEFT|wx.ADJUST_MINSIZE, 2) 328 sizer_logos.Add(self.bitmap_button_ess, 0, 329 wx.LEFT|wx.ADJUST_MINSIZE, 2) 330 sizer_logos.Add(self.bitmap_button_ill, 0, 331 wx.LEFT|wx.ADJUST_MINSIZE, 2) 332 sizer_logos.Add(self.bitmap_button_ansto, 0, 333 wx.LEFT|wx.ADJUST_MINSIZE, 2) 334 sizer_logos.Add(self.bitmap_button_tudelft, 0, 335 wx.LEFT|wx.ADJUST_MINSIZE, 2) 336 sizer_logos.Add(self.bitmap_button_dls, 0, 337 wx.LEFT|wx.ADJUST_MINSIZE, 2) 338 339 339 sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0) 340 340 sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0) 341 341 sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0) 342 342 sizer_button.Add((20, 40), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 343 sizer_button.Add(self.button_OK, 0, 343 sizer_button.Add(self.button_OK, 0, 344 344 wx.RIGHT|wx.ADJUST_MINSIZE|wx.CENTER, 10) 345 345 sizer_main.Add(sizer_button, 0, wx.EXPAND, 0) … … 350 350 # end wxGlade 351 351 352 def onNistLogo(self, event): 352 def onNistLogo(self, event): 353 353 """ 354 354 """ … … 356 356 launchBrowser(config._nist_url) 357 357 event.Skip() 358 359 def onUmdLogo(self, event): 358 359 def onUmdLogo(self, event): 360 360 """ 361 361 """ … … 363 363 launchBrowser(config._umd_url) 364 364 event.Skip() 365 366 def onOrnlLogo(self, event): 365 366 def onOrnlLogo(self, event): 367 367 """ 368 368 """ … … 370 370 launchBrowser(config._ornl_url) 371 371 event.Skip() 372 373 def onSnsLogo(self, event): 372 373 def onSnsLogo(self, event): 374 374 """ 375 375 """ … … 377 377 launchBrowser(config._sns_url) 378 378 event.Skip() 379 380 def onNsfLogo(self, event): 379 380 def onNsfLogo(self, event): 381 381 """ 382 382 """ … … 394 394 def onUTLogo(self, event): 395 395 """ 396 """ 396 """ 397 397 # wxGlade: DialogAbout.<event_handler> 398 398 launchBrowser(config._inst_url) 399 399 event.Skip() 400 400 401 def onIsisLogo(self, event): 401 def onIsisLogo(self, event): 402 402 """ 403 403 """ … … 415 415 def onIllLogo(self, event): 416 416 """ 417 """ 417 """ 418 418 # wxGlade: DialogAbout.<event_handler> 419 419 launchBrowser(config._ill_url) … … 422 422 def onAnstoLogo(self, event): 423 423 """ 424 """ 424 """ 425 425 # wxGlade: DialogAbout.<event_handler> 426 426 launchBrowser(config._ansto_url) … … 429 429 def onTudelftLogo(self, event): 430 430 """ 431 """ 431 """ 432 432 # wxGlade: DialogAbout.<event_handler> 433 433 launchBrowser(config._tudelft_url) … … 436 436 def onDlsLogo(self, event): 437 437 """ 438 """ 438 """ 439 439 # wxGlade: DialogAbout.<event_handler> 440 440 launchBrowser(config._dls_url) … … 462 462 app = MyApp(0) 463 463 app.MainLoop() 464 465 ##### end of testing code ##################################################### 464 465 ##### end of testing code #####################################################
Note: See TracChangeset
for help on using the changeset viewer.