mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 06:40:58 -04:00
removed unused file DirectoriesPage.{cpp,ui,h}
This commit is contained in:
parent
e25756316d
commit
b4e0a8f836
4 changed files with 0 additions and 381 deletions
|
@ -1,102 +0,0 @@
|
||||||
/****************************************************************
|
|
||||||
* RetroShare is distributed under the following license:
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 - 2009 RetroShare Team
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
* Boston, MA 02110-1301, USA.
|
|
||||||
****************************************************************/
|
|
||||||
|
|
||||||
#include "DirectoriesPage.h"
|
|
||||||
#include "gui/ShareManager.h"
|
|
||||||
#include "util/misc.h"
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
#include "rshare.h"
|
|
||||||
#include <retroshare/rsfiles.h>
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
DirectoriesPage::DirectoriesPage(QWidget * parent, Qt::WindowFlags flags)
|
|
||||||
: ConfigPage(parent, flags)
|
|
||||||
{
|
|
||||||
ui.setupUi(this);
|
|
||||||
|
|
||||||
connect(ui.incomingButton, SIGNAL(clicked( bool ) ), this , SLOT( setIncomingDirectory() ) );
|
|
||||||
connect(ui.partialButton, SIGNAL(clicked( bool ) ), this , SLOT( setPartialsDirectory() ) );
|
|
||||||
connect(ui.editShareButton, SIGNAL(clicked()), this, SLOT(editDirectories()));
|
|
||||||
connect(ui.autoCheckDirectories_CB, SIGNAL(clicked(bool)), this, SLOT(toggleAutoCheckDirectories(bool)));
|
|
||||||
|
|
||||||
connect(ui.autoCheckDirectories_CB, SIGNAL(toggled(bool)), this,SLOT(updateAutoCheckDirectories())) ;
|
|
||||||
connect(ui.autoCheckDirectoriesDelay_SB,SIGNAL(valueChanged(int)),this,SLOT(updateAutoScanDirectoriesPeriod())) ;
|
|
||||||
connect(ui.shareDownloadDirectoryCB, SIGNAL(toggled(bool)), this,SLOT(updateShareDownloadDirectory())) ;
|
|
||||||
connect(ui.followSymLinks_CB, SIGNAL(toggled(bool)), this,SLOT(updateFollowSymLinks())) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectoriesPage::toggleAutoCheckDirectories(bool b)
|
|
||||||
{
|
|
||||||
ui.autoCheckDirectoriesDelay_SB->setEnabled(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectoriesPage::editDirectories()
|
|
||||||
{
|
|
||||||
ShareManager::showYourself() ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectoriesPage::updateAutoCheckDirectories() { rsFiles->setWatchEnabled(ui.autoCheckDirectories_CB->isChecked()) ; }
|
|
||||||
void DirectoriesPage::updateAutoScanDirectoriesPeriod() { rsFiles->setWatchPeriod(ui.autoCheckDirectoriesDelay_SB->value()); }
|
|
||||||
void DirectoriesPage::updateShareDownloadDirectory() { rsFiles->shareDownloadDirectory(ui.shareDownloadDirectoryCB->isChecked());}
|
|
||||||
void DirectoriesPage::updateFollowSymLinks() { rsFiles->setFollowSymLinks(ui.followSymLinks_CB->isChecked()); }
|
|
||||||
|
|
||||||
/** Loads the settings for this page */
|
|
||||||
void DirectoriesPage::load()
|
|
||||||
{
|
|
||||||
whileBlocking(ui.shareDownloadDirectoryCB)->setChecked(rsFiles->getShareDownloadDirectory());
|
|
||||||
|
|
||||||
int u = rsFiles->watchPeriod() ;
|
|
||||||
whileBlocking(ui.autoCheckDirectoriesDelay_SB)->setValue(u) ;
|
|
||||||
whileBlocking(ui.autoCheckDirectories_CB)->setChecked(rsFiles->watchEnabled()) ; ;
|
|
||||||
|
|
||||||
whileBlocking(ui.incomingDir)->setText(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()));
|
|
||||||
whileBlocking(ui.partialsDir)->setText(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()));
|
|
||||||
whileBlocking(ui.followSymLinks_CB)->setChecked(rsFiles->followSymLinks());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectoriesPage::setIncomingDirectory()
|
|
||||||
{
|
|
||||||
QString qdir = QFileDialog::getExistingDirectory(this, tr("Set Incoming Directory"), "", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
|
||||||
if (qdir.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.incomingDir->setText(qdir);
|
|
||||||
std::string dir = ui.incomingDir->text().toUtf8().constData();
|
|
||||||
|
|
||||||
if(!dir.empty())
|
|
||||||
rsFiles->setDownloadDirectory(dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectoriesPage::setPartialsDirectory()
|
|
||||||
{
|
|
||||||
QString qdir = QFileDialog::getExistingDirectory(this, tr("Set Partials Directory"), "", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
|
||||||
if (qdir.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.partialsDir->setText(qdir);
|
|
||||||
std::string dir = ui.partialsDir->text().toUtf8().constData();
|
|
||||||
if (!dir.empty())
|
|
||||||
rsFiles->setPartialsDirectory(dir);
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
/****************************************************************
|
|
||||||
* RetroShare is distributed under the following license:
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 - 2009 RetroShare Team
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
* Boston, MA 02110-1301, USA.
|
|
||||||
****************************************************************/
|
|
||||||
|
|
||||||
#ifndef DIRECTORIESPAGE_H
|
|
||||||
#define DIRECTORIESPAGE_H
|
|
||||||
|
|
||||||
#include <retroshare-gui/configpage.h>
|
|
||||||
#include "ui_DirectoriesPage.h"
|
|
||||||
|
|
||||||
class DirectoriesPage: public ConfigPage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
DirectoriesPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
|
|
||||||
|
|
||||||
/** Loads the settings for this page */
|
|
||||||
virtual void load();
|
|
||||||
|
|
||||||
virtual QPixmap iconPixmap() const { return QPixmap(":/icons/settings/directories.svg") ; }
|
|
||||||
virtual QString pageName() const { return tr("Directories") ; }
|
|
||||||
virtual QString helpText() const { return ""; }
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void editDirectories() ;
|
|
||||||
void setIncomingDirectory();
|
|
||||||
void setPartialsDirectory();
|
|
||||||
void toggleAutoCheckDirectories(bool);
|
|
||||||
|
|
||||||
void updateAutoCheckDirectories() ;
|
|
||||||
void updateAutoScanDirectoriesPeriod() ;
|
|
||||||
void updateShareDownloadDirectory() ;
|
|
||||||
void updateFollowSymLinks() ;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::DirectoriesPage ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // !GENERALPAGE_H
|
|
||||||
|
|
|
@ -1,218 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>DirectoriesPage</class>
|
|
||||||
<widget class="QWidget" name="DirectoriesPage">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>929</width>
|
|
||||||
<height>549</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Shared Directories</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="shareDownloadDirectoryCB">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Automatically share incoming directory (Recommended)</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="editShareButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Edit Share</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="autoCheckDirectories_CB">
|
|
||||||
<property name="text">
|
|
||||||
<string>Auto-check shared directories every </string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="autoCheckDirectoriesDelay_SB">
|
|
||||||
<property name="suffix">
|
|
||||||
<string> minute(s)</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>5000</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="followSymLinks_CB">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Tells Retroshare to follow the links. Loops and duplicate directories are automatically taken care of. If unchecked, Retroshare will just ignore symbolic links to both files and directories.</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>follow symbolic links</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
|
||||||
<property name="title">
|
|
||||||
<string>Incoming Directory</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLineEdit" name="incomingDir">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="incomingButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Browse</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../images.qrc">
|
|
||||||
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
|
||||||
<property name="title">
|
|
||||||
<string>Partials Directory</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLineEdit" name="partialsDir">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="partialButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Browse</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../images.qrc">
|
|
||||||
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>shareDownloadDirectoryCB</tabstop>
|
|
||||||
<tabstop>editShareButton</tabstop>
|
|
||||||
<tabstop>autoCheckDirectories_CB</tabstop>
|
|
||||||
<tabstop>autoCheckDirectoriesDelay_SB</tabstop>
|
|
||||||
<tabstop>incomingDir</tabstop>
|
|
||||||
<tabstop>incomingButton</tabstop>
|
|
||||||
<tabstop>partialsDir</tabstop>
|
|
||||||
<tabstop>partialButton</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources>
|
|
||||||
<include location="../images.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
|
@ -442,7 +442,6 @@ HEADERS += rshare.h \
|
||||||
gui/settings/rsettingswin.h \
|
gui/settings/rsettingswin.h \
|
||||||
gui/settings/GeneralPage.h \
|
gui/settings/GeneralPage.h \
|
||||||
gui/settings/PeoplePage.h \
|
gui/settings/PeoplePage.h \
|
||||||
gui/settings/DirectoriesPage.h \
|
|
||||||
gui/settings/AboutPage.h \
|
gui/settings/AboutPage.h \
|
||||||
gui/settings/ServerPage.h \
|
gui/settings/ServerPage.h \
|
||||||
gui/settings/NetworkPage.h \
|
gui/settings/NetworkPage.h \
|
||||||
|
@ -626,7 +625,6 @@ FORMS += gui/StartDialog.ui \
|
||||||
gui/msgs/MessageWidget.ui\
|
gui/msgs/MessageWidget.ui\
|
||||||
gui/settings/settingsw.ui \
|
gui/settings/settingsw.ui \
|
||||||
gui/settings/GeneralPage.ui \
|
gui/settings/GeneralPage.ui \
|
||||||
gui/settings/DirectoriesPage.ui \
|
|
||||||
gui/settings/ServerPage.ui \
|
gui/settings/ServerPage.ui \
|
||||||
gui/settings/NetworkPage.ui \
|
gui/settings/NetworkPage.ui \
|
||||||
gui/settings/NotifyPage.ui \
|
gui/settings/NotifyPage.ui \
|
||||||
|
@ -850,7 +848,6 @@ SOURCES += main.cpp \
|
||||||
gui/settings/rsettings.cpp \
|
gui/settings/rsettings.cpp \
|
||||||
gui/settings/rsettingswin.cpp \
|
gui/settings/rsettingswin.cpp \
|
||||||
gui/settings/GeneralPage.cpp \
|
gui/settings/GeneralPage.cpp \
|
||||||
gui/settings/DirectoriesPage.cpp \
|
|
||||||
gui/settings/AboutPage.cpp \
|
gui/settings/AboutPage.cpp \
|
||||||
gui/settings/ServerPage.cpp \
|
gui/settings/ServerPage.cpp \
|
||||||
gui/settings/NetworkPage.cpp \
|
gui/settings/NetworkPage.cpp \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue