Commit 5222496d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Look at to implement "exclude mail with from == current user"

parent 0040cab4
......@@ -2,3 +2,4 @@ for 4.12:
---------
- Look at https://github.com/shellscape/Gmail-Notifier-Plus/tree/master/Promotional for idea
- Show if we can display full collection path (for the moment we can't)
- suggestion: don't notify if the "from" is us
......@@ -93,6 +93,17 @@ void NewMailNotifierAgent::doSetOnline(bool online)
}
}
void NewMailNotifierAgent::setExcludeMyselfFromNotification(bool b)
{
NewMailNotifierAgentSettings::setExcludeEmailsFromMe(b);
NewMailNotifierAgentSettings::self()->writeConfig();
}
bool NewMailNotifierAgent::excludeMyselfFromNotification() const
{
return NewMailNotifierAgentSettings::excludeEmailsFromMe();
}
void NewMailNotifierAgent::setShowPhoto(bool show)
{
NewMailNotifierAgentSettings::setShowPhoto(show);
......
......@@ -62,6 +62,9 @@ public:
void setShowFolderName(bool b);
bool showFolderName() const;
void setExcludeMyselfFromNotification(bool b);
bool excludeMyselfFromNotification() const;
void printDebug();
......
......@@ -25,6 +25,8 @@
<entry name="showFolder" key="showFolder" type="Bool">
<default>true</default>
</entry>
<entry name="excludeEmailsFromMe" key="excludeEmailsFromMe" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>
......@@ -60,6 +60,11 @@ NewMailNotifierSettingsDialog::NewMailNotifierSettingsDialog(QWidget *parent)
mShowFolders = new QCheckBox(i18n("Show Folders"));
mShowFolders->setChecked(NewMailNotifierAgentSettings::showFolder());
vbox->addWidget(mShowFolders);
mExcludeMySelf = new QCheckBox(i18n("Do not notify when email was sent by me"));
mExcludeMySelf->setChecked(NewMailNotifierAgentSettings::excludeEmailsFromMe());
vbox->addWidget(mExcludeMySelf);
vbox->addStretch();
tab->addTab(settings, i18n("Display"));
......@@ -80,6 +85,8 @@ void NewMailNotifierSettingsDialog::slotOkClicked()
NewMailNotifierAgentSettings::setShowFrom(mShowFrom->isChecked());
NewMailNotifierAgentSettings::setShowSubject(mShowSubject->isChecked());
NewMailNotifierAgentSettings::setShowFolder(mShowFolders->isChecked());
NewMailNotifierAgentSettings::setExcludeEmailsFromMe(mExcludeMySelf->isChecked());
NewMailNotifierAgentSettings::self()->writeConfig();
mNotify->save();
accept();
......
......@@ -39,6 +39,7 @@ private:
QCheckBox *mShowFrom;
QCheckBox *mShowSubject;
QCheckBox *mShowFolders;
QCheckBox *mExcludeMySelf;
KNotifyConfigWidget *mNotify;
};
......
......@@ -46,6 +46,12 @@
<method name="showFolderName" >
<arg type="b" direction="out"/>
</method>
<method name="setExcludeMyselfFromNotification" >
<arg type="b" direction="in"/>
</method>
<method name="excludeMyselfFromNotification" >
<arg type="b" direction="out"/>
</method>
<method name="printDebug" />
</interface>
</node>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment