Changeset 914ba0a in sasview for src/sas/sasgui/guiframe/aboutbox.py
- Timestamp:
- May 2, 2017 1:58:01 PM (8 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:
- d66dbcc
- Parents:
- 74d9780 (diff), 658dd57 (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
refe730d r914ba0a 31 31 """ 32 32 Launches browser and opens specified url 33 33 34 34 In some cases may require BROWSER environment variable to be set up. 35 35 36 36 :param url: URL to open 37 37 38 38 """ 39 39 import webbrowser … … 44 44 """ 45 45 "About" Dialog 46 46 47 47 Shows product name, current version, authors, and link to the product page. 48 48 Current version is taken from version.py 49 50 """ 51 49 50 """ 51 52 52 def __init__(self, *args, **kwds): 53 53 … … 55 55 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 56 56 wx.Dialog.__init__(self, *args, **kwds) 57 57 58 58 file_dir = os.path.dirname(__file__) 59 59 60 60 # Mac doesn't display images with transparent background so well, 61 61 # keep it for Windows 62 62 image = file_dir + "/images/angles_flat.png" 63 63 64 64 if os.path.isfile(config._corner_image): 65 65 image = config._corner_image … … 69 69 else: 70 70 self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) 71 71 72 72 self.label_title = wx.StaticText(self, -1, config.__appname__) 73 73 self.label_version = wx.StaticText(self, -1, "") … … 95 95 self.bitmap_button_nist = wx.BitmapButton(self, -1, wx.NullBitmap) 96 96 self.bitmap_button_umd = wx.BitmapButton(self, -1, wx.NullBitmap) 97 self.bitmap_button_sns = wx.BitmapButton(self, -1, wx.NullBitmap) 97 self.bitmap_button_ornl = wx.BitmapButton(self, -1, wx.NullBitmap) 98 #self.bitmap_button_sns = wx.BitmapButton(self, -1, wx.NullBitmap) 98 99 #self.bitmap_button_nsf = wx.BitmapButton(self, -1, 99 100 # wx.NullBitmap) 100 101 #self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap) 101 102 self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap) 102 103 103 104 self.bitmap_button_isis = wx.BitmapButton(self, -1, wx.NullBitmap) 104 105 self.bitmap_button_ess = wx.BitmapButton(self, -1, wx.NullBitmap) 105 106 self.bitmap_button_ill = wx.BitmapButton(self, -1, wx.NullBitmap) 106 107 self.bitmap_button_ansto = wx.BitmapButton(self, -1, wx.NullBitmap) 108 self.bitmap_button_tudelft = wx.BitmapButton(self, -1, wx.NullBitmap) 109 self.bitmap_button_dls = wx.BitmapButton(self, -1, wx.NullBitmap) 110 107 111 self.static_line_3 = wx.StaticLine(self, -1) 108 112 self.button_OK = wx.Button(self, wx.ID_OK, "OK") … … 110 114 self.__set_properties() 111 115 self.__do_layout() 112 116 113 117 self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist) 114 118 self.Bind(wx.EVT_BUTTON, self.onUmdLogo, self.bitmap_button_umd) 115 self.Bind(wx.EVT_BUTTON, self.onSnsLogo, self.bitmap_button_sns) 119 #self.Bind(wx.EVT_BUTTON, self.onSnsLogo, self.bitmap_button_sns) 120 self.Bind(wx.EVT_BUTTON, self.onOrnlLogo, self.bitmap_button_ornl) 116 121 #self.Bind(wx.EVT_BUTTON, self.onNsfLogo, self.bitmap_button_nsf) 117 122 #self.Bind(wx.EVT_BUTTON, self.onDanseLogo, self.bitmap_button_danse) … … 120 125 self.Bind(wx.EVT_BUTTON, self.onEssLogo, self.bitmap_button_ess) 121 126 self.Bind(wx.EVT_BUTTON, self.onIllLogo, self.bitmap_button_ill) 127 self.Bind(wx.EVT_BUTTON, self.onAnstoLogo, self.bitmap_button_ansto) 128 self.Bind(wx.EVT_BUTTON, self.onTudelftLogo, self.bitmap_button_tudelft) 129 self.Bind(wx.EVT_BUTTON, self.onDlsLogo, self.bitmap_button_dls) 122 130 # end wxGlade 123 131 # fill in acknowledgements … … 126 134 random.shuffle(config._authors) 127 135 strLabel = ", ".join(config._authors) 128 136 129 137 # display version and svn revison numbers 130 138 verwords = config.__version__.split('.') … … 138 146 self.label_version.SetLabel(config.__version__)#(version) 139 147 self.label_svnrevision.SetLabel(build_num) 140 148 141 149 # set bitmaps for logo buttons 142 150 image = file_dir + "/images/nist_logo.png" 143 151 if os.path.isfile(config._nist_logo): 144 152 image = config._nist_logo 145 logo = wx.Bitmap(image) 153 logo = wx.Bitmap(image) 146 154 self.bitmap_button_nist.SetBitmapLabel(logo) 147 155 148 156 image = file_dir + "/images/umd_logo.png" 149 157 if os.path.isfile(config._umd_logo): 150 158 image = config._umd_logo 151 logo = wx.Bitmap(image) 159 logo = wx.Bitmap(image) 152 160 self.bitmap_button_umd.SetBitmapLabel(logo) 153 161 154 162 image = file_dir + "/images/ornl_logo.png" 163 if os.path.isfile(config._ornl_logo): 164 image = config._ornl_logo 165 logo = wx.Bitmap(image) 166 self.bitmap_button_ornl.SetBitmapLabel(logo) 167 168 """ 155 169 image = file_dir + "/images/sns_logo.png" 156 170 if os.path.isfile(config._sns_logo): 157 171 image = config._sns_logo 158 logo = wx.Bitmap(image) 172 logo = wx.Bitmap(image) 159 173 self.bitmap_button_sns.SetBitmapLabel(logo) 160 161 """ 174 162 175 image = file_dir + "/images/nsf_logo.png" 163 176 if os.path.isfile(config._nsf_logo): 164 177 image = config._nsf_logo 165 logo = wx.Bitmap(image) 178 logo = wx.Bitmap(image) 166 179 self.bitmap_button_nsf.SetBitmapLabel(logo) 167 180 … … 177 190 logo = wx.Bitmap(image) 178 191 self.bitmap_button_msu.SetBitmapLabel(logo) 179 192 180 193 image = file_dir + "/images/isis_logo.png" 181 194 if os.path.isfile(config._isis_logo): 182 195 image = config._isis_logo 183 logo = wx.Bitmap(image) 196 logo = wx.Bitmap(image) 184 197 self.bitmap_button_isis.SetBitmapLabel(logo) 185 198 … … 189 202 logo = wx.Bitmap(image) 190 203 self.bitmap_button_ess.SetBitmapLabel(logo) 191 204 192 205 image = file_dir + "/images/ill_logo.png" 193 206 if os.path.isfile(config._ill_logo): … … 195 208 logo = wx.Bitmap(image) 196 209 self.bitmap_button_ill.SetBitmapLabel(logo) 197 210 211 image = file_dir + "/images/ansto_logo.png" 212 if os.path.isfile(config._ansto_logo): 213 image = config._ansto_logo 214 logo = wx.Bitmap(image) 215 self.bitmap_button_ansto.SetBitmapLabel(logo) 216 217 image = file_dir + "/images/tudelft_logo.png" 218 if os.path.isfile(config._tudelft_logo): 219 image = config._tudelft_logo 220 logo = wx.Bitmap(image) 221 self.bitmap_button_tudelft.SetBitmapLabel(logo) 222 223 image = file_dir + "/images/dls_logo.png" 224 if os.path.isfile(config._dls_logo): 225 image = config._dls_logo 226 logo = wx.Bitmap(image) 227 self.bitmap_button_dls.SetBitmapLabel(logo) 228 198 229 # resize dialog window to fit version number nicely 199 230 if wx.VERSION >= (2, 7, 2, 0): … … 202 233 size = [self.GetBestFittingSize()[0], self.GetSize()[1]] 203 234 self.Fit() 204 235 205 236 def __set_properties(self): 206 237 """ … … 216 247 self.bitmap_button_nist.SetSize(self.bitmap_button_nist.GetBestSize()) 217 248 self.bitmap_button_umd.SetSize(self.bitmap_button_umd.GetBestSize()) 218 self.bitmap_button_sns.SetSize(self.bitmap_button_sns.GetBestSize()) 249 self.bitmap_button_ornl.SetSize(self.bitmap_button_ornl.GetBestSize()) 250 #self.bitmap_button_sns.SetSize(self.bitmap_button_sns.GetBestSize()) 219 251 #self.bitmap_button_nsf.SetSize(self.bitmap_button_nsf.GetBestSize()) 220 252 #self.bitmap_button_danse.SetSize(self.bitmap_button_danse.GetBestSize()) … … 223 255 self.bitmap_button_ess.SetSize(self.bitmap_button_ess.GetBestSize()) 224 256 self.bitmap_button_ill.SetSize(self.bitmap_button_ill.GetBestSize()) 257 self.bitmap_button_ansto.SetSize(self.bitmap_button_ansto.GetBestSize()) 258 self.bitmap_button_tudelft.SetSize(self.bitmap_button_tudelft.GetBestSize()) 259 self.bitmap_button_dls.SetSize(self.bitmap_button_dls.GetBestSize()) 225 260 # end wxGlade 226 261 … … 264 299 sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0) 265 300 266 sizer_logos.Add(self.bitmap_button_msu, 0, 301 sizer_logos.Add(self.bitmap_button_msu, 0, 267 302 wx.LEFT|wx.ADJUST_MINSIZE, 2) 268 303 #sizer_logos.Add(self.bitmap_button_danse, 0, 269 304 # wx.LEFT|wx.ADJUST_MINSIZE, 2) 270 #sizer_logos.Add(self.bitmap_button_nsf, 0, 305 #sizer_logos.Add(self.bitmap_button_nsf, 0, 271 306 # wx.LEFT|wx.ADJUST_MINSIZE, 2) 272 sizer_logos.Add(self.bitmap_button_umd, 0, 273 wx.LEFT|wx.ADJUST_MINSIZE, 2) 274 sizer_logos.Add(self.bitmap_button_nist, 0, 275 wx.LEFT|wx.ADJUST_MINSIZE, 2) 276 sizer_logos.Add(self.bitmap_button_sns, 0, 277 wx.LEFT|wx.ADJUST_MINSIZE, 2) 278 sizer_logos.Add(self.bitmap_button_isis, 0, 279 wx.LEFT|wx.ADJUST_MINSIZE, 2) 280 sizer_logos.Add(self.bitmap_button_ess, 0, 281 wx.LEFT|wx.ADJUST_MINSIZE, 2) 282 sizer_logos.Add(self.bitmap_button_ill, 0, 283 wx.LEFT|wx.ADJUST_MINSIZE, 2) 284 307 sizer_logos.Add(self.bitmap_button_umd, 0, 308 wx.LEFT|wx.ADJUST_MINSIZE, 2) 309 sizer_logos.Add(self.bitmap_button_nist, 0, 310 wx.LEFT|wx.ADJUST_MINSIZE, 2) 311 #sizer_logos.Add(self.bitmap_button_sns, 0, 312 # wx.LEFT|wx.ADJUST_MINSIZE, 2) 313 sizer_logos.Add(self.bitmap_button_ornl, 0, 314 wx.LEFT|wx.ADJUST_MINSIZE, 2) 315 sizer_logos.Add(self.bitmap_button_isis, 0, 316 wx.LEFT|wx.ADJUST_MINSIZE, 2) 317 sizer_logos.Add(self.bitmap_button_ess, 0, 318 wx.LEFT|wx.ADJUST_MINSIZE, 2) 319 sizer_logos.Add(self.bitmap_button_ill, 0, 320 wx.LEFT|wx.ADJUST_MINSIZE, 2) 321 sizer_logos.Add(self.bitmap_button_ansto, 0, 322 wx.LEFT|wx.ADJUST_MINSIZE, 2) 323 sizer_logos.Add(self.bitmap_button_tudelft, 0, 324 wx.LEFT|wx.ADJUST_MINSIZE, 2) 325 sizer_logos.Add(self.bitmap_button_dls, 0, 326 wx.LEFT|wx.ADJUST_MINSIZE, 2) 327 285 328 sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0) 286 329 sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0) 287 330 sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0) 288 331 sizer_button.Add((20, 40), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 289 sizer_button.Add(self.button_OK, 0, 332 sizer_button.Add(self.button_OK, 0, 290 333 wx.RIGHT|wx.ADJUST_MINSIZE|wx.CENTER, 10) 291 334 sizer_main.Add(sizer_button, 0, wx.EXPAND, 0) … … 296 339 # end wxGlade 297 340 298 def onNistLogo(self, event): 341 def onNistLogo(self, event): 299 342 """ 300 343 """ … … 302 345 launchBrowser(config._nist_url) 303 346 event.Skip() 304 305 def onUmdLogo(self, event): 347 348 def onUmdLogo(self, event): 306 349 """ 307 350 """ … … 309 352 launchBrowser(config._umd_url) 310 353 event.Skip() 311 312 def onSnsLogo(self, event): 354 355 def onOrnlLogo(self, event): 356 """ 357 """ 358 # wxGlade: DialogAbout.<event_handler> 359 launchBrowser(config._ornl_url) 360 event.Skip() 361 362 def onSnsLogo(self, event): 313 363 """ 314 364 """ … … 316 366 launchBrowser(config._sns_url) 317 367 event.Skip() 318 319 def onNsfLogo(self, event): 368 369 def onNsfLogo(self, event): 320 370 """ 321 371 """ … … 333 383 def onUTLogo(self, event): 334 384 """ 335 """ 385 """ 336 386 # wxGlade: DialogAbout.<event_handler> 337 387 launchBrowser(config._inst_url) 338 388 event.Skip() 339 389 340 def onIsisLogo(self, event): 390 def onIsisLogo(self, event): 341 391 """ 342 392 """ … … 354 404 def onIllLogo(self, event): 355 405 """ 356 """ 406 """ 357 407 # wxGlade: DialogAbout.<event_handler> 358 408 launchBrowser(config._ill_url) 409 event.Skip() 410 411 def onAnstoLogo(self, event): 412 """ 413 """ 414 # wxGlade: DialogAbout.<event_handler> 415 launchBrowser(config._ansto_url) 416 event.Skip() 417 418 def onTudelftLogo(self, event): 419 """ 420 """ 421 # wxGlade: DialogAbout.<event_handler> 422 launchBrowser(config._tudelft_url) 423 event.Skip() 424 425 def onDlsLogo(self, event): 426 """ 427 """ 428 # wxGlade: DialogAbout.<event_handler> 429 launchBrowser(config._dls_url) 359 430 event.Skip() 360 431 … … 380 451 app = MyApp(0) 381 452 app.MainLoop() 382 383 ##### end of testing code ##################################################### 453 454 ##### end of testing code #####################################################
Note: See TracChangeset
for help on using the changeset viewer.