return nil
end
+def show_password_protections
+ examine_dir_elem = Proc.new { |parent_iter, xmldir, already_protected|
+ child_iter = $albums_iters[xmldir.attributes['path']]
+ if xmldir.attributes['password-protect']
+ child_iter[2] = pixbuf_or_nil("#{$FPATH}/images/galeon-secure.png")
+ already_protected = true
+ elsif already_protected
+ pix = pixbuf_or_nil("#{$FPATH}/images/galeon-secure-shadow.png")
+ if pix
+ pix = pix.saturate_and_pixelate(1, true)
+ end
+ child_iter[2] = pix
+ else
+ child_iter[2] = nil
+ end
+ xmldir.elements.each('dir') { |elem|
+ if !elem.attributes['deleted']
+ examine_dir_elem.call(child_iter, elem, already_protected)
+ end
+ }
+ }
+ examine_dir_elem.call(nil, $xmldoc.elements['//dir'], false)
+end
+
def populate_subalbums_treeview
$albums_ts.clear
$autotable.clear
+ $albums_iters = {}
$subalbums_vb.children.each { |chld|
$subalbums_vb.remove(chld)
}
child_iter = $albums_ts.append(parent_iter)
child_iter[0] = File.basename(xmldir.attributes['path'])
child_iter[1] = xmldir.attributes['path']
+ $albums_iters[xmldir.attributes['path']] = child_iter
msg 3, "puttin location: #{xmldir.attributes['path']}"
xmldir.elements.each('dir') { |elem|
if !elem.attributes['deleted']
}
}
append_dir_elem.call(nil, xmldir)
+ show_password_protections
$albums_tv.expand_all
$albums_tv.selection.select_iter($albums_ts.iter_first)
end
}
})
+ show_password_protections
end
}
end
$albums_tv = Gtk::TreeView.new
$albums_tv.set_size_request(120, -1)
- renderer = Gtk::CellRendererText.new
- column = Gtk::TreeViewColumn.new('', renderer, { :text => 0 })
- $albums_tv.append_column(column)
+ $albums_tv.append_column(Gtk::TreeViewColumn.new('', Gtk::CellRendererPixbuf.new, { :pixbuf => 2 }))
+ $albums_tv.append_column(tcol = Gtk::TreeViewColumn.new('', Gtk::CellRendererText.new, { :text => 0 }))
+ $albums_tv.expander_column = tcol
$albums_tv.set_headers_visible(false)
$albums_tv.selection.signal_connect('changed') { |w|
push_mousecursor_wait
end
}
- $albums_ts = Gtk::TreeStore.new(String, String)
+ $albums_ts = Gtk::TreeStore.new(String, String, Gdk::Pixbuf)
$albums_tv.set_model($albums_ts)
$albums_tv.signal_connect('realize') { $albums_tv.grab_focus }