* Added for Partials Directory to Directories Dialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@885 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2008-12-11 01:54:41 +00:00
parent 616f4e671f
commit 5cb9f16dd7
3 changed files with 143 additions and 100 deletions

View File

@ -38,6 +38,8 @@ DirectoriesDialog::DirectoriesDialog(QWidget *parent)
connect(ui.addButton, SIGNAL(clicked( bool ) ), this , SLOT( addShareDirectory() ) ); connect(ui.addButton, SIGNAL(clicked( bool ) ), this , SLOT( addShareDirectory() ) );
connect(ui.removeButton, SIGNAL(clicked( bool ) ), this , SLOT( removeShareDirectory() ) ); connect(ui.removeButton, SIGNAL(clicked( bool ) ), this , SLOT( removeShareDirectory() ) );
connect(ui.incomingButton, SIGNAL(clicked( bool ) ), this , SLOT( setIncomingDirectory() ) ); connect(ui.incomingButton, SIGNAL(clicked( bool ) ), this , SLOT( setIncomingDirectory() ) );
connect(ui.partialButton, SIGNAL(clicked( bool ) ), this , SLOT( setPartialsDirectory() ) );
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -73,6 +75,7 @@ void DirectoriesDialog::load()
} }
ui.incomingDir->setText(QString::fromStdString(rsFiles->getDownloadDirectory())); ui.incomingDir->setText(QString::fromStdString(rsFiles->getDownloadDirectory()));
ui.partialsDir->setText(QString::fromStdString(rsFiles->getPartialsDirectory()));
listWidget->update(); /* update display */ listWidget->update(); /* update display */
@ -84,8 +87,9 @@ void DirectoriesDialog::addShareDirectory()
/* select a dir /* select a dir
*/ */
QString qdir = QFileDialog::getExistingDirectory(this, tr("Add Shared Directory"), "",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
QString qdir = QFileDialog::getOpenFileName(this, tr("Add Shared Directory"),tr("All Files (*)"));
/* add it to the server */ /* add it to the server */
std::string dir = qdir.toStdString(); std::string dir = qdir.toStdString();
@ -111,7 +115,7 @@ void DirectoriesDialog::removeShareDirectory()
void DirectoriesDialog::setIncomingDirectory() void DirectoriesDialog::setIncomingDirectory()
{ {
QString qdir = QFileDialog::getExistingDirectory(this, tr("Add Shared Directory"), "", QString qdir = QFileDialog::getExistingDirectory(this, tr("Set Incoming Directory"), "",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
std::string dir = qdir.toStdString(); std::string dir = qdir.toStdString();
@ -122,4 +126,16 @@ void DirectoriesDialog::setIncomingDirectory()
load(); load();
} }
void DirectoriesDialog::setPartialsDirectory()
{
QString qdir = QFileDialog::getExistingDirectory(this, tr("Set Partials Directory"), "",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
std::string dir = qdir.toStdString();
if (dir != "")
{
rsFiles->setPartialsDirectory(dir);
}
load();
}

View File

@ -48,6 +48,8 @@ private slots:
void addShareDirectory(); void addShareDirectory();
void removeShareDirectory(); void removeShareDirectory();
void setIncomingDirectory(); void setIncomingDirectory();
void setPartialsDirectory();
private: private:
/** A RshareSettings object used for saving/loading settings */ /** A RshareSettings object used for saving/loading settings */

View File

@ -5,14 +5,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>470</width> <width>456</width>
<height>313</height> <height>356</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -509,43 +507,21 @@
<x>0</x> <x>0</x>
<y>200</y> <y>200</y>
<width>441</width> <width>441</width>
<height>81</height> <height>72</height>
</rect> </rect>
</property> </property>
<property name="title" > <property name="title" >
<string>Other Directories</string> <string>Incoming Directory</string>
</property>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>30</y>
<width>421</width>
<height>34</height>
</rect>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <item row="0" column="0" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QLineEdit" name="incomingDir" > <widget class="QLineEdit" name="incomingDir" >
<property name="readOnly" > <property name="readOnly" >
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" > <item row="0" column="1" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:8pt;">Incoming Files&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QPushButton" name="incomingButton" > <widget class="QPushButton" name="incomingButton" >
<property name="minimumSize" > <property name="minimumSize" >
<size> <size>
@ -575,7 +551,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</widget>
<widget class="QGroupBox" name="groupBox" > <widget class="QGroupBox" name="groupBox" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
@ -667,6 +642,56 @@
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_3" >
<property name="geometry" >
<rect>
<x>0</x>
<y>270</y>
<width>441</width>
<height>72</height>
</rect>
</property>
<property name="title" >
<string>Partials Direcrtory</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="text" >
<string/>
</property>
<property name="icon" >
<iconset resource="../images.qrc" >:/images/directoryselect_24x24_shadow.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>incomingDir</tabstop> <tabstop>incomingDir</tabstop>