mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
OneNote: changed the behavior for the default destination, we create a new page in the unfiled section. Also changed the names of the destination, included the Notebook & Section
This commit is contained in:
parent
87f4d83fd2
commit
0f63bf837f
3 changed files with 202 additions and 42 deletions
|
@ -69,7 +69,7 @@ namespace GreenshotOfficePlugin {
|
|||
if (page == null) {
|
||||
return "Microsoft OneNote";
|
||||
} else {
|
||||
return page.PageName;
|
||||
return page.DisplayName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,20 +110,20 @@ namespace GreenshotOfficePlugin {
|
|||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
|
||||
|
||||
if (page != null) {
|
||||
// No page selected, take the current
|
||||
List<OneNotePage> pages = OneNoteExporter.GetPages();
|
||||
if(pages == null || pages.Count == 0) {
|
||||
return exportInformation;
|
||||
if (page == null) {
|
||||
try {
|
||||
exportInformation.ExportMade = OneNoteExporter.ExportToNewPage(surface);
|
||||
} catch(Exception ex) {
|
||||
exportInformation.ErrorMessage = ex.Message;
|
||||
LOG.Error(ex);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
exportInformation.ExportMade = OneNoteExporter.ExportToPage(surface, page);
|
||||
} catch(Exception ex) {
|
||||
exportInformation.ErrorMessage = ex.Message;
|
||||
LOG.Error(ex);
|
||||
}
|
||||
page = pages[0];
|
||||
}
|
||||
try {
|
||||
OneNoteExporter.ExportToPage(surface, page);
|
||||
exportInformation.ExportMade = true;
|
||||
} catch (Exception ex) {
|
||||
exportInformation.ErrorMessage = ex.Message;
|
||||
LOG.Error(ex);
|
||||
}
|
||||
return exportInformation;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue