2006-09-30 20:02:39 +04:00
|
|
|
/*
|
2017-06-15 15:40:59 +03:00
|
|
|
* Bittorrent Client using Qt and libtorrent.
|
|
|
|
* Copyright (C) 2011 Christophe Dumez <chris@qbittorrent.org>
|
2006-09-30 20:02:39 +04:00
|
|
|
*
|
2007-07-14 18:31:59 +04:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2006-09-30 20:02:39 +04:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-14 18:31:59 +04:00
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2009-04-05 21:00:55 +04:00
|
|
|
* In addition, as a special exception, the copyright holders give permission to
|
|
|
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
|
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
|
|
* and distribute the linked executables. You must obey the GNU General Public
|
|
|
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
|
|
* modify file(s), you may extend this exception to your version of the file(s),
|
|
|
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
|
|
* exception statement from your version.
|
2006-09-30 20:02:39 +04:00
|
|
|
*/
|
|
|
|
|
2020-12-10 20:56:37 +03:00
|
|
|
#pragma once
|
2006-09-30 20:02:39 +04:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2017-09-11 21:32:11 +03:00
|
|
|
#include "base/settingvalue.h"
|
2006-09-30 20:02:39 +04:00
|
|
|
|
2011-02-27 18:41:05 +03:00
|
|
|
class QStandardItemModel;
|
|
|
|
|
2018-12-29 13:22:15 +03:00
|
|
|
namespace BitTorrent
|
|
|
|
{
|
2021-01-06 15:12:40 +03:00
|
|
|
class Torrent;
|
2018-12-29 13:22:15 +03:00
|
|
|
}
|
2019-02-24 19:31:39 +03:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class PreviewSelectDialog;
|
|
|
|
}
|
2017-06-15 15:40:59 +03:00
|
|
|
class PreviewListDelegate;
|
2006-09-30 20:02:39 +04:00
|
|
|
|
2020-04-19 05:42:11 +03:00
|
|
|
class PreviewSelectDialog final : public QDialog
|
2017-06-15 15:40:59 +03:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2021-06-29 09:45:23 +03:00
|
|
|
Q_DISABLE_COPY_MOVE(PreviewSelectDialog)
|
2010-12-26 12:51:37 +03:00
|
|
|
|
|
|
|
public:
|
2017-06-15 15:40:59 +03:00
|
|
|
enum PreviewColumn
|
|
|
|
{
|
|
|
|
NAME,
|
|
|
|
SIZE,
|
|
|
|
PROGRESS,
|
|
|
|
FILE_INDEX,
|
|
|
|
|
|
|
|
NB_COLUMNS
|
|
|
|
};
|
|
|
|
|
2021-01-06 15:12:40 +03:00
|
|
|
PreviewSelectDialog(QWidget *parent, const BitTorrent::Torrent *torrent);
|
2017-09-11 21:32:11 +03:00
|
|
|
~PreviewSelectDialog();
|
2006-09-30 20:02:39 +04:00
|
|
|
|
2009-11-27 14:38:42 +03:00
|
|
|
signals:
|
2017-06-15 15:40:59 +03:00
|
|
|
void readyToPreviewFile(QString) const;
|
2006-09-30 20:02:39 +04:00
|
|
|
|
2017-09-15 08:57:55 +03:00
|
|
|
private slots:
|
|
|
|
void previewButtonClicked();
|
2006-09-30 20:02:39 +04:00
|
|
|
|
2010-12-26 12:51:37 +03:00
|
|
|
private:
|
2019-10-02 14:19:33 +03:00
|
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
|
2017-09-11 21:32:11 +03:00
|
|
|
void loadWindowState();
|
|
|
|
void saveWindowState();
|
|
|
|
|
2019-02-24 19:31:39 +03:00
|
|
|
Ui::PreviewSelectDialog *m_ui;
|
2017-06-15 15:40:59 +03:00
|
|
|
QStandardItemModel *m_previewListModel;
|
|
|
|
PreviewListDelegate *m_listDelegate;
|
2021-01-06 15:12:40 +03:00
|
|
|
const BitTorrent::Torrent *m_torrent;
|
2017-09-11 21:32:11 +03:00
|
|
|
bool m_headerStateInitialized = false;
|
|
|
|
|
|
|
|
// Settings
|
2020-12-28 18:32:59 +03:00
|
|
|
SettingValue<QSize> m_storeDialogSize;
|
|
|
|
SettingValue<QByteArray> m_storeTreeHeaderState;
|
2006-09-30 20:02:39 +04:00
|
|
|
};
|