diff options
author | Michael Hutchinson <mhutchinson@novell.com> | 2010-02-06 07:47:34 +0300 |
---|---|---|
committer | Michael Hutchinson <mhutchinson@novell.com> | 2010-02-06 07:47:34 +0300 |
commit | 098e5952c238d9641705b82803bb6076ce43eb03 (patch) | |
tree | c62a321bcac2cdd00445c201437b4a612f75ffb3 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands | |
parent | 94365b33d23d0514b8254f34234f6cf9b0b9ea07 (diff) |
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPrintable.cs:
Implement a Page Setup command.
* src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:
Track print API.
svn path=/trunk/monodevelop/; revision=150971
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs index e5e16d43e4..6f7fad2a2f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs @@ -60,6 +60,7 @@ namespace MonoDevelop.Ide.Commands SaveAs, PrintDocument, PrintPreviewDocument, + PrintPageSetup, RecentFileList, ClearRecentFiles, RecentProjectList, @@ -212,7 +213,7 @@ namespace MonoDevelop.Ide.Commands { protected override void Run () { - IdeApp.Workbench.ActiveDocument.GetContent<IPrintable> ().PrintDocument (); + IdeApp.Workbench.ActiveDocument.GetContent<IPrintable> ().PrintDocument (PrintingSettings.Instance); } protected override void Update (CommandInfo info) @@ -233,7 +234,7 @@ namespace MonoDevelop.Ide.Commands { protected override void Run () { - IdeApp.Workbench.ActiveDocument.GetContent<IPrintable> ().PrintPreviewDocument (); + IdeApp.Workbench.ActiveDocument.GetContent<IPrintable> ().PrintPreviewDocument (PrintingSettings.Instance); } protected override void Update (CommandInfo info) @@ -241,6 +242,27 @@ namespace MonoDevelop.Ide.Commands info.Enabled = PrintHandler.CanPrint (); } } + + //FIXME: on GTK 2.18.x there is an option to integrate print preview with the print dialog, which makes this unnecessary + // ideally we could only conditionally show it - this is why we handle the PrintingSettings here + // MonoDevelop.Ide.Commands.FileCommands.PrintPageSetup + public class PrintPageSetupHandler : CommandHandler + { + protected override void Run () + { + var settings = PrintingSettings.Instance; + settings.PageSetup = Gtk.Print.RunPageSetupDialog (IdeApp.Workbench.RootWindow, settings.PageSetup, + settings.PrintSettings); + } + + protected override void Update (CommandInfo info) + { + info.Enabled = PrintHandler.CanPrint (); + } + } + + + // MonoDevelop.Ide.Commands.FileCommands.RecentFileList public class RecentFileListHandler : CommandHandler { |