using System; namespace zero { namespace netboot { [System.ComponentModel.ToolboxItem(true)] public partial class CustomButton : Gtk.Bin { public string url; public CustomButton (string url) { this.Build (); this.url=url; int index=url.LastIndexOf("/"); //buttonLabel.Text="Download " + url.Substring(index+1); buttonLabel.Markup=Mono.Unix.Catalog.GetString("Download") + " " + url.Substring(index+1) + ""; } public void setImage(string icon_name) { image153.Pixbuf = Gdk.Pixbuf.LoadFromResource(icon_name); } protected virtual void OnButton14Clicked (object sender, System.EventArgs e) { zero.netboot.DownloadInfo info=new zero.netboot.DownloadInfo(); int index=url.LastIndexOf("/"); string file=url.Substring(index+1); zero.netboot.Core core=zero.netboot.Core.getCore(); info.newDownload( core.confman.options["default_save_path"] + file, url); core.sqlman.insert_download(info); info.id=core.sqlman.get_last_download_id(); core.downList.Add(info); core.downwidget.populateDownloads(); core.isolistwin.Hide(); } } } }