Added default dir checkbutton

This commit is contained in:
2018-02-27 21:36:47 +01:00
parent a098969f3e
commit 53b6172eb0
3 changed files with 46 additions and 5 deletions
+22 -2
View File
@@ -86,7 +86,7 @@
<property name="can_focus">True</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="text" translatable="yes">Select source directory!</property>
<property name="text" translatable="yes">/usr/include</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -142,7 +142,7 @@
<property name="can_focus">True</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="text" translatable="yes">Select destination directory!</property>
<property name="text" translatable="yes">~/include</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -185,6 +185,26 @@
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_include_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">6</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="default_dir_checkbutton">
<property name="label" translatable="yes">Use default directories!</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_default_dir_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
+18 -3
View File
@@ -86,7 +86,7 @@
<property name="can_focus">True</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="text" translatable="yes">Select source directory!</property>
<property name="text" translatable="yes">/usr/include</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -142,7 +142,7 @@
<property name="can_focus">True</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="text" translatable="yes">Select destination directory!</property>
<property name="text" translatable="yes">~/include</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -182,10 +182,25 @@
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_include_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">6</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="default_dir_checkbutton">
<property name="label" translatable="yes">Use default directories!</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_default_dir_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
+6
View File
@@ -74,6 +74,7 @@ destdir = ''
fileindex = 0
filecnt = 0
incinc = False
defdir = False
def sourcedir_filecnt(sourcedir):
### Return the number of files, ending with '.h', in sourcedir - including subdirectories ###
@@ -179,6 +180,7 @@ class ExampleApp:
self.obj("window").set_application(app)
self.obj("window").set_wmclass("h2inc_gtk","h2inc_gtk")
self.obj("window").show_all()
self.obj("default_dir_checkbutton").set_active(False)
self.obj("include_checkbutton").set_active(True)
button = Gtk.Button.new_from_stock(Gtk.STOCK_CANCEL)
@@ -281,6 +283,10 @@ class ExampleApp:
global incinc
incinc = self.obj("include_checkbutton").get_active()
def on_default_dir_checkbutton_toggled(self, widget):
global defdir
defdir = self.obj("default_dir_checkbutton").get_active()
def on_translate_button_clicked(self, widget, data=None):
self.obj("sourceframe").set_sensitive(False)
self.obj("translate_button").set_sensitive(False)