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

Move export management to Core::App.

This commit is contained in:
John Preston
2020-06-25 11:14:05 +04:00
parent 28cafb129e
commit 65050bf9dd
16 changed files with 209 additions and 104 deletions

View File

@@ -96,6 +96,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "calls/calls_instance.h"
#include "calls/calls_top_bar.h"
#include "export/export_settings.h"
#include "export/export_manager.h"
#include "export/view/export_view_top_bar.h"
#include "export/view/export_view_panel_controller.h"
#include "main/main_session.h"
@@ -255,12 +256,17 @@ MainWidget::MainWidget(
handleAudioUpdate(state);
}, lifetime());
subscribe(session().calls().currentCallChanged(), [this](Calls::Call *call) { setCurrentCall(call); });
subscribe(session().calls().currentCallChanged(), [=](Calls::Call *call) {
setCurrentCall(call);
});
session().data().currentExportView(
Core::App().exportManager().currentView(
) | rpl::start_with_next([=](Export::View::PanelController *view) {
setCurrentExportView(view);
}, lifetime());
if (_exportTopBar) {
_exportTopBar->finishAnimating();
}
subscribe(_controller->dialogsListFocused(), [this](bool) {
updateDialogsWidthAnimated();
@@ -354,10 +360,6 @@ MainWidget::MainWidget(
cSetOtherOnline(0);
if (const auto availableAt = session().local().readExportSettings().availableAt) {
session().data().suggestStartExport(availableAt);
}
_history->start();
Core::App().checkStartUrl();
@@ -1007,8 +1009,10 @@ void MainWidget::setCurrentExportView(Export::View::PanelController *view) {
} else {
_exportTopBar->entity()->updateData(std::move(data));
}
}, _currentExportView->lifetime());
}, _exportViewLifetime);
} else {
_exportViewLifetime.destroy();
LOG(("Export Info: Destroy top bar by controller removal."));
destroyExportTopBar();
}