<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Thu Aug 7 21:12:53 2008 -->
+<!--Generated with glade3 3.4.5 on Sat Aug 9 10:42:47 2008 -->
<glade-interface>
<widget class="GtkWindow" id="Dialpad">
<property name="width_request">400</property>
<signal name="activate" handler="on_clear_number"/>
</widget>
</child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="settings_menu_item">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">gtk-preferences</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="on_settings"/>
+ </widget>
+ </child>
</widget>
</child>
</widget>
<property name="n_columns">3</property>
<property name="homogeneous">True</property>
<child>
- <widget class="GtkButton" id="dial">
+ <widget class="GtkButton" id="digit1">
<property name="visible">True</property>
- <property name="has_default">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_dial_clicked"/>
- <accelerator key="Return" modifiers="" signal="clicked"/>
+ <signal name="clicked" handler="on_digit_clicked"/>
+ <accelerator key="1" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <widget class="GtkLabel" id="label12">
<property name="visible">True</property>
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="stock">gtk-yes</property>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes"><span size="17000" weight="bold">Dial</span></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes"><span size="33000" weight="bold">1</span>
+<span size="9000"> </span></property>
+ <property name="use_markup">True</property>
</widget>
</child>
</widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
</child>
<child>
- <widget class="GtkButton" id="digit0">
+ <widget class="GtkButton" id="digit2">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="0" modifiers="" signal="clicked"/>
+ <accelerator key="2" modifiers="" signal="clicked"/>
+ <accelerator key="a" modifiers="" signal="clicked"/>
+ <accelerator key="b" modifiers="" signal="clicked"/>
+ <accelerator key="c" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label19">
+ <widget class="GtkLabel" id="label10">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="33000" weight="bold">0</span>
-<span size="9000"></span></property>
+ <property name="label" translatable="yes"><span size="30000" weight="bold">2</span>
+<span size="12000">ABC</span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="back">
- <property name="visible">True</property>
- <property name="focus_on_click">False</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="on_back_clicked"/>
- <accelerator key="BackSpace" modifiers="" signal="clicked"/>
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <child>
- <widget class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="stock">gtk-no</property>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes"><span size="17000" weight="Bold">Back</span></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="digit9">
+ <widget class="GtkButton" id="digit3">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="z" modifiers="" signal="clicked"/>
- <accelerator key="y" modifiers="" signal="clicked"/>
- <accelerator key="x" modifiers="" signal="clicked"/>
- <accelerator key="w" modifiers="" signal="clicked"/>
- <accelerator key="9" modifiers="" signal="clicked"/>
+ <accelerator key="3" modifiers="" signal="clicked"/>
+ <accelerator key="d" modifiers="" signal="clicked"/>
+ <accelerator key="e" modifiers="" signal="clicked"/>
+ <accelerator key="f" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label18">
+ <widget class="GtkLabel" id="label11">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="30000" weight="bold">9</span>
-<span size="12000">WXYZ</span></property>
+ <property name="label" translatable="yes"><span size="30000" weight="bold" stretch="ultraexpanded">3</span>
+<span size="12000">DEF</span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="digit8">
+ <widget class="GtkButton" id="digit4">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="v" modifiers="" signal="clicked"/>
- <accelerator key="u" modifiers="" signal="clicked"/>
- <accelerator key="t" modifiers="" signal="clicked"/>
- <accelerator key="8" modifiers="" signal="clicked"/>
+ <accelerator key="4" modifiers="" signal="clicked"/>
+ <accelerator key="g" modifiers="" signal="clicked"/>
+ <accelerator key="h" modifiers="" signal="clicked"/>
+ <accelerator key="i" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label17">
+ <widget class="GtkLabel" id="label13">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="30000" weight="bold">8</span>
-<span size="12000">TUV</span></property>
+ <property name="label" translatable="yes"><span size="30000" weight="bold">4</span>
+<span size="12000">GHI</span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
</child>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="digit7">
+ <widget class="GtkButton" id="digit5">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="s" modifiers="" signal="clicked"/>
- <accelerator key="r" modifiers="" signal="clicked"/>
- <accelerator key="q" modifiers="" signal="clicked"/>
- <accelerator key="p" modifiers="" signal="clicked"/>
- <accelerator key="7" modifiers="" signal="clicked"/>
+ <accelerator key="5" modifiers="" signal="clicked"/>
+ <accelerator key="j" modifiers="" signal="clicked"/>
+ <accelerator key="k" modifiers="" signal="clicked"/>
+ <accelerator key="l" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label16">
+ <widget class="GtkLabel" id="label14">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="30000" weight="bold">7</span>
-<span size="12000">PQRS</span></property>
+ <property name="label" translatable="yes"><span size="30000" weight="bold">5</span>
+<span size="12000">JKL</span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
</child>
</widget>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
</packing>
</child>
<child>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="o" modifiers="" signal="clicked"/>
- <accelerator key="n" modifiers="" signal="clicked"/>
- <accelerator key="m" modifiers="" signal="clicked"/>
<accelerator key="6" modifiers="" signal="clicked"/>
+ <accelerator key="m" modifiers="" signal="clicked"/>
+ <accelerator key="n" modifiers="" signal="clicked"/>
+ <accelerator key="o" modifiers="" signal="clicked"/>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="digit5">
+ <widget class="GtkButton" id="digit7">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="l" modifiers="" signal="clicked"/>
- <accelerator key="k" modifiers="" signal="clicked"/>
- <accelerator key="j" modifiers="" signal="clicked"/>
- <accelerator key="5" modifiers="" signal="clicked"/>
+ <accelerator key="7" modifiers="" signal="clicked"/>
+ <accelerator key="p" modifiers="" signal="clicked"/>
+ <accelerator key="q" modifiers="" signal="clicked"/>
+ <accelerator key="r" modifiers="" signal="clicked"/>
+ <accelerator key="s" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label14">
+ <widget class="GtkLabel" id="label16">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="30000" weight="bold">5</span>
-<span size="12000">JKL</span></property>
+ <property name="label" translatable="yes"><span size="30000" weight="bold">7</span>
+<span size="12000">PQRS</span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
</child>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="digit4">
+ <widget class="GtkButton" id="digit8">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="i" modifiers="" signal="clicked"/>
- <accelerator key="h" modifiers="" signal="clicked"/>
- <accelerator key="g" modifiers="" signal="clicked"/>
- <accelerator key="4" modifiers="" signal="clicked"/>
+ <accelerator key="8" modifiers="" signal="clicked"/>
+ <accelerator key="t" modifiers="" signal="clicked"/>
+ <accelerator key="u" modifiers="" signal="clicked"/>
+ <accelerator key="v" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label13">
+ <widget class="GtkLabel" id="label17">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="30000" weight="bold">4</span>
-<span size="12000">GHI</span></property>
+ <property name="label" translatable="yes"><span size="30000" weight="bold">8</span>
+<span size="12000">TUV</span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
</child>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="digit3">
+ <widget class="GtkButton" id="digit9">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="f" modifiers="" signal="clicked"/>
- <accelerator key="e" modifiers="" signal="clicked"/>
- <accelerator key="d" modifiers="" signal="clicked"/>
- <accelerator key="3" modifiers="" signal="clicked"/>
+ <accelerator key="9" modifiers="" signal="clicked"/>
+ <accelerator key="w" modifiers="" signal="clicked"/>
+ <accelerator key="x" modifiers="" signal="clicked"/>
+ <accelerator key="y" modifiers="" signal="clicked"/>
+ <accelerator key="z" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label11">
+ <widget class="GtkLabel" id="label18">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="30000" weight="bold" stretch="ultraexpanded">3</span>
-<span size="12000">DEF</span></property>
+ <property name="label" translatable="yes"><span size="30000" weight="bold">9</span>
+<span size="12000">WXYZ</span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="digit2">
+ <widget class="GtkButton" id="back">
+ <property name="visible">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="on_back_clicked"/>
+ <accelerator key="BackSpace" modifiers="" signal="clicked"/>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="stock">gtk-no</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><span size="17000" weight="Bold">Back</span></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="digit0">
<property name="visible">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="c" modifiers="" signal="clicked"/>
- <accelerator key="b" modifiers="" signal="clicked"/>
- <accelerator key="a" modifiers="" signal="clicked"/>
- <accelerator key="2" modifiers="" signal="clicked"/>
+ <accelerator key="0" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label10">
+ <widget class="GtkLabel" id="label19">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="30000" weight="bold">2</span>
-<span size="12000">ABC</span></property>
+ <property name="label" translatable="yes"><span size="33000" weight="bold">0</span>
+<span size="9000"></span></property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="digit1">
+ <widget class="GtkButton" id="dial">
<property name="visible">True</property>
+ <property name="has_default">True</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_digit_clicked"/>
- <accelerator key="1" modifiers="" signal="clicked"/>
+ <signal name="clicked" handler="on_dial_clicked"/>
+ <accelerator key="Return" modifiers="" signal="clicked"/>
<child>
- <widget class="GtkLabel" id="label12">
+ <widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="33000" weight="bold">1</span>
-<span size="9000"> </span></property>
- <property name="use_markup">True</property>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="stock">gtk-yes</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><span size="17000" weight="bold">Dial</span></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
</child>
</widget>
<packing>
<placeholder/>
</child>
<child>
- <widget class="GtkLabel" id="label1">
+ <widget class="GtkComboBoxEntry" id="callbackcombo">
<property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes">GrandCentral
-Number:</property>
- <property name="justify">GTK_JUSTIFY_RIGHT</property>
+ <child internal-child="entry">
+ <widget class="GtkEntry" id="comboboxentry-entry2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <signal name="changed" handler="on_callbackentry_changed"/>
+ </widget>
+ </child>
</widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
</child>
<child>
- <widget class="GtkLabel" id="gcnumberlabel">
+ <widget class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="label" translatable="yes"><span size="15000" weight="bold">(518) 555-1212</span></property>
- <property name="use_markup">True</property>
+ <property name="xalign">1</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">Callback Number:</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label3">
+ <widget class="GtkLabel" id="gcnumberlabel">
<property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes">Callback Number:</property>
+ <property name="label" translatable="yes"><span size="15000" weight="bold">(518) 555-1212</span></property>
+ <property name="use_markup">True</property>
</widget>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkComboBoxEntry" id="callbackcombo">
+ <widget class="GtkLabel" id="label1">
<property name="visible">True</property>
- <child internal-child="entry">
- <widget class="GtkEntry" id="comboboxentry-entry2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <signal name="changed" handler="on_callbackentry_changed"/>
- </widget>
- </child>
+ <property name="xalign">1</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">GrandCentral
+Number:</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
</widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
</child>
</widget>
<packing>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Username</property>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label6">
+ <widget class="GtkEntry" id="passwordentry">
<property name="visible">True</property>
- <property name="label" translatable="yes">Password</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
</widget>
<packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="passwordentry">
+ <widget class="GtkLabel" id="label6">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
+ <property name="label" translatable="yes">Password</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Username</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="position">1</property>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">1</property>
- <property name="n_columns">2</property>
+ <property name="n_columns">1</property>
<child>
- <widget class="GtkComboBox" id="addressbooks_combo">
+ <widget class="GtkTreeView" id="books_view">
<property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Address Book</property>
+ <property name="can_focus">True</property>
+ <property name="headers_clickable">True</property>
</widget>
</child>
</widget>
a[0].next()
return True
except StopIteration:
+ del a[:]
return False
decorated_func.__name__ = func.__name__
"""
@returns Iterable of (Address Book Factory, Book Id, Book Name)
"""
- yield self, None, "None"
+ yield self, "", "None"
def open_addressbook(self, bookId):
return self
+ def factory_name(self):
+ return ""
+
def get_contacts(self):
"""
@returns Iterable of (contact id, contact name)
"""
- return
+ return []
def get_contact_details(self, contactId):
"""
@returns Iterable of (Phone Type, Phone Number)
"""
- return
+ return []
-class SettingsWindow(object):
+class SettingsDialog(object):
def __init__(self, widgetTree, gcDialer):
self._gcDialer = gcDialer
self._cancelButton = self._widgetTree.get_widget("cancel_settings")
self._cancelButton.connect("clicked", self.custom_button_response(gtk.RESPONSE_CANCEL))
- self._booksCombo = self._widgetTree.get_widget("addressbooks_combo")
+ self._booksList = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
+ for (factoryId, bookId), (factoryName, bookName) in self._gcDialer.get_addressbooks():
+ row = (str(factoryId), bookId, factoryName, bookName)
+ self._booksList.append(row)
+
+ self._booksView = self._widgetTree.get_widget("books_view")
+ self._booksView.set_model(self._booksList)
+
+ # Add the column to the treeview
+ column = gtk.TreeViewColumn("Addressbook")
+
+ textrenderer = gtk.CellRendererText()
+ column.pack_start(textrenderer, expand=False)
+ column.add_attribute(textrenderer, 'text', 2)
+
+ textrenderer = gtk.CellRendererText()
+ column.pack_start(textrenderer, expand=True)
+ column.add_attribute(textrenderer, 'text', 3)
- self._booksList = gtk.ListStore(gobject.TYPE_STRING)
- self._booksCombo.set_model(self._booksList)
- self._booksCombo.set_text_column(0)
- #for number, description in self._gcBackend.get_callback_numbers().iteritems():
- # self.callbacklist.append([make_pretty(number)])
- #self._booksCombo.get_child().set_text()
+ column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
+ column.set_sort_column_id(2)
+ column.set_visible(True)
+ self._booksView.append_column(column)
+
+ self._booksViewSelection = self._booksView.get_selection()
+ self._booksViewSelection.set_mode(gtk.SELECTION_SINGLE)
+ self.reset()
+
+ def reset(self):
+ pass
def custom_button_response(self, response):
return button_handler
- def run(self, contactDetails):
- self._booksList.clear()
-
- for phoneType, phoneNumber in contactDetails:
- self._booksList.append((phoneNumber, "%s - %s" % (make_pretty(phoneNumber), phoneType)))
-
+ def run(self):
userResponse = self._dialog.run()
if userResponse == gtk.RESPONSE_OK:
- pass
+ model, itr = self._booksViewSelection.get_selected()
+ if itr:
+ factoryId = int(self._booksList.get_value(itr, 0))
+ bookId = self._booksList.get_value(itr, 1)
+ self._gcDialer.open_addressbook(factoryId, bookId)
+ self._booksViewSelection.unselect_all()
else:
- pass
+ self.reset()
self._dialog.hide()
"on_dialpad_quit": self._on_close,
"on_paste": self._on_paste,
"on_clear_number": self._on_clear_number,
+ "on_settings": self._on_settings,
"on_clearcookies_clicked": self._on_clearcookies_clicked,
"on_notebook_switch_page": self._on_notebook_switch_page,
self._gcBackend,
]
self._addressBook = None
- self.open_addressbook(*self.get_addressbooks().next()[0:2])
+ self.open_addressbook(*self.get_addressbooks().next()[0][0:2])
self._phoneTypeSelector = PhoneTypeSelector(self._widgetTree, self._gcBackend)
+ self._settingsDialog = SettingsDialog(self._widgetTree, self)
if not self._gcBackend.is_authed():
self.attempt_login(2)
gobject.idle_add(self._idly_init_contacts_view)
def _idly_init_recent_view(self):
- """ Deferred initalization of the recent view treeview """
+ """
+ Deferred initalization of the recent view treeview
+ """
recentview = self._widgetTree.get_widget("recentview")
recentview.set_model(self._recentmodel)
contactType = (self._gcContactIcon,)
else:
contactType = (self._gcContactText,)
- for contactId, contactName in self._gcBackend.get_contacts():
+ for contactId, contactName in self._addressBook.get_contacts():
self._contactsmodel.append(contactType + (contactName, "", contactId) + ("",))
yield
def get_addressbooks(self):
"""
- @returns Iterable of (Address Book Factory, Book Id, Book Name)
+ @returns Iterable of ((Factory Id, Book Id), (Factory Name, Book Name))
"""
- for factory in self._addressBookFactories:
+ for i, factory in enumerate(self._addressBookFactories):
for bookFactory, bookId, bookName in factory.get_addressbooks():
- yield bookFactory, bookId, bookName
+ yield (i, bookId), (factory.factory_name(), bookName)
- def open_addressbook(self, bookFactory, bookId):
- self._addressBook = bookFactory.open_addressbook(bookId)
+ def open_addressbook(self, bookFactoryId, bookId):
+ self._addressBook = self._addressBookFactories[bookFactoryId].open_addressbook(bookId)
self._contactstime = 0
+ gobject.idle_add(self._idly_populate_contactsview)
def set_number(self, number):
"""
"""
self._phonenumber = make_ugly(number)
self._prettynumber = make_pretty(self._phonenumber)
- self._numberdisplay.set_label("<span size='30000' weight='bold'>%s</span>" % ( self._prettynumber ) )
+ self._numberdisplay.set_label("<span size='30000' weight='bold'>%s</span>" % (self._prettynumber))
def set_account_number(self):
"""
self._isFullScreen = True
else:
self._isFullScreen = False
+
+ def _on_settings(self, *args, **kwds):
+ self._settingsDialog.run()
def _on_key_press(self, widget, event, *args):
"""
return
contactId = self._contactsmodel.get_value(itr, 3)
- contactDetails = self._gcBackend.get_contact_details(contactId)
+ contactDetails = self._addressBook.get_contact_details(contactId)
contactDetails = [phoneNumber for phoneNumber in contactDetails]
if len(contactDetails) == 0: