int main( int argc, char* argv[] ) { PMShell* shell = 0; KCmdLineArgs::init( argc, argv, PMFactory::aboutData( ) ); KCmdLineArgs::addCmdLineOptions( options ); KApplication app; KCmdLineArgs* args = KCmdLineArgs::parsedArgs( ); if( !args->isSet( "-opengl" ) ) PMRenderManager::disableOpenGL( ); if( !args->isSet( "-dri" ) ) PMGLView::enableDirectRendering( false ); if( args->count( ) > 0 ) { for( int i = 0 ; i < args->count( ) ; i++ ) { shell = new PMShell( args->url( i ) ); shell->show( ); } } else { shell = new PMShell; shell->show( ); } args->clear(); return app.exec( ); }
void PMShell::slotFileNew( ) { if( !m_pPart->isModified( ) && m_pPart->url( ).isEmpty( ) ) { m_pPart->newDocument( ); setCaption( ); } else { PMShell *shell = new PMShell( ); shell->show( ); } }
void PMShell::openURL( const KURL& url ) { m_pRecent->addURL( url ); if( !m_pPart->isModified( ) && m_pPart->url( ).isEmpty( ) ) { m_pPart->openURL( url ); setCaption( m_pPart->url( ).prettyURL( ) ); } else { PMShell *shell = new PMShell( ); shell->show( ); shell->openURL( url ); } }
void PMPluginManager::updatePlugins( ) { KConfigGroup cfgGroup( PMFactory::instance( )->config( ), "KParts Plugins" ); QPtrListIterator<PMPluginInfo> pit( m_plugins ); for( ; *pit; ++pit ) cfgGroup.writeEntry( ( *pit )->name( ) + "Enabled", ( *pit )->enabled( ) ); cfgGroup.sync( ); QPtrListIterator<PMPart> it( m_parts ); for( ; *it; ++it ) { Plugin::loadPlugins( *it, *it, PMFactory::instance( ), false ); PMShell* shell = ( *it )->shell( ); if( shell ) shell->updateGUI( ); // TODO find a solution to update the gui without using the shell } }
void PMShell::slotFileNewWindow( ) { PMShell* shell = new PMShell; shell->show( ); }