Adding back in separate call and sms buttons
[gc-dialer] / src / null_views.py
1 #!/usr/bin/python2.5
2
3 """
4 DialCentral - Front end for Google's Grand Central service.
5 Copyright (C) 2008  Mark Bergman bergman AT merctech DOT com
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 """
21
22 import gobject
23 import gtk
24
25
26 class Dialpad(object):
27
28         def __init__(self, widgetTree):
29                 self._buttons = [
30                         widgetTree.get_widget(buttonName)
31                         for buttonName in ("dialpadCall", "dialpadSMS")
32                 ]
33                 self._numberdisplay = widgetTree.get_widget("numberdisplay")
34
35         def enable(self):
36                 for button in self._buttons:
37                         button.set_sensitive(False)
38
39         def disable(self):
40                 for button in self._buttons:
41                         button.set_sensitive(True)
42
43         @staticmethod
44         def name():
45                 return "Dialpad"
46
47         def load_settings(self, config, sectionName):
48                 pass
49
50         def save_settings(self, config, sectionName):
51                 """
52                 @note Thread Agnostic
53                 """
54                 pass
55
56
57 class AccountInfo(object):
58
59         def __init__(self, widgetTree):
60                 self._callbackList = gtk.ListStore(gobject.TYPE_STRING)
61                 self._accountViewNumberDisplay = widgetTree.get_widget("gcnumber_display")
62                 self._callbackSelectButton = widgetTree.get_widget("callbackSelectButton")
63                 self._clearCookiesButton = widgetTree.get_widget("clearcookies")
64
65                 self._notifyCheckbox = widgetTree.get_widget("notifyCheckbox")
66                 self._minutesEntryButton = widgetTree.get_widget("minutesEntryButton")
67                 self._missedCheckbox = widgetTree.get_widget("missedCheckbox")
68                 self._voicemailCheckbox = widgetTree.get_widget("voicemailCheckbox")
69                 self._smsCheckbox = widgetTree.get_widget("smsCheckbox")
70
71         def enable(self):
72                 self._callbackSelectButton.set_sensitive(False)
73                 self._clearCookiesButton.set_sensitive(False)
74
75                 self._notifyCheckbox.set_sensitive(False)
76                 self._minutesEntryButton.set_sensitive(False)
77                 self._missedCheckbox.set_sensitive(False)
78                 self._voicemailCheckbox.set_sensitive(False)
79                 self._smsCheckbox.set_sensitive(False)
80
81                 self._accountViewNumberDisplay.set_label("")
82
83         def disable(self):
84                 self._callbackSelectButton.set_sensitive(True)
85                 self._clearCookiesButton.set_sensitive(True)
86
87                 self._notifyCheckbox.set_sensitive(True)
88                 self._minutesEntryButton.set_sensitive(True)
89                 self._missedCheckbox.set_sensitive(True)
90                 self._voicemailCheckbox.set_sensitive(True)
91                 self._smsCheckbox.set_sensitive(True)
92
93         @staticmethod
94         def update(force = False):
95                 return False
96
97         @staticmethod
98         def clear():
99                 pass
100
101         @staticmethod
102         def name():
103                 return "Account Info"
104
105         def load_settings(self, config, sectionName):
106                 pass
107
108         def save_settings(self, config, sectionName):
109                 """
110                 @note Thread Agnostic
111                 """
112                 pass
113
114
115 class CallHistoryView(object):
116
117         def __init__(self, widgetTree):
118                 self._historyFilterSelector = widgetTree.get_widget("historyFilterSelector")
119
120         def enable(self):
121                 self._historyFilterSelector.set_sensitive(False)
122
123         def disable(self):
124                 self._historyFilterSelector.set_sensitive(True)
125
126         def update(self, force = False):
127                 return False
128
129         @staticmethod
130         def clear():
131                 pass
132
133         @staticmethod
134         def name():
135                 return "Recent Calls"
136
137         def load_settings(self, config, sectionName):
138                 pass
139
140         def save_settings(self, config, sectionName):
141                 """
142                 @note Thread Agnostic
143                 """
144                 pass
145
146
147 class MessagesView(object):
148
149         def __init__(self, widgetTree):
150                 self._messageTypeButton = widgetTree.get_widget("messageTypeButton")
151                 self._messageStatusButton = widgetTree.get_widget("messageStatusButton")
152
153         def enable(self):
154                 self._messageTypeButton.set_sensitive(False)
155                 self._messageStatusButton.set_sensitive(False)
156
157         def disable(self):
158                 self._messageTypeButton.set_sensitive(True)
159                 self._messageStatusButton.set_sensitive(True)
160
161         def update(self, force = False):
162                 return False
163
164         @staticmethod
165         def clear():
166                 pass
167
168         @staticmethod
169         def name():
170                 return "Messages"
171
172         def load_settings(self, config, sectionName):
173                 pass
174
175         def save_settings(self, config, sectionName):
176                 """
177                 @note Thread Agnostic
178                 """
179                 pass
180
181
182 class ContactsView(object):
183
184         def __init__(self, widgetTree):
185                 self._bookSelectionButton = widgetTree.get_widget("addressbookSelectButton")
186
187         def enable(self):
188                 self._bookSelectionButton.set_sensitive(False)
189
190         def disable(self):
191                 self._bookSelectionButton.set_sensitive(True)
192
193         def update(self, force = False):
194                 return False
195
196         @staticmethod
197         def clear():
198                 pass
199
200         @staticmethod
201         def name():
202                 return "Contacts"
203
204         def load_settings(self, config, sectionName):
205                 pass
206
207         def save_settings(self, config, sectionName):
208                 """
209                 @note Thread Agnostic
210                 """
211                 pass