Preferences/ConfigurationPages/IconsPreviewDialog.py

Mon, 26 Dec 2011 19:31:22 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 26 Dec 2011 19:31:22 +0100
changeset 1509
c0b5e693b0eb
parent 1131
7781e396c903
child 2302
f29e9405c851
permissions
-rw-r--r--

Updated copyright for 2012.

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

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

"""
Module implementing a dialog to preview the contents of an icon directory.
"""

import os.path

from PyQt4.QtGui import QListWidgetItem, QDialog, QIcon
from PyQt4.QtCore import QDir

from .Ui_IconsPreviewDialog import Ui_IconsPreviewDialog


class IconsPreviewDialog(QDialog, Ui_IconsPreviewDialog):
    """
    Class implementing a dialog to preview the contents of an icon directory.
    """
    def __init__(self, parent, dirName):
        """
        Constructor
        
        @param parent parent widget (QWidget)
        @param dirName name of directory to show (string)
        """
        super().__init__(parent)
        self.setupUi(self)
        
        dir = QDir(dirName)
        for icon in dir.entryList(["*.png"]):
            QListWidgetItem(QIcon(os.path.join(dirName, icon)),
                icon, self.iconView)

eric ide

mercurial