mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Enabled drag and drop in ShareManager to add folders to the share.
Fixed german language. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4172 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
993e0d225c
commit
f29b41f303
@ -26,6 +26,7 @@
|
|||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
#include <retroshare/rsfiles.h>
|
#include <retroshare/rsfiles.h>
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ ShareManager::ShareManager(QWidget *parent, Qt::WFlags flags)
|
|||||||
|
|
||||||
ui.shareddirList->setRangeSelected(QTableWidgetSelectionRange(0, 0, 0, COLUMN_COUNT), true);
|
ui.shareddirList->setRangeSelected(QTableWidgetSelectionRange(0, 0, 0, COLUMN_COUNT), true);
|
||||||
|
|
||||||
|
setAcceptDrops(true);
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
}
|
}
|
||||||
@ -306,3 +308,57 @@ void ShareManager::shareddirListCurrentCellChanged(int currentRow, int currentCo
|
|||||||
ui.removeButton->setEnabled(false);
|
ui.removeButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShareManager::dragEnterEvent(QDragEnterEvent *event)
|
||||||
|
{
|
||||||
|
if (event->mimeData()->hasUrls()) {
|
||||||
|
event->acceptProposedAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShareManager::dropEvent(QDropEvent *event)
|
||||||
|
{
|
||||||
|
if (!(Qt::CopyAction & event->possibleActions())) {
|
||||||
|
/* can't do it */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList formats = event->mimeData()->formats();
|
||||||
|
QStringList::iterator it;
|
||||||
|
|
||||||
|
bool errorShown = false;
|
||||||
|
|
||||||
|
if (event->mimeData()->hasUrls()) {
|
||||||
|
QList<QUrl> urls = event->mimeData()->urls();
|
||||||
|
QList<QUrl>::iterator it;
|
||||||
|
for (it = urls.begin(); it != urls.end(); it++) {
|
||||||
|
QString localpath = it->toLocalFile();
|
||||||
|
|
||||||
|
if (localpath.isEmpty() == false) {
|
||||||
|
QDir dir(localpath);
|
||||||
|
if (dir.exists()) {
|
||||||
|
SharedDirInfo sdi;
|
||||||
|
sdi.filename = localpath.toUtf8().constData();
|
||||||
|
sdi.virtualname.clear();
|
||||||
|
|
||||||
|
sdi.shareflags = 0;
|
||||||
|
|
||||||
|
/* add new share */
|
||||||
|
rsFiles->addSharedDirectory(sdi);
|
||||||
|
} else if (QFile::exists(localpath)) {
|
||||||
|
if (errorShown == false) {
|
||||||
|
QMessageBox mb(tr("Drop file error."), tr("File can't be dropped, only directories are accepted."), QMessageBox::Information, QMessageBox::Ok, 0, 0, this);
|
||||||
|
mb.exec();
|
||||||
|
errorShown = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
QMessageBox mb(tr("Drop file error."), tr("Directory not found or directory name not accepted."), QMessageBox::Information, QMessageBox::Ok, 0, 0, this);
|
||||||
|
mb.exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event->setDropAction(Qt::CopyAction);
|
||||||
|
event->accept();
|
||||||
|
}
|
||||||
|
@ -48,6 +48,9 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
virtual void showEvent(QShowEvent * event);
|
virtual void showEvent(QShowEvent * event);
|
||||||
|
|
||||||
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
||||||
|
virtual void dropEvent(QDropEvent *event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void shareddirListCurrentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
|
void shareddirListCurrentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
|
||||||
|
Binary file not shown.
@ -3365,37 +3365,37 @@ p, li { white-space: pre-wrap; }
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../gui/RemoteDirModel.cpp" line="+664"/>
|
<location filename="../gui/RemoteDirModel.cpp" line="+664"/>
|
||||||
<source>Friends Directories</source>
|
<source>Friends Directories</source>
|
||||||
<translation type="unfinished">Dateien von Freunden</translation>
|
<translation>Dateien von Freunden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>My Directories</source>
|
<source>My Directories</source>
|
||||||
<translation type="unfinished">Meine Ordner</translation>
|
<translation>Meine Ordner</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Size</source>
|
<source>Size</source>
|
||||||
<translation type="unfinished">Grösse</translation>
|
<translation>Grösse</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Age</source>
|
<source>Age</source>
|
||||||
<translation type="unfinished">Alter</translation>
|
<translation>Alter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
<source>Friend</source>
|
<source>Friend</source>
|
||||||
<translation type="unfinished">Freund</translation>
|
<translation>Freund</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Share Type</source>
|
<source>Share Type</source>
|
||||||
<translation type="unfinished">Freigabe Typ</translation>
|
<translation>Freigabe Typ</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Directory</source>
|
<source>Directory</source>
|
||||||
<translation type="unfinished">Ordner</translation>
|
<translation>Ordner</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -3689,7 +3689,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<location line="+6"/>
|
<location line="+6"/>
|
||||||
<location line="+93"/>
|
<location line="+93"/>
|
||||||
<source>Copy RetroShare Link</source>
|
<source>Copy RetroShare Link</source>
|
||||||
<translation type="unfinished">Kopiere RetroShare Link</translation>
|
<translation>Kopiere RetroShare Link</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-88"/>
|
<location line="-88"/>
|
||||||
@ -10281,7 +10281,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Freigabe entfernen</translation>
|
<translation>Freigabe entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/ShareManager.cpp" line="+125"/>
|
<location filename="../gui/ShareManager.cpp" line="+127"/>
|
||||||
<source>If checked, the share is anonymously shared to anybody.</source>
|
<source>If checked, the share is anonymously shared to anybody.</source>
|
||||||
<translation>Wenn aktiviert, dann ist dieser Ordner anonym feigegeben.</translation>
|
<translation>Wenn aktiviert, dann ist dieser Ordner anonym feigegeben.</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -10295,9 +10295,25 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Do you really want to stop sharing this directory ?</source>
|
<source>Do you really want to stop sharing this directory ?</source>
|
||||||
<translation>Möchtes Du die Freigabe dieses Ordners wirklich aufheben ?</translation>
|
<translation>Möchtes Du die Freigabe dieses Ordners wirklich aufheben ?</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+75"/>
|
||||||
|
<location line="+5"/>
|
||||||
|
<source>Drop file error.</source>
|
||||||
|
<translation>Dateifehler bei Drag'n'Drop.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="-5"/>
|
||||||
|
<source>File can't be dropped, only directories are accepted.</source>
|
||||||
|
<translation>Dateien können nicht für Drag'n'Drop genutzt werden. Nur Ordner werden akzeptiert.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+5"/>
|
||||||
|
<source>Directory not found or directory name not accepted.</source>
|
||||||
|
<translation>Ordner nicht gefunden oder Ordnername nicht akzeptiert.</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/ShareManager.ui" line="+3"/>
|
<location filename="../gui/ShareManager.ui" line="+3"/>
|
||||||
<location filename="../gui/ShareManager.cpp" line="-176"/>
|
<location filename="../gui/ShareManager.cpp" line="-256"/>
|
||||||
<source>Remove</source>
|
<source>Remove</source>
|
||||||
<translation>Entfernen</translation>
|
<translation>Entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -10335,7 +10351,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:8pt;">You can separately setup share flags for each shared directory:</span><span style=" font-size:8pt;"> </span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:8pt;">You can separately setup share flags for each shared directory:</span><span style=" font-size:8pt;"> </span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:8pt; font-weight:600;">Browsable</span><span style=" font-family:'Sans'; font-size:8pt;">: files are browsable from your direct friends.</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:8pt; font-weight:600;">Browsable</span><span style=" font-family:'Sans'; font-size:8pt;">: files are browsable from your direct friends.</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:8pt; font-weight:600;">Network Wide</span><span style=" font-family:'Sans'; font-size:8pt;">: files can be downloaded by anybody through anonymous tunnels.</span></p></body></html></source>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:8pt; font-weight:600;">Network Wide</span><span style=" font-family:'Sans'; font-size:8pt;">: files can be downloaded by anybody through anonymous tunnels.</span></p></body></html></source>
|
||||||
<translation type="unfinished"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
@ -10466,12 +10482,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<message>
|
<message>
|
||||||
<location line="+28"/>
|
<location line="+28"/>
|
||||||
<source>Tree view</source>
|
<source>Tree view</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Baumansicht</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+5"/>
|
<location line="+5"/>
|
||||||
<source>Flat view</source>
|
<source>Flat view</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Listenansicht</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+173"/>
|
<location line="+173"/>
|
||||||
@ -11862,58 +11878,58 @@ p, li { white-space: pre-wrap; }
|
|||||||
<location filename="../gui/RemoteDirModel.cpp" line="+136"/>
|
<location filename="../gui/RemoteDirModel.cpp" line="+136"/>
|
||||||
<location line="+108"/>
|
<location line="+108"/>
|
||||||
<source>FILE</source>
|
<source>FILE</source>
|
||||||
<translation type="unfinished">DATEI</translation>
|
<translation>DATEI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-95"/>
|
<location line="-95"/>
|
||||||
<source>Files</source>
|
<source>Files</source>
|
||||||
<translation type="unfinished">Dateien</translation>
|
<translation>Dateien</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>File</source>
|
<source>File</source>
|
||||||
<translation type="unfinished">Datei</translation>
|
<translation>Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+6"/>
|
<location line="+6"/>
|
||||||
<location line="+103"/>
|
<location line="+103"/>
|
||||||
<source>DIR</source>
|
<source>DIR</source>
|
||||||
<translation type="unfinished">ORDNER</translation>
|
<translation>ORDNER</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+145"/>
|
<location line="+145"/>
|
||||||
<source>Friends Directories</source>
|
<source>Friends Directories</source>
|
||||||
<translation type="unfinished">Dateien von Freunden</translation>
|
<translation>Dateien von Freunden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>My Directories</source>
|
<source>My Directories</source>
|
||||||
<translation type="unfinished">Meine Ordner</translation>
|
<translation>Meine Ordner</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Size</source>
|
<source>Size</source>
|
||||||
<translation type="unfinished">Grösse</translation>
|
<translation>Grösse</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Age</source>
|
<source>Age</source>
|
||||||
<translation type="unfinished">Alter</translation>
|
<translation>Alter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
<source>Friend</source>
|
<source>Friend</source>
|
||||||
<translation type="unfinished">Freund</translation>
|
<translation>Freund</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Share Type</source>
|
<source>Share Type</source>
|
||||||
<translation type="unfinished">Freigabe Typ</translation>
|
<translation>Freigabe Typ</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>What's new</source>
|
<source>What's new</source>
|
||||||
<translation type="unfinished">Was ist neu</translation>
|
<translation>Was ist neu</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
Loading…
Reference in New Issue
Block a user