-rw-r--r-- | kaddressbook/kabcore.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 1 | ||||
-rw-r--r-- | libkdepim/externalapphandler.cpp | 6 | ||||
-rw-r--r-- | libkdepim/externalapphandler.h | 1 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwminit.cpp | 10 |
5 files changed, 24 insertions, 0 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4964a6c..d1dcb6e 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -265,64 +265,65 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mIncSearchWidget->setFocus(); connect( mViewManager, SIGNAL( selected( const QString& ) ), SLOT( setContactSelected( const QString& ) ) ); connect( mViewManager, SIGNAL( executed( const QString& ) ), SLOT( executeContact( const QString& ) ) ); connect( mViewManager, SIGNAL( deleteRequest( ) ), SLOT( deleteContacts( ) ) ); connect( mViewManager, SIGNAL( modified() ), SLOT( setModified() ) ); connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); connect( mXXPortManager, SIGNAL( modified() ), SLOT( setModified() ) ); connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), SLOT( incrementalSearch( const QString& ) ) ); connect( mIncSearchWidget, SIGNAL( fieldChanged() ), mJumpButtonBar, SLOT( recreateButtons() ) ); connect( mDetails, SIGNAL( sendEmail( const QString& ) ), SLOT( sendMail( const QString& ) ) ); connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); + connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); #ifndef KAB_EMBEDDED connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), mXXPortManager, SLOT( importVCard( const KURL& ) ) ); connect( mDetails, SIGNAL( browse( const QString& ) ), SLOT( browse( const QString& ) ) ); mAddressBookService = new KAddressBookService( this ); #endif //KAB_EMBEDDED mMessageTimer = new QTimer( this ); connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); mEditorDialog = 0; createAddresseeEditorDialog( this ); setModified( false ); mBRdisabled = false; #ifndef DESKTOP_VERSION infrared = 0; #endif //toggleBeamReceive( ); } KABCore::~KABCore() { // save(); //saveSettings(); //KABPrefs::instance()->writeConfig(); delete AddresseeConfig::instance(); @@ -1257,64 +1258,69 @@ void KABCore::redo() void KABCore::setJumpButtonBarVisible( bool visible ) { if (mMultipleViewsAtOnce) { if ( visible ) mJumpButtonBar->show(); else mJumpButtonBar->hide(); } else { // show the jumpbar only if "the details are hidden" == "viewmanager are shown" if (mViewManager->isVisible()) { if ( visible ) mJumpButtonBar->show(); else mJumpButtonBar->hide(); } else { mJumpButtonBar->hide(); } } } void KABCore::setDetailsToState() { setDetailsVisible( mActionDetails->isChecked() ); } +void KABCore::setDetailsToggle() +{ + mActionDetails->setChecked( !mActionDetails->isChecked() ); + setDetailsToState(); +} void KABCore::setDetailsVisible( bool visible ) { if (visible && mDetails->isHidden()) { KABC::Addressee::List addrList = mViewManager->selectedAddressees(); if ( addrList.count() > 0 ) mDetails->setAddressee( addrList[ 0 ] ); } // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between // the listview and the detailview. We do that by changing the splitbar size. if (mMultipleViewsAtOnce) { if ( visible ) mDetails->show(); else mDetails->hide(); } else { if ( visible ) { mViewManager->hide(); mDetails->show(); mIncSearchWidget->setFocus(); } else { mViewManager->show(); mDetails->hide(); mViewManager->setFocusAV(); diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index a288505..6831ec9 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -117,64 +117,65 @@ class KABCore : public QWidget, public KSyncInterface KActionCollection *actionCollection() const; /** Returns the current search field of the Incremental Search Widget. */ KABC::Field *currentSearchField() const; /** Returns the uid list of the currently selected contacts. */ QStringList selectedUIDs() const; /** Displays the ResourceSelectDialog and returns the selected resource or a null pointer if no resource was selected by the user. */ KABC::Resource *requestResource( QWidget *parent ); #ifndef KAB_EMBEDDED static KAboutData *createAboutData(); #endif //KAB_EMBEDDED #ifdef KAB_EMBEDDED inline QPopupMenu* getImportMenu() { return ImportMenu;} inline QPopupMenu* getExportMenu() { return ExportMenu;} #endif //KAB_EMBEDDED public slots: #ifdef KAB_EMBEDDED void createAboutData(); #endif //KAB_EMBEDDED + void setDetailsToggle(); void showLicence(); void faq(); void whatsnew() ; void synchowto() ; void writeToPhone(); /** Is called whenever a contact is selected in the view. */ void setContactSelected( const QString &uid ); /** Opens the preferred mail composer with all selected contacts as arguments. */ void sendMail(); /** Opens the preferred mail composer with the given contacts as arguments. */ void sendMail( const QString& email ); void mailVCard(); void mailVCard(const QStringList& uids); /** Beams the "WhoAmI contact. */ void beamMySelf(); diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 9085673..9f12152 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -1087,64 +1087,70 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete if(it2 != keyvallist.end()) { QString value = (*it2); value = value.replace( QRegExp("%1"), param1 ); value = value.replace( QRegExp("%2"), param2 ); valmap.insert(key, value); useValMap = true; } else { // qDebug("pass parameter << %s", key.latin1()); (*e) << key; } } if (useValMap == true) (*e) << valmap; #endif } /************************************************************************** * **************************************************************************/ void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) { + + if ( cmsg == "nextView()" ) { + emit nextView(); + return; + } + bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); if (!res) res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); if (!res) res = mDisplayDetails->appMessage( cmsg, data ); // if (!res) // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); } bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) { mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); } bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) { QStringList list4, list5, list6; mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); } bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) { mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); } diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index 6f5d345..52a64e1 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h @@ -204,64 +204,65 @@ class ExternalAppHandler : public QObject //Call this method on the source when you want to select names from the addressbook by using QCop bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid); //Call this method on the target when you want to return the name/email map to the source (client). bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email); bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); bool requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid); bool requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid); bool returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& birthdayList, const QStringList& anniversaryList, const QStringList& realNameList, const QStringList& emailList, const QStringList& assembledNameList, const QStringList& uidList); //loadConfig clears the cache and checks again if the applications are available or not void loadConfig(); QList<DefaultAppItem> getAvailableDefaultItems(Types); DefaultAppItem* getDefaultItem(Types, int); public slots: void appMessage( const QCString& msg, const QByteArray& data ); signals: + void nextView(); // Emmitted when the target app receives a request from the source app void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi // The first parameter is a uniqueid. It can be used to identify the event void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email); void receivedFindByEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); // Emmitted when the target app receives a request from the source app void requestForBirthdayList(const QString& sourceChannel, const QString& uid); // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi // The first parameter is a uniqueid. It can be used to identify the event void receivedBirthdayListEvent(const QString& uid, const QStringList& birthdayList, const QStringList& anniversaryList, const QStringList& realNameList, const QStringList& emailList, const QStringList& assembledNameList, const QStringList& uidList); private: ExternalAppHandler(); QList<DefaultAppItem> mDefaultItems; Availability mEmailAppAvailable; Availability mPhoneAppAvailable; Availability mFaxAppAvailable; Availability mSMSAppAvailable; diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp index fbd17a7..68f3637 100644 --- a/pwmanager/pwmanager/pwminit.cpp +++ b/pwmanager/pwmanager/pwminit.cpp @@ -156,64 +156,73 @@ void PwMInit::initializeApp() // savedCmd.minToTray) { PwMDoc *newDoc = createDoc(); qDebug(" createDoc()"); if (!newDoc->openDocUi(newDoc, conf()->confGlobAutoStart(), openDeeplocked)) { delete newDoc; } //US ENH for embedded devices: in the case of failure, open a document the default way createMainWnd(conf()->confGlobAutoStart(), openDeeplocked, true, 0, savedCmd.minimized); // } } else { createMainWnd(conf()->confGlobAutoStart(), openDeeplocked, true, 0, savedCmd.minimized); } runStatus = running; } void PwMInit::shutdownApp(int exitStatus) { + + + PwM * iii; + while ( iii = _mainWndList.first() ) { + disconnect(iii, SIGNAL(closed(PwM *)), + this, SLOT(mainWndClosed(PwM *))); + mainWndClosed((iii)); + } + printDebug(string("PwMInit::shutdownApp(") + tostr(exitStatus) + ") called."); PWM_ASSERT((runStatus == running) || (runStatus == init)); runStatus = shutdown; QApplication::exit(exitStatus); /* The destructor of PwMInit is called when control * leaves main() */ } void PwMInit::initPosixSignalHandler() { signal(SIGINT, sig_handler); signal(SIGTERM, sig_handler); } void PwMInit::initDCOP() { #ifndef PWM_EMBEDDED _dcopClient = app->dcopClient(); _dcopClient->setNotifications(true); #endif } void PwMInit::initKWalletEmu(bool forceDisable, bool forceReload) { #ifdef CONFIG_KWALLETIF if (!conf()->confGlobKwalletEmu() || forceDisable) { delete_ifnot_null(_kwalletEmu); return; @@ -395,64 +404,65 @@ again: switch (mmlock) { case 0: // don't lock anything break; case 1: // normal lock wnd->curDoc()->lockAll(true); break; case 2: // deep-lock wnd->curDoc()->deepLock(); break; default: WARN(); } } else if (doDeleteDoc) { qDebug("doDeleteDoc "); if (!wnd->curDoc()->tryDelete()) { /* We failed deleting the doc, * so open a new window with it, again. */ createMainWnd(QString::null, false, false, wnd->curDoc()); } } #ifndef PWM_EMBEDDED // find the closed window in the "mainWndList" and delete it. QValueList<PwM *>::iterator i = _mainWndList.begin(), end = _mainWndList.end(); #else // find the closed window in the "mainWndList" and delete it. QValueList<PwM *>::Iterator i = _mainWndList.begin(), end = _mainWndList.end(); #endif while (i != end) { + //qDebug("iii %x end %x wnd %x", (*i), (*end), wnd); if (*i == wnd) { #ifndef PWM_EMBEDDED _mainWndList.erase(i); #else _mainWndList.remove(i); #endif if ( app->mainWidget() == wnd ) { if ( _mainWndList.count() ) { #ifndef DESKTOP_VERSION app->showMainWidget(_mainWndList.first() ); #endif //DESKTOP_VERSION } } delete wnd; goto out_success; } ++i; } BUG(); out_success: #ifndef PWM_EMBEDDED if (!_mainWndList.size()) #else if (!_mainWndList.count()) #endif { /* If there's no main window and no tray icon * left, we have no user interface, so we can * shut down the application. |