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:
commit
ab996d1aa2
|
@ -274,7 +274,7 @@ QString FileTransferInstance::QImage2base64(const QImage &img)
|
||||||
|
|
||||||
QString FileTransferInstance::getHtmlImage()
|
QString FileTransferInstance::getHtmlImage()
|
||||||
{
|
{
|
||||||
qDebug() << "QString FileTransferInstance::getHtmlImage() " << state;
|
//qDebug() << "QString FileTransferInstance::getHtmlImage() " << state;
|
||||||
|
|
||||||
QString res;
|
QString res;
|
||||||
if (state == tsPending || state == tsProcessing || state == tsPaused)
|
if (state == tsPending || state == tsProcessing || state == tsPaused)
|
||||||
|
|
|
@ -102,18 +102,19 @@ void ChatForm::onSendTriggered()
|
||||||
|
|
||||||
void ChatForm::onAttachClicked()
|
void ChatForm::onAttachClicked()
|
||||||
{
|
{
|
||||||
QString path = QFileDialog::getOpenFileName(0,tr("Send a file"));
|
QStringList paths = QFileDialog::getOpenFileNames(0,tr("Send a file"));
|
||||||
if (path.isEmpty())
|
if (paths.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
for (QString path : paths)
|
||||||
|
{
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
if (!file.exists() || !file.open(QIODevice::ReadOnly))
|
if (!file.exists() || !file.open(QIODevice::ReadOnly))
|
||||||
return;
|
continue;
|
||||||
if (file.isSequential())
|
if (file.isSequential())
|
||||||
{
|
{
|
||||||
QMessageBox::critical(0, "Bad Idea", "You're trying to send a special (sequential) file, that's not going to work!");
|
QMessageBox::critical(0, "Bad Idea", "You're trying to send a special (sequential) file, that's not going to work!");
|
||||||
return;
|
|
||||||
file.close();
|
file.close();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
long long filesize = file.size();
|
long long filesize = file.size();
|
||||||
file.close();
|
file.close();
|
||||||
|
@ -121,6 +122,7 @@ void ChatForm::onAttachClicked()
|
||||||
|
|
||||||
emit sendFile(f->friendId, fi.fileName(), path, filesize);
|
emit sendFile(f->friendId, fi.fileName(), path, filesize);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ChatForm::startFileSend(ToxFile file)
|
void ChatForm::startFileSend(ToxFile file)
|
||||||
{
|
{
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
<enum>Qt::LeftToRight</enum>
|
<enum>Qt::LeftToRight</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Auto away after:</string>
|
<string>Auto away after (0 to disable):</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
<string> minutes</string>
|
<string> minutes</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>600</number>
|
<number>600</number>
|
||||||
|
@ -105,15 +105,26 @@
|
||||||
<string>Theme</string>
|
<string>Theme</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="smileyHLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="smileyPackLabel">
|
<widget class="QLabel" name="smileyPackLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string extracomment="Text on smiley pack label">Smiley Pack</string>
|
<string extracomment="Text on smiley pack label">Smiley Pack:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<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>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
@ -169,15 +180,26 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="styleHLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="styleLabel">
|
<widget class="QLabel" name="styleLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Style</string>
|
<string>Style:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<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>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -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"));
|
QString path = QFileDialog::getOpenFileName(this, tr("Import profile", "import dialog title"), QDir::homePath(), tr("Tox save file (*.tox)", "import dialog filter"));
|
||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QFileInfo info(path);
|
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 profile = info.completeBaseName();
|
||||||
QString profilePath = QDir(Settings::getSettingsDirPath()).filePath(profile + Core::TOX_EXT);
|
QString profilePath = QDir(Settings::getSettingsDirPath()).filePath(profile + Core::TOX_EXT);
|
||||||
QFile::copy(path, profilePath);
|
QFile::copy(path, profilePath);
|
||||||
bodyUI->profiles->addItem(profile);
|
bodyUI->profiles->addItem(profile);
|
||||||
Core::getInstance()->switchConfiguration(profile);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<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>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user