[Monodevelop-patches-list] r1737 - in trunk/MonoDevelop/src/AddIns/Misc/AddInManager: . Gui
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Jun 11 01:08:32 EDT 2004
Author: jluke
Date: 2004-06-11 01:08:32 -0400 (Fri, 11 Jun 2004)
New Revision: 1737
Added:
trunk/MonoDevelop/src/AddIns/Misc/AddInManager/ChangeLog
Modified:
trunk/MonoDevelop/src/AddIns/Misc/AddInManager/Gui/AddInManagerDialog.cs
Log:
make toggle work
Added: trunk/MonoDevelop/src/AddIns/Misc/AddInManager/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/Misc/AddInManager/ChangeLog 2004-06-11 04:43:45 UTC (rev 1736)
+++ trunk/MonoDevelop/src/AddIns/Misc/AddInManager/ChangeLog 2004-06-11 05:08:32 UTC (rev 1737)
@@ -0,0 +1,3 @@
+2004-06-11 John Luke <jluke at cfl.rr.com>
+
+ initial implementation
Modified: trunk/MonoDevelop/src/AddIns/Misc/AddInManager/Gui/AddInManagerDialog.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/Misc/AddInManager/Gui/AddInManagerDialog.cs 2004-06-11 04:43:45 UTC (rev 1736)
+++ trunk/MonoDevelop/src/AddIns/Misc/AddInManager/Gui/AddInManagerDialog.cs 2004-06-11 05:08:32 UTC (rev 1737)
@@ -9,6 +9,8 @@
{
public class AddInManagerDialog : Dialog
{
+ TreeStore store;
+
public AddInManagerDialog ()
{
this.BorderWidth = 12;
@@ -18,30 +20,45 @@
ScrolledWindow sw = new ScrolledWindow ();
TreeView tv = new TreeView ();
- tv.AppendColumn (GettextCatalog.GetString ("Enabled"), new CellRendererToggle (), "active", 0);
+
+ CellRendererToggle toggle = new CellRendererToggle ();
+ toggle.Toggled += OnCellToggled;
+ tv.AppendColumn (GettextCatalog.GetString ("Enabled"), toggle, "active", 0);
tv.AppendColumn (GettextCatalog.GetString ("Title"), new CellRendererText (), "text", 1);
tv.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 2);
sw.Add (tv);
this.AddButton (Gtk.Stock.Close, ResponseType.Close);
- tv.Model = LoadAddIns ();
+ LoadAddIns ();
+ tv.Model = store;
this.VBox.Add (sw);
this.ShowAll ();
}
- TreeStore LoadAddIns ()
+ void LoadAddIns ()
{
- TreeStore store = new TreeStore (typeof (bool), typeof (string), typeof (string));
+ store = new TreeStore (typeof (bool), typeof (string), typeof (string));
AddInCollection addins = AddInTreeSingleton.AddInTree.AddIns;
foreach (AddIn a in addins)
{
store.AppendValues (true, a.Name, a.Version);
}
-
- return store;
}
+
+ void OnCellToggled (object o, ToggledArgs args)
+ {
+ CellRendererToggle toggle = (CellRendererToggle) o;
+
+ TreeIter iter;
+ if (store.GetIterFromString(out iter, args.Path))
+ {
+ bool val = (bool) store.GetValue(iter, 0);
+ store.SetValue (iter, 0, !val);
+ }
+
+ }
}
}
More information about the Monodevelop-patches-list
mailing list