This commit is contained in:
Martin Rotter 2020-06-26 19:47:17 +02:00
parent 6e51580dcf
commit 45cae956bc
8 changed files with 121 additions and 3 deletions

View File

@ -147,6 +147,8 @@
<addaction name="m_actionSwitchImportanceOfSelectedMessages"/>
<addaction name="m_actionDeleteSelectedMessages"/>
<addaction name="m_actionRestoreSelectedMessages"/>
<addaction name="separator"/>
<addaction name="m_actionMessageFilters"/>
</widget>
<widget class="QMenu" name="m_menuRecycleBin">
<property name="title">
@ -759,6 +761,11 @@
<string>Show only &amp;unread messages</string>
</property>
</action>
<action name="m_actionMessageFilters">
<property name="text">
<string>Message &amp;filters</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -0,0 +1,7 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "gui/dialogs/formmessagefiltersmanager.h"
FormMessageFiltersManager::FormMessageFiltersManager(QWidget *parent) : QDialog(parent) {
m_ui.setupUi(this);
}

View File

@ -0,0 +1,20 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#ifndef FORMMESSAGEFILTERSMANAGER_H
#define FORMMESSAGEFILTERSMANAGER_H
#include <QDialog>
#include "ui_formmessagefiltersmanager.h"
class FormMessageFiltersManager : public QDialog {
Q_OBJECT
public:
explicit FormMessageFiltersManager(QWidget *parent = nullptr);
private:
Ui::FormMessageFiltersManager m_ui;
};
#endif // FORMMESSAGEFILTERSMANAGER_H

View File

@ -0,0 +1,71 @@
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>FormMessageFiltersManager</class>
<widget class="QDialog" name="FormMessageFiltersManager">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QDialogButtonBox" name="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>
</widget>
<pixmapfunction/>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>FormMessageFiltersManager</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>buttonBox</sender>
<signal>rejected()</signal>
<receiver>FormMessageFiltersManager</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -54,6 +54,7 @@ HEADERS += core/feeddownloader.h \
gui/dialogs/formbackupdatabasesettings.h \
gui/dialogs/formdatabasecleanup.h \
gui/dialogs/formmain.h \
gui/dialogs/formmessagefiltersmanager.h \
gui/dialogs/formrestoredatabasesettings.h \
gui/dialogs/formsettings.h \
gui/dialogs/formupdate.h \
@ -198,6 +199,7 @@ SOURCES += core/feeddownloader.cpp \
gui/dialogs/formbackupdatabasesettings.cpp \
gui/dialogs/formdatabasecleanup.cpp \
gui/dialogs/formmain.cpp \
gui/dialogs/formmessagefiltersmanager.cpp \
gui/dialogs/formrestoredatabasesettings.cpp \
gui/dialogs/formsettings.cpp \
gui/dialogs/formupdate.cpp \
@ -322,6 +324,7 @@ FORMS += gui/dialogs/formabout.ui \
gui/dialogs/formbackupdatabasesettings.ui \
gui/dialogs/formdatabasecleanup.ui \
gui/dialogs/formmain.ui \
gui/dialogs/formmessagefiltersmanager.ui \
gui/dialogs/formrestoredatabasesettings.ui \
gui/dialogs/formsettings.ui \
gui/dialogs/formupdate.ui \

View File

@ -115,9 +115,7 @@ class RSSGUARD_DLLSPEC Application : public QtSingleApplication {
std::function<void()> functor = nullptr);
// Returns pointer to "GOD" application singleton.
inline static Application* instance() {
return static_cast<Application*>(QCoreApplication::instance());
}
static Application* instance();
public slots:
@ -180,4 +178,8 @@ class RSSGUARD_DLLSPEC Application : public QtSingleApplication {
bool m_shouldRestart;
};
inline Application* Application::instance() {
return static_cast<Application*>(QCoreApplication::instance());
}
#endif // APPLICATION_H

View File

@ -10,6 +10,7 @@
#include "miscellaneous/application.h"
#include "miscellaneous/databasequeries.h"
#include "miscellaneous/mutex.h"
#include "gui/dialogs/formmessagefiltersmanager.h"
#include "services/abstract/cacheforserviceroot.h"
#include "services/abstract/serviceroot.h"
#include "services/gmail/gmailentrypoint.h"
@ -95,6 +96,11 @@ void FeedReader::updateFeeds(const QList<Feed*>& feeds) {
Q_ARG(QList<Feed*>, feeds));
}
void FeedReader::showMessageFiltersManager() {
FormMessageFiltersManager manager(qApp->mainFormWidget());
manager.exec();
}
void FeedReader::updateAutoUpdateStatus() {
// Restore global intervals.
// NOTE: Specific per-feed interval are left intact.

View File

@ -39,6 +39,8 @@ class RSSGUARD_DLLSPEC FeedReader : public QObject {
// Schedules given feeds for update.
void updateFeeds(const QList<Feed*>& feeds);
void showMessageFiltersManager();
// True if feed update is running right now.
bool isFeedUpdateRunning() const;