mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 16:39:29 -05:00
Merge pull request #793 from PhenomRetroShare/Fix_FriendListExport
Fix FriendList Import/Export filename and error message.
This commit is contained in:
commit
c481186d95
@ -1816,25 +1816,26 @@ void FriendList::importFriendlistClicked()
|
|||||||
*/
|
*/
|
||||||
bool FriendList::importExportFriendlistFileDialog(QString &fileName, bool import)
|
bool FriendList::importExportFriendlistFileDialog(QString &fileName, bool import)
|
||||||
{
|
{
|
||||||
if(!misc::getSaveFileName(this,
|
bool res = true;
|
||||||
RshareSettings::LASTDIR_CERT,
|
if (import) {
|
||||||
(import ? tr("Select file for importing your friendlist from") :
|
res = misc::getOpenFileName(this, RshareSettings::LASTDIR_CERT
|
||||||
tr("Select a file for exporting your friendlist to")),
|
, tr("Select file for importing your friendlist from")
|
||||||
tr("XML File (*.xml);;All Files (*)"),
|
, tr("XML File (*.xml);;All Files (*)")
|
||||||
fileName,
|
, fileName
|
||||||
NULL,
|
, QFileDialog::DontConfirmOverwrite
|
||||||
(import ? QFileDialog::DontConfirmOverwrite : (QFileDialog::Options)0)
|
);
|
||||||
)) {
|
} else {
|
||||||
// show error to user
|
res = misc::getSaveFileName(this, RshareSettings::LASTDIR_CERT
|
||||||
QMessageBox mbox;
|
, tr("Select a file for exporting your friendlist to")
|
||||||
mbox.setIcon(QMessageBox::Warning);
|
, tr("XML File (*.xml);;All Files (*)")
|
||||||
mbox.setText(tr("Error"));
|
, fileName, NULL
|
||||||
mbox.setInformativeText(tr("Failed to get a file!"));
|
, (QFileDialog::Options)0
|
||||||
mbox.setStandardButtons(QMessageBox::Ok);
|
);
|
||||||
mbox.exec();
|
}
|
||||||
return false;
|
if ( res && !fileName.endsWith(".xml",Qt::CaseInsensitive) )
|
||||||
}
|
fileName = fileName.append(".xml");
|
||||||
return true;
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user