@ -1,6 +1,7 @@
@@ -1,6 +1,7 @@
/*
* Bittorrent Client using Qt4 and libtorrent .
* Copyright ( C ) 2010 Christophe Dumez
* Bittorrent Client using Qt and libtorrent .
* Copyright ( C ) 2017 Mike Tzou ( Chocobo1 )
* Copyright ( C ) 2010 Christophe Dumez < chris @ qbittorrent . org >
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
@ -24,8 +25,6 @@
@@ -24,8 +25,6 @@
* 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 .
*
* Contact : chris @ qbittorrent . org
*/
# include "torrentcreatordlg.h"
@ -68,8 +67,8 @@ TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent, const QString &defaultPath
@@ -68,8 +67,8 @@ TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent, const QString &defaultPath
m_ui - > buttonBox - > button ( QDialogButtonBox : : Ok ) - > setText ( tr ( " Create Torrent " ) ) ;
connect ( m_ui - > addFile_b utton , SIGNAL ( clicked ( bool ) ) , SLOT ( onAddFileButtonClicked ( ) ) ) ;
connect ( m_ui - > addFolder_b utton , SIGNAL ( clicked ( bool ) ) , SLOT ( onAddFolderButtonClicked ( ) ) ) ;
connect ( m_ui - > addFileB utton , SIGNAL ( clicked ( bool ) ) , SLOT ( onAddFileButtonClicked ( ) ) ) ;
connect ( m_ui - > addFolderB utton , SIGNAL ( clicked ( bool ) ) , SLOT ( onAddFolderButtonClicked ( ) ) ) ;
connect ( m_ui - > buttonBox , SIGNAL ( accepted ( ) ) , SLOT ( onCreateButtonClicked ( ) ) ) ;
connect ( m_creatorThread , SIGNAL ( creationSuccess ( QString , QString ) ) , this , SLOT ( handleCreationSuccess ( QString , QString ) ) ) ;
@ -164,12 +163,12 @@ void TorrentCreatorDlg::onCreateButtonClicked()
@@ -164,12 +163,12 @@ void TorrentCreatorDlg::onCreateButtonClicked()
setInteractionEnabled ( false ) ;
setCursor ( QCursor ( Qt : : WaitCursor ) ) ;
QStringList trackers = m_ui - > trackers_l ist - > toPlainText ( ) . split ( " \n " ) ;
QStringList urlSeeds = m_ui - > URLSeeds_l ist - > toPlainText ( ) . split ( " \n " ) ;
QString comment = m_ui - > txt_c omment - > toPlainText ( ) ;
QStringList trackers = m_ui - > trackersL ist - > toPlainText ( ) . split ( " \n " ) ;
QStringList urlSeeds = m_ui - > URLSeedsL ist - > toPlainText ( ) . split ( " \n " ) ;
QString comment = m_ui - > txtC omment - > toPlainText ( ) ;
// run the creator thread
m_creatorThread - > create ( input , destination , trackers , urlSeeds , comment , m_ui - > check_p rivate - > isChecked ( ) , getPieceSize ( ) ) ;
m_creatorThread - > create ( input , destination , trackers , urlSeeds , comment , m_ui - > checkP rivate - > isChecked ( ) , getPieceSize ( ) ) ;
}
void TorrentCreatorDlg : : handleCreationFailure ( const QString & msg )
@ -211,13 +210,13 @@ void TorrentCreatorDlg::updateProgressBar(int progress)
@@ -211,13 +210,13 @@ void TorrentCreatorDlg::updateProgressBar(int progress)
void TorrentCreatorDlg : : setInteractionEnabled ( bool enabled )
{
m_ui - > textInputPath - > setEnabled ( enabled ) ;
m_ui - > addFile_b utton - > setEnabled ( enabled ) ;
m_ui - > addFolder_b utton - > setEnabled ( enabled ) ;
m_ui - > trackers_l ist - > setEnabled ( enabled ) ;
m_ui - > URLSeeds_l ist - > setEnabled ( enabled ) ;
m_ui - > txt_c omment - > setEnabled ( enabled ) ;
m_ui - > addFileB utton - > setEnabled ( enabled ) ;
m_ui - > addFolderB utton - > setEnabled ( enabled ) ;
m_ui - > trackersL ist - > setEnabled ( enabled ) ;
m_ui - > URLSeedsL ist - > setEnabled ( enabled ) ;
m_ui - > txtC omment - > setEnabled ( enabled ) ;
m_ui - > comboPieceSize - > setEnabled ( enabled ) ;
m_ui - > check_p rivate - > setEnabled ( enabled ) ;
m_ui - > checkP rivate - > setEnabled ( enabled ) ;
m_ui - > checkStartSeeding - > setEnabled ( enabled ) ;
m_ui - > buttonBox - > button ( QDialogButtonBox : : Ok ) - > setEnabled ( enabled ) ;
m_ui - > checkIgnoreShareLimits - > setEnabled ( enabled & & m_ui - > checkStartSeeding - > isChecked ( ) ) ;
@ -228,13 +227,13 @@ void TorrentCreatorDlg::saveSettings()
@@ -228,13 +227,13 @@ void TorrentCreatorDlg::saveSettings()
m_storeLastAddPath = m_ui - > textInputPath - > text ( ) . trimmed ( ) ;
m_storePieceSize = m_ui - > comboPieceSize - > currentIndex ( ) ;
m_storePrivateTorrent = m_ui - > check_p rivate - > isChecked ( ) ;
m_storePrivateTorrent = m_ui - > checkP rivate - > isChecked ( ) ;
m_storeStartSeeding = m_ui - > checkStartSeeding - > isChecked ( ) ;
m_storeIgnoreRatio = m_ui - > checkIgnoreShareLimits - > isChecked ( ) ;
m_storeTrackerList = m_ui - > trackers_l ist - > toPlainText ( ) ;
m_storeWebSeedList = m_ui - > URLSeeds_l ist - > toPlainText ( ) ;
m_storeComments = m_ui - > txt_c omment - > toPlainText ( ) ;
m_storeTrackerList = m_ui - > trackersL ist - > toPlainText ( ) ;
m_storeWebSeedList = m_ui - > URLSeedsL ist - > toPlainText ( ) ;
m_storeComments = m_ui - > txtC omment - > toPlainText ( ) ;
m_storeDialogSize = size ( ) ;
}
@ -244,14 +243,14 @@ void TorrentCreatorDlg::loadSettings()
@@ -244,14 +243,14 @@ void TorrentCreatorDlg::loadSettings()
m_ui - > textInputPath - > setText ( m_storeLastAddPath ) ;
m_ui - > comboPieceSize - > setCurrentIndex ( m_storePieceSize ) ;
m_ui - > check_p rivate - > setChecked ( m_storePrivateTorrent ) ;
m_ui - > checkP rivate - > setChecked ( m_storePrivateTorrent ) ;
m_ui - > checkStartSeeding - > setChecked ( m_storeStartSeeding ) ;
m_ui - > checkIgnoreShareLimits - > setChecked ( m_storeIgnoreRatio ) ;
m_ui - > checkIgnoreShareLimits - > setEnabled ( m_ui - > checkStartSeeding - > isChecked ( ) ) ;
m_ui - > trackers_l ist - > setPlainText ( m_storeTrackerList ) ;
m_ui - > URLSeeds_l ist - > setPlainText ( m_storeWebSeedList ) ;
m_ui - > txt_c omment - > setPlainText ( m_storeComments ) ;
m_ui - > trackersL ist - > setPlainText ( m_storeTrackerList ) ;
m_ui - > URLSeedsL ist - > setPlainText ( m_storeWebSeedList ) ;
m_ui - > txtC omment - > setPlainText ( m_storeComments ) ;
if ( m_storeDialogSize . value ( ) . isValid ( ) )
resize ( m_storeDialogSize ) ;