Changeset 1177

Show
Ignore:
Timestamp:
03/05/10 17:14:13 (5 months ago)
Author:
jeroen
Message:

added what's new dialog support

Location:
trunk/camelot/view
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/camelot/view/application_admin.py

    r1135 r1177  
    132132        """:return: the name of the application""" 
    133133        return self.name 
    134  
     134     
     135    def get_version(self): 
     136        """:return: string representing version of the application""" 
     137        return '1.0' 
     138         
    135139    def get_icon(self): 
    136140        """:return: the QIcon that should be used for the application""" 
     
    153157        from PyQt4.QtCore import QUrl 
    154158        return QUrl('http://www.conceptive.be/projects/camelot/') 
    155  
     159     
     160    def get_whats_new(self): 
     161        """:return: a widget that has a show() method """ 
     162        return None 
     163     
    156164    def get_stylesheet(self): 
    157165        """ 
  • trunk/camelot/view/mainwindow.py

    r1109 r1177  
    114114        QtGui.QMessageBox.about(self, _('About'), _(abtmsg)) 
    115115        logger.debug('about message closed') 
    116  
     116     
     117    def whats_new(self): 
     118        widget = self.app_admin.get_whats_new() 
     119        if widget: 
     120            widget.exec_() 
     121     
    117122    def readSettings(self): 
    118123        # TODO: improve settings reading 
     
    254259            slot=self.about, 
    255260            tip=_("Show the application's About box") 
     261        ) 
     262         
     263        self.whats_new_action = createAction( 
     264            parent=self, 
     265            text=_('&What\'s new'), 
     266            slot=self.whats_new, 
     267            tip=_("Show the What's New box") 
    256268        ) 
    257269 
     
    535547 
    536548        self.helpMenu = self.menuBar().addMenu(_('&Help')) 
    537         addActions(self.helpMenu, (self.helpAct, self.aboutAct)) 
     549        if self.app_admin.get_whats_new(): 
     550            addActions(self.helpMenu, (self.helpAct, self.aboutAct, self.whats_new_action)) 
     551        else: 
     552            addActions(self.helpMenu, (self.helpAct, self.aboutAct)) 
    538553 
    539554    def updateMenus(self):