diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2011-02-04 16:06:58 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-02-07 15:45:40 +0100 |
commit | 19a5bfdf0eea1e840cd93c99e52b1af5f2647be0 (patch) | |
tree | 1247b6aa03e4134669f6233aad5e35b4a378b930 /src | |
parent | f8ee41a287e077e95085a4b26ceee3b92fa2bfd8 (diff) | |
download | pianobar-19a5bfdf0eea1e840cd93c99e52b1af5f2647be0.tar.gz pianobar-19a5bfdf0eea1e840cd93c99e52b1af5f2647be0.tar.bz2 pianobar-19a5bfdf0eea1e840cd93c99e52b1af5f2647be0.zip |
Add eventcmd events for login/fetch stations
See issue #83
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -81,15 +81,17 @@ static bool BarMainLoginUser (BarApp_t *app) { PianoReturn_t pRet; WaitressReturn_t wRet; PianoRequestDataLogin_t reqData; + bool ret; + reqData.user = app->settings.username; reqData.password = app->settings.password; reqData.step = 0; BarUiMsg (MSG_INFO, "Login... "); - if (!BarUiPianoCall (app, PIANO_REQUEST_LOGIN, &reqData, &pRet, &wRet)) { - return false; - } - return true; + ret = BarUiPianoCall (app, PIANO_REQUEST_LOGIN, &reqData, &pRet, &wRet); + BarUiStartEventCmd (&app->settings, "userlogin", NULL, NULL, &app->player, + NULL, pRet, wRet); + return ret; } /* ask for username/password if none were provided in settings @@ -116,13 +118,13 @@ static void BarMainGetLoginCredentials (BarSettings_t *settings, static bool BarMainGetStations (BarApp_t *app) { PianoReturn_t pRet; WaitressReturn_t wRet; + bool ret; BarUiMsg (MSG_INFO, "Get stations... "); - if (!BarUiPianoCall (app, PIANO_REQUEST_GET_STATIONS, NULL, &pRet, - &wRet)) { - return false; - } - return true; + ret = BarUiPianoCall (app, PIANO_REQUEST_GET_STATIONS, NULL, &pRet, &wRet); + BarUiStartEventCmd (&app->settings, "usergetstations", NULL, NULL, &app->player, + app->ph.stations, pRet, wRet); + return ret; } /* get initial station from autostart setting or user input |