Fix displaying of unread root when loading app.
This commit is contained in:
parent
2dc6e51e4b
commit
3812e41d7b
|
@ -197,7 +197,7 @@ bool FeedsProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source
|
|||
|
||||
RootItem *item = m_sourceModel->itemForIndex(idx);
|
||||
|
||||
if (item->kind() == RootItemKind::Bin) {
|
||||
if (item->kind() == RootItemKind::Bin || item->kind() == RootItemKind::ServiceRoot) {
|
||||
// Recycle bin is always displayed.
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -19,13 +19,16 @@
|
|||
|
||||
#include "miscellaneous/application.h"
|
||||
#include "miscellaneous/iconfactory.h"
|
||||
#include "core/feedsmodel.h"
|
||||
|
||||
|
||||
#if defined(Q_OS_OS2)
|
||||
#include "gui/messagebox.h"
|
||||
#endif
|
||||
|
||||
|
||||
FormAddAccount::FormAddAccount(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAddAccount) {
|
||||
FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*> &entry_points, FeedsModel *model, QWidget *parent)
|
||||
: QDialog(parent), m_ui(new Ui::FormAddAccount), m_model(model), m_entryPoints(entry_points) {
|
||||
m_ui->setupUi(this);
|
||||
|
||||
// Set flags and attributes.
|
||||
|
|
|
@ -27,15 +27,20 @@ namespace Ui {
|
|||
class FormAddAccount;
|
||||
}
|
||||
|
||||
class ServiceEntryPoint;
|
||||
class FeedsModel;
|
||||
|
||||
class FormAddAccount : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FormAddAccount(QWidget *parent = 0);
|
||||
explicit FormAddAccount(const QList<ServiceEntryPoint*> &entry_points, FeedsModel *model, QWidget *parent = 0);
|
||||
virtual ~FormAddAccount();
|
||||
|
||||
private:
|
||||
Ui::FormAddAccount *m_ui;
|
||||
FeedsModel *m_model;
|
||||
QList<ServiceEntryPoint*> m_entryPoints;
|
||||
};
|
||||
|
||||
#endif // FORMADDACCOUNT_H
|
||||
|
|
|
@ -6,48 +6,51 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<width>558</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Add new account</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="m_buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>240</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QListWidget" name="m_listEntryPoints">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="m_grpEntryPointDetails">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Details</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="m_buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>m_buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>FormAddAccount</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "gui/dialogs/formupdate.h"
|
||||
#include "gui/dialogs/formbackupdatabasesettings.h"
|
||||
#include "gui/dialogs/formrestoredatabasesettings.h"
|
||||
#include "gui/dialogs/formaddaccount.h"
|
||||
#include "gui/notifications/notification.h"
|
||||
#include "services/abstract/serviceroot.h"
|
||||
#include "services/abstract/recyclebin.h"
|
||||
|
@ -447,6 +448,7 @@ void FormMain::createConnections() {
|
|||
connect(m_ui->m_actionRestoreDatabaseSettings, SIGNAL(triggered()), this, SLOT(restoreDatabaseSettings()));
|
||||
connect(m_ui->m_actionRestart, SIGNAL(triggered()), qApp, SLOT(restart()));
|
||||
connect(m_ui->m_actionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
|
||||
connect(m_ui->m_actionServiceAdd, SIGNAL(triggered()), this, SLOT(showAddAccountDialog()));
|
||||
|
||||
// Menu "View" connections.
|
||||
connect(m_ui->m_actionFullscreen, SIGNAL(toggled(bool)), this, SLOT(switchFullscreenMode()));
|
||||
|
@ -551,6 +553,14 @@ void FormMain::showWiki() {
|
|||
}
|
||||
}
|
||||
|
||||
void FormMain::showAddAccountDialog() {
|
||||
QPointer<FormAddAccount> form_update = new FormAddAccount(qApp->feedServices(),
|
||||
tabWidget()->feedMessageViewer()->feedsView()->sourceModel(),
|
||||
this);
|
||||
form_update.data()->exec();
|
||||
delete form_update.data();
|
||||
}
|
||||
|
||||
void FormMain::reportABugOnGitHub() {
|
||||
if (!WebFactory::instance()->openUrlInExternalBrowser(APP_URL_ISSUES_NEW_GITHUB)) {
|
||||
qApp->showGuiMessage(tr("Cannot open external browser"),
|
||||
|
|
|
@ -90,6 +90,7 @@ class FormMain : public QMainWindow {
|
|||
void showAbout();
|
||||
void showUpdates();
|
||||
void showWiki();
|
||||
void showAddAccountDialog();
|
||||
void reportABugOnGitHub();
|
||||
void reportABugOnBitBucket();
|
||||
void donate();
|
||||
|
|
|
@ -481,12 +481,12 @@ void MessagesView::selectNextUnreadItem() {
|
|||
active_row = 0;
|
||||
}
|
||||
|
||||
QModelIndex next_unread = m_proxyModel->getNextPreviousUnreadItemIndex(active_row);
|
||||
QModelIndex next_unread = moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier);
|
||||
|
||||
if (next_unread.isValid()) {
|
||||
// We found unread message, mark it.
|
||||
setCurrentIndex(next_unread);
|
||||
selectionModel()->select(next_unread, QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
||||
selectionModel()->select(next_unread, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
|
||||
setFocus();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue