Commit cb87e9b7 authored by Laurent Montel's avatar Laurent Montel 😁

Remove storageservice as it's broken and it will be rewrite

parent 9ed80059
......@@ -64,7 +64,6 @@ set(kmailprivate_configuredialog_LIB_SRCS
configuredialog/configureaccountpage.cpp
configuredialog/colorlistbox.cpp
configuredialog/configureagentswidget.cpp
configuredialog/configurestorageservicewidget.cpp
configuredialog/configureagents/configureagentlistmodel.cpp
configuredialog/configureagents/configureagentlistdelegate.cpp
configuredialog/configureagents/configureagentlistview.cpp
......@@ -79,9 +78,6 @@ set(kmailprivate_searchdialog_LIB_SRCS
searchdialog/searchwindow.cpp
searchdialog/searchdescriptionattribute.cpp
)
set(kmailprivate_storageservice_LIB_SRCS
storageservice/storageservicesettingsjob.cpp
)
set(kmailprivate_identity_LIB_SRCS
identity/identitylistview.cpp
identity/identitydialog.cpp
......@@ -103,7 +99,6 @@ set(kmailprivate_editor_LIB_SRCS
editor/attachment/attachmentcontroller.cpp
editor/attachment/attachmentview.cpp
editor/widgets/cryptostateindicatorwidget.cpp
editor/storageservice/kmstorageservice.cpp
editor/validatesendmailshortcut.cpp
editor/kmcomposerglobalaction.cpp
)
......@@ -203,7 +198,6 @@ set(kmailprivate_LIB_SRCS
${kmailprivate_collectionpage_LIB_SRCS}
${kmailprivate_configuredialog_LIB_SRCS}
${kmailprivate_searchdialog_LIB_SRCS}
${kmailprivate_storageservice_LIB_SRCS}
${kmailprivate_identity_LIB_SRCS}
${kmailprivate_editor_LIB_SRCS}
${kmailprivate_editor_potentialphishingemail_SRCS}
......
......@@ -17,7 +17,6 @@
#include "configurecomposerpage.h"
#include "PimCommon/ConfigureImmutableWidgetUtils"
#include "configurestorageservicewidget.h"
using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include "kmkernel.h"
#include "kmmainwidget.h"
......@@ -1301,11 +1300,6 @@ ComposerPageAttachmentsTab::ComposerPageAttachmentsTab(QWidget *parent)
layAttachment->addWidget(mMaximumAttachmentSize);
vlay->addLayout(layAttachment);
mStorageServiceWidget = new ConfigureStorageServiceWidget;
//Laurent disable until we fix it.
mStorageServiceWidget->hide();
vlay->addWidget(mStorageServiceWidget);
//Disable it connect(mStorageServiceWidget, &ConfigureStorageServiceWidget::changed, this, &ConfigModuleTab::slotEmitChanged);
}
void ComposerPage::AttachmentsTab::doLoadFromGlobalSettings()
......@@ -1315,7 +1309,6 @@ void ComposerPage::AttachmentsTab::doLoadFromGlobalSettings()
loadWidget(mAttachWordsListEditor, KMailSettings::self()->attachmentKeywordsItem());
const int maximumAttachmentSize(MessageCore::MessageCoreSettings::self()->maximumAttachmentSize());
mMaximumAttachmentSize->setValue(maximumAttachmentSize == -1 ? -1 : MessageCore::MessageCoreSettings::self()->maximumAttachmentSize() / 1024);
mStorageServiceWidget->doLoadFromGlobalSettings();
}
void ComposerPage::AttachmentsTab::save()
......@@ -1327,7 +1320,6 @@ void ComposerPage::AttachmentsTab::save()
KMime::setUseOutlookAttachmentEncoding(mOutlookCompatibleCheck->isChecked());
const int maximumAttachmentSize(mMaximumAttachmentSize->value());
MessageCore::MessageCoreSettings::self()->setMaximumAttachmentSize(maximumAttachmentSize == -1 ? -1 : maximumAttachmentSize * 1024);
mStorageServiceWidget->save();
}
void ComposerPageAttachmentsTab::slotOutlookCompatibleClicked()
......
......@@ -30,7 +30,6 @@ class QLineEdit;
class ListView;
class QPushButton;
class QLabel;
class ConfigureStorageServiceWidget;
class KPluralHandlingSpinBox;
namespace TemplateParser
{
......@@ -230,7 +229,6 @@ private:
QCheckBox *mMissingAttachmentDetectionCheck;
PimCommon::SimpleStringListEditor *mAttachWordsListEditor;
QSpinBox *mMaximumAttachmentSize;
ConfigureStorageServiceWidget *mStorageServiceWidget;
};
class ComposerPageAutoCorrectionTab : public ConfigModuleTab
......
/*
Copyright (c) 2014-2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
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
*/
#include "configurestorageservicewidget.h"
#include "kmkernel.h"
#include "settings/kmailsettings.h"
#include "PimCommon/StorageServiceSettingsWidget"
#include "PimCommon/ConfigureImmutableWidgetUtils"
using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include <KLocalizedString>
#include <KMessageBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QCheckBox>
#include <QProcess>
#include <QPushButton>
#include <QStandardPaths>
ConfigureStorageServiceWidget::ConfigureStorageServiceWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *lay = new QVBoxLayout;
mStorageServiceWidget = new PimCommon::StorageServiceSettingsWidget;
connect(mStorageServiceWidget, &PimCommon::StorageServiceSettingsWidget::changed, this, &ConfigureStorageServiceWidget::changed);
lay->addWidget(mStorageServiceWidget);
QHBoxLayout *hbox = new QHBoxLayout;
mManageStorageService = new QPushButton(i18n("Manage Storage Service"));
hbox->addWidget(mManageStorageService);
hbox->addStretch();
lay->addLayout(hbox);
if (QStandardPaths::findExecutable(QStringLiteral("storageservicemanager")).isEmpty()) {
mManageStorageService->setEnabled(false);
} else {
connect(mManageStorageService, &QPushButton::clicked, this, &ConfigureStorageServiceWidget::slotManageStorageService);
}
QList<PimCommon::StorageServiceAbstract::Capability> lstCapabilities;
lstCapabilities << PimCommon::StorageServiceAbstract::ShareLinkCapability;
if (KMKernel::self() && KMKernel::self()->storageServiceManager()) {
mStorageServiceWidget->setListService(KMKernel::self()->storageServiceManager()->listService(), lstCapabilities);
} else {
mStorageServiceWidget->setEnabled(false);
}
setLayout(lay);
}
ConfigureStorageServiceWidget::~ConfigureStorageServiceWidget()
{
}
void ConfigureStorageServiceWidget::slotManageStorageService()
{
if (!QProcess::startDetached(QStringLiteral("storageservicemanager")))
KMessageBox::error(this, i18n("Could not start storage service manager; "
"please check your installation."),
i18n("KMail Error"));
}
void ConfigureStorageServiceWidget::save()
{
if (KMKernel::self() && KMKernel::self()->storageServiceManager()) {
KMKernel::self()->storageServiceManager()->setListService(mStorageServiceWidget->listService());
}
}
void ConfigureStorageServiceWidget::doLoadFromGlobalSettings()
{
}
/*
Copyright (c) 2014-2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
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
*/
#ifndef CONFIGURESTORAGESERVICEWIDGET_H
#define CONFIGURESTORAGESERVICEWIDGET_H
#include <QWidget>
class QPushButton;
namespace PimCommon
{
class StorageServiceSettingsWidget;
}
class ConfigureStorageServiceWidget : public QWidget
{
Q_OBJECT
public:
explicit ConfigureStorageServiceWidget(QWidget *parent = Q_NULLPTR);
~ConfigureStorageServiceWidget();
void save();
void doLoadFromGlobalSettings();
Q_SIGNALS:
void changed();
private Q_SLOTS:
void slotManageStorageService();
private:
PimCommon::StorageServiceSettingsWidget *mStorageServiceWidget;
QPushButton *mManageStorageService;
};
#endif // CONFIGURESTORAGESERVICEWIDGET_H
......@@ -61,7 +61,6 @@
#include "widgets/cryptostateindicatorwidget.h"
#include "validatesendmailshortcut.h"
#include "job/saveasfilejob.h"
#include "editor/storageservice/kmstorageservice.h"
#include "messagecomposer/followupreminderselectdatedialog.h"
#include "messagecomposer/followupremindercreatejob.h"
#include "FollowupReminder/FollowUpReminderUtil"
......@@ -241,7 +240,6 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
mCheckForForgottenAttachments(true),
mWasModified(false),
mCryptoStateIndicatorWidget(Q_NULLPTR),
mStorageService(new KMStorageService(this, this)),
mSendNowByShortcutUsed(false),
mFollowUpToggleAction(Q_NULLPTR),
mStatusBarLabelToggledOverrideMode(Q_NULLPTR),
......@@ -477,8 +475,6 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
mDummyComposer = new MessageComposer::Composer(this);
mDummyComposer->globalPart()->setParentWidgetForGui(this);
connect(mStorageService, &KMStorageService::insertShareLink, this, &KMComposerWin::slotShareLinkDone);
}
KMComposerWin::~KMComposerWin()
......@@ -1289,7 +1285,6 @@ void KMComposerWin::setupActions(void)
mComposerBase->editor()->createActions(actionCollection());
//actionCollection()->addActions(mComposerBase->editor()->createActions());
actionCollection()->addAction(QStringLiteral("shared_link"), mStorageService->menuShareLinkServices());
mFollowUpToggleAction = new KToggleAction(i18n("Follow Up Mail..."), this);
actionCollection()->addAction(QStringLiteral("follow_up_mail"), mFollowUpToggleAction);
......@@ -2376,12 +2371,6 @@ void KMComposerWin::printComposeResult(KJob *job, bool preview)
void KMComposerWin::doSend(MessageComposer::MessageSender::SendMethod method,
MessageComposer::MessageSender::SaveIn saveIn)
{
if (mStorageService->numProgressUpdateFile() > 0) {
KMessageBox::sorry(this, i18np("There is %1 file upload in progress.",
"There are %1 file uploads in progress.",
mStorageService->numProgressUpdateFile()));
return;
}
// TODO integrate with MDA online status
if (method == MessageComposer::MessageSender::SendImmediate) {
if (!MessageComposer::Util::sendMailDispatcherIsOnline()) {
......
......@@ -105,7 +105,6 @@ namespace PimCommon
class CustomToolsWidgetNg;
class LineEditWithAutoCorrection;
}
class KMStorageService;
//-----------------------------------------------------------------------------
class KMComposerWin : public KMail::Composer
{
......@@ -616,7 +615,6 @@ private:
bool mCheckForForgottenAttachments;
bool mWasModified;
CryptoStateIndicatorWidget *mCryptoStateIndicatorWidget;
KMStorageService *mStorageService;
bool mSendNowByShortcutUsed;
QList<QLabel *> mStatusBarLabelList;
KSplitterCollapserButton *mSnippetSplitterCollapser;
......
/*
Copyright (c) 2014-2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
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
*/
#include "kmstorageservice.h"
#include "PimCommon/StorageServiceManager"
#include <KMessageBox>
#include <KLocalizedString>
#include <KActionMenu>
KMStorageService::KMStorageService(QWidget *parentWidget, QObject *parent)
: QObject(parent),
mParentWidget(parentWidget),
mNumProgressUploadFile(0),
mStorageManager(new PimCommon::StorageServiceManager(this))
{
connect(mStorageManager, &PimCommon::StorageServiceManager::uploadFileDone, this, &KMStorageService::slotUploadFileDone);
connect(mStorageManager, &PimCommon::StorageServiceManager::uploadFileFailed, this, &KMStorageService::slotUploadFileFailed);
connect(mStorageManager, &PimCommon::StorageServiceManager::shareLinkDone, this, &KMStorageService::slotShareLinkDone);
connect(mStorageManager, &PimCommon::StorageServiceManager::uploadFileStart, this, &KMStorageService::slotUploadFileStart);
connect(mStorageManager, &PimCommon::StorageServiceManager::actionFailed, this, &KMStorageService::slotActionFailed);
}
KMStorageService::~KMStorageService()
{
}
void KMStorageService::slotUploadFileDone(const QString &serviceName, const QString &fileName)
{
Q_UNUSED(serviceName);
Q_UNUSED(fileName);
}
void KMStorageService::slotUploadFileFailed(const QString &serviceName, const QString &fileName)
{
Q_UNUSED(serviceName);
Q_UNUSED(fileName);
KMessageBox::error(mParentWidget, i18n("An error occurred while sending the file."), i18n("Upload file"));
--mNumProgressUploadFile;
}
void KMStorageService::slotShareLinkDone(const QString &serviceName, const QString &link)
{
Q_UNUSED(serviceName);
Q_EMIT insertShareLink(link);
--mNumProgressUploadFile;
}
void KMStorageService::slotUploadFileStart(PimCommon::StorageServiceAbstract *service)
{
Q_UNUSED(service);
++mNumProgressUploadFile;
}
void KMStorageService::slotActionFailed(const QString &serviceName, const QString &error)
{
KMessageBox::error(mParentWidget, i18n("%1 return an error '%2'", serviceName, error), i18n("Error"));
--mNumProgressUploadFile;
}
KActionMenu *KMStorageService::menuShareLinkServices() const
{
return mStorageManager->menuShareLinkServices(mParentWidget);
}
int KMStorageService::numProgressUpdateFile() const
{
return mNumProgressUploadFile;
}
/*
Copyright (c) 2014-2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
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
*/
#ifndef KMSTORAGESERVICE_H
#define KMSTORAGESERVICE_H
#include <QObject>
namespace PimCommon
{
class StorageServiceManager;
class StorageServiceAbstract;
}
class KActionMenu;
class KMStorageService : public QObject
{
Q_OBJECT
public:
explicit KMStorageService(QWidget *parentWidget, QObject *parent = Q_NULLPTR);
~KMStorageService();
KActionMenu *menuShareLinkServices() const;
int numProgressUpdateFile() const;
Q_SIGNALS:
void insertShareLink(const QString &link);
private Q_SLOTS:
void slotUploadFileDone(const QString &serviceName, const QString &fileName);
void slotUploadFileFailed(const QString &serviceName, const QString &fileName);
void slotShareLinkDone(const QString &serviceName, const QString &link);
void slotUploadFileStart(PimCommon::StorageServiceAbstract *service);
void slotActionFailed(const QString &serviceName, const QString &error);
private:
QWidget *mParentWidget;
int mNumProgressUploadFile;
PimCommon::StorageServiceManager *mStorageManager;
};
#endif // KMSTORAGESERVICE_H
......@@ -25,10 +25,6 @@ using KPIM::RecentAddresses;
#include "mailcommonsettings_base.h"
#include "PimCommon/PimUtil"
#include "folderarchive/folderarchivemanager.h"
#include "PimCommon/StorageServiceManager"
#include "PimCommon/StorageServiceJobConfig"
#include "storageservice/storageservicesettingsjob.h"
// kdepim includes
#include "kmail-version.h"
......@@ -231,10 +227,6 @@ KMKernel::KMKernel(QObject *parent) :
CommonKernel->registerSettingsIf(this);
CommonKernel->registerFilterIf(this);
mFolderArchiveManager = new FolderArchiveManager(this);
mStorageManager = new PimCommon::StorageServiceManager(this);
StorageServiceSettingsJob *settingsJob = new StorageServiceSettingsJob;
PimCommon::StorageServiceJobConfig *configJob = PimCommon::StorageServiceJobConfig::self();
configJob->registerConfigIf(settingsJob);
}
KMKernel::~KMKernel()
......@@ -2182,11 +2174,6 @@ FolderArchiveManager *KMKernel::folderArchiveManager() const
return mFolderArchiveManager;
}
PimCommon::StorageServiceManager *KMKernel::storageServiceManager() const
{
return mStorageManager;
}
bool KMKernel::allowToDebugBalooSupport() const
{
return mDebugBaloo;
......
......@@ -42,7 +42,6 @@ class MessageSender;
namespace PimCommon
{
class AutoCorrection;
class StorageServiceManager;
}
/** The KMail namespace contains classes used for KMail.
......@@ -468,7 +467,6 @@ public:
void toggleSystemTray();
FolderArchiveManager *folderArchiveManager() const;
PimCommon::StorageServiceManager *storageServiceManager() const;
bool allowToDebugBalooSupport() const;
......@@ -595,7 +593,6 @@ private:
QPointer<MailCommon::KMFilterDialog> mFilterEditDialog;
PimCommon::AutoCorrection *mAutoCorrection;
FolderArchiveManager *mFolderArchiveManager;
PimCommon::StorageServiceManager *mStorageManager;
bool mDebugBaloo;
};
......
/*
Copyright (c) 2014-2016 Montel Laurent <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "storageservicesettingsjob.h"
using namespace PimCommon;
StorageServiceSettingsJob::StorageServiceSettingsJob()
{
}
StorageServiceSettingsJob::~StorageServiceSettingsJob()
{
}
QString StorageServiceSettingsJob::youSendItApiKey() const
{
//TODO customize it
return QStringLiteral("fnab8fkgwrka7v6zs2ycd34a");
}
QString StorageServiceSettingsJob::dropboxOauthConsumerKey() const
{
//TODO customize it
return QStringLiteral("e40dvomckrm48ci");
}
QString StorageServiceSettingsJob::dropboxOauthSignature() const
{
//TODO customize it
return QStringLiteral("0icikya464lny9g&");
}
QString StorageServiceSettingsJob::boxClientId() const
{
return QStringLiteral("o4sn4e0dvz50pd3ps6ao3qxehvqv8dyo");
}
QString StorageServiceSettingsJob::boxClientSecret() const
{
return QStringLiteral("wLdaOgrblYzi1Y6WN437wStvqighmSJt");
}
QString StorageServiceSettingsJob::hubicClientId() const
{
return QStringLiteral("api_hubic_zBKQ6UDUj2vDT7ciDsgjmXA78OVDnzJi");
}
QString StorageServiceSettingsJob::hubicClientSecret() const
{
return QStringLiteral("pkChgk2sRrrCEoVHmYYCglEI9E2Y2833Te5Vn8n2J6qPdxLU6K8NPUvzo1mEhyzf");
}
QString StorageServiceSettingsJob::dropboxRootPath() const
{
return QStringLiteral("dropbox");
}
QString StorageServiceSettingsJob::oauth2RedirectUrl() const
{
return QStringLiteral("https://bugs.kde.org/");
}
QString StorageServiceSettingsJob::hubicScope() const
{
return QStringLiteral("usage.r,account.r,credentials.r,links.wd");
}
QString StorageServiceSettingsJob::gdriveClientId() const
{
//TODO
return QString();
}
QString StorageServiceSettingsJob::gdriveClientSecret() const
{
//TODO
return QString();
}
QString StorageServiceSettingsJob::defaultUploadFolder() const
{
return QString(); //QStringLiteral("KMail Attachment");
}
/*
Copyright (c) 2014-2016 Montel Laurent <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef StorageServiceSettingsJob_H
#define StorageServiceSettingsJob_H
#include <QObject>
#include "pimcommon/isettingsjob.h"
class StorageServiceSettingsJob : public PimCommon::ISettingsJob
{
public:
StorageServiceSettingsJob();
~StorageServiceSettingsJob();
QString youSendItApiKey() const Q_DECL_OVERRIDE;
QString dropboxOauthConsumerKey() const Q_DECL_OVERRIDE;
QString dropboxOauthSignature() const Q_DECL_OVERRIDE;
QString boxClientId() const Q_DECL_OVERRIDE;
QString boxClientSecret() const Q_DECL_OVERRIDE;
QString hubicClientId() const Q_DECL_OVERRIDE;
QString hubicClientSecret() const Q_DECL_OVERRIDE;
QString dropboxRootPath() const Q_DECL_OVERRIDE;
QString oauth2RedirectUrl() const Q_DECL_OVERRIDE;
QString hubicScope() const Q_DECL_OVERRIDE;
QString gdriveClientId() const Q_DECL_OVERRIDE;
QString gdriveClientSecret() const Q_DECL_OVERRIDE;
QString defaultUploadFolder() const Q_DECL_OVERRIDE;
};
#endif // StorageServiceSettingsJob_H
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