[Monodevelop-patches-list] r906 - in trunk/MonoDevelop: build/AddIns build/AddIns/AddIns/Misc/StartPage src/AddIns/DisplayBindings/SourceEditor/CodeCompletion src/Main/Base/Gui/Workbench/Layouts

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sat Feb 14 16:07:17 EST 2004


Author: tberman
Date: 2004-02-14 16:07:17 -0500 (Sat, 14 Feb 2004)
New Revision: 906

Modified:
   trunk/MonoDevelop/build/AddIns/AddIns/Misc/StartPage/StartPage.addin
   trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
Log:
* removed crufty menu items
* Dont show tooltip if string length == 0
* Only show tabs when # > 1
* Change window title to be filename - MonoDevelop
* Add mimetype icon to tab


Modified: trunk/MonoDevelop/build/AddIns/AddIns/Misc/StartPage/StartPage.addin
===================================================================
--- trunk/MonoDevelop/build/AddIns/AddIns/Misc/StartPage/StartPage.addin	2004-02-14 17:46:27 UTC (rev 905)
+++ trunk/MonoDevelop/build/AddIns/AddIns/Misc/StartPage/StartPage.addin	2004-02-14 21:07:17 UTC (rev 906)
@@ -9,7 +9,7 @@
 		<Import assembly="MonoDevelop.StartPage.dll"/>
 	</Runtime>
 
-	<Extension path = "/SharpDevelop/Workbench/MainMenu/View">
+	<!-- <Extension path = "/SharpDevelop/Workbench/MainMenu/View">
 		<MenuItem id = "ShowStartPage"
 		          insertafter  = "ViewItemsSeparator"
 			  insertbefore = "StartPageSeparator"
@@ -18,7 +18,7 @@
 		<MenuItem id = "StartPageSeparator"
 				  insertbefore = "FullScreen"
 				  label = "-"/>
-	</Extension>
+	</Extension> -->
 	
 	<!-- TODO: Conditional to reflect Settings option -->
 	<Extension path = "/Workspace/Autostart">

Modified: trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin
===================================================================
--- trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin	2004-02-14 17:46:27 UTC (rev 905)
+++ trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin	2004-02-14 21:07:17 UTC (rev 906)
@@ -260,7 +260,7 @@
 	</Extension>
 	-->
 	
-	<Extension path = "/SharpDevelop/Workbench/MainMenu/Edit">
+	<!-- <Extension path = "/SharpDevelop/Workbench/MainMenu/Edit">
                 <MenuItem insertafter = "Delete" insertbefore = "SelectAll" id = "Separator2" label = "-" />
                 <MenuItem insertafter = "Separator2" insertbefore = "Separator3" id = "Format" label = "${res:XML.MainMenu.EditMenu.FormatMenu}">
 	                <Conditional activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">
@@ -316,7 +316,7 @@
                                   class ="ICSharpCode.SharpDevelop.DefaultEditor.Commands.ConvertLeadingSpacesToTabs"/>
         		</Conditional>
                 </MenuItem>
-                <!-- <MenuItem insertafter = "Format" insertbefore = "Separator3" id = "Folding" label = "${res:XML.MainMenu.EditMenu.FoldingMenu}">
+                <MenuItem insertafter = "Format" insertbefore = "Separator3" id = "Folding" label = "${res:XML.MainMenu.EditMenu.FoldingMenu}">
 	                <Conditional activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">
 	                        <MenuItem id          = "ToggleFolding"
         	                          label       = "${res:XML.MainMenu.EditMenu.FoldingMenu.ToggleFolding}"
@@ -334,9 +334,9 @@
        					  shortcut    = "Shift|Control|P"
 	                                  class       = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ShowDefinitionsOnly"/>
         		</Conditional>
-                </MenuItem> -->
+                </MenuItem>
                 <MenuItem insertafter = "Separator2" insertbefore = "SelectAll" id = "Separator3" label = "-" />
-	</Extension>
+	</Extension> -->
 
 	<Extension path = "/SharpDevelop/ViewContent/DefaultTextEditor/OptionsDialog">
 		<DialogPanel id = "General"
@@ -376,7 +376,7 @@
 			          class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ShowColorDialog"/> 
 			<MenuItem id = "Separator2" label = "-" />
 
-			<MenuItem id = "GenerateCodeAction"
+		<!--	<MenuItem id = "GenerateCodeAction"
 			          insertafter = "Separator2"
 			          label = "${res:XML.MainMenu.ToolMenu.GenerateCode}" 
 			          description = "${res:XML.MainMenu.ToolMenu.GenerateCode.Description}" 
@@ -386,7 +386,7 @@
 			          description = "${res:XML.MainMenu.ToolMenu.QuickXmlDoc.Description}" 
 			          shortcut = "Control|Q"
 			          class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.QuickDocumentation"/> 
-			<MenuItem id = "Separator3" label = "-" />
+			<MenuItem id = "Separator3" label = "-" /> -->
 		</Conditional>
 	</Extension>
 	

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs	2004-02-14 17:46:27 UTC (rev 905)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs	2004-02-14 21:07:17 UTC (rev 906)
@@ -311,7 +311,10 @@
 					declarationviewwindow = new DeclarationViewWindow ();
 					declarationviewwindow.DescriptionMarkup = data.Description;
 				}
-				
+			
+				if (declarationviewwindow.DescriptionMarkup.Length == 0)
+					return;
+			
 				declarationviewwindow.ShowAll ();
 				if (listView.Screen.Width <= horiz + declarationviewwindow.GdkWindow.FrameExtents.Width) {
 					horiz = listpos_x - declarationviewwindow.GdkWindow.FrameExtents.Width - 10;

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs	2004-02-14 17:46:27 UTC (rev 905)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs	2004-02-14 21:07:17 UTC (rev 906)
@@ -21,6 +21,7 @@
 using Gdl;
 using GdlSharp;
 using MonoDevelop.Gui.Widgets;
+using MonoDevelop.Gui.Utils;
 
 namespace ICSharpCode.SharpDevelop.Gui
 {	
@@ -82,6 +83,8 @@
 			// Create the notebook for the various documents.
 			tabControl = new Notebook ();
 			tabControl.Scrollable = true;
+			tabControl.ShowTabs = false;
+			tabControl.SwitchPage += new SwitchPageHandler (ActiveMdiChanged);
 			DockItem item = new DockItem ("Documents", "Documents",
 						      DockItemBehavior.Locked);
 			item.Add (tabControl);
@@ -309,10 +312,13 @@
 			
 
 			string title = "";
+			Gtk.Image mimeimage;
 			if (content.IsUntitled) {
 				title = content.UntitledName;
+				mimeimage = new Gtk.Image (FileIconLoader.GetPixbufForType ("gnome-fs-regular").ScaleSimple (16, 16, Gdk.InterpType.Bilinear));
 			} else {
 				title = Path.GetFileName (content.ContentName);
+				mimeimage = new Gtk.Image (FileIconLoader.GetPixbufForFile (content.ContentName, 16, 16));
 			}
 			
 			HBox hbox = new HBox (false, 3);
@@ -325,18 +331,21 @@
 			btn.StateChanged += new StateChangedHandler (stateChanged);
 			
 			Label label = new Label (title);
+			hbox.PackStart (mimeimage);
 			hbox.PackStart (label, false, false, 0);
 			hbox.PackEnd (btn, false, false, 0);
 		
 			hbox.ShowAll ();
 			tabControl.AppendPage (content.Control, hbox);
 
-			SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow(content, tabControl, label);
+			SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow(content, tabControl, label, mimeimage);
 
 			sdiWorkspaceWindow.CloseEvent += new EventHandler(CloseWindowEvent);
 			sdiWorkspaceWindow.SwitchView(tabControl.Children.Length - 1);
 			_windows.Add (sdiWorkspaceWindow);
 			
+			if (tabControl.NPages > 1)
+				tabControl.ShowTabs = true;
 			tabControl.ShowAll();
 			return sdiWorkspaceWindow;
 		}
@@ -365,13 +374,20 @@
 		public void RemoveTab (int pageNum) {
 			tabControl.RemovePage (pageNum);
 			_windows.RemoveAt (pageNum);
+			if (tabControl.NPages == 1)
+				tabControl.ShowTabs = false;
 		}
 		
-		void ActiveMdiChanged(object sender, EventArgs e)
+		void ActiveMdiChanged(object sender, SwitchPageArgs e)
 		{
-			if (ActiveWorkbenchWindowChanged != null) {
+			try {
+				((Gtk.Window)WorkbenchSingleton.Workbench).Title = ActiveWorkbenchwindow.ViewContent.ContentName + " - MonoDevelop";
+			} catch {
+				((Gtk.Window)WorkbenchSingleton.Workbench).Title = "MonoDevelop";
+			}
+			/*if (ActiveWorkbenchWindowChanged != null) {
 				ActiveWorkbenchWindowChanged(this, e);
-			}
+			}*/
 		}
 		
 		public event EventHandler ActiveWorkbenchWindowChanged;

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs	2004-02-14 17:46:27 UTC (rev 905)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs	2004-02-14 21:07:17 UTC (rev 906)
@@ -14,6 +14,8 @@
 using ICSharpCode.Core.Services;
 using ICSharpCode.SharpDevelop.Services;
 
+using MonoDevelop.Gui.Utils;
+
 namespace ICSharpCode.SharpDevelop.Gui
 {
 	public class SdiWorkspaceWindow : IWorkbenchWindow
@@ -23,8 +25,9 @@
 		ArrayList    subViewContents = null;
 		
 		Label     tabLabel;
+		Image     tabMimeType;
 		Widget    tabPage;
-		Notebook tabControl;
+		Notebook  tabControl;
 		
 		string myUntitledTitle     = null;
 		string _titleHolder = "";
@@ -117,11 +120,12 @@
 			tabControl.CurrentPage = toSelect;
 		}
 		
-		public SdiWorkspaceWindow(IViewContent content, Notebook tabControl, Label label)
+		public SdiWorkspaceWindow(IViewContent content, Notebook tabControl, Label label, Image type)
 		{
 			this.tabControl = tabControl;
 			this.content = content;
 			this.tabLabel = label;
+			this.tabMimeType = type;
 			this.tabPage = content.Control;
 			
 			IconService iconService = (IconService)ServiceManager.Services.GetService(typeof(IconService));
@@ -321,6 +325,13 @@
 		protected virtual void OnTitleChanged(EventArgs e)
 		{
 			tabLabel.Text = Title;
+			try {
+				if (content.ContentName.IndexOfAny (new char[] { '*', '+'}) == -1) {
+					tabMimeType.Pixbuf = FileIconLoader.GetPixbufForFile (content.ContentName, 16, 16);
+				}
+			} catch {
+				tabMimeType.Pixbuf = FileIconLoader.GetPixbufForType ("gnome-fs-regular").ScaleSimple (16, 16, Gdk.InterpType.Bilinear);
+			}
 			if (TitleChanged != null) {
 				TitleChanged(this, e);
 			}




More information about the Monodevelop-patches-list mailing list