using System; using Gtk; using Glade; namespace AmicEditor { public class SaveFileWindow2 : Dialog { //[Widget] Gtk.ColorButton CatFontColor; [Widget] Gtk.Dialog ChooseFile; //[Widget] Gtk.Widget dialogvbox1; //[Widget] Gtk.FileChooserWidget dialogvbox1; [Widget] Gtk.Button btCancel; [Widget] Gtk.Button BtOk; [Widget] Gtk.Image ImgSel; // NOT USED [Widget] Gtk.Button BtGeneral; // NOT USED [Widget] Gtk.Button BtCustom; //[Widget] Gtk.FileChooserWidget ImgSelectorWidget; [Widget] Gtk.FileChooserWidget ImgSelectorWidget=new Gtk.FileChooserWidget(Gtk.FileChooserAction.Open); string orig_img=""; // Ruta completa de la imatge original bool ImageIsValid; string pathGeneral=""; string pathCustom=""; string filename=""; string linkDefault=""; string linkCustom=""; public SaveFileWindow2 (string _filename) { Application.Init(); Glade.XML gxml = new Glade.XML(null, "SaveFileWindow.glade", "ChooseFile", null); gxml.Autoconnect(this); pathGeneral=Preferences.dir_img; pathCustom=Preferences.dir_img_custom; filename=_filename; // Links a les carpetes d'imatges linkDefault=Preferences.link_default_image; linkCustom=Preferences.link_custom_image; // Comprovem si la imatge és a la galeria Custom if(System.IO.File.Exists(pathCustom+"/"+filename)) orig_img=pathCustom+"/"+filename; // imatge Original Actualitzada else //if(System.IO.File.Exists(pathGeneral+"/"+filename)) // En cas contrari busquem a la galeria general orig_img=pathGeneral+"/"+filename; // imatge Original Actualitzada /*else { orig_img=pathGeneral+"/"; // imatge Original Actualitzada }*/ // Afegim els enllaços... //ImgSelectorWidget.AddShortcutFolder(pathGeneral); //ImgSelectorWidget.AddShortcutFolder(pathCustom); Console.WriteLine("****************************************************************"); //Console.WriteLine(ImgSelectorWidget); Console.WriteLine(ImgSelectorWidget.Uris.Length); foreach (string st in ImgSelectorWidget.Uris){ Console.WriteLine(st); } Console.WriteLine("****************************************************************"); ImgSelectorWidget.AddShortcutFolder(linkCustom); ImgSelectorWidget.AddShortcutFolder(linkDefault); //ImgSelectorWidget.AddShortcutFolder("/var/lib/lliurex-amic/Galeria Personal"); Console.WriteLine("****************************************************************"); Console.WriteLine(ImgSelectorWidget.Uris); Console.WriteLine(ImgSelectorWidget.Uris.Length); foreach (string st in ImgSelectorWidget.Uris){ Console.WriteLine(st); } Console.WriteLine("****************************************************************"); // Afegit el filtre d'imatges Gtk.FileFilter filter=new Gtk.FileFilter(); filter.Name="Images"; filter.AddMimeType("image/png"); filter.AddMimeType("image/jpeg"); filter.AddMimeType("image/gif"); filter.AddPattern("*.bmp"); filter.AddPattern("*.tif"); filter.AddPattern("*.tga"); ImgSelectorWidget.AddFilter(filter); // ImgSelectorWidget.RemoveShortcutFolder("*"); //ImgSelectorWidget.RemoveShortcutFolder("/usr/share/lliurex-amic/resources"); //Console.WriteLine("***********+"); //Console.WriteLine(ImgSelectorWidget.ShortcutFolders.); /*Console.WriteLine(carpetes.Length); for (int i=0;i