do not ask if one wants to enter password, just ask for password

This commit is contained in:
Andrzej Rybczak
2009-11-08 19:34:10 +01:00
parent 5b2dbe026c
commit c6e26e121f

View File

@@ -174,14 +174,6 @@ void TraceMpdStatus()
void NcmpcppErrorCallback(Connection *, int errorid, const char *msg, void *) 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->Refresh();
int answer = 0;
do
wFooter->ReadKey(answer);
while (answer != 'y' && answer != 'n');
if (answer == 'y')
{ {
wFooter->SetGetStringHelper(0); wFooter->SetGetStringHelper(0);
Statusbar() << "Password: "; Statusbar() << "Password: ";
@@ -190,7 +182,6 @@ void NcmpcppErrorCallback(Connection *, int errorid, const char *msg, void *)
ShowMessage("Password accepted!"); ShowMessage("Password accepted!");
wFooter->SetGetStringHelper(StatusbarGetStringHelper); wFooter->SetGetStringHelper(StatusbarGetStringHelper);
} }
}
else else
ShowMessage("%s", msg); ShowMessage("%s", msg);
} }