bool ProgressDialog::execute() { // get command line and display it QString cmdLine = d->cvsJob->cvsCommand(); d->resultbox->insertItem(cmdLine); // establish connections to the signals of the cvs job connectDCOPSignal(d->cvsJob->app(), d->cvsJob->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(d->cvsJob->app(), d->cvsJob->obj(), "receivedStdout(QString)", "slotReceivedOutputNonGui(QString)", true); connectDCOPSignal(d->cvsJob->app(), d->cvsJob->obj(), "receivedStderr(QString)", "slotReceivedOutputNonGui(QString)", true); // we wait for 4 seconds (or the timeout set by the user) before we // force the dialog to show up d->timer = new QTimer(this); connect(d->timer, SIGNAL(timeout()), this, SLOT(slotTimeoutOccurred())); d->timer->start(CervisiaSettings::timeout(), true); bool started = d->cvsJob->execute(); if( !started ) return false; QApplication::setOverrideCursor(waitCursor); kapp->enter_loop(); if (QApplication::overrideCursor()) QApplication::restoreOverrideCursor(); return !d->isCancelled; }
ProtocolView::ProtocolView(const QCString& appId, QWidget *parent, const char *name) : QTextEdit(parent, name) , job(0) , m_isUpdateJob(false) { setReadOnly(true); setUndoRedoEnabled(false); setTabChangesFocus(true); setTextFormat(Qt::LogText); KConfig *config = CervisiaPart::config(); config->setGroup("LookAndFeel"); setFont(config->readFontEntry("ProtocolFont")); config->setGroup("Colors"); QColor defaultColor = QColor(255, 130, 130); conflictColor=config->readColorEntry("Conflict",&defaultColor); defaultColor=QColor(130, 130, 255); localChangeColor=config->readColorEntry("LocalChange",&defaultColor); defaultColor=QColor(70, 210, 70); remoteChangeColor=config->readColorEntry("RemoteChange",&defaultColor); // create a DCOP stub for the non-concurrent cvs job job = new CvsJob_stub(appId, "NonConcurrentJob"); // establish connections to the signals of the cvs job connectDCOPSignal(job->app(), job->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(job->app(), job->obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true); connectDCOPSignal(job->app(), job->obj(), "receivedStderr(QString)", "slotReceivedOutput(QString)", true); }
void CVSService::slotUpdateToTag(const QStringList &files) { startService(); if (m_repository && !m_appId.isEmpty() && m_updateToDlg->exec()) { QString extraOpts; QString commandStr; if (m_updateToDlg->tagRadioButton->isChecked()) { extraOpts = "-r " + m_updateToDlg->tagCombo->currentText(); commandStr = i18n("Updating to revision %1 ...").arg(m_updateToDlg->tagCombo->currentText()); } else { extraOpts = "-D " + m_updateToDlg->dateLineEdit->text(); commandStr = i18n("Updating to the version from %1 ...").arg(+ m_updateToDlg->dateLineEdit->text()); } emit clearMessages(); emit showMessage(commandStr + "\n", false); m_files = files; m_job = m_cvsService->update(files, true, true, true, extraOpts); m_cvsCommand = "update"; m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj()); connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true); m_cvsJob->execute(); } }
void CVSService::slotCommit(const QStringList &files) { startService(); m_commitDlg->fileList->clear(); m_commitDlg->fileList->insertStringList(files); m_commitDlg->logEdit->clear(); m_commitDlg->messageCombo->insertItem(i18n("Current"), 0); m_commitDlg->messageCombo->setCurrentItem(0); if (m_repository && !m_appId.isEmpty() && m_commitDlg->exec()) { m_commitDlg->messageCombo->removeItem(0); QString message = m_commitDlg->logEdit->text(); if (message != m_commitDlg->messageCombo->currentText()) m_commitDlg->messageCombo->insertItem(message, 0); emit clearMessages(); emit showMessage(i18n("Running CVS commit...") + "\n", false); m_files = files; m_job = m_cvsService->commit(files, message, true); m_cvsCommand = "commit"; m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj()); connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true); m_cvsJob->execute(); } }
void CVSService::slotBrowseLog() { startService(); if (!m_defaultFile.isEmpty()) { if (m_defaultFile.startsWith(m_repositoryPath)) { QString file = m_defaultFile.remove(m_repositoryPath); if (m_repository && !m_appId.isEmpty() ) { emit clearMessages(); emit showMessage(i18n("Showing CVS log...") + "\n", false); m_files += file; m_job = m_cvsService->log(file); m_cvsCommand = "log"; m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj()); connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true); m_cvsJob->execute(); } } else { notInRepository(); } } }
KDirNotify::KDirNotify() : DCOPObject(QCString().sprintf("KDirNotify-%d", ++s_serial)) { connectDCOPSignal(0, "KDirNotify", "FilesAdded(KURL)", "FilesAdded(KURL)", false); connectDCOPSignal(0, "KDirNotify", "FilesRemoved(KURL::List)", "FilesRemoved(KURL::List)", false); connectDCOPSignal(0, "KDirNotify", "FilesChanged(KURL::List)", "FilesChanged(KURL::List)", false); connectDCOPSignal(0, "KDirNotify", "FileRenamed(KURL,KURL)", "FileRenamed(KURL,KURL)", false); }
void EditorsDialog::startjob(QString strDir) { kdDebug(9006) << "EditorsDialog::start() workDir = " << strDir << endl; DCOPRef job = m_cvsService->editors( strDir ); m_cvsJob = new CvsJob_stub( job.app(), job.obj() ); // establish connections to the signals of the cvs m_job connectDCOPSignal( job.app(), job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true ); // We'll read the ouput directly from the job ... connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true ); kdDebug(9006) << "Running: " << m_cvsJob->cvsCommand() << endl; m_cvsJob->execute(); }
FeedIconManager::FeedIconManager(QObject *parent, const char *name) : QObject(parent, name), DCOPObject("FeedIconManager"), d(new FeedIconManagerPrivate) { connectDCOPSignal("kded", "favicons", "iconChanged(bool, QString, QString)", "slotIconChanged(bool, QString, QString)", false); }
TaskBarContainer::TaskBarContainer(bool enableFrame, QWidget *parent, const char *name) : QFrame(parent, name), direction(KPanelApplet::Up), showWindowListButton(true), windowListButton(0), windowListMenu(0) { setBackgroundOrigin(AncestorOrigin); uint margin; if(enableFrame) { setFrameStyle(Sunken | StyledPanel); margin = frameWidth(); } else { setFrameStyle(NoFrame); margin = 0; } layout = new QBoxLayout(this, QApplication::reverseLayout() ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight); layout->setMargin(margin); // scrollable taskbar taskBar = new TaskBar(this); layout->addWidget(taskBar); connect(taskBar, SIGNAL(containerCountChanged()), SIGNAL(containerCountChanged())); setBackground(); // read settings and setup layout configure(); connectDCOPSignal("", "", "kdeTaskBarConfigChanged()", "configChanged()", false); }
KIMProxy::KIMProxy( DCOPClient* dc ) : DCOPObject( "KIMProxyIface" ), TQObject(), d( new Private ) { m_im_client_stubs.setAutoDelete( true ); d->dc = dc; m_initialized = false; connect( d->dc, TQT_SIGNAL( applicationRemoved( const TQCString& ) ) , this, TQT_SLOT( unregisteredFromDCOP( const TQCString& ) ) ); connect( d->dc, TQT_SIGNAL( applicationRegistered( const TQCString& ) ) , this, TQT_SLOT( registeredToDCOP( const TQCString& ) ) ); d->dc->setNotifications( true ); d->presence_strings.append( "Unknown" ); d->presence_strings.append( "Offline" ); d->presence_strings.append( "Connecting" ); d->presence_strings.append( "Away" ); d->presence_strings.append( "Online" ); d->presence_icons.append( "presence_unknown" ); d->presence_icons.append( "presence_offline" ); d->presence_icons.append( "presence_connecting" ); d->presence_icons.append( "presence_away" ); d->presence_icons.append( "presence_online" ); //TQCString senderApp = "Kopete"; //TQCString senderObjectId = "KIMIface"; TQCString method = "contactPresenceChanged( TQString, TQCString, int )"; //TQCString receiverObjectId = "KIMProxyIface"; // FIXME: make this work when the sender object id is set to KIMIFace if ( !connectDCOPSignal( 0, 0, method, method, false ) ) kdWarning() << "Couldn't connect DCOP signal. Won't receive any status notifications!" << endl; }
TaskBarExtension::TaskBarExtension(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) : KPanelExtension(configFile, type, actions, parent, name), m_bgImage(0), m_bgFilename(0), m_rootPixmap(0) { QHBoxLayout *layout = new QHBoxLayout(this); m_container = new TaskBarContainer(false, this); m_container->setBackgroundOrigin(AncestorOrigin); positionChange(position()); layout->addWidget(m_container); connect(m_container, SIGNAL(containerCountChanged()), SIGNAL(updateLayout())); kapp->dcopClient()->setNotifications(true); connectDCOPSignal("kicker", "kicker", "configurationChanged()", "configure()", false); connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(setBackgroundTheme())); QTimer::singleShot(0, this, SLOT(setBackgroundTheme())); }
KXsldbg::KXsldbg() : DCOPObject("KXsldbg"), KParts::MainWindow( 0L, "kxsldbg" ) { // set the shell's ui resource file setXMLFile("kxsldbg_shell.rc"); // then, setup our actions setupActions(); // and a status bar statusBar()->show(); statusBar()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred)); // this routine will find and load our Part. it finds the Part by // name which is a bad idea usually.. but it's alright in this // case since our Part is made for this Shell KLibFactory *factory = KLibLoader::self()->factory("libkxsldbgpart"); if (factory) { // now that the Part is loaded, we cast it to a Part to get // our hands on it m_part = static_cast<KParts::ReadOnlyPart *>(factory->create(this, "kxsldbg_part", "KParts::ReadOnlyPart" )); if (m_part) { // tell the KParts::MainWindow that this is indeed the main widget setCentralWidget(m_part->widget()); // and integrate the part's GUI with the shell's createGUI(m_part); // connect up signals kapp->dcopClient()->attach(); connectDCOPSignal(0, 0, "debuggerPositionChanged(QString,int)", "newDebuggerPosition(QString,int)", false ); connectDCOPSignal(0, 0, "editorPositionChanged(QString,int,int)", "newCursorPosition(QString,int,int)", false ); } } else { // if we couldn't find our Part, we exit since the Shell by // itself can't do anything useful KMessageBox::error(this, i18n("Could not find our part.")); kapp->quit(); } }
void CVSService::slotRevert(const QStringList &files) { startService(); if (m_repository && !m_appId.isEmpty()) { emit clearMessages(); emit showMessage(i18n("Reverting to the version from the repository...") + "\n", false); m_files = files; m_job = m_cvsService->update(files, true, true, true, "-C"); m_cvsCommand = "update"; m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj()); connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true); m_cvsJob->execute(); } }
void CVSService::slotAdd(const QStringList &files) { startService(); if (m_repository && !m_appId.isEmpty() && (KMessageBox::questionYesNoList(0, i18n("Add the following files to repository?"), files, i18n("CVS Add"), KStdGuiItem::add(), i18n("Do Not Add")) == KMessageBox::Yes)) { emit clearMessages(); emit showMessage(i18n("Adding file to the repository...") + "\n", false); m_files = files; m_job = m_cvsService->add(files, false); m_cvsCommand = "add"; m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj()); connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true); m_cvsJob->execute(); } }
void CVSService::slotRemove(const QStringList &files) { startService(); if (m_repository && !m_appId.isEmpty() && (KMessageBox::warningContinueCancelList(0, i18n("<qt>Remove the following files from the repository?<br>This will remove your <b>working copy</b> as well.</qt>"), files, i18n("CVS Remove")) == KMessageBox::Continue)) { emit clearMessages(); emit showMessage(i18n("Removing files from the repository...") + "\n", false); m_files = files; m_job = m_cvsService->remove(files, true); m_cvsCommand = "remove"; m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj()); connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true); connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true); m_cvsJob->execute(); } }
// Connection manager itself ConnectionManager::ConnectionManager( QObject * parent, const char * name ) : DCOPObject( "ConnectionManager" ),QObject( parent, name ) { d = new ConnectionManagerPrivate; d->m_stub = new ClientIface_stub( kapp->dcopClient(), "kded", "networkstatus" ); connectDCOPSignal( "kded", "networkstatus", "statusChange(QString,int)", "slotStatusChanged(QString,int)", false ); d->m_userInitiatedOnly = false; initialise(); }
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); }
bool CvsProcessWidget::startJob( const DCOPRef &aJob ) { kdDebug(9006) << "CvsProcessWidget::startJob(const DCOPRef &) here!" << endl; clear(); m_part->mainWindow()->raiseView( this ); m_part->core()->running( m_part, true ); // create a DCOP stub for the non-concurrent cvs job if (m_job) { delete m_job; m_job = 0; } m_job = new CvsJob_stub( aJob.app(), aJob.obj() ); // establish connections to the signals of the cvs m_job connectDCOPSignal( m_job->app(), m_job->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true ); connectDCOPSignal( m_job->app(), m_job->obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true ); connectDCOPSignal( m_job->app(), m_job->obj(), "receivedStderr(QString)", "slotReceivedErrors(QString)", true ); // get command line and add it to output buffer QString cmdLine = m_job->cvsCommand(); m_part->mainWindow()->statusBar()->message( cmdLine ); kdDebug(9006) << "Running: " << cmdLine << endl; // disconnect 3rd party slots from our signals disconnect( SIGNAL(jobFinished(bool, int)) ); showInfo( i18n("Started job: %1").arg( cmdLine ) ); #ifdef MYDCOPDEBUG g_dcopExitCounter = 0; g_dcopOutCounter = 0; g_dcopErrCounter = 0; #endif return m_job->execute(); }
void CVSLogPage::startLog( const QString &workDir, const QString &pathName ) { kdDebug(9006) << "CVSLogPage::start() here! workDir = " << workDir << ", pathName = " << pathName << endl; // CvsOptions *options = CvsOptions::instance(); // "cvs log" needs to be done on relative-path basis m_pathName = pathName; m_diffStrings.clear(); DCOPRef job = m_cvsService->log( pathName ); m_cvsLogJob = new CvsJob_stub( job.app(), job.obj() ); // establish connections to the signals of the cvs m_job connectDCOPSignal( job.app(), job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true ); // We'll read the ouput directly from the job ... connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true ); // connectDCOPSignal( job.app(), job.obj(), "receivedStderr(QString)", "slotReceivedErrors(QString)", true ); kdDebug(9006) << "Running: " << m_cvsLogJob->cvsCommand() << endl; m_cvsLogJob->execute(); }
SummaryWidget::SummaryWidget( QWidget *parent, const char *name ) : Kontact::Summary( parent, name ), DCOPObject( "WeatherSummaryWidget" ), mProc( 0 ) { mLayout = new QVBoxLayout( this, 3, 3 ); mLayout->setAlignment( Qt::AlignTop ); QPixmap icon = KGlobal::iconLoader()->loadIcon( "kweather", KIcon::Desktop, KIcon::SizeMedium ); QWidget *header = createHeader( this, icon, i18n( "Weather Service" ) ); mLayout->addWidget( header ); QString error; QCString appID; bool serviceAvailable = true; if ( !kapp->dcopClient()->isApplicationRegistered( "KWeatherService" ) ) { if ( KApplication::startServiceByDesktopName( "kweatherservice", QStringList(), &error, &appID ) ) { QLabel *label = new QLabel( i18n( "No weather dcop service available;\nyou need KWeather to use this plugin." ), this ); mLayout->addWidget( label, Qt::AlignHCenter | AlignVCenter ); serviceAvailable = false; } } if ( serviceAvailable ) { connectDCOPSignal( 0, 0, "fileUpdate(QString)", "refresh(QString)", false ); connectDCOPSignal( 0, 0, "stationRemoved(QString)", "stationRemoved(QString)", false ); DCOPRef dcopCall( "KWeatherService", "WeatherService" ); DCOPReply reply = dcopCall.call( "listStations()", true ); if ( reply.isValid() ) { mStations = reply; connect( &mTimer, SIGNAL( timeout() ), this, SLOT( timeout() ) ); mTimer.start( 0 ); } else { kdDebug(5602) << "ERROR: dcop reply not valid..." << endl; } } }
void DebuggerPart::slotDCOPApplicationRegistered(const QCString& appId) { if (appId.find("drkonqi-") == 0) { QByteArray answer; QCString replyType; kapp->dcopClient()->call(appId, "krashinfo", "appName()", QByteArray(), replyType, answer, true, 5000); QDataStream d(answer, IO_ReadOnly); QCString appName; d >> appName; if (appName.length() && project() && project()->mainProgram().endsWith(appName)) { kapp->dcopClient()->send(appId, "krashinfo", "registerDebuggingApplication(QString)", i18n("Debug in &KDevelop")); connectDCOPSignal(appId, "krashinfo", "acceptDebuggingApplication()", "slotDebugExternalProcess()", true); } }
KonqSidebarWeather::KonqSidebarWeather(TDEInstance* inst, TQObject* parent, TQWidget* widgetParent, TQString& desktopName, const char* name) : KonqSidebarPlugin(inst, parent, widgetParent, desktopName, name), DCOPObject(name) { m_container = new sidebarwidget(widgetParent,"sidebarwidget"); kdDebug() << "Calling Get Widget" << endl; kdDebug() << "Get weatherstation list... " << endl; if (!connectDCOPSignal(0,0, "fileUpdate(TQString)", "refresh(TQString)",false)) kdDebug() << "Could not attach signal..." << endl; else kdDebug() << "attached dcop signals..." << endl; DCOPRef dcopCall( "KWeatherService", "WeatherService" ); DCOPReply reply = dcopCall.call("listStations()", true ); if ( reply.isValid() ) { TQStringList replyList = reply; for(int i = 0; i < replyList.size(); i++) { dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1()); m_container->addWidget(d, replyList[i].latin1()); d->resizeView(80,48); d->show(); m_widgets.insert(replyList[i], d); dcopCall.send("update(TQString)", replyList[i]); } } timeOut = new TQTimer(this, "timeOut" ); timeOut->changeInterval(15*60000); connect(timeOut, TQT_SIGNAL(timeout()), this, TQT_SLOT(update())); // m_widgets.append(new dockwidget(widgetParent)); }
void kweather::initDCOP() { if ( !mClient ) mClient = TDEApplication::dcopClient(); if(!mClient->isAttached()) mClient->attach(); if(!attach()) return; kdDebug(12004) << "attached to the server..." << endl; if ( mWeatherService ) delete mWeatherService; mWeatherService = new WeatherService_stub( "KWeatherService", "WeatherService" ); if (!connectDCOPSignal(0, 0, "fileUpdate(TQString)", "refresh(TQString)",false)) kdDebug(12004) << "Could not attach dcop signal..." << endl; else kdDebug(12004) << "attached dcop signals..." << endl; }
KonvDCOP::KonvDCOP() : DCOPObject("irc"), QObject(0, "irc") { connectDCOPSignal("kdesktop", "KScreensaverIface", "KDE_start_screensaver()", "setScreenSaverStarted()", false); connectDCOPSignal("kdesktop", "KScreensaverIface", "KDE_stop_screensaver()", "setScreenSaverStopped()", false); }
MediaNotifier::MediaNotifier(const QCString &name) : KDEDModule(name) { connectDCOPSignal("kded", "mediamanager", "mediumAdded(QString, bool)", "onMediumChange(QString, bool)", true); connectDCOPSignal("kded", "mediamanager", "mediumChanged(QString, bool)", "onMediumChange(QString, bool)", true); }
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 {
TDEWalletManager::TDEWalletManager(TQWidget *parent, const char *name, WFlags f) : TDEMainWindow(parent, name, f), DCOPObject("TDEWalletManager") { TDEGlobal::dirs()->addResourceType("tdewallet", "share/apps/tdewallet"); _tdewalletdLaunch = false; TQAccel *accel = new TQAccel(this, "tdewalletmanager"); TDEApplication::dcopClient()->setQtBridgeEnabled(false); _shuttingDown = false; TDEConfig cfg("tdewalletrc"); // not sure why this setting isn't in tdewalletmanagerrc... TDEConfigGroup walletConfigGroup(&cfg, "Wallet"); _dcopRef = 0L; if (walletConfigGroup.readBoolEntry("Launch Manager", true)) { _tray = new KSystemTray(this, "tdewalletmanager tray"); _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); TQToolTip::add(_tray, i18n("TDE Wallet: No wallets open.")); connect(_tray, TQT_SIGNAL(quitSelected()), TQT_SLOT(shuttingDown())); TQStringList wl = TDEWallet::Wallet::walletList(); bool isOpen = false; for (TQStringList::Iterator it = wl.begin(); it != wl.end(); ++it) { if (TDEWallet::Wallet::isOpen(*it)) { _tray->setPixmap(loadSystemTrayIcon("wallet_open")); TQToolTip::remove(_tray); TQToolTip::add(_tray, i18n("TDE Wallet: A wallet is open.")); isOpen = true; break; } } if (!isOpen && kapp->isRestored()) { delete _tray; _tray = 0L; TQTimer::singleShot( 0, kapp, TQT_SLOT( quit())); return; } } else { _tray = 0L; } _iconView = new TDEWalletIconView(this, "tdewalletmanager icon view"); connect(_iconView, TQT_SIGNAL(executed(TQIconViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(openWallet(TQIconViewItem*))); connect(_iconView, TQT_SIGNAL(contextMenuRequested(TQIconViewItem*, const TQPoint&)), TQT_TQOBJECT(this), TQT_SLOT(contextMenu(TQIconViewItem*, const TQPoint&))); updateWalletDisplay(); setCentralWidget(_iconView); _iconView->setMinimumSize(320, 200); _dcopRef = new DCOPRef("kded", "tdewalletd"); _dcopRef->dcopClient()->setNotifications(true); connect(_dcopRef->dcopClient(), TQT_SIGNAL(applicationRemoved(const TQCString&)), this, TQT_SLOT(possiblyRescan(const TQCString&))); connect(_dcopRef->dcopClient(), TQT_SIGNAL(applicationRegistered(const TQCString&)), this, TQT_SLOT(possiblyRescan(const TQCString&))); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "allWalletsClosed()", "allWalletsClosed()", false); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(TQString)", "updateWalletDisplay()", false); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletOpened(TQString)", "aWalletWasOpened()", false); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletDeleted(TQString)", "updateWalletDisplay()", false); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletListDirty()", "updateWalletDisplay()", false); // FIXME: slight race - a wallet can open, then we get launched, but the // wallet closes before we are done opening. We will then stay // open. Must check that a wallet is still open here. new TDEAction(i18n("&New Wallet..."), "tdewalletmanager", 0, TQT_TQOBJECT(this), TQT_SLOT(createWallet()), actionCollection(), "wallet_create"); TDEAction *act = new TDEAction(i18n("Configure &Wallet..."), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT(setupWallet()), actionCollection(), "wallet_settings"); if (_tray) { act->plug(_tray->contextMenu()); } act = new TDEAction(i18n("Close &All Wallets"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(closeAllWallets()), actionCollection(), "close_all_wallets"); if (_tray) { act->plug(_tray->contextMenu()); } KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(shuttingDown()), actionCollection()); KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); createGUI("tdewalletmanager.rc"); accel->connectItem(accel->insertItem(Key_Return), TQT_TQOBJECT(this), TQT_SLOT(openWallet())); accel->connectItem(accel->insertItem(Key_Delete), TQT_TQOBJECT(this), TQT_SLOT(deleteWallet())); if (_tray) { _tray->show(); } else { show(); } kapp->setName("tdewallet"); // hack to fix docs }
KBookmarkEditorIface::KBookmarkEditorIface() : QObject(), DCOPObject("KBookmarkEditor") { // connect(KBookmarkNotifier_stub, SIGNAL( updatedAccessMetadata(QString,QString) ), // this, SLOT( slotDcopUpdatedAccessMetadata(QString,QString) )); connectDCOPSignal(0, "KBookmarkNotifier", "updatedAccessMetadata(QString,QString)", "slotDcopUpdatedAccessMetadata(QString,QString)", false); }