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