Files
tdesktop/Telegram/SourceFiles/boxes/download_path_box.h
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
init
2026-02-16 15:50:16 +03:00

60 lines
1.3 KiB
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "ui/layers/box_content.h"
namespace Ui {
template <typename Enum>
class RadioenumGroup;
template <typename Enum>
class Radioenum;
class LinkButton;
} // namespace Ui
namespace Window {
class SessionController;
} // namespace Window
class DownloadPathBox : public Ui::BoxContent {
public:
DownloadPathBox(
QWidget *parent,
not_null<Window::SessionController*> controller);
protected:
void prepare() override;
void resizeEvent(QResizeEvent *e) override;
private:
enum class Directory {
Downloads,
Temp,
Custom,
};
void radioChanged(Directory value);
Directory typeFromPath(const QString &path);
void save();
void updateControlsVisibility();
void setPathText(const QString &text);
void editPath();
const not_null<Window::SessionController*> _controller;
QString _path;
QByteArray _pathBookmark;
std::shared_ptr<Ui::RadioenumGroup<Directory>> _group;
object_ptr<Ui::Radioenum<Directory>> _default;
object_ptr<Ui::Radioenum<Directory>> _temp;
object_ptr<Ui::Radioenum<Directory>> _dir;
object_ptr<Ui::LinkButton> _pathLink;
};