<child>
<object class="GtkRadioButton" id="radio_start">
<property name="label" translatable="yes">Démarrer</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<child>
<object class="GtkRadioButton" id="radio_maj">
<property name="label" translatable="yes">Mettre à jour</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<child>
<object class="GtkRadioButton" id="radio_reinstall">
<property name="label" translatable="yes">Réinstaller</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<child>
<object class="GtkButton" id="button">
<property name="label" translatable="yes">Démarrer</property>
+ <property name="use_action_appearance">False</property>
<property name="height_request">35</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Démarrer OpenERP</property>
<property name="margin_top">5</property>
- <signal name="clicked" handler="on_start_button_clicked" swapped="no"/>
+ <property name="use_action_appearance">False</property>
+ <signal name="clicked" handler="on_start_button_clicked" object="main_window" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
#!/usr/bin/python3
+#-*- coding: utf-8 -*-
+
from gi.repository import Gtk
self.window = GladeWindowManager.initWindow("main_window", self)
self.window.show_all()
+ @staticmethod
+ def _get_all_textlines_from_buffer(buffer):
+ start, end = buffer.get_start_iter(), buffer.get_end_iter()
+ return buffer.get_text(start, end, True).splitlines()
+
def on_start_button_clicked(self, widget, data=None):
- print("Bravo")
+ # Récupération des widgets utiles à partir du widget général
+ grid = widget.get_children()[0].get_children()[1]
+ widgets = [e.get_children() for e in grid.get_children()
+ if type(e) != Gtk.Label]
+ # Récupération des valeurs dans "Scripts"
+ scripts = self._get_all_textlines_from_buffer(
+ widgets[0][0].get_buffer()
+ )
+ # Récupération des valeurs dans "Bases"
+ bases = self._get_all_textlines_from_buffer(
+ widgets[1][0].get_buffer()
+ )
+ # Récupération des valeurs dans "Modules"
+ modules = self._get_all_textlines_from_buffer(
+ widgets[2][0].get_buffer()
+ )
+ # Récupération de la valeur dans "Actions"
+ action = [rb.get_label() for rb in widgets[3] if rb.get_active()][0]
+ print("""Éléments récupérés :
+modules :
+%s
+bases
+%s
+scripts
+%s
+action
+%s""" % (modules, bases, scripts, action))
if __name__ == "__main__":