Changeset 914ba0a in sasview for src/sas/sasgui/guiframe/aboutbox.py


Ignore:
Timestamp:
May 2, 2017 1:58:01 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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.
Message:

merge with master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/aboutbox.py

    refe730d r914ba0a  
    3131    """ 
    3232    Launches browser and opens specified url 
    33      
     33 
    3434    In some cases may require BROWSER environment variable to be set up. 
    35      
     35 
    3636    :param url: URL to open 
    37      
     37 
    3838    """ 
    3939    import webbrowser 
     
    4444    """ 
    4545    "About" Dialog 
    46      
     46 
    4747    Shows product name, current version, authors, and link to the product page. 
    4848    Current version is taken from version.py 
    49      
    50     """ 
    51      
     49 
     50    """ 
     51 
    5252    def __init__(self, *args, **kwds): 
    5353 
     
    5555        kwds["style"] = wx.DEFAULT_DIALOG_STYLE 
    5656        wx.Dialog.__init__(self, *args, **kwds) 
    57          
     57 
    5858        file_dir = os.path.dirname(__file__) 
    59          
     59 
    6060        # Mac doesn't display images with transparent background so well, 
    6161        # keep it for Windows 
    6262        image = file_dir + "/images/angles_flat.png" 
    63          
     63 
    6464        if os.path.isfile(config._corner_image): 
    6565            image = config._corner_image 
     
    6969        else: 
    7070            self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) 
    71          
     71 
    7272        self.label_title = wx.StaticText(self, -1, config.__appname__) 
    7373        self.label_version = wx.StaticText(self, -1, "") 
     
    9595        self.bitmap_button_nist = wx.BitmapButton(self, -1, wx.NullBitmap) 
    9696        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) 
    9899        #self.bitmap_button_nsf = wx.BitmapButton(self, -1, 
    99100        #                                         wx.NullBitmap) 
    100101        #self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap) 
    101102        self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap) 
    102          
     103 
    103104        self.bitmap_button_isis = wx.BitmapButton(self, -1, wx.NullBitmap) 
    104105        self.bitmap_button_ess = wx.BitmapButton(self, -1, wx.NullBitmap) 
    105106        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 
    107111        self.static_line_3 = wx.StaticLine(self, -1) 
    108112        self.button_OK = wx.Button(self, wx.ID_OK, "OK") 
     
    110114        self.__set_properties() 
    111115        self.__do_layout() 
    112          
     116 
    113117        self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist) 
    114118        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) 
    116121        #self.Bind(wx.EVT_BUTTON, self.onNsfLogo, self.bitmap_button_nsf) 
    117122        #self.Bind(wx.EVT_BUTTON, self.onDanseLogo, self.bitmap_button_danse) 
     
    120125        self.Bind(wx.EVT_BUTTON, self.onEssLogo, self.bitmap_button_ess) 
    121126        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) 
    122130        # end wxGlade 
    123131        # fill in acknowledgements 
     
    126134        random.shuffle(config._authors) 
    127135        strLabel = ", ".join(config._authors) 
    128          
     136 
    129137        # display version and svn revison numbers 
    130138        verwords = config.__version__.split('.') 
     
    138146        self.label_version.SetLabel(config.__version__)#(version) 
    139147        self.label_svnrevision.SetLabel(build_num) 
    140          
     148 
    141149        # set bitmaps for logo buttons 
    142150        image = file_dir + "/images/nist_logo.png" 
    143151        if os.path.isfile(config._nist_logo): 
    144152            image = config._nist_logo 
    145         logo = wx.Bitmap(image)         
     153        logo = wx.Bitmap(image) 
    146154        self.bitmap_button_nist.SetBitmapLabel(logo) 
    147          
     155 
    148156        image = file_dir + "/images/umd_logo.png" 
    149157        if os.path.isfile(config._umd_logo): 
    150158            image = config._umd_logo 
    151         logo = wx.Bitmap(image)         
     159        logo = wx.Bitmap(image) 
    152160        self.bitmap_button_umd.SetBitmapLabel(logo) 
    153161 
    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        """ 
    155169        image = file_dir + "/images/sns_logo.png" 
    156170        if os.path.isfile(config._sns_logo): 
    157171            image = config._sns_logo 
    158         logo = wx.Bitmap(image)         
     172        logo = wx.Bitmap(image) 
    159173        self.bitmap_button_sns.SetBitmapLabel(logo) 
    160          
    161         """ 
     174 
    162175        image = file_dir + "/images/nsf_logo.png" 
    163176        if os.path.isfile(config._nsf_logo): 
    164177            image = config._nsf_logo 
    165         logo = wx.Bitmap(image)         
     178        logo = wx.Bitmap(image) 
    166179        self.bitmap_button_nsf.SetBitmapLabel(logo) 
    167180 
     
    177190        logo = wx.Bitmap(image) 
    178191        self.bitmap_button_msu.SetBitmapLabel(logo) 
    179          
     192 
    180193        image = file_dir + "/images/isis_logo.png" 
    181194        if os.path.isfile(config._isis_logo): 
    182195            image = config._isis_logo 
    183         logo = wx.Bitmap(image)         
     196        logo = wx.Bitmap(image) 
    184197        self.bitmap_button_isis.SetBitmapLabel(logo) 
    185198 
     
    189202        logo = wx.Bitmap(image) 
    190203        self.bitmap_button_ess.SetBitmapLabel(logo) 
    191          
     204 
    192205        image = file_dir + "/images/ill_logo.png" 
    193206        if os.path.isfile(config._ill_logo): 
     
    195208        logo = wx.Bitmap(image) 
    196209        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 
    198229        # resize dialog window to fit version number nicely 
    199230        if wx.VERSION >= (2, 7, 2, 0): 
     
    202233            size = [self.GetBestFittingSize()[0], self.GetSize()[1]] 
    203234        self.Fit() 
    204          
     235 
    205236    def __set_properties(self): 
    206237        """ 
     
    216247        self.bitmap_button_nist.SetSize(self.bitmap_button_nist.GetBestSize()) 
    217248        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()) 
    219251        #self.bitmap_button_nsf.SetSize(self.bitmap_button_nsf.GetBestSize()) 
    220252        #self.bitmap_button_danse.SetSize(self.bitmap_button_danse.GetBestSize()) 
     
    223255        self.bitmap_button_ess.SetSize(self.bitmap_button_ess.GetBestSize()) 
    224256        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()) 
    225260        # end wxGlade 
    226261 
     
    264299        sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0) 
    265300 
    266         sizer_logos.Add(self.bitmap_button_msu, 0,  
     301        sizer_logos.Add(self.bitmap_button_msu, 0, 
    267302                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    268303        #sizer_logos.Add(self.bitmap_button_danse, 0, 
    269304        #                wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    270         #sizer_logos.Add(self.bitmap_button_nsf, 0,  
     305        #sizer_logos.Add(self.bitmap_button_nsf, 0, 
    271306        #                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 
    285328        sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0) 
    286329        sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0) 
    287330        sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0) 
    288331        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, 
    290333                         wx.RIGHT|wx.ADJUST_MINSIZE|wx.CENTER, 10) 
    291334        sizer_main.Add(sizer_button, 0, wx.EXPAND, 0) 
     
    296339        # end wxGlade 
    297340 
    298     def onNistLogo(self, event):  
     341    def onNistLogo(self, event): 
    299342        """ 
    300343        """ 
     
    302345        launchBrowser(config._nist_url) 
    303346        event.Skip() 
    304          
    305     def onUmdLogo(self, event):  
     347 
     348    def onUmdLogo(self, event): 
    306349        """ 
    307350        """ 
     
    309352        launchBrowser(config._umd_url) 
    310353        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): 
    313363        """ 
    314364        """ 
     
    316366        launchBrowser(config._sns_url) 
    317367        event.Skip() 
    318                  
    319     def onNsfLogo(self, event):  
     368 
     369    def onNsfLogo(self, event): 
    320370        """ 
    321371        """ 
     
    333383    def onUTLogo(self, event): 
    334384        """ 
    335         """  
     385        """ 
    336386        # wxGlade: DialogAbout.<event_handler> 
    337387        launchBrowser(config._inst_url) 
    338388        event.Skip() 
    339389 
    340     def onIsisLogo(self, event):  
     390    def onIsisLogo(self, event): 
    341391        """ 
    342392        """ 
     
    354404    def onIllLogo(self, event): 
    355405        """ 
    356         """  
     406        """ 
    357407        # wxGlade: DialogAbout.<event_handler> 
    358408        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) 
    359430        event.Skip() 
    360431 
     
    380451    app = MyApp(0) 
    381452    app.MainLoop() 
    382      
    383 ##### end of testing code #####################################################     
     453 
     454##### end of testing code ##################################################### 
Note: See TracChangeset for help on using the changeset viewer.