public CS_PlayListAdmin(CS_PlayListsView plsview,CS_PlayListsModel mdl,CS_PlayListCollection cl)
        {
            _col=cl;
            _model=mdl;
            Gtk.HBox hb=new Gtk.HBox();

            Gtk.Button _add=new Gtk.Button(Gtk.Stock.Add);
            _add.Clicked+=delegate (object sender,EventArgs args) {
                OnAddPls();
            };

            Gtk.Button _remove=new Gtk.Button(Gtk.Stock.Remove);
            _remove.Clicked+=delegate (object sender,EventArgs args) {
                OnRemovePls();
            };

            hb.PackStart (_add);
            hb.PackStart (_remove);

            plsscroll=new Gtk.ScrolledWindow();
            plsscroll.Add (plsview);

            _pls=null;
            _pls_name=new Gtk.Entry();
            _pls_model=new CS_PlayListModel();
            _pls_view=new CS_PlayListView();
            _pls_view.SetModel (_pls_model);
            plscroll=new Gtk.ScrolledWindow();
            plscroll.Add (_pls_view);

            _pls_view.DragEnd+=delegate(object sender,DragEndArgs args) {
                Console.WriteLine (args);
            };
            Gtk.VBox plsvbox=new Gtk.VBox();
            plsvbox.PackStart (_pls_name,false,false,2);
            plsvbox.PackEnd (plscroll);

            Gtk.VPaned vpn=new Gtk.VPaned();
            vpn.Add1 (plsscroll);
            vpn.Add2 (plsvbox);

            base.PackStart (hb,false,false,2);
            base.PackEnd (vpn);

            base.ShowAll ();

            mdl.SetListener (delegate(CS_PlayList pls) {
                _pls=pls;
                _pls_model.SetPlayList (_pls);
                _pls_name.Text=_pls.PlsName;
            });
        }
Esempio n. 2
0
        public CS_PlayListAdmin(CS_PlayListsView plsview, CS_PlayListsModel mdl, CS_PlayListCollection cl)
        {
            _col   = cl;
            _model = mdl;
            Gtk.HBox hb = new Gtk.HBox();

            Gtk.Button _add = new Gtk.Button(Gtk.Stock.Add);
            _add.Clicked += delegate(object sender, EventArgs args) {
                OnAddPls();
            };

            Gtk.Button _remove = new Gtk.Button(Gtk.Stock.Remove);
            _remove.Clicked += delegate(object sender, EventArgs args) {
                OnRemovePls();
            };

            hb.PackStart(_add);
            hb.PackStart(_remove);

            plsscroll = new Gtk.ScrolledWindow();
            plsscroll.Add(plsview);

            _pls       = null;
            _pls_name  = new Gtk.Entry();
            _pls_model = new CS_PlayListModel();
            _pls_view  = new CS_PlayListView();
            _pls_view.SetModel(_pls_model);
            plscroll = new Gtk.ScrolledWindow();
            plscroll.Add(_pls_view);

            _pls_view.DragEnd += delegate(object sender, DragEndArgs args) {
                Console.WriteLine(args);
            };
            Gtk.VBox plsvbox = new Gtk.VBox();
            plsvbox.PackStart(_pls_name, false, false, 2);
            plsvbox.PackEnd(plscroll);

            Gtk.VPaned vpn = new Gtk.VPaned();
            vpn.Add1(plsscroll);
            vpn.Add2(plsvbox);

            base.PackStart(hb, false, false, 2);
            base.PackEnd(vpn);

            base.ShowAll();

            mdl.SetListener(delegate(CS_PlayList pls) {
                _pls = pls;
                _pls_model.SetPlayList(_pls);
                _pls_name.Text = _pls.PlsName;
            });
        }
Esempio n. 3
0
        /// <summary>Crea el notebook donde están los campos
        /// de edición de texto del ensamblador.</summary>
        /// <returns>El notebook.</returns>

        private Notebook CrearNotebook()
        {
            Notebook not = new Notebook();


            Gtk.HPaned panel1 = new Gtk.HPaned();
            panel1.Add1(CrearEditorEnsamblador());
            panel1.Add2(CrearResultadoEnsamblador());
            panel1.Position = 340;

            Gtk.VPaned panel2 = new Gtk.VPaned();
            panel2.Add1(panel1);
            panel2.Add2(CrearErroresEnsamblador());
            panel2.Position = 350;

            not.AppendPage(
                panel2,
                new Gtk.Label(GetText("Ventana_Notebook_Codigo"))
                );

            panelMemoria   = new PanelMemoria();
            panelRegistros = new PanelRegistros();

            Gtk.Table memreg = new Gtk.Table(1, 2, true);
            memreg.Attach(panelMemoria, 0, 1, 0, 1);
            memreg.Attach(panelRegistros, 1, 2, 0, 1);
            not.AppendPage(
                memreg,
                new Gtk.Label(
                    String.Format(
                        "{0} - {1}",
                        GetText("Ventana_Notebook_Memoria"),
                        GetText("Ventana_Notebook_Registros")
                        )
                    )
                );


            dArea = new PanelDibujo();
            not.AppendPage(
                dArea,
                new Gtk.Label(GetText("Ventana_Notebook_rdd"))
                );

            return(not);
        }
Esempio n. 4
0
        //private Client.GTK.Menu refreshToolStripMenuIteme = new Client.GTK.Menu("Refresh");

        private void Build()
        {
            global::Stetic.Gui.Initialize(this);
            // Widget MainWindow
            this.Name = "MainWindow";
            this.Title = messages.Localize("[[channelinfo-title]]") + ": " + channel.Name;
            this.WindowPosition = ((global::Gtk.WindowPosition)(4));
            // Container child MainWindow.Gtk.Container+ContainerChild
            this.notebook1 = new global::Gtk.Notebook();
            this.notebook1.CanFocus = true;
            this.notebook1.Name = "notebook1";
            this.notebook1.CurrentPage = 0;
            // Container child notebook1.Gtk.Notebook+NotebookChild
            this.vpaned01 = new Gtk.VPaned();
            this.vbox1 = new global::Gtk.VBox();
            this.vbox1.Name = "vbox1";
            this.vbox1.Spacing = 6;
            // Container child vbox1.Gtk.Box+BoxChild
            this.frame4 = new global::Gtk.Frame();
            this.frame4.Name = "frame4";
            this.frame4.ShadowType = ((global::Gtk.ShadowType)(0));
            // Container child frame4.Gtk.Container+ContainerChild
            this.GtkAlignment3 = new global::Gtk.Alignment(0F, 0F, 1F, 1F);
            this.GtkAlignment3.Name = "GtkAlignment3";
            this.GtkAlignment3.HeightRequest = 60;
            this.GtkAlignment3.LeftPadding = ((uint)(12));
            // Container child GtkAlignment3.Gtk.Container+ContainerChild
            this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow.Name = "GtkScrolledWindow";
            this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
            // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
            this.textview1 = new global::Gtk.TextView();
            this.textview1.CanFocus = true;
            this.textview1.Name = "textview1";
            this.textview1.HeightRequest = 60;
            this.GtkScrolledWindow.Add(this.textview1);
            this.GtkAlignment3.Add(this.GtkScrolledWindow);
            //global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(GtkAlignment3));
            //w2.Position = 0;
            //w2.Expand = false;
            this.frame4.Add(this.GtkAlignment3);
            this.GtkLabel = new global::Gtk.Label();
            this.GtkLabel.Name = "GtkLabel";
            this.GtkLabel.LabelProp = "Topic was last set on " + Core.ConvertFromUNIXToString(channel.TopicDate.ToString()) + " by " + channel.TopicUser;
            if (channel.TopicDate == 0)
            {
                this.GtkLabel.LabelProp = "Topic (information about current topic isn't present)";
            }
            this.GtkLabel.UseMarkup = true;
            this.frame4.LabelWidget = this.GtkLabel;
            //this.vbox1.Add(this.frame4);
            this.vpaned01.Add(this.frame4);
            global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.frame4]));
            w4.Position = 0;
            // Container child vbox1.Gtk.Box+BoxChild
            this.frame5 = new global::Gtk.Frame();
            this.frame5.Name = "frame5";
            this.frame5.ShadowType = ((global::Gtk.ShadowType)(0));
            // Container child frame5.Gtk.Container+ContainerChild
            this.GtkAlignment4 = new global::Gtk.Alignment(0F, 0F, 1F, 1F);
            this.GtkAlignment4.Name = "GtkAlignment4";
            this.GtkAlignment4.LeftPadding = ((uint)(12));
            // Container child GtkAlignment4.Gtk.Container+ContainerChild
            this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
            this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
            // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
            Gtk.Layout f = new Layout(new Adjustment(10, 0, 10000, 10, 10, 10), new Adjustment(10, 0, 100000, 10, 10, 10));
            ReloadModes(ref f);
            this.GtkScrolledWindow1.Add(f);
            this.GtkAlignment4.Add(this.GtkScrolledWindow1);
            this.frame5.Add(this.GtkAlignment4);
            this.GtkLabel4 = new global::Gtk.Label();
            this.GtkLabel4.Name = "GtkLabel4";
            this.GtkLabel4.LabelProp = "<b>Channel mode</b>";
            this.GtkLabel4.UseMarkup = true;
            this.frame5.LabelWidget = this.GtkLabel4;
            this.vbox1.Add(this.frame5);
            global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.frame5]));
            w8.Position = 1;
            // Container child vbox1.Gtk.Box+BoxChild
            this.button1 = new global::Gtk.Button();
            this.button1.Clicked += new EventHandler(bClose_Click);
            this.button1.CanFocus = true;
            this.button1.Name = "button1";
            this.button1.UseUnderline = true;
            this.button1.Label = "Update";
            this.vbox1.Add(this.button1);
            global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.button1]));
            w9.Position = 2;
            w9.Expand = false;
            w9.Fill = false;
            vpaned01.Add2(this.vbox1);
            this.notebook1.Add(this.vpaned01);
            // Notebook tab
            this.label1 = new global::Gtk.Label();
            this.label1.Name = "label1";
            this.label1.LabelProp = messages.get("channelinfo-t0", Core.SelectedLanguage);
            this.notebook1.SetTabLabel(this.vpaned01, this.label1);
            this.label1.ShowAll();
            // Container child notebook1.Gtk.Notebook+NotebookChild
            this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
            this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
            // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
            this.treeview5 = new global::Gtk.TreeView();
            treeview5.Selection.Mode = SelectionMode.Multiple;
            this.treeview5.Model = invites;
            this.treeview5.CanFocus = true;
            this.treeview5.Name = "treeview5";
            Gtk.TreeViewColumn invite = new TreeViewColumn();
            Gtk.CellRendererText r3 = new CellRendererText();
            Gtk.TreeViewColumn itime = new TreeViewColumn();
            Gtk.CellRendererText r2 = new CellRendererText();
            Gtk.TreeViewColumn iu = new TreeViewColumn();
            Gtk.CellRendererText r1 = new CellRendererText();
            invite.Title = "Invite";
            itime.Title = "Time";
            iu.Title = "Created by";
            invite.PackStart(r1, true);
            itime.PackStart(r2, true);
            iu.PackStart(r3, true);
            invite.AddAttribute(r1, "text", 0);
            itime.AddAttribute(r2, "text", 1);
            iu.AddAttribute(r3, "text", 2);
            treeview5.AppendColumn(invite);
            treeview5.AppendColumn(itime);
            treeview5.ButtonPressEvent += new ButtonPressEventHandler(IgnoreInvite);
            treeview5.AppendColumn(iu);
            this.GtkScrolledWindow2.Add(this.treeview5);
            this.notebook1.Add(this.GtkScrolledWindow2);
            global::Gtk.Notebook.NotebookChild w12 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1[this.GtkScrolledWindow2]));
            w12.Position = 1;
            // Notebook tab
            this.label2 = new global::Gtk.Label();
            this.label2.Name = "label2";
            this.label2.LabelProp = messages.get("channelinfo-t2", Core.SelectedLanguage);
            this.notebook1.SetTabLabel(this.GtkScrolledWindow2, this.label2);
            this.label2.ShowAll();
            // Container child notebook1.Gtk.Notebook+NotebookChild
            this.GtkScrolledWindow3 = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow3.Name = "GtkScrolledWindow3";
            this.GtkScrolledWindow3.ShadowType = ((global::Gtk.ShadowType)(1));
            // Container child GtkScrolledWindow3.Gtk.Container+ContainerChild
            this.treeview6 = new global::Gtk.TreeView();
            this.treeview6.CanFocus = true;
            this.treeview6.Selection.Mode = SelectionMode.Multiple;
            this.treeview6.Name = "treeview6";
            Gtk.TreeViewColumn exception = new TreeViewColumn();
            Gtk.CellRendererText er3 = new CellRendererText();
            Gtk.TreeViewColumn etime = new TreeViewColumn();
            Gtk.CellRendererText er2 = new CellRendererText();
            Gtk.TreeViewColumn eu = new TreeViewColumn();
            Gtk.CellRendererText er1 = new CellRendererText();
            exception.Title = "Exception";
            etime.Title = "Time";
            eu.Title = "Created by";
            exception.PackStart(er1, true);
            etime.PackStart(er2, true);
            eu.PackStart(er3, true);
            exception.AddAttribute(er1, "text", 0);
            etime.AddAttribute(er2, "text", 1);
            eu.AddAttribute(er3, "text", 2);
            treeview6.AppendColumn(exception);
            treeview6.AppendColumn(etime);
            treeview6.AppendColumn(eu);
            this.treeview6.ButtonPressEvent += new ButtonPressEventHandler(IgnoreExcept);
            this.GtkScrolledWindow3.Add(this.treeview6);
            this.notebook1.Add(this.GtkScrolledWindow3);
            global::Gtk.Notebook.NotebookChild w14 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1[this.GtkScrolledWindow3]));
            this.treeview6.Model = exceptions;
            w14.Position = 2;

            // Notebook tab
            this.label3 = new global::Gtk.Label();
            this.label3.Name = "label3";
            this.label3.LabelProp = messages.get("channelinfo-t3", Core.SelectedLanguage);
            this.notebook1.SetTabLabel(this.GtkScrolledWindow3, this.label3);
            this.label3.ShowAll();
            // Container child notebook1.Gtk.Notebook+NotebookChild
            this.GtkScrolledWindow4 = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow4.Name = "GtkScrolledWindow4";
            this.GtkScrolledWindow4.ShadowType = ((global::Gtk.ShadowType)(1));
            // Container child GtkScrolledWindow4.Gtk.Container+ContainerChild
            this.treeview7 = new global::Gtk.TreeView();
            this.treeview7.CanFocus = true;
            this.treeview7.Name = "treeview7";
            this.treeview7.ButtonPressEvent += new ButtonPressEventHandler(IgnoreBans);
            this.treeview6.PopupMenu += new PopupMenuHandler(MenuExceptions);
            this.treeview7.PopupMenu += new PopupMenuHandler(MenuBans);
            this.treeview5.PopupMenu += new PopupMenuHandler(MenuInvites);
            this.treeview7.Selection.Mode = SelectionMode.Multiple;
            this.GtkScrolledWindow4.Add(this.treeview7);
            this.treeview7.Model = bans;
            this.notebook1.Add(this.GtkScrolledWindow4);
            Gtk.TreeViewColumn ban = new TreeViewColumn();
            Gtk.CellRendererText br3 = new CellRendererText();
            Gtk.TreeViewColumn btime = new TreeViewColumn();
            Gtk.CellRendererText br2 = new CellRendererText();
            Gtk.TreeViewColumn bu = new TreeViewColumn();
            Gtk.CellRendererText br1 = new CellRendererText();
            ban.Title = "Host";
            btime.Title = "Time";
            bu.Title = "Created by";
            ban.PackStart(br1, true);
            btime.PackStart(br2, true);
            bu.PackStart(br3, true);
            ban.AddAttribute(br1, "text", 0);
            btime.AddAttribute(br2, "text", 1);
            bu.AddAttribute(br3, "text", 2);
            treeview7.AppendColumn(ban);
            treeview7.AppendColumn(btime);
            treeview7.AppendColumn(bu);
            global::Gtk.Notebook.NotebookChild w16 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1[this.GtkScrolledWindow4]));
            w16.Position = 3;
            // Notebook tab
            this.label4 = new global::Gtk.Label();
            this.label4.Name = "label4";
            this.label4.LabelProp = messages.get("channelinfo-t4", Core.SelectedLanguage);
            this.notebook1.SetTabLabel(this.GtkScrolledWindow4, this.label4);
            this.label4.ShowAll();
            this.WindowPosition = WindowPosition.Center;
            this.Icon = Gdk.Pixbuf.LoadFromResource("Client.Resources.pigeon_clip_art_hight.ico");
            this.Add(this.notebook1);
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth = 796;
            this.DefaultHeight = 511;
            this.Show();
        }
		public LogView (string filepath, bool isDirectory, Revision [] history, Repository vc) 
			: base (Path.GetFileName (filepath) + " Log")
		{
			this.vc = vc;
			this.filepath = filepath;
			this.history = history;
			
			try {
				this.vinfo = vc.GetVersionInfo (filepath, false);
			}
			catch (Exception ex) {
				MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
			}

			// Widget setup
			
			VBox box = new VBox (false, 6);
			
			widget = box;

			// Create the toolbar
			commandbar = new Toolbar ();
			commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
			commandbar.IconSize = Gtk.IconSize.Menu;
			box.PackStart (commandbar, false, false, 0);
				
			if (vinfo != null) {
				Gtk.ToolButton button = new Gtk.ToolButton (new Gtk.Image ("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString ("View Changes"));
				button.IsImportant = true;
				if (isDirectory) {
					button.Clicked += new EventHandler (DirDiffButtonClicked);
					commandbar.Insert (button, -1);
				} else {
					button.Clicked += new EventHandler (DiffButtonClicked);
					commandbar.Insert (button, -1);
					
					button = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString ("View File"));
					button.IsImportant = true;
					button.Clicked += new EventHandler (ViewTextButtonClicked);
					commandbar.Insert (button, -1);
				}
			}
			
			revertButton = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert changes from this revision"));
			revertButton.IsImportant = true;
			revertButton.Sensitive = false;
			revertButton.Clicked += new EventHandler (RevertRevisionClicked);
			commandbar.Insert (revertButton, -1);
			
			revertToButton = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert to this revision"));
			revertToButton.IsImportant = true;
			revertToButton.Sensitive = false;
			revertToButton.Clicked += new EventHandler (RevertToRevisionClicked);
			commandbar.Insert (revertToButton, -1);

			
			// A paned with two trees
			
			Gtk.VPaned paned = new Gtk.VPaned ();
			box.PackStart (paned, true, true, 0);
			
			// Create the log list
			
			loglist = new TreeView ();
			ScrolledWindow loglistscroll = new ScrolledWindow ();
			loglistscroll.ShadowType = Gtk.ShadowType.In;
			loglistscroll.Add (loglist);
			loglistscroll.HscrollbarPolicy = PolicyType.Automatic;
			loglistscroll.VscrollbarPolicy = PolicyType.Automatic;
			paned.Add1 (loglistscroll);
			((Paned.PanedChild)paned [loglistscroll]).Resize = true;
			
			TreeView changedPaths = new TreeView ();
			ScrolledWindow changedPathsScroll = new ScrolledWindow ();
			changedPathsScroll.ShadowType = Gtk.ShadowType.In;
			changedPathsScroll.HscrollbarPolicy = PolicyType.Automatic;
			changedPathsScroll.VscrollbarPolicy = PolicyType.Automatic;
			changedPathsScroll.Add (changedPaths);
			paned.Add2 (changedPathsScroll);
			((Paned.PanedChild)paned [changedPathsScroll]).Resize = false;

			widget.ShowAll ();
			
			// Revision list setup
			
			CellRendererText textRenderer = new CellRendererText ();
			textRenderer.Yalign = 0;
			
			TreeViewColumn colRevNum = new TreeViewColumn (GettextCatalog.GetString ("Revision"), textRenderer, "text", 0);
			TreeViewColumn colRevDate = new TreeViewColumn (GettextCatalog.GetString ("Date"), textRenderer, "text", 1);
			TreeViewColumn colRevAuthor = new TreeViewColumn (GettextCatalog.GetString ("Author"), textRenderer, "text", 2);
			TreeViewColumn colRevMessage = new TreeViewColumn (GettextCatalog.GetString ("Message"), textRenderer, "text", 3);
			
			loglist.AppendColumn (colRevNum);
			loglist.AppendColumn (colRevDate);
			loglist.AppendColumn (colRevAuthor);
			loglist.AppendColumn (colRevMessage);
			
			ListStore logstore = new ListStore (typeof (string), typeof (string), typeof (string), typeof (string));
			loglist.Model = logstore;
			 
			foreach (Revision d in history) {
				logstore.AppendValues(
					d.ToString (),
					d.Time.ToString (),
					d.Author,
					d.Message == String.Empty ? GettextCatalog.GetString ("(No message)") : d.Message);
			}

			// Changed paths list setup
			
			changedpathstore = new ListStore (typeof(Gdk.Pixbuf), typeof (string), typeof(Gdk.Pixbuf), typeof (string));
			changedPaths.Model = changedpathstore;
			
			TreeViewColumn colOperation = new TreeViewColumn ();
			CellRendererText crt = new CellRendererText ();
			var crp = new CellRendererPixbuf ();
			colOperation.Title = GettextCatalog.GetString ("Operation");
			colOperation.PackStart (crp, false);
			colOperation.PackStart (crt, true);
			colOperation.AddAttribute (crp, "pixbuf", 0);
			colOperation.AddAttribute (crt, "text", 1);
			changedPaths.AppendColumn (colOperation);
			
			TreeViewColumn colChangedPath = new TreeViewColumn ();
			crp = new CellRendererPixbuf ();
			crt = new CellRendererText ();
			colChangedPath.Title = GettextCatalog.GetString ("File Path");
			colChangedPath.PackStart (crp, false);
			colChangedPath.PackStart (crt, true);
			colChangedPath.AddAttribute (crp, "pixbuf", 2);
			colChangedPath.AddAttribute (crt, "text", 3);
			changedPaths.AppendColumn (colChangedPath);
			
			loglist.Selection.Changed += new EventHandler (TreeSelectionChanged);
		}
Esempio n. 6
0
		void CreateControlFromInfo ()
		{
			this.vc = info.Item.Repository;
			this.filepath = info.Item.Path;
			
			
			
			// Widget setup
			VBox box = new VBox (false, 6);
			
			widget = box;

			// Create the toolbar
			commandbar = new Toolbar ();
			commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
			commandbar.IconSize = Gtk.IconSize.Menu;
			box.PackStart (commandbar, false, false, 0);
				
			if (vinfo != null) {
				Gtk.ToolButton button = new Gtk.ToolButton (new Gtk.Image ("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString ("View Changes"));
				button.IsImportant = true;
				button.Clicked += new EventHandler (DiffButtonClicked);
				commandbar.Insert (button, -1);
				
				button = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString ("View File"));
				button.IsImportant = true;
				button.Clicked += new EventHandler (ViewTextButtonClicked);
				commandbar.Insert (button, -1);
			}
			
			revertButton = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert changes from this revision"));
			revertButton.IsImportant = true;
			revertButton.Sensitive = false;
			revertButton.Clicked += new EventHandler (RevertRevisionClicked);
			commandbar.Insert (revertButton, -1);
			
			revertToButton = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert to this revision"));
			revertToButton.IsImportant = true;
			revertToButton.Sensitive = false;
			revertToButton.Clicked += new EventHandler (RevertToRevisionClicked);
			commandbar.Insert (revertToButton, -1);

			
			// A paned with two trees
			
			Gtk.VPaned paned = new Gtk.VPaned ();
			box.PackStart (paned, true, true, 0);
			
			// Create the log list
			
			loglist = new TreeView ();
			ScrolledWindow loglistscroll = new ScrolledWindow ();
			loglistscroll.ShadowType = Gtk.ShadowType.In;
			loglistscroll.Add (loglist);
			loglistscroll.HscrollbarPolicy = PolicyType.Automatic;
			loglistscroll.VscrollbarPolicy = PolicyType.Automatic;
			paned.Add1 (loglistscroll);
			((Paned.PanedChild)paned [loglistscroll]).Resize = true;
			
			TreeView changedPaths = new TreeView ();
			ScrolledWindow changedPathsScroll = new ScrolledWindow ();
			changedPathsScroll.ShadowType = Gtk.ShadowType.In;
			changedPathsScroll.HscrollbarPolicy = PolicyType.Automatic;
			changedPathsScroll.VscrollbarPolicy = PolicyType.Automatic;
			changedPathsScroll.Add (changedPaths);
			paned.Add2 (changedPathsScroll);
			((Paned.PanedChild)paned [changedPathsScroll]).Resize = false;

			widget.ShowAll ();
			
			// Revision list setup
			
			CellRendererText textRenderer = new CellRendererText ();
			textRenderer.Yalign = 0;
			
			TreeViewColumn colRevNum = new TreeViewColumn (GettextCatalog.GetString ("Revision"), textRenderer, "text", 0);
			colRevNum.Resizable = true;
			TreeViewColumn colRevDate = new TreeViewColumn (GettextCatalog.GetString ("Date"), textRenderer, "text", 1);
			colRevDate.Resizable = true;
			TreeViewColumn colRevAuthor = new TreeViewColumn (GettextCatalog.GetString ("Author"), textRenderer, "text", 2);
			colRevAuthor.Resizable = true;
			TreeViewColumn colRevMessage = new TreeViewColumn (GettextCatalog.GetString ("Message"), textRenderer, "text", 3);
			colRevMessage.Resizable = true;
			
			loglist.AppendColumn (colRevNum);
			loglist.AppendColumn (colRevDate);
			loglist.AppendColumn (colRevAuthor);
			loglist.AppendColumn (colRevMessage);
			
			logstore = new ListStore (typeof (string), typeof (string), typeof (string), typeof (string));
			loglist.Model = logstore;

			// Changed paths list setup
			
			changedpathstore = new ListStore (typeof(Gdk.Pixbuf), typeof (string), typeof(Gdk.Pixbuf), typeof (string));
			changedPaths.Model = changedpathstore;
			
			TreeViewColumn colOperation = new TreeViewColumn ();
			CellRendererText crt = new CellRendererText ();
			var crp = new CellRendererPixbuf ();
			colOperation.Title = GettextCatalog.GetString ("Operation");
			colOperation.PackStart (crp, false);
			colOperation.PackStart (crt, true);
			colOperation.AddAttribute (crp, "pixbuf", 0);
			colOperation.AddAttribute (crt, "text", 1);
			changedPaths.AppendColumn (colOperation);
			
			TreeViewColumn colChangedPath = new TreeViewColumn ();
			crp = new CellRendererPixbuf ();
			crt = new CellRendererText ();
			colChangedPath.Title = GettextCatalog.GetString ("File Path");
			colChangedPath.PackStart (crp, false);
			colChangedPath.PackStart (crt, true);
			colChangedPath.AddAttribute (crp, "pixbuf", 2);
			colChangedPath.AddAttribute (crt, "text", 3);
			changedPaths.AppendColumn (colChangedPath);
			
			loglist.Selection.Changed += new EventHandler (TreeSelectionChanged);
			
			
			info.Updated += delegate {
				history = this.info.History;
				vinfo   = this.info.VersionInfo;
				ShowHistory ();
			};
			history = this.info.History;
			vinfo   = this.info.VersionInfo;
			ShowHistory ();
		}
Esempio n. 7
0
        private void Build()
        {
            // toolbar
            toolbar = new Toolbar();
            //			toolbar.MarginLeft = 10;
            this.Add (toolbar);
            var toolbarBox = (Gtk.Box.BoxChild)this [toolbar];
            toolbarBox.Fill = false;
            toolbarBox.Expand = false;
            toolbarBox.Position = 0;

            // toolbar choose database dropdown
            Gtk.Label l = new Gtk.Label(string.Format("Current database: {0}", this.ServerConnection.Name));
            ToolItem lTi = new ToolItem ();
            lTi.Add (l);
            toolbar.Insert (lTi, 0);

            // toolbar exec button
            ToolButton execBtn = new ToolButton (Gtk.Stock.MediaPlay);
            execBtn.Clicked += (sender, e) => this.ExecuteCommand();
            toolbar.Insert (execBtn, 1);

            // vpaned
            vpaned = new VPaned();
            this.Add (vpaned);

            // Sql area textbox wrapped in a scrolled window
            ScrolledWindow sqlAreaScroll = new ScrolledWindow();
            vpaned.Add1 (sqlAreaScroll);
            sqlArea = new Mono.TextEditor.TextEditor();
            sqlArea.Text = string.Format ("{0}{0}", System.Environment.NewLine);
            sqlArea.SetCaretTo (1, 1);
            sqlArea.CanFocus = true;
            sqlArea.IsFocus = true;

            var syntaxMode = loadSyntaxMode ();
            sqlArea.Document.SyntaxMode = syntaxMode;

            sqlAreaScroll.Add (sqlArea);

            // result tabs
            resultNoteBook = new Notebook ();
            sqlResultContainer = new Gtk.ScrolledWindow ();
            resultNoteBook.Add (sqlResultContainer);
            resultNoteBook.SetTabLabel (sqlResultContainer, new Label ("Results"));

            outputView = new TextView ();
            outputView.Editable = false;
            resultNoteBook.Add (outputView);
            resultNoteBook.SetTabLabel (outputView, new Label ("Output"));

            vpaned.Add2 (resultNoteBook);

            vpaned.Position = 180;
        }
Esempio n. 8
0
        public LogView(VersionControlDocumentInfo info) : base("Log")
        {
            this.info     = info;
            this.vc       = info.Item.Repository;
            this.filepath = info.Item.Path;

            info.Updated += delegate {
                history = this.info.History;
                vinfo   = this.info.VersionInfo;
                ShowHistory();
            };

            // Widget setup
            VBox box = new VBox(false, 6);

            widget = box;

            // Create the toolbar
            commandbar = new Toolbar();
            commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
            commandbar.IconSize     = Gtk.IconSize.Menu;
            box.PackStart(commandbar, false, false, 0);

            if (vinfo != null)
            {
                Gtk.ToolButton button = new Gtk.ToolButton(new Gtk.Image("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString("View Changes"));
                button.IsImportant = true;
                button.Clicked    += new EventHandler(DiffButtonClicked);
                commandbar.Insert(button, -1);

                button             = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString("View File"));
                button.IsImportant = true;
                button.Clicked    += new EventHandler(ViewTextButtonClicked);
                commandbar.Insert(button, -1);
            }

            revertButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert changes from this revision"));
            revertButton.IsImportant = true;
            revertButton.Sensitive   = false;
            revertButton.Clicked    += new EventHandler(RevertRevisionClicked);
            commandbar.Insert(revertButton, -1);

            revertToButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert to this revision"));
            revertToButton.IsImportant = true;
            revertToButton.Sensitive   = false;
            revertToButton.Clicked    += new EventHandler(RevertToRevisionClicked);
            commandbar.Insert(revertToButton, -1);


            // A paned with two trees

            Gtk.VPaned paned = new Gtk.VPaned();
            box.PackStart(paned, true, true, 0);

            // Create the log list

            loglist = new TreeView();
            ScrolledWindow loglistscroll = new ScrolledWindow();

            loglistscroll.ShadowType = Gtk.ShadowType.In;
            loglistscroll.Add(loglist);
            loglistscroll.HscrollbarPolicy = PolicyType.Automatic;
            loglistscroll.VscrollbarPolicy = PolicyType.Automatic;
            paned.Add1(loglistscroll);
            ((Paned.PanedChild)paned [loglistscroll]).Resize = true;

            TreeView       changedPaths       = new TreeView();
            ScrolledWindow changedPathsScroll = new ScrolledWindow();

            changedPathsScroll.ShadowType       = Gtk.ShadowType.In;
            changedPathsScroll.HscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.VscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.Add(changedPaths);
            paned.Add2(changedPathsScroll);
            ((Paned.PanedChild)paned [changedPathsScroll]).Resize = false;

            widget.ShowAll();

            // Revision list setup

            CellRendererText textRenderer = new CellRendererText();

            textRenderer.Yalign = 0;

            TreeViewColumn colRevNum     = new TreeViewColumn(GettextCatalog.GetString("Revision"), textRenderer, "text", 0);
            TreeViewColumn colRevDate    = new TreeViewColumn(GettextCatalog.GetString("Date"), textRenderer, "text", 1);
            TreeViewColumn colRevAuthor  = new TreeViewColumn(GettextCatalog.GetString("Author"), textRenderer, "text", 2);
            TreeViewColumn colRevMessage = new TreeViewColumn(GettextCatalog.GetString("Message"), textRenderer, "text", 3);

            loglist.AppendColumn(colRevNum);
            loglist.AppendColumn(colRevDate);
            loglist.AppendColumn(colRevAuthor);
            loglist.AppendColumn(colRevMessage);

            logstore      = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string));
            loglist.Model = logstore;

            // Changed paths list setup

            changedpathstore   = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Gdk.Pixbuf), typeof(string));
            changedPaths.Model = changedpathstore;

            TreeViewColumn   colOperation = new TreeViewColumn();
            CellRendererText crt          = new CellRendererText();
            var crp = new CellRendererPixbuf();

            colOperation.Title = GettextCatalog.GetString("Operation");
            colOperation.PackStart(crp, false);
            colOperation.PackStart(crt, true);
            colOperation.AddAttribute(crp, "pixbuf", 0);
            colOperation.AddAttribute(crt, "text", 1);
            changedPaths.AppendColumn(colOperation);

            TreeViewColumn colChangedPath = new TreeViewColumn();

            crp = new CellRendererPixbuf();
            crt = new CellRendererText();
            colChangedPath.Title = GettextCatalog.GetString("File Path");
            colChangedPath.PackStart(crp, false);
            colChangedPath.PackStart(crt, true);
            colChangedPath.AddAttribute(crp, "pixbuf", 2);
            colChangedPath.AddAttribute(crt, "text", 3);
            changedPaths.AppendColumn(colChangedPath);

            loglist.Selection.Changed += new EventHandler(TreeSelectionChanged);
        }
Esempio n. 9
0
        public LogView(string filepath, bool isDirectory, Revision [] history, Repository vc)
            : base(Path.GetFileName(filepath) + " Log")
        {
            this.vc       = vc;
            this.filepath = filepath;
            this.history  = history;

            try {
                this.vinfo = vc.GetVersionInfo(filepath, false);
            }
            catch (Exception ex) {
                MessageService.ShowException(ex, GettextCatalog.GetString("Version control command failed."));
            }

            // Widget setup

            VBox box = new VBox(false, 6);

            widget = box;

            // Create the toolbar
            commandbar = new Toolbar();
            commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
            commandbar.IconSize     = Gtk.IconSize.Menu;
            box.PackStart(commandbar, false, false, 0);

            if (vinfo != null)
            {
                Gtk.ToolButton button = new Gtk.ToolButton(new Gtk.Image("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString("View Changes"));
                button.IsImportant = true;
                if (isDirectory)
                {
                    button.Clicked += new EventHandler(DirDiffButtonClicked);
                    commandbar.Insert(button, -1);
                }
                else
                {
                    button.Clicked += new EventHandler(DiffButtonClicked);
                    commandbar.Insert(button, -1);

                    button             = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString("View File"));
                    button.IsImportant = true;
                    button.Clicked    += new EventHandler(ViewTextButtonClicked);
                    commandbar.Insert(button, -1);
                }
            }

            revertButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert changes from this revision"));
            revertButton.IsImportant = true;
            revertButton.Sensitive   = false;
            revertButton.Clicked    += new EventHandler(RevertRevisionClicked);
            commandbar.Insert(revertButton, -1);

            revertToButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert to this revision"));
            revertToButton.IsImportant = true;
            revertToButton.Sensitive   = false;
            revertToButton.Clicked    += new EventHandler(RevertToRevisionClicked);
            commandbar.Insert(revertToButton, -1);


            // A paned with two trees

            Gtk.VPaned paned = new Gtk.VPaned();
            box.PackStart(paned, true, true, 0);

            // Create the log list

            loglist = new TreeView();
            ScrolledWindow loglistscroll = new ScrolledWindow();

            loglistscroll.ShadowType = Gtk.ShadowType.In;
            loglistscroll.Add(loglist);
            loglistscroll.HscrollbarPolicy = PolicyType.Automatic;
            loglistscroll.VscrollbarPolicy = PolicyType.Automatic;
            paned.Add1(loglistscroll);
            ((Paned.PanedChild)paned [loglistscroll]).Resize = true;

            TreeView       changedPaths       = new TreeView();
            ScrolledWindow changedPathsScroll = new ScrolledWindow();

            changedPathsScroll.ShadowType       = Gtk.ShadowType.In;
            changedPathsScroll.HscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.VscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.Add(changedPaths);
            paned.Add2(changedPathsScroll);
            ((Paned.PanedChild)paned [changedPathsScroll]).Resize = false;

            widget.ShowAll();

            // Revision list setup

            CellRendererText textRenderer = new CellRendererText();

            textRenderer.Yalign = 0;

            TreeViewColumn colRevNum     = new TreeViewColumn(GettextCatalog.GetString("Revision"), textRenderer, "text", 0);
            TreeViewColumn colRevDate    = new TreeViewColumn(GettextCatalog.GetString("Date"), textRenderer, "text", 1);
            TreeViewColumn colRevAuthor  = new TreeViewColumn(GettextCatalog.GetString("Author"), textRenderer, "text", 2);
            TreeViewColumn colRevMessage = new TreeViewColumn(GettextCatalog.GetString("Message"), textRenderer, "text", 3);

            loglist.AppendColumn(colRevNum);
            loglist.AppendColumn(colRevDate);
            loglist.AppendColumn(colRevAuthor);
            loglist.AppendColumn(colRevMessage);

            ListStore logstore = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string));

            loglist.Model = logstore;

            foreach (Revision d in history)
            {
                logstore.AppendValues(
                    d.ToString(),
                    d.Time.ToString(),
                    d.Author,
                    d.Message == String.Empty ? GettextCatalog.GetString("(No message)") : d.Message);
            }

            // Changed paths list setup

            changedpathstore   = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Gdk.Pixbuf), typeof(string));
            changedPaths.Model = changedpathstore;

            TreeViewColumn   colOperation = new TreeViewColumn();
            CellRendererText crt          = new CellRendererText();
            var crp = new CellRendererPixbuf();

            colOperation.Title = GettextCatalog.GetString("Operation");
            colOperation.PackStart(crp, false);
            colOperation.PackStart(crt, true);
            colOperation.AddAttribute(crp, "pixbuf", 0);
            colOperation.AddAttribute(crt, "text", 1);
            changedPaths.AppendColumn(colOperation);

            TreeViewColumn colChangedPath = new TreeViewColumn();

            crp = new CellRendererPixbuf();
            crt = new CellRendererText();
            colChangedPath.Title = GettextCatalog.GetString("File Path");
            colChangedPath.PackStart(crp, false);
            colChangedPath.PackStart(crt, true);
            colChangedPath.AddAttribute(crp, "pixbuf", 2);
            colChangedPath.AddAttribute(crt, "text", 3);
            changedPaths.AppendColumn(colChangedPath);

            loglist.Selection.Changed += new EventHandler(TreeSelectionChanged);
        }