Browse Source

Greatly improved the RSS downloader dialog layout

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
bb19cfce1f
  1. 8
      src/rss/automatedrssdownloader.cpp
  2. 31
      src/rss/automatedrssdownloader.ui

8
src/rss/automatedrssdownloader.cpp

@ -50,9 +50,13 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) : @@ -50,9 +50,13 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) :
m_editedRule(0)
{
ui->setupUi(this);
// Ui Settings
ui->listRules->setSortingEnabled(true);
ui->listRules->setSelectionMode(QAbstractItemView::ExtendedSelection);
ui->treeMatchingArticles->setSortingEnabled(true);
ui->hsplitter->setCollapsible(0, false);
ui->hsplitter->setCollapsible(1, false);
ui->hsplitter->setCollapsible(2, true); // Only the preview list is collapsible
connect(ui->listRules, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayRulesListMenu(const QPoint&)));
m_ruleList = RssDownloadRuleList::instance();
@ -84,6 +88,7 @@ void AutomatedRssDownloader::loadSettings() @@ -84,6 +88,7 @@ void AutomatedRssDownloader::loadSettings()
QIniSettings settings("qBittorrent", "qBittorrent");
restoreGeometry(settings.value("RssFeedDownloader/geometry").toByteArray());
ui->checkEnableDownloader->setChecked(RssSettings().isRssDownloadingEnabled());
ui->hsplitter->restoreState(settings.value("RssFeedDownloader/hsplitterSizes").toByteArray());
// Display download rules
loadRulesList();
}
@ -94,6 +99,7 @@ void AutomatedRssDownloader::saveSettings() @@ -94,6 +99,7 @@ void AutomatedRssDownloader::saveSettings()
// Save dialog geometry
QIniSettings settings("qBittorrent", "qBittorrent");
settings.setValue("RssFeedDownloader/geometry", saveGeometry());
settings.setValue("RssFeedDownloader/hsplitterSizes", ui->hsplitter->saveState());
}
void AutomatedRssDownloader::loadRulesList()
@ -455,6 +461,7 @@ void AutomatedRssDownloader::addFeedArticlesToTree(const RssFeed *feed, const QS @@ -455,6 +461,7 @@ void AutomatedRssDownloader::addFeedArticlesToTree(const RssFeed *feed, const QS
// If there is none, create it
if(!treeFeedItem) {
treeFeedItem = new QTreeWidgetItem(QStringList() << feed->getName());
treeFeedItem->setToolTip(0, feed->getName());
QFont f = treeFeedItem->font(0);
f.setBold(true);
treeFeedItem->setFont(0, f);
@ -465,6 +472,7 @@ void AutomatedRssDownloader::addFeedArticlesToTree(const RssFeed *feed, const QS @@ -465,6 +472,7 @@ void AutomatedRssDownloader::addFeedArticlesToTree(const RssFeed *feed, const QS
// Insert the articles
foreach(const QString &art, articles) {
QTreeWidgetItem *item = new QTreeWidgetItem(QStringList() << art);
item->setToolTip(0, art);
treeFeedItem->addChild(item);
}
ui->treeMatchingArticles->expandItem(treeFeedItem);

31
src/rss/automatedrssdownloader.ui

@ -28,8 +28,11 @@ @@ -28,8 +28,11 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSplitter" name="hsplitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
@ -119,8 +122,8 @@ @@ -119,8 +122,8 @@
</widget>
</item>
</layout>
</item>
<item>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="ruleDefBox">
@ -242,15 +245,8 @@ @@ -242,15 +245,8 @@
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_3">
@ -278,14 +274,7 @@ @@ -278,14 +274,7 @@
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</widget>
</item>
<item>

Loading…
Cancel
Save