2009-04-09 18:55:47 +00:00
|
|
|
/*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This file Copyright (C) Mnemosyne LLC
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MAKE_DIALOG_H
|
|
|
|
#define MAKE_DIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
struct QAbstractButton;
|
|
|
|
struct QPlainTextEdit;
|
|
|
|
struct QLineEdit;
|
|
|
|
struct QCheckBox;
|
|
|
|
struct QLabel;
|
|
|
|
struct QPushButton;
|
2009-10-05 19:53:38 +00:00
|
|
|
struct QRadioButton;
|
2009-04-09 18:55:47 +00:00
|
|
|
struct Session;
|
2009-10-05 19:53:38 +00:00
|
|
|
struct QProgressBar;
|
|
|
|
struct QDialogButtonBox;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
struct tr_metainfo_builder;
|
|
|
|
}
|
|
|
|
|
|
|
|
class MakeDialog: public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onSourceChanged( );
|
|
|
|
void onButtonBoxClicked( QAbstractButton* );
|
2009-10-05 19:53:38 +00:00
|
|
|
void onNewButtonBoxClicked( QAbstractButton* );
|
|
|
|
void onNewDialogDestroyed( QObject* );
|
2009-04-09 18:55:47 +00:00
|
|
|
void onProgress( );
|
2009-10-05 19:53:38 +00:00
|
|
|
|
|
|
|
void onFolderClicked( );
|
2010-08-02 20:55:11 +00:00
|
|
|
void onFolderSelected( const QString& );
|
2009-10-05 19:53:38 +00:00
|
|
|
void onFolderSelected( const QStringList& );
|
2010-08-02 20:55:11 +00:00
|
|
|
|
2009-10-05 19:53:38 +00:00
|
|
|
void onFileClicked( );
|
2010-08-02 20:55:11 +00:00
|
|
|
void onFileSelected( const QString& );
|
2009-10-05 19:53:38 +00:00
|
|
|
void onFileSelected( const QStringList& );
|
2010-08-02 20:55:11 +00:00
|
|
|
|
2009-10-05 19:53:38 +00:00
|
|
|
void onDestinationClicked( );
|
2010-08-02 20:55:11 +00:00
|
|
|
void onDestinationSelected( const QString& );
|
2009-10-05 19:53:38 +00:00
|
|
|
void onDestinationSelected( const QStringList& );
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void makeTorrent( );
|
2009-10-05 19:53:38 +00:00
|
|
|
QString getSource( ) const;
|
|
|
|
void enableBuddyWhenChecked( QCheckBox *, QWidget * );
|
|
|
|
void enableBuddyWhenChecked( QRadioButton *, QWidget * );
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
private:
|
2009-10-05 19:53:38 +00:00
|
|
|
Session& mySession;
|
|
|
|
QString myDestination;
|
|
|
|
QString myTarget;
|
|
|
|
QString myFile;
|
|
|
|
QString myFolder;
|
2009-04-09 18:55:47 +00:00
|
|
|
QTimer myTimer;
|
2009-10-05 19:53:38 +00:00
|
|
|
QRadioButton * myFolderRadio;
|
|
|
|
QRadioButton * myFileRadio;
|
|
|
|
QPushButton * myDestinationButton;
|
|
|
|
QPushButton * myFileButton;
|
|
|
|
QPushButton * myFolderButton;
|
2009-04-09 18:55:47 +00:00
|
|
|
QPlainTextEdit * myTrackerEdit;
|
2009-10-05 19:53:38 +00:00
|
|
|
QCheckBox * myCommentCheck;
|
2009-04-09 18:55:47 +00:00
|
|
|
QLineEdit * myCommentEdit;
|
|
|
|
QCheckBox * myPrivateCheck;
|
2009-10-05 19:53:38 +00:00
|
|
|
QLabel * mySourceLabel;
|
|
|
|
QDialogButtonBox * myButtonBox;
|
|
|
|
QProgressBar * myNewProgress;
|
|
|
|
QLabel * myNewLabel;
|
|
|
|
QDialogButtonBox * myNewButtonBox;
|
|
|
|
QDialog * myNewDialog;
|
2009-04-09 18:55:47 +00:00
|
|
|
struct tr_metainfo_builder * myBuilder;
|
|
|
|
|
2010-08-02 20:55:11 +00:00
|
|
|
protected:
|
|
|
|
virtual void dragEnterEvent( QDragEnterEvent * );
|
|
|
|
virtual void dropEvent( QDropEvent * );
|
|
|
|
|
2009-04-09 18:55:47 +00:00
|
|
|
public:
|
|
|
|
MakeDialog( Session&, QWidget * parent = 0 );
|
|
|
|
~MakeDialog( );
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|