Exemplo n.º 1
0
        public override void ShowPane()
        {
            _chkDownloadPeriod.SetSetting(Settings.UseEclosureDownloadPeriod);

            int iTime        = GetLocaleITime();
            int iTimeMarkPos = GetLocaleITimeMarkPosn();

            _edtStartDownload.SetLocaleInfo(iTime, iTimeMarkPos);
            _edtFinishDownload.SetLocaleInfo(iTime, iTimeMarkPos);

            _edtStartDownload.Value  = Settings.EnclosureDownloadStartHour;
            _edtFinishDownload.Value = Settings.EnclosureDownloadFinishHour;
            bool validTime = _edtStartDownload.TimeParseable() && _edtFinishDownload.TimeParseable();

            if (!_edtStartDownload.TimeParseable())
            {
                _edtStartDownload.Value = Settings.cInitialTimeStamp;
            }
            if (!_edtFinishDownload.TimeParseable())
            {
                _edtFinishDownload.Value = Settings.cInitialTimeStamp;
            }

            //  The setting is enabled only if the time set in the controls is a valid
            //  parseable time of day.
            _chkDownloadPeriod.Checked = _chkDownloadPeriod.Checked && validTime;
            _edtStartDownload.Enabled  = _edtFinishDownload.Enabled = _chkDownloadPeriod.Checked;

            _chkShowDesktopAlertDownloadComplete.SetSetting(Settings.ShowDesktopAlertWhenEncosureDownloadingComplete);
            _chkShowDesktopAlertDownloadFailed.SetSetting(Settings.ShowDesktopAlertWhenEncosureDownloadingFailed);
            _chkCreateSubfolderForEveryFeed.SetSetting(Settings.CreateSubfolderForEveryFeed);
            _browseForFolderControl.SetSetting(Settings.EnclosurePath);
            _browseForFolderControl.Description = "Select a folder for storing the downloaded feed enclosures:";

            _oldUpdatePeriod    = Settings.UpdatePeriod;
            _oldUpdateFrequency = Settings.UpdateFrequency;
        }
Exemplo n.º 2
0
        public void DisplayRSSFeeds(IResourceList feeds)
        {
            Guard.NullArgument(feeds, "feeds");
            if (feeds.Count == 0)
            {
                throw new ArgumentException("feeds should have at least one feed");
            }
            RestoreSettings();
            _feeds             = feeds;
            _feed              = feeds[0];
            _selector.Resource = feeds[0];

            SettingArray enclosurePath = SettingArray.FromResourceList(_feeds, Props.EnclosurePath, Settings.EnclosurePath, true);

            _browseForFolderControl.SetSetting(enclosurePath);
            _cmbUpdatePeriod.SetSetting(SettingArray.FromResourceList(_feeds, Props.UpdatePeriod, "daily", true));
            _udUpdateFrequency.SetSetting(SettingArray.FromResourceList(_feeds, Props.UpdateFrequency, Settings.UpdateFrequency));

            if (!_udUpdateFrequency.Setting.Defined || _udUpdateFrequency.Setting.Value == null || (int)_udUpdateFrequency.Setting.Value == -1)
            {
                _chkUpdate.Checked       = false;
                _udUpdateFrequency.Value = Settings.UpdateFrequency;
            }

            _edtUserName.SetSetting(SettingArray.FromResourceList(_feeds, Props.HttpUserName, null, true));
            _edtPassword.SetSetting(SettingArray.FromResourceList(_feeds, Props.HttpPassword, null, true));

            if (_edtUserName.Setting.Different || _edtUserName.Setting.Defined ||
                _edtPassword.Setting.Different || _edtPassword.Setting.Defined)
            {
                _chkAuthentication.Checked = true;
            }

            _chkMarkReadOnLeave.SetSetting(SettingArray.FromResourceList(_feeds, Props.MarkReadOnLeave, false));
            _chkAutoFollowLink.SetSetting(SettingArray.FromResourceList(_feeds, Props.AutoFollowLink, false));
            _chkAutoUpdateComments.SetSetting(SettingArray.FromResourceList(_feeds, Props.AutoUpdateComments, false));
            _chkAllowEqualPosts.SetSetting(SettingArray.FromResourceList(_feeds, Props.AllowEqualPosts, false));
            _chkAutoDownloadEncls.SetSetting(SettingArray.FromResourceList(_feeds, Props.AutoDownloadEnclosure, false));

            if (_feeds.Count > 1)
            {
                _edtAddress.Text           = MULTIPLE_SELECTION;
                _edtAddress.ReadOnly       = true;
                _edtTitle.Text             = MULTIPLE_SELECTION;
                _edtTitle.ReadOnly         = true;
                _lblHomepage.Text          = MULTIPLE_SELECTION;
                _lblHomepage.ClickableLink = false;
                _lblAuthor.Text            = MULTIPLE_SELECTION;
                _lblAuthor.ClickableLink   = false;
                _edtDescription.Text       = MULTIPLE_SELECTION;
                _lblLastUpdated.Text       = MULTIPLE_SELECTION;
                _edtAnnotation.Text        = MULTIPLE_SELECTION;
            }
            else
            {
                //  Fix OM-12232 - broken feeds some times return empty string
                //  for an URL. Just ignore such image specifications.
                //  Test feed (for 16.02.06) was http://www.metalfan.ro/forum/rss.php
                if (!_feed.HasProp(Props.ImageContent) && _feed.HasProp(Props.ImageURL) &&
                    !string.IsNullOrEmpty(_feed.GetStringProp(Props.ImageURL)))
                {
                    Core.NetworkAP.QueueJob(JobPriority.AboveNormal,
                                            new DownloadResourceBlobJob(_feed, Props.ImageContent, _feed.GetStringProp(Props.ImageURL),
                                                                        ImageContentDownloaded));
                }
                SetImage();
                InitSingleFeedSelection(_feed);
            }
            UpdateControls();
        }