Exemple #1
0
    def __init__(self, msg='', parent=None):
        """
        @param items:
            The list of items to export.
        @param msg:
            A message to display in the dialog. Might be information
            about problems with fetching all the LDAP entries, etc.
        """
        super(ExportDialog, self).__init__(parent)
        self.setupUi(self)

        self.iconLabel.setPixmap(
            pixmapFromTheme('document-save', ':/icons/64/document-export'))
        self.fileButton.setIcon(
            iconFromTheme('document-open', ':/icons/32/document-open'))
        self.messageLabel.setText(msg)

        self.model = QtGui.QStandardItemModel()
        self.exportItemView.setModel(self.model)
        self.exportItemView.setAlternatingRowColors(True)
        self.exportItemView.setUniformItemSizes(True)
        self.exportDict = {}

        # Disabled until path set
        self.exportButton.setEnabled(False)
        # If the users manually edits the path, we'll trust him
        #self.outputEdit.textEdited.connect(self.enableExport)
        # The signal textEdit is not emitted if the text is changed
        # programmatically, we therefore use textChanged instead.
        self.outputEdit.textChanged['QString'].connect(self.onFilenameChanged)
Exemple #2
0
    def __init__(self, msg='', parent=None):
        """
        @param items:
            The list of items to export.
        @param msg:
            A message to display in the dialog. Might be information
            about problems with fetching all the LDAP entries, etc.
        """
        super(ExportDialog, self).__init__(parent)
        self.setupUi(self)

        self.iconLabel.setPixmap(pixmapFromTheme(
            'document-save', ':/icons/64/document-export'))
        self.fileButton.setIcon(iconFromTheme(
            'document-open', ':/icons/32/document-open'))
        self.messageLabel.setText(msg)

        self.model = QtGui.QStandardItemModel()
        self.exportItemView.setModel(self.model)
        self.exportItemView.setAlternatingRowColors(True)
        self.exportItemView.setUniformItemSizes(True)
        self.exportDict = {}

        # Disabled until path set
        self.exportButton.setEnabled(False)
        # If the users manually edits the path, we'll trust him
        #self.outputEdit.textEdited.connect(self.enableExport)
        # The signal textEdit is not emitted if the text is changed
        # programmatically, we therefore use textChanged instead.
        self.outputEdit.textChanged['QString'].connect(self.onFilenameChanged)
Exemple #3
0
 def data(self, column, role):
     if role == QtCore.Qt.StatusTipRole:
         return QtCore.QCoreApplication.translate("LDAPErrorItem","There was an error receiving this item or it's parent. See the attached error-message and/or the log for details.")
     if role == QtCore.Qt.DecorationRole:
         #return QIcon(QPixmap(":/icons/no"))
         return iconFromTheme('dialog-error', ':/icons/48/dialog-error')
     if not role == QtCore.Qt.DisplayRole:
         return None
     return self.error
Exemple #4
0
 def data(self, column, role):
     if role == QtCore.Qt.StatusTipRole:
         return QtCore.QCoreApplication.translate(
             "LDAPErrorItem",
             "There was an error receiving this item or it's parent. See the attached error-message and/or the log for details."
         )
     if role == QtCore.Qt.DecorationRole:
         #return QIcon(QPixmap(":/icons/no"))
         return iconFromTheme('dialog-error', ':/icons/48/dialog-error')
     if not role == QtCore.Qt.DisplayRole:
         return None
     return self.error
Exemple #5
0
    def __init__(self, parent=None):
        super(SearchPlugin, self).__init__(parent)
        self.setupUi(self)
        self.setObjectName('SearchPlugin')
        self.openTabs = {}
        self.completer = None
        self.currentServer = None
        #self.connection = None
        self.resultSetCount = 0

        self.serverListObject = ServerList()
        self.serverList = self.serverListObject.getTable()

        self.searchForm = SearchForm(parent=self)
        self.filterBuilder = FilterBuilder(parent=self)

        # Icons
        searchIcon = iconFromTheme('edit-find', ':/icons/32/edit-find')
        filterIcon = iconFromTheme('edit-find-replace',
                                   ':/icons/32/edit-find-replace')
        secureIcon = iconFromTheme('object-locked', ':/icons/16/object-locked')
        errorIcon = pixmapFromTheme('dialog-error', ':/icons/48/dialog-error',
                                    24, 24)
        undoIcon = iconFromTheme('edit-undo', ':/icons/32/edit-undo')
        redoIcon = iconFromTheme('edit-redo', ':/icons/32/edit-redo')
        addIcon = iconFromTheme('list-add', ':/icons/32/list-add')

        self.indexSF = self.left.addTab(self.searchForm, searchIcon, '')
        self.indexFB = self.left.addTab(self.filterBuilder, filterIcon, '')

        self.searchForm.filterBuilderToolButton.setIcon(filterIcon)
        self.searchForm.errorIcon.setPixmap(errorIcon)
        self.filterBuilder.undoButton.setIcon(undoIcon)
        self.filterBuilder.redoButton.setIcon(redoIcon)
        self.filterBuilder.addSpecialCharButton.setIcon(addIcon)

        # The search plugin event filter we
        # use for acting upon various events
        eventFilter = SearchPluginEventFilter(self)
        # Install the eventFilter on desired widgets
        self.installEventFilter(eventFilter)
        self.right.installEventFilter(eventFilter)
        self.right.setUsesScrollButtons(True)

        self.__loadSettings()
        self.__connectSlots()

        # Only add text to these class and its children at this time
        self.retranslate(all=False)

        # TODO: maybe we allways want to return a list from ServerList,
        #       eliminating the 'NoneType is not iterable' exceptions.
        if not self.serverList is None:
            for server in self.serverList:
                # As documendted in the ServerObject class:
                # 0 = Unencrypted, 1 = TLS, 2 = SSL
                if server.encryptionMethod == 0:
                    self.searchForm.serverBox.addItem(server.name)
                else:
                    self.searchForm.serverBox.addItem(secureIcon, server.name)
Exemple #6
0
def getIcon():
    return iconFromTheme('luma-template-plugin', ':/icons/plugins/template')
Exemple #7
0
def getIcon():
    return iconFromTheme('luma-browser-plugin', ':/icons/plugins/browser')
Exemple #8
0
def getIcon(iconPath=None):
    return iconFromTheme('luma-search-plugin', ':/icons/plugins/search')
Exemple #9
0
def getIcon(iconPath=None):
    return iconFromTheme('luma-search-plugin', ':/icons/plugins/search')
Exemple #10
0
    def __init__(self, parent=None):
        super(SearchPlugin, self).__init__(parent)
        self.setupUi(self)
        self.setObjectName('SearchPlugin')
        self.openTabs = {}
        self.completer = None
        self.currentServer = None
        #self.connection = None
        self.resultSetCount = 0

        self.serverListObject = ServerList()
        self.serverList = self.serverListObject.getTable()

        self.searchForm = SearchForm(parent=self)
        self.filterBuilder = FilterBuilder(parent=self)

        # Icons
        searchIcon = iconFromTheme(
            'edit-find', ':/icons/32/edit-find')
        filterIcon = iconFromTheme(
            'edit-find-replace', ':/icons/32/edit-find-replace')
        secureIcon = iconFromTheme(
            'object-locked', ':/icons/16/object-locked')
        errorIcon = pixmapFromTheme(
            'dialog-error', ':/icons/48/dialog-error', 24, 24)
        undoIcon = iconFromTheme(
            'edit-undo', ':/icons/32/edit-undo')
        redoIcon = iconFromTheme(
            'edit-redo', ':/icons/32/edit-redo')
        addIcon = iconFromTheme(
            'list-add', ':/icons/32/list-add')

        self.indexSF = self.left.addTab(self.searchForm, searchIcon, '')
        self.indexFB = self.left.addTab(self.filterBuilder, filterIcon, '')

        self.searchForm.filterBuilderToolButton.setIcon(filterIcon)
        self.searchForm.errorIcon.setPixmap(errorIcon)
        self.filterBuilder.undoButton.setIcon(undoIcon)
        self.filterBuilder.redoButton.setIcon(redoIcon)
        self.filterBuilder.addSpecialCharButton.setIcon(addIcon)

        # The search plugin event filter we
        # use for acting upon various events
        eventFilter = SearchPluginEventFilter(self)
        # Install the eventFilter on desired widgets
        self.installEventFilter(eventFilter)
        self.right.installEventFilter(eventFilter)
        self.right.setUsesScrollButtons(True)

        self.__loadSettings()
        self.__connectSlots()

        # Only add text to these class and its children at this time
        self.retranslate(all=False)

        # TODO: maybe we allways want to return a list from ServerList,
        #       eliminating the 'NoneType is not iterable' exceptions.
        if not self.serverList is None:
            for server in self.serverList:
                # As documendted in the ServerObject class:
                # 0 = Unencrypted, 1 = TLS, 2 = SSL
                if server.encryptionMethod == 0:
                    self.searchForm.serverBox.addItem(server.name)
                else:
                    self.searchForm.serverBox.addItem(secureIcon, server.name)
Exemple #11
0
def getIcon():
    return iconFromTheme('luma-browser-plugin', ':/icons/plugins/browser')