support Latte::ImportExportState

pull/15/head
Michail Vourlakos 5 years ago
parent 552216d4d3
commit 0a4fd31f32

@ -3,6 +3,7 @@ set(lattedock-app_SRCS
infoview.cpp
lattecorona.cpp
screenpool.cpp
types.cpp
main.cpp
)

@ -251,7 +251,7 @@ QString Factory::uiPath(QString pluginName) const
return m_pluginUiPaths[pluginName];
}
Latte::Types::ImportExportState Factory::importIndicatorFile(QString compressedFile)
Latte::ImportExport::State Factory::importIndicatorFile(QString compressedFile)
{
auto showNotificationError = []() {
auto notification = new KNotification("import-fail", KNotification::CloseOnTimeout);
@ -281,7 +281,7 @@ Latte::Types::ImportExportState Factory::importIndicatorFile(QString compressedF
if (!tarArchive->isOpen()) {
delete tarArchive;
showNotificationError();
return Latte::Types::Failed;
return Latte::ImportExport::FailedState;
} else {
archive = tarArchive;
}
@ -329,11 +329,11 @@ Latte::Types::ImportExportState Factory::importIndicatorFile(QString compressedF
QString output(process.readAllStandardOutput());
showNotificationSucceed(metadata.name(), updated);
return Latte::Types::Installed;
return Latte::ImportExport::InstalledState;
}
showNotificationError();
return Latte::Types::Failed;
return Latte::ImportExport::FailedState;
}
void Factory::removeIndicator(QString id)

@ -20,14 +20,14 @@
#ifndef INDICATORFACTORY_H
#define INDICATORFACTORY_H
// local
#include "../types.h"
// Qt
#include <QHash>
#include <QObject>
#include <QWidget>
// Latte
#include <Latte>
class KPluginMetaData;
namespace Latte {
@ -62,7 +62,7 @@ public:
static bool metadataAreValid(QString &file);
//! imports an indicator compressed file
static Latte::Types::ImportExportState importIndicatorFile(QString compressedFile);
static Latte::ImportExport::State importIndicatorFile(QString compressedFile);
signals:
void indicatorChanged(const QString &indicatorId);
void indicatorRemoved(const QString &indicatorId);

@ -0,0 +1,21 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
*
* This file is part of Latte-Dock
*
* Latte-Dock 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.
*
* Latte-Dock 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, see <http://www.gnu.org/licenses/>.
*/
#include "types.h"

@ -0,0 +1,42 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
*
* This file is part of Latte-Dock
*
* Latte-Dock 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.
*
* Latte-Dock 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef LATTEAPPLOCALTYPES_H
#define LATTEAPPLOCALTYPES_H
// Qt
#include <QObject>
namespace Latte {
namespace ImportExport {
Q_NAMESPACE
enum State
{
FailedState = 0,
UpdatedState = 2,
InstalledState = 4
};
Q_ENUM_NS(State);
}
}
#endif
Loading…
Cancel
Save