Added three new methods on misc: getOpenFileName, getOpenFileNames and getSaveFileName. Please use this rather than QFileDialog.

Added save and restore of the last used directories for the following types
- Extra files
- Certificates
- History
- Images
- Messages
- Blogs (not tested)
It is easy to change.

Added attach of multiple files at once in CreateForumMsg.
The RetroShare links of the added files in CreateForumMsg are added with new style and as anchor with size information.
Added translation to some file dialogs.
Removed (commented out) not needed methods in NetworkDialog.
Fixed handling of filenames with umlauts when adding extra files.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3894 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-12-03 00:54:40 +00:00
parent c1e3947957
commit f7252fd693
23 changed files with 786 additions and 676 deletions

View file

@ -21,7 +21,6 @@
#include <QDragEnterEvent>
#include <QUrl>
#include <QFileDialog>
#include <QTimer>
#include <QMessageBox>
#include <QBuffer>
@ -289,14 +288,15 @@ void CreateChannelMsg::addAttachment(const std::string &hash, const std::string
void CreateChannelMsg::addExtraFile()
{
/* add a SubFileItem to the attachment section */
std::cerr << "CreateChannelMsg::addExtraFile() opening file dialog";
std::cerr << std::endl;
/* add a SubFileItem to the attachment section */
std::cerr << "CreateChannelMsg::addExtraFile() opening file dialog";
std::cerr << std::endl;
// select a file
QStringList files = QFileDialog::getOpenFileNames(this, tr("Add Extra File"), "", "", 0, QFileDialog::DontResolveSymlinks);
for (QStringList::iterator fileIt = files.begin(); fileIt != files.end(); fileIt++) {
addAttachment((*fileIt).toUtf8().constData());
QStringList files;
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
for (QStringList::iterator fileIt = files.begin(); fileIt != files.end(); fileIt++) {
addAttachment((*fileIt).toUtf8().constData());
}
}
}
@ -563,8 +563,8 @@ void CreateChannelMsg::sendMessage(std::wstring subject, std::wstring msg, std::
void CreateChannelMsg::addThumbnail()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Load File"), QDir::homePath(), tr("Pictures (*.png *.xpm *.jpg)"));
if(!fileName.isEmpty())
QString fileName;
if (misc::getOpenFileName(this, RshareSettings::LASTDIR_IMAGES, tr("Load File"), tr("Pictures (*.png *.xpm *.jpg)"), fileName))
{
picture = QPixmap(fileName).scaled(156,107, Qt::IgnoreAspectRatio,Qt::SmoothTransformation);