mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-03 10:47:47 +01:00
Fixed #92.
This commit is contained in:
parent
c0c623ead5
commit
91f9dd7a9c
@ -3,13 +3,14 @@
|
|||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Fixed #76, #75, #82, #79, #85 #78</li>
|
<li>Fixed #76, #75, #82, #79, #85 #78, #92.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
Added:
|
Added:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Settings/database can now experimentally be exported/imported.</li>
|
<li>Settings/database can now experimentally be exported/imported.</li>
|
||||||
<li>Added Swedish localization (thanks to Åke Engelbrektson).</li>
|
<li>Added Swedish localization (thanks to Åke Engelbrektson).</li>
|
||||||
|
<li>Parent item is now selected when adding new category/feed with that parent pre-selected in feed view.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
Changed:
|
Changed:
|
||||||
|
@ -110,6 +110,17 @@ QList<FeedsModelFeed*> FeedsView::allFeeds() const {
|
|||||||
return m_sourceModel->allFeeds();
|
return m_sourceModel->allFeeds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FeedsModelRootItem *FeedsView::selectedItem() const {
|
||||||
|
QModelIndexList selected_rows = selectionModel()->selectedRows();
|
||||||
|
|
||||||
|
if (selected_rows.isEmpty()) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
FeedsModelRootItem *selected_item = m_sourceModel->itemForIndex(m_proxyModel->mapToSource(selected_rows.at(0)));
|
||||||
|
return selected_item == m_sourceModel->rootItem() ? NULL : selected_item;
|
||||||
|
}
|
||||||
|
|
||||||
FeedsModelCategory *FeedsView::selectedCategory() const {
|
FeedsModelCategory *FeedsView::selectedCategory() const {
|
||||||
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
||||||
return m_sourceModel->categoryForIndex(current_mapped);
|
return m_sourceModel->categoryForIndex(current_mapped);
|
||||||
@ -246,7 +257,7 @@ void FeedsView::addNewCategory() {
|
|||||||
|
|
||||||
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
||||||
|
|
||||||
form_pointer.data()->exec(NULL, NULL);
|
form_pointer.data()->exec(NULL, selectedItem());
|
||||||
|
|
||||||
delete form_pointer.data();
|
delete form_pointer.data();
|
||||||
|
|
||||||
@ -275,7 +286,7 @@ void FeedsView::addNewFeed() {
|
|||||||
|
|
||||||
QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
|
QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
|
||||||
|
|
||||||
form_pointer.data()->exec(NULL);
|
form_pointer.data()->exec(NULL, selectedItem());
|
||||||
|
|
||||||
delete form_pointer.data();
|
delete form_pointer.data();
|
||||||
|
|
||||||
@ -286,7 +297,7 @@ void FeedsView::addNewFeed() {
|
|||||||
void FeedsView::editFeed(FeedsModelFeed *feed) {
|
void FeedsView::editFeed(FeedsModelFeed *feed) {
|
||||||
QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
|
QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
|
||||||
|
|
||||||
form_pointer.data()->exec(feed);
|
form_pointer.data()->exec(feed, NULL);
|
||||||
|
|
||||||
delete form_pointer.data();
|
delete form_pointer.data();
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ class FeedsView : public QTreeView {
|
|||||||
|
|
||||||
// Returns pointers to selected feed/category if they are really
|
// Returns pointers to selected feed/category if they are really
|
||||||
// selected.
|
// selected.
|
||||||
|
FeedsModelRootItem *selectedItem() const;
|
||||||
FeedsModelCategory *selectedCategory() const;
|
FeedsModelCategory *selectedCategory() const;
|
||||||
FeedsModelFeed *selectedFeed() const;
|
FeedsModelFeed *selectedFeed() const;
|
||||||
FeedsModelRecycleBin *selectedRecycleBin() const;
|
FeedsModelRecycleBin *selectedRecycleBin() const;
|
||||||
@ -113,9 +114,7 @@ class FeedsView : public QTreeView {
|
|||||||
|
|
||||||
// Is called when counts of messages are changed externally,
|
// Is called when counts of messages are changed externally,
|
||||||
// typically from message view.
|
// typically from message view.
|
||||||
void receiveMessageCountsChange(MessagesModel::MessageMode mode,
|
void receiveMessageCountsChange(MessagesModel::MessageMode mode, bool total_msg_count_changed, bool any_msg_restored);
|
||||||
bool total_msg_count_changed,
|
|
||||||
bool any_msg_restored);
|
|
||||||
|
|
||||||
// Reloads counts for selected feeds.
|
// Reloads counts for selected feeds.
|
||||||
void updateCountsOfSelectedFeeds(bool update_total_too);
|
void updateCountsOfSelectedFeeds(bool update_total_too);
|
||||||
|
@ -92,6 +92,20 @@ int FormCategoryDetails::exec(FeedsModelCategory *input_category, FeedsModelRoot
|
|||||||
// Make sure that "default" icon is used as the default option for new
|
// Make sure that "default" icon is used as the default option for new
|
||||||
// categories.
|
// categories.
|
||||||
m_actionUseDefaultIcon->trigger();
|
m_actionUseDefaultIcon->trigger();
|
||||||
|
|
||||||
|
// Load parent from suggested item.
|
||||||
|
if (parent_to_select != NULL) {
|
||||||
|
if (parent_to_select->kind() == FeedsModelRootItem::Category) {
|
||||||
|
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
||||||
|
}
|
||||||
|
else if (parent_to_select->kind() == FeedsModelRootItem::Feed) {
|
||||||
|
int target_item = m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select->parent()));
|
||||||
|
|
||||||
|
if (target_item >= 0) {
|
||||||
|
m_ui->m_cmbParentCategory->setCurrentIndex(target_item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// User is editing existing category.
|
// User is editing existing category.
|
||||||
|
@ -56,7 +56,7 @@ FormFeedDetails::~FormFeedDetails() {
|
|||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FormFeedDetails::exec(FeedsModelFeed *input_feed) {
|
int FormFeedDetails::exec(FeedsModelFeed *input_feed, FeedsModelRootItem *parent_to_select) {
|
||||||
// Load categories.
|
// Load categories.
|
||||||
loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem());
|
loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem());
|
||||||
|
|
||||||
@ -73,6 +73,19 @@ int FormFeedDetails::exec(FeedsModelFeed *input_feed) {
|
|||||||
if (default_encoding_index >= 0) {
|
if (default_encoding_index >= 0) {
|
||||||
m_ui->m_cmbEncoding->setCurrentIndex(default_encoding_index);
|
m_ui->m_cmbEncoding->setCurrentIndex(default_encoding_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parent_to_select != NULL) {
|
||||||
|
if (parent_to_select->kind() == FeedsModelRootItem::Category) {
|
||||||
|
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
||||||
|
}
|
||||||
|
else if (parent_to_select->kind() == FeedsModelRootItem::Feed) {
|
||||||
|
int target_item = m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select->parent()));
|
||||||
|
|
||||||
|
if (target_item >= 0) {
|
||||||
|
m_ui->m_cmbParentCategory->setCurrentIndex(target_item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// User is editing existing category.
|
// User is editing existing category.
|
||||||
|
@ -42,7 +42,7 @@ class FormFeedDetails : public QDialog {
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Executes add/edit standard feed dialog.
|
// Executes add/edit standard feed dialog.
|
||||||
int exec(FeedsModelFeed *input_feed);
|
int exec(FeedsModelFeed *input_feed, FeedsModelRootItem *parent_to_select);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// Applies changes.
|
// Applies changes.
|
||||||
|
@ -95,7 +95,6 @@ bool DatabaseFactory::initiateRestoration(const QString &database_backup_file_pa
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseFactory::finishRestoration() {
|
void DatabaseFactory::finishRestoration() {
|
||||||
// TODO: Finish restoration.
|
|
||||||
if (m_activeDatabaseDriver != SQLITE && m_activeDatabaseDriver != SQLITE_MEMORY) {
|
if (m_activeDatabaseDriver != SQLITE && m_activeDatabaseDriver != SQLITE_MEMORY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user