1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-04 05:56:02 +00:00
transmission/qt/OptionsDialog.h
Charles Kerr b0ee4007ff
refactor: include cleanups (#2392)
* refactor: include <memory> when using shared_ptr or unique_ptr

* refactor: include <cstdio> iff we use it

* refactor: include <cstring> iff we use it

* refactor: include <cstdlib> iff we use it

* refactor: include <string_view> or <string> iff we use it

* refactor: include <array> iff we use it

* refactor: include <ctime> iff we use it

* refactor: include <cctype> iff we use it

* refactor: misc #include cleanups in libtransmission
2022-01-12 20:13:58 -06:00

77 lines
1.5 KiB
C++

/*
* This file Copyright (C) 2009-2015 Mnemosyne LLC
*
* It may be used under the GNU GPL versions 2 or 3
* or any future license endorsed by Mnemosyne LLC.
*
*/
#pragma once
#include <optional>
#include <vector>
#include <QDir>
#include <QFile>
#include <QMap>
#include <QSet>
#include <QString>
#include <QTimer>
#include <libtransmission/tr-macros.h>
#include "AddData.h" // AddData
#include "BaseDialog.h"
#include "Torrent.h" // FileList
#include "ui_OptionsDialog.h"
#include <libtransmission/transmission.h>
#include <libtransmission/torrent-metainfo.h>
class Prefs;
class Session;
extern "C"
{
struct tr_variant;
}
class OptionsDialog : public BaseDialog
{
Q_OBJECT
TR_DISABLE_COPY_MOVE(OptionsDialog)
public:
OptionsDialog(Session& session, Prefs const& prefs, AddData addme, QWidget* parent = nullptr);
~OptionsDialog() override;
private slots:
void onAccepted();
void onPriorityChanged(QSet<int> const& file_indices, int);
void onWantedChanged(QSet<int> const& file_indices, bool);
void onSourceChanged();
void onDestinationChanged();
void onSessionUpdated();
private:
using mybins_t = QMap<uint32_t, int32_t>;
void reload();
void updateWidgetsLocality();
void clearInfo();
AddData add_;
FileList files_;
QDir local_destination_;
QTimer edit_timer_;
std::vector<bool> wanted_;
std::vector<int> priorities_;
Session& session_;
Ui::OptionsDialog ui_ = {};
std::optional<tr_torrent_metainfo> metainfo_;
bool is_local_ = {};
};