|
|
@ -237,10 +237,13 @@ void RSSImp::deleteSelectedItems() |
|
|
|
ret = QMessageBox::question(this, tr("Are you sure? -- qBittorrent"), tr("Are you sure you want to delete these elements from the list?"), |
|
|
|
ret = QMessageBox::question(this, tr("Are you sure? -- qBittorrent"), tr("Are you sure you want to delete these elements from the list?"), |
|
|
|
tr("&Yes"), tr("&No"), |
|
|
|
tr("&Yes"), tr("&No"), |
|
|
|
QString(), 0, 1); |
|
|
|
QString(), 0, 1); |
|
|
|
else |
|
|
|
else { |
|
|
|
|
|
|
|
if (selectedItems.first() == m_feedList->stickyUnreadItem()) |
|
|
|
|
|
|
|
return; |
|
|
|
ret = QMessageBox::question(this, tr("Are you sure? -- qBittorrent"), tr("Are you sure you want to delete this element from the list?"), |
|
|
|
ret = QMessageBox::question(this, tr("Are you sure? -- qBittorrent"), tr("Are you sure you want to delete this element from the list?"), |
|
|
|
tr("&Yes"), tr("&No"), |
|
|
|
tr("&Yes"), tr("&No"), |
|
|
|
QString(), 0, 1); |
|
|
|
QString(), 0, 1); |
|
|
|
|
|
|
|
} |
|
|
|
if (ret) |
|
|
|
if (ret) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
@ -250,6 +253,8 @@ void RSSImp::deleteSelectedItems() |
|
|
|
m_currentArticle = 0; |
|
|
|
m_currentArticle = 0; |
|
|
|
listArticles->clear(); |
|
|
|
listArticles->clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (item == m_feedList->stickyUnreadItem()) |
|
|
|
|
|
|
|
continue; |
|
|
|
RssFilePtr rss_item = m_feedList->getRSSItem(item); |
|
|
|
RssFilePtr rss_item = m_feedList->getRSSItem(item); |
|
|
|
QTreeWidgetItem* parent = item->parent(); |
|
|
|
QTreeWidgetItem* parent = item->parent(); |
|
|
|
// Notify TreeWidget
|
|
|
|
// Notify TreeWidget
|
|
|
@ -366,8 +371,11 @@ void RSSImp::openSelectedArticlesUrls() |
|
|
|
void RSSImp::renameSelectedRssFile() |
|
|
|
void RSSImp::renameSelectedRssFile() |
|
|
|
{ |
|
|
|
{ |
|
|
|
QList<QTreeWidgetItem*> selectedItems = m_feedList->selectedItems(); |
|
|
|
QList<QTreeWidgetItem*> selectedItems = m_feedList->selectedItems(); |
|
|
|
Q_ASSERT(selectedItems.size() == 1); |
|
|
|
if (selectedItems.size() != 1) |
|
|
|
|
|
|
|
return; |
|
|
|
QTreeWidgetItem* item = selectedItems.first(); |
|
|
|
QTreeWidgetItem* item = selectedItems.first(); |
|
|
|
|
|
|
|
if (item == m_feedList->stickyUnreadItem()) |
|
|
|
|
|
|
|
return; |
|
|
|
RssFilePtr rss_item = m_feedList->getRSSItem(item); |
|
|
|
RssFilePtr rss_item = m_feedList->getRSSItem(item); |
|
|
|
bool ok; |
|
|
|
bool ok; |
|
|
|
QString newName; |
|
|
|
QString newName; |
|
|
@ -681,6 +689,11 @@ RSSImp::RSSImp(QWidget *parent) : |
|
|
|
splitter_h->insertWidget(0, m_feedList); |
|
|
|
splitter_h->insertWidget(0, m_feedList); |
|
|
|
listArticles->setSelectionBehavior(QAbstractItemView::SelectItems); |
|
|
|
listArticles->setSelectionBehavior(QAbstractItemView::SelectItems); |
|
|
|
listArticles->setSelectionMode(QAbstractItemView::SingleSelection); |
|
|
|
listArticles->setSelectionMode(QAbstractItemView::SingleSelection); |
|
|
|
|
|
|
|
editHotkey = new QShortcut(QKeySequence("F2"), m_feedList, 0, 0, Qt::WidgetShortcut); |
|
|
|
|
|
|
|
connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedRssFile())); |
|
|
|
|
|
|
|
connect(m_feedList, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedRssFile())); |
|
|
|
|
|
|
|
deleteHotkey = new QShortcut(QKeySequence(QKeySequence::Delete), m_feedList, 0, 0, Qt::WidgetShortcut); |
|
|
|
|
|
|
|
connect(deleteHotkey, SIGNAL(activated()), SLOT(deleteSelectedItems())); |
|
|
|
|
|
|
|
|
|
|
|
m_rssManager->loadStreamList(); |
|
|
|
m_rssManager->loadStreamList(); |
|
|
|
fillFeedsList(); |
|
|
|
fillFeedsList(); |
|
|
@ -729,6 +742,8 @@ RSSImp::~RSSImp() |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug("Deleting RSSImp..."); |
|
|
|
qDebug("Deleting RSSImp..."); |
|
|
|
saveFoldersOpenState(); |
|
|
|
saveFoldersOpenState(); |
|
|
|
|
|
|
|
delete editHotkey; |
|
|
|
|
|
|
|
delete deleteHotkey; |
|
|
|
delete m_feedList; |
|
|
|
delete m_feedList; |
|
|
|
qDebug("RSSImp deleted"); |
|
|
|
qDebug("RSSImp deleted"); |
|
|
|
} |
|
|
|
} |
|
|
|