예제 #1
0
        /// <summary>
        /// Initializes a new instance of class.
        /// </summary>
        /// <param name="plugin">Plugin.</param>
        /// <param name="list">List of actions.</param>
        public ActionsPreferencesPage(Actions plugin, ListStore list)
        {
            this.Build();
            this.plugin = plugin;
            this.list = list;
            this.enable.Active = Core.Settings.Instance[SettingsKeys.Enable].AsBoolean();

            TreeViewColumn column = new TreeViewColumn();
            column.Title = Catalog.GetString("Label");
            CellRendererText cell = new CellRendererText();
            column.PackStart(cell, true);
            column.SetCellDataFunc(cell, delegate (TreeViewColumn col, CellRenderer c, TreeModel m, TreeIter i)
            {
                Action a = (Action)m.GetValue(i, 0);
                ((CellRendererText)c).Text = a.Label;
            });
            this.actions.AppendColumn(column);

            column = new TreeViewColumn();
            column.Title = Catalog.GetString("Content");
            cell = new CellRendererText();
            column.PackStart(cell, true);
            column.SetCellDataFunc(cell, delegate (TreeViewColumn col, CellRenderer c, TreeModel m, TreeIter i)
            {
                Action a = (Action)m.GetValue(i, 0);
                ((CellRendererText)c).Text = a.Content;
            });
            this.actions.AppendColumn(column);

            this.actions.Model = list;
            this.actions.ShowAll();

            this.SetActionsSensitivity();
            this.handleEvents = true;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of class.
        /// </summary>
        /// <param name="plugin">Plugin.</param>
        /// <param name="list">List of actions.</param>
        public EditActionWindow(Actions plugin, ListStore list)
            : base(WindowType.Toplevel)
        {
            this.Build();
            this.list = list;
            this.plugin = plugin;

            try
            {
                this.Icon = IconTheme.Default.LoadIcon("glippy", 128, IconLookupFlags.GenericFallback);
            }
            catch (Exception ex)
            {
                Core.Tools.PrintInfo(ex, this.GetType());
            }

            this.Destroyed += (s, e) => this.Purge();
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of class.
 /// </summary>
 /// <param name="plugin">Plugin.</param>
 /// <param name="list">List of plugins.</param>
 /// <param name="action">Edited action.</param>
 /// <param name="path">Tree path of edited element.</param>
 /// <param name="iter">Tree iterator of edited element.</param>
 public EditActionWindow(Actions plugin, ListStore list, Action action, TreePath path, TreeIter iter)
     : this(plugin, list)
 {
     this.action = action;
     this.iter = iter;
     this.path = path;
     this.label.Text = action.Label;
     this.content.Buffer.Text = action.Content;
     this.Title = Catalog.GetString("Edit action");
 }