Skip to content

Commit

Permalink
MailboxAlert fix display in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Mayer committed Jan 6, 2018
1 parent 98cd1ba commit e6febfe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions MailboxAlert/MailboxAlert.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
Expand Down Expand Up @@ -629,7 +629,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.10;
SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
WARNING_CFLAGS = (
Expand Down
2 changes: 1 addition & 1 deletion MailboxAlert/MailboxAlert/Account.m
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ - (void)encodeWithCoder:(NSCoder *)coder
if ((![[SSKeychain passwordForService:makeString(@"mailbox://%@", self.server) account:self.username] isEqualToString:_password]) && // not already stored
(![SSKeychain setPassword:_password forService:makeString(@"mailbox://%@", self.server) account:self.username error:&error])) // couldn't store it
{
NSRunAlertPanel(@"MailboxAlert Problem", @"MailboxAlert could not store your mailbox password securely in the system keychain. Please make sure you've allowed MailboxAlert to access the keychain and try again.", @"OK", nil, nil);
alert(@"MailboxAlert Problem", @"MailboxAlert could not store your mailbox password securely in the system keychain. Please make sure you've allowed MailboxAlert to access the keychain and try again.", @"OK", nil, nil);
exit(1);
}

Expand Down
26 changes: 10 additions & 16 deletions MailboxAlert/MailboxAlert/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification

self.visibilityManager = [VisibilityManager new];
self.visibilityManager.statusItemMenu = self.statusItemMenu;
self.visibilityManager.templateSetting = kTemplateAlways;
NSImage *image = [NSImage imageNamed:@"menuicon_ok"];
[image setTemplate:YES];
self.visibilityManager.menubarIcon = image;
self.loginItemManager = [LoginItemManager new];

Expand Down Expand Up @@ -123,7 +123,6 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
(self.summaryLabel).stringValue = makeString(@"%li accounts, %li problems", self.accountArray.count, problems);

NSImage *image = [NSImage imageNamed:(problems && kNotificationMenubarKey.defaultInt) ? @"menuicon_error" : @"menuicon_ok"];
[image setTemplate:YES];
self.visibilityManager.menubarIcon = image;

self.visibilityManager.menuTooltip = makeString(@"MailboxAlert: %li accounts, %li problems (last check: %@)", self.accountArray.count, problems, [NSDateFormatter localizedStringFromDate:[NSDate date] dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterMediumStyle]);
Expand Down Expand Up @@ -198,11 +197,7 @@ - (IBAction)toolbarClicked:(id)sender

- (void)startAccountEditing
{
[NSApp beginSheet:self.setupPanel1
modalForWindow:self.window
modalDelegate:nil
didEndSelector:nil
contextInfo:NULL];
[self.window beginSheet:self.setupPanel1 completionHandler:^(NSModalResponse r) {}];

self.passwordField.stringValue = NON_NIL_STR(self.currentAccount[@"password"]);
self.usernameField.stringValue = NON_NIL_STR(self.currentAccount[@"username"]);
Expand Down Expand Up @@ -328,10 +323,10 @@ - (IBAction)continueAccount:(NSButton *)sender
if ([mb[@"status"] hasPrefix:@"ERR"])
{
if ([mb[@"status"] hasPrefix:@"ERRSERVER"])
NSRunAlertPanel(cc.appName, @"The server you've entered doesn't seem to be a valid IMAP server or maybe it is offline at the moment.", @"OK", nil, nil);
alert_apptitled(@"The server you've entered doesn't seem to be a valid IMAP server or maybe it is offline at the moment.", @"OK", nil, nil);

if ([mb[@"status"] hasPrefix:@"ERRCREDENTIALS"])
NSRunAlertPanel(cc.appName, @"The username and password combination was not accepted by the server.", @"OK", nil, nil);
alert_apptitled(@"The username and password combination was not accepted by the server.", @"OK", nil, nil);
}
else
{
Expand Down Expand Up @@ -361,18 +356,14 @@ - (IBAction)continueAccount:(NSButton *)sender

[self updateThresholdField:nil];

[NSApp beginSheet:self.setupPanel2
modalForWindow:self.window
modalDelegate:nil
didEndSelector:nil
contextInfo:NULL];
[self.window beginSheet:self.setupPanel2 completionHandler:^(NSModalResponse r) {}];
}
});
});
}
else
{
NSRunAlertPanel(cc.appName, @"You must enter a server and username and password to continue.", @"OK", nil, nil);
alert_apptitled(@"You must enter a server and username and password to continue.", @"OK", nil, nil);
}
}

Expand Down Expand Up @@ -440,7 +431,10 @@ + (NSDictionary *)checkMailbox:(NSDictionary *)account
// Quota 1480.996094 10333.430664

NSMutableDictionary *out = [NSMutableDictionary new];
NSString *res = [@[@"/usr/bin/python", @"imap.py".resourcePath, account[@"server"], account[@"username"], account[@"password"]] runAsTask];
NSString *server = account[@"server"];
NSString *username = account[@"username"];
NSString *passwd = account[@"password"];
NSString *res = [@[@"/usr/bin/python", @"imap.py".resourcePath, server, username, passwd] runAsTask];

// LOG(res);

Expand Down
9 changes: 5 additions & 4 deletions MailboxAlert/MailboxAlert/History.rtf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{\rtf1\ansi\ansicpg1252\cocoartf1561
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf200
{\fonttbl\f0\fswiss\fcharset0 ArialMT;\f1\froman\fcharset0 TimesNewRomanPSMT;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\vieww9000\viewh8400\viewkind0
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\partightenfactor0
{\field{\*\fldinst{HYPERLINK "https://www.corecode.io/mailboxalert/"}}{\fldrslt
Expand All @@ -17,7 +17,8 @@
\cf0 \expnd0\expndtw0\kerning0
\CocoaLigature1 \'95 IMPORTANT: The minimum system requirements have been raised to macOS 10.10\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\partightenfactor0
\cf0 \kerning1\expnd0\expndtw0 \CocoaLigature0 \
\cf0 \kerning1\expnd0\expndtw0 \CocoaLigature0 \'95 Fixed icon display when menubar has ben set to be 'dark' in the System Preferences\
\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\partightenfactor0

\b \cf0 1.1.3
Expand Down

0 comments on commit e6febfe

Please sign in to comment.