diff --git a/TODO b/TODO index c5d8295a..04c0e52b 100644 --- a/TODO +++ b/TODO @@ -28,15 +28,19 @@ - some early playback end spotted on flac files (windows chrome only?) [UI] + - handle internationalization + - make a wizard on first connection (or make a default admin/admin account of the very first connection) [Settings] - increase the menu's width - logout users that are being changed (loss of admin admin rights), or make sure they are still admin when they make changes - "signal not exposed" problem if a user logout and login again. bad resource destruction? - [admin/DB] - - Do not make the update start time field active when update perdiod is "Never" - - refresh the audio/video view when the database directories have been updated [user/transcoding] - Prefered codecs for audio/video? + [admin/Users] + - do not activate the update period/start time when 'admin' is checked + [admin/Database update] + - do not make the update start time field active when update perdiod is "Never" + - refresh the audio/video view when the database directories have been updated [Audio] - Search patterns in the genre list diff --git a/main/main.cpp b/main/main.cpp index 540ebb75..b2bbd8d0 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -26,10 +26,14 @@ int main(int argc, char* argv[]) if (argc > 1) configFile = boost::filesystem::path(argv[1]); - if ( !boost::filesystem::exists(configFile) - || !boost::filesystem::is_regular(configFile)) + if ( !boost::filesystem::exists(configFile)) { - std::cerr << "Cannot open config file '" << configFile << "'" << std::endl; + std::cerr << "Config file '" << configFile << "' does not exist!" << std::endl; + return EXIT_FAILURE; + } + else if (!boost::filesystem::is_regular(configFile)) + { + std::cerr << "Config file '" << configFile << "' is not regular!" << std::endl; return EXIT_FAILURE; } diff --git a/ui/LmsApplication.cpp b/ui/LmsApplication.cpp index 75b380ad..49ddc697 100644 --- a/ui/LmsApplication.cpp +++ b/ui/LmsApplication.cpp @@ -60,8 +60,7 @@ LmsApplication::handleAuthEvent(void) if (_sessionData.getDatabaseHandler().getLogin().loggedIn()) { if (_home == nullptr) { - _home = new LmsHome(_sessionData ); - root()->addWidget( _home ); + _home = new LmsHome(_sessionData, root() ); } else std::cerr << "Already logged in??" << std::endl; @@ -70,9 +69,14 @@ LmsApplication::handleAuthEvent(void) { std::cerr << "user log out" << std::endl; if (_home != nullptr) { - std::cerr << "Deleting home pointer..." << std::endl; delete _home; _home = nullptr; + + // Hack: quit/redirect in order to avoid 'signal not exposed' problems + // TODO, investigate/remove? + quit(); + redirect("/"); + } else std::cerr << "Already logged out??" << std::endl; diff --git a/ui/LmsHome.cpp b/ui/LmsHome.cpp index 2b59e10b..e7126275 100644 --- a/ui/LmsHome.cpp +++ b/ui/LmsHome.cpp @@ -11,8 +11,9 @@ namespace UserInterface { -LmsHome::LmsHome(SessionData& sessionData) -: _sessionData(sessionData) +LmsHome::LmsHome(SessionData& sessionData, Wt::WContainerWidget* parent) +: Wt::WContainerWidget(parent), + _sessionData(sessionData) { const Wt::Auth::User& user = sessionData.getDatabaseHandler().getLogin().user(); @@ -25,7 +26,7 @@ LmsHome::LmsHome(SessionData& sessionData) Wt::WStackedWidget *contentsStack = new Wt::WStackedWidget(this); // Setup a Left-aligned menu. - Wt::WMenu *leftMenu = new Wt::WMenu(contentsStack, this); + Wt::WMenu *leftMenu = new Wt::WMenu(contentsStack); navigation->addMenu(leftMenu); _audioWidget = new AudioWidget(_sessionData); diff --git a/ui/LmsHome.hpp b/ui/LmsHome.hpp index 310668f3..89707f22 100644 --- a/ui/LmsHome.hpp +++ b/ui/LmsHome.hpp @@ -15,7 +15,7 @@ class LmsHome : public Wt::WContainerWidget { public: - LmsHome(SessionData& sessionData); + LmsHome(SessionData& sessionData, Wt::WContainerWidget* parent = 0); private: