share of incoming directory by default

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1359 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
alexandrut 2009-07-12 13:22:31 +00:00
parent 49e9066afb
commit 990ed277bd
9 changed files with 440 additions and 312 deletions

View file

@ -78,7 +78,8 @@ ftFileControl::ftFileControl(std::string fname,
} }
ftController::ftController(CacheStrapper *cs, ftDataMultiplex *dm, std::string configDir) ftController::ftController(CacheStrapper *cs, ftDataMultiplex *dm, std::string configDir)
:CacheTransfer(cs), p3Config(CONFIG_TYPE_FT_CONTROL), mDataplex(dm), mFtActive(false),mTurtle(NULL) :CacheTransfer(cs), p3Config(CONFIG_TYPE_FT_CONTROL), mDataplex(dm), mFtActive(false),
mTurtle(NULL), mShareDownloadDir(true)
{ {
/* TODO */ /* TODO */
} }
@ -1293,6 +1294,7 @@ bool ftController::CancelCacheFile(RsPeerId id, std::string path, std::string ha
const std::string download_dir_ss("DOWN_DIR"); const std::string download_dir_ss("DOWN_DIR");
const std::string partial_dir_ss("PART_DIR"); const std::string partial_dir_ss("PART_DIR");
const std::string share_dwl_dir("SHARE_DWL_DIR");
/* p3Config Interface */ /* p3Config Interface */
@ -1323,6 +1325,7 @@ std::list<RsItem *> ftController::saveList(bool &cleanup)
/* basic control parameters */ /* basic control parameters */
configMap[download_dir_ss] = getDownloadDirectory(); configMap[download_dir_ss] = getDownloadDirectory();
configMap[partial_dir_ss] = getPartialsDirectory(); configMap[partial_dir_ss] = getPartialsDirectory();
configMap[share_dwl_dir] = mShareDownloadDir ? "YES" : "NO";
RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet(); RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet();
@ -1462,6 +1465,27 @@ bool ftController::loadConfigMap(std::map<std::string, std::string> &configMap)
setPartialsDirectory(mit->second); setPartialsDirectory(mit->second);
} }
if (configMap.end() != (mit = configMap.find(share_dwl_dir)))
{
if (mit->second == "YES")
{
setShareDownloadDirectory(true);
}
else if (mit->second == "NO")
{
setShareDownloadDirectory(false);
}
}
return true; return true;
} }
void ftController::setShareDownloadDirectory(bool value)
{
mShareDownloadDir = value;
}
bool ftController::getShareDownloadDirectory()
{
return mShareDownloadDir;
}

View file

@ -118,6 +118,9 @@ void setFtSearchNExtra(ftSearch *, ftExtraList *);
void setTurtleRouter(p3turtle *) ; void setTurtleRouter(p3turtle *) ;
bool activate(); bool activate();
void setShareDownloadDirectory(bool value);
bool getShareDownloadDirectory();
virtual void run(); virtual void run();
/***************************************************************/ /***************************************************************/
@ -172,7 +175,6 @@ virtual std::list<RsItem *> saveList(bool &cleanup);
virtual bool loadList(std::list<RsItem *> load); virtual bool loadList(std::list<RsItem *> load);
bool loadConfigMap(std::map<std::string, std::string> &configMap); bool loadConfigMap(std::map<std::string, std::string> &configMap);
private: private:
/* RunTime Functions */ /* RunTime Functions */
@ -218,6 +220,9 @@ bool setPeerState(ftTransferModule *tm, std::string id,
bool mFtActive; bool mFtActive;
bool mFtPendingDone; bool mFtPendingDone;
std::list<ftPendingRequest> mPendingRequests; std::list<ftPendingRequest> mPendingRequests;
/* share incoming directory */
bool mShareDownloadDir;
}; };
#endif #endif

View file

@ -500,6 +500,27 @@ bool ftServer::removeSharedDirectory(std::string dir)
return true; return true;
} }
void ftServer::setShareDownloadDirectory(bool value)
{
mFtController->setShareDownloadDirectory(value);
}
bool ftServer::getShareDownloadDirectory()
{
return mFtController->getShareDownloadDirectory();
}
bool ftServer::shareDownloadDirectory()
{
std::string dir = mFtController->getDownloadDirectory();
return addSharedDirectory(dir);
}
bool ftServer::unshareDownloadDirectory()
{
std::string dir = mFtController->getDownloadDirectory();
return removeSharedDirectory(dir);
}
/***************************************************************/ /***************************************************************/
/****************** End of RsFiles Interface *******************/ /****************** End of RsFiles Interface *******************/

View file

@ -169,6 +169,10 @@ virtual bool setSharedDirectories(std::list<std::string> &dirs);
virtual bool addSharedDirectory(std::string dir); virtual bool addSharedDirectory(std::string dir);
virtual bool removeSharedDirectory(std::string dir); virtual bool removeSharedDirectory(std::string dir);
virtual void setShareDownloadDirectory(bool value);
virtual bool getShareDownloadDirectory();
virtual bool shareDownloadDirectory();
virtual bool unshareDownloadDirectory();
/***************************************************************/ /***************************************************************/
/*************** Control Interface *****************************/ /*************** Control Interface *****************************/

View file

@ -157,6 +157,10 @@ virtual bool getSharedDirectories(std::list<std::string> &dirs) = 0;
virtual bool addSharedDirectory(std::string dir) = 0; virtual bool addSharedDirectory(std::string dir) = 0;
virtual bool removeSharedDirectory(std::string dir) = 0; virtual bool removeSharedDirectory(std::string dir) = 0;
virtual void setShareDownloadDirectory(bool value) = 0;
virtual bool getShareDownloadDirectory() = 0;
virtual bool shareDownloadDirectory() = 0;
virtual bool unshareDownloadDirectory() = 0;
}; };

View file

@ -24,6 +24,7 @@
#include "rsiface/rsfiles.h" #include "rsiface/rsfiles.h"
#include "DirectoriesDialog.h" #include "DirectoriesDialog.h"
#include <algorithm>
/** Constructor */ /** Constructor */
DirectoriesDialog::DirectoriesDialog(QWidget *parent) DirectoriesDialog::DirectoriesDialog(QWidget *parent)
@ -39,13 +40,21 @@ DirectoriesDialog::DirectoriesDialog(QWidget *parent)
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() ) ); connect(ui.partialButton, SIGNAL(clicked( bool ) ), this , SLOT( setPartialsDirectory() ) );
connect(ui.checkBox, SIGNAL(stateChanged(int)), this, SLOT(shareDownloadDirectory(int)));
ui.addButton->setToolTip(tr("Add a Share Directory")); ui.addButton->setToolTip(tr("Add a Share Directory"));
ui.removeButton->setToolTip(tr("Remove Shared Directory")); ui.removeButton->setToolTip(tr("Remove Shared Directory"));
ui.incomingButton->setToolTip(tr("Browse")); ui.incomingButton->setToolTip(tr("Browse"));
ui.partialButton->setToolTip(tr("Browse")); ui.partialButton->setToolTip(tr("Browse"));
if (rsFiles->getShareDownloadDirectory())
{
ui.checkBox->setDown(true); /* signal not emitted */
}
else
{
ui.checkBox->setDown(false); /* signal not emitted */
}
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -57,6 +66,26 @@ DirectoriesDialog::DirectoriesDialog(QWidget *parent)
bool bool
DirectoriesDialog::save(QString &errmsg) DirectoriesDialog::save(QString &errmsg)
{ {
/* this is usefull especially when shared incoming files is
* default option and when the user don't check/uncheck the
* checkBox, so no signal is emitted to update the shared list */
if (ui.checkBox->isChecked())
{
std::list<std::string>::const_iterator it;
std::list<std::string> dirs;
rsFiles->getSharedDirectories(dirs);
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
{
rsFiles->shareDownloadDirectory();
}
rsFiles->setShareDownloadDirectory(true);
}
else
{
rsFiles->unshareDownloadDirectory();
rsFiles->setShareDownloadDirectory(false);
}
return true; return true;
} }
@ -84,8 +113,6 @@ void DirectoriesDialog::load()
ui.partialsDir->setText(QString::fromStdString(rsFiles->getPartialsDirectory())); ui.partialsDir->setText(QString::fromStdString(rsFiles->getPartialsDirectory()));
listWidget->update(); /* update display */ listWidget->update(); /* update display */
} }
void DirectoriesDialog::addShareDirectory() void DirectoriesDialog::addShareDirectory()
@ -130,6 +157,17 @@ void DirectoriesDialog::setIncomingDirectory()
if (dir != "") if (dir != "")
{ {
rsFiles->setDownloadDirectory(dir); rsFiles->setDownloadDirectory(dir);
if (ui.checkBox->isChecked())
{
std::list<std::string>::const_iterator it;
std::list<std::string> dirs;
rsFiles->getSharedDirectories(dirs);
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
{
rsFiles->shareDownloadDirectory();
}
}
} }
load(); load();
} }
@ -147,3 +185,24 @@ void DirectoriesDialog::setPartialsDirectory()
load(); load();
} }
void DirectoriesDialog::shareDownloadDirectory(int state)
{
if (state == Qt::Checked)
{
std::list<std::string>::const_iterator it;
std::list<std::string> dirs;
rsFiles->getSharedDirectories(dirs);
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
{
rsFiles->shareDownloadDirectory();
}
rsFiles->setShareDownloadDirectory(true);
}
else
{
rsFiles->unshareDownloadDirectory();
rsFiles->setShareDownloadDirectory(false);
}
load();
}

View file

@ -49,6 +49,7 @@ private slots:
void removeShareDirectory(); void removeShareDirectory();
void setIncomingDirectory(); void setIncomingDirectory();
void setPartialsDirectory(); void setPartialsDirectory();
void shareDownloadDirectory(int state);
private: private:

View file

@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DirectoriesDialog</class> <class>DirectoriesDialog</class>
<widget class="QWidget" name="DirectoriesDialog" > <widget class="QWidget" name="DirectoriesDialog">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,162 +10,162 @@
<height>349</height> <height>349</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" > <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="palette" > <property name="palette">
<palette> <palette>
<active> <active>
<colorrole role="WindowText" > <colorrole role="WindowText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Button" > <colorrole role="Button">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>208</red> <red>208</red>
<green>208</green> <green>208</green>
<blue>208</blue> <blue>208</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Light" > <colorrole role="Light">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Midlight" > <colorrole role="Midlight">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>247</red> <red>247</red>
<green>247</green> <green>247</green>
<blue>247</blue> <blue>247</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Dark" > <colorrole role="Dark">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>104</red> <red>104</red>
<green>104</green> <green>104</green>
<blue>104</blue> <blue>104</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Mid" > <colorrole role="Mid">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>139</red> <red>139</red>
<green>139</green> <green>139</green>
<blue>139</blue> <blue>139</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Text" > <colorrole role="Text">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="BrightText" > <colorrole role="BrightText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="ButtonText" > <colorrole role="ButtonText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Base" > <colorrole role="Base">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Window" > <colorrole role="Window">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>240</red> <red>240</red>
<green>240</green> <green>240</green>
<blue>240</blue> <blue>240</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Shadow" > <colorrole role="Shadow">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Highlight" > <colorrole role="Highlight">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>128</blue> <blue>128</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="HighlightedText" > <colorrole role="HighlightedText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Link" > <colorrole role="Link">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="LinkVisited" > <colorrole role="LinkVisited">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>0</green> <green>0</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="AlternateBase" > <colorrole role="AlternateBase">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>231</red> <red>231</red>
<green>231</green> <green>231</green>
<blue>231</blue> <blue>231</blue>
@ -173,153 +174,153 @@
</colorrole> </colorrole>
</active> </active>
<inactive> <inactive>
<colorrole role="WindowText" > <colorrole role="WindowText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Button" > <colorrole role="Button">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>208</red> <red>208</red>
<green>208</green> <green>208</green>
<blue>208</blue> <blue>208</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Light" > <colorrole role="Light">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Midlight" > <colorrole role="Midlight">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>247</red> <red>247</red>
<green>247</green> <green>247</green>
<blue>247</blue> <blue>247</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Dark" > <colorrole role="Dark">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>104</red> <red>104</red>
<green>104</green> <green>104</green>
<blue>104</blue> <blue>104</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Mid" > <colorrole role="Mid">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>139</red> <red>139</red>
<green>139</green> <green>139</green>
<blue>139</blue> <blue>139</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Text" > <colorrole role="Text">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="BrightText" > <colorrole role="BrightText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="ButtonText" > <colorrole role="ButtonText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Base" > <colorrole role="Base">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Window" > <colorrole role="Window">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>240</red> <red>240</red>
<green>240</green> <green>240</green>
<blue>240</blue> <blue>240</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Shadow" > <colorrole role="Shadow">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Highlight" > <colorrole role="Highlight">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>192</red> <red>192</red>
<green>192</green> <green>192</green>
<blue>192</blue> <blue>192</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="HighlightedText" > <colorrole role="HighlightedText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Link" > <colorrole role="Link">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="LinkVisited" > <colorrole role="LinkVisited">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>0</green> <green>0</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="AlternateBase" > <colorrole role="AlternateBase">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>231</red> <red>231</red>
<green>231</green> <green>231</green>
<blue>231</blue> <blue>231</blue>
@ -328,153 +329,153 @@
</colorrole> </colorrole>
</inactive> </inactive>
<disabled> <disabled>
<colorrole role="WindowText" > <colorrole role="WindowText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>104</red> <red>104</red>
<green>104</green> <green>104</green>
<blue>104</blue> <blue>104</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Button" > <colorrole role="Button">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>208</red> <red>208</red>
<green>208</green> <green>208</green>
<blue>208</blue> <blue>208</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Light" > <colorrole role="Light">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Midlight" > <colorrole role="Midlight">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>247</red> <red>247</red>
<green>247</green> <green>247</green>
<blue>247</blue> <blue>247</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Dark" > <colorrole role="Dark">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>104</red> <red>104</red>
<green>104</green> <green>104</green>
<blue>104</blue> <blue>104</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Mid" > <colorrole role="Mid">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>139</red> <red>139</red>
<green>139</green> <green>139</green>
<blue>139</blue> <blue>139</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Text" > <colorrole role="Text">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>104</red> <red>104</red>
<green>104</green> <green>104</green>
<blue>104</blue> <blue>104</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="BrightText" > <colorrole role="BrightText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="ButtonText" > <colorrole role="ButtonText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>104</red> <red>104</red>
<green>104</green> <green>104</green>
<blue>104</blue> <blue>104</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Base" > <colorrole role="Base">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>240</red> <red>240</red>
<green>240</green> <green>240</green>
<blue>240</blue> <blue>240</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Window" > <colorrole role="Window">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>240</red> <red>240</red>
<green>240</green> <green>240</green>
<blue>240</blue> <blue>240</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Shadow" > <colorrole role="Shadow">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Highlight" > <colorrole role="Highlight">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>128</blue> <blue>128</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="HighlightedText" > <colorrole role="HighlightedText">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>255</green> <green>255</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="Link" > <colorrole role="Link">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="LinkVisited" > <colorrole role="LinkVisited">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>255</red> <red>255</red>
<green>0</green> <green>0</green>
<blue>255</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
<colorrole role="AlternateBase" > <colorrole role="AlternateBase">
<brush brushstyle="SolidPattern" > <brush brushstyle="SolidPattern">
<color alpha="255" > <color alpha="255">
<red>231</red> <red>231</red>
<green>231</green> <green>231</green>
<blue>231</blue> <blue>231</blue>
@ -484,7 +485,7 @@
</disabled> </disabled>
</palette> </palette>
</property> </property>
<property name="font" > <property name="font">
<font> <font>
<family>Arial</family> <family>Arial</family>
<pointsize>10</pointsize> <pointsize>10</pointsize>
@ -495,61 +496,50 @@
<strikeout>false</strikeout> <strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="mouseTracking" > <property name="mouseTracking">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="contextMenuPolicy" > <property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum> <enum>Qt::NoContextMenu</enum>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="leftMargin" > <property name="margin">
<number>6</number> <number>6</number>
</property> </property>
<property name="topMargin" > <property name="spacing">
<number>6</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>6</number>
</property>
<property name="horizontalSpacing" >
<number>0</number> <number>0</number>
</property> </property>
<property name="verticalSpacing" > <item row="0" column="0">
<number>0</number> <widget class="QGroupBox" name="groupBox">
</property> <property name="title">
<item row="0" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Shared Directories</string> <string>Shared Directories</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<item rowspan="3" row="0" column="0" > <item row="0" column="0" rowspan="3">
<widget class="QListWidget" name="dirList" /> <widget class="QListWidget" name="dirList"/>
</item> </item>
<item row="0" column="1" > <item row="0" column="1">
<widget class="QPushButton" name="addButton" > <widget class="QPushButton" name="addButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>34</width> <width>34</width>
<height>34</height> <height>34</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>34</width> <width>34</width>
<height>34</height> <height>34</height>
</size> </size>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset resource="../images.qrc" >:/images/directoryadd_24x24_shadow.png</iconset> <iconset resource="../images.qrc">
<normaloff>:/images/directoryadd_24x24_shadow.png</normaloff>:/images/directoryadd_24x24_shadow.png</iconset>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
@ -557,27 +547,28 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="1" column="1">
<widget class="QPushButton" name="removeButton" > <widget class="QPushButton" name="removeButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>34</width> <width>34</width>
<height>34</height> <height>34</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>34</width> <width>34</width>
<height>34</height> <height>34</height>
</size> </size>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset resource="../images.qrc" >:/images/directoryremove_24x24_shadow.png</iconset> <iconset resource="../images.qrc">
<normaloff>:/images/directoryremove_24x24_shadow.png</normaloff>:/images/directoryremove_24x24_shadow.png</iconset>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
@ -585,12 +576,12 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" > <item row="2" column="1">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>71</height> <height>71</height>
@ -601,40 +592,41 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2" > <widget class="QGroupBox" name="groupBox_2">
<property name="title" > <property name="title">
<string>Incoming Directory</string> <string>Incoming Directory</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<item row="0" column="0" > <item row="0" column="0">
<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="1" > <item row="0" column="1">
<widget class="QPushButton" name="incomingButton" > <widget class="QPushButton" name="incomingButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>31</width> <width>31</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>31</width> <width>31</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset resource="../images.qrc" >:/images/directoryselect_24x24_shadow.png</iconset> <iconset resource="../images.qrc">
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
@ -642,43 +634,57 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Automatically share incoming directory (Recommanded)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0">
<widget class="QGroupBox" name="groupBox_3" > <widget class="QGroupBox" name="groupBox_3">
<property name="title" > <property name="title">
<string>Partials Direcrtory</string> <string>Partials Direcrtory</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<item row="0" column="0" > <item row="0" column="0">
<widget class="QLineEdit" name="partialsDir" > <widget class="QLineEdit" name="partialsDir">
<property name="readOnly" > <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1" > <item row="0" column="1">
<widget class="QPushButton" name="partialButton" > <widget class="QPushButton" name="partialButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>31</width> <width>31</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>31</width> <width>31</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset resource="../images.qrc" >:/images/directoryselect_24x24_shadow.png</iconset> <iconset resource="../images.qrc">
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
@ -699,7 +705,7 @@
<tabstop>removeButton</tabstop> <tabstop>removeButton</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../images.qrc" /> <include location="../images.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View file

@ -157,6 +157,10 @@ virtual bool getSharedDirectories(std::list<std::string> &dirs) = 0;
virtual bool addSharedDirectory(std::string dir) = 0; virtual bool addSharedDirectory(std::string dir) = 0;
virtual bool removeSharedDirectory(std::string dir) = 0; virtual bool removeSharedDirectory(std::string dir) = 0;
virtual void setShareDownloadDirectory(bool value) = 0;
virtual bool getShareDownloadDirectory() = 0;
virtual bool shareDownloadDirectory() = 0;
virtual bool unshareDownloadDirectory() = 0;
}; };