1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-24 16:51:58 +00: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>
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>
@ -56,11 +56,30 @@ public int PercentComplete
/// <value>The progress value.</value>
public int ProgressValue { get; set; }
private ProgressNotificationStatus _status;
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <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

View file

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

View file

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

View file

@ -24,9 +24,17 @@ public virtual List<ProgressNotification> GetProgressNotifications
{
get
{
return
new List<ProgressNotification>(
_progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress));
var activeNotification = _progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress).ToList();
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
{
display: none;
height: 40px;
height: 30px;
background-color: #272525;
background-image: url(images/spin.gif) no-repeat left middle;
opacity: .9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
@ -12,13 +11,10 @@
position: fixed;
z-index: 99;
bottom: 0;
right: 0;
font-size: 20px;
color: White;
width: 100%
margin-right: auto;
width: 85%;
margin-left: auto;
min-width: 800px;
text-align: center;
}
#msgCloseButton
{

View file

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

View file

@ -1,53 +1,48 @@
@using Helpers;
<!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">
<head runat="server">
<link rel="SHORTCUT ICON" href="../../favicon.ico"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>NZBDrone</title>
@{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css")
<head runat="server">
<link rel="SHORTCUT ICON" href="../../favicon.ico" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>NZBDrone</title>
@{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css")
.Add("telerik.sitefinity.css")
.Add("notibar.css"))
.Render();}
<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.custom.css" rel="stylesheet" type="text/css" />
@RenderSection("HeaderContent", required: false)
</head>
<body>
<div id="centered">
<div id="menu">
<ul>
@MvcHtmlString.Create(Html.CurrentActionLink("Series", "Index", "Series"))
@MvcHtmlString.Create(Html.CurrentActionLink("Upcoming", "Index", "Upcoming"))
@MvcHtmlString.Create(Html.CurrentActionLink("History", "Index", "History"))
@MvcHtmlString.Create(Html.CurrentActionLink("Settings", "Index", "Settings"))
@MvcHtmlString.Create(Html.CurrentActionLink("Logs", "Index", "Log"))
</ul>
</div>
<div id="logo">
@RenderSection("TitleContent", required: false)
</div>
<div id="page">
@RenderSection("ActionMenu", required: false)
@RenderSection("MainContent", required: false)
@RenderBody()
</div>
<div id="footer">
@{Html.RenderAction("Footer", "Shared");}
</div>
<div id="msgBox">
<span id="msgText">Scanning Series Folder...</span>
</div>
<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.custom.css" rel="stylesheet" type="text/css" />
@RenderSection("HeaderContent", required: false)
</head>
<body>
<div id="centered">
<div id="menu">
<ul>
@MvcHtmlString.Create(Html.CurrentActionLink("Series", "Index", "Series"))
@MvcHtmlString.Create(Html.CurrentActionLink("Upcoming", "Index", "Upcoming"))
@MvcHtmlString.Create(Html.CurrentActionLink("History", "Index", "History"))
@MvcHtmlString.Create(Html.CurrentActionLink("Settings", "Index", "Settings"))
@MvcHtmlString.Create(Html.CurrentActionLink("Logs", "Index", "Log"))
</ul>
</div>
</body>
@RenderSection("Scripts", required: false)
@{Html.Telerik().ScriptRegistrar().Scripts(
<div id="logo">
@RenderSection("TitleContent", required: false)
</div>
<div id="page">
@RenderSection("ActionMenu", required: false)
@RenderSection("MainContent", required: false)
@RenderBody()
</div>
<div id="footer">
@{Html.RenderAction("Footer", "Shared");}
</div>
</div>
<div id="msgBox">
<span id="msgText">Scanning Series Folder...</span>
</div>
</body>
@RenderSection("Scripts", required: false)
@{Html.Telerik().ScriptRegistrar().Scripts(
c => c.Add("jquery-ui-1.8.8.min.js")
.Add("jquery.form.js")
.Add("jquery.jgrowl.js")