2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

some template send improvements

This commit is contained in:
John Preston
2014-10-17 22:32:34 +04:00
parent 21a7e0243c
commit b35b3bcb87
6 changed files with 45 additions and 35 deletions

View File

@@ -119,7 +119,7 @@ a_opacity(0, 1) {
void PhotoSendBox::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
onSend();
onSend((e->modifiers().testFlag(Qt::ControlModifier) || e->modifiers().testFlag(Qt::MetaModifier)) && e->modifiers().testFlag(Qt::ShiftModifier));
} else if (e->key() == Qt::Key_Escape) {
onCancel();
}
@@ -200,18 +200,18 @@ void PhotoSendBox::animStep(float64 ms) {
update();
}
void PhotoSendBox::onSend() {
void PhotoSendBox::onSend(bool ctrlShiftEnter) {
if (!_img) {
if (App::main()) App::main()->confirmShareContact(_phone, _fname, _lname);
if (App::main()) App::main()->confirmShareContact(ctrlShiftEnter, _phone, _fname, _lname);
} else {
if (!_compressed.isHidden()) {
cSetCompressPastedImage(_compressed.checked());
App::writeUserConfig();
}
if (_compressed.isHidden() || _compressed.checked()) {
if (App::main()) App::main()->confirmSendImage(*_img);
if (App::main()) App::main()->confirmSendImage(ctrlShiftEnter, *_img);
} else {
if (App::main()) App::main()->confirmSendImageUncompressed();
if (App::main()) App::main()->confirmSendImageUncompressed(ctrlShiftEnter);
}
}
emit closed();