Preferences/ConfigurationPages/IconsPreviewDialog.py

Tue, 13 Jul 2010 19:14:58 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 13 Jul 2010 19:14:58 +0200
branch
5_0_x
changeset 389
1a8c8424d2b3
parent 13
1af94a91f439
child 791
9ec2ac20e54e
permissions
-rw-r--r--

Fixed an issue with the Email config page.

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

# Copyright (c) 2004 - 2010 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)
        """
        QDialog.__init__(self, 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