• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kmail

  • sources
  • kde-4.14
  • kdepim
  • kmail
  • configuredialog
configurestorageservicewidget.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2014-2015 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include "configurestorageservicewidget.h"
19 #include "kmkernel.h"
20 #include "settings/globalsettings.h"
21 #include "pimcommon/storageservice/settings/storageservicesettingswidget.h"
22 #include "pimcommon/widgets/configureimmutablewidgetutils.h"
23 using namespace PimCommon::ConfigureImmutableWidgetUtils;
24 
25 #include <KLocalizedString>
26 #include <KStandardDirs>
27 #include <KMessageBox>
28 
29 #include <QVBoxLayout>
30 #include <QHBoxLayout>
31 #include <QCheckBox>
32 #include <QSpinBox>
33 #include <QProcess>
34 #include <QPushButton>
35 
36 ConfigureStorageServiceWidget::ConfigureStorageServiceWidget(QWidget *parent)
37  : QWidget(parent)
38 {
39  QVBoxLayout *lay = new QVBoxLayout;
40  mStorageServiceWidget = new PimCommon::StorageServiceSettingsWidget;
41  connect(mStorageServiceWidget, SIGNAL(changed()), this, SIGNAL(changed()));
42  lay->addWidget(mStorageServiceWidget);
43 
44  QHBoxLayout *hbox = new QHBoxLayout;
45  mManageStorageService = new QPushButton(i18n("Manage Storage Service"));
46  hbox->addWidget(mManageStorageService);
47  hbox->addStretch();
48  lay->addLayout(hbox);
49  if (KStandardDirs::findExe(QLatin1String("storageservicemanager")).isEmpty()) {
50  mManageStorageService->setEnabled(false);
51  } else {
52  connect(mManageStorageService, SIGNAL(clicked(bool)), this, SLOT(slotManageStorageService()));
53  }
54  QList<PimCommon::StorageServiceAbstract::Capability> lstCapabilities;
55  lstCapabilities << PimCommon::StorageServiceAbstract::ShareLinkCapability;
56  if (KMKernel::self() && KMKernel::self()->storageServiceManager()) {
57  mStorageServiceWidget->setListService(KMKernel::self()->storageServiceManager()->listService(), lstCapabilities);
58  } else {
59  mStorageServiceWidget->setEnabled(false);
60  }
61  setLayout(lay);
62 }
63 
64 ConfigureStorageServiceWidget::~ConfigureStorageServiceWidget()
65 {
66 }
67 
68 void ConfigureStorageServiceWidget::slotManageStorageService()
69 {
70  if ( !QProcess::startDetached(QLatin1String("storageservicemanager") ) )
71  KMessageBox::error( this, i18n( "Could not start storage service manager; "
72  "please check your installation." ),
73  i18n( "KMail Error" ) );
74 }
75 
76 void ConfigureStorageServiceWidget::save()
77 {
78  if (KMKernel::self() && KMKernel::self()->storageServiceManager())
79  KMKernel::self()->storageServiceManager()->setListService(mStorageServiceWidget->listService());
80 }
81 
82 void ConfigureStorageServiceWidget::doLoadFromGlobalSettings()
83 {
84 }
globalsettings.h
QWidget
QProcess::startDetached
bool startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
KMKernel::storageServiceManager
PimCommon::StorageServiceManager * storageServiceManager() const
Definition: kmkernel.cpp:2080
QHBoxLayout
KMKernel::self
static KMKernel * self()
normal control stuff
Definition: kmkernel.cpp:1471
QWidget::setEnabled
void setEnabled(bool)
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QWidget::setLayout
void setLayout(QLayout *layout)
QVBoxLayout
QList
ConfigureStorageServiceWidget::~ConfigureStorageServiceWidget
~ConfigureStorageServiceWidget()
Definition: configurestorageservicewidget.cpp:64
ConfigureStorageServiceWidget::doLoadFromGlobalSettings
void doLoadFromGlobalSettings()
Definition: configurestorageservicewidget.cpp:82
ConfigureStorageServiceWidget::changed
void changed()
kmkernel.h
ConfigureStorageServiceWidget::save
void save()
Definition: configurestorageservicewidget.cpp:76
QLatin1String
QBoxLayout::addStretch
void addStretch(int stretch)
configurestorageservicewidget.h
QPushButton
ConfigureStorageServiceWidget::ConfigureStorageServiceWidget
ConfigureStorageServiceWidget(QWidget *parent=0)
Definition: configurestorageservicewidget.cpp:36
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QBoxLayout::addLayout
void addLayout(QLayout *layout, int stretch)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal