In playing with direct dial I found I setup the user-agent incorrectly
[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         def set_orientation(self, orientation):
57                 if orientation == gtk.ORIENTATION_VERTICAL:
58                         pass
59                 elif orientation == gtk.ORIENTATION_HORIZONTAL:
60                         pass
61                 else:
62                         raise NotImplementedError(orientation)
63
64
65 class AccountInfo(object):
66
67         def __init__(self, widgetTree):
68                 self._callbackList = gtk.ListStore(gobject.TYPE_STRING)
69                 self._accountViewNumberDisplay = widgetTree.get_widget("gcnumber_display")
70                 self._callbackSelectButton = widgetTree.get_widget("callbackSelectButton")
71                 self._clearCookiesButton = widgetTree.get_widget("clearcookies")
72
73                 self._notifyCheckbox = widgetTree.get_widget("notifyCheckbox")
74                 self._minutesEntryButton = widgetTree.get_widget("minutesEntryButton")
75                 self._missedCheckbox = widgetTree.get_widget("missedCheckbox")
76                 self._voicemailCheckbox = widgetTree.get_widget("voicemailCheckbox")
77                 self._smsCheckbox = widgetTree.get_widget("smsCheckbox")
78
79         def enable(self):
80                 self._callbackSelectButton.set_sensitive(False)
81                 self._clearCookiesButton.set_sensitive(False)
82
83                 self._notifyCheckbox.set_sensitive(False)
84                 self._minutesEntryButton.set_sensitive(False)
85                 self._missedCheckbox.set_sensitive(False)
86                 self._voicemailCheckbox.set_sensitive(False)
87                 self._smsCheckbox.set_sensitive(False)
88
89                 self._accountViewNumberDisplay.set_label("")
90
91         def disable(self):
92                 self._callbackSelectButton.set_sensitive(True)
93                 self._clearCookiesButton.set_sensitive(True)
94
95                 self._notifyCheckbox.set_sensitive(True)
96                 self._minutesEntryButton.set_sensitive(True)
97                 self._missedCheckbox.set_sensitive(True)
98                 self._voicemailCheckbox.set_sensitive(True)
99                 self._smsCheckbox.set_sensitive(True)
100
101         @staticmethod
102         def update(force = False):
103                 return False
104
105         @staticmethod
106         def clear():
107                 pass
108
109         @staticmethod
110         def name():
111                 return "Account Info"
112
113         def load_settings(self, config, sectionName):
114                 pass
115
116         def save_settings(self, config, sectionName):
117                 """
118                 @note Thread Agnostic
119                 """
120                 pass
121
122         def set_orientation(self, orientation):
123                 if orientation == gtk.ORIENTATION_VERTICAL:
124                         pass
125                 elif orientation == gtk.ORIENTATION_HORIZONTAL:
126                         pass
127                 else:
128                         raise NotImplementedError(orientation)
129
130
131 class CallHistoryView(object):
132
133         def __init__(self, widgetTree):
134                 self._historyFilterSelector = widgetTree.get_widget("historyFilterSelector")
135
136         def enable(self):
137                 self._historyFilterSelector.set_sensitive(False)
138
139         def disable(self):
140                 self._historyFilterSelector.set_sensitive(True)
141
142         def update(self, force = False):
143                 return False
144
145         @staticmethod
146         def clear():
147                 pass
148
149         @staticmethod
150         def name():
151                 return "Recent Calls"
152
153         def load_settings(self, config, sectionName):
154                 pass
155
156         def save_settings(self, config, sectionName):
157                 """
158                 @note Thread Agnostic
159                 """
160                 pass
161
162         def set_orientation(self, orientation):
163                 if orientation == gtk.ORIENTATION_VERTICAL:
164                         pass
165                 elif orientation == gtk.ORIENTATION_HORIZONTAL:
166                         pass
167                 else:
168                         raise NotImplementedError(orientation)
169
170
171 class MessagesView(object):
172
173         def __init__(self, widgetTree):
174                 self._messageTypeButton = widgetTree.get_widget("messageTypeButton")
175                 self._messageStatusButton = widgetTree.get_widget("messageStatusButton")
176
177         def enable(self):
178                 self._messageTypeButton.set_sensitive(False)
179                 self._messageStatusButton.set_sensitive(False)
180
181         def disable(self):
182                 self._messageTypeButton.set_sensitive(True)
183                 self._messageStatusButton.set_sensitive(True)
184
185         def update(self, force = False):
186                 return False
187
188         @staticmethod
189         def clear():
190                 pass
191
192         @staticmethod
193         def name():
194                 return "Messages"
195
196         def load_settings(self, config, sectionName):
197                 pass
198
199         def save_settings(self, config, sectionName):
200                 """
201                 @note Thread Agnostic
202                 """
203                 pass
204
205         def set_orientation(self, orientation):
206                 if orientation == gtk.ORIENTATION_VERTICAL:
207                         pass
208                 elif orientation == gtk.ORIENTATION_HORIZONTAL:
209                         pass
210                 else:
211                         raise NotImplementedError(orientation)
212
213
214 class ContactsView(object):
215
216         def __init__(self, widgetTree):
217                 self._bookSelectionButton = widgetTree.get_widget("addressbookSelectButton")
218
219         def enable(self):
220                 self._bookSelectionButton.set_sensitive(False)
221
222         def disable(self):
223                 self._bookSelectionButton.set_sensitive(True)
224
225         def update(self, force = False):
226                 return False
227
228         @staticmethod
229         def clear():
230                 pass
231
232         @staticmethod
233         def name():
234                 return "Contacts"
235
236         def load_settings(self, config, sectionName):
237                 pass
238
239         def save_settings(self, config, sectionName):
240                 """
241                 @note Thread Agnostic
242                 """
243                 pass
244
245         def set_orientation(self, orientation):
246                 if orientation == gtk.ORIENTATION_VERTICAL:
247                         pass
248                 elif orientation == gtk.ORIENTATION_HORIZONTAL:
249                         pass
250                 else:
251                         raise NotImplementedError(orientation)