1 # -*- coding: utf-8 -*-
3 # (c) Copyright 2001-2008 Hewlett-Packard Development Company, L.P.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 from base.codes import *
25 from ui_utils import *
28 from PyQt4.QtCore import *
29 from PyQt4.QtGui import *
30 from mimetypesdialog_base import Ui_MimeTypesDialog_base
34 class MimeTypesDialog(QDialog, Ui_MimeTypesDialog_base):
35 def __init__(self, mime_types, parent=None):
36 QDialog.__init__(self, parent)
39 self.TypesTableWidget.setRowCount(len(mime_types))
42 for row, m in enumerate(t):
43 i = QTableWidgetItem(m)
44 self.TypesTableWidget.setItem(row, 0, i)
46 i = QTableWidgetItem(mime_types[m][0])
47 self.TypesTableWidget.setItem(row, 1, i)
49 i = QTableWidgetItem(mime_types[m][1])
50 self.TypesTableWidget.setItem(row, 2, i)
52 self.TypesTableWidget.resizeColumnsToContents()
55 def __tr(self,s,c = None):
56 return qApp.translate("SettingsDialog",s,c)