DebuggerPerlDBGP::DebuggerPerlDBGP(LanguageSettings* langs)
    : AbstractDebugger(langs), m_name("perldbgp"), m_isRunning(false), m_isJITActive(false),
      m_listenPort(-1), m_currentExecutionPoint(0), m_globalExecutionPoint(0), 
      m_pdbgSettings(0), m_net(0)
{
  m_pdbgSettings = new PerlDBGPSettings(Protoeditor::self()->settings()->configFile(),
      name(), label(), langSettings());

  langSettings()->registerDebuggerSettings(name(), m_pdbgSettings);

  m_currentExecutionPoint = new DebuggerExecutionPoint();
  m_globalExecutionPoint  = new DebuggerExecutionPoint();


  connect(Protoeditor::self()->settings(), SIGNAL(sigSettingsChanged()),
          this, SLOT(slotSettingsChanged()));

  m_net = new PerlDBGPNet(this);
  connect(m_net, SIGNAL(sigStarted()), this, SLOT(slotStarted()));
  connect(m_net, SIGNAL(sigClosed()), this, SLOT(slotStopped()));
  connect(m_net, SIGNAL(sigError(const QString&)), this, SIGNAL(sigInternalError(const QString&)));
  connect(m_net, SIGNAL(sigStepDone()), this, SLOT(slotStepDone()));
  connect(m_net, SIGNAL(sigNewConnection()), this, SLOT(slotNewConnection()));
  //connect(m_net, SIGNAL(sigBreakpoint()), this, SLOT(slotBreakpoint()));  
}
SimpleUI::SimpleUI()
     : KMainWindow(0, "NoatunSimpleUI"), UserInterface()
{
    setAcceptDrops( true );
    setCaption( i18n("Noatun") );
    setIcon( SmallIcon( "noatun" ) );

    setupCentralWidget();
    setupActions();

    contextMenu = video->popupMenu( this );

    setupGUI( StatusBar|Create, "simpleui.rc" );

    connect( napp->player(), SIGNAL(playing()), SLOT(slotPlaying()) );
    connect( napp->player(), SIGNAL(stopped()), SLOT(slotStopped()) );
    connect( napp->player(), SIGNAL(paused()), SLOT(slotPaused()) );
    connect( napp->player(), SIGNAL(timeout()), SLOT(slotTimeout()) );
    connect( napp->player(), SIGNAL(newSong()), SLOT(slotChanged()) );
    connect( napp->player(), SIGNAL(volumeChanged(int)), SLOT(slotVolumeChanged(int)) );
    connect( napp, SIGNAL(hideYourself()), SLOT(hide()) );
    connect( napp, SIGNAL(showYourself()), SLOT(show()) );

    napp->player()->handleButtons();

    resize( minimumSize() );

    // Show UI and calculate video widget frame
    show();

    extra_width  = (width() - video->width());
    extra_height = (height() - video->height());

    // Load configuration
    KConfig &config = *KGlobal::config();
    config.setGroup( "Simple" );
    QString str = config.readEntry( "View", "NormalSize" );

    if (str == "HalfSize")
        video->setHalfSize();
    else if (str == "NormalSize")
        video->setNormalSize();
    else if (str == "DoubleSize")
        video->setDoubleSize();
    else
        applyMainWindowSettings( &config, "Simple" );

    // PlayObject could be running, update video widget
    slotChanged();

    video->give();
}