Removed unused Home view

This commit is contained in:
emeric
2018-06-05 14:03:28 +02:00
parent 1bd5633202
commit c1e7e9a602
7 changed files with 4 additions and 103 deletions
-1
View File
@@ -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 \
-9
View File
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<messages xmlns:if="Wt.WTemplate.conditions">
<message id="Lms.Home.template">
${tr:Lms.Home.welcome}
</message>
</messages>
-3
View File
@@ -53,9 +53,6 @@
<message id="Lms.Auth.remember-me">Remember me</message>
<message id="Lms.Auth.welcome">Welcome!</message>
<!--Home-->
<message id="Lms.Home.welcome"><h2>Welcome!</h2></message>
<!--Explore-->
<message id="Lms.Explore.add-filter">Add filter</message>
<message id="Lms.Explore.artists">Artists</message>
-1
View File
@@ -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 \
-41
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
#include "HomeView.hpp"
#include <Wt/WTemplate.h>
#include "utils/Logger.hpp"
#include "LmsApplication.hpp"
namespace UserInterface {
Home::Home()
: Wt::WContainerWidget()
{
auto t = std::make_unique<Wt::WTemplate>(Wt::WString::tr("Lms.Home.template"));
t->addFunction("tr", &Wt::WTemplate::Functions::tr);
this->addWidget(std::move(t));
}
} // namespace UserInterface
-39
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <Wt/WContainerWidget.h>
namespace UserInterface {
class Home : public Wt::WContainerWidget
{
public:
Home();
private:
void displayFilter(void);
void displayContents(void);
};
} // namespace UserInterface
+4 -9
View File
@@ -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<Wt::WNavigationBar>("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<Wt::WMenu>());
@@ -344,7 +340,6 @@ LmsApplication::handleAuthEvent(void)
// Order is important in mainStack, see IdxRoot!
Wt::WStackedWidget* mainStack = main->bindNew<Wt::WStackedWidget>("contents");
mainStack->addNew<Home>();
Explore* explore = mainStack->addNew<Explore>();
PlayQueue* playqueue = mainStack->addNew<PlayQueue>();
mainStack->addNew<SettingsView>();