Commit 204d42fa authored by Glen Ditchfield's avatar Glen Ditchfield 🐛
Browse files

Add Exclude Confidential/Private options to the Journal print-out

parent f310452d
Pipeline #68331 passed with stage
in 6 minutes and 44 seconds
......@@ -138,6 +138,35 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="mSecurity">
<property name="title">
<string>Security Exclusions</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="mExcludeConfidential">
<property name="toolTip">
<string>Check this option to exclude items that have their Access level set to &#8220;Confidential&#8221;</string>
</property>
<property name="text">
<string>Exclude c&amp;onfidential</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mExcludePrivate">
<property name="toolTip">
<string>Check this option to exclude items that have their Access level set to &#8220;Private&#8221;</string>
</property>
<property name="text">
<string>Exclude pri&amp;vate</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="mGeneralGroup">
<property name="title">
......
......@@ -28,6 +28,8 @@ void CalPrintJournal::readSettingsWidget()
mFromDate = cfg->mFromDate->date();
mToDate = cfg->mToDate->date();
mUseDateRange = cfg->mRangeJournals->isChecked();
mExcludeConfidential = cfg->mExcludeConfidential->isChecked();
mExcludePrivate = cfg->mExcludePrivate->isChecked();
}
}
......@@ -38,6 +40,8 @@ void CalPrintJournal::setSettingsWidget()
cfg->mPrintFooter->setChecked(mPrintFooter);
cfg->mFromDate->setDate(mFromDate);
cfg->mToDate->setDate(mToDate);
cfg->mExcludeConfidential->setChecked(mExcludeConfidential);
cfg->mExcludePrivate->setChecked(mExcludePrivate);
if (mUseDateRange) {
cfg->mRangeJournals->setChecked(true);
......@@ -60,6 +64,8 @@ void CalPrintJournal::loadConfig()
if (mConfig) {
KConfigGroup config(mConfig, "Journalprint");
mUseDateRange = config.readEntry("JournalsInRange", false);
mExcludeConfidential = config.readEntry("Exclude confidential", true);
mExcludePrivate = config.readEntry("Exclude private", true);
}
setSettingsWidget();
}
......@@ -72,6 +78,8 @@ void CalPrintJournal::saveConfig()
if (mConfig) {
KConfigGroup config(mConfig, "Journalprint");
config.writeEntry("JournalsInRange", mUseDateRange);
config.writeEntry("Exclude confidential", mExcludeConfidential);
config.writeEntry("Exclude private", mExcludePrivate);
}
}
......@@ -108,7 +116,12 @@ void CalPrintJournal::print(QPainter &p, int width, int height)
y = headerHeight() + 15;
for (const KCalendarCore::Journal::Ptr &j : qAsConst(journals)) {
drawJournal(j, p, x, y, width, height);
Q_ASSERT(j);
if (j
&& (!mExcludeConfidential || j->secrecy() != KCalendarCore::Incidence::SecrecyConfidential)
&& (!mExcludePrivate || j->secrecy() != KCalendarCore::Incidence::SecrecyPrivate)) {
drawJournal(j, p, x, y, width, height);
}
}
if (mPrintFooter) {
......
......@@ -60,6 +60,8 @@ public:
protected:
bool mUseDateRange;
bool mExcludeConfidential;
bool mExcludePrivate;
};
class CalPrintJournalConfig : public QWidget, public Ui::CalPrintJournalConfig_Base
......
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