mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -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)
|
||||
{
|
||||
if(!misc::getSaveFileName(this,
|
||||
RshareSettings::LASTDIR_CERT,
|
||||
(import ? tr("Select file for importing your friendlist from") :
|
||||
tr("Select a file for exporting your friendlist to")),
|
||||
tr("XML File (*.xml);;All Files (*)"),
|
||||
fileName,
|
||||
NULL,
|
||||
(import ? QFileDialog::DontConfirmOverwrite : (QFileDialog::Options)0)
|
||||
)) {
|
||||
// show error to user
|
||||
QMessageBox mbox;
|
||||
mbox.setIcon(QMessageBox::Warning);
|
||||
mbox.setText(tr("Error"));
|
||||
mbox.setInformativeText(tr("Failed to get a file!"));
|
||||
mbox.setStandardButtons(QMessageBox::Ok);
|
||||
mbox.exec();
|
||||
return false;
|
||||
bool res = true;
|
||||
if (import) {
|
||||
res = misc::getOpenFileName(this, RshareSettings::LASTDIR_CERT
|
||||
, tr("Select file for importing your friendlist from")
|
||||
, tr("XML File (*.xml);;All Files (*)")
|
||||
, fileName
|
||||
, QFileDialog::DontConfirmOverwrite
|
||||
);
|
||||
} else {
|
||||
res = misc::getSaveFileName(this, RshareSettings::LASTDIR_CERT
|
||||
, tr("Select a file for exporting your friendlist to")
|
||||
, tr("XML File (*.xml);;All Files (*)")
|
||||
, fileName, NULL
|
||||
, (QFileDialog::Options)0
|
||||
);
|
||||
}
|
||||
return true;
|
||||
if ( res && !fileName.endsWith(".xml",Qt::CaseInsensitive) )
|
||||
fileName = fileName.append(".xml");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user