Reduced duration of the annoying notifications

This commit is contained in:
emeric
2018-08-30 11:24:59 +02:00
parent 3b0c025ffb
commit b0956925bd
3 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -533,7 +533,7 @@ static std::string msgTypeToString(MsgType type)
}
void
LmsApplication::notifyMsg(MsgType type, const Wt::WString& message)
LmsApplication::notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration)
{
LMS_LOG(UI, INFO) << "Notifying message '" << message.toUTF8() << "' of type '" << msgTypeToString(type);
@@ -543,7 +543,9 @@ LmsApplication::notifyMsg(MsgType type, const Wt::WString& message)
"message: '" << message.toUTF8() << "'"
"},{"
"type: '" << msgTypeToString(type) << "',"
"placement: {from: 'top', align: 'center'}"
"placement: {from: 'top', align: 'center'},"
"timer: 250,"
"delay: " << duration.count() << ""
"});";
LmsApp->doJavaScript(oss.str());
+1 -1
View File
@@ -79,7 +79,7 @@ class LmsApplication : public Wt::WApplication
void goHome();
void goHomeAndQuit();
void notifyMsg(MsgType type, const Wt::WString& message);
void notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration = std::chrono::milliseconds(4000));
static Wt::WLink createArtistLink(Database::Artist::pointer artist);
static std::unique_ptr<Wt::WAnchor> createArtistAnchor(Database::Artist::pointer artist, bool addText = true);
+2 -2
View File
@@ -236,7 +236,7 @@ void
PlayQueue::addTracks(const std::vector<Database::Track::pointer>& tracks)
{
enqueueTracks(tracks);
LmsApp->notifyMsg(MsgType::Info, Wt::WString::tr("Lms.PlayQueue.nb-tracks-added").arg(tracks.size()));
LmsApp->notifyMsg(MsgType::Info, Wt::WString::tr("Lms.PlayQueue.nb-tracks-added").arg(tracks.size()), std::chrono::milliseconds(2000));
}
void
@@ -248,7 +248,7 @@ PlayQueue::playTracks(const std::vector<Database::Track::pointer>& tracks)
enqueueTracks(tracks);
play(0);
LmsApp->notifyMsg(MsgType::Info, Wt::WString::tr("Lms.PlayQueue.nb-tracks-playing").arg(tracks.size()));
LmsApp->notifyMsg(MsgType::Info, Wt::WString::tr("Lms.PlayQueue.nb-tracks-playing").arg(tracks.size()), std::chrono::milliseconds(2000));
}