|
|
|
@ -175,21 +175,12 @@ void NcmpcppErrorCallback(Connection *, int errorid, const char *msg, void *) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (errorid == MPD_SERVER_ERROR_PERMISSION) |
|
|
|
if (errorid == MPD_SERVER_ERROR_PERMISSION) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Statusbar() << msg << ", enter password ? [" << fmtBold << 'y' << fmtBoldEnd << "/" << fmtBold << 'n' << fmtBoldEnd << "]"; |
|
|
|
wFooter->SetGetStringHelper(0); |
|
|
|
wFooter->Refresh(); |
|
|
|
Statusbar() << "Password: "; |
|
|
|
int answer = 0; |
|
|
|
Mpd.SetPassword(wFooter->GetString(-1, 0, 1)); |
|
|
|
do |
|
|
|
if (Mpd.SendPassword()) |
|
|
|
wFooter->ReadKey(answer); |
|
|
|
ShowMessage("Password accepted!"); |
|
|
|
while (answer != 'y' && answer != 'n'); |
|
|
|
wFooter->SetGetStringHelper(StatusbarGetStringHelper); |
|
|
|
if (answer == 'y') |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
wFooter->SetGetStringHelper(0); |
|
|
|
|
|
|
|
Statusbar() << "Password: "; |
|
|
|
|
|
|
|
Mpd.SetPassword(wFooter->GetString(-1, 0, 1)); |
|
|
|
|
|
|
|
if (Mpd.SendPassword()) |
|
|
|
|
|
|
|
ShowMessage("Password accepted!"); |
|
|
|
|
|
|
|
wFooter->SetGetStringHelper(StatusbarGetStringHelper); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
ShowMessage("%s", msg); |
|
|
|
ShowMessage("%s", msg); |
|
|
|
|