You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.5 KiB
C
106 lines
2.5 KiB
C
4 years ago
|
/*
|
||
|
* Copyright 2021 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 EXPORTTEMPLATEHANDLER_H
|
||
|
#define EXPORTTEMPLATEHANDLER_H
|
||
|
|
||
|
// local
|
||
4 years ago
|
#include "../generic/generichandler.h"
|
||
4 years ago
|
#include "../../data/appletdata.h"
|
||
|
|
||
|
// Qt
|
||
|
#include <QButtonGroup>
|
||
|
#include <QSortFilterProxyModel>
|
||
|
|
||
|
namespace Ui {
|
||
|
class ExportTemplateDialog;
|
||
|
}
|
||
|
|
||
|
namespace Latte{
|
||
4 years ago
|
class View;
|
||
4 years ago
|
namespace Settings{
|
||
|
namespace Dialog{
|
||
|
class ExportTemplateDialog;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
namespace Latte{
|
||
|
namespace Settings{
|
||
|
namespace Model {
|
||
|
class Applets;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
namespace Latte {
|
||
|
namespace Settings {
|
||
|
namespace Handler {
|
||
|
|
||
|
//! Handlers are objects to handle the UI elements that semantically associate with specific
|
||
|
//! ui::tabs or different windows. They are responsible also to handle the user interaction
|
||
|
//! between controllers and views
|
||
|
|
||
|
class ExportTemplateHandler : public Generic
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
ExportTemplateHandler(Dialog::ExportTemplateDialog *parentDialog);
|
||
4 years ago
|
ExportTemplateHandler(Dialog::ExportTemplateDialog *parentDialog, const QString &layoutName, const QString &layoutId);
|
||
|
ExportTemplateHandler(Dialog::ExportTemplateDialog *parentDialog, Latte::View *view);
|
||
4 years ago
|
~ExportTemplateHandler();
|
||
|
|
||
|
bool dataAreChanged() const override;
|
||
|
bool inDefaultValues() const override;
|
||
|
|
||
|
void reset() override;
|
||
|
void resetDefaults() override;
|
||
|
void save() override;
|
||
|
|
||
|
Latte::Data::AppletsTable currentData() const;
|
||
|
|
||
|
private:
|
||
|
void init();
|
||
4 years ago
|
void initDefaults();
|
||
|
|
||
4 years ago
|
void loadLayoutApplets(const QString &layoutName, const QString &layoutId);
|
||
|
void loadViewApplets(Latte::View *view);
|
||
4 years ago
|
|
||
4 years ago
|
private slots:
|
||
|
void onReset();
|
||
4 years ago
|
void onSelectAll();
|
||
|
void onDeselectAll();
|
||
4 years ago
|
|
||
4 years ago
|
private:
|
||
|
Dialog::ExportTemplateDialog *m_parentDialog{nullptr};
|
||
|
Ui::ExportTemplateDialog *m_ui{nullptr};
|
||
|
|
||
|
//! current data
|
||
|
Model::Applets *m_appletsModel{nullptr};
|
||
|
QSortFilterProxyModel *m_appletsProxyModel{nullptr};
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|