2 # -*- coding: UTF-8 -*-
5 # graphical user interface for pdf2swf
7 # Part of the swftools package.
9 # Copyright (c) 2008,2009 Matthias Kramm <kramm@quiss.org>
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
25 from __future__ import division
29 from wx.lib.wordwrap import wordwrap
31 from gui.options import Quality, ViewerBook
34 class ProgressDialog(wx.ProgressDialog):
35 def __init__(self, title, message, maximum=100, parent=None,
36 style=wx.PD_AUTO_HIDE|wx.PD_APP_MODAL):
37 wx.ProgressDialog.__init__(self, title, message, maximum=maximum,
38 parent=parent, style=style)
40 class OptionsDialog(wx.Dialog):
41 def __init__(self, parent):
42 wx.Dialog.__init__(self, parent)
44 app_name = wx.GetApp().GetAppName()
45 self.SetTitle(u"%s options" % app_name)
48 self.__quality = Quality(p)
49 self.__viewers = ViewerBook(p)
50 p.AddPage(self.__quality, u"Quality")
51 p.AddPage(self.__viewers, u"Viewer")
53 sizer = wx.BoxSizer(wx.VERTICAL)
54 btnsizer = wx.BoxSizer(wx.HORIZONTAL)
56 btn = wx.Button(self, wx.ID_CLOSE)
57 self.SetAffirmativeId(wx.ID_CLOSE)
60 sizer.Add(p, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
61 sizer.Add(btnsizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
66 def __get_quality(self):
68 quality_panel = property(__get_quality)
70 def __get_viewers(self):
72 viewers_panel = property(__get_viewers)
74 def __get_quality_options(self):
75 return self.__quality.options
76 quality = property(__get_quality_options)
78 def __get_viewers_options(self):
79 return self.__viewers.options
80 viewers = property(__get_viewers_options)
84 def __init__(self, parent):
85 info = wx.AboutDialogInfo()
86 # no need to get app name
87 #info.Name = wx.GetApp().GetAppName()
88 info.Version = u"0.9.0"
89 info.Copyright = (u"Copyright (c) 2008,2009 "
90 u"Matthias Kramm <kramm@quiss.org>")
91 info.Description = u"graphical user interface for pdf2swf"
93 u"Matthias Kramm <kramm@quiss.org>",
94 u"Ricardo Pedroso <rmdpedroso@gmail.com>",
97 if 'wxGTK' in wx.PlatformInfo:
98 info.WebSite = (u"http://www.swftools.org/", u"swftools home page")
100 u"%(name)s is free software; you can redistribute "
101 u"it and/or modify it under the terms of the GNU General "
102 u"Public License as published by the Free Software "
103 u"Foundation; either version 2 of the License, or (at "
104 u"your option) any later version."
107 u"%(name)s is distributed in the hope that it will "
108 u"be useful, but WITHOUT ANY WARRANTY; without even the "
109 u"implied warranty of MERCHANTABILITY or FITNESS FOR A "
110 u"PARTICULAR PURPOSE. See the GNU General Public License "
114 u"You should have received a copy of the GNU General "
115 u"Public License along with %(name)s; if not, "
116 u"write to the Free Software Foundation, Inc., 51 "
117 u"Franklin St, Fifth Floor, Boston, MA 02110-1301 USA"
119 lic = (os.linesep*2).join(licenseText) % {'name': info.Name}
120 info.License = wordwrap(lic, 350, wx.ClientDC(parent))