28 #include "pimcommon/folderdialog/checkedcollectionwidget.h"
30 #include <Akonadi/ETMViewStateSaver>
31 #include <KMime/KMimeMessage>
34 #include <KAcceleratorManager>
35 #include <KCheckableProxyModel>
36 #include <KComponentData>
39 #include <KLocalizedString>
44 #include <QVBoxLayout>
50 KComponentData inst(
"kcmkmailsummary" );
60 connect( mCheckedCollectionWidget->folderTreeView(), SIGNAL(clicked(
QModelIndex)),
62 connect( mFullPath, SIGNAL(toggled(
bool)), SLOT(modified()) );
64 KAcceleratorManager::manage(
this );
69 new KAboutData( I18N_NOOP(
"kcmkmailsummary" ), 0,
70 ki18n(
"Mail Summary Configuration Dialog" ),
71 0, KLocalizedString(), KAboutData::License_GPL,
72 ki18n(
"Copyright © 2004–2010 Tobias Koenig" ) );
74 about->addAuthor( ki18n(
"Tobias Koenig" ),
75 KLocalizedString(),
"tokoe@kde.org" );
76 setAboutData( about );
79 void KCMKMailSummary::modified()
84 void KCMKMailSummary::initGUI()
90 mCheckedCollectionWidget =
new PimCommon::CheckedCollectionWidget(KMime::Message::mimeType());
92 mFullPath =
new QCheckBox( i18n(
"Show full path for folders" ),
this );
94 i18nc(
"@info:tooltip",
"Show full path for each folder" ) );
96 i18nc(
"@info:whatsthis",
97 "Enable this option if you want to see the full path "
98 "for each folder listed in the summary. If this option is "
99 "not enabled, then only the base folder path will be shown." ) );
100 layout->
addWidget( mCheckedCollectionWidget );
104 void KCMKMailSummary::initFolders()
106 KSharedConfigPtr _config = KSharedConfig::openConfig(
QLatin1String(
"kcmkmailsummaryrc") );
109 new KViewStateMaintainer<Akonadi::ETMViewStateSaver>( _config->group(
"CheckState" ), this );
110 mModelState->setSelectionModel( mCheckedCollectionWidget->selectionModel() );
113 void KCMKMailSummary::loadFolders()
116 KConfigGroup config(&_config,
"General" );
117 mModelState->restoreState();
118 const bool showFolderPaths = config.readEntry(
"showFolderPaths",
false );
122 void KCMKMailSummary::storeFolders()
125 KConfigGroup config(&_config,
"General" );
126 mModelState->saveState();
127 config.writeEntry(
"showFolderPaths", mFullPath->
isChecked() );
136 emit changed(
false );
143 emit changed(
false );
150 emit changed(
true );
KCModule * create_kmailsummary(QWidget *parent, const char *)
KCMKMailSummary(const KComponentData &inst, QWidget *parent=0)
void setMargin(int margin)
void setSpacing(int spacing)