2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Use separate click handler for OpenWith.

This commit is contained in:
John Preston
2019-03-13 13:35:47 +04:00
parent f9f84fd407
commit 5ec37e9112
12 changed files with 104 additions and 53 deletions

View File

@@ -99,14 +99,14 @@ public:
const HistoryItem *item);
void automaticLoadSettingsChanged();
enum FilePathResolveType {
FilePathResolveCached,
FilePathResolveChecked,
FilePathResolveSaveFromData,
FilePathResolveSaveFromDataSilent,
enum class FilePathResolve {
Cached,
Checked,
SaveFromData,
SaveFromDataSilent,
};
[[nodiscard]] bool loaded(
FilePathResolveType type = FilePathResolveCached) const;
FilePathResolve resolve = FilePathResolve::Cached) const;
[[nodiscard]] bool loading() const;
[[nodiscard]] QString loadingFilePath() const;
[[nodiscard]] bool displayLoading() const;
@@ -129,7 +129,7 @@ public:
void setLocation(const FileLocation &loc);
[[nodiscard]] QString filepath(
FilePathResolveType type = FilePathResolveCached) const;
FilePathResolve resolve = FilePathResolve::Cached) const;
[[nodiscard]] bool saveToCache() const;
@@ -344,6 +344,18 @@ protected:
};
class DocumentOpenWithClickHandler : public DocumentClickHandler {
public:
using DocumentClickHandler::DocumentClickHandler;
static void Open(
Data::FileOrigin origin,
not_null<DocumentData*> document);
protected:
void onClickImpl() const override;
};
class VoiceSeekClickHandler : public DocumentOpenClickHandler {
public:
using DocumentOpenClickHandler::DocumentOpenClickHandler;