Diffstat (limited to 'kaddressbook/kaddressbookmain.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index f48f214..8c4ca09 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -47,97 +47,107 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW | |||
47 | //MOC_SKIP_END | 47 | //MOC_SKIP_END |
48 | #endif //KAB_EMBEDDED | 48 | #endif //KAB_EMBEDDED |
49 | { | 49 | { |
50 | 50 | ||
51 | setIcon(SmallIcon( "ka24" ) ); | 51 | setIcon(SmallIcon( "ka24" ) ); |
52 | #if 0 | 52 | #if 0 |
53 | //US for embedded systems, create the toolbar before we initiate KABCore. | 53 | //US for embedded systems, create the toolbar before we initiate KABCore. |
54 | // KABCore will fill the toolbar with menues and icons | 54 | // KABCore will fill the toolbar with menues and icons |
55 | QMainWindow::ToolBarDock tbd; | 55 | QMainWindow::ToolBarDock tbd; |
56 | tbd = Top; | 56 | tbd = Top; |
57 | iconToolBar = new QToolBar( this ); | 57 | iconToolBar = new QToolBar( this ); |
58 | addToolBar (iconToolBar , tbd ); | 58 | addToolBar (iconToolBar , tbd ); |
59 | iconToolBar->setHorizontalStretchable(true); | 59 | iconToolBar->setHorizontalStretchable(true); |
60 | //US iconToolBar->setWidth(300); | 60 | //US iconToolBar->setWidth(300); |
61 | #endif // 0 | 61 | #endif // 0 |
62 | 62 | ||
63 | mCore = new KABCore( this, true, this ); | 63 | mCore = new KABCore( this, true, this ); |
64 | 64 | ||
65 | #ifdef KAB_EMBEDDED | 65 | #ifdef KAB_EMBEDDED |
66 | setCaption( i18n( "KAddressbook/Pi" ) ); | 66 | setCaption( i18n( "KAddressbook/Pi" ) ); |
67 | #else //KAB_EMBEDDED | 67 | #else //KAB_EMBEDDED |
68 | setCaption( i18n( "Address Book Browser" ) ); | 68 | setCaption( i18n( "Address Book Browser" ) ); |
69 | #endif //KAB_EMBEDDED | 69 | #endif //KAB_EMBEDDED |
70 | 70 | ||
71 | //mCore->restoreSettings(); | 71 | //mCore->restoreSettings(); |
72 | 72 | ||
73 | initActions(); | 73 | initActions(); |
74 | 74 | ||
75 | setCentralWidget( mCore ); | 75 | setCentralWidget( mCore ); |
76 | 76 | ||
77 | //US statusBar()->show(); | 77 | //US statusBar()->show(); |
78 | 78 | ||
79 | #ifndef KAB_EMBEDDED | 79 | #ifndef KAB_EMBEDDED |
80 | setStandardToolBarMenuEnabled(true); | 80 | setStandardToolBarMenuEnabled(true); |
81 | 81 | ||
82 | createGUI( "kaddressbookui.rc", false ); | 82 | createGUI( "kaddressbookui.rc", false ); |
83 | 83 | ||
84 | 84 | ||
85 | #endif //KAB_EMBEDDED | 85 | #endif //KAB_EMBEDDED |
86 | setAutoSaveSettings(); | 86 | setAutoSaveSettings(); |
87 | qApp->processEvents(); | 87 | qApp->processEvents(); |
88 | mCore->restoreSettings(); | 88 | mCore->restoreSettings(); |
89 | } | 89 | } |
90 | 90 | ||
91 | KAddressBookMain::~KAddressBookMain() | 91 | KAddressBookMain::~KAddressBookMain() |
92 | { | 92 | { |
93 | // mCore->saveSettings(); | 93 | // mCore->saveSettings(); |
94 | } | 94 | } |
95 | 95 | void KAddressBookMain::recieve( const QCString& cmsg, const QByteArray& data ) | |
96 | { | ||
97 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); | ||
98 | if ( cmsg == "setDocument(QString)" ) { | ||
99 | QDataStream stream( data, IO_ReadOnly ); | ||
100 | QString fileName; | ||
101 | stream >> fileName; | ||
102 | mCore->recieve( fileName ); | ||
103 | return; | ||
104 | } | ||
105 | } | ||
96 | void KAddressBookMain::showMinimized () | 106 | void KAddressBookMain::showMinimized () |
97 | { | 107 | { |
98 | QWidget::showMinimized () ; | 108 | QWidget::showMinimized () ; |
99 | } | 109 | } |
100 | void KAddressBookMain::addEmail( QString addr ) | 110 | void KAddressBookMain::addEmail( QString addr ) |
101 | { | 111 | { |
102 | mCore->addEmail( addr ); | 112 | mCore->addEmail( addr ); |
103 | } | 113 | } |
104 | 114 | ||
105 | #ifndef KAB_EMBEDDED | 115 | #ifndef KAB_EMBEDDED |
106 | ASYNC KAddressBookMain::showContactEditor( QString uid ) | 116 | ASYNC KAddressBookMain::showContactEditor( QString uid ) |
107 | { | 117 | { |
108 | mCore->editContact( uid ); | 118 | mCore->editContact( uid ); |
109 | } | 119 | } |
110 | #endif //KAB_EMBEDDED | 120 | #endif //KAB_EMBEDDED |
111 | void KAddressBookMain::newContact() | 121 | void KAddressBookMain::newContact() |
112 | { | 122 | { |
113 | mCore->newContact(); | 123 | mCore->newContact(); |
114 | } | 124 | } |
115 | 125 | ||
116 | QString KAddressBookMain::getNameByPhone( QString phone ) | 126 | QString KAddressBookMain::getNameByPhone( QString phone ) |
117 | { | 127 | { |
118 | return mCore->getNameByPhone( phone ); | 128 | return mCore->getNameByPhone( phone ); |
119 | } | 129 | } |
120 | 130 | ||
121 | void KAddressBookMain::save() | 131 | void KAddressBookMain::save() |
122 | { | 132 | { |
123 | mCore->save(); | 133 | mCore->save(); |
124 | } | 134 | } |
125 | 135 | ||
126 | void KAddressBookMain::exit() | 136 | void KAddressBookMain::exit() |
127 | { | 137 | { |
128 | close( ); | 138 | close( ); |
129 | } | 139 | } |
130 | 140 | ||
131 | void KAddressBookMain::saveProperties( KConfig* ) | 141 | void KAddressBookMain::saveProperties( KConfig* ) |
132 | { | 142 | { |
133 | } | 143 | } |
134 | 144 | ||
135 | void KAddressBookMain::readProperties( KConfig* ) | 145 | void KAddressBookMain::readProperties( KConfig* ) |
136 | { | 146 | { |
137 | } | 147 | } |
138 | 148 | ||
139 | void KAddressBookMain::initActions() | 149 | void KAddressBookMain::initActions() |
140 | { | 150 | { |
141 | #ifndef KAB_EMBEDDED | 151 | #ifndef KAB_EMBEDDED |
142 | KStdAction::quit( this, SLOT( close() ), actionCollection() ); | 152 | KStdAction::quit( this, SLOT( close() ), actionCollection() ); |
143 | KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); | 153 | KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); |