transmission/qt/OptionsDialog.h

89 lines
1.8 KiB
C
Raw Normal View History

2009-04-09 18:55:47 +00:00
/*
* This file Copyright (C) 2009-2015 Mnemosyne LLC
2009-04-09 18:55:47 +00:00
*
* It may be used under the GNU GPL versions 2 or 3
* or any future license endorsed by Mnemosyne LLC.
2009-04-09 18:55:47 +00:00
*
* $Id$
2009-04-09 18:55:47 +00:00
*/
#ifndef QTR_OPTIONS_DIALOG_H
#define QTR_OPTIONS_DIALOG_H
2009-04-09 18:55:47 +00:00
#include <QCryptographicHash>
2009-04-09 18:55:47 +00:00
#include <QDialog>
#include <QDir>
#include <QFile>
2009-04-09 18:55:47 +00:00
#include <QMap>
#include <QString>
2009-04-09 18:55:47 +00:00
#include <QTimer>
#include <QVector>
2009-04-09 18:55:47 +00:00
#include "AddData.h" // AddData
#include "Torrent.h" // FileList
2009-04-09 18:55:47 +00:00
#include "ui_OptionsDialog.h"
class Prefs;
2009-04-09 18:55:47 +00:00
class Session;
extern "C"
{
struct tr_variant;
}
class OptionsDialog: public QDialog
2009-04-09 18:55:47 +00:00
{
Q_OBJECT
public:
2015-06-12 22:12:12 +00:00
OptionsDialog (Session& session, const Prefs& prefs, const AddData& addme, QWidget * parent = nullptr);
virtual ~OptionsDialog ();
private:
typedef QMap<uint32_t, int32_t> mybins_t;
private:
void reload ();
void clearInfo ();
void clearVerify ();
private slots:
void onAccepted ();
void onPriorityChanged (const QSet<int>& fileIndices, int);
void onWantedChanged (const QSet<int>& fileIndices, bool);
void onVerify ();
void onTimeout ();
void onSourceChanged ();
void onDestinationChanged ();
private:
Session& mySession;
AddData myAdd;
2015-06-12 22:12:12 +00:00
Ui::OptionsDialog ui;
QDir myLocalDestination;
bool myHaveInfo;
tr_info myInfo;
QPushButton * myVerifyButton;
QVector<int> myPriorities;
QVector<bool> myWanted;
FileList myFiles;
QTimer myVerifyTimer;
char myVerifyBuf[2048 * 4];
QFile myVerifyFile;
uint64_t myVerifyFilePos;
int myVerifyFileIndex;
uint32_t myVerifyPieceIndex;
uint32_t myVerifyPiecePos;
QVector<bool> myVerifyFlags;
QCryptographicHash myVerifyHash;
mybins_t myVerifyBins;
QTimer myEditTimer;
2009-04-09 18:55:47 +00:00
};
#endif // QTR_OPTIONS_DIALOG_H