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

void KBearFileSysPart::slotGotPreviewPart ( KParts::ReadOnlyPart *  part,
const KURL &  realURL 
) [private, slot]

Definition at line 972 of file kbearfilesyspart.cpp.

References m_backStack, Connection::metaData(), KBearTreeView::setDNDEnabled(), slotFinishedLoading(), slotInfoMessage(), slotProgress(), KBearDirView::slotSetURL(), and slotStatusMessage().

Referenced by openConnection().

                                                                                        {
      if( part ) {
            m_partViewer = part;
            kdDebug()<<"KBearFileSysPart::slotGotPreviewPart received part="<<m_partViewer<<endl;

            setActionsEnabled( false );
            m_leftView->setDNDEnabled( false ); // we have to turn off DND when in preview mode
//          addToHistory( m_url.path( -1 ) );
            addToPathHistory( m_url.path( -1 ) );
            m_partViewer->widget()->setCursor( Qt::WaitCursor );
            m_partViewer->widget()->setFocusPolicy( QWidget::WheelFocus );
            manager()->replacePart( this, m_partViewer );

            m_partViewer->setProgressInfoEnabled( false );
            KParts::BrowserExtension* browserExtension = KParts::BrowserExtension::childObject( m_partViewer );
            if( browserExtension ) {
                  KParts::URLArgs args = browserExtension->urlArgs();
                  args.metaData() = m_connection.metaData();
                  browserExtension->setURLArgs( args );
                  connect( browserExtension, SIGNAL( speedProgress( int ) ),
                                    this, SLOT( slotSpeed( int ) ) );
                  connect( browserExtension, SIGNAL( loadingProgress( int ) ),
                                    this, SLOT( slotProgress( int ) ) );
            }
            connect( m_partViewer, SIGNAL( started( KIO::Job* ) ), this, SLOT( slotJobStarted( KIO::Job* ) ) );
            connect( m_partViewer, SIGNAL( completed() ), this, SLOT( slotFinishedLoading() ) );
            connect( m_partViewer, SIGNAL( completed() ), m_dirLister, SLOT( slotDisconnectSlaveInfo() ) );
            connect( m_partViewer, SIGNAL( canceled( const QString& ) ), this, SLOT( slotFinishedLoading() ) );
            connect( m_partViewer, SIGNAL( canceled( const QString& ) ), m_dirLister, SLOT( slotDisconnectSlaveInfo() ) );
            connect( m_partViewer, SIGNAL( setWindowCaption( const QString& ) ),
                              this, SLOT( slotSetWindowCaption( const QString& ) ) );
            connect( m_partViewer, SIGNAL( setStatusBarText( const QString& ) ),
                              this, SLOT( slotInfoMessage( const QString& ) ) );

            m_fileView->widget()->hide();
            m_partViewer->openURL( realURL );
            slotSetWindowCaption( m_url.prettyURL() );
            m_leftView->slotSetURL( m_url.upURL() );
            m_splitter->setResizeMode( m_partViewerWidget, QSplitter::Stretch );
            QVBoxLayout* layout = new QVBoxLayout( m_partViewerWidget );
            layout->addWidget( m_partViewer->widget() );
            m_partViewerWidget->show();

            m_splitter->setSizes( m_splitterSizes );
      }
      else {
            kdDebug()<<"KBearFileSysPart::slotOpenFile No part !!!!!!!!!!"<<endl;
            delete m_partViewerWidget;  // no use for this
            m_partViewerWidget = 0L;
            m_partViewer = 0L;
//          const_cast<KFileItem*>(item)->run();
            KRun::displayOpenWithDialog( m_url );
            slotStatusMessage( i18n( "No Operation in Progress" ) );
            m_backStack.pop();      // we don't want this in history since we didn't open it internally
            m_url = m_lastURL; // since we couldn't open it we set it back to old URL
      }
}


Generated by  Doxygen 1.6.0   Back to index