Reduced duration of the annoying notifications
This commit is contained in:
@@ -533,7 +533,7 @@ static std::string msgTypeToString(MsgType type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
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);
|
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() << "'"
|
"message: '" << message.toUTF8() << "'"
|
||||||
"},{"
|
"},{"
|
||||||
"type: '" << msgTypeToString(type) << "',"
|
"type: '" << msgTypeToString(type) << "',"
|
||||||
"placement: {from: 'top', align: 'center'}"
|
"placement: {from: 'top', align: 'center'},"
|
||||||
|
"timer: 250,"
|
||||||
|
"delay: " << duration.count() << ""
|
||||||
"});";
|
"});";
|
||||||
|
|
||||||
LmsApp->doJavaScript(oss.str());
|
LmsApp->doJavaScript(oss.str());
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class LmsApplication : public Wt::WApplication
|
|||||||
void goHome();
|
void goHome();
|
||||||
void goHomeAndQuit();
|
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 Wt::WLink createArtistLink(Database::Artist::pointer artist);
|
||||||
static std::unique_ptr<Wt::WAnchor> createArtistAnchor(Database::Artist::pointer artist, bool addText = true);
|
static std::unique_ptr<Wt::WAnchor> createArtistAnchor(Database::Artist::pointer artist, bool addText = true);
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ void
|
|||||||
PlayQueue::addTracks(const std::vector<Database::Track::pointer>& tracks)
|
PlayQueue::addTracks(const std::vector<Database::Track::pointer>& tracks)
|
||||||
{
|
{
|
||||||
enqueueTracks(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
|
void
|
||||||
@@ -248,7 +248,7 @@ PlayQueue::playTracks(const std::vector<Database::Track::pointer>& tracks)
|
|||||||
enqueueTracks(tracks);
|
enqueueTracks(tracks);
|
||||||
play(0);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user