void EditorsDialog::slotJobExited( bool normalExit, int exitStatus )
{
    if (!normalExit)
    {
        KMessageBox::sorry( this, i18n("Log failed with exitStatus == %1").arg( exitStatus), i18n("Log Failed") );
        return;
    }

    static QRegExp re("([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s"
                        "([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s(.*)");
    static QRegExp subre("([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s"
                        "([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s(.*)");
	QString lastfilename;

    QStringList lines = QStringList::split( "\n", m_output );
    int found = 0;
    for (size_t i=0; i<lines.count(); ++i) {
        QString s = lines[i].simplifyWhiteSpace();
    	kdDebug(9006) << "editors:---" << s << "---" << endl;
    	kdDebug(9006) << "       : lastfile was " << lastfilename << endl;

        if (re.exactMatch(s)) {
            QString file = re.cap( 1 );
            QString locker = re.cap( 2 );
            QString date = re.cap(5)+" "+re.cap(4)+" "+re.cap(7)+" "+re.cap(6);
            
            m_textBrowser->append( "<b>"+i18n("File")+": <code>"+file+"</code></b>" );
            m_textBrowser->append( "<b>"+i18n("User")+":</b> "+locker );
            m_textBrowser->append( "<b>"+i18n("Date")+":</b> "+date );
            m_textBrowser->append( "<hr>" );
            found++;

            lastfilename = file;
        } else {
	        if (subre.exactMatch(s)) {
				QString file = lastfilename;
				QString locker = subre.cap( 1 );
				QString date = subre.cap(4)+" "+subre.cap(3)+" "+subre.cap(6)+" "+subre.cap(5);
				
				m_textBrowser->append( "<b>"+i18n("File")+": <code>"+file+"</code></b>" );
				m_textBrowser->append( "<b>"+i18n("User")+":</b> "+locker );
				m_textBrowser->append( "<b>"+i18n("Date")+":</b> "+date );
				m_textBrowser->append( "<hr>" );
				found++;
 			}
    	}
	}

    if (!found)
        m_textBrowser->append(i18n("No files from your query are marked as being edited."));

    m_textBrowser->source();

    if (m_cvsJob) {
        disconnectDCOPSignal( m_cvsJob->app(), m_cvsJob->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)" );
        delete m_cvsJob;
        m_cvsJob=NULL;
    }
}
Beispiel #2
0
void CVSService::slotJobExited(bool normalExit, int exitStatus)
{
    if (!normalExit)
    {
        KMessageBox::sorry(0, i18n("<qt>The CVS command <b>%1</b> has failed. The error code was <i>%2</i>.</qt>").arg(m_cvsCommand).arg(exitStatus), i18n("Command Failed"));
    }
    if (exitStatus == 0)
    {
        emit commandExecuted(m_cvsCommand, m_files);
    }
    disconnectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)");
    disconnectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)");
    disconnectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)");
    //delete m_cvsJob;
    //m_cvsJob = 0L;
    emit showMessage(i18n("CVS command finished."), false);
    emit showMessage(" ", false);
}
void CvsProcessWidget::slotJobExited( bool normalExit, int exitStatus )
{
    kdDebug(9006) << "CvsProcessWidget::slotJobExited(bool, int) here!" << endl;
#ifdef MYDCOPDEBUG
    g_dcopExitCounter++;
    kdDebug(9006) << "MYDCOPDEBUG: dcopExitCounter == " << g_dcopExitCounter << endl;
#endif
    if (m_job)
    {
        disconnectDCOPSignal( m_job->app(), m_job->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)" );
        disconnectDCOPSignal( m_job->app(), m_job->obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)" );
        disconnectDCOPSignal( m_job->app(), m_job->obj(), "receivedStderr(QString)", "slotReceivedErrors(QString)" );
        delete m_job;
        m_job = 0;
    }
    QString exitMsg = i18n("Job finished with exitCode == %1");
    showInfo( exitMsg.arg( exitStatus) );

    m_part->core()->running( m_part, false );
    m_part->mainWindow()->statusBar()->message( i18n("Done CVS command ..."), 2000 );

    emit jobFinished( normalExit, exitStatus );
}
Beispiel #4
0
KopeteIface::KopeteIface() : DCOPObject( "KopeteIface" )
{
    KConfig *config = KGlobal::config();
    config->setGroup("AutoAway");

    if (config->readBoolEntry("UseAutoAway", true))
    {
        connectDCOPSignal("kdesktop", "KScreensaverIface",
                          "KDE_start_screensaver()", "setAutoAway()", false);
    }
    else
    {
        disconnectDCOPSignal("kdesktop", "KScreensaverIface",
                             "KDE_start_screensaver()", "setAutoAway()");
    }
    // FIXME: AFAICT, this never seems to fire.
    connectDCOPSignal("kdesktop", "KScreensaverIface",
                      "KDE_stop_screensaver()", "setActive()", false);
}
Beispiel #5
0
void MainWindow::initEmbedPanel()
{
    static int kicker_start_timeout_counter = 0, load_skimapplet_timeout_counter = 0;

    if(kapp->dcopClient()->isApplicationRegistered("kicker"))
    {
        kicker_start_timeout_counter = 0;
        if(kapp->dcopClient()->remoteObjects("kicker").contains("SkimApplet"))
        {
            load_skimapplet_timeout_counter = 0;
            DCOPRef m_kickerSkimApplet("kicker","SkimApplet");

            if(!m_embedInitialized)
            {
                m_embedInitialized = true;

                disconnectDCOPSignal("kicker", "SkimApplet",
                                     "preferedSizeChanged(QSize, int)", "changePreferedSize(QSize, int)");
                disconnectDCOPSignal("kicker", "SkimApplet",
                                     "appletDestroyed(bool)", "appletDestroyed(bool)");
                disconnectDCOPSignal("kicker", "SkimApplet",
                                     "doubleCliked()", "toggleDocking()");

                connectDCOPSignal("kicker", "SkimApplet",
                                  "preferedSizeChanged(QSize, int)", "changePreferedSize(QSize, int)", false);
                connectDCOPSignal("kicker", "SkimApplet",
                                  "appletDestroyed(bool)", "appletDestroyed(bool)", false);
                connectDCOPSignal("kicker", "SkimApplet",
                                  "doubleCliked()", "toggleDocking()", false);

                m_kickerSkimApplet.call("embedWindow(Q_UINT32)", (Q_UINT32)winId());
            }

            m_kickerSkimApplet.call("setAutoHideHandle(bool)", !m_alwaysShowHandle);
            show();
        }
        else
        {
            if(load_skimapplet_timeout_counter < 1)
            {
                DCOPRef m_kickerPanel("kicker","Panel");
                m_kickerPanel.call("addApplet(QString)", QString("skimapplet.desktop"));

                // if this is KDE 3.3.x, then we have to restart kicker after we add
                // the new applet, otherwise, the new added applet will be a separate
                // dcop object, rather than an object under kicker.
                if(!KDEGT340)
                    m_kickerPanel.call("restart()");
            }

            if(load_skimapplet_timeout_counter<20)
            {
                QTimer::singleShot(500, this, SLOT(initEmbedPanel()));
                load_skimapplet_timeout_counter++;
            }
            else
            {
                //TODO: tell user: timeout when waiting for kicker to load SkimApplet
                kdDebug() << k_lineinfo << " timeout when waiting for kicker to load SkimApplet\n";
                toggleDocking();
            }
        }
    }
    else    //waiting for kicker to start
    {
        if(kicker_start_timeout_counter < 1)
        {
            kapp->dcopClient()->setNotifications(true);
            connect(kapp->dcopClient(), SIGNAL(applicationRegistered (const QCString &)),
                    SLOT(slotApplicationRegistered (const QCString &)));

            //this timer will make sure if kicker is not started within 50s, the initEmbedPanel
            // will be called. ATTENTION here: if no timeout occur, this will init another call
            // to initEmbedPanel(). However as we have m_embedInitialized variable, there should
            // be no problems.
            QTimer::singleShot(50000, this, SLOT(initEmbedPanel()));
            kicker_start_timeout_counter++;
        }
        else
        {
Beispiel #6
0
MediaNotifier::~MediaNotifier()
{
    disconnectDCOPSignal("kded", "mediamanager", "mediumAdded(QString, bool)", "onMediumChange(QString, bool)");

    disconnectDCOPSignal("kded", "mediamanager", "mediumChanged(QString, bool)", "onMediumChange(QString, bool)");
}