2009-04-09 18:55:47 +00:00
|
|
|
/*
|
2015-06-10 21:27:11 +00:00
|
|
|
* This file Copyright (C) 2009-2015 Mnemosyne LLC
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2014-01-21 03:10:30 +00:00
|
|
|
* It may be used under the GNU GPL versions 2 or 3
|
2014-01-19 01:09:44 +00:00
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2009-05-31 19:33:48 +00:00
|
|
|
* $Id$
|
2009-04-09 18:55:47 +00:00
|
|
|
*/
|
|
|
|
|
2015-06-10 21:27:11 +00:00
|
|
|
#ifndef QTR_OPTIONS_DIALOG_H
|
|
|
|
#define QTR_OPTIONS_DIALOG_H
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2014-12-29 04:03:56 +00:00
|
|
|
#include <QCryptographicHash>
|
2009-04-09 18:55:47 +00:00
|
|
|
#include <QDir>
|
2014-12-29 04:03:56 +00:00
|
|
|
#include <QFile>
|
2009-04-09 18:55:47 +00:00
|
|
|
#include <QMap>
|
2010-08-01 18:55:04 +00:00
|
|
|
#include <QString>
|
2009-04-09 18:55:47 +00:00
|
|
|
#include <QTimer>
|
2014-12-29 04:03:56 +00:00
|
|
|
#include <QVector>
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2015-06-10 21:27:11 +00:00
|
|
|
#include "AddData.h" // AddData
|
2015-09-01 20:19:26 +00:00
|
|
|
#include "BaseDialog.h"
|
2015-06-10 21:27:11 +00:00
|
|
|
#include "Torrent.h" // FileList
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2015-06-10 21:27:11 +00:00
|
|
|
#include "ui_OptionsDialog.h"
|
2013-02-09 04:05:03 +00:00
|
|
|
|
|
|
|
class Prefs;
|
2009-04-09 18:55:47 +00:00
|
|
|
class Session;
|
|
|
|
|
2013-08-24 19:26:21 +00:00
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
struct tr_variant;
|
|
|
|
}
|
2009-05-15 02:05:07 +00:00
|
|
|
|
2015-09-01 20:19:26 +00:00
|
|
|
class OptionsDialog: public BaseDialog
|
2009-04-09 18:55:47 +00:00
|
|
|
{
|
2013-02-09 21:47:42 +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;
|
2013-02-09 21:47:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void reload ();
|
|
|
|
void clearInfo ();
|
2014-12-29 04:03:56 +00:00
|
|
|
void clearVerify ();
|
2013-02-09 21:47:42 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onAccepted ();
|
|
|
|
void onPriorityChanged (const QSet<int>& fileIndices, int);
|
|
|
|
void onWantedChanged (const QSet<int>& fileIndices, bool);
|
|
|
|
void onVerify ();
|
|
|
|
void onTimeout ();
|
2014-12-29 04:03:56 +00:00
|
|
|
|
2014-12-31 21:00:34 +00:00
|
|
|
void onSourceChanged ();
|
|
|
|
void onDestinationChanged ();
|
2013-02-09 21:47:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Session& mySession;
|
|
|
|
AddData myAdd;
|
2015-06-12 22:12:12 +00:00
|
|
|
|
|
|
|
Ui::OptionsDialog ui;
|
|
|
|
|
2013-02-09 23:11:17 +00:00
|
|
|
QDir myLocalDestination;
|
2013-02-09 21:47:42 +00:00
|
|
|
bool myHaveInfo;
|
|
|
|
tr_info myInfo;
|
|
|
|
QPushButton * myVerifyButton;
|
|
|
|
QVector<int> myPriorities;
|
|
|
|
QVector<bool> myWanted;
|
|
|
|
FileList myFiles;
|
|
|
|
|
|
|
|
QTimer myVerifyTimer;
|
2014-12-29 04:03:56 +00:00
|
|
|
char myVerifyBuf[2048 * 4];
|
2013-02-09 21:47:42 +00:00
|
|
|
QFile myVerifyFile;
|
2013-08-29 00:37:37 +00:00
|
|
|
uint64_t myVerifyFilePos;
|
2013-02-09 21:47:42 +00:00
|
|
|
int myVerifyFileIndex;
|
2013-08-29 00:37:37 +00:00
|
|
|
uint32_t myVerifyPieceIndex;
|
|
|
|
uint32_t myVerifyPiecePos;
|
2013-02-09 21:47:42 +00:00
|
|
|
QVector<bool> myVerifyFlags;
|
|
|
|
QCryptographicHash myVerifyHash;
|
|
|
|
mybins_t myVerifyBins;
|
|
|
|
QTimer myEditTimer;
|
2009-04-09 18:55:47 +00:00
|
|
|
};
|
|
|
|
|
2015-06-10 21:27:11 +00:00
|
|
|
#endif // QTR_OPTIONS_DIALOG_H
|