copy by default
authorgc <gc>
Mon, 14 Apr 2008 08:23:17 +0000 (08:23 +0000)
committergc <gc>
Mon, 14 Apr 2008 08:23:17 +0000 (08:23 +0000)
bin/booh-classifier

index 4bc9dfd..a7c896c 100644 (file)
@@ -1230,11 +1230,11 @@ def execute
         combostore = Gtk::ListStore.new(Gdk::Pixbuf, String)
         iter = combostore.append
         if normal
-            iter[0] = $main_window.render_icon(Gtk::Stock::GO_FORWARD, Gtk::IconSize::MENU)
-            iter[1] = utf8(_("Move to:"))
-            iter = combostore.append
             iter[0] = $main_window.render_icon(Gtk::Stock::PASTE, Gtk::IconSize::MENU)
             iter[1] = utf8(_("Copy to:"))
+            iter = combostore.append
+            iter[0] = $main_window.render_icon(Gtk::Stock::GO_FORWARD, Gtk::IconSize::MENU)
+            iter[1] = utf8(_("Move to:"))
         else
             iter[0] = $main_window.render_icon(Gtk::Stock::DELETE, Gtk::IconSize::MENU)
             iter[1] = utf8(_("Permanently remove"))
@@ -1366,11 +1366,11 @@ def execute
                                 destination = stuff[key][:pathlabel].text
                                 label2entries[key].each { |entry|
                                     if stuff[key][:combo].active == 0
-                                        system("mv '#{entry.path}' '#{destination}'") or raise "failed to move '#{entry.path}'"
-                                        moved += 1
-                                    elsif stuff[key][:combo].active == 1
                                         system("cp -dp '#{entry.path}' '#{destination}'") or raise "failed to copy '#{entry.path}'"
                                         copied += 1
+                                    elsif stuff[key][:combo].active == 1
+                                        system("mv '#{entry.path}' '#{destination}'") or raise "failed to move '#{entry.path}'"
+                                        moved += 1
                                     end
                                 }
                             end
@@ -1679,6 +1679,11 @@ def reset_thumbnails
     for child in $imagesline.children
         $imagesline.remove(child)
     end
+    set_imagesline_size_request
+end
+
+def set_imagesline_size_request
+    $imagesline.set_size_request(-1, Gtk::Button.new.size_request[1] + Entry.thumbnails_height + Entry.thumbnails_height/4)
 end
 
 def create_main_window
@@ -1702,7 +1707,7 @@ def create_main_window
     main_vbox.pack_start($imagesline_sw, false, false)
     main_vbox.pack_end($statusbar = Gtk::Statusbar.new, false, false)
 
-    $imagesline.set_size_request(-1, Gtk::Button.new.size_request[1] + Entry.thumbnails_height + Entry.thumbnails_height/4)
+    set_imagesline_size_request
 
     $main_window = create_window
     $main_window.add(main_vbox)