Search
lxdream.org :: lxdream/src/cocoaui/cocoa_win.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoa_win.c
changeset 837:4eae2ddccf9c
prev786:8f6ece92500e
next839:51f1c4195790
author nkeynes
date Thu Aug 28 01:39:51 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Extract the disc title (where available) and display in the title bar
file annotate diff log raw
1.1 --- a/src/cocoaui/cocoa_win.c Tue Jul 29 08:51:10 2008 +0000
1.2 +++ b/src/cocoaui/cocoa_win.c Thu Aug 28 01:39:51 2008 +0000
1.3 @@ -19,6 +19,7 @@
1.4 #include "cocoaui/cocoaui.h"
1.5 #include "lxdream.h"
1.6 #include "dreamcast.h"
1.7 +#include "gdrom/gdrom.h"
1.8 #include <ApplicationServices/ApplicationServices.h>
1.9
1.10 @interface NSWindow (OSX10_5_and_later)
1.11 @@ -155,9 +156,7 @@
1.12 [self setDelegate: [NSApp delegate]];
1.13 [self setContentMinSize: contentRect.size];
1.14 [self setAcceptsMouseMovedEvents: YES];
1.15 -
1.16 - NSString *title = [[NSString alloc] initWithCString: lxdream_package_name encoding: NSASCIIStringEncoding];
1.17 - [self setTitle: title];
1.18 + [self updateTitle];
1.19
1.20 NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier: @"LxdreamToolbar"];
1.21 [toolbar setDelegate: [[LxdreamToolbarDelegate alloc] init]];
1.22 @@ -169,6 +168,18 @@
1.23 }
1.24 }
1.25
1.26 +- (void)updateTitle
1.27 +{
1.28 + NSString *title;
1.29 + const char *disc_title = gdrom_get_current_disc_title();
1.30 + if( disc_title == NULL ) {
1.31 + title = [NSString stringWithCString: lxdream_package_name];
1.32 + } else {
1.33 + title = [NSString stringWithFormat: @"%s - %s", lxdream_package_name, disc_title];
1.34 + }
1.35 + [self setTitle: title];
1.36 +}
1.37 +
1.38 - (void)setStatusText: (const gchar *)text
1.39 {
1.40 if( isGrabbed ) {
.