--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Preferences/ConfigurationPages/IconsPreviewDialog.py Mon Dec 28 16:03:33 2009 +0000 @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2004 - 2009 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)