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

void KBear::slotCreateClient ( const Connection connection  )  [slot]

Definition at line 102 of file kbear_slots.cpp.

References KBearInfoView::addLogPage(), QextMdiMainFrm::addWindow(), Connection::anonym(), decodePassword(), email(), Connection::enableLog(), Connection::fileSysEncoding(), getMdiChildViewCaption(), Connection::label(), Connection::localPath(), QextMdiMainFrm::mdiMode(), Connection::pass(), Connection::protocol(), readTopChildPositionFromIndex(), setChildFrameMode(), Connection::setFireWallAccount(), Connection::setFireWallHost(), Connection::setFireWallMacro(), Connection::setFireWallPass(), Connection::setFireWallPort(), Connection::setFireWallType(), Connection::setFireWallUser(), Connection::setLabel(), Connection::setPass(), KBearMdiChildView::setPath(), Connection::setUser(), KBearMdiChildView::showStatusBarLower(), KBearMdiChildView::showStatusBarUpper(), KBearMdiChildView::showToolBarLower(), KBearMdiChildView::showToolBarUpper(), Connection::url(), and Connection::user().

Referenced by slotQuickConnect().

                                                           {
      kdDebug()<<"KBear::slotCreateClient url="<<connection.url().prettyURL()<<" pass="<<connection.pass()<<endl;
      Connection c = connection;
      QString name = c.label();
      name = getMdiChildViewCaption( c.label() );
      c.setLabel( name );
      if( c.anonym() ) {
            if( c.pass() == "" )
                  c.setPass( email() );
            if( c.user() == "" )
                  c.setUser( QString::fromLatin1("anonymous") );
      }

      if( c.protocol() == "kbearftp" ) {
            // Now if it's over ftp we have to set firewall support
            QString oldGroup = kapp->config()->group();
            kapp->config()->setGroup("Firewall");
            unsigned int type = kapp->config()->readUnsignedNumEntry( "Type", FirewallSettingsWidget::NONE );
            QString firewallHost = kapp->config()->readEntry( "Host", QString::null );
            int firewallPort = kapp->config()->readUnsignedNumEntry( "Port", 21 );
            QString firewallUser = kapp->config()->readEntry( "User", QString::null );
            QString firewallPass = decodePassword( kapp->config()->readEntry( "Pass", QString::null ) );
            QString firewallAccount = kapp->config()->readEntry( "Account", QString::null );
            QString firewallMacro = QString::null;
            if( type == FirewallSettingsWidget::TYPE_EIGHT )
                  firewallMacro = kapp->config()->readEntry( "Macro", QString::null );
            kapp->config()->setGroup( oldGroup );
            c.setFireWallType( type );
            c.setFireWallHost( firewallHost );
            c.setFireWallPort( firewallPort );
            c.setFireWallUser( firewallUser );
            c.setFireWallPass( firewallPass );
            c.setFireWallAccount( firewallAccount );
            c.setFireWallMacro( firewallMacro );
      }

      KBearMdiChildView* w = new KBearMdiChildView( 0L, c );
      if( c.enableLog() ) {
            m_infoView->addLogPage( w, c.fileSysEncoding() );
      }
      QWhatsThis::add( w, i18n("This Window displays the remote file system.\n"
                                                      "You can use this to transfer files and folders to or "
                                                      "from any other open file system by drag and drop."));

      addWindow( w );

      if( m_autoChildFrameMode && mdiMode() == QextMdi::ChildframeMode )
            setChildFrameMode( m_childFrameMode );
      else if( mdiMode() == QextMdi::ToplevelMode && m_rememberTopLevelChildPos )
            readTopChildPositionFromIndex(m_pWinList->count() - 1 );

      connect( w, SIGNAL( transfer( Transfer* ) ), this, SLOT( slotNewTransfer( Transfer* ) ) );
      // set local path according to the Connection
      m_viewLocal->setPath( c.localPath() );

      // We have to apply chilv view settings to the ne
      KToggleAction* action = static_cast<KToggleAction*>(actionCollection()->action("show_child_toolbar"));
      w->showToolBarUpper( action->isChecked() );
      action = static_cast<KToggleAction*>(actionCollection()->action("show_child_path_toolbar"));
      w->showToolBarLower( action->isChecked() );
      action = static_cast<KToggleAction*>(actionCollection()->action("show_child_statusbar"));
      w->showStatusBarUpper( action->isChecked() );
      action = static_cast<KToggleAction*>(actionCollection()->action("show_child_infobar"));
      w->showStatusBarLower( action->isChecked() );

}


Generated by  Doxygen 1.6.0   Back to index