[Monodevelop-patches-list] r2150 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Commands Commands/ProjectBrowserCommands Gui Gui/BrowserDisplayBinding Gui/Components/StatusBar Gui/Dialogs/OptionPanels/ProjectOptions Gui/Pads Gui/Pads/ProjectBrowser Gui/Pads/ProjectBrowser/BrowserNode Gui/Pads/ProjectBrowser/NodeBuilder Gui/Workbench/Layouts Internal Internal/Codons/LanguageBinding Internal/ProgressMonitoring Internal/Project Internal/Project/Combine Internal/Project/Project Internal/Templates/ProjectTemplates Services/DispatchService Services/ParserService Services/ProcessService Services/Project Services/StatusBar Services/Tasks
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Jan 24 18:29:00 EST 2005
Author: lluis
Date: 2005-01-24 18:29:00 -0500 (Mon, 24 Jan 2005)
New Revision: 2150
Added:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/IStatusIcon.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/AggregatedProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ConsoleProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IAsyncOperation.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/LogTextWriter.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullAsyncOperation.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ProgressTracker.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/BackgroundProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs
Removed:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/IProgressMonitor.cs
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Base.glade
trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/RunCommands.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/SdStatusBar.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/OpenTaskView.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/TerminalPad.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/DefaultCompilerResult.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ICompilerResult.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ILanguageBinding.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/IFileFormat.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/AbstractProjectConfiguration.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/DotNetProject.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectReference.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/ProjectPathItemPropertyAttribute.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Makefile.am
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DispatchService/DispatchService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessWrapper.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/DefaultStatusBarService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/IStatusBarService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs
Log:
2005-01-24 Lluis Sanchez Gual <lluis at novell.com>
* Services/ParserService/DefaultParserService.cs:
* Services/ParserService/CodeCompletionDatabase.cs:
* Commands/ProjectBrowserCommands/CombineNodeCommands.cs:
* Gui/Pads/TerminalPad.cs:
* Gui/BrowserDisplayBinding/HtmlViewPane.cs:
* Internal/Codons/LanguageBinding/ILanguageBinding.cs:
* Internal/Project/PrjxFileFormat.cs:
* Internal/Project/CmbxFileFormat.cs:
* Internal/Project/IFileFormat.cs:
* Internal/Project/Project/DotNetProject.cs:
* Internal/Project/Project/Project.cs:
* Internal/Project/Combine/Combine.cs:
* Internal/Project/Combine/CombineEntry.cs:
* Internal/Templates/ProjectTemplates/CombineDescriptor.cs:
* Internal/Templates/ProjectTemplates/ProjectDescriptor.cs:
* Commands/MenuItemBuilders.cs: Use the new progress monitor API.
* Internal/ProcessMonitoring/*: New progress monitoring classes.
* Commands/RunCommands.cs: Factorized a lot of common code into
ProjectService.cs.
* Services/DispatchService/DispatchService.cs: Added new ThreadDispatch
method, which dispatches the call in a new thread (and does not queue the
call, like BackgroundDispatch).
* Services/ProcessService/ProcessService.cs: StartProcess now returns
a reference to the started process. Added a StartProcess methods that
writes the output in a text writer.
Added StartConsoleProcess method which runs a process in an xterm.
* Services/ProcessService/ProcessWrapper.cs: Added WaitForOutput method
which blocks until all process output has been read.
* Services/Project/DefaultProjectService.cs: Use the new progress
monitor API. Factorized here some methods from RunCommands.cs.
* IProjectService.cs: Added new methods for building and running projects.
Removed some event methods that are now handled internally.
* Services/StatusBar/IStatusBarService.cs:
* Services/StatusBar/DefaultStatusBarService.cs: Simplified. All progress
monitoring is now done by TaskService. Added API for managing the progress
bar and showing and hiding the icons.
* Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Allow dynamic addition of
new pads.
* Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Sanity fix.
* Base.glade:
* Internal/Project/Project/AbstractProjectConfiguration.cs:
* Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs: Added
option for chosing bewteen internal or external output window.
* Gui/Components/StatusBar/SdStatusBar.cs: Don't use AppBar any more, and
use something that allows more flexibility. Added support for icons.
* Internal/Codons/LanguageBinding/DefaultCompilerResult.cs: Added new
properties: WarningCount, ErrorCount, BuildCount, FailedBuildCount.
* Internal/Project/ProjectPathItemPropertyAttribute.cs: Minor fix.
* Internal/Project/Project/ProjectReference.cs: Added new useful
constructors.
* Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs:
* Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
* Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs:
* Gui/Pads/OpenTaskView.cs: Fix warnings.
* Makefile.am: Added new files.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Base.glade
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Base.glade 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Base.glade 2005-01-24 23:29:00 UTC (rev 2150)
@@ -14,6 +14,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
@@ -35,6 +40,7 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
<signal name="clicked" handler="CancelEvent" last_modification_time="Thu, 15 Jan 2004 07:06:35 GMT"/>
</widget>
@@ -48,6 +54,7 @@
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="AcceptEvent" last_modification_time="Thu, 15 Jan 2004 07:06:24 GMT"/>
</widget>
@@ -307,6 +314,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">True</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
@@ -328,6 +340,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
<signal name="clicked" handler="cancelClicked" last_modification_time="Sat, 17 Jan 2004 16:47:11 GMT"/>
</widget>
@@ -342,6 +355,7 @@
<property name="label">gtk-new</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="OpenEvent" last_modification_time="Sat, 17 Jan 2004 16:46:13 GMT"/>
</widget>
@@ -705,6 +719,7 @@
<property name="label" translatable="yes">Create seperate c_ombine subdirectory</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -802,6 +817,11 @@
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">True</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
@@ -823,6 +843,7 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
@@ -835,6 +856,7 @@
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
@@ -957,6 +979,7 @@
<property name="label">gtk-remove</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<signal name="clicked" handler="RemoveReference" last_modification_time="Sat, 17 Jan 2004 22:02:58 GMT"/>
</widget>
</child>
@@ -993,6 +1016,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox8">
@@ -1067,6 +1095,7 @@
<property name="label" translatable="yes">_Start code block on the same line</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1085,6 +1114,7 @@
<property name="label" translatable="yes">_Else on same line as closing bracket</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1103,6 +1133,7 @@
<property name="label" translatable="yes">_Insert blank lines between members</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1121,6 +1152,7 @@
<property name="label" translatable="yes">_Use full type names</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1220,6 +1252,7 @@
<property name="label" translatable="yes">Generate _documentation comments</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1238,6 +1271,7 @@
<property name="label" translatable="yes">Generate _additional comments</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1286,6 +1320,11 @@
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
@@ -1307,6 +1346,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-7</property>
<signal name="clicked" handler="OnCloseButtonClicked" last_modification_time="Sat, 24 Jan 2004 01:26:19 GMT"/>
</widget>
@@ -1334,6 +1374,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
+ <property name="overwrite">False</property>
+ <property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">False</property>
@@ -1365,6 +1407,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox13">
@@ -1379,6 +1426,7 @@
<property name="label" translatable="yes">Show Extensions in project scout</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1397,6 +1445,7 @@
<property name="label" translatable="yes">Show hidden files and directories</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1423,6 +1472,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox17">
@@ -1463,6 +1517,7 @@
<property name="max_saved">10</property>
<property name="directory_entry">False</property>
<property name="modal">False</property>
+ <property name="use_filechooser">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="combo-entry1">
@@ -1565,6 +1620,7 @@
<property name="label" translatable="yes">Load user-specific settings with the document</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1583,6 +1639,7 @@
<property name="label" translatable="yes">_Load previous solution on startup</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1689,6 +1746,7 @@
<property name="label" translatable="yes">Always create backup copy</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1767,6 +1825,7 @@
<property name="label" translatable="yes">Windows</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1785,6 +1844,7 @@
<property name="label" translatable="yes">Macintosh</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1804,6 +1864,7 @@
<property name="label" translatable="yes">Unix</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1869,6 +1930,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox2">
@@ -1948,6 +2014,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
+ <property name="overwrite">False</property>
+ <property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">False</property>
@@ -1988,6 +2056,7 @@
<property name="label" translatable="yes">_Show at startup</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2011,6 +2080,7 @@
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<child>
<widget class="GtkAlignment" id="alignment3">
@@ -2019,6 +2089,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox6">
@@ -2079,6 +2153,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
</child>
</widget>
@@ -2107,6 +2182,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox66">
@@ -2121,6 +2201,7 @@
<property name="label" translatable="yes">Show _output pad when build starts</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2139,6 +2220,7 @@
<property name="label" translatable="yes">Show _task list pad if build finished with errors</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2211,6 +2293,7 @@
<property name="label" translatable="yes">_Save Changes to open documents</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2229,6 +2312,7 @@
<property name="label" translatable="yes">_Prompt to save changes to open documents</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2248,6 +2332,7 @@
<property name="label" translatable="yes">_Don't save changes to open documents </property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2285,6 +2370,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox32">
@@ -2340,6 +2430,7 @@
<property name="label">gtk-add</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -2355,6 +2446,7 @@
<property name="label">gtk-remove</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -2391,6 +2483,7 @@
<property name="label">gtk-go-up</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -2406,6 +2499,7 @@
<property name="label">gtk-go-down</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -2613,6 +2707,7 @@
<property name="label" translatable="yes"> > </property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -2671,6 +2766,7 @@
<property name="label" translatable="yes"> > </property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -2729,6 +2825,7 @@
<property name="label" translatable="yes">Browse</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -2770,6 +2867,7 @@
<property name="label" translatable="yes">_Prompt for Arguments</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2788,6 +2886,7 @@
<property name="label" translatable="yes">Use _Output Window</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2817,6 +2916,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox40">
@@ -3054,6 +3158,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
+ <property name="overwrite">False</property>
+ <property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">True</property>
@@ -3095,6 +3201,7 @@
<property name="label" translatable="yes">Enable _viewstate</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3188,6 +3295,7 @@
<property name="label" translatable="yes">Search for new _files on load</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3261,6 +3369,7 @@
<property name="label" translatable="yes">Automaticly _include found files</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3297,6 +3406,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox48">
@@ -3366,6 +3480,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox49">
@@ -3446,6 +3565,7 @@
<property name="label" translatable="yes">With _scriptfile</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3516,6 +3636,7 @@
<property name="label" translatable="yes">...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -3552,6 +3673,7 @@
<property name="label" translatable="yes">Compilation _target</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3577,6 +3699,7 @@
<property name="label" translatable="yes">_Project Files</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3717,6 +3840,7 @@
<property name="label" translatable="yes">...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -3771,6 +3895,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox57">
@@ -3791,6 +3920,7 @@
<property name="label" translatable="yes">_Single Startup Project</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3869,6 +3999,7 @@
<property name="label" translatable="yes">_Multiple Startup Project</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -3962,6 +4093,7 @@
<property name="label">gtk-go-up</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -3998,6 +4130,7 @@
<property name="label">gtk-go-down</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -4098,6 +4231,11 @@
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">True</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
@@ -4119,6 +4257,7 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
@@ -4132,6 +4271,7 @@
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
@@ -4276,6 +4416,7 @@
<property name="label" translatable="yes">New Files Only</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -4294,6 +4435,7 @@
<property name="label" translatable="yes">All Files</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -4342,6 +4484,7 @@
<property name="label" translatable="yes">Select All</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
</child>
@@ -4353,6 +4496,7 @@
<property name="label" translatable="yes">Clear Selection</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
</child>
</widget>
@@ -4389,6 +4533,11 @@
<property name="modal">False</property>
<property name="resizable">False</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
@@ -4410,6 +4559,7 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
@@ -4423,6 +4573,7 @@
<property name="label">gtk-new</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
@@ -4499,6 +4650,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox68">
@@ -4581,6 +4737,7 @@
<property name="label" translatable="yes">_Browse...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -4607,6 +4764,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox66">
@@ -4786,6 +4948,7 @@
<property name="label" translatable="yes">...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -4847,12 +5010,32 @@
</child>
<child>
+ <widget class="GtkCheckButton" id="externalConsoleCheckButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Run on e_xternal console</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkCheckButton" id="pauseConsoleOutputCheckButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Pause _console output</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -4951,8 +5134,8 @@
<child>
<widget class="GtkLabel" id="label95">
<property name="visible">True</property>
- <property name="label" translatable="yes">Execute Command</property>
- <property name="use_underline">False</property>
+ <property name="label" translatable="yes">Execute Co_mmand</property>
+ <property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
@@ -4961,6 +5144,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">executeScriptEntry</property>
</widget>
<packing>
<property name="left_attach">0</property>
@@ -5092,6 +5276,7 @@
<property name="label" translatable="yes">...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -5110,6 +5295,7 @@
<property name="label" translatable="yes">...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -5128,6 +5314,7 @@
<property name="label" translatable="yes">...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-01-24 23:29:00 UTC (rev 2150)
@@ -1,3 +1,78 @@
+2005-01-24 Lluis Sanchez Gual <lluis at novell.com>
+
+ * Services/ParserService/DefaultParserService.cs:
+ * Services/ParserService/CodeCompletionDatabase.cs:
+ * Commands/ProjectBrowserCommands/CombineNodeCommands.cs:
+ * Gui/Pads/TerminalPad.cs:
+ * Gui/BrowserDisplayBinding/HtmlViewPane.cs:
+ * Internal/Codons/LanguageBinding/ILanguageBinding.cs:
+ * Internal/Project/PrjxFileFormat.cs:
+ * Internal/Project/CmbxFileFormat.cs:
+ * Internal/Project/IFileFormat.cs:
+ * Internal/Project/Project/DotNetProject.cs:
+ * Internal/Project/Project/Project.cs:
+ * Internal/Project/Combine/Combine.cs:
+ * Internal/Project/Combine/CombineEntry.cs:
+ * Internal/Templates/ProjectTemplates/CombineDescriptor.cs:
+ * Internal/Templates/ProjectTemplates/ProjectDescriptor.cs:
+ * Commands/MenuItemBuilders.cs: Use the new progress monitor API.
+
+ * Internal/ProcessMonitoring/*: New progress monitoring classes.
+
+ * Commands/RunCommands.cs: Factorized a lot of common code into
+ ProjectService.cs.
+
+ * Services/DispatchService/DispatchService.cs: Added new ThreadDispatch
+ method, which dispatches the call in a new thread (and does not queue the
+ call, like BackgroundDispatch).
+
+ * Services/ProcessService/ProcessService.cs: StartProcess now returns
+ a reference to the started process. Added a StartProcess methods that
+ writes the output in a text writer.
+ Added StartConsoleProcess method which runs a process in an xterm.
+
+ * Services/ProcessService/ProcessWrapper.cs: Added WaitForOutput method
+ which blocks until all process output has been read.
+
+ * Services/Project/DefaultProjectService.cs: Use the new progress
+ monitor API. Factorized here some methods from RunCommands.cs.
+
+ * IProjectService.cs: Added new methods for building and running projects.
+ Removed some event methods that are now handled internally.
+
+ * Services/StatusBar/IStatusBarService.cs:
+ * Services/StatusBar/DefaultStatusBarService.cs: Simplified. All progress
+ monitoring is now done by TaskService. Added API for managing the progress
+ bar and showing and hiding the icons.
+
+ * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Allow dynamic addition of
+ new pads.
+
+ * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Sanity fix.
+
+ * Base.glade:
+ * Internal/Project/Project/AbstractProjectConfiguration.cs:
+ * Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs: Added
+ option for chosing bewteen internal or external output window.
+
+ * Gui/Components/StatusBar/SdStatusBar.cs: Don't use AppBar any more, and
+ use something that allows more flexibility. Added support for icons.
+
+ * Internal/Codons/LanguageBinding/DefaultCompilerResult.cs: Added new
+ properties: WarningCount, ErrorCount, BuildCount, FailedBuildCount.
+
+ * Internal/Project/ProjectPathItemPropertyAttribute.cs: Minor fix.
+
+ * Internal/Project/Project/ProjectReference.cs: Added new useful
+ constructors.
+
+ * Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs:
+ * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
+ * Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs:
+ * Gui/Pads/OpenTaskView.cs: Fix warnings.
+
+ * Makefile.am: Added new files.
+
2005-01-18 Lluis Sanchez Gual <lluis at novell.com>
* Internal/Project/CmbxFileFormat.cs: Fix hang when the entry list
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -143,73 +143,67 @@
void ToolEvt(object sender, EventArgs e)
{
SdMenuCommand item = (SdMenuCommand)sender;
- StringParserService stringParserService = Runtime.StringParserService;
for (int i = 0; i < ToolLoader.Tool.Count; ++i) {
if (item.Text == ToolLoader.Tool[i].ToString()) {
-
ExternalTool tool = (ExternalTool)ToolLoader.Tool[i];
- // set the command
- string command = tool.Command;
- // set the args
- string args = stringParserService.Parse(tool.Arguments);
- // prompt for args if needed
- if (tool.PromptForArguments) {
- args = Runtime.MessageService.GetTextResponse(String.Format (GettextCatalog.GetString ("Enter any arguments you want to use while launching tool, {0}:"), tool.MenuCommand), String.Format (GettextCatalog.GetString ("Command Arguments for {0}"), tool.MenuCommand), args);
-
- // if user selected cancel string will be null
- if (args == null) {
- args = stringParserService.Parse(tool.Arguments);
- }
- }
-
- // debug command and args
- Console.WriteLine("command : " + command);
- Console.WriteLine("args : " + args);
-
- // create the process
- try {
- string workingDirectory = stringParserService.Parse(tool.InitialDirectory);
- if (tool.UseOutputPad)
- Runtime.ProcessService.StartProcess (command, args, workingDirectory, new ProcessEventHandler (OnStdOut), new ProcessEventHandler (OnStdErr), new EventHandler (OnExited));
- else
- Runtime.ProcessService.StartProcess (command, args, workingDirectory, new EventHandler (OnExited));
- } catch (Exception ex) {
- Runtime.MessageService.ShowError(ex, String.Format (GettextCatalog.GetString ("External program execution failed.\nError while starting:\n '{0} {1}'"), command, args));
- }
+ Runtime.DispatchService.BackgroundDispatch (new StatefulMessageHandler (RunTool), tool);
break;
}
}
}
- private void OnStdOut (object sender, string s)
+ private void RunTool (object ob)
{
- lock (Runtime.TaskService.CompilerOutput)
- {
- Runtime.TaskService.CompilerOutput += s + Environment.NewLine;
+ StringParserService stringParserService = Runtime.StringParserService;
+ ExternalTool tool = (ExternalTool) ob;
+
+ // set the command
+ string command = tool.Command;
+ // set the args
+ string args = stringParserService.Parse(tool.Arguments);
+ // prompt for args if needed
+ if (tool.PromptForArguments) {
+ args = Runtime.MessageService.GetTextResponse(String.Format (GettextCatalog.GetString ("Enter any arguments you want to use while launching tool, {0}:"), tool.MenuCommand), String.Format (GettextCatalog.GetString ("Command Arguments for {0}"), tool.MenuCommand), args);
+
+ // if user selected cancel string will be null
+ if (args == null) {
+ args = stringParserService.Parse(tool.Arguments);
+ }
}
- }
-
- private void OnStdErr (object sender, string s)
- {
- lock (Runtime.TaskService.CompilerOutput)
- {
- Runtime.TaskService.CompilerOutput += s + Environment.NewLine;
- }
- }
-
- private void OnExited (object sender, EventArgs e)
- {
- ProcessWrapper wrapper = (ProcessWrapper)sender;
- lock (Runtime.TaskService.CompilerOutput)
- {
- if (wrapper.ExitCode == 0) {
- Runtime.TaskService.CompilerOutput += string.Format("{0}Process {1} has completed succesfully.{0}", Environment.NewLine, wrapper.ProcessName);
+ // debug command and args
+ Console.WriteLine("command : " + command);
+ Console.WriteLine("args : " + args);
+
+ // create the process
+ IProgressMonitor monitor = Runtime.TaskService.GetRunProgressMonitor ();
+ monitor.Log.WriteLine ("Running: {0} {1} ...", command, args);
+ monitor.Log.WriteLine ();
+
+ try {
+ ProcessWrapper p;
+ string workingDirectory = stringParserService.Parse(tool.InitialDirectory);
+ if (tool.UseOutputPad)
+ p = Runtime.ProcessService.StartProcess (command, args, workingDirectory, monitor.Log, monitor.Log, null);
+ else
+ p = Runtime.ProcessService.StartProcess (command, args, workingDirectory, null);
+
+ p.WaitForOutput ();
+ Console.WriteLine ("DONE");
+
+ monitor.Log.WriteLine ();
+ if (p.ExitCode == 0) {
+ monitor.Log.WriteLine ("Process '{0}' has completed succesfully.", p.ProcessName);
} else {
- Runtime.TaskService.CompilerOutput += string.Format("{0}Process {1} has exited with errorcode {2}.{0}", Environment.NewLine, wrapper.ProcessName, wrapper.ExitCode);
+ monitor.Log.WriteLine ("Process '{0}' has exited with errorcode {1}.", p.ProcessName, p.ExitCode);
}
- }
+
+ } catch (Exception ex) {
+ monitor.ReportError (String.Format (GettextCatalog.GetString ("External program execution failed.\nError while starting:\n '{0} {1}'"), command, args), ex);
+ } finally {
+ monitor.Dispose ();
+ }
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -49,15 +49,18 @@
{
try
{
- int newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((Project)node.Combine.AddEntry(npdlg.NewProjectLocation)));
+ int newNodeIndex;
+ using (IProgressMonitor monitor = Runtime.TaskService.GetLoadProgressMonitor ()) {
+ newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((Project)node.Combine.AddEntry(npdlg.NewProjectLocation, monitor)));
+ }
Runtime.ProjectService.SaveCombine ();
// expand to the new node
node.Nodes[newNodeIndex].Expand();
}
- catch
- {
+ catch {
Runtime.MessageService.ShowError (GettextCatalog.GetString ("Invalid Project File"));
}
+
npdlg = null;
}
}
@@ -83,7 +86,10 @@
{
try
{
- int newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)node.Combine.AddEntry(npdlg.NewCombineLocation)));
+ int newNodeIndex;
+ using (IProgressMonitor monitor = Runtime.TaskService.GetLoadProgressMonitor ()) {
+ newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)node.Combine.AddEntry(npdlg.NewCombineLocation, monitor)));
+ }
Runtime.ProjectService.SaveCombine ();
// expand to the new node
@@ -109,7 +115,10 @@
fdiag.SelectMultiple = false;
if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
try {
- object obj = node.Combine.AddEntry(fdiag.Filename);
+ object obj;
+ using (IProgressMonitor monitor = Runtime.TaskService.GetLoadProgressMonitor ()) {
+ obj = node.Combine.AddEntry (fdiag.Filename, monitor);
+ }
int newNodeIndex = -1;
if (obj is Project) {
newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((Project)obj));
@@ -147,7 +156,10 @@
fdiag.SelectMultiple = false;
if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
try {
- object obj = node.Combine.AddEntry(fdiag.Filename);
+ object obj;
+ using (IProgressMonitor monitor = Runtime.TaskService.GetLoadProgressMonitor ()) {
+ obj = node.Combine.AddEntry (fdiag.Filename, monitor);
+ }
int newNodeIndex = -1;
if (obj is Project) {
newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((Project)obj));
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/RunCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/RunCommands.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/RunCommands.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -35,205 +35,69 @@
{
public class Compile : AbstractMenuCommand
{
- public static object CompileLockObject = new Compile();
-
- public static void ShowAfterCompileStatus()
- {
- if (!Runtime.TaskService.SomethingWentWrong) {
- Runtime.Gui.StatusBar.SetMessage (GettextCatalog.GetString ("Successful"));
+ public override void Run()
+ {
+ IProjectService projectService = Runtime.ProjectService;
+ if (projectService.CurrentOpenCombine != null) {
+ projectService.BuildActiveCombine ();
} else {
- Runtime.Gui.StatusBar.SetMessage (String.Format (GettextCatalog.GetString ("{0} errors, {1} warnings"), Runtime.TaskService.Errors.ToString (), Runtime.TaskService.Warnings.ToString ()));
- }
- }
-
- void CompileThread()
- {
- //lock (Compile.CompileLockObject) {
- CombineEntry.BuildProjects = 0;
- CombineEntry.BuildErrors = 0;
-
- TaskService taskService = Runtime.TaskService;
- IProjectService projectService = Runtime.ProjectService;
- try {
- if (projectService.CurrentOpenCombine != null) {
- projectService.CompileCombine();
- ShowAfterCompileStatus();
- } else {
- if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null) {
- new SaveFile().Run();
- Project tempProject = Runtime.ProjectService.CreateSingleFileProject (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.ContentName);
- if (tempProject != null) {
- taskService.ClearTasks ();
- taskService.CompilerOutput = "";
- ICompilerResult res = tempProject.Compile ();
- taskService.CompilerOutput = res.CompilerOutput;
- ShowAfterCompileStatus();
- } else {
- Runtime.MessageService.ShowError(GettextCatalog.GetString ("The current file can't be compiled."));
- }
- }
- }
- taskService.CompilerOutput += String.Format (GettextCatalog.GetString ("---------------------- Done ----------------------\n\nBuild: {0} succeeded, {1} failed\n"), CombineEntry.BuildProjects.ToString (), CombineEntry.BuildErrors.ToString ());
- } catch (Exception e) {
- Console.WriteLine (e);
- Runtime.MessageService.ShowError(e, GettextCatalog.GetString ("Error while compiling"));
+ if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null) {
+ new SaveFile().Run();
+ projectService.BuildFile (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.ContentName);
}
- projectService.OnEndBuild(CombineEntry.BuildErrors == 0);
- //}
- }
-
- public void RunWithWait()
- {
- CompileThread();
- }
-
- public override void Run()
- {
- lock (CompileLockObject) {
- Runtime.TaskService.CompilerOutput = String.Empty;
- Runtime.ProjectService.OnStartBuild();
- RunWithWait();
- //Thread t = new Thread(new ThreadStart(CompileThread));
- //t.IsBackground = true;
- //t.Start();
}
}
}
+
public class CompileAll : AbstractMenuCommand
{
- void CompileThread()
+ public override void Run()
{
- lock (Compile.CompileLockObject) {
- CombineEntry.BuildProjects = 0;
- CombineEntry.BuildErrors = 0;
- TaskService taskService = Runtime.TaskService;
- IProjectService projectService = Runtime.ProjectService;
- try {
-
- if (projectService.CurrentOpenCombine != null) {
- projectService.RecompileAll();
- Compile.ShowAfterCompileStatus();
- } else {
- if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null) {
- new SaveFile().Run();
- Project tempProject = Runtime.ProjectService.CreateSingleFileProject (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.ContentName);
- if (tempProject != null) {
- taskService.ClearTasks ();
- taskService.CompilerOutput = "";
- ICompilerResult res = tempProject.Compile ();
- taskService.CompilerOutput = res.CompilerOutput;
- Compile.ShowAfterCompileStatus();
- } else {
- Runtime.MessageService.ShowError(GettextCatalog.GetString ("The current file can't be compiled."));
- }
- }
- }
- taskService.CompilerOutput += String.Format (GettextCatalog.GetString ("---------------------- Done ----------------------\n\nBuild: {0} succeeded, {1} failed\n"), CombineEntry.BuildProjects.ToString(), CombineEntry.BuildErrors.ToString());
- } catch (Exception e) {
- Console.WriteLine (e);
- Runtime.MessageService.ShowError (e, GettextCatalog.GetString ("Error while compiling"));
+ IProjectService projectService = Runtime.ProjectService;
+ if (projectService.CurrentOpenCombine != null) {
+ projectService.RebuildActiveCombine ();
+ } else {
+ if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null) {
+ new SaveFile().Run();
+ projectService.BuildFile (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.ContentName);
}
- projectService.OnEndBuild(CombineEntry.BuildErrors == 0);
}
}
-
- public override void Run()
- {
-// if (Monitor.TryEnter(Compile.CompileLockObject)) {
- if (Runtime.ProjectService.CurrentOpenCombine != null) {
-
- Runtime.TaskService.CompilerOutput = String.Empty;
- Runtime.ProjectService.OnStartBuild();
- CompileThread ();
- //Thread t = new Thread(new ThreadStart(CompileThread));
- //t.IsBackground = true;
- //t.Start();
- }
-// Monitor.Exit(Compile.CompileLockObject);
-// }
- }
}
public class RunCommand : AbstractMenuCommand
{
- //void RunThread()
- bool RunThread()
+ public override void Run()
{
- lock (Compile.CompileLockObject) {
- IProjectService projectService = Runtime.ProjectService;
- try {
- Runtime.Gui.StatusBar.SetMessage(GettextCatalog.GetString ("Executing"));
- if (projectService.CurrentOpenCombine != null) {
- try {
- if (projectService.NeedsCompiling) {
- projectService.CompileCombine();
- }
- if (Runtime.TaskService.Errors == 0) {
- projectService.OnBeforeStartProject();
- projectService.CurrentOpenCombine.Execute();
- }
-
- } catch (NoStartupCombineDefinedException) {
- Runtime.MessageService.ShowError(GettextCatalog.GetString ("Cannot execute Run command, cannot find startup project.\nPlease define a startup project for the combine in the combine properties."));
- }
- } else {
- if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null) {
- if (Runtime.TaskService.Errors == 0) {
- Project tempProject = Runtime.ProjectService.CreateSingleFileProject (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.ContentName);
- if (tempProject != null) {
- tempProject.Compile ();
- projectService.OnBeforeStartProject();
- tempProject.Execute ();
- } else {
- Runtime.MessageService.ShowError(GettextCatalog.GetString ("No runnable executable found."));
- }
- }
- }
- }
- } catch (Exception e) {
- Console.WriteLine (e);
- Runtime.MessageService.ShowError(e, GettextCatalog.GetString ("Error while running"));
+ if (Runtime.ProjectService.CurrentOpenCombine != null) {
+ IAsyncOperation op = Runtime.ProjectService.BuildActiveCombine ();
+ op.Completed += new OperationHandler (ExecuteCombine);
+ } else {
+ if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null) {
+ IAsyncOperation op = Runtime.ProjectService.ExecuteFile (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.ContentName);
+ op.Completed += new OperationHandler (ExecuteFile);
}
- Runtime.Gui.StatusBar.SetMessage(GettextCatalog.GetString ("Ready"));
- return false;
}
}
- public override void Run()
+ void ExecuteCombine (IAsyncOperation op)
{
- RunThread(); // TODO FIXME PEDRO
-
- //Thread t = new Thread(new ThreadStart(RunThread));
- //t.IsBackground = true;
- //t.Start();
+ if (op.Success)
+ Runtime.ProjectService.ExecuteActiveCombine ();
}
+
+ void ExecuteFile (IAsyncOperation op)
+ {
+ if (op.Success)
+ Runtime.ProjectService.ExecuteActiveCombine ();
+ }
}
public class BuildCurrentProject : AbstractMenuCommand
{
public override void Run()
{
- lock (Compile.CompileLockObject) {
- TaskService taskService = Runtime.TaskService;
- IProjectService projectService = Runtime.ProjectService;
-
- if (projectService.CurrentSelectedProject != null) {
- try {
- CombineEntry.BuildProjects = 0;
- CombineEntry.BuildErrors = 0;
- taskService.CompilerOutput = String.Empty;
- taskService.ClearTasks();
-
- projectService.OnStartBuild();
- projectService.CompileProject(projectService.CurrentSelectedProject);
- taskService.CompilerOutput += String.Format (GettextCatalog.GetString ("---------------------- Done ----------------------\n\nBuild: {0} succeeded, {1} failed\n"), CombineEntry.BuildProjects.ToString(), CombineEntry.BuildErrors.ToString());
- } catch (Exception e) {
- Runtime.MessageService.ShowError(e, String.Format (GettextCatalog.GetString ("Error while compiling project {0}"), projectService.CurrentSelectedProject.Name));
- }
- projectService.OnEndBuild(CombineEntry.BuildErrors == 0);
- }
- Compile.ShowAfterCompileStatus();
- }
+ Runtime.ProjectService.BuildActiveProject ();
}
}
@@ -241,27 +105,7 @@
{
public override void Run()
{
- lock (Compile.CompileLockObject) {
- TaskService taskService = Runtime.TaskService;
- IProjectService projectService = Runtime.ProjectService;
-
- if (projectService.CurrentSelectedProject != null) {
- try {
- CombineEntry.BuildProjects = 0;
- CombineEntry.BuildErrors = 0;
- taskService.CompilerOutput = String.Empty;
- taskService.ClearTasks();
-
- projectService.OnStartBuild();
- projectService.RecompileProject(projectService.CurrentSelectedProject);
- taskService.CompilerOutput += String.Format (GettextCatalog.GetString ("---------------------- Done ----------------------\n\nBuild: {0} succeeded, {1} failed\n"), CombineEntry.BuildProjects.ToString(), CombineEntry.BuildErrors.ToString());
- } catch (Exception e) {
- Runtime.MessageService.ShowError(e, String.Format (GettextCatalog.GetString ("Error while compiling project {0}"), projectService.CurrentSelectedProject.Name));
- }
- projectService.OnEndBuild(CombineEntry.BuildErrors == 0);
- }
- Compile.ShowAfterCompileStatus();
- }
+ Runtime.ProjectService.RebuildActiveProject ();
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -206,7 +206,7 @@
System.Threading.Thread.Sleep (100);
return true;
}
- status.Done ();
+ status.EndProgress ();
Runtime.Gui.StatusBar.SetMessage (GettextCatalog.GetString ("Done."));
return false;
}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/IStatusIcon.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/IStatusIcon.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/IStatusIcon.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,40 @@
+//
+// IStatusIcon.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+
+namespace MonoDevelop.Gui.Components
+{
+ public interface IStatusIcon
+ {
+ string ToolTip { get; set; }
+ Image Image { get; set; }
+ EventBox EventBox { get; }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/SdStatusBar.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/SdStatusBar.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Components/StatusBar/SdStatusBar.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -11,11 +11,22 @@
namespace MonoDevelop.Gui.Components
{
- public class SdStatusBar : AppBar, IProgressMonitor
+ public class SdStatusBar : HBox
{
- Statusbar txtStatusBarPanel = new Statusbar ();
- Statusbar cursorStatusBarPanel = new Statusbar ();
- Statusbar modeStatusBarPanel = new Statusbar ();
+ ProgressBar progress = new ProgressBar ();
+ Frame txtStatusBarPanel = new Frame ();
+ Frame cursorStatusBarPanel = new Frame ();
+ Frame modeStatusBarPanel = new Frame ();
+
+ Label statusLabel;
+ Label modeLabel;
+ Label cursorLabel;
+
+ HBox iconsStatusBarPanel = new HBox ();
+
+ HBox statusBox = new HBox ();
+ Image currentStatusImage;
+
bool cancelEnabled;
const int ctx = 1;
private static GLib.GType gtype;
@@ -28,21 +39,15 @@
}
}*/
- public Statusbar ModeStatusBarPanel
+ public bool CancelEnabled
{
- get {
- return modeStatusBarPanel;
- }
+ get { return cancelEnabled; }
+ set { cancelEnabled = value; }
}
-
- public bool CancelEnabled
+
+ public ProgressBar Progress
{
- get {
- return cancelEnabled;
- }
- set {
- cancelEnabled = value;
- }
+ get { return progress; }
}
public static new GLib.GType GType
@@ -54,64 +59,116 @@
}
}
- public SdStatusBar(IStatusBarService manager) : base (true, true, PreferencesType.Never)
+ public SdStatusBar (IStatusBarService manager)
{
- txtStatusBarPanel.HasResizeGrip = false;
- this.PackStart (txtStatusBarPanel);
+ Spacing = 3;
+ BorderWidth = 1;
+
+ progress = new ProgressBar ();
+ this.PackStart (progress, false, false, 0);
- cursorStatusBarPanel.HasResizeGrip = false;
- this.PackStart (cursorStatusBarPanel, true, true, 0);
+ this.PackStart (txtStatusBarPanel, true, true, 0);
+ statusBox = new HBox ();
+ statusLabel = new Label ();
+ statusLabel.SetAlignment (0, 0.5f);
+ statusLabel.Wrap = false;
+ statusBox.PackEnd (statusLabel, true, true, 0);
+ txtStatusBarPanel.Add (statusBox);
+
+ this.PackStart (cursorStatusBarPanel, false, false, 0);
+ cursorLabel = new Label (" ");
+ cursorStatusBarPanel.Add (cursorLabel);
- modeStatusBarPanel.HasResizeGrip = false;
- this.PackStart (modeStatusBarPanel, true, true, 0);
+ this.PackStart (modeStatusBarPanel, false, false, 0);
+ modeLabel = new Label (" ");
+ modeStatusBarPanel.Add (modeLabel);
- Progress.Visible = false;
+ this.PackStart (iconsStatusBarPanel, false, false, 0);
+ txtStatusBarPanel.ShowAll ();
+
+ Progress.Hide ();
Progress.PulseStep = 0.3;
-
- this.ShowAll ();
}
+ public void SetModeStatus (string status)
+ {
+ modeStatusBarPanel.ShowAll ();
+ modeLabel.Text = " " + status + " ";
+ }
+
public void ShowErrorMessage(string message)
{
- txtStatusBarPanel.Push (ctx, String.Format (GettextCatalog.GetString ("Error : {0}"), message));
+ SetMessage (String.Format (GettextCatalog.GetString ("Error : {0}"), message));
}
public void ShowErrorMessage(Image image, string message)
{
- txtStatusBarPanel.Push (ctx, String.Format (GettextCatalog.GetString ("Error : {0}"), message));
+ SetMessage (String.Format (GettextCatalog.GetString ("Error : {0}"), message));
}
public void SetCursorPosition (int ln, int col, int ch)
{
- cursorStatusBarPanel.Push (ctx, String.Format (GettextCatalog.GetString ("ln {0} col {1} ch {2}"), ln, col, ch));
+ cursorStatusBarPanel.ShowAll ();
+ cursorLabel.Markup = String.Format (GettextCatalog.GetString (" ln <span font_family='fixed'>{0,-4}</span> col <span font_family='fixed'>{1,-3}</span> ch <span font_family='fixed'>{2,-3}</span> "), ln, col, ch);
}
public void SetMessage (string message)
{
- txtStatusBarPanel.Push (ctx, message);
+ if (currentStatusImage != null) {
+ statusBox.Remove (currentStatusImage);
+ currentStatusImage = null;
+ }
+ if (message != null)
+ statusLabel.Text = " " + message;
+ else
+ statusLabel.Text = "";
}
public void SetMessage (Image image, string message)
{
- txtStatusBarPanel.Push (ctx, message);
+ if (currentStatusImage != image) {
+ if (currentStatusImage != null) statusBox.Remove (currentStatusImage);
+ currentStatusImage = image;
+ statusBox.PackStart (image, false, false, 3);
+ image.Show ();
+ }
+
+ if (message != null)
+ statusLabel.Text = message;
+ else
+ statusLabel.Text = "";
}
+ public IStatusIcon ShowStatusIcon (Gtk.Image image)
+ {
+ EventBox ebox = new EventBox ();
+ ebox.Child = image;
+ statusBox.PackEnd (ebox, false, false, 2);
+ statusBox.ReorderChild (ebox, 0);
+ ebox.ShowAll ();
+ return new StatusIcon (ebox);
+ }
+
+ public void HideStatusIcon (IStatusIcon icon)
+ {
+ statusBox.Remove (((StatusIcon)icon).EventBox);
+ }
+
// Progress Monitor implementation
- public void BeginTask (string name, int totalWork)
+ public void BeginProgress (string name)
{
SetMessage (name);
this.Progress.Visible = true;
}
- public void Worked (double work, string status)
+ public void SetProgressFraction (double work)
{
this.Progress.Fraction = work;
- this.Progress.Text = status;
}
- public void Done ()
+ public void EndProgress ()
{
- txtStatusBarPanel.Pop (ctx);
+ SetMessage ("");
this.Progress.Fraction = 0.0;
this.Progress.Visible = false;
}
@@ -121,26 +178,40 @@
this.Progress.Visible = true;
this.Progress.Pulse ();
}
+ }
+
+ class StatusIcon: IStatusIcon
+ {
+ internal EventBox box;
+ string tip;
+ Tooltips tips;
-
- public bool Canceled
+ public StatusIcon (EventBox box)
{
- get {
- return true;
- }
- set {
- Done ();
- }
+ this.box = box;
}
- public string TaskName
- {
- get {
- return "";
- }
+ public string ToolTip {
+ get { return tip; }
set {
-
+ if (tips == null) tips = new Tooltips ();
+ tip = value;
+ if (tip == null)
+ tips.Disable ();
+ else {
+ tips.Enable ();
+ tips.SetTip (box, tip, tip);
+ }
}
}
+
+ public EventBox EventBox {
+ get { return box; }
+ }
+
+ public Image Image {
+ get { return (Image) box.Child; }
+ set { box.Child = value; }
+ }
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -36,6 +36,7 @@
[Glade.Widget] Entry executeScriptEntry;
[Glade.Widget] Entry executeAfterEntry;
[Glade.Widget] CheckButton pauseConsoleOutputCheckButton;
+ [Glade.Widget] CheckButton externalConsoleCheckButton;
[Glade.Widget] Button browseButton;
[Glade.Widget] Button browseButton2;
[Glade.Widget] Button browseButton3;
@@ -50,6 +51,7 @@
browseButton2.Clicked += new EventHandler (SelectFile4);
browseButton3.Clicked += new EventHandler (SelectFile3);
browseButton4.Clicked += new EventHandler (SelectFile2);
+ externalConsoleCheckButton.Toggled += new EventHandler (ExternalConsoleToggle);
assemblyNameEntry.Text = configuration.OutputAssembly;
outputDirectoryEntry.Text = configuration.OutputDirectory;
@@ -58,6 +60,7 @@
executeBeforeEntry.Text = configuration.ExecuteBeforeBuild;
executeAfterEntry.Text = configuration.ExecuteAfterBuild;
+ externalConsoleCheckButton.Active = configuration.ExternalConsole;
pauseConsoleOutputCheckButton.Active = configuration.PauseConsoleOutput;
}
@@ -83,6 +86,7 @@
configuration.ExecuteBeforeBuild = executeBeforeEntry.Text;
configuration.ExecuteAfterBuild = executeAfterEntry.Text;
configuration.ExecuteScript = executeScriptEntry.Text;
+ configuration.ExternalConsole = externalConsoleCheckButton.Active;
configuration.PauseConsoleOutput = pauseConsoleOutputCheckButton.Active;
return true;
}
@@ -139,6 +143,17 @@
fdiag.Hide ();
}
}
+
+ void ExternalConsoleToggle (object sender, EventArgs e)
+ {
+ if (externalConsoleCheckButton.Active) {
+ pauseConsoleOutputCheckButton.Sensitive = true;
+ pauseConsoleOutputCheckButton.Active = true;
+ } else {
+ pauseConsoleOutputCheckButton.Sensitive = false;
+ pauseConsoleOutputCheckButton.Active = false;
+ }
+ }
}
OutputOptionsPanelWidget widget;
Deleted: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/IProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/IProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/IProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -1,34 +0,0 @@
-// <file>
-// <copyright see="prj:///doc/copyright.txt"/>
-// <license see="prj:///doc/license.txt"/>
-// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
-// <version value="$version"/>
-// </file>
-
-namespace MonoDevelop.Gui
-{
- /// <summary>
- /// This is a basic interface to a "progress bar" type of
- /// control.
- /// </summary>
- public interface IProgressMonitor
- {
- void BeginTask (string name, int totalWork);
-
- void Worked (double work, string status);
-
- void Pulse ();
-
- void Done();
-
- bool Canceled {
- get;
- set;
- }
-
- string TaskName {
- get;
- set;
- }
- }
-}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,184 @@
+// <file>
+// <copyright see="prj:///doc/copyright.txt"/>
+// <license see="prj:///doc/license.txt"/>
+// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+// <owner name="Lluis Sanchez" email="lluis at novell.com"/>
+// <version value="$version"/>
+// </file>
+
+using System;
+using System.Collections;
+using System.CodeDom.Compiler;
+using System.IO;
+using System.Diagnostics;
+using MonoDevelop.Services;
+
+using MonoDevelop.Core.Properties;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Gui;
+
+using Gtk;
+using Pango;
+
+namespace MonoDevelop.EditorBindings.Gui.Pads
+{
+ public class DefaultMonitorPad : IPadContent
+ {
+ Gtk.TextBuffer buffer;
+ Gtk.TextView textEditorControl;
+ Gtk.ScrolledWindow scroller;
+
+ TextTag tag;
+ TextTag bold;
+ int ident = 0;
+ ArrayList tags = new ArrayList ();
+
+ string markupTitle;
+ string title;
+ string icon;
+ string id;
+
+ public DefaultMonitorPad (string title, string icon)
+ {
+ buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ());
+ textEditorControl = new Gtk.TextView (buffer);
+ textEditorControl.Editable = false;
+ scroller = new Gtk.ScrolledWindow ();
+ scroller.ShadowType = ShadowType.In;
+ scroller.Add (textEditorControl);
+
+ bold = new TextTag ("bold");
+ bold.Weight = Pango.Weight.Bold;
+ buffer.TagTable.Add (bold);
+
+ tag = new TextTag ("0");
+ tag.Indent = 10;
+ buffer.TagTable.Add (tag);
+ tags.Add (tag);
+
+ this.title = title;
+ this.icon = icon;
+ this.markupTitle = title;
+ }
+
+ public void BeginProgress (string title)
+ {
+ this.title = title;
+ this.markupTitle = "<span foreground=\"blue\">" + title + "</span>";
+
+ buffer.Clear ();
+ OnTitleChanged (null);
+ }
+
+ public void BeginTask (string name, int totalWork)
+ {
+ Indent ();
+ TextIter it = buffer.EndIter;
+ string txt = "\n" + name + "\n";
+ buffer.InsertWithTags (ref it, txt, tag, bold);
+ }
+
+ public void EndTask ()
+ {
+ Unindent ();
+ }
+
+ public void WriteText (string text)
+ {
+ AddText (text);
+// buffer.MoveMark (buffer.InsertMark, buffer.EndIter);
+ textEditorControl.ScrollMarkOnscreen (buffer.InsertMark);
+ }
+
+ public Gtk.Widget Control {
+ get { return scroller; }
+ }
+
+ public string Title {
+ get { return markupTitle; }
+ }
+
+ public string Icon {
+ get { return icon; }
+ }
+
+ public string Id {
+ get { return id; }
+ set { id = value; }
+ }
+
+ public override string ToString ()
+ {
+ return base.ToString () + id;
+ }
+
+ public void EndProgress ()
+ {
+ markupTitle = title;
+ OnTitleChanged (null);
+ }
+
+ void AddText (string s)
+ {
+ TextIter it = buffer.EndIter;
+ buffer.InsertWithTags (ref it, s, tag);
+ }
+
+ void Indent ()
+ {
+ ident++;
+ if (ident >= tags.Count) {
+ tag = new TextTag (ident.ToString ());
+ tag.Indent = 10 + 15 * (ident - 1);
+ buffer.TagTable.Add (tag);
+ tags.Add (tag);
+ } else {
+ tag = (TextTag) tags [ident];
+ }
+ }
+
+ void Unindent ()
+ {
+ if (ident >= 0) {
+ ident--;
+ tag = (TextTag) tags [ident];
+ }
+ }
+
+ public virtual void Dispose ()
+ {
+ }
+
+ public void RedrawContent()
+ {
+ OnTitleChanged(null);
+ OnIconChanged(null);
+ }
+
+ protected virtual void OnTitleChanged(EventArgs e)
+ {
+ if (TitleChanged != null) {
+ TitleChanged(this, e);
+ }
+ }
+
+ protected virtual void OnIconChanged(EventArgs e)
+ {
+ if (IconChanged != null) {
+ IconChanged(this, e);
+ }
+ }
+
+ public event EventHandler TitleChanged;
+ public event EventHandler IconChanged;
+
+ public void BringToFront()
+ {
+ if (!WorkbenchSingleton.Workbench.WorkbenchLayout.IsVisible(this)) {
+ WorkbenchSingleton.Workbench.WorkbenchLayout.ShowPad(this);
+ }
+ WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this);
+ }
+
+ }
+}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/OpenTaskView.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/OpenTaskView.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/OpenTaskView.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -248,7 +248,7 @@
path = Path.GetDirectoryName(tmpPath);
} catch (Exception) {}
- TreeIter iter = store.AppendValues (
+ store.AppendValues (
stock,
t.Line + 1,
t.Description,
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -123,8 +123,6 @@
/// </summary>
public override bool RemoveNode()
{
- DateTime old = DateTime.Now;
-
bool yes = Runtime.MessageService.AskQuestion (String.Format (GettextCatalog.GetString ("Are you sure you want to remove file {0} from project {1}?"), Path.GetFileName (((ProjectFile)userData).Name), Project.Name));
if (!yes)
return false;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -207,7 +207,6 @@
// only works for relative paths right now!
AbstractBrowserNode parentNode = null;
string relativeFile = Runtime.FileUtilityService.AbsoluteToRelativePath(project.BaseDirectory, projectFile.Name);
- string fileName = Path.GetFileName(projectFile.Name);
parentNode = projectNode;
if(projectFile.DependsOn != String.Empty && projectFile.DependsOn != null) {
@@ -253,8 +252,6 @@
directoryName = directoryName.Substring(2);
}
- string parentDirectory = Path.GetFileName(directoryName);
-
AbstractBrowserNode currentPathNode;
currentPathNode = GetPath(directoryName, parentNode, false);
@@ -418,33 +415,8 @@
{
parentNode.Nodes.Clear();
foreach (ProjectReference referenceInformation in project.ProjectReferences) {
- string name = null;
- switch (referenceInformation.ReferenceType) {
- case ReferenceType.Typelib:
- int index = referenceInformation.Reference.IndexOf("|");
- if (index > 0) {
- name = referenceInformation.Reference.Substring(0, index);
- } else {
- name = referenceInformation.Reference;
- }
- break;
- case ReferenceType.Project:
- name = referenceInformation.Reference;
- break;
- case ReferenceType.Assembly:
- name = Path.GetFileName(referenceInformation.Reference);
- break;
- case ReferenceType.Gac:
- name = referenceInformation.Reference.Split(',')[0];
- break;
- default:
- throw new NotImplementedException("reference type : " + referenceInformation.ReferenceType);
- }
-
AbstractBrowserNode newReferenceNode = new ReferenceNode (referenceInformation);
-
newReferenceNode.Image = Stock.Reference;
-
parentNode.Nodes.Add (newReferenceNode);
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -529,7 +529,6 @@
string newfilename = alreadyInPlace ? filename : Runtime.FileUtilityService.GetDirectoryNameWithSeparator(baseDirectory) + name;
string oldrelativename = Runtime.FileUtilityService.AbsoluteToRelativePath(baseDirectory, filename);
- string newrelativename = Runtime.FileUtilityService.AbsoluteToRelativePath(baseDirectory, newfilename);
AbstractBrowserNode oldparent = DefaultDotNetNodeBuilder.GetPath(oldrelativename, GetRootProjectNode(node), false); // TODO : change this for more projects
AbstractBrowserNode newparent = node;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/TerminalPad.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/TerminalPad.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/TerminalPad.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -97,11 +97,11 @@
sw.Add (hbox);
frame.Add (sw);
- Runtime.TaskService.CompilerOutputChanged += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SetOutput));
+/* Runtime.TaskService.CompilerOutputChanged += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SetOutput));
projectService.StartBuild += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SelectMessageView));
projectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));
projectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
- }
+*/ }
void OnChildExited (object o, EventArgs args)
{
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -109,21 +109,16 @@
foreach (IViewContent content in workbench.ViewContentCollection)
ShowView (content);
+ // by default, the active pad collection is the full set
+ // will be overriden in CreateDefaultLayout() below
+ activePadCollection = workbench.PadContentCollection;
+
// create DockItems for all the pads
foreach (IPadContent content in workbench.PadContentCollection)
{
- item = new DockItem (content.ToString (),
- content.Title,
- content.Icon,
- DockItemBehavior.Normal);
- item.Add (content.Control);
- item.ShowAll ();
- dock.AddItem (item, DockPlacement.Left);
+ AddPad (content, DockPlacement.Left, false);
}
- // by default, the active pad collection is the full set
- // will be overriden in CreateDefaultLayout() below
- activePadCollection = workbench.PadContentCollection;
-
+
// FIXME: GTKize
tabControl.SwitchPage += new SwitchPageHandler(ActiveMdiChanged);
//tabControl.SelectionChanged += new EventHandler(ActiveMdiChanged);
@@ -271,7 +266,7 @@
"MonoDevelop.Gui.Pads.PropertyPad",
"MonoDevelop.Gui.Pads.OpenTaskView",
"MonoDevelop.Gui.Pads.HelpTree",
- "MonoDevelop.EditorBindings.Gui.Pads.CompilerMessageView",
+// "MonoDevelop.EditorBindings.Gui.Pads.CompilerMessageView",
//"MonoDevelop.Gui.Pads.TerminalPad",
"MonoDevelop.Gui.Pads.HelpBrowser",
"MonoQuery.Pads.MonoQueryView"
@@ -342,12 +337,59 @@
wbWindow.Remove(rootWidget);
activePadCollection = null;
}
+
+ void AddPad (IPadContent content, DockPlacement placement, bool extraPad)
+ {
+ DockItem item = new DockItem (content.ToString (),
+ content.Title,
+ content.Icon,
+ DockItemBehavior.Normal);
+
+ Gtk.Label label = item.Tablabel as Gtk.Label;
+ label.UseMarkup = true;
+ item.Add (content.Control);
+ item.ShowAll ();
+ content.TitleChanged += new EventHandler (UpdatePad);
+ content.IconChanged += new EventHandler (UpdatePad);
+
+ if (extraPad) {
+ DockItem ot = dock.GetItemByName ("MonoDevelop.Gui.Pads.OpenTaskView");
+ if (ot != null && ot.IsAttached) {
+ item.DockTo (ot, DockPlacement.Center, 0);
+ }
+ else {
+ ot = dock.GetItemByName ("Documents");
+ item.DockTo (ot, DockPlacement.Bottom, 0);
+ }
+ }
+ else
+ dock.AddItem (item, placement);
+
+ if (!activePadCollection.Contains (content))
+ activePadCollection.Add (content);
+ }
+
+ void UpdatePad (object source, EventArgs args)
+ {
+ IPadContent content = (IPadContent) source;
+ DockItem item = GetDockItem (content);
+ if (item != null) {
+ Gtk.Label label = item.Tablabel as Gtk.Label;
+ label.Markup = content.Title;
+ item.LongName = content.Title;
+ item.StockId = content.Icon;
+ }
+ }
+
public void ShowPad (IPadContent content)
{
DockItem item = GetDockItem (content);
if (item != null)
item.ShowItem();
+ else {
+ AddPad (content, DockPlacement.Bottom, true);
+ }
}
public bool IsVisible (IPadContent padContent)
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -214,32 +214,25 @@
public void CloseWindow(bool force, bool fromMenu, int pageNum)
{
if (!force && ViewContent != null && ViewContent.IsDirty) {
- bool response = Runtime.MessageService.AskQuestion (GettextCatalog.GetString ("Do you want to save the current changes"));
- switch (response) {
- case true:
- if (content.ContentName == null) {
- while (true) {
- new MonoDevelop.Commands.SaveFileAs().Run();
- if (ViewContent.IsDirty) {
- if (Runtime.MessageService.AskQuestion(GettextCatalog.GetString ("Do you really want to discard your changes ?"))) {
- break;
- }
- } else {
+ bool save = Runtime.MessageService.AskQuestion (GettextCatalog.GetString ("Do you want to save the current changes"));
+
+ if (save) {
+ if (content.ContentName == null) {
+ while (true) {
+ new MonoDevelop.Commands.SaveFileAs().Run();
+ if (ViewContent.IsDirty) {
+ if (Runtime.MessageService.AskQuestion(GettextCatalog.GetString ("Do you really want to discard your changes ?"))) {
break;
}
+ } else {
+ break;
}
-
- } else {
- Runtime.FileUtilityService.ObservedSave(new FileOperationDelegate(ViewContent.Save), ViewContent.ContentName , FileErrorPolicy.ProvideAlternative);
}
- break;
- case false:
- break;
- default:
- // considering this to be Cancel
- return;
+ } else {
+ Runtime.FileUtilityService.ObservedSave(new FileOperationDelegate(ViewContent.Save), ViewContent.ContentName , FileErrorPolicy.ProvideAlternative);
+ }
}
}
if (fromMenu == true) {
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/DefaultCompilerResult.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/DefaultCompilerResult.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/DefaultCompilerResult.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -21,24 +21,64 @@
public class DefaultCompilerResult : ICompilerResult
{
CompilerResults compilerResults;
- string compilerOutput;
+ string compilerOutput;
- public CompilerResults CompilerResults {
- get {
- return compilerResults;
- }
+ int warningCount;
+ int errorCount;
+ int buildCount = 1;
+ int failedBuildCount;
+
+ public DefaultCompilerResult ()
+ {
+ compilerResults = new CompilerResults (null);
+ compilerOutput = "";
}
- public string CompilerOutput {
- get {
- return compilerOutput;
+ public DefaultCompilerResult (CompilerResults compilerResults, string compilerOutput)
+ {
+ this.compilerResults = compilerResults;
+ this.compilerOutput = compilerOutput;
+
+ if (compilerResults != null) {
+ foreach (CompilerError err in compilerResults.Errors) {
+ if (err.IsWarning) warningCount++;
+ else errorCount++;
+ }
+ if (errorCount > 0) failedBuildCount = 1;
}
}
- public DefaultCompilerResult(CompilerResults compilerResults, string compilerOutput)
+ public DefaultCompilerResult (CompilerResults compilerResults, string compilerOutput, int buildCount, int failedBuildCount)
+ : this (compilerResults, compilerOutput)
{
- this.compilerResults = compilerResults;
- this.compilerOutput = compilerOutput;
+ this.buildCount = buildCount;
+ this.failedBuildCount = failedBuildCount;
}
+
+ public CompilerResults CompilerResults {
+ get { return compilerResults; }
+ }
+
+ public string CompilerOutput {
+ get { return compilerOutput; }
+ }
+
+ public int WarningCount {
+ get { return warningCount; }
+ }
+
+ public int ErrorCount {
+ get { return errorCount; }
+ }
+
+ public int BuildCount {
+ get { return buildCount; }
+ set { buildCount = value; }
+ }
+
+ public int FailedBuildCount {
+ get { return failedBuildCount; }
+ set { failedBuildCount = value; }
+ }
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ICompilerResult.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ICompilerResult.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ICompilerResult.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -30,6 +30,14 @@
get;
}
+ int WarningCount { get; }
+
+ int ErrorCount { get; }
+
+ int BuildCount { get; }
+
+ int FailedBuildCount { get; }
+
/// <summary>
/// The console output of the compiler as string.
/// </summary>
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ILanguageBinding.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ILanguageBinding.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Codons/LanguageBinding/ILanguageBinding.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -12,6 +12,7 @@
using MonoDevelop.Internal.Templates;
using MonoDevelop.Internal.Project;
using MonoDevelop.Gui;
+using MonoDevelop.Services;
namespace MonoDevelop.Internal.Project
{
@@ -33,7 +34,7 @@
/// </returns>
bool CanCompile(string fileName);
- ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration);
+ ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration, IProgressMonitor monitor);
void GenerateMakefile (Project project, Combine parentCombine);
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/AggregatedProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/AggregatedProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/AggregatedProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,153 @@
+//
+// AggregatedProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.IO;
+
+namespace MonoDevelop.Services
+{
+ public class AggregatedProgressMonitor: IProgressMonitor, IAsyncOperation
+ {
+ IProgressMonitor[] monitors;
+ LogTextWriter logger;
+
+ public AggregatedProgressMonitor (params IProgressMonitor[] monitors)
+ {
+ this.monitors = monitors;
+ logger = new LogTextWriter ();
+ logger.TextWritten += new LogTextEventHandler (OnWriteLog);
+ }
+
+ public void BeginTask (string name, int totalWork)
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.BeginTask (name, totalWork);
+ }
+
+ public void EndTask ()
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.EndTask ();
+ }
+
+ public void Step (int work)
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.Step (work);
+ }
+
+ public TextWriter Log
+ {
+ get { return logger; }
+ }
+
+ void OnWriteLog (string text)
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.Log.Write (text);
+ }
+
+ public void ReportSuccess (string message)
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.ReportSuccess (message);
+ }
+
+ public void ReportWarning (string message)
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.ReportWarning (message);
+ }
+
+ public void ReportError (string message, Exception ex)
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.ReportError (message, ex);
+ }
+
+ public void Dispose ()
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.Dispose ();
+ }
+
+ public bool IsCancelRequested
+ {
+ get {
+ foreach (IProgressMonitor monitor in monitors)
+ if (monitor.IsCancelRequested) return true;
+ return false;
+ }
+ }
+
+ public IAsyncOperation AsyncOperation
+ {
+ get { return this; }
+ }
+
+ void IAsyncOperation.Cancel ()
+ {
+ foreach (IProgressMonitor monitor in monitors)
+ monitor.AsyncOperation.Cancel ();
+ }
+
+ void IAsyncOperation.WaitForCompleted ()
+ {
+ if (IsCompleted) return;
+
+ if (Runtime.DispatchService.IsGuiThread) {
+ while (!IsCompleted) {
+ while (Gtk.Application.EventsPending ())
+ Gtk.Application.RunIteration ();
+ System.Threading.Thread.Sleep (100);
+ }
+ } else {
+ monitors [0].AsyncOperation.WaitForCompleted ();
+ }
+ }
+
+ public bool IsCompleted {
+ get { return monitors [0].AsyncOperation.IsCompleted; }
+ }
+
+ bool IAsyncOperation.Success {
+ get { return monitors [0].AsyncOperation.Success; }
+ }
+
+ public event MonitorHandler CancelRequested {
+ add { monitors [0].CancelRequested += value; }
+ remove { monitors [0].CancelRequested -= value; }
+ }
+
+ public event OperationHandler Completed {
+ add { monitors [0].AsyncOperation.Completed += value; }
+ remove { monitors [0].AsyncOperation.Completed -= value; }
+ }
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,252 @@
+//
+// BaseProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Threading;
+using System.Collections.Specialized;
+using System.IO;
+
+namespace MonoDevelop.Services
+{
+ public class BaseProgressMonitor: GuiSyncObject, IProgressMonitor, IAsyncOperation
+ {
+ class MbrWrapper {
+ public ManualResetEvent waitEvent;
+ }
+
+ MbrWrapper c = new MbrWrapper ();
+ ProgressTracker progressTracker;
+ LogTextWriter logger;
+ bool canceled;
+
+ event OperationHandler completedEvent;
+ event MonitorHandler cancelRequestedEvent;
+
+ StringCollection errorsMessages = new StringCollection ();
+ StringCollection successMessages = new StringCollection ();
+ StringCollection warningMessages = new StringCollection ();
+
+ public BaseProgressMonitor ()
+ {
+ progressTracker = new ProgressTracker ();
+ logger = new LogTextWriter ();
+ logger.TextWritten += new LogTextEventHandler (OnWriteLog);
+ }
+
+ [AsyncDispatch]
+ public virtual void BeginTask (string name, int totalWork)
+ {
+ progressTracker.BeginTask (name, totalWork);
+ OnProgressChanged ();
+ }
+
+ [AsyncDispatch]
+ public virtual void EndTask ()
+ {
+ progressTracker.EndTask ();
+ }
+
+ [AsyncDispatch]
+ public virtual void Step (int work)
+ {
+ progressTracker.Step (work);
+ OnProgressChanged ();
+ }
+
+ [FreeDispatch]
+ public TextWriter Log {
+ get { return logger; }
+ }
+
+ [FreeDispatch]
+ public virtual void ReportSuccess (string message)
+ {
+ successMessages.Add (message);
+ }
+
+ [FreeDispatch]
+ public virtual void ReportWarning (string message)
+ {
+ warningMessages.Add (message);
+ }
+
+ [FreeDispatch]
+ public virtual void ReportError (string message, Exception ex)
+ {
+ if (message == null && ex != null)
+ message = ex.Message;
+ errorsMessages.Add (message);
+ }
+
+ [FreeDispatch]
+ public virtual bool IsCancelRequested {
+ get { return canceled; }
+ }
+
+ [AsyncDispatch]
+ public virtual void Dispose()
+ {
+ lock (progressTracker) {
+ progressTracker.Done ();
+ if (c.waitEvent != null)
+ c.waitEvent.Set ();
+ }
+ OnCompleted ();
+ }
+
+ [FreeDispatch]
+ public IAsyncOperation AsyncOperation
+ {
+ get { return this; }
+ }
+
+ [FreeDispatch]
+ void IAsyncOperation.Cancel ()
+ {
+ OnCancelRequested ();
+ }
+
+ [FreeDispatch]
+ void IAsyncOperation.WaitForCompleted ()
+ {
+ if (IsCompleted) return;
+
+ if (Runtime.DispatchService.IsGuiThread) {
+ while (!IsCompleted) {
+ while (Gtk.Application.EventsPending ())
+ Gtk.Application.RunIteration ();
+ Thread.Sleep (100);
+ }
+ } else {
+ lock (progressTracker) {
+ if (!progressTracker.InProgress) return;
+ if (c.waitEvent == null)
+ c.waitEvent = new ManualResetEvent (false);
+ }
+ c.waitEvent.WaitOne ();
+ }
+ }
+
+ [FreeDispatch]
+ bool IAsyncOperation.Success {
+ get { return errorsMessages.Count == 0; }
+ }
+
+ [FreeDispatch]
+ public bool IsCompleted
+ {
+ get { return !progressTracker.InProgress; }
+ }
+
+ public event OperationHandler Completed {
+ add {
+ bool alreadyCompleted = false;
+ lock (progressTracker) {
+ completedEvent += value;
+ alreadyCompleted = !progressTracker.InProgress;
+ }
+ if (alreadyCompleted) value (this);
+ }
+ remove {
+ lock (progressTracker) {
+ completedEvent -= value;
+ }
+ }
+ }
+
+ public event MonitorHandler CancelRequested {
+ add {
+ bool alreadyCanceled = false;
+ lock (progressTracker) {
+ cancelRequestedEvent += value;
+ alreadyCanceled = canceled;
+ }
+ if (alreadyCanceled) value (this);
+ }
+ remove {
+ lock (progressTracker) {
+ cancelRequestedEvent -= value;
+ }
+ }
+ }
+
+ protected StringCollection Errors {
+ get { return errorsMessages; }
+ }
+
+ protected StringCollection SuccessMessages {
+ get { return successMessages; }
+ }
+
+ protected StringCollection Warnings {
+ get { return warningMessages; }
+ }
+
+ protected string CurrentTask {
+ get { return progressTracker.CurrentTask; }
+ }
+
+ protected double CurrentTaskWork {
+ get { return progressTracker.CurrentTaskWork; }
+ }
+
+ protected double GlobalWork {
+ get { return progressTracker.GlobalWork; }
+ }
+
+ protected bool UnknownWork {
+ get { return progressTracker.UnknownWork; }
+ }
+
+ protected virtual void OnCompleted ()
+ {
+ if (completedEvent != null)
+ completedEvent (AsyncOperation);
+ }
+
+ protected virtual void OnCancelRequested ()
+ {
+ lock (progressTracker) {
+ canceled = true;
+ }
+
+ if (cancelRequestedEvent != null)
+ cancelRequestedEvent (this);
+ }
+
+ [AsyncDispatch]
+ protected virtual void OnWriteLog (string text)
+ {
+ }
+
+ protected virtual void OnProgressChanged ()
+ {
+ }
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ConsoleProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ConsoleProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ConsoleProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,61 @@
+//
+// ConsoleProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+
+namespace MonoDevelop.Services
+{
+ public class ConsoleProgressMonitor: NullProgressMonitor
+ {
+ public override void BeginTask (string name, int totalWork)
+ {
+ Console.WriteLine ("*** " + name);
+ }
+
+ public override TextWriter Log {
+ get { return Console.Out; }
+ }
+
+ public override void ReportSuccess (string message)
+ {
+ Console.WriteLine (message);
+ }
+
+ public override void ReportWarning (string message)
+ {
+ Console.WriteLine ("WARNING: " + message);
+ }
+
+ public void ReportError (string message, Exception ex)
+ {
+ Console.WriteLine ("ERROR: " + message);
+ Console.WriteLine (ex);
+ }
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IAsyncOperation.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IAsyncOperation.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IAsyncOperation.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,18 @@
+
+using System;
+using System.IO;
+
+namespace MonoDevelop.Services
+{
+ public delegate void OperationHandler (IAsyncOperation op);
+
+ public interface IAsyncOperation
+ {
+ void Cancel ();
+ void WaitForCompleted ();
+ bool IsCompleted { get; }
+ bool Success { get; }
+
+ event OperationHandler Completed;
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/IProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,55 @@
+//
+// IProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.IO;
+
+namespace MonoDevelop.Services
+{
+ public delegate void MonitorHandler (IProgressMonitor monitor);
+
+ public interface IProgressMonitor: IDisposable
+ {
+ void BeginTask (string name, int totalWork);
+ void EndTask ();
+ void Step (int work);
+
+ TextWriter Log { get; }
+
+ void ReportWarning (string message);
+
+ void ReportSuccess (string message);
+ void ReportError (string message, Exception exception);
+
+ bool IsCancelRequested { get; }
+ event MonitorHandler CancelRequested;
+
+ IAsyncOperation AsyncOperation { get; }
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/LogTextWriter.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/LogTextWriter.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/LogTextWriter.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,65 @@
+//
+// LogTextWriter.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.IO;
+using System.Text;
+
+namespace MonoDevelop.Services
+{
+ public delegate void LogTextEventHandler (string writtenText);
+
+ internal class LogTextWriter: TextWriter
+ {
+ public override Encoding Encoding {
+ get { return Encoding.Default; }
+ }
+
+ public override void Close ()
+ {
+ if (Closed != null)
+ Closed (this, null);
+ }
+
+ public override void Write (char value)
+ {
+ if (TextWritten != null)
+ TextWritten (value.ToString ());
+ }
+
+ public override void Write (string value)
+ {
+ if (TextWritten != null)
+ TextWritten (value);
+ }
+
+ public event LogTextEventHandler TextWritten;
+ public event EventHandler Closed;
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullAsyncOperation.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullAsyncOperation.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullAsyncOperation.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,67 @@
+//
+// NullAsyncOperation.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+
+namespace MonoDevelop.Services
+{
+ public class NullAsyncOperation: IAsyncOperation
+ {
+ public static NullAsyncOperation Success = new NullAsyncOperation (true);
+ public static NullAsyncOperation Failure = new NullAsyncOperation (false);
+
+ bool success;
+
+ private NullAsyncOperation (bool success)
+ {
+ this.success = success;
+ }
+
+ public void Cancel ()
+ {
+ }
+
+ public void WaitForCompleted ()
+ {
+ }
+
+ public bool IsCompleted {
+ get { return true; }
+ }
+
+ bool IAsyncOperation.Success {
+ get { return success; }
+ }
+
+ public event OperationHandler Completed {
+ add { value (this); }
+ remove {}
+ }
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/NullProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,153 @@
+//
+// NullProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Threading;
+using System.IO;
+
+namespace MonoDevelop.Services
+{
+ public class NullProgressMonitor: IProgressMonitor, IAsyncOperation
+ {
+ bool done, canceled, error;
+ ManualResetEvent waitEvent;
+
+ public virtual void BeginTask (string name, int totalWork)
+ {
+ }
+
+ public virtual void EndTask ()
+ {
+ }
+
+ public virtual void Step (int work)
+ {
+ }
+
+ public virtual TextWriter Log {
+ get { return TextWriter.Null; }
+ }
+
+ public virtual void ReportSuccess (string message)
+ {
+ }
+
+ public virtual void ReportWarning (string message)
+ {
+ }
+
+ public virtual void ReportError (string message, Exception ex)
+ {
+ error = true;
+ }
+
+ public bool IsCancelRequested {
+ get { return canceled; }
+ }
+
+ public virtual void Dispose ()
+ {
+ lock (this) {
+ if (done) return;
+ done = true;
+ }
+ if (completedEvent != null)
+ completedEvent (this);
+ }
+
+ public IAsyncOperation AsyncOperation
+ {
+ get { return this; }
+ }
+
+ void IAsyncOperation.Cancel ()
+ {
+ lock (this) {
+ if (canceled) return;
+ canceled = true;
+ }
+ if (cancelRequestedEvent != null)
+ cancelRequestedEvent (this);
+ }
+
+ void IAsyncOperation.WaitForCompleted ()
+ {
+ lock (this) {
+ if (done) return;
+ if (waitEvent == null)
+ waitEvent = new ManualResetEvent (false);
+ }
+ waitEvent.WaitOne ();
+ }
+
+ bool IAsyncOperation.IsCompleted
+ {
+ get { return done; }
+ }
+
+ bool IAsyncOperation.Success {
+ get { return !error; }
+ }
+
+ public event OperationHandler Completed {
+ add {
+ bool alreadyCompleted = false;
+ lock (this) {
+ completedEvent += value;
+ alreadyCompleted = done;
+ }
+ if (alreadyCompleted) value (this);
+ }
+ remove {
+ lock (this) {
+ completedEvent -= value;
+ }
+ }
+ }
+
+ public event MonitorHandler CancelRequested {
+ add {
+ bool alreadyCanceled = false;
+ lock (this) {
+ cancelRequestedEvent += value;
+ alreadyCanceled = canceled;
+ }
+ if (alreadyCanceled) value (this);
+ }
+ remove {
+ lock (this) {
+ cancelRequestedEvent -= value;
+ }
+ }
+ }
+
+ event MonitorHandler cancelRequestedEvent;
+ event OperationHandler completedEvent;
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ProgressTracker.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ProgressTracker.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/ProgressTracker.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,130 @@
+//
+// ProgressTracker.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Collections;
+
+namespace MonoDevelop.Services
+{
+ public class ProgressTracker
+ {
+ bool done;
+
+ ArrayList tasks = new ArrayList ();
+ class Task
+ {
+ public string Name;
+ public int TotalWork;
+ public int CurrentWork;
+
+ public double GetWorkPercent (double part)
+ {
+ if (TotalWork <= 0) return 0;
+ if (CurrentWork >= TotalWork) return 1.0;
+ return ((double)CurrentWork + part) / (double)TotalWork;
+ }
+ }
+
+ public void Reset ()
+ {
+ done = false;
+ tasks.Clear ();
+ }
+
+ public void BeginTask (string name, int totalWork)
+ {
+ Task t = new Task ();
+ t.Name = name;
+ t.TotalWork = totalWork;
+ tasks.Add (t);
+ }
+
+ public void EndTask ()
+ {
+ if (tasks.Count > 0)
+ tasks.RemoveAt (tasks.Count - 1);
+ }
+
+ public void Step (int work)
+ {
+ if (tasks.Count == 0) return;
+ Task t = LastTask;
+ if (t.CurrentWork < t.TotalWork)
+ t.CurrentWork++;
+ }
+
+ Task LastTask {
+ get { return (Task)tasks [tasks.Count-1]; }
+ }
+
+ public string CurrentTask {
+ get {
+ if (tasks.Count == 0) return null;
+ return LastTask.Name;
+ }
+ }
+
+ public double CurrentTaskWork {
+ get {
+ if (tasks.Count == 0) return 0;
+ return LastTask.GetWorkPercent (0);
+ }
+ }
+
+ public bool UnknownWork {
+ get {
+ if (tasks.Count == 0) return false;
+ return LastTask.TotalWork <= 1;
+ }
+ }
+
+ public double GlobalWork {
+ get {
+ if (done) return 1.0;
+
+ double work = 0;
+ for (int n = tasks.Count - 1; n >= 0; n--) {
+ Task t = (Task) tasks [n];
+ work = t.GetWorkPercent (work);
+ }
+ return work;
+ }
+ }
+
+ public bool InProgress {
+ get { return !done; }
+ }
+
+ public void Done ()
+ {
+ done = true;
+ tasks.Clear ();
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -27,6 +27,7 @@
//
using System;
+using System.Collections;
using System.IO;
using System.Xml;
using MonoDevelop.Services;
@@ -55,7 +56,7 @@
return obj is Combine;
}
- public void WriteFile (string file, object node)
+ public void WriteFile (string file, object node, IProgressMonitor monitor)
{
Combine combine = node as Combine;
if (combine == null)
@@ -63,17 +64,21 @@
StreamWriter sw = new StreamWriter (file);
try {
+ monitor.BeginTask (string.Format (GettextCatalog.GetString("Saving combine: {0}"), file), 1);
XmlTextWriter tw = new XmlTextWriter (sw);
tw.Formatting = Formatting.Indented;
DataSerializer serializer = new DataSerializer (Runtime.ProjectService.DataContext, file);
- CombineWriterV2 combineWriter = new CombineWriterV2 (serializer);
+ CombineWriterV2 combineWriter = new CombineWriterV2 (serializer, monitor);
combineWriter.WriteCombine (tw, combine);
+ } catch (Exception ex) {
+ monitor.ReportError (string.Format (GettextCatalog.GetString ("Could not save combine: {0}"), file), ex);
} finally {
+ monitor.EndTask ();
sw.Close ();
}
}
- public object ReadFile (string file)
+ public object ReadFile (string file, IProgressMonitor monitor)
{
XmlTextReader reader = new XmlTextReader (new StreamReader (file));
reader.MoveToContent ();
@@ -85,9 +90,9 @@
ICombineReader combineReader = null;
if (version == "1.0")
- combineReader = new CombineReaderV1 (serializer);
+ combineReader = new CombineReaderV1 (serializer, monitor);
else if (version == "2.0")
- combineReader = new CombineReaderV2 (serializer);
+ combineReader = new CombineReaderV2 (serializer, monitor);
try {
if (combineReader != null)
@@ -109,13 +114,15 @@
Combine combine;
string file;
DataSerializer serializer;
+ IProgressMonitor monitor;
- public CombineReaderV1 (DataSerializer serializer)
+ public CombineReaderV1 (DataSerializer serializer, IProgressMonitor monitor)
{
this.serializer = serializer;
this.file = serializer.SerializationContext.BaseFile;
combine = new Combine ();
combine.FileName = file;
+ this.monitor = monitor;
}
public Combine ReadCombine (XmlReader reader)
@@ -141,12 +148,14 @@
if (reader.IsEmptyElement) { reader.Skip(); return null; }
string basePath = Path.GetDirectoryName (file);
reader.ReadStartElement ();
+ monitor.BeginTask (string.Format (GettextCatalog.GetString("Loading combine: {0}"), combine.FileName), 1);
while (MoveToNextElement (reader)) {
string nodefile = reader.GetAttribute ("filename");
nodefile = Runtime.FileUtilityService.RelativeToAbsolutePath (basePath, nodefile);
- combine.Entries.Add ((CombineEntry) Runtime.ProjectService.ReadFile (nodefile));
+ combine.Entries.Add ((CombineEntry) Runtime.ProjectService.ReadFile (nodefile, monitor));
reader.Skip ();
}
+ monitor.EndTask ();
reader.ReadEndElement ();
return null;
} else if (reader.LocalName == "Configurations") {
@@ -167,11 +176,13 @@
{
DataSerializer serializer;
Combine combine = new Combine ();
+ IProgressMonitor monitor;
- public CombineReaderV2 (DataSerializer serializer)
+ public CombineReaderV2 (DataSerializer serializer, IProgressMonitor monitor)
{
this.serializer = serializer;
combine.FileName = serializer.SerializationContext.BaseFile;
+ this.monitor = monitor;
}
public Combine ReadCombine (XmlReader reader)
@@ -187,12 +198,25 @@
if (reader.IsEmptyElement) { reader.Skip(); return null; }
string basePath = Path.GetDirectoryName (combine.FileName);
reader.ReadStartElement ();
+
+ ArrayList files = new ArrayList ();
while (MoveToNextElement (reader)) {
string nodefile = reader.GetAttribute ("filename");
nodefile = Runtime.FileUtilityService.RelativeToAbsolutePath (basePath, nodefile);
- combine.Entries.Add ((CombineEntry) Runtime.ProjectService.ReadFile (nodefile));
+ files.Add (nodefile);
reader.Skip ();
}
+
+ monitor.BeginTask (string.Format (GettextCatalog.GetString("Loading combine: {0}"), combine.FileName), files.Count);
+ try {
+ foreach (string nodefile in files) {
+ combine.Entries.Add ((CombineEntry) Runtime.ProjectService.ReadFile (nodefile, monitor));
+ monitor.Step (1);
+ }
+ } finally {
+ monitor.EndTask ();
+ }
+
reader.ReadEndElement ();
return null;
}
@@ -205,10 +229,12 @@
{
Combine combine;
DataSerializer serializer;
+ IProgressMonitor monitor;
- public CombineWriterV2 (DataSerializer serializer)
+ public CombineWriterV2 (DataSerializer serializer, IProgressMonitor monitor)
{
this.serializer = serializer;
+ this.monitor = monitor;
}
public void WriteCombine (XmlWriter writer, Combine combine)
@@ -227,7 +253,7 @@
writer.WriteStartElement ("Entry");
writer.WriteAttributeString ("filename", entry.RelativeFileName);
writer.WriteEndElement ();
- Runtime.ProjectService.WriteFile (entry.FileName, entry);
+ Runtime.ProjectService.WriteFile (entry.FileName, entry, monitor);
}
writer.WriteEndElement ();
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -208,29 +208,16 @@
conf.SetCombine (this);
}
- public override void Save ()
+ public override void Save (IProgressMonitor monitor)
{
- base.Save ();
+ base.Save (monitor);
GenerateMakefiles ();
}
-
- public void SaveCombineAs ()
- {
- using (FileSelector fdiag = new FileSelector (GettextCatalog.GetString ("Save Combine As..."))) {
- //fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
- if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
- string filename = fdiag.Filename;
- Save (filename);
- Runtime.MessageService.ShowMessage(filename, GettextCatalog.GetString ("Combine saved"));
- }
-
- fdiag.Hide ();
- }
- }
- public CombineEntry AddEntry (string filename)
+ public CombineEntry AddEntry (string filename, IProgressMonitor monitor)
{
- CombineEntry entry = Runtime.ProjectService.ReadFile (filename);
+ if (monitor == null) monitor = new NullProgressMonitor ();
+ CombineEntry entry = Runtime.ProjectService.ReadFile (filename, monitor);
Entries.Add (entry);
return entry;
}
@@ -260,22 +247,29 @@
OnEntryRemoved (new CombineEntryEventArgs (entry));
}
- public override void Debug ()
+ public override void Debug (IProgressMonitor monitor)
{
CombineEntry entry = Entries [startProject];
- entry.Debug ();
+ entry.Debug (monitor);
}
- public override void Execute()
+ public override void Execute (IProgressMonitor monitor)
{
if (singleStartup) {
CombineEntry entry = (CombineEntry) Entries [startProject];
- entry.Execute();
+ entry.Execute (monitor);
} else {
+ ArrayList list = new ArrayList ();
foreach (CombineExecuteDefinition ced in combineExecuteDefinitions) {
if (ced.Type == EntryExecuteType.Execute)
- ced.Entry.Execute ();
+ list.Add (ced);
}
+ monitor.BeginTask ("Executing projects", list.Count);
+ foreach (CombineExecuteDefinition ced in list) {
+ ced.Entry.Execute (monitor);
+ monitor.Step (1);
+ }
+ monitor.EndTask ();
}
}
@@ -357,20 +351,36 @@
entry.Clean ();
}
- public override void Build ()
+ public override ICompilerResult Build (IProgressMonitor monitor)
{
CombineEntryCollection allProjects = GetAllProjects ();
+ monitor.BeginTask ("Building Combine " + Name, allProjects.Count);
try {
- allProjects = TopologicalSort(allProjects);
- } catch (CyclicBuildOrderException) {
- Runtime.MessageService.ShowError(GettextCatalog.GetString ("Cyclic dependencies can not be built with this version.\nBut we are working on it."));
- return;
- }
- foreach (Project entry in allProjects) {
- entry.Build ();
- if (Runtime.TaskService.Errors > 0) {
- break;
+ CompilerResults cres = new CompilerResults (null);
+
+ try {
+ allProjects = TopologicalSort(allProjects);
+ } catch (CyclicBuildOrderException) {
+ monitor.ReportError (GettextCatalog.GetString ("Cyclic dependencies can not be built with this version.\nBut we are working on it."), null);
+ return new DefaultCompilerResult (cres, "", 1, 1);
}
+
+ int builds = 0;
+ int failedBuilds = 0;
+
+ foreach (Project entry in allProjects) {
+ ICompilerResult res = entry.Build (monitor);
+ builds++;
+ cres.Errors.AddRange (res.CompilerResults.Errors);
+ monitor.Step (1);
+ if (res.ErrorCount > 0) {
+ failedBuilds++;
+ break;
+ }
+ }
+ return new DefaultCompilerResult (cres, "", builds, failedBuilds);
+ } finally {
+ monitor.EndTask ();
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -25,9 +25,6 @@
{
public abstract class CombineEntry : ICustomDataItem, IDisposable
{
- public static int BuildProjects = 0;
- public static int BuildErrors = 0;
-
[ItemProperty ("Configurations")]
[ItemProperty ("Configuration", ValueType=typeof(IConfiguration), Scope=1)]
ArrayList configurations = new ArrayList();
@@ -94,15 +91,15 @@
set {}
}
- public virtual void Save (string fileName)
+ public virtual void Save (string fileName, IProgressMonitor monitor)
{
FileName = fileName;
- Save ();
+ Save (monitor);
}
- public virtual void Save ()
+ public virtual void Save (IProgressMonitor monitor)
{
- Runtime.ProjectService.WriteFile (FileName, this);
+ Runtime.ProjectService.WriteFile (FileName, this, monitor);
}
internal void SetParentCombine (Combine combine)
@@ -186,9 +183,9 @@
}
public abstract void Clean ();
- public abstract void Build ();
- public abstract void Execute();
- public abstract void Debug ();
+ public abstract ICompilerResult Build (IProgressMonitor monitor);
+ public abstract void Execute (IProgressMonitor monitor);
+ public abstract void Debug (IProgressMonitor monitor);
public abstract string GetOutputFileName ();
public abstract bool NeedsBuilding { get; set; }
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/IFileFormat.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/IFileFormat.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/IFileFormat.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -28,6 +28,7 @@
using System;
+using MonoDevelop.Services;
namespace MonoDevelop.Internal.Project
{
@@ -39,7 +40,7 @@
bool CanReadFile (string file);
bool CanWriteFile (object obj);
- void WriteFile (string file, object obj);
- object ReadFile (string file);
+ void WriteFile (string file, object obj, IProgressMonitor monitor);
+ object ReadFile (string file, IProgressMonitor monitor);
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -55,7 +55,7 @@
return obj is Project;
}
- public void WriteFile (string file, object node)
+ public void WriteFile (string file, object node, IProgressMonitor monitor)
{
Project project = node as Project;
if (project == null)
@@ -63,15 +63,19 @@
StreamWriter sw = new StreamWriter (file);
try {
+ monitor.BeginTask (string.Format (GettextCatalog.GetString("Saving project: {0}"), file), 1);
XmlDataSerializer ser = new XmlDataSerializer (Runtime.ProjectService.DataContext);
ser.SerializationContext.BaseFile = file;
ser.Serialize (sw, project, typeof(Project));
+ } catch (Exception ex) {
+ monitor.ReportError (string.Format (GettextCatalog.GetString ("Could not save project: {0}"), file), ex);
} finally {
+ monitor.EndTask ();
sw.Close ();
}
}
- public object ReadFile (string fileName)
+ public object ReadFile (string fileName, IProgressMonitor monitor)
{
XmlTextReader reader = new XmlTextReader (new StreamReader (fileName));
reader.MoveToContent ();
@@ -84,7 +88,6 @@
if (version == "1.0") {
string tempFile = Path.GetTempFileName();
- Runtime.MessageService.ShowMessage(String.Format ("Old project file format found.\n It will be automatically converted to the current format"));
ConvertXml.Convert(fileName,
Runtime.Properties.DataDirectory + Path.DirectorySeparatorChar +
@@ -98,8 +101,10 @@
File.Delete (tempFile);
reader = new XmlTextReader (new StringReader (fdata));
projectReader = new ProjectReaderV1 (serializer);
+ monitor.ReportWarning (string.Format (GettextCatalog.GetString ("The format of the project '{0}' is an old file format. It will be automatically converted to the current format."), fileName));
}
else if (version == "1.1") {
+ monitor.ReportWarning (string.Format (GettextCatalog.GetString ("The format of the project '{0}' is an old file format. It will be automatically converted to the current format."), fileName));
projectReader = new ProjectReaderV1 (serializer);
}
else if (version == "2.0") {
@@ -107,11 +112,16 @@
}
try {
+ monitor.BeginTask (string.Format (GettextCatalog.GetString ("Loading project: {0}"), fileName), 1);
if (projectReader != null)
return projectReader.ReadProject (reader);
else
throw new UnknownProjectVersionException (version);
+ } catch (Exception ex) {
+ monitor.ReportError (string.Format (GettextCatalog.GetString ("Could not load project: {0}"), fileName), ex);
+ throw;
} finally {
+ monitor.EndTask ();
reader.Close ();
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/AbstractProjectConfiguration.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/AbstractProjectConfiguration.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/AbstractProjectConfiguration.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -45,6 +45,9 @@
[ItemProperty ("Execution/commandlineparameters", DefaultValue = "")]
public string commandLineParameters = String.Empty;
+ [ItemProperty ("Execution/externalconsole", DefaultValue=false)]
+ public bool externalConsole = false;
+
[ItemProperty ("Execution/consolepause")]
public bool pauseconsoleoutput = true;
@@ -87,6 +90,11 @@
set { commandLineParameters = value; }
}
+ public bool ExternalConsole {
+ get { return externalConsole; }
+ set { externalConsole = value; }
+ }
+
public bool PauseConsoleOutput {
get { return pauseconsoleoutput; }
set { pauseconsoleoutput = value; }
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/DotNetProject.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/DotNetProject.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/DotNetProject.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -98,7 +98,7 @@
return new DotNetProjectConfiguration ();
}
- protected override ICompilerResult DoBuild ()
+ protected override ICompilerResult DoBuild (IProgressMonitor monitor)
{
DotNetProjectConfiguration conf = (DotNetProjectConfiguration) ActiveConfiguration;
foreach (ProjectFile finfo in ProjectFiles) {
@@ -110,7 +110,7 @@
}
}
- ICompilerResult res = languageBinding.Compile (ProjectFiles, ProjectReferences, conf);
+ ICompilerResult res = languageBinding.Compile (ProjectFiles, ProjectReferences, conf, monitor);
CopyReferencesToOutputPath (false);
return res;
}
@@ -121,7 +121,7 @@
return conf.CompiledOutputName;
}
- public override void Debug ()
+ public override void Debug (IProgressMonitor monitor)
{
if (Runtime.TaskService.Errors != 0) return;
@@ -130,44 +130,46 @@
Runtime.DebuggingService.Run (new string[] { configuration.CompiledOutputName } );
}
- protected override void DoExecute ()
+ protected override void DoExecute (IProgressMonitor monitor)
{
CopyReferencesToOutputPath (true);
DotNetProjectConfiguration configuration = (DotNetProjectConfiguration) ActiveConfiguration;
- string args = configuration.CommandLineParameters;
+ monitor.Log.WriteLine ("Running " + configuration.CompiledOutputName + " ...");
- ProcessStartInfo psi;
- string runtimeStarter = "mono --debug ";
+ string runtimeStarter = "/home/lluis/install/bin/mono";
switch (configuration.NetRuntime) {
case NetRuntime.Mono:
- runtimeStarter = "mono --debug ";
+ runtimeStarter = "/home/lluis/install/bin/mono";
break;
case NetRuntime.MonoInterpreter:
- runtimeStarter = "mint ";
+ runtimeStarter = "mint";
break;
}
- string additionalCommands = "";
- if (configuration.PauseConsoleOutput)
- additionalCommands = @"echo; read -p 'press any key to continue...' -n1;";
-
- psi = new ProcessStartInfo("xterm",
- string.Format (
- @"-e ""{0} '{1}' {2} ; {3}""",
- runtimeStarter, configuration.CompiledOutputName, args, additionalCommands));
- psi.UseShellExecute = false;
+ string args = string.Format (@"--debug {0} {1}", configuration.CompiledOutputName, configuration.CommandLineParameters);
try {
- psi.WorkingDirectory = Path.GetDirectoryName (configuration.CompiledOutputName);
- psi.UseShellExecute = false;
+ ProcessWrapper p;
- Process p = new Process();
- p.StartInfo = psi;
- p.Start();
- } catch (Exception) {
- throw new ApplicationException("Can not execute " + "\"" + configuration.CompiledOutputName + "\"\n(Try restarting MonoDevelop or start your app manually)");
+ if (configuration.ExternalConsole)
+ p = Runtime.ProcessService.StartConsoleProcess (
+ runtimeStarter,
+ args,
+ Path.GetDirectoryName (configuration.CompiledOutputName),
+ configuration.PauseConsoleOutput, null);
+ else
+ p = Runtime.ProcessService.StartProcess (
+ runtimeStarter,
+ args,
+ Path.GetDirectoryName (configuration.CompiledOutputName),
+ monitor.Log, monitor.Log, null);
+
+ p.WaitForOutput ();
+ monitor.Log.WriteLine ("The application exited with code: {0}", p.ExitCode);
+ } catch (Exception ex) {
+ monitor.ReportError ("Can not execute " + "\"" + configuration.CompiledOutputName + "\"\n(Try restarting MonoDevelop or start your app manually)", ex);
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -197,9 +197,9 @@
}
}
- public static Project LoadProject (string filename)
+ public static Project LoadProject (string filename, IProgressMonitor monitor)
{
- Project prj = Runtime.ProjectService.ReadFile (filename) as Project;
+ Project prj = Runtime.ProjectService.ReadFile (filename, monitor) as Project;
if (prj == null)
throw new InvalidOperationException ("Invalid project file: " + filename);
@@ -229,7 +229,7 @@
if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
string filename = fdiag.Filename;
- Save (filename);
+ Save (filename, new ConsoleProgressMonitor ());
Runtime.MessageService.ShowMessage(filename, GettextCatalog.GetString ("Project saved"));
}
@@ -301,46 +301,39 @@
isDirty = true;
}
- public override void Build ()
+ public override ICompilerResult Build (IProgressMonitor monitor)
{
- Compile ();
- }
-
- public ICompilerResult Compile ()
- {
- if (isDirty) {
+ if (!isDirty) return new DefaultCompilerResult (new CompilerResults (null), "");
+
+ try {
+ monitor.BeginTask (String.Format (GettextCatalog.GetString ("Building Project: {0} Configuration: {1}"), Name, ActiveConfiguration.Name), 3);
+
Runtime.StringParserService.Properties["Project"] = Name;
TaskService taskService = Runtime.TaskService;
- Runtime.Gui.StatusBar.SetMessage(String.Format (GettextCatalog.GetString ("Compiling: {0}"), Name));
+ DoPreBuild (monitor);
- DoPreBuild ();
+ monitor.Step (1);
+ monitor.Log.WriteLine (String.Format ("Performing main compilation..."));
- taskService.CompilerOutput += String.Format (GettextCatalog.GetString ("------ Build started: Project: {0} Configuration: {1} ------\n\nPerforming main compilation...\n"), Name, ActiveConfiguration.Name);
+ ICompilerResult res = DoBuild (monitor);
- ICompilerResult res = DoBuild ();
+ monitor.Step (1);
- DoPostBuild ();
+ DoPostBuild (monitor);
isDirty = false;
- foreach (System.CodeDom.Compiler.CompilerError err in res.CompilerResults.Errors) {
- isDirty = true;
- taskService.AddTask(new Task(this, err));
- }
- if (taskService.Errors > 0) {
- ++CombineEntry.BuildErrors;
- } else {
- ++CombineEntry.BuildProjects;
- }
+ monitor.Step (1);
+ monitor.Log.WriteLine (String.Format (GettextCatalog.GetString ("Build complete -- {0} errors, {1} warnings"), res.ErrorCount, res.WarningCount));
- taskService.CompilerOutput += String.Format (GettextCatalog.GetString ("Build complete -- {0} errors, {1} warnings\n\n"), taskService.Errors.ToString (), taskService.Warnings.ToString ());
return res;
+ } finally {
+ monitor.EndTask ();
}
- return new DefaultCompilerResult (new CompilerResults (null), "");
}
- protected virtual void DoPreBuild ()
+ protected virtual void DoPreBuild (IProgressMonitor monitor)
{
AbstractProjectConfiguration conf = ActiveConfiguration as AbstractProjectConfiguration;
@@ -355,42 +348,42 @@
throw new ApplicationException("Can't create project output directory " + outputDir + " original exception:\n" + e.ToString());
}
- if (conf != null && File.Exists(conf.ExecuteBeforeBuild)) {
- Runtime.TaskService.CompilerOutput += String.Format (GettextCatalog.GetString ("Execute : {0}"), conf.ExecuteBeforeBuild);
+ if (conf != null && conf.ExecuteBeforeBuild != "" && File.Exists(conf.ExecuteBeforeBuild)) {
+ monitor.Log.WriteLine (String.Format (GettextCatalog.GetString ("Executing: {0}"), conf.ExecuteBeforeBuild));
ProcessStartInfo ps = new ProcessStartInfo(conf.ExecuteBeforeBuild);
ps.UseShellExecute = false;
ps.RedirectStandardOutput = true;
- ps.WorkingDirectory = Path.GetDirectoryName(conf.ExecuteBeforeBuild);
Process process = new Process();
process.StartInfo = ps;
process.Start();
- Runtime.TaskService.CompilerOutput += process.StandardOutput.ReadToEnd();
+ monitor.Log.Write (process.StandardOutput.ReadToEnd());
+ monitor.Log.WriteLine ();
}
}
- protected virtual ICompilerResult DoBuild ()
+ protected virtual ICompilerResult DoBuild (IProgressMonitor monitor)
{
return new DefaultCompilerResult (new CompilerResults (null), "");
}
- protected virtual void DoPostBuild ()
+ protected virtual void DoPostBuild (IProgressMonitor monitor)
{
AbstractProjectConfiguration conf = ActiveConfiguration as AbstractProjectConfiguration;
- if (conf != null && File.Exists(conf.ExecuteAfterBuild)) {
- Runtime.TaskService.CompilerOutput += String.Format (GettextCatalog.GetString ("Execute : {0}"), conf.ExecuteAfterBuild);
+ if (conf != null && conf.ExecuteAfterBuild != "" && File.Exists(conf.ExecuteAfterBuild)) {
+ monitor.Log.WriteLine ();
+ monitor.Log.WriteLine (String.Format (GettextCatalog.GetString ("Executing: {0}"), conf.ExecuteAfterBuild));
ProcessStartInfo ps = new ProcessStartInfo(conf.ExecuteAfterBuild);
ps.UseShellExecute = false;
ps.RedirectStandardOutput = true;
- ps.WorkingDirectory = Path.GetDirectoryName(conf.ExecuteAfterBuild);
Process process = new Process();
process.StartInfo = ps;
process.Start();
- Runtime.TaskService.CompilerOutput += process.StandardOutput.ReadToEnd();
+ monitor.Log.Write (process.StandardOutput.ReadToEnd());
}
}
- public override void Execute()
+ public override void Execute (IProgressMonitor monitor)
{
if (Runtime.TaskService.Errors != 0) return;
@@ -400,24 +393,16 @@
string args = configuration.CommandLineParameters;
- ProcessStartInfo psi;
if (configuration.ExecuteScript != null && configuration.ExecuteScript.Length > 0) {
- string additionalCommands = "";
- if (configuration.PauseConsoleOutput)
- additionalCommands = @"echo; read -p 'press any key to continue...' -n1;";
- psi = new ProcessStartInfo("xterm",
- String.Format (@"-e ""cd {3} ; '{0}' {1} ; {2}""", configuration.ExecuteScript, args, additionalCommands, BaseDirectory));
- psi.UseShellExecute = false;
- Process p = new Process ();
- p.StartInfo = psi;
- p.Start ();
+ ProcessWrapper p = Runtime.ProcessService.StartProcess (configuration.ExecuteScript, args, BaseDirectory, monitor.Log, monitor.Log, null);
+ p.WaitForOutput ();
} else {
- DoExecute ();
+ DoExecute (monitor);
}
}
- protected virtual void DoExecute ()
+ protected virtual void DoExecute (IProgressMonitor monitor)
{
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectReference.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectReference.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectReference.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -39,6 +39,22 @@
[ItemProperty ("localcopy")]
bool localCopy = true;
+ public ProjectReference ()
+ {
+ }
+
+ public ProjectReference(ReferenceType referenceType, string reference)
+ {
+ this.referenceType = referenceType;
+ this.reference = reference;
+ }
+
+ public ProjectReference (Project referencedProject)
+ {
+ referenceType = ReferenceType.Project;
+ reference = referencedProject.Name;
+ }
+
bool IsAssembly {
get {
return referenceType == ReferenceType.Assembly;
@@ -107,16 +123,6 @@
}
}
- public ProjectReference()
- {
- }
-
- public ProjectReference(ReferenceType referenceType, string reference)
- {
- this.referenceType = referenceType;
- this.reference = reference;
- }
-
DataCollection ICustomDataItem.Serialize (ITypeSerializer handler)
{
DataCollection data = handler.Serialize (this);
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/ProjectPathItemPropertyAttribute.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/ProjectPathItemPropertyAttribute.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/ProjectPathItemPropertyAttribute.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -63,7 +63,7 @@
public override object Deserialize (SerializationContext serCtx, object mapData, DataNode data)
{
string file = ((DataValue)data).Value;
- if (file == "") return null;
+ if (file == "") return "";
string basePath = Path.GetDirectoryName (serCtx.BaseFile);
return Runtime.FileUtilityService.RelativeToAbsolutePath (basePath, file);
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -78,29 +78,32 @@
// Create sub projects
foreach (ProjectDescriptor projectDescriptor in projectDescriptors) {
- newCombine.AddEntry(projectDescriptor.CreateProject(projectCreateInformation, defaultLanguage));
+ newCombine.AddEntry(projectDescriptor.CreateProject(projectCreateInformation, defaultLanguage), null);
}
// Create sub combines
foreach (CombineDescriptor combineDescriptor in combineDescriptors) {
- newCombine.AddEntry(combineDescriptor.CreateCombine(projectCreateInformation, defaultLanguage));
+ newCombine.AddEntry(combineDescriptor.CreateCombine(projectCreateInformation, defaultLanguage), null);
}
projectCreateInformation.CombinePath = oldCombinePath;
projectCreateInformation.ProjectBasePath = oldProjectPath;
// Save combine
- string combineLocation = Runtime.FileUtilityService.GetDirectoryNameWithSeparator(projectCreateInformation.CombinePath) + newCombineName + ".cmbx";
- if (File.Exists(combineLocation)) {
- IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
- if (messageService.AskQuestion(String.Format (GettextCatalog.GetString ("Solution file {0} already exists, do you want to overwrite\nthe existing file ?"), combineLocation))) {
- newCombine.Save (combineLocation);
+ using (IProgressMonitor monitor = Runtime.TaskService.GetSaveProgressMonitor ()) {
+ string combineLocation = Runtime.FileUtilityService.GetDirectoryNameWithSeparator(projectCreateInformation.CombinePath) + newCombineName + ".cmbx";
+ if (File.Exists(combineLocation)) {
+ IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
+ if (messageService.AskQuestion(String.Format (GettextCatalog.GetString ("Solution file {0} already exists, do you want to overwrite\nthe existing file ?"), combineLocation))) {
+ newCombine.Save (combineLocation, monitor);
+ }
+ } else {
+ newCombine.Save (combineLocation, monitor);
}
- } else {
- newCombine.Save (combineLocation);
+
+ newCombine.Dispose();
+ return combineLocation;
}
- newCombine.Dispose();
- return combineLocation;
}
public static CombineDescriptor CreateCombineDescriptor(XmlElement element)
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -149,12 +149,15 @@
// Save project
string projectLocation = fileUtilityService.GetDirectoryNameWithSeparator(projectCreateInformation.ProjectBasePath) + newProjectName + ".prjx";
- if (File.Exists(projectLocation)) {
- if (Runtime.MessageService.AskQuestion(String.Format (GettextCatalog.GetString ("Project file {0} already exists, do you want to overwrite\nthe existing file ?"), projectLocation), GettextCatalog.GetString ("File already exists"))) {
- project.Save (projectLocation);
+
+ using (IProgressMonitor monitor = Runtime.TaskService.GetSaveProgressMonitor ()) {
+ if (File.Exists(projectLocation)) {
+ if (Runtime.MessageService.AskQuestion(String.Format (GettextCatalog.GetString ("Project file {0} already exists, do you want to overwrite\nthe existing file ?"), projectLocation), GettextCatalog.GetString ("File already exists"))) {
+ project.Save (projectLocation, monitor);
+ }
+ } else {
+ project.Save (projectLocation, monitor);
}
- } else {
- project.Save (projectLocation);
}
return projectLocation;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Makefile.am 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Makefile.am 2005-01-24 23:29:00 UTC (rev 2150)
@@ -42,6 +42,7 @@
Gui/Pads/HelpBrowser/MonodocTreePad.cs \
Gui/Pads/HelpBrowser/HelpViewer.cs \
Gui/Pads/SideBarView.cs \
+Gui/Pads/DefaultMonitorPad.cs \
Gui/AbstractPadContent.cs \
Gui/ISecondaryViewContent.cs \
Gui/IViewContent.cs \
@@ -51,6 +52,7 @@
Gui/Components/SharpMessageBox.cs \
Gui/Components/StatusBar/AxStatusBar.cs \
Gui/Components/StatusBar/SdStatusBar.cs \
+Gui/Components/StatusBar/IStatusIcon.cs \
Gui/Components/StatusBar/AxStatusBarPanel.cs \
Gui/Components/LocalizedPropertyGrid/LocalizedPropertyDescriptor.cs \
Gui/Components/LocalizedPropertyGrid/LocalizedObject.cs \
@@ -64,7 +66,6 @@
Gui/Components/SdMenuCheckBox.cs \
Gui/Components/SdMenuCommand.cs \
Gui/Components/SdToolbarCommand.cs \
-Gui/IProgressMonitor.cs \
Gui/WorkbenchWindowCollection.cs \
Gui/WorkbenchSingleton.cs \
Gui/IMementoCapable.cs \
@@ -182,6 +183,9 @@
Services/LanguageBinding/LanguageBindingService.cs \
Services/Tasks/TaskService.cs \
Services/Tasks/Task.cs \
+Services/Tasks/BackgroundProgressMonitor.cs \
+Services/Tasks/OutputProgressMonitor.cs \
+Services/Tasks/StatusProgressMonitor.cs \
Services/AmbienceService/AmbienceService.cs \
Services/AmbienceService/AmbienceReflectionDecorator.cs \
Services/AmbienceService/AbstractAmbience.cs \
@@ -339,6 +343,15 @@
Internal/Parser/IMethod.cs \
Internal/Parser/IComment.cs \
Internal/Parser/ICompilationUnit.cs \
+Internal/ProgressMonitoring/AggregatedProgressMonitor.cs \
+Internal/ProgressMonitoring/BaseProgressMonitor.cs \
+Internal/ProgressMonitoring/ConsoleProgressMonitor.cs \
+Internal/ProgressMonitoring/IAsyncOperation.cs \
+Internal/ProgressMonitoring/IProgressMonitor.cs \
+Internal/ProgressMonitoring/LogTextWriter.cs \
+Internal/ProgressMonitoring/NullProgressMonitor.cs \
+Internal/ProgressMonitoring/NullAsyncOperation.cs \
+Internal/ProgressMonitoring/ProgressTracker.cs \
Internal/Project/PrjxFileFormat.cs \
Internal/Project/CmbxFileFormat.cs \
Internal/Project/IFileFormat.cs \
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DispatchService/DispatchService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DispatchService/DispatchService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DispatchService/DispatchService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -113,6 +113,14 @@
arrBackgroundQueue.Add (new StatefulMessageContainer (cb, state, false));
//thrBackground.Resume ();
}
+
+ public void ThreadDispatch (StatefulMessageHandler cb, object state)
+ {
+ StatefulMessageContainer smc = new StatefulMessageContainer (cb, state, false);
+ Thread t = new Thread (new ThreadStart (smc.Run));
+ t.IsBackground = true;
+ t.Start ();
+ }
private bool guiDispatcher ()
{
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -359,21 +359,21 @@
// before the parse job is executed
file.LastParseTime = fi.LastWriteTime;
- parserService.QueueParseJob (new WaitCallback (ParseCallback), file.FileName);
+ parserService.QueueParseJob (new JobCallback (ParseCallback), file.FileName);
}
}
}
}
- void ParseCallback (object ob)
+ void ParseCallback (object ob, IProgressMonitor monitor)
{
lock (rwlock)
{
- ParseFile ((string)ob);
+ ParseFile ((string)ob, monitor);
}
}
- protected virtual void ParseFile (string fileName)
+ protected virtual void ParseFile (string fileName, IProgressMonitor monitor)
{
}
@@ -382,7 +382,7 @@
lock (rwlock)
{
foreach (FileEntry fe in files.Values)
- ParseFile (fe.FileName);
+ ParseFile (fe.FileName, null);
}
}
@@ -683,14 +683,20 @@
}
}
- protected override void ParseFile (string fileName)
+ protected override void ParseFile (string fileName, IProgressMonitor monitor)
{
- IParseInformation parserInfo = parserService.DoParseFile ((string)fileName, null);
- if (parserInfo != null) {
- ICompilationUnit cu = (ICompilationUnit)parserInfo.BestCompilationUnit;
-
- ClassUpdateInformation res = UpdateFromParseInfo (parserInfo, fileName);
- if (res != null) parserService.NotifyParseInfoChange (fileName, res);
+ if (monitor != null) monitor.BeginTask ("Parsing file: " + Path.GetFileName (fileName), 1);
+
+ try {
+ IParseInformation parserInfo = parserService.DoParseFile ((string)fileName, null);
+ if (parserInfo != null) {
+ ICompilationUnit cu = (ICompilationUnit)parserInfo.BestCompilationUnit;
+
+ ClassUpdateInformation res = UpdateFromParseInfo (parserInfo, fileName);
+ if (res != null) parserService.NotifyParseInfoChange (fileName, res);
+ }
+ } finally {
+ if (monitor != null) monitor.EndTask ();
}
}
@@ -841,22 +847,30 @@
get { return assemblyName; }
}
- protected override void ParseFile (string fileName)
+ protected override void ParseFile (string fileName, IProgressMonitor parentMonitor)
{
- if (useExternalProcess)
- {
- string dbgen = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "dbgen.exe");
- Process proc = Process.Start ("mono " + dbgen, "\"" + baseDir + "\" \"" + assemblyName + "\"");
- proc.WaitForExit ();
- Read ();
+ IProgressMonitor monitor = parentMonitor;
+ if (parentMonitor == null) monitor = parserService.GetParseProgressMonitor ();
+
+ try {
+ monitor.BeginTask ("Parsing assembly: " + Path.GetFileName (fileName), 1);
+ if (useExternalProcess)
+ {
+ string dbgen = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "dbgen.exe");
+ Process proc = Process.Start ("mono " + dbgen, "\"" + baseDir + "\" \"" + assemblyName + "\"");
+ proc.WaitForExit ();
+ Read ();
+ }
+ else
+ {
+ AssemblyInformation ainfo = new AssemblyInformation();
+ ainfo.Load (fileName, false);
+ UpdateClassInformation (ainfo.Classes, fileName);
+ }
+ } finally {
+ monitor.EndTask ();
+ if (parentMonitor == null) monitor.Dispose ();
}
- else
- {
- Console.WriteLine ("Parsing assembly: " + fileName);
- AssemblyInformation ainfo = new AssemblyInformation();
- ainfo.Load (fileName, false);
- UpdateClassInformation (ainfo.Classes, fileName);
- }
}
public bool ParseInExternalProcess
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -54,7 +54,7 @@
class ParsingJob
{
public object Data;
- public WaitCallback ParseCallback;
+ public JobCallback ParseCallback;
}
class CompilationUnitTypeResolver: ITypeResolver
@@ -185,7 +185,7 @@
while (Gtk.Application.EventsPending ())
Gtk.Application.RunIteration ();
- if (progressMonitor.Canceled)
+ if (progressMonitor.IsCancelRequested)
return false;
else
return true;
@@ -194,7 +194,7 @@
public void GenerateCodeCompletionDatabase(string createPath, IProgressMonitor progressMonitor)
{
if (progressMonitor != null)
- progressMonitor.BeginTask(GettextCatalog.GetString ("Generate code completion database"), assemblyList.Length);
+ progressMonitor.BeginTask(GettextCatalog.GetString ("Generating database"), assemblyList.Length);
for (int i = 0; i < assemblyList.Length; ++i)
{
@@ -204,7 +204,7 @@
db.Write ();
if (progressMonitor != null)
- progressMonitor.Worked(i, GettextCatalog.GetString ("Writing class"));
+ progressMonitor.Step (1);
if (!ContinueWithProcess (progressMonitor))
return;
@@ -215,7 +215,7 @@
}
if (progressMonitor != null) {
- progressMonitor.Done();
+ progressMonitor.Dispose ();
}
}
@@ -263,6 +263,14 @@
projectService.ReferenceRemovedFromProject += new ProjectReferenceEventHandler (OnProjectReferencesChanged);
}
+ internal IProgressMonitor GetParseProgressMonitor ()
+ {
+ if (Runtime.TaskService == null) {
+ return new ConsoleProgressMonitor ();
+ }
+ return Runtime.TaskService.GetBackgroundProgressMonitor ("Code Completion Database Generation", "Icons.16x16.RunProgramIcon");
+ }
+
internal CodeCompletionDatabase GetDatabase (string uri)
{
return GetDatabase (null, uri);
@@ -500,7 +508,7 @@
}
}
- internal void QueueParseJob (WaitCallback callback, object data)
+ internal void QueueParseJob (JobCallback callback, object data)
{
ParsingJob job = new ParsingJob ();
job.ParseCallback = callback;
@@ -606,23 +614,34 @@
void ConsumeParsingQueue ()
{
- int pending;
- do {
- ParsingJob job = null;
- lock (parseQueue)
- {
- if (parseQueue.Count > 0)
- job = (ParsingJob) parseQueue.Dequeue ();
+ int pending = 0;
+ IProgressMonitor monitor = null;
+
+ try {
+ do {
+ if (pending > 5 && monitor == null) {
+ monitor = GetParseProgressMonitor ();
+ monitor.BeginTask ("Generating database", 0);
+ }
+
+ ParsingJob job = null;
+ lock (parseQueue)
+ {
+ if (parseQueue.Count > 0)
+ job = (ParsingJob) parseQueue.Dequeue ();
+ }
+
+ if (job != null)
+ job.ParseCallback (job.Data, monitor);
+
+ lock (parseQueue)
+ pending = parseQueue.Count;
+
}
-
- if (job != null)
- job.ParseCallback (job.Data);
-
- lock (parseQueue)
- pending = parseQueue.Count;
-
+ while (pending > 0);
+ } finally {
+ if (monitor != null) monitor.Dispose ();
}
- while (pending > 0);
}
@@ -1376,4 +1395,6 @@
{
string Resolve (string typeName);
}
+
+ public delegate void JobCallback (object data, IProgressMonitor monitor);
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -1,5 +1,6 @@
// created on 12/17/2004 at 22:07
using System;
+using System.IO;
using System.Collections;
using System.Threading;
using System.Diagnostics;
@@ -10,18 +11,25 @@
{
public class ProcessService : AbstractService
{
- public void StartProcess (string command, string arguments, string workingDirectory, EventHandler exited)
+ public ProcessWrapper StartProcess (string command, string arguments, string workingDirectory, EventHandler exited)
{
- StartProcess (command, arguments, workingDirectory, null, null, exited);
+ return StartProcess (command, arguments, workingDirectory, (ProcessEventHandler)null, (ProcessEventHandler)null, exited);
}
- public void StartProcess (string command, string arguments, string workingDirectory, ProcessEventHandler outputStreamChanged, ProcessEventHandler errorStreamChanged)
+ public ProcessWrapper StartProcess (string command, string arguments, string workingDirectory, ProcessEventHandler outputStreamChanged, ProcessEventHandler errorStreamChanged)
{
- StartProcess (command, arguments, workingDirectory, outputStreamChanged, errorStreamChanged, null);
+ return StartProcess (command, arguments, workingDirectory, outputStreamChanged, errorStreamChanged, null);
}
- public void StartProcess (string command, string arguments, string workingDirectory, ProcessEventHandler outputStreamChanged, ProcessEventHandler errorStreamChanged, EventHandler exited)
+ public ProcessWrapper StartProcess (string command, string arguments, string workingDirectory, TextWriter outWriter, TextWriter errorWriter, EventHandler exited)
{
+ ProcessEventHandler wout = OutWriter.GetWriteHandler (outWriter);
+ ProcessEventHandler werr = OutWriter.GetWriteHandler (errorWriter);
+ return StartProcess (command, arguments, workingDirectory, wout, werr, exited);
+ }
+
+ public ProcessWrapper StartProcess (string command, string arguments, string workingDirectory, ProcessEventHandler outputStreamChanged, ProcessEventHandler errorStreamChanged, EventHandler exited)
+ {
if (command == null)
throw new ArgumentNullException("command");
@@ -55,6 +63,49 @@
p.EnableRaisingEvents = true;
p.Start ();
+ return p;
}
+
+ public ProcessWrapper StartConsoleProcess (string command, string arguments, string workingDirectory, bool pauseBeforeExit, EventHandler exited)
+ {
+ string additionalCommands = "";
+ if (pauseBeforeExit)
+ additionalCommands = @"echo; read -p 'Press any key to continue...' -n1;";
+ ProcessStartInfo psi = new ProcessStartInfo("xterm",
+ String.Format (@"-e ""cd {3} ; '{0}' {1} ; {2}""", command, arguments, additionalCommands, workingDirectory));
+ psi.UseShellExecute = false;
+ psi.WorkingDirectory = workingDirectory;
+ psi.UseShellExecute = false;
+
+ ProcessWrapper p = new ProcessWrapper();
+
+ if (exited != null)
+ p.Exited += exited;
+
+ p.StartInfo = psi;
+ p.Start();
+ return p;
+ }
+
}
+
+ class OutWriter
+ {
+ TextWriter writer;
+
+ public OutWriter (TextWriter writer)
+ {
+ this.writer = writer;
+ }
+
+ public void WriteOut (object sender, string s)
+ {
+ writer.WriteLine (s);
+ }
+
+ public static ProcessEventHandler GetWriteHandler (TextWriter tw)
+ {
+ return tw != null ? new ProcessEventHandler(new OutWriter (tw).WriteOut) : null;
+ }
+ }
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessWrapper.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessWrapper.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ProcessService/ProcessWrapper.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -11,8 +11,10 @@
{
private Thread captureOutputThread;
private Thread captureErrorThread;
+ AutoResetEvent endEventOut = new AutoResetEvent (false);
+ AutoResetEvent endEventErr = new AutoResetEvent (false);
- public void Start ()
+ public new void Start ()
{
base.Start ();
@@ -31,34 +33,38 @@
captureErrorThread.Abort ();
}
+ public void WaitForOutput ()
+ {
+ WaitForExit ();
+ WaitHandle.WaitAll (new WaitHandle[] {endEventOut, endEventErr});
+ }
+
private void CaptureOutput ()
{
string s;
- while (OutputStreamChanged != null)
+ if (OutputStreamChanged != null)
{
while ((s = StandardOutput.ReadLine()) != null) {
if (OutputStreamChanged != null)
OutputStreamChanged (this, s);
}
-
- Thread.Sleep (100);
}
+ endEventOut.Set ();
}
private void CaptureError ()
{
string s;
- while (ErrorStreamChanged != null)
+ if (ErrorStreamChanged != null)
{
while ((s = StandardError.ReadLine()) != null) {
if (ErrorStreamChanged != null)
ErrorStreamChanged (this, s);
}
-
- Thread.Sleep (100);
}
+ endEventErr.Set ();
}
public event ProcessEventHandler OutputStreamChanged;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -11,6 +11,7 @@
using System.IO;
using System.Xml;
using System.CodeDom.Compiler;
+using System.Threading;
using MonoDevelop.Gui;
using MonoDevelop.Internal.Project;
@@ -39,9 +40,14 @@
DataContext dataContext = new DataContext ();
ProjectBindingCodon[] projectBindings;
+ IAsyncOperation currentBuildOperation;
+ IAsyncOperation currentRunOperation;
+
FileFormatManager formatManager = new FileFormatManager ();
IFileFormat defaultProjectFormat = new PrjxFileFormat ();
IFileFormat defaultCombineFormat = new CmbxFileFormat ();
+
+ ICompilerResult lastResult = new DefaultCompilerResult ();
public Project CurrentSelectedProject {
get {
@@ -74,6 +80,10 @@
}
}
+ public ICompilerResult LastCompilerResult {
+ get { return lastResult; }
+ }
+
bool IsDirtyFileInCombine {
get {
CombineEntryCollection projects = openCombine.GetAllProjects();
@@ -114,14 +124,14 @@
SaveCombinePreferences(CurrentOpenCombine);
}
- public CombineEntry ReadFile (string file)
+ public CombineEntry ReadFile (string file, IProgressMonitor monitor)
{
IFileFormat format = formatManager.GetFileFormat (file);
if (format == null)
throw new InvalidOperationException ("Unknown file format: " + file);
- CombineEntry obj = format.ReadFile (file) as CombineEntry;
+ CombineEntry obj = format.ReadFile (file, monitor) as CombineEntry;
if (obj == null)
throw new InvalidOperationException ("Invalid file format: " + file);
@@ -129,7 +139,7 @@
return obj;
}
- public void WriteFile (string file, CombineEntry entry)
+ public void WriteFile (string file, CombineEntry entry, IProgressMonitor monitor)
{
IFileFormat format = entry.FileFormat;
if (format == null) {
@@ -141,7 +151,7 @@
throw new InvalidOperationException ("FileFormat not provided for combine entry '" + entry.Name + "'");
}
- format.WriteFile (file, entry);
+ format.WriteFile (file, entry, monitor);
}
public Project CreateSingleFileProject (string file)
@@ -204,16 +214,7 @@
if (filename.StartsWith ("file://"))
filename = filename.Substring (7);
-
- Runtime.Gui.StatusBar.SetMessage(GettextCatalog.GetString ("Opening Combine..."));
- LoadCombine (filename);
-
- Runtime.Gui.StatusBar.SetMessage(GettextCatalog.GetString ("Ready"));
- }
-
- void LoadCombine(string filename)
- {
Runtime.DispatchService.BackgroundDispatch (new StatefulMessageHandler (backgroundLoadCombine), filename);
}
@@ -231,32 +232,43 @@
filename = validcombine;
}
- CombineEntry entry = ReadFile (filename);
- if (!(entry is Combine)) {
- Combine loadingCombine = new Combine();
- loadingCombine.Entries.Add (entry);
- loadingCombine.Name = entry.Name;
- loadingCombine.Save (validcombine);
- entry = loadingCombine;
+ using (IProgressMonitor monitor = Runtime.TaskService.GetLoadProgressMonitor ()) {
+ CombineEntry entry = ReadFile (filename, monitor);
+ if (!(entry is Combine)) {
+ Combine loadingCombine = new Combine();
+ loadingCombine.Entries.Add (entry);
+ loadingCombine.Name = entry.Name;
+ loadingCombine.Save (validcombine, monitor);
+ entry = loadingCombine;
+ }
+
+ openCombine = (Combine) entry;
+
+ Runtime.FileService.RecentOpen.AddLastProject (filename, openCombine.Name);
+
+ OnCombineOpened(new CombineEventArgs(openCombine));
+ openCombine.FileAddedToProject += new ProjectFileEventHandler (NotifyFileAddedToProject);
+ openCombine.FileRemovedFromProject += new ProjectFileEventHandler (NotifyFileRemovedFromProject);
+ openCombine.FileChangedInProject += new ProjectFileEventHandler (NotifyFileChangedInProject);
+ openCombine.ReferenceAddedToProject += new ProjectReferenceEventHandler (NotifyReferenceAddedToProject);
+ openCombine.ReferenceRemovedFromProject += new ProjectReferenceEventHandler (NotifyReferenceRemovedFromProject);
+
+ RestoreCombinePreferences (CurrentOpenCombine);
+ monitor.ReportSuccess (GettextCatalog.GetString ("Combine loaded."));
}
-
- openCombine = (Combine) entry;
-
- Runtime.FileService.RecentOpen.AddLastProject (filename, openCombine.Name);
-
- OnCombineOpened(new CombineEventArgs(openCombine));
- openCombine.FileAddedToProject += new ProjectFileEventHandler (NotifyFileAddedToProject);
- openCombine.FileRemovedFromProject += new ProjectFileEventHandler (NotifyFileRemovedFromProject);
- openCombine.FileChangedInProject += new ProjectFileEventHandler (NotifyFileChangedInProject);
- openCombine.ReferenceAddedToProject += new ProjectReferenceEventHandler (NotifyReferenceAddedToProject);
- openCombine.ReferenceRemovedFromProject += new ProjectReferenceEventHandler (NotifyReferenceRemovedFromProject);
-
- RestoreCombinePreferences (CurrentOpenCombine);
}
public void SaveCombine()
{
- openCombine.Save ();
+ IProgressMonitor monitor = Runtime.TaskService.GetSaveProgressMonitor ();
+ try {
+ openCombine.Save (monitor);
+ monitor.ReportSuccess (GettextCatalog.GetString ("Combine saved."));
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Save failed."), ex);
+ } finally {
+ monitor.Dispose ();
+ }
}
public void MarkFileDirty (string filename)
@@ -269,36 +281,204 @@
}
}
- public void CompileCombine()
+ public IAsyncOperation ExecuteActiveCombine ()
{
- if (openCombine != null) {
- DoBeforeCompileAction();
- Runtime.TaskService.ClearTasks();
-
- openCombine.Build ();
+ if (openCombine == null) return NullAsyncOperation.Success;
+ if (currentRunOperation != null && !currentRunOperation.IsCompleted) return currentRunOperation;
+ IProgressMonitor monitor = Runtime.TaskService.GetRunProgressMonitor ();
+ Runtime.DispatchService.ThreadDispatch (new StatefulMessageHandler (ExecuteActiveCombineAsync), monitor);
+ currentRunOperation = monitor.AsyncOperation;
+ return currentRunOperation;
+ }
+
+ void ExecuteActiveCombineAsync (object ob)
+ {
+ IProgressMonitor monitor = (IProgressMonitor) ob;
+
+ OnBeforeStartProject ();
+ try {
+ openCombine.Execute (monitor);
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Execution failed."), ex);
+ } finally {
+ monitor.Dispose ();
}
}
+
+ public IAsyncOperation ExecuteProject (Project project)
+ {
+ IProgressMonitor monitor = Runtime.TaskService.GetRunProgressMonitor ();
+ Runtime.DispatchService.ThreadDispatch (new StatefulMessageHandler (ExecuteProjectAsync), new object[] {project, monitor});
+ return monitor.AsyncOperation;
+ }
- public void RecompileAll()
+ void ExecuteProjectAsync (object ob)
{
- if (openCombine != null) {
- DoBeforeCompileAction();
- Runtime.TaskService.ClearTasks();
+ object[] data = (object[]) ob;
+ Project project = (Project) data[0];
+ IProgressMonitor monitor = (IProgressMonitor) data[1];
+ OnBeforeStartProject ();
+ try {
+ project.Execute (monitor);
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Execution failed."), ex);
+ } finally {
+ monitor.Dispose ();
+ }
+ }
+
+ class ProjectOperationHandler {
+ public Project Project;
+ public void Run (IAsyncOperation op) { Project.Dispose (); }
+ }
+
+ public IAsyncOperation BuildFile (string file)
+ {
+ Project tempProject = CreateSingleFileProject (file);
+ if (tempProject != null) {
+ IAsyncOperation aop = BuildProject (tempProject);
+ ProjectOperationHandler h = new ProjectOperationHandler ();
+ h.Project = tempProject;
+ aop.Completed += new OperationHandler (h.Run);
+ return aop;
+ } else {
+ Runtime.MessageService.ShowError (string.Format (GettextCatalog.GetString ("The current file {0} can't be compiled."), file));
+ return NullAsyncOperation.Failure;
+ }
+ }
+
+ public IAsyncOperation ExecuteFile (string file)
+ {
+ Project tempProject = CreateSingleFileProject (file);
+ if (tempProject != null) {
+ IAsyncOperation aop = ExecuteProject (tempProject);
+ ProjectOperationHandler h = new ProjectOperationHandler ();
+ h.Project = tempProject;
+ aop.Completed += new OperationHandler (h.Run);
+ return aop;
+ } else {
+ Runtime.MessageService.ShowError(GettextCatalog.GetString ("No runnable executable found."));
+ return NullAsyncOperation.Failure;
+ }
+ }
+
+ public IAsyncOperation BuildActiveCombine ()
+ {
+ if (openCombine == null || !openCombine.NeedsBuilding) return NullAsyncOperation.Success;
+ if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) return currentBuildOperation;
+
+ DoBeforeCompileAction();
+
+ IProgressMonitor monitor = Runtime.TaskService.GetBuildProgressMonitor ();
+ Runtime.DispatchService.ThreadDispatch (new StatefulMessageHandler (BuildActiveCombineAsync), monitor);
+ currentBuildOperation = monitor.AsyncOperation;
+ return currentBuildOperation;
+ }
+
+ void BuildActiveCombineAsync (object ob)
+ {
+ IProgressMonitor monitor = (IProgressMonitor) ob;
+ try {
+ BeginBuild ();
+ ICompilerResult result = openCombine.Build (monitor);
+ BuildDone (monitor, result);
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Build failed."), ex);
+ } finally {
+ monitor.Dispose ();
+ }
+ }
+
+ public IAsyncOperation RebuildActiveCombine()
+ {
+ if (openCombine == null) return NullAsyncOperation.Success;
+ openCombine.Clean ();
+ return BuildActiveCombine ();
+ }
+
+ public IAsyncOperation BuildActiveProject ()
+ {
+ if (CurrentSelectedProject == null) {
+ Runtime.MessageService.ShowError (GettextCatalog.GetString ("Active project not set."));
+ return NullAsyncOperation.Failure;
+ }
- openCombine.Clean ();
- openCombine.Build ();
+ return BuildProject (CurrentSelectedProject);
+ }
+
+ public IAsyncOperation RebuildActiveProject ()
+ {
+ return RebuildProject (CurrentSelectedProject);
+ }
+
+ public IAsyncOperation BuildProject (Project project)
+ {
+ if (!project.NeedsBuilding) return NullAsyncOperation.Success;
+
+ BeforeCompile (project);
+ IProgressMonitor monitor = Runtime.TaskService.GetRunProgressMonitor ();
+ Runtime.DispatchService.ThreadDispatch (new StatefulMessageHandler (BuildProjectAsync), new object[] {project, monitor});
+ return monitor.AsyncOperation;
+ }
+
+ public void BuildProjectAsync (object ob)
+ {
+ object[] data = (object[]) ob;
+ Project project = (Project) data [0];
+ IProgressMonitor monitor = (IProgressMonitor) data [1];
+ ICompilerResult result = null;
+ try {
+ BeginBuild ();
+ result = project.Build (monitor);
+ BuildDone (monitor, result);
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Build failed."), ex);
+ } finally {
+ monitor.Dispose ();
}
}
+ public IAsyncOperation RebuildProject (Project project)
+ {
+ project.Clean ();
+ return BuildProject (project);
+ }
+
+ void BeginBuild ()
+ {
+ Runtime.TaskService.ClearTasks();
+ OnStartBuild ();
+ }
+
+ void BuildDone (IProgressMonitor monitor, ICompilerResult result)
+ {
+ lastResult = result;
+ monitor.Log.WriteLine ();
+ monitor.Log.WriteLine (String.Format (GettextCatalog.GetString ("---------------------- Done ----------------------")));
+
+ foreach (CompilerError err in result.CompilerResults.Errors) {
+ Runtime.TaskService.AddTask (new Task(null, err));
+ }
+
+ if (result.ErrorCount == 0 && result.WarningCount == 0 && lastResult.FailedBuildCount == 0) {
+ monitor.ReportSuccess (GettextCatalog.GetString ("Build successful."));
+ } else if (result.ErrorCount == 0 && result.WarningCount > 0) {
+ monitor.ReportWarning (String.Format (GettextCatalog.GetString ("Build: {0} errors, {1} warnings."), result.ErrorCount, result.WarningCount));
+ } else if (result.ErrorCount > 0) {
+ monitor.ReportError (String.Format (GettextCatalog.GetString ("Build: {0} errors, {1} warnings."), result.ErrorCount, result.WarningCount), null);
+ } else {
+ monitor.ReportError (String.Format (GettextCatalog.GetString ("Build failed.")), null);
+ }
+
+ OnEndBuild (lastResult.FailedBuildCount == 0);
+ }
+
void BeforeCompile (Project project)
{
DoBeforeCompileAction();
- Runtime.TaskService.NotifyTaskChange();
-
// cut&pasted from CombineEntry.cs
Runtime.StringParserService.Properties["Project"] = project.Name;
- Runtime.Gui.StatusBar.SetMessage(String.Format (GettextCatalog.GetString ("Compiling {0}"), project.Name));
string outputDir = ((AbstractProjectConfiguration)project.ActiveConfiguration).OutputDirectory;
try {
@@ -311,36 +491,6 @@
}
}
- void AfterCompile (Project project, ICompilerResult res)
- {
- // cut&pasted from CombineEntry.cs
- foreach (CompilerError err in res.CompilerResults.Errors) {
- Runtime.TaskService.AddTask(new Task(project, err));
- }
-
- if (Runtime.TaskService.Errors > 0) {
- ++CombineEntry.BuildErrors;
- } else {
- ++CombineEntry.BuildProjects;
- }
-
- Runtime.TaskService.CompilerOutput = res.CompilerOutput;
- Runtime.TaskService.NotifyTaskChange();
- }
-
- public void RecompileProject(Project project)
- {
- project.Clean ();
- BeforeCompile (project);
- AfterCompile(project, project.Compile ());
- }
-
- public void CompileProject(Project project)
- {
- BeforeCompile (project);
- AfterCompile(project, project.Compile ());
- }
-
void DoBeforeCompileAction()
{
BeforeCompileAction action = (BeforeCompileAction)Runtime.Properties.GetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", BeforeCompileAction.SaveAllFiles);
@@ -656,21 +806,23 @@
}
}
}
-
- public void OnStartBuild()
+
+
+ void OnStartBuild()
{
if (StartBuild != null) {
StartBuild(this, null);
}
}
- public void OnEndBuild(bool success)
+ void OnEndBuild (bool success)
{
if (EndBuild != null) {
EndBuild(success);
}
}
- public void OnBeforeStartProject()
+
+ void OnBeforeStartProject()
{
if (BeforeStartProject != null) {
BeforeStartProject(this, null);
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -56,6 +56,8 @@
get;
}
+ ICompilerResult LastCompilerResult { get; }
+
DataContext DataContext {
get;
}
@@ -64,9 +66,9 @@
get;
}
- CombineEntry ReadFile (string file);
+ CombineEntry ReadFile (string file, IProgressMonitor monitor);
- void WriteFile (string file, CombineEntry entry);
+ void WriteFile (string file, CombineEntry entry, IProgressMonitor monitor);
/// <remarks>
/// Closes the root combine
@@ -81,24 +83,41 @@
/// <remarks>
/// Compile the root combine.
/// </remarks>
- void CompileCombine();
+ IAsyncOperation BuildActiveCombine();
/// <remarks>
/// Compile the root combine. Forces Recompile for all projects.
/// </remarks>
- void RecompileAll();
+ IAsyncOperation RebuildActiveCombine();
/// <remarks>
+ /// Compiles the active project, if the project isn't dirty this
+ /// method does nothing
+ /// </remarks>
+ IAsyncOperation BuildActiveProject ();
+
+ /// <remarks>
+ /// Compiles the active project (forced!)
+ /// </remarks>
+ IAsyncOperation RebuildActiveProject ();
+
+ /// <remarks>
/// Compiles a specific project, if the project isn't dirty this
/// method does nothing
/// </remarks>
- void CompileProject(Project project);
+ IAsyncOperation BuildProject (Project project);
/// <remarks>
/// Compiles a specific project (forced!)
/// </remarks>
- void RecompileProject(Project project);
+ IAsyncOperation RebuildProject (Project project);
+ IAsyncOperation BuildFile (string file);
+
+ IAsyncOperation ExecuteActiveCombine ();
+ IAsyncOperation ExecuteProject (Project project);
+ IAsyncOperation ExecuteFile (string sourceFile);
+
/// <remarks>
/// Opens a new root combine, closes the old root combine automatically.
/// </remarks>
@@ -122,21 +141,6 @@
void MarkFileDirty(string filename);
/// <remarks>
- /// Only to be called by the compile actions.
- /// </remarks>
- void OnStartBuild();
-
- /// <remarks>
- /// Only to be called by the compile actions.
- /// </remarks>
- void OnEndBuild(bool success);
-
- /// <remarks>
- /// Only to be called by the compile actions.
- /// </remarks>
- void OnBeforeStartProject();
-
- /// <remarks>
/// Removes a file from it's project(s)
/// </remarks>
void RemoveFileFromProject(string fileName);
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/DefaultStatusBarService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/DefaultStatusBarService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/DefaultStatusBarService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -15,7 +15,7 @@
namespace MonoDevelop.Services
{
- public class DefaultStatusBarService : GuiSyncAbstractService, IStatusBarService, IProgressMonitor
+ public class DefaultStatusBarService : GuiSyncAbstractService, IStatusBarService
{
SdStatusBar statusBar = null;
StringParserService stringParserService = Runtime.StringParserService;
@@ -40,44 +40,26 @@
}
}
- public IProgressMonitor ProgressMonitor {
- get {
- Debug.Assert(statusBar != null);
- return this;
- }
- }
-
-
- void IProgressMonitor.BeginTask (string name, int totalWork)
+ public void BeginProgress (string name)
{
- statusBar.BeginTask (name, totalWork);
+ statusBar.BeginProgress (name);
}
- void IProgressMonitor.Worked (double work, string status)
+ public void SetProgressFraction (double work)
{
- statusBar.Worked (work, status);
+ statusBar.SetProgressFraction (work);
}
- void IProgressMonitor.Pulse ()
+ public void Pulse ()
{
statusBar.Pulse ();
}
- void IProgressMonitor.Done()
+ public void EndProgress ()
{
- statusBar.Done ();
+ statusBar.EndProgress ();
}
- bool IProgressMonitor.Canceled {
- get { return statusBar.Canceled; }
- set { statusBar.Canceled = value; }
- }
-
- string IProgressMonitor.TaskName {
- get { return statusBar.TaskName; }
- set { statusBar.TaskName = value; }
- }
-
public bool CancelEnabled {
get {
return statusBar != null && statusBar.CancelEnabled;
@@ -88,6 +70,17 @@
}
}
+ public IStatusIcon ShowStatusIcon (Gtk.Image image)
+ {
+ return statusBar.ShowStatusIcon (image);
+ }
+
+ public void HideStatusIcon (IStatusIcon icon)
+ {
+ statusBar.HideStatusIcon (icon);
+ }
+
+
[AsyncDispatch]
public void SetCaretPosition (int ln, int col, int ch)
{
@@ -97,7 +90,7 @@
[AsyncDispatch]
public void SetInsertMode (bool insertMode)
{
- statusBar.ModeStatusBarPanel.Push (1, insertMode ? GettextCatalog.GetString ("INS") : GettextCatalog.GetString ("OVR"));
+ statusBar.SetModeStatus (insertMode ? GettextCatalog.GetString ("INS") : GettextCatalog.GetString ("OVR"));
}
[AsyncDispatch]
@@ -125,33 +118,5 @@
bool wasError = false;
string lastMessage = "";
-
- [AsyncDispatch]
- public void RedrawStatusbar()
- {
- if (wasError) {
- ShowErrorMessage(lastMessage);
- } else {
- SetMessage(lastMessage);
- }
- }
-
- [AsyncDispatch]
- public void Update()
- {
- Debug.Assert(statusBar != null);
- /*statusBar.Clear ();
- statusBar.Clear ();
-
- foreach (StatusBarContributionItem item in Items) {
- if (item.Control != null) {
- statusBar.Add (item.Control);
- } else if (item.Panel != null) {
- statusBar.Add (item.Panel);
- } else {
- throw new ApplicationException ("StatusBarContributionItem " + item.ItemID + " has no Control or Panel defined.");
- }
- }*/
- }
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/IStatusBarService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/IStatusBarService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/StatusBar/IStatusBarService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -7,15 +7,12 @@
using System.Drawing;
using MonoDevelop.Gui;
using Gtk;
+using MonoDevelop.Gui.Components;
namespace MonoDevelop.Services
{
public interface IStatusBarService
{
- IProgressMonitor ProgressMonitor {
- get;
- }
-
Widget Control {
get;
}
@@ -25,6 +22,14 @@
set;
}
+ void BeginProgress (string name);
+ void SetProgressFraction (double work);
+ void EndProgress ();
+ void Pulse ();
+
+ IStatusIcon ShowStatusIcon (Gtk.Image image);
+ void HideStatusIcon (IStatusIcon icon);
+
void ShowErrorMessage(string message);
void SetMessage (string message);
@@ -32,7 +37,5 @@
void SetCaretPosition (int ln, int col, int ch);
void SetInsertMode (bool insertMode);
-
- void RedrawStatusbar();
}
}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/BackgroundProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/BackgroundProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/BackgroundProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,63 @@
+//
+// BackgroundProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.IO;
+using MonoDevelop.Gui.Components;
+using Gtk;
+
+namespace MonoDevelop.Services
+{
+ internal class BackgroundProgressMonitor: BaseProgressMonitor
+ {
+ string title;
+ IStatusIcon icon;
+
+ public BackgroundProgressMonitor (string title, string iconName)
+ {
+ this.title = title;
+ Image img = Runtime.Gui.Resources.GetImage (iconName, Gtk.IconSize.Menu);
+ icon = Runtime.Gui.StatusBar.ShowStatusIcon (img);
+ }
+
+ protected override void OnProgressChanged ()
+ {
+ if (UnknownWork)
+ icon.ToolTip = string.Format ("{0}\n{1}", title, CurrentTask);
+ else
+ icon.ToolTip = string.Format ("{0} ({1}%)\n{2}", title, (int)(GlobalWork * 100), CurrentTask);
+ }
+
+ public override void Dispose()
+ {
+ base.Dispose ();
+ Runtime.Gui.StatusBar.HideStatusIcon (icon);
+ }
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,84 @@
+// <file>
+// <copyright see="prj:///doc/copyright.txt"/>
+// <license see="prj:///doc/license.txt"/>
+// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+// <owner name="Lluis Sanchez" email="lluis at novell.com"/>
+// <version value="$version"/>
+// </file>
+
+using System;
+using System.Collections;
+using System.CodeDom.Compiler;
+using System.IO;
+using System.Diagnostics;
+using MonoDevelop.Services;
+
+using MonoDevelop.Core.Properties;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Gui;
+
+using Gtk;
+using Pango;
+
+namespace MonoDevelop.EditorBindings.Gui.Pads
+{
+ public class OutputProgressMonitor : BaseProgressMonitor
+ {
+ DefaultMonitorPad outputPad;
+
+ public OutputProgressMonitor (DefaultMonitorPad pad, string title, string icon)
+ {
+ outputPad = pad;
+ outputPad.BeginProgress (title);
+ }
+
+ [AsyncDispatch]
+ public override void BeginTask (string name, int totalWork)
+ {
+ if (outputPad == null) throw GetDisposedException ();
+ outputPad.BeginTask (name, totalWork);
+ base.BeginTask (name, totalWork);
+ }
+
+ [AsyncDispatch]
+ public override void EndTask ()
+ {
+ if (outputPad == null) throw GetDisposedException ();
+ outputPad.EndTask ();
+ base.EndTask ();
+ }
+
+ [AsyncDispatch]
+ protected override void OnWriteLog (string text)
+ {
+ if (outputPad == null) throw GetDisposedException ();
+ outputPad.WriteText (text);
+ }
+
+ protected override void OnCompleted ()
+ {
+ if (outputPad == null) throw GetDisposedException ();
+ outputPad.WriteText ("\n");
+
+ foreach (string msg in SuccessMessages)
+ outputPad.WriteText (msg + "\n");
+
+ foreach (string msg in Warnings)
+ outputPad.WriteText (msg + "\n");
+
+ foreach (string msg in Errors)
+ outputPad.WriteText (msg + "\n");
+
+ outputPad.EndProgress ();
+ base.OnCompleted ();
+
+ Runtime.TaskService.ReleasePad (outputPad);
+ outputPad = null;
+ }
+
+ Exception GetDisposedException ()
+ {
+ return new InvalidOperationException ("Output progress monitor already disposed.");
+ }
+ }
+}
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -0,0 +1,98 @@
+//
+// StatusProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.IO;
+using MonoDevelop.Gui;
+
+namespace MonoDevelop.Services
+{
+ internal class StatusProgressMonitor: BaseProgressMonitor
+ {
+ string title;
+ Gtk.Image icon;
+ bool showErrorDialogs;
+
+ public StatusProgressMonitor (string title, string iconName, bool showErrorDialogs)
+ {
+ this.title = title;
+ icon = Runtime.Gui.Resources.GetImage (iconName, Gtk.IconSize.Menu);
+ Runtime.Gui.StatusBar.BeginProgress (title);
+ Runtime.Gui.StatusBar.SetMessage (icon, title);
+ }
+
+ protected override void OnProgressChanged ()
+ {
+ Runtime.Gui.StatusBar.SetMessage (icon, CurrentTask);
+ if (!UnknownWork)
+ Runtime.Gui.StatusBar.SetProgressFraction (GlobalWork);
+ }
+
+ protected override void OnCompleted ()
+ {
+ Runtime.Gui.StatusBar.EndProgress ();
+
+ if (Errors.Count > 0) {
+ if (showErrorDialogs) {
+ string s = "";
+ foreach (string m in Errors)
+ s += m + "\n";
+ Runtime.MessageService.ShowError (s);
+ }
+ Gtk.Image img = Runtime.Gui.Resources.GetImage (Stock.Error, Gtk.IconSize.Menu);
+ Runtime.Gui.StatusBar.SetMessage (img, Errors [Errors.Count - 1]);
+ base.OnCompleted ();
+ return;
+ }
+
+ if (Warnings.Count > 0) {
+ if (showErrorDialogs) {
+ string s = "";
+ foreach (string m in Warnings)
+ s += m + "\n";
+ Runtime.MessageService.ShowWarning (s);
+ }
+
+ if (SuccessMessages.Count == 0) {
+ Gtk.Image img = Runtime.Gui.Resources.GetImage (Stock.Warning, Gtk.IconSize.Menu);
+ Runtime.Gui.StatusBar.SetMessage (img, Warnings [Warnings.Count - 1]);
+ base.OnCompleted ();
+ return;
+ }
+ }
+
+ if (SuccessMessages.Count > 0)
+ Runtime.Gui.StatusBar.SetMessage (SuccessMessages [SuccessMessages.Count - 1]);
+ else
+ Runtime.Gui.StatusBar.SetMessage (GettextCatalog.GetString ("Ready"));
+
+ base.OnCompleted ();
+ }
+ }
+}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs 2005-01-19 01:36:50 UTC (rev 2149)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs 2005-01-24 23:29:00 UTC (rev 2150)
@@ -12,14 +12,94 @@
using MonoDevelop.Gui;
using MonoDevelop.Gui.Pads;
using MonoDevelop.Internal.Project;
+using MonoDevelop.EditorBindings.Gui.Pads;
namespace MonoDevelop.Services
{
- public class TaskService : AbstractService
+ public class TaskService : GuiSyncAbstractService
{
ArrayList tasks = new ArrayList();
string compilerOutput = String.Empty;
+ ArrayList outputMonitors = new ArrayList ();
+ int monitorId = 0;
+
+
+ /******************************/
+
+ public IProgressMonitor GetBuildProgressMonitor ()
+ {
+ bool front = (bool) Runtime.Properties.GetProperty ("SharpDevelop.ShowOutputWindowAtBuild", true);
+ return new AggregatedProgressMonitor (
+ GetOutputProgressMonitor ("Build Output", MonoDevelop.Gui.Stock.BuildCombine, front, true),
+ GetStatusProgressMonitor ("Building...", MonoDevelop.Gui.Stock.BuildCombine, false)
+ );
+ }
+
+ public IProgressMonitor GetRunProgressMonitor ()
+ {
+ return GetOutputProgressMonitor ("Application Output", MonoDevelop.Gui.Stock.RunProgramIcon, true, true);
+ }
+
+ public IProgressMonitor GetLoadProgressMonitor ()
+ {
+ return GetStatusProgressMonitor ("Loading...", Stock.OpenFileIcon, true);
+ }
+
+ public IProgressMonitor GetSaveProgressMonitor ()
+ {
+ return GetStatusProgressMonitor ("Saving...", Stock.SaveIcon, true);
+ }
+
+
+ /******************************/
+
+
+ public IProgressMonitor GetStatusProgressMonitor (string title, string icon, bool showErrorDialogs)
+ {
+ return new StatusProgressMonitor (title, icon, showErrorDialogs);
+ }
+
+ public IProgressMonitor GetBackgroundProgressMonitor (string title, string icon)
+ {
+ return new BackgroundProgressMonitor (title, icon);
+ }
+
+ public IProgressMonitor GetOutputProgressMonitor (string title, string icon, bool bringToFront, bool allowMonitorReuse)
+ {
+ if (allowMonitorReuse) {
+ DefaultMonitorPad pad = null;
+ lock (outputMonitors) {
+ // Look for an available pad
+ for (int n=0; n<outputMonitors.Count; n++) {
+ DefaultMonitorPad mpad = (DefaultMonitorPad) outputMonitors [n];
+ if (mpad.Title == title) {
+ pad = mpad;
+ outputMonitors.RemoveAt (n);
+ break;
+ }
+ }
+ }
+ if (pad != null) {
+ if (bringToFront) pad.BringToFront ();
+ return new OutputProgressMonitor (pad, title, icon);
+ }
+ }
+
+ DefaultMonitorPad defMonitor = new DefaultMonitorPad (title, icon);
+ defMonitor.Id = (monitorId++).ToString ();
+ Runtime.Gui.Workbench.ShowPad (defMonitor);
+ if (bringToFront) defMonitor.BringToFront ();
+ return new OutputProgressMonitor (defMonitor, title, icon);
+ }
+
+ internal void ReleasePad (DefaultMonitorPad pad)
+ {
+ lock (outputMonitors) {
+ outputMonitors.Add (pad);
+ }
+ }
+
[FreeDispatch]
public ICollection Tasks {
get {
More information about the Monodevelop-patches-list
mailing list