1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Updated task notification UI. Last message will stay on screen for an extra 3 seconds if there are no new messages.

This commit is contained in:
kay.one 2011-04-23 21:06:34 -07:00
parent 53a7b92a64
commit 0d139f9c21
7 changed files with 77 additions and 58 deletions

View File

@ -41,7 +41,7 @@ public ProgressNotification(string title)
/// <value>The percent complete.</value> /// <value>The percent complete.</value>
public int PercentComplete public int PercentComplete
{ {
get { return Convert.ToInt32(Convert.ToDouble(ProgressValue)/Convert.ToDouble(ProgressMax)*100); } get { return Convert.ToInt32(Convert.ToDouble(ProgressValue) / Convert.ToDouble(ProgressMax) * 100); }
} }
/// <summary> /// <summary>
@ -56,11 +56,30 @@ public int PercentComplete
/// <value>The progress value.</value> /// <value>The progress value.</value>
public int ProgressValue { get; set; } public int ProgressValue { get; set; }
private ProgressNotificationStatus _status;
/// <summary> /// <summary>
/// Gets or sets the status. /// Gets or sets the status.
/// </summary> /// </summary>
/// <value>The status.</value> /// <value>The status.</value>
public ProgressNotificationStatus Status { get; set; } public ProgressNotificationStatus Status
{
get { return _status; }
set
{
if (value != ProgressNotificationStatus.InProgress)
{
CompletedTime = DateTime.Now;
}
_status = value;
}
}
/// <summary>
/// Gets the completed time.
/// </summary>
public DateTime CompletedTime { get; private set; }
#region IDisposable Members #region IDisposable Members

View File

@ -52,8 +52,8 @@ private void ScanSeries(ProgressNotification notification)
updatedSeries.Title); updatedSeries.Title);
_episodeProvider.RefreshEpisodeInfo(updatedSeries.SeriesId); _episodeProvider.RefreshEpisodeInfo(updatedSeries.SeriesId);
notification.CurrentStatus = String.Format("Scanning series folder {0}", notification.CurrentStatus = String.Format("Scanning disk for {0} files",
updatedSeries.Path); updatedSeries.Title);
_mediaFileProvider.Scan(_seriesProvider.GetSeries(updatedSeries.SeriesId)); _mediaFileProvider.Scan(_seriesProvider.GetSeries(updatedSeries.SeriesId));
} }

View File

@ -44,6 +44,7 @@ public void Start(ProgressNotification notification, int targetId)
_seriesProvider.UpdateSeriesInfo(series.SeriesId); _seriesProvider.UpdateSeriesInfo(series.SeriesId);
notification.CurrentStatus = "Updating episode info for " + series.Title; notification.CurrentStatus = "Updating episode info for " + series.Title;
_episodeProvider.RefreshEpisodeInfo(series.SeriesId); _episodeProvider.RefreshEpisodeInfo(series.SeriesId);
notification.CurrentStatus = "Update completed for " + series.Title;
} }
} }
} }

View File

@ -24,9 +24,17 @@ public virtual List<ProgressNotification> GetProgressNotifications
{ {
get get
{ {
return
new List<ProgressNotification>( var activeNotification = _progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress).ToList();
_progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress));
if (activeNotification.Count == 0)
{
//Get notifications that were recently done
activeNotification = _progressNotification.Values.Where(p => p.CompletedTime >= DateTime.Now.AddSeconds(-3)).OrderByDescending(c => c.CompletedTime).ToList();
}
return activeNotification.ToList();
} }
} }

View File

@ -1,9 +1,8 @@
#msgBox #msgBox
{ {
display: none; display: none;
height: 40px; height: 30px;
background-color: #272525; background-color: #272525;
background-image: url(images/spin.gif) no-repeat left middle;
opacity: .9; opacity: .9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
@ -12,13 +11,10 @@
position: fixed; position: fixed;
z-index: 99; z-index: 99;
bottom: 0; bottom: 0;
right: 0;
font-size: 20px; font-size: 20px;
color: White; color: White;
width: 100% text-align: center;
margin-right: auto;
width: 85%;
margin-left: auto;
min-width: 800px;
} }
#msgCloseButton #msgCloseButton
{ {

View File

@ -4,7 +4,7 @@ $(function () {
refreshNotifications(); refreshNotifications();
var timer = window.setInterval(function () { var timer = window.setInterval(function () {
speed = 1000; speed = 500;
refreshNotifications(); refreshNotifications();
}, 2000); }, 2000);

View File

@ -1,23 +1,20 @@
@using Helpers; @using Helpers;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head runat="server"> <head runat="server">
<link rel="SHORTCUT ICON" href="../../favicon.ico"/> <link rel="SHORTCUT ICON" href="../../favicon.ico" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>NZBDrone</title> <title>NZBDrone</title>
@{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css") @{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css")
.Add("telerik.sitefinity.css") .Add("telerik.sitefinity.css")
.Add("notibar.css")) .Add("notibar.css"))
.Render();} .Render();}
<link href="../../Content/style.css" rel="stylesheet" type="text/css" /> <link href="../../Content/style.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-ui.css" rel="stylesheet" type="text/css" /> <link href="../../Content/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-ui.custom.css" rel="stylesheet" type="text/css" /> <link href="../../Content/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
@RenderSection("HeaderContent", required: false) @RenderSection("HeaderContent", required: false)
</head> </head>
<body> <body>
<div id="centered"> <div id="centered">
<div id="menu"> <div id="menu">
<ul> <ul>
@ -39,15 +36,13 @@
<div id="footer"> <div id="footer">
@{Html.RenderAction("Footer", "Shared");} @{Html.RenderAction("Footer", "Shared");}
</div> </div>
</div>
<div id="msgBox"> <div id="msgBox">
<span id="msgText">Scanning Series Folder...</span> <span id="msgText">Scanning Series Folder...</span>
</div> </div>
</div> </body>
</body> @RenderSection("Scripts", required: false)
@{Html.Telerik().ScriptRegistrar().Scripts(
@RenderSection("Scripts", required: false)
@{Html.Telerik().ScriptRegistrar().Scripts(
c => c.Add("jquery-ui-1.8.8.min.js") c => c.Add("jquery-ui-1.8.8.min.js")
.Add("jquery.form.js") .Add("jquery.form.js")
.Add("jquery.jgrowl.js") .Add("jquery.jgrowl.js")