ncmpcpp: fix custom startup screen

This commit is contained in:
Andrzej Rybczak
2013-04-07 18:41:34 +02:00
parent 5aec12b269
commit 425836630e
4 changed files with 4 additions and 28 deletions

View File

@@ -253,27 +253,6 @@ void setWindowsDimensions()
FooterHeight = Config.statusbar_visibility ? 2 : 1;
}
bool connectToMPD()
{
try
{
Mpd.Connect();
if (Mpd.Version() < 16)
{
std::cout << "MPD < 0.16.0 is not supported, please upgrade\n";
return false;
}
}
catch (std::exception &e)
{
std::cout << "Couldn't connect to MPD ";
std::cout << "(host = " << Mpd.GetHostname() << ", port = " << Mpd.GetPort() << ")";
std::cout << ": " << e.what() << std::endl;
return false;
}
return true;
}
bool askYesNoQuestion(const std::string &question, void (*callback)())
{
using Global::wFooter;

View File

@@ -65,7 +65,6 @@ void setResizeFlags();
void resizeScreen(bool reload_main_window);
void setWindowsDimensions();
bool connectToMPD();
bool askYesNoQuestion(const std::string &question, void (*callback)());
bool isMPDMusicDirSet();

View File

@@ -121,8 +121,6 @@ void ParseArgv(int argc, char **argv)
exit(0);
}
Actions::connectToMPD();
if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--screen"))
{
if (++i == argc) {

View File

@@ -170,10 +170,6 @@ int main(int argc, char **argv)
myPlaylist->switchTo();
myPlaylist->UpdateTimer();
// go to startup screen
if (Config.startup_screen != myScreen)
Config.startup_screen->switchTo();
// local variables
Key input(0, Key::Standard);
timeval past = { 0, 0 };
@@ -213,6 +209,10 @@ int main(int argc, char **argv)
myPlaylist->main().highlight(curr_pos);
}
// go to startup screen
if (Config.startup_screen != myScreen)
Config.startup_screen->switchTo();
myBrowser->fetchSupportedExtensions();
# ifdef ENABLE_OUTPUTS
myOutputs->FetchList();