2011-12-27 09:49:06 -05:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 Felix Geyer <debfx@fobos.de>
|
|
|
|
*
|
|
|
|
* This program 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 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-04-18 16:08:22 -04:00
|
|
|
#ifndef KEEPASSX_EDITGROUPWIDGET_H
|
|
|
|
#define KEEPASSX_EDITGROUPWIDGET_H
|
2011-12-27 09:49:06 -05:00
|
|
|
|
2013-10-03 09:18:16 -04:00
|
|
|
#include <QComboBox>
|
|
|
|
#include <QScopedPointer>
|
2012-04-24 07:23:09 -04:00
|
|
|
|
2011-12-27 09:49:06 -05:00
|
|
|
#include "core/Group.h"
|
2012-05-20 17:08:23 -04:00
|
|
|
#include "gui/EditWidget.h"
|
2011-12-27 09:49:06 -05:00
|
|
|
|
2012-05-15 07:31:56 -04:00
|
|
|
class EditWidgetIcons;
|
2012-10-29 17:41:37 -04:00
|
|
|
class EditWidgetProperties;
|
2012-05-15 07:31:56 -04:00
|
|
|
|
2011-12-27 09:49:06 -05:00
|
|
|
namespace Ui {
|
2012-05-14 13:10:54 -04:00
|
|
|
class EditGroupWidgetMain;
|
|
|
|
class EditWidget;
|
2011-12-27 09:49:06 -05:00
|
|
|
}
|
|
|
|
|
2012-05-14 13:10:54 -04:00
|
|
|
class EditGroupWidget : public EditWidget
|
2011-12-27 09:49:06 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-07-24 12:28:12 -04:00
|
|
|
explicit EditGroupWidget(QWidget* parent = nullptr);
|
2011-12-27 09:49:06 -05:00
|
|
|
~EditGroupWidget();
|
|
|
|
|
2012-05-15 07:31:56 -04:00
|
|
|
void loadGroup(Group* group, bool create, Database* database);
|
2015-01-11 10:20:59 -05:00
|
|
|
void clear();
|
2011-12-27 09:49:06 -05:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void editFinished(bool accepted);
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void save();
|
|
|
|
void cancel();
|
|
|
|
|
|
|
|
private:
|
2014-04-26 12:33:09 -04:00
|
|
|
void addTriStateItems(QComboBox* comboBox, bool inheritValue);
|
2012-10-20 11:53:33 -04:00
|
|
|
int indexFromTriState(Group::TriState triState);
|
|
|
|
Group::TriState triStateFromIndex(int index);
|
|
|
|
|
2012-05-14 13:10:54 -04:00
|
|
|
const QScopedPointer<Ui::EditGroupWidgetMain> m_mainUi;
|
2012-05-15 06:39:26 -04:00
|
|
|
QWidget* const m_editGroupWidgetMain;
|
2012-05-15 07:31:56 -04:00
|
|
|
EditWidgetIcons* const m_editGroupWidgetIcons;
|
2012-10-29 17:41:37 -04:00
|
|
|
EditWidgetProperties* const m_editWidgetProperties;
|
2011-12-27 09:49:06 -05:00
|
|
|
Group* m_group;
|
2012-05-15 10:50:42 -04:00
|
|
|
Database* m_database;
|
2011-12-27 09:49:06 -05:00
|
|
|
|
|
|
|
Q_DISABLE_COPY(EditGroupWidget)
|
|
|
|
};
|
|
|
|
|
2012-04-18 16:08:22 -04:00
|
|
|
#endif // KEEPASSX_EDITGROUPWIDGET_H
|