Skip to content

Commit 76f5fa0

Browse files
committed
Add a waiting Alert for Last.fm 's auth.
1 parent 864ef7c commit 76f5fa0

6 files changed

Lines changed: 30 additions & 7 deletions

File tree

Last.fm

Preferences/AccountPreferences.mm

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,32 @@ - (IBAction)actionConnect:(id)sender
9999
}
100100
else
101101
{
102+
NSAlert *alert = [[NSAlert alloc]init];
103+
[alert setMessageText: NSLocalizedString(@"uPlayer is 'Waiting' for your authorization",nil ) ];
104+
[alert setInformativeText: NSLocalizedString(@"Switch to the web instanse just opened and login in to allow uPlayer for scrobbling songs",nil) ];
105+
[alert addButtonWithTitle: NSLocalizedString(@"Abort", nil)];
106+
107+
__block bool stopAuth = false;
108+
102109
dojobInBkgnd(^{
103-
if (auth( *_user , true ) )
110+
111+
if (auth( *_user , true , stopAuth ) )
104112
{
113+
105114
}
106115

107116
} , ^{
117+
[(NSWindow *)alert.window close];
108118
[self updateUIUser: _user];
109119
});
110120

121+
if ([alert runModal] == NSAlertFirstButtonReturn)
122+
{
123+
stopAuth = true;
124+
125+
[self updateUIUser: _user];
126+
}
127+
111128
}
112129

113130

src/PlayerDocument.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ -(instancetype)init
3030
self.resumeAtReboot = TRUE;
3131
self.playTime = -1;
3232
self.trackSongsWhenPlayStarted = TRUE;
33-
self.lastFmEnabled =FALSE;
33+
self.lastFmEnabled = FALSE;
3434
self.volume = 1.0;
3535
self.playerQueue=[[PlayerQueue alloc]init];
3636
self.playingIndexList = -1;

src/UPlayer.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void initLastFm()
2222

2323

2424
// Load Last.fm session locally
25-
auth(* lastFmUser() , FALSE );
25+
authLocal(* lastFmUser() );
2626
}
2727

2828
@interface UPlayer ()

uPlayer.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@
823823
INFOPLIST_FILE = uPlayer/Info.plist;
824824
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
825825
LIBRARY_SEARCH_PATHS = /usr/local/lib;
826-
MACOSX_DEPLOYMENT_TARGET = 10.8;
826+
MACOSX_DEPLOYMENT_TARGET = 10.9;
827827
OTHER_LDFLAGS = (
828828
"-ltag",
829829
"-ljson",
@@ -855,7 +855,7 @@
855855
INFOPLIST_FILE = uPlayer/Info.plist;
856856
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
857857
LIBRARY_SEARCH_PATHS = /usr/local/lib;
858-
MACOSX_DEPLOYMENT_TARGET = 10.8;
858+
MACOSX_DEPLOYMENT_TARGET = 10.9;
859859
OTHER_LDFLAGS = (
860860
"-ltag",
861861
"-ljson",

uPlayer/zh-Hans.lproj/Localizable.strings

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,10 @@
4646

4747
"Disconnect the session?" = "断开会话?";
4848

49-
"The session connection needs login in on web browser." = "会话需要在浏览器里登录";
49+
"The session connection needs login in on web browser." = "会话需要在浏览器里登录";
50+
51+
"uPlayer is 'Waiting' for your authorization" = "uPlayer正在'等待'您的授权";
52+
"Switch to the web instanse just opened and login in to allow uPlayer for scrobbling songs" = "切换到刚打开的网页然后登录来允许uPlayer Scrobble歌曲";
53+
"Abort" = "中止";
54+
55+

0 commit comments

Comments
 (0)