Beispiel #1
0
class ZApplicationPreferencesDialog(ZPreferencesDialog, ZPersistentPrefsDialogMixin):

    def __init__(self, parent, jumpToPageId = None):
        self.model = ZPreferencesModel()
        
        ZPreferencesDialog.__init__(self, parent, jumpToPageId)
        ZPersistentPrefsDialogMixin.__init__(self, IZAppUserPrefsKeys.USERPREFS_DIALOG, False)
    # end __init__()

    def _getHeaderTitle(self):
        if self.currentSelection is None:
            return _extstr(u"prefsdialog.ZoundryRavenSettings") #$NON-NLS-1$
        else:
            return self.currentSelection.getName()
    # end _getHeaderTitle()

    def _getHeaderMessage(self):
        if self.currentSelection is None:
            return _extstr(u"prefsdialog.SettingsDialogMessage") #$NON-NLS-1$
        else:
            return self.currentSelection.getDescription()
    # end _getHeaderMessage()

    def _getHeaderImagePath(self):
        if self.currentSelection is None:
            return u"images/userprefs/preferences.png" #$NON-NLS-1$
        else:
            return self.currentSelection.getHeaderImagePath()
    # end _getHeaderImagePath()

    def _getHeaderHelpURL(self):
        return u"http://www.zoundry.com" #$NON-NLS-1$
    # end _getHeaderHelpUrl()

    def _resolveNodeId(self, treeNode):
        return treeNode.getId()
    # end _resolveNodeId()

    def _getDefaultPageId(self):
        userPrefs = getApplicationModel().getUserProfile().getPreferences()
        return userPrefs.getUserPreference(IZAppUserPrefsKeys.USERPREFS_DIALOG + u".page-id", None) #$NON-NLS-1$
    # end _getDefaultPageId()

    def _getDialogTitle(self):
        return _extstr(u"prefsdialog.SettingsDialogTitle") #$NON-NLS-1$
    # end _getDialogTitle()
    
    def _createTreeProvider(self):
        return ZTreeNodeBasedContentProvider(self.model.getRootNode(), self.model.getImageList())
    # end _createTreeProvider()
    
    def _createPrefPage(self, parent, currentSelection):
        pageClass = self._getPrefPageClass(currentSelection)
        return pageClass(parent)
    # end _createPrefPage()

    def _getPrefPageClass(self, selectedNode):
        return selectedNode.getPreferencePageClass()
Beispiel #2
0
 def __init__(self, parent, jumpToPageId = None):
     self.model = ZPreferencesModel()
     
     ZPreferencesDialog.__init__(self, parent, jumpToPageId)
     ZPersistentPrefsDialogMixin.__init__(self, IZAppUserPrefsKeys.USERPREFS_DIALOG, False)
Beispiel #3
0
    def __init__(self, parent, jumpToPageId=None):
        self.model = ZPreferencesModel()

        ZPreferencesDialog.__init__(self, parent, jumpToPageId)
        ZPersistentPrefsDialogMixin.__init__(
            self, IZAppUserPrefsKeys.USERPREFS_DIALOG, False)
Beispiel #4
0
class ZApplicationPreferencesDialog(ZPreferencesDialog,
                                    ZPersistentPrefsDialogMixin):
    def __init__(self, parent, jumpToPageId=None):
        self.model = ZPreferencesModel()

        ZPreferencesDialog.__init__(self, parent, jumpToPageId)
        ZPersistentPrefsDialogMixin.__init__(
            self, IZAppUserPrefsKeys.USERPREFS_DIALOG, False)

    # end __init__()

    def _getHeaderTitle(self):
        if self.currentSelection is None:
            return _extstr(u"prefsdialog.ZoundryRavenSettings")  #$NON-NLS-1$
        else:
            return self.currentSelection.getName()

    # end _getHeaderTitle()

    def _getHeaderMessage(self):
        if self.currentSelection is None:
            return _extstr(u"prefsdialog.SettingsDialogMessage")  #$NON-NLS-1$
        else:
            return self.currentSelection.getDescription()

    # end _getHeaderMessage()

    def _getHeaderImagePath(self):
        if self.currentSelection is None:
            return u"images/userprefs/preferences.png"  #$NON-NLS-1$
        else:
            return self.currentSelection.getHeaderImagePath()

    # end _getHeaderImagePath()

    def _getHeaderHelpURL(self):
        return u"http://www.zoundry.com"  #$NON-NLS-1$

    # end _getHeaderHelpUrl()

    def _resolveNodeId(self, treeNode):
        return treeNode.getId()

    # end _resolveNodeId()

    def _getDefaultPageId(self):
        userPrefs = getApplicationModel().getUserProfile().getPreferences()
        return userPrefs.getUserPreference(
            IZAppUserPrefsKeys.USERPREFS_DIALOG + u".page-id",
            None)  #$NON-NLS-1$

    # end _getDefaultPageId()

    def _getDialogTitle(self):
        return _extstr(u"prefsdialog.SettingsDialogTitle")  #$NON-NLS-1$

    # end _getDialogTitle()

    def _createTreeProvider(self):
        return ZTreeNodeBasedContentProvider(self.model.getRootNode(),
                                             self.model.getImageList())

    # end _createTreeProvider()

    def _createPrefPage(self, parent, currentSelection):
        pageClass = self._getPrefPageClass(currentSelection)
        return pageClass(parent)

    # end _createPrefPage()

    def _getPrefPageClass(self, selectedNode):
        return selectedNode.getPreferencePageClass()