mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
commit
d288f89870
|
@ -873,11 +873,12 @@ void ChatForm::doScreenshot()
|
||||||
ScreenshotGrabber* screenshotGrabber = new ScreenshotGrabber(this);
|
ScreenshotGrabber* screenshotGrabber = new ScreenshotGrabber(this);
|
||||||
connect(screenshotGrabber, &ScreenshotGrabber::screenshotTaken, this, &ChatForm::onScreenshotTaken);
|
connect(screenshotGrabber, &ScreenshotGrabber::screenshotTaken, this, &ChatForm::onScreenshotTaken);
|
||||||
screenshotGrabber->showGrabber();
|
screenshotGrabber->showGrabber();
|
||||||
|
// Create dir for screenshots
|
||||||
|
QDir(Settings::getSettingsDirPath()).mkdir("screenshots");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatForm::onScreenshotTaken(const QPixmap &pixmap) {
|
void ChatForm::onScreenshotTaken(const QPixmap &pixmap) {
|
||||||
QTemporaryFile file("qTox-Screenshot-XXXXXXXX.png");
|
QTemporaryFile file(QDir(Settings::getSettingsDirPath() + QDir::separator() + "screenshots" + QDir::separator()).filePath("qTox-Screenshot-XXXXXXXX.png"));
|
||||||
|
|
||||||
if (!file.open())
|
if (!file.open())
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this, tr("Failed to open temporary file", "Temporary file for screenshot"),
|
QMessageBox::warning(this, tr("Failed to open temporary file", "Temporary file for screenshot"),
|
||||||
|
@ -894,7 +895,6 @@ void ChatForm::onScreenshotTaken(const QPixmap &pixmap) {
|
||||||
QFileInfo fi(file);
|
QFileInfo fi(file);
|
||||||
|
|
||||||
emit sendFile(f->getFriendID(), fi.fileName(), fi.filePath(), filesize);
|
emit sendFile(f->getFriendID(), fi.fileName(), fi.filePath(), filesize);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatForm::onLoadHistory()
|
void ChatForm::onLoadHistory()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user