diff options
author | Daniel Brötzmann <mailtrash@posteo.de> | 2018-10-09 20:55:52 +0300 |
---|---|---|
committer | Daniel Brötzmann <mailtrash@posteo.de> | 2018-10-24 22:18:39 +0300 |
commit | 39ef5002c3c7419518c21a50af2883ff3f19a73a (patch) | |
tree | d6f6d6d14e77fb0ba3d59436dd6b504fa305cc9f /set_location | |
parent | 52fcf0db87b68bc968fc944eadde21c42e177933 (diff) |
[set_location] Rework config dialog
Diffstat (limited to 'set_location')
-rw-r--r-- | set_location/config_dialog.ui | 743 | ||||
-rw-r--r-- | set_location/set_location.py | 41 |
2 files changed, 439 insertions, 345 deletions
diff --git a/set_location/config_dialog.ui b/set_location/config_dialog.ui index 386b5a0..aedf343 100644 --- a/set_location/config_dialog.ui +++ b/set_location/config_dialog.ui @@ -1,620 +1,707 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.20"/> <object class="GtkWindow" id="window1"> <property name="can_focus">False</property> <child> - <object class="GtkHBox" id="hbox1"> + <placeholder/> + </child> + <child> + <object class="GtkBox" id="config_box"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="border_width">18</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkVBox" id="vbox2"> + <object class="GtkInfoBar" id="dependency_warning"> <property name="visible">True</property> <property name="can_focus">False</property> - <child> - <object class="GtkHBox" id="hbox2"> - <property name="visible">True</property> + <property name="message_type">warning</property> + <property name="show_close_button">True</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> <property name="can_focus">False</property> + <property name="spacing">6</property> + <property name="layout_style">end</property> <child> - <object class="GtkLabel" id="preset"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Preset:</property> + <property name="label" translatable="yes">You need to install gir1.2-gtkchamplain and gir1.2-gtkclutter-1.0 for the map to work.</property> </object> <packing> <property name="expand">False</property> - <property name="fill">False</property> - <property name="padding">7</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="preset_combobox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <signal name="changed" handler="on_preset_combobox_changed" swapped="no"/> - </object> - <packing> - <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child internal-child="content_area"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkGrid" id="config_table"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> <child> - <object class="GtkButton" id="preset_button"> - <property name="use_action_appearance">False</property> + <object class="GtkBox"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - <property name="xalign">0</property> - <signal name="clicked" handler="on_preset_button_clicked" swapped="no"/> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="preset_combobox"> + <property name="width_request">200</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <signal name="changed" handler="on_preset_combobox_changed" swapped="no"/> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> <child> - <object class="GtkHBox" id="hbox3"> + <object class="GtkButtonBox"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="spacing">6</property> + <property name="layout_style">start</property> <child> - <object class="GtkImage" id="image1"> + <object class="GtkButton" id="preset_button"> + <property name="label">gtk-save</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-save</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Save Preset</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_preset_button_clicked" swapped="no"/> </object> <packing> - <property name="expand">True</property> + <property name="expand">False</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> - <object class="GtkLabel" id="label17"> + <object class="GtkButton" id="del_preset"> + <property name="label">gtk-remove</property> <property name="visible">True</property> + <property name="sensitive">False</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Save preset</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Remove Preset</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_del_preset_clicked" swapped="no"/> </object> <packing> - <property name="expand">True</property> + <property name="expand">False</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="padding">7</property> - <property name="position">2</property> + <property name="left_attach">1</property> + <property name="top_attach">0</property> </packing> </child> <child> - <object class="GtkButton" id="del_preset"> - <property name="use_action_appearance">False</property> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="sensitive">False</property> <property name="can_focus">False</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - <signal name="clicked" handler="on_del_preset_clicked" swapped="no"/> - <child> - <object class="GtkHBox" id="hbox4"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="stock">gtk-delete</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label18"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Delete preset</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> + <property name="halign">end</property> + <property name="label" translatable="yes">Preset</property> + <style> + <class name="dim-label"/> + <class name="bold"/> + </style> </object> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">3</property> + <property name="left_attach">0</property> + <property name="top_attach">0</property> </packing> </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="config_table"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="border_width">6</property> - <property name="n_rows">16</property> - <property name="n_columns">2</property> - <property name="column_spacing">7</property> - <property name="row_spacing">5</property> <child> - <object class="GtkLabel" id="label1"> + <object class="GtkEntry" id="lat"> + <property name="width_request">250</property> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">alt:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Latitude in decimal degrees North</property> + <property name="invisible_char">*</property> </object> <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> + <property name="left_attach">1</property> + <property name="top_attach">1</property> </packing> </child> <child> - <object class="GtkLabel" id="label2"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">area:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">L_atitude</property> + <property name="use_underline">True</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> + <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkLabel" id="label3"> + <object class="GtkEntry" id="lon"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">building:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Longitude in decimal degrees East</property> + <property name="invisible_char">*</property> </object> <packing> + <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkLabel" id="label4"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">country:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">L_ongitude</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">lon</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="left_attach">0</property> + <property name="top_attach">2</property> </packing> </child> <child> - <object class="GtkLabel" id="label5"> + <object class="GtkEntry" id="alt"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">countrycode:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Altitude in meters above sea level</property> + <property name="invisible_char">*</property> </object> <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="left_attach">1</property> + <property name="top_attach">3</property> </packing> </child> <child> - <object class="GtkLabel" id="label6"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">description:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">A_ltitude</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">alt</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="left_attach">0</property> + <property name="top_attach">3</property> </packing> </child> <child> - <object class="GtkLabel" id="label7"> + <object class="GtkEntry" id="country"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">floor:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Nation we are located in</property> + <property name="invisible_char">*</property> </object> <packing> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> + <property name="left_attach">1</property> + <property name="top_attach">4</property> </packing> </child> <child> - <object class="GtkLabel" id="label8"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">locality:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">_Country</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">country</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> + <property name="left_attach">0</property> + <property name="top_attach">4</property> </packing> </child> <child> - <object class="GtkLabel" id="label9"> + <object class="GtkEntry" id="countrycode"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">lat:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Two-letter country code (ISO 3166)</property> + <property name="invisible_char">*</property> </object> <packing> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> + <property name="left_attach">1</property> + <property name="top_attach">5</property> </packing> </child> <child> - <object class="GtkLabel" id="label10"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">lon:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Cou_ntry code</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">countrycode</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="top_attach">9</property> - <property name="bottom_attach">10</property> + <property name="left_attach">0</property> + <property name="top_attach">5</property> </packing> </child> <child> - <object class="GtkLabel" id="label11"> + <object class="GtkEntry" id="region"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">postalcode:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Administrative region of the nation, such as a state or province</property> + <property name="invisible_char">*</property> </object> <packing> - <property name="top_attach">10</property> - <property name="bottom_attach">11</property> + <property name="left_attach">1</property> + <property name="top_attach">6</property> </packing> </child> <child> - <object class="GtkLabel" id="label12"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">region:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Re_gion</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">region</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="top_attach">11</property> - <property name="bottom_attach">12</property> + <property name="left_attach">0</property> + <property name="top_attach">6</property> </packing> </child> <child> - <object class="GtkLabel" id="label13"> + <object class="GtkEntry" id="locality"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">room:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Locality within the administrative region, such as a town or city</property> + <property name="invisible_char">*</property> </object> <packing> - <property name="top_attach">12</property> - <property name="bottom_attach">13</property> + <property name="left_attach">1</property> + <property name="top_attach">7</property> </packing> </child> <child> - <object class="GtkLabel" id="label14"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">street:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Localit_y</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">locality</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="top_attach">13</property> - <property name="bottom_attach">14</property> + <property name="left_attach">0</property> + <property name="top_attach">7</property> </packing> </child> <child> - <object class="GtkLabel" id="label15"> + <object class="GtkEntry" id="postalcode"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">text:</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Code used for postal delivery</property> + <property name="invisible_char">*</property> </object> <packing> - <property name="top_attach">14</property> - <property name="bottom_attach">15</property> + <property name="left_attach">1</property> + <property name="top_attach">8</property> </packing> </child> <child> - <object class="GtkLabel" id="label16"> + <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">uri:</property> + <property name="halign">end</property> + <property name="label" translatable="yes">_Postal code</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">postalcode</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="top_attach">15</property> - <property name="bottom_attach">16</property> + <property name="left_attach">0</property> + <property name="top_attach">8</property> </packing> </child> <child> - <object class="GtkEntry" id="alt"> + <object class="GtkEntry" id="area"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">Altitude in meters above or below sea level</property> - <property name="invisible_char">●</property> + <property name="tooltip_text" translatable="yes">A named area such as a campus or neighborhood</property> + <property name="invisible_char">*</property> </object> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> + <property name="top_attach">9</property> </packing> </child> <child> - <object class="GtkEntry" id="area"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A named area such as a campus or neighborhood</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">A_rea</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">area</property> + <style> + <class name="dim-label"/> + </style> </object> <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="left_attach">0</property> + <property name="top_attach">9</property> </packing> </child> <child> - <object class="GtkEntry" id="building"> + <object class="GtkEntry" id="street"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A specific building on a street or in an area</property> - <property name="invisible_char">●</property> + <property name="tooltip_text" translatable="yes">A street within the locality, or a crossing of two streets</property> + <property name="invisible_char">*</property> </object> <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">10</property> </packing> </child> <child> - <object class="GtkEntry" id="country"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">The nation where the user is located</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">_Street</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">street</property> + <style> + <class name="dim-label"/> + </style> </object> <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> + <property name="left_attach">0</property> + <property name="top_attach">10</property> </packing> </child> <child> - <object class="GtkEntry" id="countrycode"> + <object class="GtkEntry" id="building"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">The ISO 3166 two-letter country code</property> - <property name="invisible_char">●</property> + <property name="tooltip_text" translatable="yes">A specific building on a street or in an area</property> + <property name="invisible_char">*</property> </object> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">11</property> </packing> </child> <child> - <object class="GtkEntry" id="description"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A natural-language name for or description of the location</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">_Building</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">building</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="left_attach">0</property> + <property name="top_attach">11</property> </packing> </child> <child> <object class="GtkEntry" id="floor"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> <property name="tooltip_text" translatable="yes">A particular floor in a building</property> - <property name="invisible_char">●</property> + <property name="invisible_char">*</property> </object> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> + <property name="top_attach">12</property> </packing> </child> <child> - <object class="GtkEntry" id="locality"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A locality within the administrative region, such as a town or city</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">_Floor</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">floor</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> + <property name="left_attach">0</property> + <property name="top_attach">12</property> </packing> </child> <child> - <object class="GtkEntry" id="lat"> + <object class="GtkEntry" id="room"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">Latitude in decimal degrees North</property> - <property name="invisible_char">●</property> + <property name="tooltip_text" translatable="yes">A particular room in a building</property> + <property name="invisible_char">*</property> </object> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> + <property name="top_attach">13</property> </packing> </child> <child> - <object class="GtkEntry" id="lon"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">Longitude in decimal degrees East</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Roo_m</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">room</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">9</property> - <property name="bottom_attach">10</property> + <property name="left_attach">0</property> + <property name="top_attach">13</property> </packing> </child> <child> - <object class="GtkEntry" id="postalcode"> + <object class="GtkEntry" id="description"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A code used for postal delivery</property> - <property name="invisible_char">●</property> + <property name="tooltip_text" translatable="yes">A description of the location</property> + <property name="invisible_char">*</property> </object> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">10</property> - <property name="bottom_attach">11</property> + <property name="top_attach">14</property> </packing> </child> <child> - <object class="GtkEntry" id="region"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">An administrative region of the nation, such as a state or province</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Descrip_tion</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">description</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">11</property> - <property name="bottom_attach">12</property> + <property name="left_attach">0</property> + <property name="top_attach">14</property> </packing> </child> <child> - <object class="GtkEntry" id="room"> + <object class="GtkEntry" id="uri"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A particular room in a building</property> - <property name="invisible_char">●</property> + <property name="tooltip_text" translatable="yes">An URI or URL pointing to information about the location</property> + <property name="invisible_char">*</property> </object> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">12</property> - <property name="bottom_attach">13</property> + <property name="top_attach">15</property> </packing> </child> <child> - <object class="GtkEntry" id="street"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A thoroughfare within the locality, or a crossing of two thoroughfares</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">UR_I</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">uri</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">13</property> - <property name="bottom_attach">14</property> + <property name="left_attach">0</property> + <property name="top_attach">15</property> </packing> </child> <child> <object class="GtkEntry" id="text"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A catch-all element that captures any other information about the location</property> - <property name="invisible_char">●</property> + <property name="tooltip_text" translatable="yes">Any other information about the location</property> + <property name="invisible_char">*</property> </object> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">14</property> - <property name="bottom_attach">15</property> + <property name="top_attach">16</property> </packing> </child> <child> - <object class="GtkEntry" id="uri"> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">A URI or URL pointing to information about the location</property> - <property name="invisible_char">●</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Te_xt</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">text</property> + <style> + <class name="dim-label"/> + </style> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">15</property> - <property name="bottom_attach">16</property> + <property name="left_attach">0</property> + <property name="top_attach">16</property> </packing> </child> </object> <packing> <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="resize_mode">immediate</property> - <child> - <placeholder/> - </child> <child> - <placeholder/> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="map_box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="map_placeholder"> + <property name="width_request">400</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="label" translatable="yes">Map</property> + <property name="wrap">True</property> + <style> + <class name="large-header"/> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="instruction_text"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">end</property> + <property name="label" translatable="yes">Use right mouse button to set your location. +Middle mouse button shows/hides your contacts on the map.</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> - <property name="expand">True</property> + <property name="expand">False</property> <property name="fill">True</property> - <property name="padding">6</property> <property name="position">1</property> </packing> </child> diff --git a/set_location/set_location.py b/set_location/set_location.py index fe8cb20..6c77da4 100644 --- a/set_location/set_location.py +++ b/set_location/set_location.py @@ -35,7 +35,7 @@ try: GtkClutter.init([]) # Must be initialized before importing those: from gi.repository import Champlain, GtkChamplain except: - log.debug('Champlain library not available') + log.exception('Champlain library not available') CHAMPLAIN_AVAILABLE = False @@ -43,9 +43,9 @@ class SetLocationPlugin(GajimPlugin): @log_calls('SetLocationPlugin') def init(self): self.description = _('Set information about your current geographical ' - 'or physical location. \n' - 'To be able to set your location on the built-in map, ' - 'you must install gir1.2-gtkchamplain') + 'or physical location. \nTo be able to set your location on the ' + 'built-in map, you need to have gir1.2-gtkchamplain and ' + 'gir1.2-gtkclutter-1.0 installed') self.config_dialog = SetLocationPluginConfigDialog(self) self.config_default_values = { 'alt': (1609, ''), @@ -93,7 +93,7 @@ class SetLocationPlugin(GajimPlugin): self._data[name] = self.config[name] if not acct: - #set geo for all accounts + # Set geo for all accounts for acct in app.connections: if app.config.get_per('accounts', acct, 'publish_location'): app.connections[acct].get_module('UserLocation').send( @@ -108,10 +108,10 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): 'config_dialog.ui') self.xml = Gtk.Builder() self.xml.set_translation_domain('gajim_plugins') - self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH, - ['hbox1']) - hbox = self.xml.get_object('hbox1') - self.get_child().pack_start(hbox, True, True, 0) + self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH, + ['config_box']) + config_box = self.xml.get_object('config_box') + self.get_child().pack_start(config_box, True, True, 0) self.xml.connect_signals(self) self.connect('hide', self.on_hide) self.connect('show', self.on_show) @@ -125,6 +125,7 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): self.preset_combo.add_attribute(cellrenderer, 'text', 0) #self.plugin.config['presets'] = {'default': {}} + @log_calls('SetLocationPlugin.SetLocationPluginConfigDialog') def on_run(self): if not self.is_active: @@ -138,9 +139,17 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): widget = self.xml.get_object(name) widget.set_text(str(self.plugin.config[name])) + map_placeholder = self.xml.get_object('map_placeholder') + dependency_bar = self.xml.get_object('dependency_warning') + dependency_bar.connect("close", lambda b: b.hide()) + dependency_bar.connect("response", lambda b,i: b.hide()) + if CHAMPLAIN_AVAILABLE and not self.is_active: - vbox = self.xml.get_object('vbox1') - vbox.set_size_request(400, -1) + map_placeholder.set_no_show_all(True) + map_placeholder.hide() + dependency_bar.set_revealed(False) + map_box = self.xml.get_object('map_box') + map_box.set_size_request(400, -1) embed = GtkChamplain.Embed() @@ -165,11 +174,8 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): self.path_to_image = os.path.abspath(gtkgui_helpers.get_icon_path( 'org.gajim.Gajim', 16)) - vbox.pack_start(embed, expand=True, fill=True, padding=6) - label = Gtk.Label(_( - 'Click right mouse button to set your location, \n'\ - 'middle mouse button to show / hide your contacts on the map')) - vbox.pack_start(label, expand=False, fill=False, padding=6) + map_box.pack_start(embed, expand=True, fill=True, padding=0) + self.is_active = True self.layer = Champlain.MarkerLayer() texture = Clutter.Texture() @@ -198,6 +204,7 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): continue widget = self.xml.get_object(name) self.plugin.config[name] = widget.get_text() + lat = self.xml.get_object('lat').get_text() lon = self.xml.get_object('lon').get_text() if self.is_valid_coord(lat, lon): @@ -208,7 +215,7 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): else: self.plugin.config['lat'] = '0.0' self.plugin.config['lon'] = '0.0' - error_text = 'lat or lon field contains wrong value.' + error_text = _('Latitude or Longitude field contains an invalid value') WarningDialog(_('Wrong coordinates'), error_text, self) def map_clicked(self, actor, event, view): |