1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge branch 'pr448'

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-10-17 17:57:08 +02:00
commit ab996d1aa2
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
5 changed files with 73 additions and 35 deletions

View File

@ -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)

View File

@ -102,18 +102,19 @@ 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;
for (QString path : paths)
{
QFile file(path);
if (!file.exists() || !file.open(QIODevice::ReadOnly))
return;
continue;
if (file.isSequential())
{
QMessageBox::critical(0, "Bad Idea", "You're trying to send a special (sequential) file, that's not going to work!");
return;
file.close();
continue;
}
long long filesize = file.size();
file.close();
@ -121,6 +122,7 @@ void ChatForm::onAttachClicked()
emit sendFile(f->friendId, fi.fileName(), path, filesize);
}
}
void ChatForm::startFileSend(ToxFile file)
{

View File

@ -71,7 +71,7 @@
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Auto away after:</string>
<string>Auto away after (0 to disable):</string>
</property>
</widget>
</item>
@ -87,7 +87,7 @@
<string> minutes</string>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>600</number>
@ -105,15 +105,26 @@
<string>Theme</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="smileyHLayout">
<item>
<widget class="QLabel" name="smileyPackLabel">
<property name="text">
<string extracomment="Text on smiley pack label">Smiley Pack</string>
<string extracomment="Text on smiley pack label">Smiley Pack:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="smileyPackBrowser"/>
<widget class="QComboBox" name="smileyPackBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -169,15 +180,26 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="styleHLayout">
<item>
<widget class="QLabel" name="styleLabel">
<property name="text">
<string>Style</string>
<string>Style:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="styleBrowser"/>
<widget class="QComboBox" name="styleBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>

View File

@ -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);
}

View File

@ -75,7 +75,14 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="profiles" />
<widget class="QComboBox" name="profiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>