moveright.sensitive = false
end
end
+ if optionals.include?('move_top')
+ menu.append(movetop = Gtk::ImageMenuItem.new(utf8(_("Move top"))))
+ movetop.image = Gtk::Image.new("#{$FPATH}/images/move-top.png")
+ movetop.signal_connect('activate') { closures[:move].call('top') }
+ if !possible_actions[:can_top]
+ movetop.sensitive = false
+ end
+ end
menu.append(moveup = Gtk::ImageMenuItem.new(utf8(_("Move up"))))
moveup.image = Gtk::Image.new("#{$FPATH}/images/stock-move-up.png")
moveup.signal_connect('activate') { closures[:move].call('up') }
if !possible_actions[:can_down]
movedown.sensitive = false
end
+ if optionals.include?('move_bottom')
+ menu.append(movebottom = Gtk::ImageMenuItem.new(utf8(_("Move bottom"))))
+ movebottom.image = Gtk::Image.new("#{$FPATH}/images/move-bottom.png")
+ movebottom.signal_connect('activate') { closures[:move].call('bottom') }
+ if !possible_actions[:can_bottom]
+ movebottom.sensitive = false
+ end
+ end
end
if type == 'video'
if !possible_actions[:can_multiple] || $selected_elements.length == 0 || $selected_elements.reject { |k,v| $name2widgets[k][:type] == 'video' }.empty?
$modified = true
save_changes('forced')
+ oldpos = $subalbums_edits[xmldir.attributes['path']][:position]
if direction == 'up'
- oldpos = $subalbums_edits[xmldir.attributes['path']][:position]
$subalbums_edits[xmldir.attributes['path']][:position] -= 1
subalbums_edits_bypos[oldpos - 1][:position] += 1
- else
- oldpos = $subalbums_edits[xmldir.attributes['path']][:position]
+ end
+ if direction == 'down'
$subalbums_edits[xmldir.attributes['path']][:position] += 1
subalbums_edits_bypos[oldpos + 1][:position] -= 1
end
+ if direction == 'top'
+ for i in 1 .. oldpos - 1
+ subalbums_edits_bypos[i][:position] += 1
+ end
+ $subalbums_edits[xmldir.attributes['path']][:position] = 1
+ end
+ if direction == 'bottom'
+ for i in oldpos + 1 .. subalbums_counter
+ subalbums_edits_bypos[i][:position] -= 1
+ end
+ $subalbums_edits[xmldir.attributes['path']][:position] = subalbums_counter
+ end
elems = []
$xmldir.elements.each('dir') { |element|
$xmldir.elements.each('descendant::dir') { |elem|
elem.delete_attribute('already-generated')
}
+
+ sel = $albums_tv.selection.selected_rows
change_dir
+ populate_subalbums_treeview(false)
+ $albums_tv.selection.select_path(sel[0])
}
color_swap_and_cleanup = Proc.new {
end
end
if event.event_type == Gdk::Event::BUTTON_PRESS && event.button == 3
- popup_thumbnail_menu(event, ['change_image'], captionfile, entry2type(captionfile), xmldir, "#{infotype}-",
+ popup_thumbnail_menu(event, ['change_image', 'move_top', 'move_bottom'], captionfile, entry2type(captionfile), xmldir, "#{infotype}-",
{ :forbid_left => true, :forbid_right => true,
- :can_up => counter > 1, :can_down => counter > 0 && counter < subalbums_counter },
+ :can_up => counter > 1, :can_down => counter > 0 && counter < subalbums_counter,
+ :can_top => counter > 1, :can_bottom => counter > 0 && counter < subalbums_counter },
{ :change => change_image, :move => move, :rotate => rotate_and_cleanup, :enhance => enhance_and_cleanup,
:color_swap => color_swap_and_cleanup, :frame_offset => change_frame_offset_and_cleanup, :whitebalance => whitebalance_and_cleanup })
end