1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

introduction of exporttemplatedialog

This commit is contained in:
Michail Vourlakos 2021-02-06 19:19:12 +02:00
parent c5c94a22cf
commit 674888800d
5 changed files with 252 additions and 0 deletions

View File

@ -38,6 +38,7 @@ add_subdirectory(wm/tracker)
set(latte_dbusXML dbus/org.kde.LatteDock.xml)
qt5_add_dbus_adaptor(lattedock-app_SRCS ${latte_dbusXML} lattecorona.h Latte::Corona lattedockadaptor)
ki18n_wrap_ui(lattedock-app_SRCS settings/dialogs/exporttemplatedialog.ui)
ki18n_wrap_ui(lattedock-app_SRCS settings/dialogs/detailsdialog.ui)
ki18n_wrap_ui(lattedock-app_SRCS settings/dialogs/settingsdialog.ui)

View File

@ -2,6 +2,7 @@ set(lattedock-app_SRCS
${lattedock-app_SRCS}
${CMAKE_CURRENT_SOURCE_DIR}/detailsdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/genericdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/exporttemplatedialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/settingsdialog.cpp
PARENT_SCOPE
)

View File

@ -0,0 +1,66 @@
/*
* 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/>.
*
*/
#include "exporttemplatedialog.h"
// local
#include "ui_exporttemplatedialog.h"
namespace Latte {
namespace Settings {
namespace Dialog {
ExportTemplateDialog::ExportTemplateDialog(SettingsDialog *parent)
: GenericDialog(parent),
m_parentDlg(parent),
m_ui(new Ui::ExportTemplateDialog)
{
//! first we need to setup the ui
m_ui->setupUi(this);
}
ExportTemplateDialog::~ExportTemplateDialog()
{
}
Ui::ExportTemplateDialog *ExportTemplateDialog::ui() const
{
return m_ui;
}
Latte::Corona *ExportTemplateDialog::corona() const
{
return m_parentDlg->corona();
}
void ExportTemplateDialog::accept()
{
qDebug() << Q_FUNC_INFO;
}
void ExportTemplateDialog::onCancel()
{
qDebug() << Q_FUNC_INFO;
close();
}
}
}
}

View File

@ -0,0 +1,67 @@
/*
* 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 EXPORTTEMPLATEDIALOG_H
#define EXPORTTEMPLATEDIALOG_H
// local
#include "genericdialog.h"
#include "settingsdialog.h"
// Qt
#include <QDialog>
#include <QObject>
namespace Ui {
class ExportTemplateDialog;
}
namespace Latte {
namespace Settings {
namespace Dialog {
class ExportTemplateDialog : public GenericDialog
{
Q_OBJECT
public:
ExportTemplateDialog(SettingsDialog *parent);
~ExportTemplateDialog();
Latte::Corona *corona() const;
Ui::ExportTemplateDialog *ui() const;
protected:
void accept() override;
private slots:
void onCancel();
private:
SettingsDialog *m_parentDlg{nullptr};
Ui::ExportTemplateDialog *m_ui;
};
}
}
}
#endif

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportTemplateDialog</class>
<widget class="QDialog" name="ExportTemplateDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>561</width>
<height>615</height>
</rect>
</property>
<property name="windowTitle">
<string>Personal Data</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="optionsLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;b&gt;Select only&lt;/b&gt; applets that you would like to keep their settings in the extracted template. Make sure to not include any applets that contain personal data such as email credentials, calendar etc. </string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="tableView"/>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DetailsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DetailsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>