Prepare for release, mention why there is still no Windows version.
[wammu.git] / Wammu / TalkbackFeaturesDialog.py
blob8ff59e225de177e919c1b77cd2290a734f59f9bc
1 # -*- coding: UTF-8 -*-
2 # generated by wxGlade 0.4.1 on Thu Feb 8 16:46:42 2007
3 # vim: expandtab sw=4 ts=4 sts=4:
4 '''
5 Wammu - Phone manager
6 Gammu Phone Database Talkback window
7 '''
8 __author__ = 'Michal Čihař'
9 __email__ = 'michal@cihar.com'
10 __license__ = '''
11 Copyright © 2003 - 2008 Michal Čihař
13 This program is free software; you can redistribute it and/or modify it
14 under the terms of the GNU General Public License version 2 as published by
15 the Free Software Foundation.
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
20 more details.
22 You should have received a copy of the GNU General Public License along with
23 this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 '''
27 import wx
29 # begin wxGlade: dependencies
30 # end wxGlade
32 class TalkbackFeaturesDialog(wx.Dialog):
33 def __init__(self, *args, **kwds):
34 # begin wxGlade: TalkbackFeaturesDialog.__init__
35 kwds["style"] = wx.DEFAULT_DIALOG_STYLE
36 wx.Dialog.__init__(self, *args, **kwds)
37 self.top_label = wx.StaticText(self, -1, _("Select which functionality works without problems on your phone (either in Wammu or in some other tool using Gammu library)."))
38 self.top_static_line = wx.StaticLine(self, -1)
39 self.feature_info_checkbox = wx.CheckBox(self, -1, _("Phone information"))
40 self.feature_sms_checkbox = wx.CheckBox(self, -1, _("Sending and saving SMS"))
41 self.feature_mms_checkbox = wx.CheckBox(self, -1, _("Multimedia messaging"))
42 self.feature_phonebook_checkbox = wx.CheckBox(self, -1, _("Basic phonebook functions"))
43 self.feature_enhancedphonebook_checkbox = wx.CheckBox(self, -1, _("Enhanced phonebook entries"))
44 self.feature_calendar_checkbox = wx.CheckBox(self, -1, _("Calendar entries"))
45 self.feature_todo_checkbox = wx.CheckBox(self, -1, _("Todos"))
46 self.feature_filesystem_checkbox = wx.CheckBox(self, -1, _("Filesystem manipulation"))
47 self.feature_call_checkbox = wx.CheckBox(self, -1, _("Reading and making calls"))
48 self.feature_logo_checkbox = wx.CheckBox(self, -1, _("Logos"))
49 self.feature_ringtone_checkbox = wx.CheckBox(self, -1, _("Ringtones"))
50 self.bottom_static_line = wx.StaticLine(self, -1)
52 self.__set_properties()
53 self.__do_layout()
54 # end wxGlade
55 # List of features
56 self.__allfeatures = ['info', 'sms', 'mms', 'phonebook', 'enhancedphonebook', 'calendar', 'todo', 'filesystem', 'call', 'logo', 'ringtone']
58 def __set_properties(self):
59 # begin wxGlade: TalkbackFeaturesDialog.__set_properties
60 self.SetTitle(_("Select features"))
61 self.feature_phonebook_checkbox.SetToolTipString(_("You can access name and phone number."))
62 self.feature_enhancedphonebook_checkbox.SetToolTipString(_("You have access to more phone numbers per entry or additional fields as email."))
63 # end wxGlade
65 def __do_layout(self):
66 self.button_sizer = wx.StdDialogButtonSizer()
67 self.button_sizer.AddButton(wx.Button(self, wx.ID_OK))
68 self.button_sizer.AddButton(wx.Button(self, wx.ID_CANCEL))
69 self.top_label.Wrap(400)
70 # begin wxGlade: TalkbackFeaturesDialog.__do_layout
71 window_grid_sizer = wx.FlexGridSizer(3, 1, 0, 0)
72 features_sizer = wx.BoxSizer(wx.VERTICAL)
73 window_grid_sizer.Add(self.top_label, 0, wx.EXPAND, 0)
74 window_grid_sizer.Add(self.top_static_line, 0, wx.ALL|wx.EXPAND, 5)
75 features_sizer.Add(self.feature_info_checkbox, 0, wx.ADJUST_MINSIZE, 0)
76 features_sizer.Add(self.feature_sms_checkbox, 0, wx.ADJUST_MINSIZE, 0)
77 features_sizer.Add(self.feature_mms_checkbox, 0, wx.ADJUST_MINSIZE, 0)
78 features_sizer.Add(self.feature_phonebook_checkbox, 0, wx.ADJUST_MINSIZE, 0)
79 features_sizer.Add(self.feature_enhancedphonebook_checkbox, 0, wx.ADJUST_MINSIZE, 0)
80 features_sizer.Add(self.feature_calendar_checkbox, 0, wx.ADJUST_MINSIZE, 0)
81 features_sizer.Add(self.feature_todo_checkbox, 0, wx.ADJUST_MINSIZE, 0)
82 features_sizer.Add(self.feature_filesystem_checkbox, 0, wx.ADJUST_MINSIZE, 0)
83 features_sizer.Add(self.feature_call_checkbox, 0, wx.ADJUST_MINSIZE, 0)
84 features_sizer.Add(self.feature_logo_checkbox, 0, wx.ADJUST_MINSIZE, 0)
85 features_sizer.Add(self.feature_ringtone_checkbox, 0, wx.ADJUST_MINSIZE, 0)
86 window_grid_sizer.Add(features_sizer, 1, wx.EXPAND, 0)
87 window_grid_sizer.Add(self.bottom_static_line, 0, wx.ALL|wx.EXPAND, 5)
88 self.SetAutoLayout(True)
89 self.SetSizer(window_grid_sizer)
90 window_grid_sizer.Fit(self)
91 window_grid_sizer.SetSizeHints(self)
92 window_grid_sizer.AddGrowableRow(1)
93 window_grid_sizer.AddGrowableCol(0)
94 self.Layout()
95 # end wxGlade
96 self.button_sizer.Realize()
97 window_grid_sizer.Add(self.button_sizer, 0, wx.ALIGN_RIGHT, 0)
98 window_grid_sizer.Fit(self)
99 self.Layout()
101 def GetFeatures(self):
102 result = []
103 for x in self.__allfeatures:
104 if getattr(self, 'feature_%s_checkbox' % x).GetValue():
105 result.append(x)
106 return result
108 def SetFeatures(self, list):
109 for x in self.__allfeatures:
110 getattr(self, 'feature_%s_checkbox' % x).SetValue(False)
111 for x in list:
112 getattr(self, 'feature_%s_checkbox' % x).SetValue(True)
114 # end of class TalkbackFeaturesDialog