2018-12-25 21:34:59 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/ShareManager.h *
|
|
|
|
* *
|
|
|
|
* Copyright (c) 2006 Crypton <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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2008-12-11 01:19:34 +00:00
|
|
|
|
|
|
|
#ifndef _SHAREMANAGER_H
|
|
|
|
#define _SHAREMANAGER_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
2016-10-31 16:28:26 +01:00
|
|
|
#include <retroshare/rsfiles.h>
|
2008-12-11 01:19:34 +00:00
|
|
|
#include "ui_ShareManager.h"
|
|
|
|
|
|
|
|
class ShareManager : public QDialog
|
|
|
|
{
|
2010-09-17 18:27:30 +00:00
|
|
|
Q_OBJECT
|
2008-12-11 01:19:34 +00:00
|
|
|
|
2010-09-17 18:27:30 +00:00
|
|
|
public:
|
|
|
|
static void showYourself() ;
|
|
|
|
static void postModDirectories(bool update_local);
|
2009-08-03 19:43:52 +00:00
|
|
|
|
|
|
|
private:
|
2010-09-17 18:27:30 +00:00
|
|
|
/** Default constructor */
|
2012-11-06 23:26:47 +00:00
|
|
|
ShareManager();
|
2010-09-17 18:27:30 +00:00
|
|
|
/** Default destructor */
|
|
|
|
~ShareManager();
|
2010-04-08 16:33:10 +00:00
|
|
|
|
2010-09-17 18:27:30 +00:00
|
|
|
/** Loads the settings for this page */
|
|
|
|
void load();
|
2010-04-08 16:33:10 +00:00
|
|
|
|
2008-12-11 01:19:34 +00:00
|
|
|
protected:
|
2010-09-17 18:27:30 +00:00
|
|
|
virtual void showEvent(QShowEvent * event);
|
2009-01-01 17:47:35 +00:00
|
|
|
|
2011-04-26 23:38:29 +00:00
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
virtual void dropEvent(QDropEvent *event);
|
|
|
|
|
2008-12-11 01:19:34 +00:00
|
|
|
private slots:
|
2010-09-17 18:27:30 +00:00
|
|
|
/** Create the context popup menu and it's submenus */
|
2010-09-18 16:05:32 +00:00
|
|
|
void shareddirListCurrentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
|
2016-11-03 20:26:35 +01:00
|
|
|
void shareddirListCustomPopupMenu( QPoint point );
|
2016-10-31 16:28:26 +01:00
|
|
|
void addShare();
|
|
|
|
void doubleClickedCell(int,int);
|
2016-11-01 11:11:28 +01:00
|
|
|
void handleCellChange(int row,int column);
|
2016-11-03 20:26:35 +01:00
|
|
|
void editShareDirectory();
|
2008-12-11 01:19:34 +00:00
|
|
|
|
2010-09-17 18:27:30 +00:00
|
|
|
void removeShareDirectory();
|
2012-11-02 13:52:29 +00:00
|
|
|
void updateFlags();
|
2016-10-31 16:28:26 +01:00
|
|
|
void applyAndClose() ;
|
|
|
|
void cancel() ;
|
|
|
|
void reload() ;
|
2010-04-08 16:33:10 +00:00
|
|
|
|
2016-10-31 16:28:26 +01:00
|
|
|
static QString getGroupString(const std::list<RsNodeGroupId>& groups);
|
2008-12-11 01:19:34 +00:00
|
|
|
private:
|
2010-09-17 18:27:30 +00:00
|
|
|
static ShareManager *_instance;
|
|
|
|
bool isLoading;
|
2008-12-11 01:19:34 +00:00
|
|
|
|
2010-09-17 18:27:30 +00:00
|
|
|
/** Define the popup menus for the Context menu */
|
|
|
|
QMenu* contextMnu;
|
2009-01-01 17:47:35 +00:00
|
|
|
|
2010-09-17 18:27:30 +00:00
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::ShareManager ui;
|
2016-10-31 16:28:26 +01:00
|
|
|
|
|
|
|
std::vector<SharedDirInfo> mDirInfos ;
|
2008-12-11 01:19:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|