Skip to content

Commit

Permalink
Cleanup Menus
Browse files Browse the repository at this point in the history
  • Loading branch information
Frak AlNuaimy committed Sep 3, 2020
1 parent 58081c7 commit 1d7aa62
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 14 deletions.
23 changes: 23 additions & 0 deletions App/BitBar/Assets.xcassets/AboutIcon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions App/BitBar/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
"version" : 1,
"author" : "xcode"
}
}
17 changes: 11 additions & 6 deletions App/BitBar/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -539,22 +539,27 @@ - (void) cycleLines {
return;
}

if (params[@"href"] || params[@"bash"] || params[@"imsg"] || params[@"refresh"]) {
if (params[@"href"] || params[@"bash"] || params[@"imsg"] || params[@"refresh"])
{
self.statusItem.menu = nil;
self.statusItem.action = @selector(statusItemClicked);
self.statusItem.target = self;
} else if (!self.statusItem.menu) {
} else if (!self.statusItem.menu)
{
self.statusItem.action = NULL;
self.statusItem.target = nil;
[self rebuildMenuForStatusItem:self.statusItem];
}

// Add image if present
if (params[@"templateImage"]) {
if (params[@"templateImage"])
{
self.statusItem.image = [self createImageFromBase64:params[@"templateImage"] isTemplate:true];
}else if (params[@"image"]) {
}else if (params[@"image"])
{
self.statusItem.image = [self createImageFromBase64:params[@"image"] isTemplate:false];
} else {
} else
{
self.statusItem.image = nil;
}

Expand Down Expand Up @@ -759,7 +764,7 @@ - (void)menuWillOpen:(NSMenu *)menu {
[self.statusItem setHighlightMode:YES];

[self.lastUpdatedMenuItem setTitle:self.lastUpdated ? [NSString stringWithFormat:@"⏳ Updated %@", self.lastUpdatedString] : @"Refreshing…"];
[self.MemoryUsedMenuItem setTitle: [NSString stringWithFormat:@"Memory Used: %d MB", [self report_memory]]];
[self.MemoryUsedMenuItem setTitle: [NSString stringWithFormat:@"🐏 Memory Used: %d MB", [self report_memory]]];
self.MemoryUsedMenuItem.alternate = YES;
self.MemoryUsedMenuItem.keyEquivalentModifierMask = NSAlternateKeyMask;

Expand Down
30 changes: 26 additions & 4 deletions App/BitBar/PluginManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (void) addHelperItemsToMenu:(NSMenu*)menu asSubMenu:(BOOL)submenu {

if (submenu) {
NSMenu *moreMenu = [NSMenu.alloc initWithTitle:@"Preferences"];
moreItem = [NSMenuItem.alloc initWithTitle:@"🅿️ Preferences" action:nil keyEquivalent:@""];
moreItem = [NSMenuItem.alloc initWithTitle:@"ℹ️ About" action:nil keyEquivalent:@""];
moreItem.submenu = moreMenu;
[menu addItem:moreItem];
targetMenu = moreMenu;
Expand Down Expand Up @@ -117,12 +117,33 @@ - (void) addHelperItemsToMenu:(NSMenu*)menu asSubMenu:(BOOL)submenu {
ADD_MENU(@"Check for Updates…", checkForUpdates:, nil, [SUUpdater sharedUpdater]);
}
*/
// open at login, aka openAtLoginMenuItem
[ADD_MENU(@"Open at Login", toggleOpenAtLogin:, nil, self) setState:_launchAtLoginController.launchAtLogin];

NSMenuItem *fraksoftMI = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"🆔 Docker Info by FrakSoft"] action:nil keyEquivalent:@""];
NSMenuItem *made = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"🛠️ Made with ❤️ at the Frak Lab"] action:@selector(openLinkedInPage) keyEquivalent:@""];
NSMenuItem *made2 = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"🛠️ Made with 💉💦 & 😭 in Hell"] action:@selector(openLinkedInPage) keyEquivalent:@""];
made2.alternate = YES;
made2.keyEquivalentModifierMask = NSAlternateKeyMask;

made.toolTip = @"🌐 Clicking here will open up my LinkedIn profile";
made2.toolTip = @"🌐 Clicking here will open up my LinkedIn profile";
[made setTarget:self]; //This makes it highlighted and clickable
[made2 setTarget:self]; //This makes it highlighted and clickable
NSMenuItem *DockerInfoImg = [ [NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@""] action:@selector(openGithubPage) keyEquivalent:@""];
[ DockerInfoImg setImage: [ NSImage imageNamed:@"AboutIcon"] ];
DockerInfoImg.indentationLevel = [@"3" intValue];
DockerInfoImg.enabled=YES;
[DockerInfoImg setTarget:self]; //This makes it highlighted and clickable
DockerInfoImg.toolTip = @"🌐 Clicking here will take you to this project's GitHub page";
[targetMenu addItem:DockerInfoImg];
[targetMenu addItem:fraksoftMI];
[targetMenu addItem:versionMenuitem];
[targetMenu addItem:buildMenuitem];
[targetMenu addItem:made];
[targetMenu addItem:made2];
[targetMenu addItem:NSMenuItem.separatorItem];
// open at login, aka openAtLoginMenuItem
[ADD_MENU(@"Open at Login", toggleOpenAtLogin:, nil, self) setState:_launchAtLoginController.launchAtLogin];



//
Expand All @@ -144,7 +165,8 @@ - (void) quit {
[NSApp terminate:[NSApplication sharedApplication]];
}
#define WSPACE NSWorkspace.sharedWorkspace

- (void) openGithubPage { [WSPACE openURL:[NSURL URLWithString:@"https://github.com/frakman1/dockerinfo"]];}
- (void) openLinkedInPage { [WSPACE openURL:[NSURL URLWithString:@"https://www.linkedin.com/in/fraknuaimy"]];}
- (void) openReportIssuesPage {
[WSPACE openURL:[NSURL URLWithString:@"https://github.com/matryer/bitbar/issues"]];
}
Expand Down
4 changes: 2 additions & 2 deletions App/Dockerinfo-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>v1.0.0_beta-4-g4a880fd</string>
<string>v1.0.0-beta2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>Sep-02-2020 17:28:38</string>
<string>Sep-02-2020 23:03:26</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

Manage your local and remote docker containers from your menubar

Powered by [BitBar](https://github.com/matryer/bitbar/)

<img alt="demo" src="https://github.com/frakman1/dockerinfo/blob/master/images/dockerinfo1.png?raw=true">

Download releases from [here](https://github.com/frakman1/dockerinfo/releases)

0 comments on commit 1d7aa62

Please sign in to comment.