Exemplo n.º 1
0
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( );
}
Exemplo n.º 2
0
void PMShell::slotFileNew( )
{
   if( !m_pPart->isModified( ) && m_pPart->url( ).isEmpty( ) )
   {
      m_pPart->newDocument( );
      setCaption( );
   }
   else
   {
      PMShell *shell = new PMShell( );
      shell->show( );
   }
}
Exemplo n.º 3
0
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 );
   }
}
Exemplo n.º 4
0
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
   }
}
Exemplo n.º 5
0
void PMShell::slotFileNewWindow( )
{
   PMShell* shell = new PMShell;
   shell->show( );
}