ncmpcpp: fix custom startup screen
This commit is contained in:
@@ -253,27 +253,6 @@ void setWindowsDimensions()
|
|||||||
FooterHeight = Config.statusbar_visibility ? 2 : 1;
|
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)())
|
bool askYesNoQuestion(const std::string &question, void (*callback)())
|
||||||
{
|
{
|
||||||
using Global::wFooter;
|
using Global::wFooter;
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ void setResizeFlags();
|
|||||||
void resizeScreen(bool reload_main_window);
|
void resizeScreen(bool reload_main_window);
|
||||||
void setWindowsDimensions();
|
void setWindowsDimensions();
|
||||||
|
|
||||||
bool connectToMPD();
|
|
||||||
bool askYesNoQuestion(const std::string &question, void (*callback)());
|
bool askYesNoQuestion(const std::string &question, void (*callback)());
|
||||||
bool isMPDMusicDirSet();
|
bool isMPDMusicDirSet();
|
||||||
|
|
||||||
|
|||||||
@@ -121,8 +121,6 @@ void ParseArgv(int argc, char **argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Actions::connectToMPD();
|
|
||||||
|
|
||||||
if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--screen"))
|
if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--screen"))
|
||||||
{
|
{
|
||||||
if (++i == argc) {
|
if (++i == argc) {
|
||||||
|
|||||||
@@ -170,10 +170,6 @@ int main(int argc, char **argv)
|
|||||||
myPlaylist->switchTo();
|
myPlaylist->switchTo();
|
||||||
myPlaylist->UpdateTimer();
|
myPlaylist->UpdateTimer();
|
||||||
|
|
||||||
// go to startup screen
|
|
||||||
if (Config.startup_screen != myScreen)
|
|
||||||
Config.startup_screen->switchTo();
|
|
||||||
|
|
||||||
// local variables
|
// local variables
|
||||||
Key input(0, Key::Standard);
|
Key input(0, Key::Standard);
|
||||||
timeval past = { 0, 0 };
|
timeval past = { 0, 0 };
|
||||||
@@ -213,6 +209,10 @@ int main(int argc, char **argv)
|
|||||||
myPlaylist->main().highlight(curr_pos);
|
myPlaylist->main().highlight(curr_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// go to startup screen
|
||||||
|
if (Config.startup_screen != myScreen)
|
||||||
|
Config.startup_screen->switchTo();
|
||||||
|
|
||||||
myBrowser->fetchSupportedExtensions();
|
myBrowser->fetchSupportedExtensions();
|
||||||
# ifdef ENABLE_OUTPUTS
|
# ifdef ENABLE_OUTPUTS
|
||||||
myOutputs->FetchList();
|
myOutputs->FetchList();
|
||||||
|
|||||||
Reference in New Issue
Block a user