2018-11-11 10:57:05 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/common/GroupSelectionBox.h *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2010, Retroshare Team <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* 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 Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
|
|
|
|
2012-11-02 13:26:20 -04:00
|
|
|
#include <QListWidget>
|
2016-10-31 11:28:26 -04:00
|
|
|
#include <QDialog>
|
2016-07-05 23:49:43 -04:00
|
|
|
#include <retroshare/rsids.h>
|
2012-11-02 13:26:20 -04:00
|
|
|
|
|
|
|
class GroupSelectionBox: public QListWidget
|
|
|
|
{
|
2012-11-08 19:46:41 -05:00
|
|
|
Q_OBJECT
|
2012-11-02 13:26:20 -04:00
|
|
|
|
2012-11-08 19:46:41 -05:00
|
|
|
public:
|
|
|
|
GroupSelectionBox(QWidget *parent);
|
2012-11-02 13:26:20 -04:00
|
|
|
|
2016-10-31 11:28:26 -04:00
|
|
|
static void selectGroups(const std::list<RsNodeGroupId>& default_groups) ;
|
|
|
|
|
2016-07-05 23:49:43 -04:00
|
|
|
void selectedGroupIds(std::list<RsNodeGroupId> &groupIds) const;
|
2012-11-08 19:46:41 -05:00
|
|
|
void selectedGroupNames(QList<QString> &groupNames) const;
|
|
|
|
|
2016-07-05 23:49:43 -04:00
|
|
|
void setSelectedGroupIds(const std::list<RsNodeGroupId> &groupIds);
|
2012-11-08 19:46:41 -05:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void fillGroups();
|
2012-11-02 13:26:20 -04:00
|
|
|
};
|
2016-10-31 11:28:26 -04:00
|
|
|
|
|
|
|
class GroupSelectionDialog: public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GroupSelectionDialog(QWidget *parent) ;
|
|
|
|
virtual ~GroupSelectionDialog() ;
|
|
|
|
|
|
|
|
static std::list<RsNodeGroupId> selectGroups(const std::list<RsNodeGroupId>& default_groups) ;
|
|
|
|
|
|
|
|
private:
|
|
|
|
GroupSelectionBox *mBox ;
|
|
|
|
};
|