From 3e8557466cb82a4e3f4ab45bf9ac385810c34058 Mon Sep 17 00:00:00 2001 From: dubslow Date: Fri, 17 Oct 2014 03:02:19 -0500 Subject: [PATCH 1/3] fix #445 --- src/widget/form/settings/identityform.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/widget/form/settings/identityform.cpp b/src/widget/form/settings/identityform.cpp index d61a9fb18..a518730f4 100644 --- a/src/widget/form/settings/identityform.cpp +++ b/src/widget/form/settings/identityform.cpp @@ -168,10 +168,17 @@ void IdentityForm::onImportClicked() QString path = QFileDialog::getOpenFileName(this, tr("Import profile", "import dialog title"), QDir::homePath(), tr("Tox save file (*.tox)", "import dialog filter")); if (path.isEmpty()) return; + QFileInfo info(path); + + if (info.suffix() != "tox") + { + QMessageBox::warning(this, tr("Ignoring non-Tox file", "popup title"), tr("Warning: you've chosen a file that is not a Tox save file; ignoring.", "popup text")); + return; + } + QString profile = info.completeBaseName(); QString profilePath = QDir(Settings::getSettingsDirPath()).filePath(profile + Core::TOX_EXT); QFile::copy(path, profilePath); bodyUI->profiles->addItem(profile); - Core::getInstance()->switchConfiguration(profile); } From 9207dfc888b81e83fbf8f19f122b91354ef1ab53 Mon Sep 17 00:00:00 2001 From: dubslow Date: Fri, 17 Oct 2014 07:11:26 -0500 Subject: [PATCH 2/3] ui tweaks --- src/widget/form/settings/generalsettings.ui | 58 ++++++++++++++------ src/widget/form/settings/identitysettings.ui | 9 ++- 2 files changed, 48 insertions(+), 19 deletions(-) diff --git a/src/widget/form/settings/generalsettings.ui b/src/widget/form/settings/generalsettings.ui index da70efdae..d5d3a2026 100644 --- a/src/widget/form/settings/generalsettings.ui +++ b/src/widget/form/settings/generalsettings.ui @@ -71,7 +71,7 @@ Qt::LeftToRight - Auto away after: + Auto away after (0 to disable): @@ -87,7 +87,7 @@ minutes - 1 + 0 600 @@ -106,14 +106,25 @@ - - - Smiley Pack - - - - - + + + + + Smiley Pack: + + + + + + + + 0 + 0 + + + + + @@ -170,14 +181,25 @@ - - - Style - - - - - + + + + + Style: + + + + + + + + 0 + 0 + + + + + diff --git a/src/widget/form/settings/identitysettings.ui b/src/widget/form/settings/identitysettings.ui index 437495795..49314395b 100644 --- a/src/widget/form/settings/identitysettings.ui +++ b/src/widget/form/settings/identitysettings.ui @@ -75,7 +75,14 @@ - + + + + 0 + 0 + + + From 35f95ea50119a3a9845ebc8e29c14bc1737ea6bf Mon Sep 17 00:00:00 2001 From: dubslow Date: Fri, 17 Oct 2014 07:29:48 -0500 Subject: [PATCH 3/3] fix #438 --- src/filetransferinstance.cpp | 2 +- src/widget/form/chatform.cpp | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/filetransferinstance.cpp b/src/filetransferinstance.cpp index 158ddd65c..8880b044c 100644 --- a/src/filetransferinstance.cpp +++ b/src/filetransferinstance.cpp @@ -274,7 +274,7 @@ QString FileTransferInstance::QImage2base64(const QImage &img) QString FileTransferInstance::getHtmlImage() { - qDebug() << "QString FileTransferInstance::getHtmlImage() " << state; + //qDebug() << "QString FileTransferInstance::getHtmlImage() " << state; QString res; if (state == tsPending || state == tsProcessing || state == tsPaused) diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index 777a39b0a..125ef170a 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -102,24 +102,26 @@ void ChatForm::onSendTriggered() void ChatForm::onAttachClicked() { - QString path = QFileDialog::getOpenFileName(0,tr("Send a file")); - if (path.isEmpty()) + QStringList paths = QFileDialog::getOpenFileNames(0,tr("Send a file")); + if (paths.isEmpty()) return; - - QFile file(path); - if (!file.exists() || !file.open(QIODevice::ReadOnly)) - return; - if (file.isSequential()) + for (QString path : paths) { - QMessageBox::critical(0, "Bad Idea", "You're trying to send a special (sequential) file, that's not going to work!"); - return; + QFile file(path); + if (!file.exists() || !file.open(QIODevice::ReadOnly)) + continue; + if (file.isSequential()) + { + QMessageBox::critical(0, "Bad Idea", "You're trying to send a special (sequential) file, that's not going to work!"); + file.close(); + continue; + } + long long filesize = file.size(); file.close(); - } - long long filesize = file.size(); - file.close(); - QFileInfo fi(path); + QFileInfo fi(path); - emit sendFile(f->friendId, fi.fileName(), path, filesize); + emit sendFile(f->friendId, fi.fileName(), path, filesize); + } } void ChatForm::startFileSend(ToxFile file)