From f29b41f303f8a1083e5a183eadefb6c9c718bf55 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 26 Apr 2011 23:38:29 +0000 Subject: [PATCH] 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 --- retroshare-gui/src/gui/ShareManager.cpp | 56 ++++++++++++++++++++ retroshare-gui/src/gui/ShareManager.h | 3 ++ retroshare-gui/src/lang/retroshare_de.qm | Bin 327659 -> 328390 bytes retroshare-gui/src/lang/retroshare_de.ts | 64 ++++++++++++++--------- 4 files changed, 99 insertions(+), 24 deletions(-) diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index 526a8c4c6..4a5302c2a 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -76,6 +77,7 @@ ShareManager::ShareManager(QWidget *parent, Qt::WFlags flags) ui.shareddirList->setRangeSelected(QTableWidgetSelectionRange(0, 0, 0, COLUMN_COUNT), true); + setAcceptDrops(true); setAttribute(Qt::WA_DeleteOnClose, true); } @@ -306,3 +308,57 @@ void ShareManager::shareddirListCurrentCellChanged(int currentRow, int currentCo 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 urls = event->mimeData()->urls(); + QList::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(); +} diff --git a/retroshare-gui/src/gui/ShareManager.h b/retroshare-gui/src/gui/ShareManager.h index 962a9e009..885962b2f 100644 --- a/retroshare-gui/src/gui/ShareManager.h +++ b/retroshare-gui/src/gui/ShareManager.h @@ -48,6 +48,9 @@ private: protected: virtual void showEvent(QShowEvent * event); + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dropEvent(QDropEvent *event); + private slots: /** Create the context popup menu and it's submenus */ void shareddirListCurrentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn); diff --git a/retroshare-gui/src/lang/retroshare_de.qm b/retroshare-gui/src/lang/retroshare_de.qm index 0d622fd8729515fffd956ecec3fc84bc40878d3b..ea1dafac8ddf270f13ac310fda427008218ca967 100644 GIT binary patch delta 3843 zcmY+Hd0bOh7RS%K?><685;Q=?AjleJizp^akSL&Zv|uYLDi)MVSS26=S}TYPDijeo zATHIq09KGiQBf-@t%zEeR_j<7aAp+k0(4xc){32LnEA}iANhPg_kHd=?=HXdJ14*V zX>~r&y4ac}I8U?<&8tAufK&GOJwCOeW@NvrH z6+k;y0CDpM`e+uA);OR)s(>DE#T2Smd=UV&+Xsk*9S9?B>Bl-6P13KUOjxh@;xPyj z?A!SdK#0i)dSD1v399hg01(pi*|l9Tk#5QzVC_;6vdRE5e+8kCEpf1eiS+a*AZ%>| zP~9<+_=K8Blj1=5?Cn~9L3^_;lKLkg>=A$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V`jJRYpt<&l7;2Wyb z+2fRaYU9Mcq;CFSosQf;2*Cqsl>UJh#}A>(5A=@yTjdLqE&zzd@|XoL?e%eiUP`$3AwK1seb?kWg>uahT5@l>>OmM7&CUq_2gvcvWAl#*x=6Tg=)+ui~! zqKmeTiPkKAAkV3*2Yk^W-+WFE(4&-ZnZXCj`2I2FSiOKgVHE7qgG(#O+f$3n+G)P0 z4g+7&Hcvfnc};De{;D6|f}qX8lK)O@e7X19SA}uUd(6yc#8EgYF1BDteDHIp;4n)@tX|@PK}C{<<&fsexg<%JtjV& zULUQ0;X}pVNqnMLUr_A*c?!U@Y(-TvFP5#vii5Iiyn=HSpRaxnsOs!@%WsNWp#a#D z8#Ko^T)izuacT$;xDb`1b#f&CIhI;|?KP*|6j%51J@KkP71uQ$fNK{izS8iDofksA zzIx4~4;A;VkAe8aR?+dK6NH{W6kVM>4#usbU_YbAqfCik^5tyCC?%WK0a#|MlwA3; zV3ud}UO2d8Gi1ny>8I7{qg^g6@ygYQ_#yi6gD~R^*aO zCh{k4aYH2^_&wiW31l}uJm`SE%3X2>JUv|H`79nF)!(G}&#z6gh(Ri^U--L)_{ya4 zd$r2gXU<Lr&H7T6isr7YJrMC7;2|lkk<}E{Q^}?G2hH2`jWw5k7L)xE&JpU_C*_)qQ zeiblo(4D~W!FyXRUl#B&_3N~J z&EF}YES=}u*=yzJCZhvApD?ie?o&a%A$P*2+zA5zApeLbb0@HmoXhvevn%Ddm$2O@ WlM>j+mL~^ivL3UOQ~%A@{`>#gLzjR6 diff --git a/retroshare-gui/src/lang/retroshare_de.ts b/retroshare-gui/src/lang/retroshare_de.ts index cbc98de8d..5acde3eec 100644 --- a/retroshare-gui/src/lang/retroshare_de.ts +++ b/retroshare-gui/src/lang/retroshare_de.ts @@ -3365,37 +3365,37 @@ p, li { white-space: pre-wrap; } Friends Directories - Dateien von Freunden + Dateien von Freunden My Directories - Meine Ordner + Meine Ordner Size - Grösse + Grösse Age - Alter + Alter Friend - Freund + Freund Share Type - Freigabe Typ + Freigabe Typ Directory - Ordner + Ordner @@ -3689,7 +3689,7 @@ p, li { white-space: pre-wrap; } Copy RetroShare Link - Kopiere RetroShare Link + Kopiere RetroShare Link @@ -10281,7 +10281,7 @@ p, li { white-space: pre-wrap; } Freigabe entfernen - + If checked, the share is anonymously shared to anybody. Wenn aktiviert, dann ist dieser Ordner anonym feigegeben. @@ -10295,9 +10295,25 @@ p, li { white-space: pre-wrap; } Do you really want to stop sharing this directory ? Möchtes Du die Freigabe dieses Ordners wirklich aufheben ? + + + + Drop file error. + Dateifehler bei Drag'n'Drop. + + + + File can't be dropped, only directories are accepted. + Dateien können nicht für Drag'n'Drop genutzt werden. Nur Ordner werden akzeptiert. + + + + Directory not found or directory name not accepted. + Ordner nicht gefunden oder Ordnername nicht akzeptiert. + - + Remove Entfernen @@ -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; 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> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!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"> 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;"> @@ -10466,12 +10482,12 @@ p, li { white-space: pre-wrap; } Tree view - + Baumansicht Flat view - + Listenansicht @@ -11862,58 +11878,58 @@ p, li { white-space: pre-wrap; } FILE - DATEI + DATEI Files - Dateien + Dateien File - Datei + Datei DIR - ORDNER + ORDNER Friends Directories - Dateien von Freunden + Dateien von Freunden My Directories - Meine Ordner + Meine Ordner Size - Grösse + Grösse Age - Alter + Alter Friend - Freund + Freund Share Type - Freigabe Typ + Freigabe Typ What's new - Was ist neu + Was ist neu