[set_location] Add dependency bar
This commit is contained in:
@@ -18,24 +18,15 @@
|
|||||||
<object class="GtkInfoBar" id="dependency_warning">
|
<object class="GtkInfoBar" id="dependency_warning">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="no_show_all">True</property>
|
||||||
<property name="message_type">warning</property>
|
<property name="message_type">warning</property>
|
||||||
<property name="show_close_button">True</property>
|
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkButtonBox">
|
<object class="GtkButtonBox">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<placeholder/>
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</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">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -48,7 +39,16 @@
|
|||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</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">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ try:
|
|||||||
GtkClutter.init([]) # Must be initialized before importing those:
|
GtkClutter.init([]) # Must be initialized before importing those:
|
||||||
from gi.repository import Champlain, GtkChamplain
|
from gi.repository import Champlain, GtkChamplain
|
||||||
except:
|
except:
|
||||||
log.exception('Champlain library not available')
|
log.exception('To view the map, you have to install all dependencies')
|
||||||
CHAMPLAIN_AVAILABLE = False
|
CHAMPLAIN_AVAILABLE = False
|
||||||
|
|
||||||
|
|
||||||
@@ -141,13 +141,11 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
|
|||||||
|
|
||||||
map_placeholder = self.xml.get_object('map_placeholder')
|
map_placeholder = self.xml.get_object('map_placeholder')
|
||||||
dependency_bar = self.xml.get_object('dependency_warning')
|
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:
|
if CHAMPLAIN_AVAILABLE and not self.is_active:
|
||||||
map_placeholder.set_no_show_all(True)
|
map_placeholder.set_no_show_all(True)
|
||||||
map_placeholder.hide()
|
map_placeholder.hide()
|
||||||
dependency_bar.set_revealed(False)
|
dependency_bar.hide()
|
||||||
map_box = self.xml.get_object('map_box')
|
map_box = self.xml.get_object('map_box')
|
||||||
map_box.set_size_request(400, -1)
|
map_box.set_size_request(400, -1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user