Skip to content

Commit

Permalink
Fix issue where calendar buttons didn't appear
Browse files Browse the repository at this point in the history
This fixes #65

This bug manifested only on non-english systems and was caused by
looking at a field that was localized to determine whether to show the
buttons or not.
  • Loading branch information
mscrivo committed Aug 21, 2017
1 parent bcd9fb2 commit 594b796
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions OutlookDesktop/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private void SetMAPIFolder()
try
{
_outlookFolder = Startup.OutlookNameSpace.GetFolderFromID(Preferences.OutlookFolderEntryId, Preferences.OutlookFolderStoreId);
ShowToolbarButtonsFor(_outlookFolder.FolderPath);
ShowToolbarButtonsFor(_outlookFolder.DefaultMessageClass);

}
catch (Exception ex)
Expand Down Expand Up @@ -521,16 +521,15 @@ private void DefaultFolderTypesClicked(FolderViewType folderViewType, ToolStripM
}

/// <summary>
/// Given a folderPath, show the appropriate buttons in the toolbar for that view.
/// Given a defaultMessagePath, show the appropriate buttons in the toolbar for that view.
/// </summary>
/// <param name="folderPath"></param>
private void ShowToolbarButtonsFor(string folderPath)
/// <param name="defaultMessagePath"></param>
private void ShowToolbarButtonsFor(string defaultMessagePath)
{
Logger.Info($"Outlook folder path: {folderPath}");
switch (folderPath)
Logger.Info($"Outlook folder path: {defaultMessagePath}");
switch (defaultMessagePath)
{
// ReSharper disable once PatternAlwaysOfType
case string c when c.Contains("\\Calendar"):
case "IPM.Appointment":
{
TodayButton.Visible = true;
DayButton.Visible = true;
Expand All @@ -544,7 +543,7 @@ private void ShowToolbarButtonsFor(string folderPath)
NewEmailButton.Visible = false;
break;
}
case string s when s.Contains("\\Inbox"):
case "IPM.Note":
{
TodayButton.Visible = false;
DayButton.Visible = false;
Expand Down

0 comments on commit 594b796

Please sign in to comment.