1 # -*- coding: utf-8 -*-
3 # (c) Copyright 2003-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
26 from ui_utils import load_pixmap
27 from fax import coverpages
28 from ui_utils import load_pixmap
32 from coverpageform_base import CoverpageForm_base
36 class CoverpageForm(CoverpageForm_base):
37 def __init__(self, cover_page_name='', preserve_formatting=False, parent=None, name=None, modal=0, fl=0):
38 CoverpageForm_base.__init__(self, parent, name, modal, fl)
40 self.preserve_formatting = preserve_formatting
41 self.preserveFormattingCheckBox.setChecked(preserve_formatting)
42 self.prevCoverpageButton.setPixmap(load_pixmap('prev', '16x16'))
43 self.nextCoverpageButton.setPixmap(load_pixmap('next', '16x16'))
44 self.coverpage_list = coverpages.COVERPAGES.keys()
47 self.coverpage_index = self.coverpage_list.index(cover_page_name)
49 self.coverpage_index = 0
54 def setCoverpage(self, inc=0):
55 self.coverpage_index += inc
57 if self.coverpage_index > len(self.coverpage_list) - 1:
58 self.coverpage_index = 0
60 elif self.coverpage_index < 0:
61 self.coverpage_index = len(self.coverpage_list) - 1
63 self.coverpage_name = self.coverpage_list[self.coverpage_index]
64 self.data = coverpages.COVERPAGES[self.coverpage_name]
66 self.coverpagePixmap.setPixmap(load_pixmap(self.data[1], 'other'))
69 def prevCoverpageButton_clicked(self):
73 def nextCoverpageButton_clicked(self):
77 def preserveFormattingCheckBox_toggled(self,a0):
78 self.preserve_formatting = bool(a0)
81 def __tr(self,s,c = None):
82 return qApp.translate("CoverpageForm_base",s,c)