Adding turning off the led on initial tab load
[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._numberdisplay = widgetTree.get_widget("numberdisplay")
30                 self._dialButton = widgetTree.get_widget("dial")
31
32         def enable(self):
33                 self._dialButton.set_sensitive(False)
34
35         def disable(self):
36                 self._dialButton.set_sensitive(True)
37
38         @staticmethod
39         def name():
40                 return "Dialpad"
41
42         def load_settings(self, config, sectionName):
43                 pass
44
45         def save_settings(self, config, sectionName):
46                 """
47                 @note Thread Agnostic
48                 """
49                 pass
50
51
52 class AccountInfo(object):
53
54         def __init__(self, widgetTree):
55                 self._callbackList = gtk.ListStore(gobject.TYPE_STRING)
56                 self._accountViewNumberDisplay = widgetTree.get_widget("gcnumber_display")
57                 self._callbackCombo = widgetTree.get_widget("callbackcombo")
58                 self._clearCookiesButton = widgetTree.get_widget("clearcookies")
59
60                 self._notifyCheckbox = widgetTree.get_widget("notifyCheckbox")
61                 self._minutesEntry = widgetTree.get_widget("minutesEntry")
62                 self._missedCheckbox = widgetTree.get_widget("missedCheckbox")
63                 self._voicemailCheckbox = widgetTree.get_widget("voicemailCheckbox")
64                 self._smsCheckbox = widgetTree.get_widget("smsCheckbox")
65
66         def enable(self):
67                 self._callbackCombo.set_sensitive(False)
68                 self._clearCookiesButton.set_sensitive(False)
69
70                 self._notifyCheckbox.set_sensitive(False)
71                 self._minutesEntry.set_sensitive(False)
72                 self._missedCheckbox.set_sensitive(False)
73                 self._voicemailCheckbox.set_sensitive(False)
74                 self._smsCheckbox.set_sensitive(False)
75
76                 self._accountViewNumberDisplay.set_text("")
77
78         def disable(self):
79                 self._callbackCombo.set_sensitive(True)
80                 self._clearCookiesButton.set_sensitive(True)
81
82                 self._notifyCheckbox.set_sensitive(True)
83                 self._minutesEntry.set_sensitive(True)
84                 self._missedCheckbox.set_sensitive(True)
85                 self._voicemailCheckbox.set_sensitive(True)
86                 self._smsCheckbox.set_sensitive(True)
87
88         @staticmethod
89         def update():
90                 return False
91
92         @staticmethod
93         def clear():
94                 pass
95
96         @staticmethod
97         def name():
98                 return "Account Info"
99
100         def load_settings(self, config, sectionName):
101                 pass
102
103         def save_settings(self, config, sectionName):
104                 """
105                 @note Thread Agnostic
106                 """
107                 pass
108
109
110 class RecentCallsView(object):
111
112         def __init__(self, widgetTree):
113                 pass
114
115         def enable(self):
116                 pass
117
118         def disable(self):
119                 pass
120
121         def update(self):
122                 return False
123
124         @staticmethod
125         def clear():
126                 pass
127
128         @staticmethod
129         def name():
130                 return "Recent Calls"
131
132         def load_settings(self, config, sectionName):
133                 pass
134
135         def save_settings(self, config, sectionName):
136                 """
137                 @note Thread Agnostic
138                 """
139                 pass
140
141
142 class MessagesView(object):
143
144         def __init__(self, widgetTree):
145                 pass
146
147         def enable(self):
148                 pass
149
150         def disable(self):
151                 pass
152
153         def update(self):
154                 return False
155
156         @staticmethod
157         def clear():
158                 pass
159
160         @staticmethod
161         def name():
162                 return "Messages"
163
164         def load_settings(self, config, sectionName):
165                 pass
166
167         def save_settings(self, config, sectionName):
168                 """
169                 @note Thread Agnostic
170                 """
171                 pass
172
173
174 class ContactsView(object):
175
176         def __init__(self, widgetTree):
177                 self._booksSelectionBox = widgetTree.get_widget("addressbook_combo")
178
179         def enable(self):
180                 self._booksSelectionBox.set_sensitive(False)
181
182         def disable(self):
183                 self._booksSelectionBox.set_sensitive(True)
184
185         def update(self):
186                 return False
187
188         @staticmethod
189         def clear():
190                 pass
191
192         @staticmethod
193         def name():
194                 return "Contacts"
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