From c1e7e9a602ced6fcbef732b6ec4328adecb24221 Mon Sep 17 00:00:00 2001 From: emeric Date: Tue, 5 Jun 2018 14:03:28 +0200 Subject: [PATCH] Removed unused Home view --- Makefile.am | 1 - approot/home.xml | 9 --------- approot/messages.xml | 3 --- src/Makefile.am | 1 - src/ui/HomeView.cpp | 41 --------------------------------------- src/ui/HomeView.hpp | 39 ------------------------------------- src/ui/LmsApplication.cpp | 13 ++++--------- 7 files changed, 4 insertions(+), 103 deletions(-) delete mode 100644 approot/home.xml delete mode 100644 src/ui/HomeView.cpp delete mode 100644 src/ui/HomeView.hpp diff --git a/Makefile.am b/Makefile.am index 15ac8af4..5737756e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,7 +28,6 @@ lms_approot_DATA = \ approot/artist.xml \ approot/artists.xml \ approot/explore.xml \ - approot/home.xml \ approot/login.xml \ approot/mediaplayer.xml \ approot/messages.xml \ diff --git a/approot/home.xml b/approot/home.xml deleted file mode 100644 index 8b877520..00000000 --- a/approot/home.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - ${tr:Lms.Home.welcome} - - - - diff --git a/approot/messages.xml b/approot/messages.xml index 87f6afde..5312e568 100644 --- a/approot/messages.xml +++ b/approot/messages.xml @@ -53,9 +53,6 @@ Remember me Welcome! - -

Welcome!

- Add filter Artists diff --git a/src/Makefile.am b/src/Makefile.am index fd9f89d2..f3774a12 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,6 @@ lms_SOURCES = \ $(srcdir)/metadata/TagLibParser.cpp \ $(srcdir)/scanner/MediaScanner.cpp \ $(srcdir)/ui/Auth.cpp \ - $(srcdir)/ui/HomeView.cpp \ $(srcdir)/ui/LmsApplication.cpp \ $(srcdir)/ui/MediaPlayer.cpp \ $(srcdir)/ui/PlayQueueView.cpp \ diff --git a/src/ui/HomeView.cpp b/src/ui/HomeView.cpp deleted file mode 100644 index 965d7da9..00000000 --- a/src/ui/HomeView.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2018 Emeric Poupon - * - * This file is part of LMS. - * - * LMS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * LMS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with LMS. If not, see . - */ - -#include "HomeView.hpp" - -#include - -#include "utils/Logger.hpp" - -#include "LmsApplication.hpp" - -namespace UserInterface { - - -Home::Home() -: Wt::WContainerWidget() -{ - auto t = std::make_unique(Wt::WString::tr("Lms.Home.template")); - t->addFunction("tr", &Wt::WTemplate::Functions::tr); - - this->addWidget(std::move(t)); -} - -} // namespace UserInterface - diff --git a/src/ui/HomeView.hpp b/src/ui/HomeView.hpp deleted file mode 100644 index 8406bc58..00000000 --- a/src/ui/HomeView.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2018 Emeric Poupon - * - * This file is part of LMS. - * - * LMS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * LMS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with LMS. If not, see . - */ - -#pragma once - -#include - -namespace UserInterface { - -class Home : public Wt::WContainerWidget -{ - public: - Home(); - - private: - - void displayFilter(void); - void displayContents(void); - -}; - -} // namespace UserInterface - diff --git a/src/ui/LmsApplication.cpp b/src/ui/LmsApplication.cpp index 41295e9b..fb25b9cb 100644 --- a/src/ui/LmsApplication.cpp +++ b/src/ui/LmsApplication.cpp @@ -35,7 +35,6 @@ #include "utils/Utils.hpp" #include "explore/Explore.hpp" -#include "HomeView.hpp" #include "MediaPlayer.hpp" #include "PlayQueueView.hpp" #include "SettingsView.hpp" @@ -94,7 +93,6 @@ LmsApplication::LmsApplication(const Wt::WEnvironment& env, Wt::Dbo::SqlConnecti messageResourceBundle().use(appRoot() + "admin-initwizard"); messageResourceBundle().use(appRoot() + "artist"); messageResourceBundle().use(appRoot() + "artists"); - messageResourceBundle().use(appRoot() + "home"); messageResourceBundle().use(appRoot() + "explore"); messageResourceBundle().use(appRoot() + "login"); messageResourceBundle().use(appRoot() + "mediaplayer"); @@ -192,7 +190,7 @@ LmsApplication::createCluster(Database::Cluster::pointer cluster, bool canDelete void LmsApplication::goHome() { - setInternalPath("/home", true); + setInternalPath("/artists", true); } void @@ -205,8 +203,7 @@ LmsApplication::goHomeAndQuit() enum IdxRoot { - IdxHome = 0, - IdxExplore, + IdxExplore = 0, IdxPlayQueue, IdxSettings, IdxAdminDatabase, @@ -224,7 +221,6 @@ handlePathChange(Wt::WStackedWidget* stack, bool isAdmin) bool admin; } views[] = { - { "/home", IdxHome, false }, { "/artists", IdxExplore, false }, { "/artist", IdxExplore, false }, { "/releases", IdxExplore, false }, @@ -251,7 +247,7 @@ handlePathChange(Wt::WStackedWidget* stack, bool isAdmin) } } - wApp->setInternalPath("/home", true); + wApp->setInternalPath("/artists", true); } void @@ -281,7 +277,7 @@ LmsApplication::handleAuthEvent(void) // Navbar Wt::WNavigationBar* navbar = main->bindNew("navbar-top"); - navbar->setTitle("LMS", Wt::WLink(Wt::LinkType::InternalPath, "/home")); + navbar->setTitle("LMS", Wt::WLink(Wt::LinkType::InternalPath, "/artists")); navbar->setResponsive(true); Wt::WMenu* menu = navbar->addMenu(std::make_unique()); @@ -344,7 +340,6 @@ LmsApplication::handleAuthEvent(void) // Order is important in mainStack, see IdxRoot! Wt::WStackedWidget* mainStack = main->bindNew("contents"); - mainStack->addNew(); Explore* explore = mainStack->addNew(); PlayQueue* playqueue = mainStack->addNew(); mainStack->addNew();