eric6/Preferences/ConfigurationPages/WebBrowserFlashCookieManagerPage.py

Mon, 02 Sep 2019 18:51:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 02 Sep 2019 18:51:38 +0200
branch
without_py2_and_pyqt4
changeset 7202
d2f2a1fe0129
parent 7196
ab0a91b82b37
child 7206
74666c6679af
permissions
-rw-r--r--

Modified sources to be in line with the minimum QScintilla requirement (v 2.9.0).

# -*- coding: utf-8 -*-

# Copyright (c) 2015 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the Flash Cookies Manager configuration page.
"""

from __future__ import unicode_literals

from E5Gui.E5PathPicker import E5PathPickerModes

from .ConfigurationPageBase import ConfigurationPageBase
from .Ui_WebBrowserFlashCookieManagerPage import \
    Ui_WebBrowserFlashCookieManagerPage

import Preferences


class WebBrowserFlashCookieManagerPage(ConfigurationPageBase,
                                       Ui_WebBrowserFlashCookieManagerPage):
    """
    Class implementing the Flash Cookies Manager configuration page.
    """
    def __init__(self):
        """
        Constructor
        """
        super(WebBrowserFlashCookieManagerPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("WebBrowserFlashCookieManagerPage")
        
        self.flashDataPathPicker.setMode(E5PathPickerModes.DirectoryMode)
        
        # set initial values
        self.flashDataPathPicker.setText(
            Preferences.getWebBrowser("FlashCookiesDataPath"))
        self.autoModeGroup.setChecked(
            Preferences.getWebBrowser("FlashCookieAutoRefresh"))
        self.notificationGroup.setChecked(
            Preferences.getWebBrowser("FlashCookieNotify"))
        self.deleteGroup.setChecked(
            Preferences.getWebBrowser("FlashCookiesDeleteOnStartExit"))
    
    def save(self):
        """
        Public slot to save the Flash Cookies Manager configuration.
        """
        Preferences.setWebBrowser("FlashCookiesDataPath",
                            self.flashDataPathPicker.text())
        Preferences.setWebBrowser("FlashCookieAutoRefresh",
                            self.autoModeGroup.isChecked())
        Preferences.setWebBrowser("FlashCookieNotify",
                            self.notificationGroup.isChecked())
        Preferences.setWebBrowser("FlashCookiesDeleteOnStartExit",
                            self.deleteGroup.isChecked())
    

def create(dlg):
    """
    Module function to create the configuration page.
    
    @param dlg reference to the configuration dialog
    @return reference to the instantiated page (ConfigurationPageBase)
    """
    page = WebBrowserFlashCookieManagerPage()
    return page

eric ide

mercurial