Example #1
0
        public override void ShowPane()
        {
            _udUpdateFrequency.SetSetting(Settings.UpdateFrequency);
            _udStopUpdatePeriod.SetSetting(Settings.StopUpdateFrequency);

            _updateTimeOut.SetSetting(Settings.TimeoutInSec);
            _cmbUpdatePeriod.SetSetting(Settings.UpdatePeriod);
            _cmbStopUpdatePeriod.SetSetting(Settings.StopUpdatePeriod);

            _oldUpdatePeriod    = Settings.UpdatePeriod;
            _oldUpdateFrequency = Settings.UpdateFrequency;

            _chkRememberSelection.SetSetting(Settings.RememberSelection);
            _chkShowDesktopAlert.Checked = (FindDesktopAlertRules().Count > 0);
            _wasDesktopAlertChecked      = _chkShowDesktopAlert.Checked;

            _checkNewspaperAllowHoverSelection.Checked = Core.SettingStore.ReadBool("NewspaperView()", "AllowHoverSelection", true);
            _checkPropagateFavIconToItems.Checked      = Core.SettingStore.ReadBool(IniKeys.Section, IniKeys.PropagateFavIconToItems, true);
            _checkUseDetailedURLs.Checked = Core.SettingStore.ReadBool(IniKeys.Section, IniKeys.UseDetailedURLs, false);

            if (IsStartupPane)
            {
                _grpFontChars.Visible  = false;
                _grpExtensions.Visible = false;
                groupExpRules.Visible  = false;
            }
            else
            {
                foreach (BlogExtensionData extData in RSSPlugin.ExtensionManager.BlogExtensions)
                {
                    AddExtensionDataToList(extData);
                }

                ReadFontCharacteristics();
                ReadItemFormattingOptions();
                _txtFont.Text = _currFont + ", " + _currFontSize;
            }

            IResource resFolderType = Core.ResourceStore.FindUniqueResource("ResourceType", "Name", "RSSFeed");

            buttonClearDefault.Enabled = resFolderType.HasProp("ExpirationRuleLink");
            IResource resItemType = Core.ResourceStore.FindUniqueResource("ResourceType", "Name", "RSSItem");

            buttonClearDeleted.Enabled = resItemType.HasProp("ExpirationRuleOnDeletedLink");

            _cookieProviderSelector.Populate(typeof(RSSUnitOfWork));
        }
Example #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();
        }