protected void OnBtnDeleteIFiClicked(object sender, EventArgs e) { TreeSelection ts = tvIgnoreFiles.Selection; TreeIter ti = new TreeIter(); ts.GetSelected(out ti); TreePath[] tp = ts.GetSelectedRows(); if (tp.Length < 1) { return; } IgnoreFolder iFol = (IgnoreFolder)tvIgnoreFiles.Model.GetValue(ti, 3); if (iFol == null) { return; } MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, MainClass.Languages.Translate("delete_resolution", iFol.Folder), "", Gtk.MessageType.Question, parentWindow); int result = md.ShowDialog(); if (result != (int)Gtk.ResponseType.Yes) { return; } ignoreFile.Remove(iFol); storeIFi.Remove(ref ti); }
protected void OnBtnEditIFiClicked(object sender, EventArgs e) { TreeSelection ts = tvIgnoreFiles.Selection; TreeIter ti = new TreeIter(); ts.GetSelected(out ti); TreePath[] tp = ts.GetSelectedRows(); if (tp.Length < 1) { return; } IgnoreFolder iFol = (IgnoreFolder)tvIgnoreFiles.Model.GetValue(ti, 3); if (String.IsNullOrEmpty(iFol.Folder)) { return; } EntryDialog ed = new EntryDialog(iFol.Folder, MainClass.Languages.Translate("new_name"), parentWindow); int result = ed.Run(); if (result == (int)ResponseType.Ok) { if (!String.IsNullOrEmpty(ed.TextEntry)) { iFol.Folder = ed.TextEntry; storeIFi.SetValues(ti, ed.TextEntry, iFol.IsForIde, iFol.IsForPublish, iFol); } } ed.Destroy(); }
protected void OnBtnAddIFiClicked(object sender, EventArgs e) { EntryDialog ed = new EntryDialog("", MainClass.Languages.Translate("name"), parentWindow); int result = ed.Run(); if (result == (int)ResponseType.Ok) { if (!String.IsNullOrEmpty(ed.TextEntry)) { IgnoreFolder ifol = new IgnoreFolder(ed.TextEntry, true, true); storeIFi.AppendValues(ed.TextEntry, true, true, ifol); ignoreFile.Add(ifol); } } ed.Destroy(); }
public GlobalOptionsWidget(Gtk.Window parent) { parentWindow = parent; this.Build(); this.chbShowUnsupportDevic.Sensitive = false; feLib = new FavoriteEntry(NavigationBar.NavigationType.libs); feLib.IsFolder = true; fePublishTool = new FavoriteEntry(NavigationBar.NavigationType.publish); fePublishTool.IsFolder = true; feEmulator = new FavoriteEntry(NavigationBar.NavigationType.emulator); feEmulator.IsFolder = true; if (!String.IsNullOrEmpty(MainClass.Settings.EmulatorDirectory)) { feEmulator.Path = MainClass.Settings.EmulatorDirectory; } if (!String.IsNullOrEmpty(MainClass.Settings.LibDirectory)) { feLib.Path = MainClass.Settings.LibDirectory; } if (!String.IsNullOrEmpty(MainClass.Settings.PublishDirectory)) { fePublishTool.Path = MainClass.Settings.PublishDirectory; } table1.Attach(fePublishTool, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); table1.Attach(feLib, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); table1.Attach(feEmulator, 1, 2, 2, 3, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); fontbutton1.FontName = MainClass.Settings.ConsoleTaskFont; chbAutoselectProject.Active = MainClass.Settings.AutoSelectProject; chbOpenLastOpenedW.Active = MainClass.Settings.OpenLastOpenedWorkspace; chbShowUnsupportDevic.Active = MainClass.Settings.ShowUnsupportedDevices; chbShowDebugDevic.Active = MainClass.Settings.ShowDebugDevices; cbBackground.UseAlpha = false; cbBackground.Color = new Gdk.Color(MainClass.Settings.BackgroundColor.Red, MainClass.Settings.BackgroundColor.Green, MainClass.Settings.BackgroundColor.Blue); ignoreFolder = new List <IgnoreFolder>(MainClass.Settings.IgnoresFolders.ToArray()); tvIgnoreFolder.AppendColumn(MainClass.Languages.Translate("name"), new Gtk.CellRendererText(), "text", 0); CellRendererToggle crt = new CellRendererToggle(); crt.Activatable = true; crt.Toggled += delegate(object o, ToggledArgs args) { TreeIter iter; if (storeIFo.GetIter(out iter, new TreePath(args.Path))) { bool old = (bool)storeIFo.GetValue(iter, 1); IgnoreFolder iFol = (IgnoreFolder)storeIFo.GetValue(iter, 3); iFol.IsForIde = !old; storeIFo.SetValue(iter, 1, !old); } }; tvIgnoreFolder.AppendColumn(MainClass.Languages.Translate("ignore_for_ide"), crt, "active", 1); CellRendererToggle crt2 = new CellRendererToggle(); crt2.Activatable = true; crt2.Toggled += delegate(object o, ToggledArgs args) { TreeIter iter; if (storeIFo.GetIter(out iter, new TreePath(args.Path))) { bool old = (bool)storeIFo.GetValue(iter, 2); IgnoreFolder iFol = (IgnoreFolder)storeIFo.GetValue(iter, 3); //CombinePublish cp =(CombinePublish) fontListStore.GetValue(iter,2); //cp.IsSelected = !old; iFol.IsForPublish = !old; storeIFo.SetValue(iter, 2, !old); } }; tvIgnoreFolder.AppendColumn(MainClass.Languages.Translate("ignore_for_Pub"), crt2, "active", 2); tvIgnoreFolder.Model = storeIFo; foreach (IgnoreFolder ignoref in MainClass.Settings.IgnoresFolders) { storeIFo.AppendValues(ignoref.Folder, ignoref.IsForIde, ignoref.IsForPublish, ignoref); } /* Ignore Files */ ignoreFile = new List <IgnoreFolder>(MainClass.Settings.IgnoresFiles.ToArray()); tvIgnoreFiles.AppendColumn(MainClass.Languages.Translate("name"), new Gtk.CellRendererText(), "text", 0); CellRendererToggle crtFi = new CellRendererToggle(); crtFi.Activatable = true; crtFi.Toggled += delegate(object o, ToggledArgs args) { TreeIter iter; if (storeIFi.GetIter(out iter, new TreePath(args.Path))) { bool old = (bool)storeIFi.GetValue(iter, 1); IgnoreFolder iFol = (IgnoreFolder)storeIFi.GetValue(iter, 3); iFol.IsForIde = !old; storeIFi.SetValue(iter, 1, !old); } }; tvIgnoreFiles.AppendColumn(MainClass.Languages.Translate("ignore_for_ide"), crtFi, "active", 1); CellRendererToggle crtFi2 = new CellRendererToggle(); crtFi2.Activatable = true; crtFi2.Toggled += delegate(object o, ToggledArgs args) { TreeIter iter; if (storeIFi.GetIter(out iter, new TreePath(args.Path))) { bool old = (bool)storeIFi.GetValue(iter, 2); IgnoreFolder iFol = (IgnoreFolder)storeIFi.GetValue(iter, 3); iFol.IsForPublish = !old; storeIFi.SetValue(iter, 2, !old); } }; tvIgnoreFiles.AppendColumn(MainClass.Languages.Translate("ignore_for_Pub"), crtFi2, "active", 2); tvIgnoreFiles.Model = storeIFi; foreach (IgnoreFolder ignoref in MainClass.Settings.IgnoresFiles) { storeIFi.AppendValues(ignoref.Folder, ignoref.IsForIde, ignoref.IsForPublish, ignoref); } /**/ Gdk.Pixbuf default_pixbuf = null; string file = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-menu.png"); if (System.IO.File.Exists(file)) { default_pixbuf = new Gdk.Pixbuf(file); popupColor = new Gtk.Menu(); CreateMenu(); Gtk.Button btnClose = new Gtk.Button(new Gtk.Image(default_pixbuf)); btnClose.TooltipText = MainClass.Languages.Translate("select_color"); btnClose.Relief = Gtk.ReliefStyle.None; btnClose.CanFocus = false; btnClose.WidthRequest = btnClose.HeightRequest = 22; popupColor.AttachToWidget(btnClose, new Gtk.MenuDetachFunc(DetachWidget)); btnClose.Clicked += delegate { popupColor.Popup(null, null, new Gtk.MenuPositionFunc(GetPosition), 3, Gtk.Global.CurrentEventTime); }; table1.Attach(btnClose, 2, 3, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); popupColor.ShowAll(); } }