-rw-r--r-- | kabc/addresseedialog.cpp | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 648e780..19b52bb 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp | |||
@@ -121,19 +121,20 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | |||
121 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), | 121 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), |
122 | SLOT( selectNextItem( QListViewItem * ) ) ); | 122 | SLOT( selectNextItem( QListViewItem * ) ) ); |
123 | 123 | ||
124 | } | 124 | } |
125 | 125 | ||
126 | mAddressBook = StdAddressBook::self( true ); | 126 | mAddressBook = StdAddressBook::self( true ); |
127 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), | 127 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), |
128 | SLOT( addressBookChanged() ) ); | 128 | SLOT( addressBookChanged() ) ); |
129 | #if 0 | ||
129 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), | 130 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), |
130 | SLOT( addressBookChanged() ) ); | 131 | SLOT( addressBookChanged() ) ); |
131 | 132 | #endif | |
132 | loadAddressBook(); | 133 | loadAddressBook(); |
133 | QValueList<int> splitterSize; | 134 | QValueList<int> splitterSize; |
134 | splitterSize.append( ( width() / 5 ) * 3 ); | 135 | splitterSize.append( ( width() / 5 ) * 3 ); |
135 | splitterSize.append( ( width() / 5 ) *2 ); | 136 | splitterSize.append( ( width() / 5 ) *2 ); |
136 | mMiniSplitter->setSizes( splitterSize ); | 137 | mMiniSplitter->setSizes( splitterSize ); |
137 | } | 138 | } |
138 | 139 | ||
139 | AddresseeDialog::~AddresseeDialog() | 140 | AddresseeDialog::~AddresseeDialog() |
@@ -275,33 +276,74 @@ Addressee::List AddresseeDialog::addressees() | |||
275 | 276 | ||
276 | return al; | 277 | return al; |
277 | } | 278 | } |
278 | 279 | ||
279 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) | 280 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) |
280 | { | 281 | { |
281 | AddresseeDialog *dlg = new AddresseeDialog( parent ); | 282 | AddresseeDialog *dlg = new AddresseeDialog( parent ); |
282 | Addressee addressee; | 283 | Addressee addressee; |
283 | int result = dlg->exec(); | 284 | #ifdef DESKTOP_VERSION |
285 | static int geoX = 0; | ||
286 | static int geoY = 0; | ||
287 | static int geoW = 0; | ||
288 | static int geoH = 0; | ||
289 | if ( !geoX && ! geoY && !geoW &&!geoH ) { | ||
290 | geoX = dlg->geometry().x(); | ||
291 | geoY = dlg->geometry().y(); | ||
292 | geoW = dlg->width(); | ||
293 | geoH = dlg->height(); | ||
294 | } else { | ||
295 | dlg->show(); | ||
296 | dlg->setGeometry(geoX , geoY,geoW , geoH ); | ||
284 | 297 | ||
298 | } | ||
299 | #endif | ||
300 | int result = dlg->exec(); | ||
301 | #ifdef DESKTOP_VERSION | ||
302 | geoX = dlg->geometry().x(); | ||
303 | geoY = dlg->geometry().y(); | ||
304 | geoW = dlg->width(); | ||
305 | geoH = dlg->height(); | ||
306 | #endif | ||
285 | if ( result == QDialog::Accepted ) { | 307 | if ( result == QDialog::Accepted ) { |
286 | addressee = dlg->addressee(); | 308 | addressee = dlg->addressee(); |
287 | } | 309 | } |
288 | 310 | ||
289 | delete dlg; | 311 | delete dlg; |
290 | return addressee; | 312 | return addressee; |
291 | } | 313 | } |
292 | 314 | ||
293 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) | 315 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) |
294 | { | 316 | { |
295 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); | 317 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); |
296 | Addressee::List addressees; | 318 | Addressee::List addressees; |
319 | static int geoX = 0; | ||
320 | static int geoY = 0; | ||
321 | static int geoW = 0; | ||
322 | static int geoH = 0; | ||
297 | if ( QApplication::desktop()->width() <= 640 ) | 323 | if ( QApplication::desktop()->width() <= 640 ) |
298 | dlg->showMaximized(); | 324 | dlg->showMaximized(); |
325 | else { | ||
326 | if ( !geoX && ! geoY && !geoW &&!geoH ) { | ||
327 | geoX = dlg->geometry().x(); | ||
328 | geoY = dlg->geometry().y(); | ||
329 | geoW = dlg->width(); | ||
330 | geoH = dlg->height(); | ||
331 | } else { | ||
332 | dlg->show(); | ||
333 | dlg->setGeometry(geoX , geoY,geoW , geoH ); | ||
334 | |||
335 | } | ||
336 | } | ||
299 | int result = dlg->exec(); | 337 | int result = dlg->exec(); |
338 | geoX = dlg->geometry().x(); | ||
339 | geoY = dlg->geometry().y(); | ||
340 | geoW = dlg->width(); | ||
341 | geoH = dlg->height(); | ||
300 | if ( result == QDialog::Accepted ) { | 342 | if ( result == QDialog::Accepted ) { |
301 | addressees = dlg->addressees(); | 343 | addressees = dlg->addressees(); |
302 | } | 344 | } |
303 | 345 | ||
304 | delete dlg; | 346 | delete dlg; |
305 | return addressees; | 347 | return addressees; |
306 | } | 348 | } |
307 | 349 | ||