aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpapoteur-mga <yves.brungard_git@gadz.org>2014-06-15 12:42:19 +0200
committerpapoteur-mga <yves.brungard_git@gadz.org>2014-06-15 12:42:19 +0200
commitd9a9d1959827489c1129f878ed58c41cadec70b8 (patch)
treea2b6ed557827826c66153cc787fd81a007edd46b
parent41774d166676112ae8cfda11387ea9642fb7d8e0 (diff)
downloadisodumper-d9a9d1959827489c1129f878ed58c41cadec70b8.tar
isodumper-d9a9d1959827489c1129f878ed58c41cadec70b8.tar.gz
isodumper-d9a9d1959827489c1129f878ed58c41cadec70b8.tar.bz2
isodumper-d9a9d1959827489c1129f878ed58c41cadec70b8.tar.xz
isodumper-d9a9d1959827489c1129f878ed58c41cadec70b8.zip
Change a window to a dialog
Set default values for backup
-rwxr-xr-xlib/isodumper.py15
-rw-r--r--share/isodumper/isodumper.glade69
2 files changed, 51 insertions, 33 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 17edf2c..0019a92 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -59,7 +59,7 @@ class IsoDumper:
def __init__(self, user):
APP="isodumper"
DIR="/usr/share/locale"
- RELEASE="v0.21"
+ RELEASE="v0.22"
# for the localisation of log file
self.user=user
@@ -78,6 +78,7 @@ class IsoDumper:
self.logview = self.wTree.get_widget("detail_text")
self.log = self.logview.get_buffer()
self.window.set_title(self.window.get_title()+' '+RELEASE)
+ self.wTree.get_widget("about_dialog").set_version(RELEASE)
# define size of the selected device
self.deviceSize=0
@@ -112,6 +113,7 @@ class IsoDumper:
"on_backup_toggled" : self.enable_backup,
"on_backup_select_clicked" : self.backup_sel,
"on_select_clicked" : self.backup_choosed,
+ "on_choose_cancel_clicked" : self.backup_cancel,
"on_about_button_clicked" : self.about,
"on_write_button_clicked" : self.do_write}
self.wTree.signal_autoconnect(dict)
@@ -136,6 +138,7 @@ class IsoDumper:
# convert in Mbytes
sizeM=str(int(size)/(1024*1024))
self.combo.append_text(name+' ('+path.lstrip()+') '+sizeM+_('Mb'))
+ self.device_name=name.rstrip().replace(' ', '')
dialog.destroy()
@@ -148,7 +151,15 @@ class IsoDumper:
self.backup_select.set_sensitive(not self.backup_select.get_sensitive())
def backup_sel(self,widget):
- self.choose.show_all()
+ if self.backup_bname.get_current_folder_uri() == None :
+ self.backup_bname.set_current_folder_uri('file:///home/'+self.user)
+ self.backup_bname.set_current_name(self.device_name+".iso")
+ self.choose.run()
+
+ def backup_cancel(self,widget):
+ self.choose.hide()
+ # Unckeck the choice to backup
+ self.backup.set_active(0)
def backup_choosed(self, widget):
exit_dialog=self.backup_bname.get_filename()
diff --git a/share/isodumper/isodumper.glade b/share/isodumper/isodumper.glade
index f977070..a851f2e 100644
--- a/share/isodumper/isodumper.glade
+++ b/share/isodumper/isodumper.glade
@@ -11,7 +11,6 @@
<property name="type_hint">dialog</property>
<property name="has_separator">True</property>
<property name="program_name">IsoDumper</property>
- <property name="version">v0.21</property>
<property name="copyright">© 2013-2014 Mageia</property>
<property name="comments" translatable="yes">A tool for writing ISO images on a USB stick. It's a fork of usb-imagewriter.</property>
<property name="website">https://github.com/papoteur-mga/isodumper</property>
@@ -407,39 +406,20 @@ Public License instead of this License.
</widget>
</child>
</widget>
- <widget class="GtkWindow" id="choose">
+ <widget class="GtkDialog" id="choose">
<property name="can_focus">False</property>
<property name="border_width">5</property>
- <property name="title" translatable="yes">IsoDumper</property>
- <property name="modal">True</property>
- <property name="window_position">center</property>
- <property name="default_width">715</property>
- <property name="default_height">540</property>
- <property name="icon_name">isodumper</property>
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="height_request">400</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
- <child>
- <widget class="GtkFileChooserWidget" id="bname">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="action">save</property>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox1">
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area6">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">9</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="select">
<property name="label" translatable="yes">Select</property>
@@ -454,11 +434,38 @@ Public License instead of this License.
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="choose_cancel">
+ <property name="label">gtk-discard</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_choose_cancel_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFileChooserWidget" id="bname">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="action">save</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -748,7 +755,7 @@ Public License instead of this License.
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="tooltip" translatable="yes">Select target device to write the image to</property>
- <property name="items" translatable="yes"></property>
+ <property name="items" translatable="yes"/>
<signal name="changed" handler="on_device_combobox_changed" swapped="no"/>
</widget>
<packing>