Commit e5436d4b authored by Nicolás Alvarez's avatar Nicolás Alvarez

Initial import from the monolithic kdepim.

This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:

http://community.kde.org/Frameworks/GitOldHistory

If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.

Branched from the monolithic repo, kdepim master branch, at commit
d0009536f24e8c7f4cc32a70936f5c25194e9a6f
parents
EXTRA kdebug,tipsandthis,defines,qenums,null,camelcase
SKIP /tests/
cmake_minimum_required(VERSION 2.8.12)
project(calendarsupport)
if(${CMAKE_SOURCE_DIR} STREQUAL ${calendarsupport_SOURCE_DIR})
# ECM setup
find_package(ECM 5.16.0 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(KF5_VERSION "5.16.0")
set(KDEPIMLIBS_LIB_VERSION "5.1.42")
set(KDEPIM_LIB_VERSION "5.1.42")
set(QT_REQUIRED_VERSION "5.4.0")
set(KMIME_LIB_VERSION "4.87.0")
set(CALENDARUTILS_LIB_VERSION "4.80.0")
set(KCALENDARCORE_LIB_VERSION "4.81.0")
set(IDENTITYMANAGEMENT_LIB_VERSION "4.80.0")
set(KHOLIDAYS_LIB_VERSION "4.80.0")
set(AKONADICALENDAR_LIB_VERSION "4.80.0")
find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommon ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KdepimDBusInterfaces ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX CALENDARSUPPORT
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfigVersion.cmake"
SOVERSION 5
)
########### Targets ###########
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5CalendarSupport")
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5CalendarSupportConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(EXPORT KF5CalendarSupportTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5CalendarSupportTargets.cmake NAMESPACE KF5::)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
else()
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX CALENDARSUPPORT
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfigVersion.cmake"
SOVERSION 5
)
endif()
add_subdirectory(src)
install( FILES calendarsupport.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
@PACKAGE_INIT@
find_dependency(KF5Mime "@KMIME_LIB_VERSION@")
find_dependency(KF5IdentityManagement "@IDENTITYMANAGEMENT_LIB_VERSION@")
find_dependency(KF5AkonadiCalendar "@AKONADICALENDAR_LIB_VERSION@")
include("${CMAKE_CURRENT_LIST_DIR}/KF5CalendarSupportTargets.cmake")
// DOXYGEN_NAME=Calendar Support
// DOXYGEN_ENABLE=YES
log_calendarsupport kdepim (calendarsupport)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DTRANSLATION_DOMAIN=\"calendarsupport\")
########### next target ###############
set(calendarsupport_LIB_SRCS
archivedialog.cpp
attachmenthandler.cpp
calendarsingleton.cpp
calendarutils.cpp
categoryconfig.cpp
categoryhierarchyreader.cpp
cellitem.cpp
collectionselection.cpp
eventarchiver.cpp
identitymanager.cpp
incidenceattachmentmodel.cpp
kcalmodel.cpp
kcalprefs.cpp
messagewidget.cpp
utils.cpp
tagcache.cpp
plugin.cpp
printing/calprintpluginbase.cpp
printing/calprintdefaultplugins.cpp
printing/calprinter.cpp
printing/journalprint.cpp
printing/yearprint.cpp
next/incidenceviewer.cpp
freebusymodel/freeperiodmodel.cpp
freebusymodel/freebusyitem.cpp
freebusymodel/freebusyitemmodel.cpp
freebusymodel/freebusycalendar.cpp
)
ki18n_wrap_ui(calendarsupport_LIB_SRCS
printing/calprintdayconfig_base.ui
printing/calprintincidenceconfig_base.ui
printing/calprintjournalconfig_base.ui
printing/calprintmonthconfig_base.ui
printing/calprinttodoconfig_base.ui
printing/calprintweekconfig_base.ui
printing/calprintyearconfig_base.ui
)
ecm_qt_declare_logging_category(calendarsupport_LIB_SRCS HEADER calendarsupport_debug.h IDENTIFIER CALENDARSUPPORT_LOG CATEGORY_NAME log_calendarsupport)
kconfig_add_kcfg_files(calendarsupport_LIB_SRCS kcalprefs_base.kcfgc)
add_library(KF5CalendarSupport ${calendarsupport_LIB_SRCS})
generate_export_header(KF5CalendarSupport BASE_NAME calendarsupport)
add_library(KF5::CalendarSupport ALIAS KF5CalendarSupport)
target_include_directories(KF5CalendarSupport INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/CalendarSupport/;${KDE_INSTALL_INCLUDEDIR_KF5}/calendarsupport>")
target_include_directories(KF5CalendarSupport PUBLIC "$<BUILD_INTERFACE:${calendarsupport_SOURCE_DIR}/src;${calendarsupport_BINARY_DIR}/src;${Boost_INCLUDE_DIRS}>")
target_link_libraries(
KF5CalendarSupport
PUBLIC
KF5::Mime
KF5::IdentityManagement
KF5::AkonadiCalendar
PRIVATE
KF5::AkonadiWidgets
KF5::Holidays
KF5::Codecs
KF5::AkonadiCore
KF5::CalendarCore
KF5::CalendarUtils
KF5::KdepimDBusInterfaces
)
set_target_properties(KF5CalendarSupport PROPERTIES
VERSION ${CALENDARSUPPORT_VERSION_STRING}
SOVERSION ${CALENDARSUPPORT_SOVERSION}
EXPORT_NAME CalendarSupport
)
install(TARGETS
KF5CalendarSupport
EXPORT KF5CalendarSupportTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK}
)
ecm_generate_headers(CalendarSupport_CamelCase_HEADERS
HEADER_NAMES
Utils
CategoryConfig
CellItem
CollectionSelection
KCalPrefs
IdentityManager
EventArchiver
Plugin
CategoryHierarchyReader
CalendarSingleton
MessageWidget
ArchiveDialog
REQUIRED_HEADERS CalendarSupport_HEADERS
PREFIX CalendarSupport
)
ecm_generate_headers(CalendarSupport_CamelCaseprinter_HEADERS
HEADER_NAMES
PrintPlugin
CalPrinter
CalPrintDefaultPlugins
CalPrintPluginBase
REQUIRED_HEADERS CalendarSupport_printer_HEADERS
PREFIX CalendarSupport
RELATIVE printing
)
ecm_generate_headers(CalendarSupport_CamelCasenext_HEADERS
HEADER_NAMES
IncidenceViewer
REQUIRED_HEADERS CalendarSupport_next_HEADERS
PREFIX CalendarSupport
RELATIVE next
)
ecm_generate_headers(CalendarSupport_CamelCasefreebusy_HEADERS
HEADER_NAMES
FreeBusyItem
FreeBusyItemModel
FreeBusyCalendar
FreePeriodModel
REQUIRED_HEADERS CalendarSupport_freebusy_HEADERS
PREFIX CalendarSupport
RELATIVE freebusymodel
)
ecm_generate_pri_file(BASE_NAME CalendarSupport
LIB_NAME KF5CalendarSupport
DEPS "Mime IdentityManagement AkonadiCalendar" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/CalendarSupport
)
if(${CMAKE_SOURCE_DIR} STREQUAL ${calendarsupport_SOURCE_DIR})
install(FILES
${CalendarSupport_CamelCase_HEADERS}
${CalendarSupport_CamelCaseprinter_HEADERS}
${CalendarSupport_CamelCasenext_HEADERS}
${CalendarSupport_CamelCasefreebusy_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/CalendarSupport
COMPONENT Devel
)
install(FILES
${CalendarSupport_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_export.h
${CMAKE_CURRENT_BINARY_DIR}/ui_calprintincidenceconfig_base.h
${CMAKE_CURRENT_BINARY_DIR}/ui_calprintdayconfig_base.h
${CMAKE_CURRENT_BINARY_DIR}/ui_calprintweekconfig_base.h
${CMAKE_CURRENT_BINARY_DIR}/ui_calprintmonthconfig_base.h
${CMAKE_CURRENT_BINARY_DIR}/ui_calprinttodoconfig_base.h
${CMAKE_CURRENT_BINARY_DIR}/kcalprefs_base.h
${CalendarSupport_HEADERS}
${CalendarSupport_printer_HEADERS}
${CalendarSupport_next_HEADERS}
${CalendarSupport_freebusy_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/calendarsupport
COMPONENT Devel
)
install(FILES
${PRI_FILENAME}
DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
endif()
install(FILES calendarplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
if(BUILD_TESTING)
add_subdirectory(freebusymodel/autotests)
endif()
#!/bin/sh
$EXTRACTRC `find . -name "*.ui" -o -name "*.kcfg"` >> rc.cpp || exit 11
$XGETTEXT `find . -name "*.cpp" -o -name "*.h" | grep -v '/tests/'` -o $podir/calendarsupport.pot
rm -f rc.cpp
/*
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
// ArchiveDialog -- archive/delete past events.
#include "archivedialog.h"
#include "eventarchiver.h"
#include "kcalprefs.h"
#include <Akonadi/Calendar/IncidenceChanger>
#include <KComboBox>
#include <KDateComboBox>
#include <KLineEdit>
#include <KLocalizedString>
#include <KMessageBox>
#include <QUrl>
#include <KUrlRequester>
#include <QHBoxLayout>
#include <QSpinBox>
#include <QButtonGroup>
#include <QCheckBox>
#include <QFrame>
#include <QGroupBox>
#include <QLabel>
#include <QRadioButton>
#include <QVBoxLayout>
#include <QWhatsThis>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
using namespace CalendarSupport;
ArchiveDialog::ArchiveDialog(const Akonadi::ETMCalendar::Ptr &cal,
Akonadi::IncidenceChanger *changer,
QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18nc("@title:window", "Archive/Delete Past Events and To-dos"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mUser1Button = new QPushButton;
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ArchiveDialog::reject);
mUser1Button->setDefault(true);
setModal(false);
mUser1Button->setText(i18nc("@action:button", "&Archive"));
mCalendar = cal;
mChanger = changer;
QFrame *topFrame = new QFrame(this);
mainLayout->addWidget(topFrame);
mainLayout->addWidget(buttonBox);
QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
QLabel *descLabel = new QLabel(topFrame);
descLabel->setText(
xi18nc("@info:whatsthis",
"Archiving saves old items into the given file and "
"then deletes them in the current calendar. If the archive file "
"already exists they will be added. "
"(<link url=\"#\">How to restore</link>)"));
descLabel->setWhatsThis(
i18nc("@info:whatsthis",
"In order to add an archive to your calendar, use the Merge Calendar "
"function. You can view an archive by opening it like you would any "
"other calendar. It is not saved in a special format, but as "
"vCalendar."));
descLabel->setTextInteractionFlags(
Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard |
Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard);
descLabel->setWordWrap(true);
descLabel->setContextMenuPolicy(Qt::NoContextMenu);
topLayout->addWidget(descLabel);
connect(descLabel, &QLabel::linkActivated, this, &ArchiveDialog::showWhatsThis);
QButtonGroup *radioBG = new QButtonGroup(this);
connect(radioBG, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &ArchiveDialog::slotActionChanged);
QHBoxLayout *dateLayout = new QHBoxLayout();
dateLayout->setMargin(0);
mArchiveOnceRB = new QRadioButton(i18nc("@option:radio",
"Archive now items older than:"),
topFrame);
mArchiveOnceRB->setToolTip(
i18nc("@info:tooltip",
"Enable one time archiving or purging of older items"));
mArchiveOnceRB->setWhatsThis(
i18nc("@info:whatsthis",
"If you check this box, events and to-dos older than the specified age "
"will be archived or purged. The items will be archived unless the "
"\"Delete only\" option is enabled; else the items will be purged "
"and not saved."));
dateLayout->addWidget(mArchiveOnceRB);
radioBG->addButton(mArchiveOnceRB);
mDateEdit = new KDateComboBox(topFrame);
mDateEdit->setToolTip(
i18nc("@info:tooltip",
"Set the one time archiving cut-off date"));
mDateEdit->setWhatsThis(
i18nc("@info:whatsthis",
"The date before which items should be archived. All older events "
"and to-dos will be saved and deleted, the newer (and events "
"exactly on that date) will be kept."));
dateLayout->addWidget(mDateEdit);
topLayout->addLayout(dateLayout);
// Checkbox, numinput and combo for auto-archiving (similar to kmail's
// mExpireFolderCheckBox/mReadExpiryTimeNumInput in kmfolderdia.cpp)
QWidget *autoArchiveHBox = new QWidget(topFrame);
QHBoxLayout *autoArchiveHBoxHBoxLayout = new QHBoxLayout(autoArchiveHBox);
autoArchiveHBoxHBoxLayout->setMargin(0);
topLayout->addWidget(autoArchiveHBox);
mAutoArchiveRB = new QRadioButton(i18nc("@option:radio",
"Automaticall&y archive items older than:"),
autoArchiveHBox);
mAutoArchiveRB->setToolTip(
i18nc("@info:tooltip",
"Enable automatic archiving or purging of older items"));
mAutoArchiveRB->setWhatsThis(
i18nc("@info:whatsthis",
"If this feature is enabled, the application will regularly check if "
"events and to-dos have to be archived; this means you will not "
"need to use this dialog box again, except to change the settings."));
radioBG->addButton(mAutoArchiveRB);
autoArchiveHBoxHBoxLayout->addWidget(mAutoArchiveRB);
mExpiryTimeNumInput = new QSpinBox(autoArchiveHBox);
autoArchiveHBoxHBoxLayout->addWidget(mExpiryTimeNumInput);
mExpiryTimeNumInput->setRange(1, 500);
mExpiryTimeNumInput->setSingleStep(1);
mExpiryTimeNumInput->setEnabled(false);
mExpiryTimeNumInput->setValue(7);
mExpiryTimeNumInput->setToolTip(
i18nc("@info:tooltip",
"Set the archival age in days, weeks or months"));
mExpiryTimeNumInput->setWhatsThis(
i18nc("@info:whatsthis",
"The age of the events and to-dos to archive. All older items "
"will be saved and deleted, the newer will be kept."));
mExpiryUnitsComboBox = new KComboBox(autoArchiveHBox);
autoArchiveHBoxHBoxLayout->addWidget(mExpiryUnitsComboBox);
mExpiryUnitsComboBox->setToolTip(
i18nc("@info:tooltip",
"Set the units for the automatic archive age"));
mExpiryUnitsComboBox->setWhatsThis(
i18nc("@info:whatsthis",
"Select the time units (days, weeks or months) for automatic archiving."));
// Those items must match the "Expiry Unit" enum in the kcfg file!
mExpiryUnitsComboBox->addItem(
i18nc("@item:inlistbox expires in daily units", "Day(s)"));
mExpiryUnitsComboBox->addItem(
i18nc("@item:inlistbox expiration in weekly units", "Week(s)"));
mExpiryUnitsComboBox->addItem(
i18nc("@item:inlistbox expiration in monthly units", "Month(s)"));
mExpiryUnitsComboBox->setEnabled(false);
QHBoxLayout *fileLayout = new QHBoxLayout();
fileLayout->setMargin(0);
QLabel *l = new QLabel(i18nc("@label", "Archive &file:"), topFrame);
fileLayout->addWidget(l);
mArchiveFile = new KUrlRequester(QUrl::fromLocalFile(KCalPrefs::instance()->mArchiveFile), topFrame);
mArchiveFile->setMode(KFile::File);
mArchiveFile->setFilter(i18nc("@label filter for KUrlRequester", "*.ics|iCalendar Files"));
mArchiveFile->setToolTip(
i18nc("@info:tooltip",
"Set the location of the archive"));
mArchiveFile->setWhatsThis(
i18nc("@info:whatsthis",
"The path of the archive file. The events and to-dos will be appended "
"to the specified file, so any events that are already in the file "
"will not be modified or deleted. You can later load or merge the "
"file like any other calendar. It is not saved in a special "
"format, it uses the iCalendar format."));
l->setBuddy(mArchiveFile->lineEdit());
fileLayout->addWidget(mArchiveFile);
topLayout->addLayout(fileLayout);
QGroupBox *typeBox = new QGroupBox(i18nc("@title:group", "Type of Items to Archive"));
typeBox->setWhatsThis(
i18nc("@info:whatsthis",
"Here you can select which items "
"should be archived. Events are archived if they "
"ended before the date given above; to-dos are archived if "
"they were finished before the date."));
topLayout->addWidget(typeBox);
QBoxLayout *typeLayout = new QVBoxLayout(typeBox);
mEvents = new QCheckBox(i18nc("@option:check", "Archive &Events"));
mEvents->setToolTip(
i18nc("@option:check", "Archive or purge events"));
mEvents->setWhatsThis(
i18nc("@info:whatsthis",
"Select this option to archive events if they ended before the date given above."));
typeLayout->addWidget(mEvents);
mTodos = new QCheckBox(i18nc("@option:check", "Archive Completed &To-dos"));
mTodos->setToolTip(
i18nc("@option:check", "Archive or purge completed to-dos"));
mTodos->setWhatsThis(
i18nc("@info:whatsthis",
"Select this option to archive to-dos if they were completed "
"before the date given above."));
typeLayout->addWidget(mTodos);
mDeleteCb = new QCheckBox(i18nc("@option:check", "&Delete only, do not save"), topFrame);
mDeleteCb->setToolTip(
i18nc("@info:tooltip",
"Purge the old items without saving them"));
mDeleteCb->setWhatsThis(
i18nc("@info:whatsthis",
"Select this option to delete old events and to-dos without saving "
"them. It is not possible to recover the events later."));
topLayout->addWidget(mDeleteCb);
connect(mDeleteCb, &QCheckBox::toggled, mArchiveFile, &KUrlRequester::setDisabled);
connect(mDeleteCb, &QCheckBox::toggled, this, &ArchiveDialog::slotEnableUser1);
connect(mArchiveFile->lineEdit(), &QLineEdit::textChanged, this, &ArchiveDialog::slotEnableUser1);
// Load settings from KCalPrefs
mExpiryTimeNumInput->setValue(KCalPrefs::instance()->mExpiryTime);
mExpiryUnitsComboBox->setCurrentIndex(KCalPrefs::instance()->mExpiryUnit);
mDeleteCb->setChecked(KCalPrefs::instance()->mArchiveAction == KCalPrefs::actionDelete);
mEvents->setChecked(KCalPrefs::instance()->mArchiveEvents);
mTodos->setChecked(KCalPrefs::instance()->mArchiveTodos);
slotEnableUser1();
// The focus should go to a useful field by default, not to the top richtext-label
if (KCalPrefs::instance()->mAutoArchive) {
mAutoArchiveRB->setChecked(true);
mAutoArchiveRB->setFocus();
} else {
mArchiveOnceRB->setChecked(true);
mArchiveOnceRB->setFocus();
}
slotActionChanged();
connect(mUser1Button, &QPushButton::clicked, this, &ArchiveDialog::slotUser1);
}
ArchiveDialog::~ArchiveDialog()
{
}
void ArchiveDialog::slotEnableUser1()
{
const bool state = (mDeleteCb->isChecked() || !mArchiveFile->lineEdit()->text().trimmed().isEmpty());
mUser1Button->setEnabled(state);
}
void ArchiveDialog::slotActionChanged()