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

void KBearSiteManager::setSite ( const Site site  ) 

Definition at line 336 of file kbearsitemanager.cpp.

References Connection::anonym(), Connection::autoReconnect(), Connection::binaryMode(), decodePassword(), Site::description(), Connection::enableLog(), Connection::extendedPassiveMode(), Connection::fileSysEncoding(), Connection::host(), Connection::label(), Connection::listA(), Connection::localPath(), Connection::markPartial(), Connection::numOfRetries(), Site::parent(), Connection::pass(), Connection::passiveMode(), Connection::port(), Connection::protocol(), Connection::queue(), Connection::reconnectTime(), Connection::remotePath(), Connection::singleConnection(), slotConnect(), and Connection::user().

Referenced by clear().

                                                 {
      siteEdit->setText( site.label() );
      hostNameEdit->setText( site.host() );
      kdDebug()<<"KBearSiteManager::setSite protocol="<<site.protocol()<<endl;
      QString prot = (site.protocol()=="kbearftp"?QString::fromLatin1("ftp"):site.protocol());
      p_protocolComboBox->setCurrentItem( prot );
      anonymousCheck->setChecked( site.anonym() );
      userNameEdit->setCurrentText( site.user() );
      passwordEdit->setText( decodePassword( site.pass() ) );
      defaultLocalDirEdit->setText( site.localPath() );
      defaultRemoteDirEdit->setText( site.remotePath() );
      p_portSpinBox->setValue( site.port() );
      descriptionEdit->setText( site.description() );
      // Advanced settings
      m_advancedDialog->p_autoReconnectCheckBox->setChecked( site.autoReconnect() );
      m_advancedDialog->p_reconnectTime->setValue( site.reconnectTime() );
      m_advancedDialog->p_numOfRetries->setValue( site.numOfRetries() );
      if( site.binaryMode() )
            m_advancedDialog->p_binaryModeRadioButton->setChecked( true );
      else
            m_advancedDialog->p_asciiModeRadioButton->setChecked( true );

      m_advancedDialog->p_disableLogging->setChecked( ! site.enableLog() );
      m_advancedDialog->p_partExtensionCheckBox->setChecked( site.markPartial() );
      m_advancedDialog->p_disablePassiveMode->setChecked( ! site.passiveMode() );
      m_advancedDialog->p_disableExtendedPassiveMode->setChecked( ! site.extendedPassiveMode() );
      m_advancedDialog->p_disableListA->setChecked( ! site.listA() );
      m_advancedDialog->p_queueTransfers->setChecked( site.queue() );
      m_advancedDialog->p_singleConnection->setChecked( site.singleConnection() );
      QString fileSysEncoding = site.fileSysEncoding();
       for( int i = 0; i < m_advancedDialog->m_encodingComboBox->count(); i++ ) {
            QString tmp = KGlobal::charsets()->encodingForName( m_advancedDialog->m_encodingComboBox->text( i ) );
            if( tmp == fileSysEncoding ) {
                  m_advancedDialog->m_encodingComboBox->setCurrentItem( i );
                  break;
            }
      }


      m_isModified = false;
      m_selectedItem = site;
      p_advancedSettingsButton->setEnabled( true );
      connectButton->setEnabled( true );
      saveButton->setEnabled( false );
      QListViewItem* parentItem = siteTreeView->findParentByFullName( site.parent() );
      if( parentItem ) {
            QListViewItem* item = siteTreeView->findItemByName( parentItem, site.label() );
            if( item ) {
                  siteTreeView->ensureItemVisible( item );        
                  siteTreeView->blockSignals( true );
                  siteTreeView->setSelected( item, true );        
                  siteTreeView->blockSignals( false );
            }
      }
      if( m_pendingConnect ) {
            slotConnect();
            m_pendingConnect = false;
      }
      kdDebug()<<"KBearSiteManager::setSite="<<passwordEdit->text()<<endl;          
}


Generated by  Doxygen 1.6.0   Back to index