Setting window title to help browsing in history. ref #253
This commit is contained in:
@@ -104,7 +104,7 @@
|
||||
<message id="Lms.Admin.User.user-already-exists">User already exists!</message>
|
||||
<message id="Lms.Admin.User.user-create">New user</message>
|
||||
<message id="Lms.Admin.User.user-created">New user created!</message>
|
||||
<message id="Lms.Admin.User.user-edit">Edit user '{1}'</message>
|
||||
<message id="Lms.Admin.User.user-edit">User '{1}'</message>
|
||||
<message id="Lms.Admin.User.user-updated">User updated!</message>
|
||||
|
||||
<!--Wizard-->
|
||||
@@ -133,6 +133,7 @@
|
||||
<message id="Lms.Explore.recently-modified">Recently modified</message>
|
||||
<message id="Lms.Explore.recently-played">Recently played</message>
|
||||
<message id="Lms.Explore.releases">Albums</message>
|
||||
<message id="Lms.Explore.search">Search</message>
|
||||
<message id="Lms.Explore.star">Star</message>
|
||||
<message id="Lms.Explore.starred">Starred</message>
|
||||
<message id="Lms.Explore.tracklists">Playlists</message>
|
||||
@@ -187,7 +188,6 @@
|
||||
<!--PlayHistory-->
|
||||
<message id="Lms.PlayHistory.playhistory">Play History</message>
|
||||
|
||||
|
||||
<!--Settings-->
|
||||
<message id="Lms.Settings.audio">Audio</message>
|
||||
<message id="Lms.Settings.audio-settings-are-local">These audio settings are local to your browser!</message>
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
<message id="Lms.Explore.recently-modified">Modifiés récemment</message>
|
||||
<message id="Lms.Explore.recently-played">Joués récemment</message>
|
||||
<message id="Lms.Explore.releases">Albums</message>
|
||||
<message id="Lms.Explore.search">Rechercher</message>
|
||||
<message id="Lms.Explore.star">Ajouter aux favoris</message>
|
||||
<message id="Lms.Explore.starred">Favoris</message>
|
||||
<message id="Lms.Explore.tracklists">Playlists</message>
|
||||
|
||||
@@ -133,9 +133,9 @@
|
||||
|
||||
<message id="Lms.Explore.recently-played">Riprodotti di recente</message>
|
||||
<message id="Lms.Explore.releases">Album</message>
|
||||
<message id="Lms.Explore.search">Ricerca</message>
|
||||
<message id="Lms.Explore.star">Aggiungi ai preferiti</message>
|
||||
<message id="Lms.Explore.starred">Preferiti</message>
|
||||
|
||||
<message id="Lms.Explore.tracks">Tracce</message>
|
||||
<message id="Lms.Explore.type">Tipo</message>
|
||||
<message id="Lms.Explore.unstar">Rimuovi dai preferiti</message>
|
||||
|
||||
@@ -130,6 +130,7 @@
|
||||
<message id="Lms.Explore.recently-modified">最近更改</message>
|
||||
<message id="Lms.Explore.recently-played">最近播放</message>
|
||||
<message id="Lms.Explore.releases">专辑</message>
|
||||
<message id="Lms.Explore.search">搜索</message>
|
||||
<message id="Lms.Explore.star">收藏</message>
|
||||
<message id="Lms.Explore.starred">已收藏</message>
|
||||
<message id="Lms.Explore.tracklists">播放列表</message>
|
||||
|
||||
@@ -106,6 +106,7 @@ getOrCreateMessageBundle()
|
||||
return res;
|
||||
}
|
||||
|
||||
static constexpr const char* titleSeparator {" | "};
|
||||
static constexpr const char* defaultPath {"/releases"};
|
||||
|
||||
std::unique_ptr<Wt::WApplication>
|
||||
@@ -378,21 +379,22 @@ handlePathChange(Wt::WStackedWidget& stack, bool isAdmin)
|
||||
std::string path;
|
||||
int index;
|
||||
bool admin;
|
||||
std::optional<Wt::WString> title;
|
||||
} views[] =
|
||||
{
|
||||
{ "/artists", IdxExplore, false },
|
||||
{ "/artist", IdxExplore, false },
|
||||
{ "/releases", IdxExplore, false },
|
||||
{ "/release", IdxExplore, false },
|
||||
{ "/search", IdxExplore, false },
|
||||
{ "/tracks", IdxExplore, false },
|
||||
{ "/tracklists", IdxExplore, false },
|
||||
{ "/tracklist", IdxExplore, false },
|
||||
{ "/playqueue", IdxPlayQueue, false },
|
||||
{ "/settings", IdxSettings, false },
|
||||
{ "/admin/database", IdxAdminDatabase, true },
|
||||
{ "/admin/users", IdxAdminUsers, true },
|
||||
{ "/admin/user", IdxAdminUser, true },
|
||||
{ "/artists", IdxExplore, false, Wt::WString::tr("Lms.Explore.artists") },
|
||||
{ "/artist", IdxExplore, false, std::nullopt },
|
||||
{ "/releases", IdxExplore, false, Wt::WString::tr("Lms.Explore.releases") },
|
||||
{ "/release", IdxExplore, false, std::nullopt },
|
||||
{ "/search", IdxExplore, false, Wt::WString::tr("Lms.Explore.search") },
|
||||
{ "/tracks", IdxExplore, false, Wt::WString::tr("Lms.Explore.tracks") },
|
||||
{ "/tracklists", IdxExplore, false, Wt::WString::tr("Lms.Explore.tracklists") },
|
||||
{ "/tracklist", IdxExplore, false, std::nullopt },
|
||||
{ "/playqueue", IdxPlayQueue, false, Wt::WString::tr("Lms.PlayQueue.playqueue") },
|
||||
{ "/settings", IdxSettings, false, Wt::WString::tr("Lms.Settings.settings") },
|
||||
{ "/admin/database", IdxAdminDatabase, true, Wt::WString::tr("Lms.Admin.Database.database") },
|
||||
{ "/admin/users", IdxAdminUsers, true, Wt::WString::tr("Lms.Admin.Users.users") },
|
||||
{ "/admin/user", IdxAdminUser, true, std::nullopt },
|
||||
};
|
||||
|
||||
LMS_LOG(UI, DEBUG) << "Internal path changed to '" << wApp->internalPath() << "'";
|
||||
@@ -406,6 +408,8 @@ handlePathChange(Wt::WStackedWidget& stack, bool isAdmin)
|
||||
break;
|
||||
|
||||
stack.setCurrentIndex(view.index);
|
||||
if (view.title)
|
||||
LmsApp->setTitle(*view.title);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -623,7 +627,7 @@ LmsApplication::setTitle(const Wt::WString& title)
|
||||
if (title.empty())
|
||||
WApplication::setTitle("LMS");
|
||||
else
|
||||
WApplication::setTitle(title + " | LMS");
|
||||
WApplication::setTitle(Wt::WString {"LMS"} + titleSeparator + title);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -215,16 +215,22 @@ UserView::refreshView()
|
||||
if (!user)
|
||||
throw UserNotFoundException {};
|
||||
|
||||
t->bindString("title", Wt::WString::tr("Lms.Admin.User.user-edit").arg(user->getLoginName()), Wt::TextFormat::Plain);
|
||||
const Wt::WString title {Wt::WString::tr("Lms.Admin.User.user-edit").arg(user->getLoginName())};
|
||||
LmsApp->setTitle(title);
|
||||
|
||||
t->bindString("title", title, Wt::TextFormat::Plain);
|
||||
t->setCondition("if-has-last-login", true);
|
||||
t->bindString("last-login", user->getLastLogin().toString(), Wt::TextFormat::Plain);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Wt::WString title {Wt::WString::tr("Lms.Admin.User.user-create")};
|
||||
LmsApp->setTitle(title);
|
||||
|
||||
// Login
|
||||
t->setCondition("if-has-login", true);
|
||||
t->setFormWidget(UserModel::LoginField, std::make_unique<Wt::WLineEdit>());
|
||||
t->bindString("title", Wt::WString::tr("Lms.Admin.User.user-create"));
|
||||
t->bindString("title", title);
|
||||
}
|
||||
|
||||
if (authPasswordService)
|
||||
|
||||
@@ -109,6 +109,7 @@ Artist::refreshView()
|
||||
if (!artist)
|
||||
throw ArtistNotFoundException {};
|
||||
|
||||
LmsApp->setTitle(artist->getName());
|
||||
_artistId = *artistId;
|
||||
|
||||
std::size_t sectionCount{};
|
||||
|
||||
@@ -106,6 +106,8 @@ Release::refreshView()
|
||||
if (!release)
|
||||
throw ReleaseNotFoundException {};
|
||||
|
||||
LmsApp->setTitle(release->getName());
|
||||
|
||||
refreshCopyright(release);
|
||||
refreshLinks(release);
|
||||
refreshSimilarReleases(similarReleasesIds);
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace UserInterface
|
||||
if (!trackList)
|
||||
throw TrackListNotFoundException {};
|
||||
|
||||
LmsApp->setTitle(std::string {trackList->getName()});
|
||||
_trackListId = *trackListId;
|
||||
|
||||
clear();
|
||||
|
||||
Reference in New Issue
Block a user