mirror of https://github.com/procxx/kepka.git
Don't save values while uploading scans.
This commit is contained in:
parent
67ea175fc6
commit
704e3c9423
|
@ -1015,7 +1015,27 @@ void FormController::fileLoadFail(FileKey key) {
|
||||||
bool FormController::savingValue(not_null<const Value*> value) const {
|
bool FormController::savingValue(not_null<const Value*> value) const {
|
||||||
return (value->saveRequestId != 0)
|
return (value->saveRequestId != 0)
|
||||||
|| (value->verification.requestId != 0)
|
|| (value->verification.requestId != 0)
|
||||||
|| (value->verification.codeLength != 0);
|
|| (value->verification.codeLength != 0)
|
||||||
|
|| uploadingScan(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FormController::uploadingScan(not_null<const Value*> value) const {
|
||||||
|
for (const auto &scan : value->scansInEdit) {
|
||||||
|
if (scan.uploadData
|
||||||
|
&& scan.uploadData->fullId
|
||||||
|
&& !scan.deleted) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (value->selfieInEdit) {
|
||||||
|
const auto &selfie = *value->selfieInEdit;
|
||||||
|
if (selfie.uploadData
|
||||||
|
&& selfie.uploadData->fullId
|
||||||
|
&& !selfie.deleted) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormController::cancelValueEdit(not_null<const Value*> value) {
|
void FormController::cancelValueEdit(not_null<const Value*> value) {
|
||||||
|
|
|
@ -263,6 +263,7 @@ public:
|
||||||
void saveValueEdit(not_null<const Value*> value, ValueMap &&data);
|
void saveValueEdit(not_null<const Value*> value, ValueMap &&data);
|
||||||
void deleteValueEdit(not_null<const Value*> value);
|
void deleteValueEdit(not_null<const Value*> value);
|
||||||
bool savingValue(not_null<const Value*> value) const;
|
bool savingValue(not_null<const Value*> value) const;
|
||||||
|
bool uploadingScan(not_null<const Value*> value) const;
|
||||||
|
|
||||||
void cancel();
|
void cancel();
|
||||||
void cancelSure();
|
void cancelSure();
|
||||||
|
|
|
@ -265,6 +265,7 @@ void Panel::ensureLayerCreated() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_layer.create(_body);
|
_layer.create(_body);
|
||||||
|
_layer->setHideByBackgroundClick(false);
|
||||||
_layer->move(0, 0);
|
_layer->move(0, 0);
|
||||||
_body->sizeValue(
|
_body->sizeValue(
|
||||||
) | rpl::start_with_next([=](QSize size) {
|
) | rpl::start_with_next([=](QSize size) {
|
||||||
|
|
|
@ -345,6 +345,10 @@ bool LayerWidget::overlaps(const QRect &globalRect) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LayerStackWidget::setHideByBackgroundClick(bool hide) {
|
||||||
|
_hideByBackgroundClick = hide;
|
||||||
|
}
|
||||||
|
|
||||||
void LayerStackWidget::keyPressEvent(QKeyEvent *e) {
|
void LayerStackWidget::keyPressEvent(QKeyEvent *e) {
|
||||||
if (e->key() == Qt::Key_Escape) {
|
if (e->key() == Qt::Key_Escape) {
|
||||||
hideCurrent(anim::type::normal);
|
hideCurrent(anim::type::normal);
|
||||||
|
@ -352,7 +356,9 @@ void LayerStackWidget::keyPressEvent(QKeyEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerStackWidget::mousePressEvent(QMouseEvent *e) {
|
void LayerStackWidget::mousePressEvent(QMouseEvent *e) {
|
||||||
hideCurrent(anim::type::normal);
|
if (_hideByBackgroundClick) {
|
||||||
|
hideCurrent(anim::type::normal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerStackWidget::hideCurrent(anim::type animated) {
|
void LayerStackWidget::hideCurrent(anim::type animated) {
|
||||||
|
|
|
@ -107,6 +107,7 @@ public:
|
||||||
void hideLayers(anim::type animated);
|
void hideLayers(anim::type animated);
|
||||||
void hideAll(anim::type animated);
|
void hideAll(anim::type animated);
|
||||||
void hideTopLayer(anim::type animated);
|
void hideTopLayer(anim::type animated);
|
||||||
|
void setHideByBackgroundClick(bool hide);
|
||||||
|
|
||||||
bool showSectionInternal(
|
bool showSectionInternal(
|
||||||
not_null<SectionMemento*> memento,
|
not_null<SectionMemento*> memento,
|
||||||
|
@ -183,6 +184,7 @@ private:
|
||||||
|
|
||||||
class BackgroundWidget;
|
class BackgroundWidget;
|
||||||
object_ptr<BackgroundWidget> _background;
|
object_ptr<BackgroundWidget> _background;
|
||||||
|
bool _hideByBackgroundClick = true;
|
||||||
|
|
||||||
rpl::event_stream<> _hideFinishStream;
|
rpl::event_stream<> _hideFinishStream;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue