From 14a8ec19b5f01373410c11ef20c28367fe911e28 Mon Sep 17 00:00:00 2001 From: Matthew Judy Date: Thu, 12 Dec 2002 09:09:36 +0000 Subject: [PATCH] Making MenuTunes use the ITKit, for ITStatusItem. There are a few notes: 1-) In order to build MenuTunes from this point forward, you will need to check out the ITKit and build it. 2-) The ITKit project folder will need to be in the same folder as MenuTunes. For example, I have both ITKit and MenuTunes inside ~/Projects. So, check MenuTunes out wherever you keep your projects, build it, and all should go well. The MenuTunes project will find ITKit, link against it, and copy it inside the MenuTunes app package. If you have any questions, ask me IMMEDIATELY. Thanks! --- MenuTunes.h | 3 ++- MenuTunes.m | 23 ++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/MenuTunes.h b/MenuTunes.h index c7dc4fd..da28d11 100755 --- a/MenuTunes.h +++ b/MenuTunes.h @@ -14,13 +14,14 @@ #import #import +#import //@class MenuTunesView; @class PreferencesController, StatusWindowController; @interface MenuTunes : NSObject { - NSStatusItem *statusItem; + ITStatusItem *statusItem; NSMenu *menu; ComponentInstance asComponent; diff --git a/MenuTunes.m b/MenuTunes.m index f4a66cd..7df098f 100755 --- a/MenuTunes.m +++ b/MenuTunes.m @@ -57,16 +57,15 @@ Things to do: [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(iTunesLaunched:) name:NSWorkspaceDidLaunchApplicationNotification object:nil]; refreshTimer = nil; } + + statusItem = [[ITStatusItem alloc] initWithStatusBar:[NSStatusBar systemStatusBar] + withLength:NSVariableStatusItemLength]; - statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]; - [[[statusItem _button] cell] setType:NSNullCellType]; [statusItem setImage:[NSImage imageNamed:@"menu"]]; - [[statusItem _button] setAlternateImage:[NSImage imageNamed:@"selected_image"]]; - [statusItem setHighlightMode:YES]; + [statusItem setAlternateImage:[NSImage imageNamed:@"selected_image"]]; [statusItem setMenu:menu]; // Below line of code is for creating builds for Beta Testers // [statusItem setToolTip:@"This Nontransferable Beta (Built on __DATE__) of iThink Software's MenuTunes is Registered to: Beta Tester (betatester@somedomain.com)."]; - [statusItem retain]; } @@ -97,23 +96,19 @@ Things to do: nil] forKey:@"menu"]; } - if (![defaults objectForKey:@"showName"]) - { + if (![defaults objectForKey:@"showName"]) { [defaults setBool:YES forKey:@"showName"]; } - if (![defaults objectForKey:@"showArtist"]) - { + if (![defaults objectForKey:@"showArtist"]) { [defaults setBool:YES forKey:@"showArtist"]; } - if (![defaults objectForKey:@"showAlbum"]) - { + if (![defaults objectForKey:@"showAlbum"]) { [defaults setBool:NO forKey:@"showAlbum"]; } - if (![defaults objectForKey:@"showTime"]) - { + if (![defaults objectForKey:@"showTime"]) { [defaults setBool:NO forKey:@"showTime"]; } } @@ -215,9 +210,11 @@ Things to do: if (upcomingSongsItem) { [self rebuildUpcomingSongsMenu]; } + if (playlistItem) { [self rebuildPlaylistMenu]; } + if (eqItem) { [self rebuildEQPresetsMenu]; } -- 2.20.1