Logo Search packages:      
Sourcecode: kbear version File versions  Download package

kbearsitemanageradvanceddialog.cpp

#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './kbearsitemanageradvanceddialog.ui'
**
** Created: Sa Nov 22 17:47:04 2003
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.2.1   edited May 19 14:22 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kbearsitemanageradvanceddialog.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <kcombobox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qframe.h>
#include <knuminput.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "./kbearsitemanageradvanceddialog.ui.h"

/*
 *  Constructs a KBearSiteManagerAdvancedDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
KBearSiteManagerAdvancedDialog::KBearSiteManagerAdvancedDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
      setName( "KBearSiteManagerAdvancedDialog" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setSizeGripEnabled( TRUE );
    KBearSiteManagerAdvancedDialogLayout = new QVBoxLayout( this, 11, 6, "KBearSiteManagerAdvancedDialogLayout"); 

    p_disablePassiveMode = new QCheckBox( this, "p_disablePassiveMode" );
    p_disablePassiveMode->setChecked( TRUE );
    KBearSiteManagerAdvancedDialogLayout->addWidget( p_disablePassiveMode );

    p_disableExtendedPassiveMode = new QCheckBox( this, "p_disableExtendedPassiveMode" );
    p_disableExtendedPassiveMode->setChecked( TRUE );
    KBearSiteManagerAdvancedDialogLayout->addWidget( p_disableExtendedPassiveMode );

    p_disableListA = new QCheckBox( this, "p_disableListA" );
    KBearSiteManagerAdvancedDialogLayout->addWidget( p_disableListA );

    p_partExtensionCheckBox = new QCheckBox( this, "p_partExtensionCheckBox" );
    p_partExtensionCheckBox->setChecked( TRUE );
    KBearSiteManagerAdvancedDialogLayout->addWidget( p_partExtensionCheckBox );

    p_disableLogging = new QCheckBox( this, "p_disableLogging" );
    p_disableLogging->setChecked( TRUE );
    KBearSiteManagerAdvancedDialogLayout->addWidget( p_disableLogging );

    p_queueTransfers = new QCheckBox( this, "p_queueTransfers" );
    KBearSiteManagerAdvancedDialogLayout->addWidget( p_queueTransfers );

    p_singleConnection = new QCheckBox( this, "p_singleConnection" );
    KBearSiteManagerAdvancedDialogLayout->addWidget( p_singleConnection );

    TextLabel1 = new QLabel( this, "TextLabel1" );
    KBearSiteManagerAdvancedDialogLayout->addWidget( TextLabel1 );

    m_encodingComboBox = new KComboBox( FALSE, this, "m_encodingComboBox" );
    m_encodingComboBox->setAutoCompletion( FALSE );
    m_encodingComboBox->setDuplicatesEnabled( FALSE );
    KBearSiteManagerAdvancedDialogLayout->addWidget( m_encodingComboBox );

    ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" );
    ButtonGroup1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, ButtonGroup1->sizePolicy().hasHeightForWidth() ) );
    ButtonGroup1->setColumnLayout(0, Qt::Vertical );
    ButtonGroup1->layout()->setSpacing( 6 );
    ButtonGroup1->layout()->setMargin( 11 );
    ButtonGroup1Layout = new QHBoxLayout( ButtonGroup1->layout() );
    ButtonGroup1Layout->setAlignment( Qt::AlignTop );

    p_binaryModeRadioButton = new QRadioButton( ButtonGroup1, "p_binaryModeRadioButton" );
    p_binaryModeRadioButton->setChecked( TRUE );
    ButtonGroup1Layout->addWidget( p_binaryModeRadioButton );

    p_asciiModeRadioButton = new QRadioButton( ButtonGroup1, "p_asciiModeRadioButton" );
    ButtonGroup1Layout->addWidget( p_asciiModeRadioButton );
    KBearSiteManagerAdvancedDialogLayout->addWidget( ButtonGroup1 );

    Frame6 = new QFrame( this, "Frame6" );
    Frame6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, Frame6->sizePolicy().hasHeightForWidth() ) );
    Frame6->setMinimumSize( QSize( 0, 100 ) );
    Frame6->setFrameShape( QFrame::Box );
    Frame6->setFrameShadow( QFrame::Raised );
    Frame6Layout = new QGridLayout( Frame6, 1, 1, 11, 6, "Frame6Layout"); 

    p_autoReconnectCheckBox = new QCheckBox( Frame6, "p_autoReconnectCheckBox" );
    p_autoReconnectCheckBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, p_autoReconnectCheckBox->sizePolicy().hasHeightForWidth() ) );
    p_autoReconnectCheckBox->setChecked( TRUE );

    Frame6Layout->addWidget( p_autoReconnectCheckBox, 0, 0 );

    p_reconnectTime = new KIntSpinBox( Frame6, "p_reconnectTime" );
    p_reconnectTime->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, p_reconnectTime->sizePolicy().hasHeightForWidth() ) );
    p_reconnectTime->setMaxValue( 600 );
    p_reconnectTime->setMinValue( 1 );
    p_reconnectTime->setValue( 30 );

    Frame6Layout->addWidget( p_reconnectTime, 1, 1 );

    p_numOfRetries = new KIntSpinBox( Frame6, "p_numOfRetries" );
    p_numOfRetries->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, p_numOfRetries->sizePolicy().hasHeightForWidth() ) );
    p_numOfRetries->setMaxValue( 100 );
    p_numOfRetries->setValue( 10 );

    Frame6Layout->addWidget( p_numOfRetries, 2, 1 );

    numOfRetriesTextLabel = new QLabel( Frame6, "numOfRetriesTextLabel" );
    numOfRetriesTextLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, numOfRetriesTextLabel->sizePolicy().hasHeightForWidth() ) );

    Frame6Layout->addWidget( numOfRetriesTextLabel, 2, 0 );

    autoReconnectTextLabel = new QLabel( Frame6, "autoReconnectTextLabel" );
    autoReconnectTextLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, autoReconnectTextLabel->sizePolicy().hasHeightForWidth() ) );

    Frame6Layout->addWidget( autoReconnectTextLabel, 1, 0 );
    KBearSiteManagerAdvancedDialogLayout->addWidget( Frame6 );

    Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); 
    QSpacerItem* spacer = new QSpacerItem( 20, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout2->addItem( spacer );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setAccel( QKeySequence( 0 ) );
    buttonCancel->setAutoDefault( TRUE );
    Layout2->addWidget( buttonCancel );

    buttonOk = new QPushButton( this, "buttonOk" );
    buttonOk->setAccel( QKeySequence( 0 ) );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );
    Layout2->addWidget( buttonOk );
    KBearSiteManagerAdvancedDialogLayout->addLayout( Layout2 );
    languageChange();
    resize( QSize(312, 439).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( p_autoReconnectCheckBox, SIGNAL( toggled(bool) ), p_reconnectTime, SLOT( setEnabled(bool) ) );
    connect( p_autoReconnectCheckBox, SIGNAL( toggled(bool) ), p_numOfRetries, SLOT( setEnabled(bool) ) );
    connect( p_disableExtendedPassiveMode, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_partExtensionCheckBox, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_disableLogging, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_binaryModeRadioButton, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_asciiModeRadioButton, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_autoReconnectCheckBox, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_reconnectTime, SIGNAL( valueChanged(int) ), this, SLOT( emitEdited() ) );
    connect( p_numOfRetries, SIGNAL( valueChanged(int) ), this, SLOT( emitEdited() ) );
    connect( p_disablePassiveMode, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_singleConnection, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_disableListA, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_queueTransfers, SIGNAL( clicked() ), this, SLOT( emitEdited() ) );
    connect( p_disablePassiveMode, SIGNAL( toggled(bool) ), this, SLOT( disablePassiveChecked(bool) ) );
    connect( m_encodingComboBox, SIGNAL( activated(const QString&) ), this, SLOT( emitEdited() ) );

    // tab order
    setTabOrder( p_disablePassiveMode, p_disableExtendedPassiveMode );
    setTabOrder( p_disableExtendedPassiveMode, p_disableListA );
    setTabOrder( p_disableListA, p_partExtensionCheckBox );
    setTabOrder( p_partExtensionCheckBox, p_disableLogging );
    setTabOrder( p_disableLogging, p_queueTransfers );
    setTabOrder( p_queueTransfers, p_singleConnection );
    setTabOrder( p_singleConnection, m_encodingComboBox );
    setTabOrder( m_encodingComboBox, p_binaryModeRadioButton );
    setTabOrder( p_binaryModeRadioButton, p_asciiModeRadioButton );
    setTabOrder( p_asciiModeRadioButton, p_autoReconnectCheckBox );
    setTabOrder( p_autoReconnectCheckBox, p_reconnectTime );
    setTabOrder( p_reconnectTime, p_numOfRetries );
    setTabOrder( p_numOfRetries, buttonCancel );
    setTabOrder( buttonCancel, buttonOk );
    init();
}

/*
 *  Destroys the object and frees any allocated resources
 */
KBearSiteManagerAdvancedDialog::~KBearSiteManagerAdvancedDialog()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KBearSiteManagerAdvancedDialog::languageChange()
{
    setCaption( tr2i18n( "Advanced Settings" ) );
    p_disablePassiveMode->setText( tr2i18n( "Disable passive mode (PASV)" ) );
    QToolTip::add( p_disablePassiveMode, tr2i18n( "Check this option if you want to disable passive mode (PASV)." ) );
    QWhatsThis::add( p_disablePassiveMode, tr2i18n( "Check this option if you want to disable passive mode (PASV)." ) );
    p_disableExtendedPassiveMode->setText( tr2i18n( "Disable extended passive mode (EPSV)" ) );
    QToolTip::add( p_disableExtendedPassiveMode, tr2i18n( "Check this option if you want to disable extended passive mode (EPSV)." ) );
    QWhatsThis::add( p_disableExtendedPassiveMode, tr2i18n( "Check this option if you want to disable extended passive mode (EPSV)." ) );
    p_disableListA->setText( tr2i18n( "Do NOT send 'list -a' to list directories." ) );
    QToolTip::add( p_disableListA, tr2i18n( "Check this option if you don't want to send 'list -a' to the server when listing directories." ) );
    QWhatsThis::add( p_disableListA, tr2i18n( "Check this option if you don't want to send 'list -a' to the server when listing directories. Some servers don't understand this option. On the other hand, if you don't send 'list -a' you don't receive hidden files." ) );
    p_partExtensionCheckBox->setText( tr2i18n( "Use .part extension" ) );
    QToolTip::add( p_partExtensionCheckBox, tr2i18n( "Uncheck this option if you don't want the '.part' extension to be used during transfers. This can solve the 'rename problem' on anonymous servers." ) );
    QWhatsThis::add( p_partExtensionCheckBox, tr2i18n( "Uncheck this option if you don't want the '.part' extension to be used during transfers.\n"
"This can solve the 'rename problem' on anonymous servers." ) );
    p_disableLogging->setText( tr2i18n( "Disable logging" ) );
    QToolTip::add( p_disableLogging, tr2i18n( "Check this option if you don't want KBear to produce log information." ) );
    QWhatsThis::add( p_disableLogging, tr2i18n( "Check this option if you don't want KBear to produce log information.\n"
"If you notice reduced transfer speed, you can try to check this, since log information can reduce transfer speed a bit." ) );
    p_queueTransfers->setText( tr2i18n( "Queue transfers" ) );
    QToolTip::add( p_queueTransfers, tr2i18n( "Check this option if you want to queue transfers to or from this site." ) );
    QWhatsThis::add( p_queueTransfers, tr2i18n( "Check this option if you want to queue transfers to or from this site.\n"
"This will override the global queue option if checked." ) );
    p_singleConnection->setText( tr2i18n( "Use a single connection" ) );
    QToolTip::add( p_singleConnection, tr2i18n( "Check this if you want all filesystem operations to use the same connection." ) );
    QWhatsThis::add( p_singleConnection, tr2i18n( "Check this if you want all filesystem operations to use the same connection. This will cause, for example, a listing operation to be blocked until a delete operation is finished. Default is to use several connections, but some systems don't allow this so if you have trouble with this, try to check this option." ) );
    TextLabel1->setText( tr2i18n( "Select encoding for this site:" ) );
    QToolTip::add( m_encodingComboBox, tr2i18n( "Select the encoding used by this site." ) );
    QWhatsThis::add( m_encodingComboBox, tr2i18n( "Select the encoding used by this site.\n"
"Normally you shouldn't need to do this. Some sites, \n"
"like sites using, for example, chinese file names, this can be \n"
"necessary if you want the file names to be displayed correctly." ) );
    ButtonGroup1->setTitle( tr2i18n( "File transfer mode" ) );
    p_binaryModeRadioButton->setText( tr2i18n( "Binary (I)" ) );
    QToolTip::add( p_binaryModeRadioButton, tr2i18n( "Check this option if you want files to be transfered in binary mode." ) );
    QWhatsThis::add( p_binaryModeRadioButton, tr2i18n( "Check this option if you want files to be transfered in binary mode.\n"
"This is normally the best option." ) );
    p_asciiModeRadioButton->setText( tr2i18n( "ASCII (A)" ) );
    QToolTip::add( p_asciiModeRadioButton, tr2i18n( "Check this option if you want files to be transfered in ASCII mode." ) );
    QWhatsThis::add( p_asciiModeRadioButton, tr2i18n( "Check this option if you want files to be transfered in ASCII mode.\n"
"This can be necessary for some filetypes, for example some perl scripts." ) );
    p_autoReconnectCheckBox->setText( tr2i18n( "Reconnect automatically." ) );
    QToolTip::add( p_autoReconnectCheckBox, tr2i18n( "Check this if you want KBear to automatically try to reconnect on connection failure." ) );
    QWhatsThis::add( p_autoReconnectCheckBox, tr2i18n( "Check this if you want KBear to automatically try to reconnect on connection failure." ) );
    QToolTip::add( p_reconnectTime, tr2i18n( "Set number of seconds to wait before trying to reconnect. Only valid if 'Reconnect automatically' is selected." ) );
    QWhatsThis::add( p_reconnectTime, tr2i18n( "Set number of seconds to wait before trying to reconnect. Only valid if 'Reconnect automatically' is selected." ) );
    QToolTip::add( p_numOfRetries, tr2i18n( "Set number of attempts to reconnect. Only valid if 'Reconnect automatically' is selected." ) );
    QWhatsThis::add( p_numOfRetries, tr2i18n( "Set number of attempts to reconnect. Only valid if 'Reconnect automatically' is selected." ) );
    numOfRetriesTextLabel->setText( tr2i18n( "Number of retries." ) );
    autoReconnectTextLabel->setText( tr2i18n( "Wait number of seconds:" ) );
    buttonCancel->setText( tr2i18n( "Cancel" ) );
    buttonOk->setText( tr2i18n( "OK" ) );
}

#include "kbearsitemanageradvanceddialog.moc"

Generated by  Doxygen 1.6.0   Back to index