author | ar <ar> | 2004-02-08 19:14:56 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-08 19:14:56 (UTC) |
commit | 5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0 (patch) (unidiff) | |
tree | 525f35c4937c9f4ae99538289c5d1f96c53d7fa7 | |
parent | 2dc8add65c44b3dd240cf2bd3c276c3c0155f46b (diff) | |
download | opie-5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0.zip opie-5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0.tar.gz opie-5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0.tar.bz2 |
improve support for BigScreen
23 files changed, 82 insertions, 88 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 26bc36d..78f9da2 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -219,72 +219,70 @@ void AdvancedFm::doDelete() { | |||
219 | // DocLnk lnk(f); | 219 | // DocLnk lnk(f); |
220 | DocLnk *lnk; | 220 | DocLnk *lnk; |
221 | lnk = new DocLnk(f); | 221 | lnk = new DocLnk(f); |
222 | // qDebug("Deleting doclnk " + lnk->linkFile()); | 222 | // qDebug("Deleting doclnk " + lnk->linkFile()); |
223 | if(lnk->isValid()) | 223 | if(lnk->isValid()) |
224 | lnk->removeLinkFile(); | 224 | lnk->removeLinkFile(); |
225 | // delete lnk; | 225 | // delete lnk; |
226 | file.remove(); | 226 | file.remove(); |
227 | } | 227 | } |
228 | } | 228 | } |
229 | } | 229 | } |
230 | } | 230 | } |
231 | populateView(); | 231 | populateView(); |
232 | } | 232 | } |
233 | 233 | ||
234 | void AdvancedFm::filePerms() { | 234 | void AdvancedFm::filePerms() { |
235 | QStringList curFileList = getPath(); | 235 | QStringList curFileList = getPath(); |
236 | QString filePath; | 236 | QString filePath; |
237 | 237 | ||
238 | filePath = CurrentDir()->canonicalPath()+"/"; | 238 | filePath = CurrentDir()->canonicalPath()+"/"; |
239 | 239 | ||
240 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 240 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
241 | filePermissions *filePerm; | 241 | filePermissions *filePerm; |
242 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); | 242 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); |
243 | filePerm->showMaximized(); | 243 | QPEApplication::execDialog( filePerm ); |
244 | filePerm->exec(); | ||
245 | if( filePerm) | 244 | if( filePerm) |
246 | delete filePerm; | 245 | delete filePerm; |
247 | } | 246 | } |
248 | populateView(); | 247 | populateView(); |
249 | } | 248 | } |
250 | 249 | ||
251 | void AdvancedFm::doProperties() { | 250 | void AdvancedFm::doProperties() { |
252 | #if defined(QT_QWS_OPIE) | 251 | #if defined(QT_QWS_OPIE) |
253 | 252 | ||
254 | QStringList curFileList = getPath(); | 253 | QStringList curFileList = getPath(); |
255 | 254 | ||
256 | QString filePath; | 255 | QString filePath; |
257 | filePath = CurrentDir()->canonicalPath()+"/"; | 256 | filePath = CurrentDir()->canonicalPath()+"/"; |
258 | 257 | ||
259 | // qDebug("%d",curFileList.count()); | 258 | // qDebug("%d",curFileList.count()); |
260 | 259 | ||
261 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 260 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
262 | // qDebug((filePath+*it)); | 261 | // qDebug((filePath+*it)); |
263 | DocLnk lnk( (filePath+*it)); | 262 | DocLnk lnk( (filePath+*it)); |
264 | LnkProperties prop( &lnk ); | 263 | LnkProperties prop( &lnk ); |
265 | prop.showMaximized(); | 264 | QPEApplication::execDialog( &prop ); |
266 | prop.exec(); | ||
267 | } | 265 | } |
268 | #endif | 266 | #endif |
269 | 267 | ||
270 | } | 268 | } |
271 | 269 | ||
272 | void AdvancedFm::upDir() { | 270 | void AdvancedFm::upDir() { |
273 | QDir *thisDir = CurrentDir(); | 271 | QDir *thisDir = CurrentDir(); |
274 | QString current = thisDir->canonicalPath(); | 272 | QString current = thisDir->canonicalPath(); |
275 | QDir dir(current); | 273 | QDir dir(current); |
276 | dir.cdUp(); | 274 | dir.cdUp(); |
277 | current = dir.canonicalPath(); | 275 | current = dir.canonicalPath(); |
278 | chdir( current.latin1() ); | 276 | chdir( current.latin1() ); |
279 | thisDir->cd( current, TRUE); | 277 | thisDir->cd( current, TRUE); |
280 | 278 | ||
281 | populateView(); | 279 | populateView(); |
282 | update(); | 280 | update(); |
283 | } | 281 | } |
284 | 282 | ||
285 | void AdvancedFm::copy() { | 283 | void AdvancedFm::copy() { |
286 | qApp->processEvents(); | 284 | qApp->processEvents(); |
287 | QStringList curFileList = getPath(); | 285 | QStringList curFileList = getPath(); |
288 | 286 | ||
289 | QDir *thisDir = CurrentDir(); | 287 | QDir *thisDir = CurrentDir(); |
290 | QDir *thatDir = OtherDir(); | 288 | QDir *thatDir = OtherDir(); |
@@ -580,88 +578,86 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { | |||
580 | } | 578 | } |
581 | 579 | ||
582 | void AdvancedFm::runCommand() { | 580 | void AdvancedFm::runCommand() { |
583 | if( !CurrentView()->currentItem()) return; | 581 | if( !CurrentView()->currentItem()) return; |
584 | QDir *thisDir = CurrentDir(); | 582 | QDir *thisDir = CurrentDir(); |
585 | 583 | ||
586 | QString curFile; | 584 | QString curFile; |
587 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); | 585 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); |
588 | 586 | ||
589 | InputDialog *fileDlg; | 587 | InputDialog *fileDlg; |
590 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 588 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
591 | fileDlg->setInputText(curFile); | 589 | fileDlg->setInputText(curFile); |
592 | fileDlg->exec(); | 590 | fileDlg->exec(); |
593 | //QString command; | 591 | //QString command; |
594 | 592 | ||
595 | if( fileDlg->result() == 1 ) { | 593 | if( fileDlg->result() == 1 ) { |
596 | // qDebug(fileDlg->LineEdit1->text()); | 594 | // qDebug(fileDlg->LineEdit1->text()); |
597 | QStringList command; | 595 | QStringList command; |
598 | 596 | ||
599 | command << "/bin/sh"; | 597 | command << "/bin/sh"; |
600 | command << "-c"; | 598 | command << "-c"; |
601 | command << fileDlg->LineEdit1->text(); | 599 | command << fileDlg->LineEdit1->text(); |
602 | Output *outDlg; | 600 | Output *outDlg; |
603 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 601 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
604 | outDlg->showMaximized(); | 602 | QPEApplication::execDialog( outDlg ); |
605 | outDlg->exec(); | ||
606 | qApp->processEvents(); | 603 | qApp->processEvents(); |
607 | 604 | ||
608 | } | 605 | } |
609 | } | 606 | } |
610 | 607 | ||
611 | void AdvancedFm::runCommandStd() { | 608 | void AdvancedFm::runCommandStd() { |
612 | if( !CurrentView()->currentItem()) return; | 609 | if( !CurrentView()->currentItem()) return; |
613 | QString curFile; | 610 | QString curFile; |
614 | QDir *thisDir = CurrentDir(); | 611 | QDir *thisDir = CurrentDir(); |
615 | QListView *thisView = CurrentView(); | 612 | QListView *thisView = CurrentView(); |
616 | if( thisView->currentItem()) | 613 | if( thisView->currentItem()) |
617 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); | 614 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); |
618 | 615 | ||
619 | InputDialog *fileDlg; | 616 | InputDialog *fileDlg; |
620 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 617 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
621 | fileDlg->setInputText(curFile); | 618 | fileDlg->setInputText(curFile); |
622 | fileDlg->exec(); | 619 | fileDlg->exec(); |
623 | 620 | ||
624 | if( fileDlg->result() == 1 ) { | 621 | if( fileDlg->result() == 1 ) { |
625 | qApp->processEvents(); | 622 | qApp->processEvents(); |
626 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); | 623 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); |
627 | } | 624 | } |
628 | } | 625 | } |
629 | 626 | ||
630 | void AdvancedFm::fileStatus() { | 627 | void AdvancedFm::fileStatus() { |
631 | if( !CurrentView()->currentItem()) return; | 628 | if( !CurrentView()->currentItem()) return; |
632 | QString curFile; | 629 | QString curFile; |
633 | curFile = CurrentView()->currentItem()->text(0); | 630 | curFile = CurrentView()->currentItem()->text(0); |
634 | 631 | ||
635 | QStringList command; | 632 | QStringList command; |
636 | command << "/bin/sh"; | 633 | command << "/bin/sh"; |
637 | command << "-c"; | 634 | command << "-c"; |
638 | command << "stat -l "+ curFile; | 635 | command << "stat -l "+ curFile; |
639 | 636 | ||
640 | Output *outDlg; | 637 | Output *outDlg; |
641 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 638 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
642 | outDlg->showMaximized(); | 639 | QPEApplication::execDialog( outDlg ); |
643 | outDlg->exec(); | ||
644 | qApp->processEvents(); | 640 | qApp->processEvents(); |
645 | } | 641 | } |
646 | 642 | ||
647 | 643 | ||
648 | void AdvancedFm::mkDir() { | 644 | void AdvancedFm::mkDir() { |
649 | makeDir(); | 645 | makeDir(); |
650 | } | 646 | } |
651 | 647 | ||
652 | void AdvancedFm::rn() { | 648 | void AdvancedFm::rn() { |
653 | renameIt(); | 649 | renameIt(); |
654 | } | 650 | } |
655 | 651 | ||
656 | void AdvancedFm::del() { | 652 | void AdvancedFm::del() { |
657 | doDelete(); | 653 | doDelete(); |
658 | } | 654 | } |
659 | 655 | ||
660 | void AdvancedFm::mkSym() { | 656 | void AdvancedFm::mkSym() { |
661 | QString cmd; | 657 | QString cmd; |
662 | QStringList curFileList = getPath(); | 658 | QStringList curFileList = getPath(); |
663 | if( curFileList.count() > 0) { | 659 | if( curFileList.count() > 0) { |
664 | QDir *thisDir = CurrentDir(); | 660 | QDir *thisDir = CurrentDir(); |
665 | QDir * thatDir = OtherDir(); | 661 | QDir * thatDir = OtherDir(); |
666 | 662 | ||
667 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 663 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp index a42c824..a5492e4 100644 --- a/noncore/apps/checkbook/checkbook.cpp +++ b/noncore/apps/checkbook/checkbook.cpp | |||
@@ -462,97 +462,95 @@ void Checkbook::slotNameChanged( const QString &newname ) | |||
462 | namestr.append( tr( "Checkbook" ) ); | 462 | namestr.append( tr( "Checkbook" ) ); |
463 | setCaption( namestr ); | 463 | setCaption( namestr ); |
464 | } | 464 | } |
465 | 465 | ||
466 | 466 | ||
467 | // ---slotStartingBalanceChanged ---------------------------------------------- | 467 | // ---slotStartingBalanceChanged ---------------------------------------------- |
468 | void Checkbook::slotStartingBalanceChanged( const QString &newbalance ) | 468 | void Checkbook::slotStartingBalanceChanged( const QString &newbalance ) |
469 | { | 469 | { |
470 | bool ok; | 470 | bool ok; |
471 | info->setStartingBalance( newbalance.toFloat( &ok ) ); | 471 | info->setStartingBalance( newbalance.toFloat( &ok ) ); |
472 | adjustBalance(); | 472 | adjustBalance(); |
473 | } | 473 | } |
474 | 474 | ||
475 | 475 | ||
476 | // --- slotNewTran ------------------------------------------------------------ | 476 | // --- slotNewTran ------------------------------------------------------------ |
477 | void Checkbook::slotNewTran() | 477 | void Checkbook::slotNewTran() |
478 | { | 478 | { |
479 | TranInfo *traninfo = new TranInfo( info->getNextNumber() ); | 479 | TranInfo *traninfo = new TranInfo( info->getNextNumber() ); |
480 | if( !_dLastNew.isNull() ) | 480 | if( !_dLastNew.isNull() ) |
481 | traninfo->setDate(_dLastNew); | 481 | traninfo->setDate(_dLastNew); |
482 | 482 | ||
483 | Transaction *currtran = new Transaction( this, true, info->name(), | 483 | Transaction *currtran = new Transaction( this, true, info->name(), |
484 | traninfo, | 484 | traninfo, |
485 | _pCfg ); | 485 | _pCfg ); |
486 | currtran->showMaximized(); | 486 | if ( QPEApplication::execDialog( currtran ) == QDialog::Accepted ) |
487 | if ( currtran->exec() == QDialog::Accepted ) | ||
488 | { | 487 | { |
489 | // Add to transaction list | 488 | // Add to transaction list |
490 | info->addTransaction( traninfo ); | 489 | info->addTransaction( traninfo ); |
491 | 490 | ||
492 | // Add to transaction table | 491 | // Add to transaction table |
493 | float amount; | 492 | float amount; |
494 | QString stramount; | 493 | QString stramount; |
495 | amount = (traninfo->withdrawal() ? -1 : 1)*traninfo->amount(); | 494 | amount = (traninfo->withdrawal() ? -1 : 1)*traninfo->amount(); |
496 | stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); | 495 | stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); |
497 | ( void ) new CBListItem( traninfo, tranTable, traninfo->getIdStr(), traninfo->datestr(false), | 496 | ( void ) new CBListItem( traninfo, tranTable, traninfo->getIdStr(), traninfo->datestr(false), |
498 | traninfo->number(), traninfo->datestr(true), traninfo->desc(), | 497 | traninfo->number(), traninfo->datestr(true), traninfo->desc(), |
499 | stramount ); | 498 | stramount ); |
500 | resort(); | 499 | resort(); |
501 | adjustBalance(); | 500 | adjustBalance(); |
502 | 501 | ||
503 | // save last date | 502 | // save last date |
504 | _dLastNew = traninfo->date(); | 503 | _dLastNew = traninfo->date(); |
505 | 504 | ||
506 | // save description in list of payees, if not in there | 505 | // save description in list of payees, if not in there |
507 | QStringList *pLst=&_pCfg->getPayees(); | 506 | QStringList *pLst=&_pCfg->getPayees(); |
508 | if( _pCfg->getSavePayees() && pLst->contains(traninfo->desc())==0 ) { | 507 | if( _pCfg->getSavePayees() && pLst->contains(traninfo->desc())==0 ) { |
509 | pLst->append( traninfo->desc() ); | 508 | pLst->append( traninfo->desc() ); |
510 | pLst->sort(); | 509 | pLst->sort(); |
511 | _pCfg->setDirty(true); | 510 | _pCfg->setDirty(true); |
512 | } | 511 | } |
513 | } | 512 | } |
514 | else | 513 | else |
515 | { | 514 | { |
516 | delete traninfo; | 515 | delete traninfo; |
517 | } | 516 | } |
518 | } | 517 | } |
519 | 518 | ||
520 | 519 | ||
521 | // --- slotEditTran ----------------------------------------------------------- | 520 | // --- slotEditTran ----------------------------------------------------------- |
522 | void Checkbook::slotEditTran() | 521 | void Checkbook::slotEditTran() |
523 | { | 522 | { |
524 | QListViewItem *curritem = tranTable->currentItem(); | 523 | QListViewItem *curritem = tranTable->currentItem(); |
525 | if ( !curritem ) | 524 | if ( !curritem ) |
526 | return; | 525 | return; |
527 | 526 | ||
528 | TranInfo *traninfo=info->findTransaction( curritem->text(COL_ID) ); | 527 | TranInfo *traninfo=info->findTransaction( curritem->text(COL_ID) ); |
529 | 528 | ||
530 | Transaction *currtran = new Transaction( this, false, info->name(), | 529 | Transaction *currtran = new Transaction( this, false, info->name(), |
531 | traninfo, | 530 | traninfo, |
532 | _pCfg ); | 531 | _pCfg ); |
533 | currtran->showMaximized(); | 532 | if ( QPEApplication::execDialog( currtran ) == QDialog::Accepted ) |
534 | if ( currtran->exec() == QDialog::Accepted ) | ||
535 | { | 533 | { |
536 | curritem->setText( COL_NUM, traninfo->number() ); | 534 | curritem->setText( COL_NUM, traninfo->number() ); |
537 | curritem->setText( COL_SORTDATE, traninfo->datestr(false) ); | 535 | curritem->setText( COL_SORTDATE, traninfo->datestr(false) ); |
538 | curritem->setText( COL_DATE, traninfo->datestr(true) ); | 536 | curritem->setText( COL_DATE, traninfo->datestr(true) ); |
539 | curritem->setText( COL_DESC, traninfo->desc() ); | 537 | curritem->setText( COL_DESC, traninfo->desc() ); |
540 | 538 | ||
541 | float amount = traninfo->amount(); | 539 | float amount = traninfo->amount(); |
542 | if ( traninfo->withdrawal() ) | 540 | if ( traninfo->withdrawal() ) |
543 | { | 541 | { |
544 | amount *= -1; | 542 | amount *= -1; |
545 | } | 543 | } |
546 | QString stramount; | 544 | QString stramount; |
547 | stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); | 545 | stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); |
548 | curritem->setText( COL_AMOUNT, stramount ); | 546 | curritem->setText( COL_AMOUNT, stramount ); |
549 | resort(); | 547 | resort(); |
550 | adjustBalance(); | 548 | adjustBalance(); |
551 | 549 | ||
552 | // save description in list of payees, if not in there | 550 | // save description in list of payees, if not in there |
553 | QStringList *pLst=&_pCfg->getPayees(); | 551 | QStringList *pLst=&_pCfg->getPayees(); |
554 | if( _pCfg->getSavePayees() && pLst->contains(traninfo->desc())==0 ) { | 552 | if( _pCfg->getSavePayees() && pLst->contains(traninfo->desc())==0 ) { |
555 | pLst->append( traninfo->desc() ); | 553 | pLst->append( traninfo->desc() ); |
556 | pLst->sort(); | 554 | pLst->sort(); |
557 | _pCfg->setDirty(true); | 555 | _pCfg->setDirty(true); |
558 | } | 556 | } |
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp index f29001a..60aea42 100644 --- a/noncore/apps/checkbook/mainwindow.cpp +++ b/noncore/apps/checkbook/mainwindow.cpp | |||
@@ -15,53 +15,53 @@ | |||
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "mainwindow.h" | 29 | #include "mainwindow.h" |
30 | #include "cbinfo.h" | 30 | #include "cbinfo.h" |
31 | #include "configuration.h" | 31 | #include "configuration.h" |
32 | #include "password.h" | 32 | #include "password.h" |
33 | #include "checkbook.h" | 33 | #include "checkbook.h" |
34 | #include "listedit.h" | 34 | #include "listedit.h" |
35 | 35 | ||
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include <qpe/global.h> | 37 | #include <qpe/global.h> |
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | #include <qmenubar.h> | ||
40 | #include <qpe/qpemessagebox.h> | 39 | #include <qpe/qpemessagebox.h> |
41 | #include <qpe/qpetoolbar.h> | 40 | #include <qpe/qpetoolbar.h> |
42 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
43 | 42 | ||
43 | #include <qmenubar.h> | ||
44 | #include <qaction.h> | 44 | #include <qaction.h> |
45 | #include <qcheckbox.h> | 45 | #include <qcheckbox.h> |
46 | #include <qdir.h> | 46 | #include <qdir.h> |
47 | #include <qlineedit.h> | 47 | #include <qlineedit.h> |
48 | #include <qwhatsthis.h> | 48 | #include <qwhatsthis.h> |
49 | 49 | ||
50 | 50 | ||
51 | MainWindow::MainWindow( QWidget* parent, const char* name, WFlags /*fl*/ ) | 51 | MainWindow::MainWindow( QWidget* parent, const char* name, WFlags /*fl*/ ) |
52 | : QMainWindow( parent, name, WStyle_ContextHelp ) | 52 | : QMainWindow( parent, name, WStyle_ContextHelp ) |
53 | { | 53 | { |
54 | setCaption( tr( "Checkbook" ) ); | 54 | setCaption( tr( "Checkbook" ) ); |
55 | 55 | ||
56 | cbDir = Global::applicationFileName( "checkbook", "" ); | 56 | cbDir = Global::applicationFileName( "checkbook", "" ); |
57 | lockIcon = Resource::loadPixmap( "locked" ); | 57 | lockIcon = Resource::loadPixmap( "locked" ); |
58 | 58 | ||
59 | // Load configuration options | 59 | // Load configuration options |
60 | Config config( "checkbook" ); | 60 | Config config( "checkbook" ); |
61 | _cfg.readConfig( config ); | 61 | _cfg.readConfig( config ); |
62 | 62 | ||
63 | 63 | ||
64 | // Build menu and tool bars | 64 | // Build menu and tool bars |
65 | setToolBarsMovable( FALSE ); | 65 | setToolBarsMovable( FALSE ); |
66 | 66 | ||
67 | QToolBar *bar = new QToolBar( this ); | 67 | QToolBar *bar = new QToolBar( this ); |
@@ -193,50 +193,49 @@ void MainWindow::addCheckbook( CBInfo *cb ) | |||
193 | { | 193 | { |
194 | lvi->setPixmap( 0, lockIcon ); | 194 | lvi->setPixmap( 0, lockIcon ); |
195 | } | 195 | } |
196 | lvi->setText( posName, cb->name() ); | 196 | lvi->setText( posName, cb->name() ); |
197 | if ( _cfg.getShowBalances() ) | 197 | if ( _cfg.getShowBalances() ) |
198 | { | 198 | { |
199 | QString balance; | 199 | QString balance; |
200 | balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() ); | 200 | balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() ); |
201 | lvi->setText( posName + 1, balance ); | 201 | lvi->setText( posName + 1, balance ); |
202 | } | 202 | } |
203 | } | 203 | } |
204 | 204 | ||
205 | void MainWindow::buildFilename( const QString &name ) | 205 | void MainWindow::buildFilename( const QString &name ) |
206 | { | 206 | { |
207 | tempFilename = cbDir; | 207 | tempFilename = cbDir; |
208 | tempFilename.append( name ); | 208 | tempFilename.append( name ); |
209 | tempFilename.append( ".qcb" ); | 209 | tempFilename.append( ".qcb" ); |
210 | } | 210 | } |
211 | 211 | ||
212 | void MainWindow::slotNew() | 212 | void MainWindow::slotNew() |
213 | { | 213 | { |
214 | CBInfo *cb = new CBInfo(); | 214 | CBInfo *cb = new CBInfo(); |
215 | 215 | ||
216 | Checkbook *currcb = new Checkbook( this, cb, &_cfg ); | 216 | Checkbook *currcb = new Checkbook( this, cb, &_cfg ); |
217 | currcb->showMaximized(); | 217 | if ( QPEApplication::execDialog( currcb ) == QDialog::Accepted ) |
218 | if ( currcb->exec() == QDialog::Accepted ) | ||
219 | { | 218 | { |
220 | // Save new checkbook | 219 | // Save new checkbook |
221 | buildFilename( cb->name() ); | 220 | buildFilename( cb->name() ); |
222 | _cfg.setLastBook( cb->name() ); | 221 | _cfg.setLastBook( cb->name() ); |
223 | cb->setFilename( tempFilename ); | 222 | cb->setFilename( tempFilename ); |
224 | cb->write(); | 223 | cb->write(); |
225 | 224 | ||
226 | // Add to listbox | 225 | // Add to listbox |
227 | checkbooks->inSort( cb ); | 226 | checkbooks->inSort( cb ); |
228 | addCheckbook( cb ); | 227 | addCheckbook( cb ); |
229 | } | 228 | } |
230 | delete currcb; | 229 | delete currcb; |
231 | } | 230 | } |
232 | 231 | ||
233 | // --- slotEdit --------------------------------------------------------------- | 232 | // --- slotEdit --------------------------------------------------------------- |
234 | void MainWindow::slotEdit() | 233 | void MainWindow::slotEdit() |
235 | { | 234 | { |
236 | // get name and open it | 235 | // get name and open it |
237 | QListViewItem *curritem = cbList->currentItem(); | 236 | QListViewItem *curritem = cbList->currentItem(); |
238 | if ( !curritem ) | 237 | if ( !curritem ) |
239 | return; | 238 | return; |
240 | openBook( curritem ); | 239 | openBook( curritem ); |
241 | } | 240 | } |
242 | 241 | ||
@@ -251,50 +250,49 @@ void MainWindow::openBook(QListViewItem *curritem) | |||
251 | if ( cb->name() == currname ) | 250 | if ( cb->name() == currname ) |
252 | break; | 251 | break; |
253 | cb = checkbooks->next(); | 252 | cb = checkbooks->next(); |
254 | } | 253 | } |
255 | if ( !cb ) return; | 254 | if ( !cb ) return; |
256 | 255 | ||
257 | // | 256 | // |
258 | buildFilename( currname ); | 257 | buildFilename( currname ); |
259 | float currbalance = cb->balance(); | 258 | float currbalance = cb->balance(); |
260 | bool currlock = !cb->password().isNull(); | 259 | bool currlock = !cb->password().isNull(); |
261 | 260 | ||
262 | if ( currlock ) | 261 | if ( currlock ) |
263 | { | 262 | { |
264 | Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) ); | 263 | Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) ); |
265 | if ( pw->exec() != QDialog::Accepted || pw->password != cb->password() ) | 264 | if ( pw->exec() != QDialog::Accepted || pw->password != cb->password() ) |
266 | { | 265 | { |
267 | delete pw; | 266 | delete pw; |
268 | return; | 267 | return; |
269 | } | 268 | } |
270 | delete pw; | 269 | delete pw; |
271 | } | 270 | } |
272 | 271 | ||
273 | _cfg.setLastBook( currname ); | 272 | _cfg.setLastBook( currname ); |
274 | Checkbook *currcb = new Checkbook( this, cb, &_cfg ); | 273 | Checkbook *currcb = new Checkbook( this, cb, &_cfg ); |
275 | currcb->showMaximized(); | 274 | if ( QPEApplication::execDialog( currcb ) == QDialog::Accepted ) |
276 | if ( currcb->exec() == QDialog::Accepted ) | ||
277 | { | 275 | { |
278 | QString newname = cb->name(); | 276 | QString newname = cb->name(); |
279 | if ( currname != newname ) | 277 | if ( currname != newname ) |
280 | { | 278 | { |
281 | // Update name if changed | 279 | // Update name if changed |
282 | if( curritem ) { | 280 | if( curritem ) { |
283 | curritem->setText( posName, newname ); | 281 | curritem->setText( posName, newname ); |
284 | cbList->sort(); | 282 | cbList->sort(); |
285 | } | 283 | } |
286 | _cfg.setLastBook( newname ); | 284 | _cfg.setLastBook( newname ); |
287 | 285 | ||
288 | // Remove old file | 286 | // Remove old file |
289 | QFile f( tempFilename ); | 287 | QFile f( tempFilename ); |
290 | if ( f.exists() ) | 288 | if ( f.exists() ) |
291 | f.remove(); | 289 | f.remove(); |
292 | 290 | ||
293 | // Get new filename | 291 | // Get new filename |
294 | buildFilename( newname ); | 292 | buildFilename( newname ); |
295 | cb->setFilename( tempFilename ); | 293 | cb->setFilename( tempFilename ); |
296 | } | 294 | } |
297 | 295 | ||
298 | cb->write(); | 296 | cb->write(); |
299 | 297 | ||
300 | // Update lock if changed | 298 | // Update lock if changed |
@@ -324,42 +322,41 @@ void MainWindow::openBook(QListViewItem *curritem) | |||
324 | } | 322 | } |
325 | 323 | ||
326 | // --- slotDelete ------------------------------------------------------------- | 324 | // --- slotDelete ------------------------------------------------------------- |
327 | void MainWindow::slotDelete() | 325 | void MainWindow::slotDelete() |
328 | { | 326 | { |
329 | QString currname = cbList->currentItem()->text( posName ); | 327 | QString currname = cbList->currentItem()->text( posName ); |
330 | 328 | ||
331 | if ( QPEMessageBox::confirmDelete ( this, tr( "Delete checkbook" ), currname ) ) | 329 | if ( QPEMessageBox::confirmDelete ( this, tr( "Delete checkbook" ), currname ) ) |
332 | { | 330 | { |
333 | buildFilename( currname ); | 331 | buildFilename( currname ); |
334 | QFile f( tempFilename ); | 332 | QFile f( tempFilename ); |
335 | if ( f.exists() ) | 333 | if ( f.exists() ) |
336 | { | 334 | { |
337 | f.remove(); | 335 | f.remove(); |
338 | } | 336 | } |
339 | 337 | ||
340 | delete cbList->currentItem(); | 338 | delete cbList->currentItem(); |
341 | } | 339 | } |
342 | } | 340 | } |
343 | 341 | ||
344 | // --- slotConfigure ---------------------------------------------------------- | 342 | // --- slotConfigure ---------------------------------------------------------- |
345 | void MainWindow::slotConfigure() | 343 | void MainWindow::slotConfigure() |
346 | { | 344 | { |
347 | Configuration *cfgdlg = new Configuration( this, _cfg ); | 345 | Configuration *cfgdlg = new Configuration( this, _cfg ); |
348 | cfgdlg->showMaximized(); | 346 | if ( QPEApplication::execDialog( cfgdlg ) == QDialog::Accepted ) |
349 | if ( cfgdlg->exec() == QDialog::Accepted ) | ||
350 | { | 347 | { |
351 | // read data from config dialog & save it | 348 | // read data from config dialog & save it |
352 | cfgdlg->saveConfig( _cfg ); | 349 | cfgdlg->saveConfig( _cfg ); |
353 | writeConfig(); | 350 | writeConfig(); |
354 | buildList(); | 351 | buildList(); |
355 | } | 352 | } |
356 | delete cfgdlg; | 353 | delete cfgdlg; |
357 | } | 354 | } |
358 | 355 | ||
359 | 356 | ||
360 | // --- writeConfig -------------------------------------------------------------- | 357 | // --- writeConfig -------------------------------------------------------------- |
361 | void MainWindow::writeConfig() | 358 | void MainWindow::writeConfig() |
362 | { | 359 | { |
363 | Config config("checkbook"); | 360 | Config config("checkbook"); |
364 | _cfg.writeConfig( config ); | 361 | _cfg.writeConfig( config ); |
365 | } | 362 | } |
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp index 2103df9..b12a395 100644 --- a/noncore/apps/odict/configdlg.cpp +++ b/noncore/apps/odict/configdlg.cpp | |||
@@ -1,80 +1,81 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | application: : ODict | 2 | application: : ODict |
3 | 3 | ||
4 | begin : December 2002 | 4 | begin : December 2002 |
5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus | 5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus |
6 | email : cniehaus@handhelds.org | 6 | email : cniehaus@handhelds.org |
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #include "configdlg.h" | 17 | #include "configdlg.h" |
18 | #include "searchmethoddlg.h" | 18 | #include "searchmethoddlg.h" |
19 | 19 | ||
20 | #include <qdialog.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qlayout.h> | ||
23 | 22 | ||
23 | #include <qdialog.h> | ||
24 | #include <qlayout.h> | ||
24 | #include <qhbox.h> | 25 | #include <qhbox.h> |
25 | #include <qvbox.h> | 26 | #include <qvbox.h> |
26 | #include <qlabel.h> | 27 | #include <qlabel.h> |
27 | #include <qlistview.h> | 28 | #include <qlistview.h> |
28 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
29 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
30 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
31 | 32 | ||
32 | ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) | 33 | ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) |
33 | { | 34 | { |
34 | setCaption( tr( "Options" ) ); | 35 | setCaption( tr( "Options" ) ); |
35 | QVBoxLayout *vbox_layout = new QVBoxLayout( this ); | 36 | QVBoxLayout *vbox_layout = new QVBoxLayout( this ); |
36 | search_tab = new QWidget( this , "search_tab" ); | 37 | search_tab = new QWidget( this , "search_tab" ); |
37 | QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); | 38 | QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); |
38 | 39 | ||
39 | QHBox *hbox = new QHBox( search_tab ); | 40 | QHBox *hbox = new QHBox( search_tab ); |
40 | list = new QListView( hbox ); | 41 | list = new QListView( hbox ); |
41 | list->addColumn( tr( "Searchmethod" ) ); | 42 | list->addColumn( tr( "Searchmethod" ) ); |
42 | loadSearchMethodNames(); | 43 | loadSearchMethodNames(); |
43 | 44 | ||
44 | QVBox *vbox = new QVBox( hbox ); | 45 | QVBox *vbox = new QVBox( hbox ); |
45 | new_button = new QPushButton( tr( "New" ) , vbox ); | 46 | new_button = new QPushButton( tr( "New" ) , vbox ); |
46 | change_button = new QPushButton( tr( "Change" ) , vbox ); | 47 | change_button = new QPushButton( tr( "Change" ) , vbox ); |
47 | delete_button = new QPushButton( tr( "Delete" ) , vbox ); | 48 | delete_button = new QPushButton( tr( "Delete" ) , vbox ); |
48 | connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); | 49 | connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); |
49 | connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() )); | 50 | connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() )); |
50 | connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() )); | 51 | connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() )); |
51 | 52 | ||
52 | vbox_layout_searchtab->addWidget( hbox ); | 53 | vbox_layout_searchtab->addWidget( hbox ); |
53 | 54 | ||
54 | vbox_layout->addWidget( search_tab ); | 55 | vbox_layout->addWidget( search_tab ); |
55 | 56 | ||
56 | showMaximized(); | 57 | QPEApplication::execDialog( this ); |
57 | } | 58 | } |
58 | 59 | ||
59 | void ConfigDlg::slotNewMethod() | 60 | void ConfigDlg::slotNewMethod() |
60 | { | 61 | { |
61 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); | 62 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); |
62 | if ( dlg.exec() == QDialog::Accepted ) | 63 | if ( dlg.exec() == QDialog::Accepted ) |
63 | { | 64 | { |
64 | dlg.saveItem(); | 65 | dlg.saveItem(); |
65 | QListViewItem *item = new QListViewItem( list ); | 66 | QListViewItem *item = new QListViewItem( list ); |
66 | item->setText( 0 , dlg.nameLE->text() ); | 67 | item->setText( 0 , dlg.nameLE->text() ); |
67 | } | 68 | } |
68 | } | 69 | } |
69 | 70 | ||
70 | void ConfigDlg::slotChangeMethod() | 71 | void ConfigDlg::slotChangeMethod() |
71 | { | 72 | { |
72 | if ( list->selectedItem() ) | 73 | if ( list->selectedItem() ) |
73 | { | 74 | { |
74 | SearchMethodDlg dlg( this, "SearchMethodDlg", true, list->selectedItem()->text( 0 ) ); | 75 | SearchMethodDlg dlg( this, "SearchMethodDlg", true, list->selectedItem()->text( 0 ) ); |
75 | if ( dlg.exec() == QDialog::Accepted ) | 76 | if ( dlg.exec() == QDialog::Accepted ) |
76 | { | 77 | { |
77 | dlg.saveItem(); | 78 | dlg.saveItem(); |
78 | QListViewItem *item = list->selectedItem(); | 79 | QListViewItem *item = list->selectedItem(); |
79 | item->setText( 0 , dlg.nameLE->text() ); | 80 | item->setText( 0 , dlg.nameLE->text() ); |
80 | } | 81 | } |
diff --git a/noncore/apps/odict/searchmethoddlg.cpp b/noncore/apps/odict/searchmethoddlg.cpp index 99cd8db..8ed7152 100644 --- a/noncore/apps/odict/searchmethoddlg.cpp +++ b/noncore/apps/odict/searchmethoddlg.cpp | |||
@@ -1,93 +1,94 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | application: : ODict | 2 | application: : ODict |
3 | 3 | ||
4 | begin : December 2002 | 4 | begin : December 2002 |
5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus | 5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus |
6 | email : cniehaus@handhelds.org | 6 | email : cniehaus@handhelds.org |
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #include "searchmethoddlg.h" | 17 | #include "searchmethoddlg.h" |
18 | 18 | ||
19 | #include <qdialog.h> | ||
20 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
21 | #include <qlayout.h> | 20 | #include <qpe/qpeapplication.h> |
22 | 21 | ||
22 | #include <qdialog.h> | ||
23 | #include <qlayout.h> | ||
23 | #include <qhbox.h> | 24 | #include <qhbox.h> |
24 | #include <qvbox.h> | 25 | #include <qvbox.h> |
25 | #include <qlabel.h> | 26 | #include <qlabel.h> |
26 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
27 | #include <qstring.h> | 28 | #include <qstring.h> |
28 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
29 | #include <qdir.h> | 30 | #include <qdir.h> |
30 | 31 | ||
31 | #include <opie/ofileselector.h> | 32 | #include <opie/ofileselector.h> |
32 | #include <opie/ofiledialog.h> | 33 | #include <opie/ofiledialog.h> |
33 | 34 | ||
34 | SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal) | 35 | SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal) |
35 | { | 36 | { |
36 | 37 | ||
37 | QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" ); | 38 | QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" ); |
38 | QVBox *vbox = new QVBox( this ); | 39 | QVBox *vbox = new QVBox( this ); |
39 | 40 | ||
40 | QHBox *hbox1 = new QHBox( vbox ); | 41 | QHBox *hbox1 = new QHBox( vbox ); |
41 | QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 ); | 42 | QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 ); |
42 | nameLE = new QLineEdit( hbox1 ); | 43 | nameLE = new QLineEdit( hbox1 ); |
43 | 44 | ||
44 | QLabel *dictLabel = new QLabel( tr( "Dictionary file" ), vbox ); | 45 | QLabel *dictLabel = new QLabel( tr( "Dictionary file" ), vbox ); |
45 | QHBox *hbox2 = new QHBox( vbox ); | 46 | QHBox *hbox2 = new QHBox( vbox ); |
46 | dictFileLE = new QLineEdit( hbox2 ); | 47 | dictFileLE = new QLineEdit( hbox2 ); |
47 | QPushButton *browseButton = new QPushButton( tr( "Browse" ) , hbox2 ); | 48 | QPushButton *browseButton = new QPushButton( tr( "Browse" ) , hbox2 ); |
48 | connect( browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) ); | 49 | connect( browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) ); |
49 | 50 | ||
50 | QWidget *dummywidget = new QWidget( vbox ); | 51 | QWidget *dummywidget = new QWidget( vbox ); |
51 | QLabel *lag1 = new QLabel( tr( "Language 1" ),dummywidget); | 52 | QLabel *lag1 = new QLabel( tr( "Language 1" ),dummywidget); |
52 | QLabel *devider = new QLabel( tr( "Decollator" ),dummywidget); | 53 | QLabel *devider = new QLabel( tr( "Decollator" ),dummywidget); |
53 | QLabel *lag2 = new QLabel( tr( "Language 2" ),dummywidget); | 54 | QLabel *lag2 = new QLabel( tr( "Language 2" ),dummywidget); |
54 | lang1 = new QLineEdit( dummywidget ); | 55 | lang1 = new QLineEdit( dummywidget ); |
55 | lang2 = new QLineEdit( dummywidget ); | 56 | lang2 = new QLineEdit( dummywidget ); |
56 | trenner = new QLineEdit( dummywidget ); | 57 | trenner = new QLineEdit( dummywidget ); |
57 | trenner->setText( "::" ); | 58 | trenner->setText( "::" ); |
58 | 59 | ||
59 | QGridLayout *grid = new QGridLayout( dummywidget, 2,3 ); | 60 | QGridLayout *grid = new QGridLayout( dummywidget, 2,3 ); |
60 | grid->addWidget( lag1, 0,0 ); | 61 | grid->addWidget( lag1, 0,0 ); |
61 | grid->addWidget( devider, 0,1 ); | 62 | grid->addWidget( devider, 0,1 ); |
62 | grid->addWidget( lag2, 0,2 ); | 63 | grid->addWidget( lag2, 0,2 ); |
63 | grid->addWidget( lang1, 1,0 ); | 64 | grid->addWidget( lang1, 1,0 ); |
64 | grid->addWidget( trenner, 1,1 ); | 65 | grid->addWidget( trenner, 1,1 ); |
65 | grid->addWidget( lang2, 1,2 ); | 66 | grid->addWidget( lang2, 1,2 ); |
66 | 67 | ||
67 | vbox_layout->addWidget( vbox ); | 68 | vbox_layout->addWidget( vbox ); |
68 | 69 | ||
69 | showMaximized(); | 70 | QPEApplication::execDialog ( this ); |
70 | 71 | ||
71 | if( !itemname ) | 72 | if( !itemname ) |
72 | setCaption( tr( "New Searchmethod" ) ); | 73 | setCaption( tr( "New Searchmethod" ) ); |
73 | else | 74 | else |
74 | { | 75 | { |
75 | setCaption( tr( "Change Searchmethod" ) ); | 76 | setCaption( tr( "Change Searchmethod" ) ); |
76 | itemName = itemname; | 77 | itemName = itemname; |
77 | setupEntries(itemname); | 78 | setupEntries(itemname); |
78 | } | 79 | } |
79 | } | 80 | } |
80 | 81 | ||
81 | void SearchMethodDlg::setupEntries( QString item ) | 82 | void SearchMethodDlg::setupEntries( QString item ) |
82 | { | 83 | { |
83 | Config cfg( "odict" ); | 84 | Config cfg( "odict" ); |
84 | cfg.setGroup( "Method_"+itemName ); | 85 | cfg.setGroup( "Method_"+itemName ); |
85 | trenner->setText( cfg.readEntry( "Seperator" ) ); | 86 | trenner->setText( cfg.readEntry( "Seperator" ) ); |
86 | lang1->setText( cfg.readEntry( "Lang1" ) ); | 87 | lang1->setText( cfg.readEntry( "Lang1" ) ); |
87 | lang2->setText( cfg.readEntry( "Lang2" ) ); | 88 | lang2->setText( cfg.readEntry( "Lang2" ) ); |
88 | nameLE->setText( itemName ); | 89 | nameLE->setText( itemName ); |
89 | dictFileLE->setText( cfg.readEntry( "file" ) ); | 90 | dictFileLE->setText( cfg.readEntry( "file" ) ); |
90 | } | 91 | } |
91 | 92 | ||
92 | void SearchMethodDlg::slotBrowse() | 93 | void SearchMethodDlg::slotBrowse() |
93 | { | 94 | { |
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp index 8c4ee93..cd0a364 100644 --- a/noncore/apps/opie-bartender/bartender.cpp +++ b/noncore/apps/opie-bartender/bartender.cpp | |||
@@ -148,50 +148,49 @@ void Bartender::initDrinkDb() { | |||
148 | void Bartender::fillList() { | 148 | void Bartender::fillList() { |
149 | dbFile.at(1); | 149 | dbFile.at(1); |
150 | DrinkView->clear(); | 150 | DrinkView->clear(); |
151 | int i=0; | 151 | int i=0; |
152 | QListViewItem * item ; | 152 | QListViewItem * item ; |
153 | QTextStream t( &dbFile); | 153 | QTextStream t( &dbFile); |
154 | QString s; | 154 | QString s; |
155 | while ( !t.eof()) { | 155 | while ( !t.eof()) { |
156 | s = t.readLine(); | 156 | s = t.readLine(); |
157 | if(s.find("#",0,TRUE) != -1) { | 157 | if(s.find("#",0,TRUE) != -1) { |
158 | // qDebug(s.right(s.length()-2)); | 158 | // qDebug(s.right(s.length()-2)); |
159 | item= new QListViewItem( DrinkView, 0 ); | 159 | item= new QListViewItem( DrinkView, 0 ); |
160 | item->setText( 0, s.right(s.length()-2)); | 160 | item->setText( 0, s.right(s.length()-2)); |
161 | i++; | 161 | i++; |
162 | } | 162 | } |
163 | } | 163 | } |
164 | qDebug("there are currently %d of drinks", i); | 164 | qDebug("there are currently %d of drinks", i); |
165 | } | 165 | } |
166 | 166 | ||
167 | void Bartender::fileNew() { | 167 | void Bartender::fileNew() { |
168 | 168 | ||
169 | New_Drink *newDrinks; | 169 | New_Drink *newDrinks; |
170 | newDrinks = new New_Drink(this,"New Drink....", TRUE); | 170 | newDrinks = new New_Drink(this,"New Drink....", TRUE); |
171 | QString newName, newIng; | 171 | QString newName, newIng; |
172 | newDrinks->showMaximized(); | 172 | QPEApplication::execDialog( newDrinks ); |
173 | newDrinks->exec(); | ||
174 | newName = newDrinks->LineEdit1->text(); | 173 | newName = newDrinks->LineEdit1->text(); |
175 | newIng= newDrinks->MultiLineEdit1->text(); | 174 | newIng= newDrinks->MultiLineEdit1->text(); |
176 | 175 | ||
177 | if(dbFile.isOpen()) | 176 | if(dbFile.isOpen()) |
178 | dbFile.close(); | 177 | dbFile.close(); |
179 | if ( !dbFile.open( IO_WriteOnly| IO_Append)) { | 178 | if ( !dbFile.open( IO_WriteOnly| IO_Append)) { |
180 | QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); | 179 | QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); |
181 | return; | 180 | return; |
182 | } | 181 | } |
183 | if(newDrinks ->result() == 1 ) { | 182 | if(newDrinks ->result() == 1 ) { |
184 | QString newDrink="\n# "+newName+"\n"; | 183 | QString newDrink="\n# "+newName+"\n"; |
185 | newDrink.append(newIng+"\n"); | 184 | newDrink.append(newIng+"\n"); |
186 | qDebug("writing "+newDrink); | 185 | qDebug("writing "+newDrink); |
187 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 186 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
188 | clearList(); | 187 | clearList(); |
189 | dbFile.close(); | 188 | dbFile.close(); |
190 | 189 | ||
191 | initDrinkDb(); | 190 | initDrinkDb(); |
192 | } | 191 | } |
193 | delete newDrinks; | 192 | delete newDrinks; |
194 | } | 193 | } |
195 | 194 | ||
196 | void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) { | 195 | void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) { |
197 | switch (mouse) { | 196 | switch (mouse) { |
@@ -205,50 +204,49 @@ void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) { | |||
205 | } | 204 | } |
206 | 205 | ||
207 | void Bartender::showDrink( QListViewItem *item) { | 206 | void Bartender::showDrink( QListViewItem *item) { |
208 | if(item==NULL) return; | 207 | if(item==NULL) return; |
209 | dbFile.at(0); | 208 | dbFile.at(0); |
210 | Show_Drink *showDrinks; | 209 | Show_Drink *showDrinks; |
211 | QString myDrink=item->text(0); | 210 | QString myDrink=item->text(0); |
212 | showDrinks = new Show_Drink(this, myDrink, TRUE); | 211 | showDrinks = new Show_Drink(this, myDrink, TRUE); |
213 | QTextStream t( &dbFile); | 212 | QTextStream t( &dbFile); |
214 | 213 | ||
215 | QString s, s2; | 214 | QString s, s2; |
216 | while ( !t.eof()) { | 215 | while ( !t.eof()) { |
217 | s = t.readLine(); | 216 | s = t.readLine(); |
218 | if(s.find( myDrink, 0, TRUE) != -1) { | 217 | if(s.find( myDrink, 0, TRUE) != -1) { |
219 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { | 218 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { |
220 | s2 = t.readLine(); | 219 | s2 = t.readLine(); |
221 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { | 220 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { |
222 | // qDebug(s2); | 221 | // qDebug(s2); |
223 | showDrinks->MultiLineEdit1->append(s2); | 222 | showDrinks->MultiLineEdit1->append(s2); |
224 | } | 223 | } |
225 | if( dbFile.atEnd() ) break; | 224 | if( dbFile.atEnd() ) break; |
226 | } | 225 | } |
227 | } | 226 | } |
228 | } | 227 | } |
229 | showDrinks->showMaximized(); | 228 | QPEApplication::execDialog( showDrinks ); |
230 | showDrinks->exec(); | ||
231 | 229 | ||
232 | if(showDrinks ->result() ==0) { | 230 | if(showDrinks ->result() ==0) { |
233 | doEdit(); | 231 | doEdit(); |
234 | } | 232 | } |
235 | delete showDrinks; | 233 | delete showDrinks; |
236 | } | 234 | } |
237 | 235 | ||
238 | void Bartender::askSearch() { | 236 | void Bartender::askSearch() { |
239 | switch ( QMessageBox::warning(this,tr("Find"),tr("Search by drink name\n")+ | 237 | switch ( QMessageBox::warning(this,tr("Find"),tr("Search by drink name\n")+ |
240 | "\nor alcohol ?" | 238 | "\nor alcohol ?" |
241 | ,tr("Drink Name"),tr("Alcohol"),0,0,1) ) { | 239 | ,tr("Drink Name"),tr("Alcohol"),0,0,1) ) { |
242 | case 0: | 240 | case 0: |
243 | doSearchByName(); | 241 | doSearchByName(); |
244 | break; | 242 | break; |
245 | case 1: | 243 | case 1: |
246 | doSearchByDrink(); | 244 | doSearchByDrink(); |
247 | break; | 245 | break; |
248 | }; | 246 | }; |
249 | } | 247 | } |
250 | 248 | ||
251 | /* search by name */ | 249 | /* search by name */ |
252 | void Bartender::doSearchByName() { | 250 | void Bartender::doSearchByName() { |
253 | // if( DrinkView->currentItem() == NULL) return; | 251 | // if( DrinkView->currentItem() == NULL) return; |
254 | QStringList searchList; | 252 | QStringList searchList; |
@@ -296,78 +294,77 @@ void Bartender::doSearchByDrink() { | |||
296 | } | 294 | } |
297 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { | 295 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { |
298 | // qDebug("appending "+lastDrinkName); | 296 | // qDebug("appending "+lastDrinkName); |
299 | searchList.append( lastDrinkName); | 297 | searchList.append( lastDrinkName); |
300 | tempName=lastDrinkName; | 298 | tempName=lastDrinkName; |
301 | } | 299 | } |
302 | // if( dbFile.atEnd() ) break; | 300 | // if( dbFile.atEnd() ) break; |
303 | 301 | ||
304 | } //oef | 302 | } //oef |
305 | if(searchList.count() >0) | 303 | if(searchList.count() >0) |
306 | showSearchResult(searchList); | 304 | showSearchResult(searchList); |
307 | else | 305 | else |
308 | QMessageBox::message(tr("Search"),tr("Sorry no results for\n")+ searchForDrinkName); | 306 | QMessageBox::message(tr("Search"),tr("Sorry no results for\n")+ searchForDrinkName); |
309 | } | 307 | } |
310 | delete fileDlg; | 308 | delete fileDlg; |
311 | } | 309 | } |
312 | 310 | ||
313 | void Bartender::showSearchResult(QStringList &searchList) { | 311 | void Bartender::showSearchResult(QStringList &searchList) { |
314 | QString result; | 312 | QString result; |
315 | Search_Results *searchDlg; | 313 | Search_Results *searchDlg; |
316 | 314 | ||
317 | searchList.sort(); | 315 | searchList.sort(); |
318 | 316 | ||
319 | searchDlg = new Search_Results(this, "Search Results", TRUE); | 317 | searchDlg = new Search_Results(this, "Search Results", TRUE); |
320 | searchDlg->showMaximized(); | ||
321 | searchDlg->ListBox1->insertStringList( searchList,-1); | 318 | searchDlg->ListBox1->insertStringList( searchList,-1); |
322 | searchDlg->exec(); | 319 | QPEApplication::execDialog( searchDlg ); |
323 | 320 | ||
324 | if( searchDlg->result() == 1 ) { | 321 | if( searchDlg->result() == 1 ) { |
325 | result= searchDlg->ListBox1->currentText(); | 322 | result= searchDlg->ListBox1->currentText(); |
326 | } | 323 | } |
327 | QListViewItemIterator it2( DrinkView ); | 324 | QListViewItemIterator it2( DrinkView ); |
328 | for ( ; it2.current(); ++it2 ) { | 325 | for ( ; it2.current(); ++it2 ) { |
329 | if ( it2.current()->text(0)== result ) { | 326 | if ( it2.current()->text(0)== result ) { |
330 | // qDebug( it2.current()->text(0)); | 327 | // qDebug( it2.current()->text(0)); |
331 | showDrink(it2.current()); | 328 | showDrink(it2.current()); |
332 | } | 329 | } |
333 | } | 330 | } |
334 | delete searchDlg; | 331 | delete searchDlg; |
335 | } | 332 | } |
336 | 333 | ||
337 | void Bartender::doEdit() { | 334 | void Bartender::doEdit() { |
338 | if(DrinkView->currentItem() == NULL) { | 335 | if(DrinkView->currentItem() == NULL) { |
339 | fileNew(); | 336 | fileNew(); |
340 | } | 337 | } |
341 | 338 | ||
342 | QString myDrink; | 339 | QString myDrink; |
343 | myDrink= DrinkView->currentItem()->text(0); | 340 | myDrink= DrinkView->currentItem()->text(0); |
344 | dbFile.at(0); | 341 | dbFile.at(0); |
345 | int foundAt=0; | 342 | int foundAt=0; |
346 | New_Drink *newDrinks; | 343 | New_Drink *newDrinks; |
347 | newDrinks = new New_Drink(this,"Edit Drink....", TRUE); | 344 | newDrinks = new New_Drink(this,"Edit Drink....", TRUE); |
348 | QString newName, newIng; | 345 | QString newName, newIng; |
349 | newDrinks->showMaximized(); | 346 | QPEApplication::showDialog( newDrinks ); |
350 | QTextStream t( &dbFile); | 347 | QTextStream t( &dbFile); |
351 | 348 | ||
352 | QString s, s2; | 349 | QString s, s2; |
353 | while ( !t.eof()) { | 350 | while ( !t.eof()) { |
354 | s = t.readLine(); | 351 | s = t.readLine(); |
355 | if(s.find( myDrink, 0, TRUE) != -1) { | 352 | if(s.find( myDrink, 0, TRUE) != -1) { |
356 | foundAt = dbFile.at() - (s.length()+1); | 353 | foundAt = dbFile.at() - (s.length()+1); |
357 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { | 354 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { |
358 | s2 = t.readLine(); | 355 | s2 = t.readLine(); |
359 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { | 356 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { |
360 | // qDebug(s2); | 357 | // qDebug(s2); |
361 | newDrinks->MultiLineEdit1->append(s2); | 358 | newDrinks->MultiLineEdit1->append(s2); |
362 | newDrinks->LineEdit1->setText(myDrink); | 359 | newDrinks->LineEdit1->setText(myDrink); |
363 | } | 360 | } |
364 | if( dbFile.atEnd() ) break; | 361 | if( dbFile.atEnd() ) break; |
365 | } | 362 | } |
366 | } | 363 | } |
367 | } | 364 | } |
368 | newDrinks->exec(); | 365 | newDrinks->exec(); |
369 | newName = newDrinks->LineEdit1->text(); | 366 | newName = newDrinks->LineEdit1->text(); |
370 | newIng= newDrinks->MultiLineEdit1->text(); | 367 | newIng= newDrinks->MultiLineEdit1->text(); |
371 | 368 | ||
372 | if( newDrinks ->result() == 1 ) { | 369 | if( newDrinks ->result() == 1 ) { |
373 | if(dbFile.isOpen()) | 370 | if(dbFile.isOpen()) |
@@ -380,50 +377,49 @@ void Bartender::doEdit() { | |||
380 | lseek( fd, foundAt, SEEK_SET); | 377 | lseek( fd, foundAt, SEEK_SET); |
381 | 378 | ||
382 | // dbFile.at( foundAt); | 379 | // dbFile.at( foundAt); |
383 | #warning FIXME problems with editing drinks db | 380 | #warning FIXME problems with editing drinks db |
384 | ////////// FIXME write to user file | 381 | ////////// FIXME write to user file |
385 | QString newDrink="# "+newName+"\n"; | 382 | QString newDrink="# "+newName+"\n"; |
386 | newDrink.append(newIng+"\n"); | 383 | newDrink.append(newIng+"\n"); |
387 | qDebug("writing "+newDrink); | 384 | qDebug("writing "+newDrink); |
388 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 385 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
389 | clearList(); | 386 | clearList(); |
390 | 387 | ||
391 | dbFile.flush(); | 388 | dbFile.flush(); |
392 | 389 | ||
393 | initDrinkDb(); | 390 | initDrinkDb(); |
394 | } | 391 | } |
395 | } | 392 | } |
396 | 393 | ||
397 | void Bartender::clearList() { | 394 | void Bartender::clearList() { |
398 | DrinkView->clear(); | 395 | DrinkView->clear(); |
399 | } | 396 | } |
400 | 397 | ||
401 | void Bartender::doBac() { | 398 | void Bartender::doBac() { |
402 | BacDialog *bacDlg; | 399 | BacDialog *bacDlg; |
403 | bacDlg = new BacDialog(this,"BAC",TRUE); | 400 | bacDlg = new BacDialog(this,"BAC",TRUE); |
404 | bacDlg->showMaximized(); | 401 | QPEApplication::execDialog( bacDlg ); |
405 | bacDlg->exec(); | ||
406 | delete bacDlg; | 402 | delete bacDlg; |
407 | } | 403 | } |
408 | 404 | ||
409 | void Bartender::openCurrentDrink() { | 405 | void Bartender::openCurrentDrink() { |
410 | if(DrinkView->currentItem() == NULL) return; | 406 | if(DrinkView->currentItem() == NULL) return; |
411 | showDrink(DrinkView->currentItem()); | 407 | showDrink(DrinkView->currentItem()); |
412 | } | 408 | } |
413 | 409 | ||
414 | void Bartender::fileMenuActivated( int item) { | 410 | void Bartender::fileMenuActivated( int item) { |
415 | qDebug("Item %d", item); | 411 | qDebug("Item %d", item); |
416 | switch(item) { | 412 | switch(item) { |
417 | case -3: // new -3 | 413 | case -3: // new -3 |
418 | fileNew(); | 414 | fileNew(); |
419 | break; | 415 | break; |
420 | case -4:// open -4 | 416 | case -4:// open -4 |
421 | openCurrentDrink(); | 417 | openCurrentDrink(); |
422 | break; | 418 | break; |
423 | case -5:// drink -5 | 419 | case -5:// drink -5 |
424 | doSearchByName(); | 420 | doSearchByName(); |
425 | 421 | ||
426 | break; | 422 | break; |
427 | case -6:// alcohol -6 | 423 | case -6:// alcohol -6 |
428 | doSearchByDrink(); | 424 | doSearchByDrink(); |
429 | 425 | ||
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp index b23f4d0..882cd3d 100644 --- a/noncore/apps/opie-console/configdialog.cpp +++ b/noncore/apps/opie-console/configdialog.cpp | |||
@@ -1,26 +1,28 @@ | |||
1 | #include <qlistview.h> | ||
2 | 1 | ||
2 | #include <qpe/qpeapplication.h> | ||
3 | |||
4 | #include <qlistview.h> | ||
3 | 5 | ||
4 | #include "configdialog.h" | 6 | #include "configdialog.h" |
5 | #include "profileeditordialog.h" | 7 | #include "profileeditordialog.h" |
6 | 8 | ||
7 | class ConfigListItem : public QListViewItem { | 9 | class ConfigListItem : public QListViewItem { |
8 | public: | 10 | public: |
9 | ConfigListItem( QListView* item, const Profile& ); | 11 | ConfigListItem( QListView* item, const Profile& ); |
10 | ~ConfigListItem(); | 12 | ~ConfigListItem(); |
11 | Profile profile()const; | 13 | Profile profile()const; |
12 | 14 | ||
13 | private: | 15 | private: |
14 | Profile m_prof; | 16 | Profile m_prof; |
15 | }; | 17 | }; |
16 | ConfigListItem::ConfigListItem( QListView* item, const Profile& prof ) | 18 | ConfigListItem::ConfigListItem( QListView* item, const Profile& prof ) |
17 | : QListViewItem( item ), m_prof( prof ) | 19 | : QListViewItem( item ), m_prof( prof ) |
18 | { | 20 | { |
19 | setText(0, prof.name() ); | 21 | setText(0, prof.name() ); |
20 | } | 22 | } |
21 | ConfigListItem::~ConfigListItem() { | 23 | ConfigListItem::~ConfigListItem() { |
22 | 24 | ||
23 | } | 25 | } |
24 | Profile ConfigListItem::profile()const { | 26 | Profile ConfigListItem::profile()const { |
25 | return m_prof; | 27 | return m_prof; |
26 | } | 28 | } |
@@ -52,60 +54,58 @@ Profile::ValueList ConfigDialog::list()const { | |||
52 | } | 54 | } |
53 | return lst; | 55 | return lst; |
54 | } | 56 | } |
55 | /* our slots */ | 57 | /* our slots */ |
56 | void ConfigDialog::slotRemove() { | 58 | void ConfigDialog::slotRemove() { |
57 | ConfigListItem* item = (ConfigListItem*)lstView->currentItem(); | 59 | ConfigListItem* item = (ConfigListItem*)lstView->currentItem(); |
58 | if (!item ) | 60 | if (!item ) |
59 | return; | 61 | return; |
60 | 62 | ||
61 | lstView->takeItem( item ); | 63 | lstView->takeItem( item ); |
62 | delete item; | 64 | delete item; |
63 | } | 65 | } |
64 | 66 | ||
65 | void ConfigDialog::slotEdit() { | 67 | void ConfigDialog::slotEdit() { |
66 | Profile p; | 68 | Profile p; |
67 | 69 | ||
68 | if(!lstView->currentItem()) return; | 70 | if(!lstView->currentItem()) return; |
69 | 71 | ||
70 | // Load profile | 72 | // Load profile |
71 | p = ((ConfigListItem*)lstView->currentItem())->profile(); | 73 | p = ((ConfigListItem*)lstView->currentItem())->profile(); |
72 | 74 | ||
73 | ProfileEditorDialog dlg(m_fact, p); | 75 | ProfileEditorDialog dlg(m_fact, p); |
74 | 76 | ||
75 | dlg.setCaption(tr("Edit Connection Profile")); | 77 | dlg.setCaption(tr("Edit Connection Profile")); |
76 | dlg.showMaximized(); | 78 | int ret = QPEApplication::execDialog( &dlg ); |
77 | int ret = dlg.exec(); | ||
78 | 79 | ||
79 | if(ret == QDialog::Accepted) | 80 | if(ret == QDialog::Accepted) |
80 | { | 81 | { |
81 | if(lstView->currentItem()) delete lstView->currentItem(); | 82 | if(lstView->currentItem()) delete lstView->currentItem(); |
82 | 83 | ||
83 | // use dlg.terminal()! | 84 | // use dlg.terminal()! |
84 | Profile p = dlg.profile(); | 85 | Profile p = dlg.profile(); |
85 | 86 | ||
86 | new ConfigListItem(lstView, p); | 87 | new ConfigListItem(lstView, p); |
87 | } | 88 | } |
88 | } | 89 | } |
89 | 90 | ||
90 | 91 | ||
91 | void ConfigDialog::slotAdd() { | 92 | void ConfigDialog::slotAdd() { |
92 | ProfileEditorDialog dlg(m_fact); | 93 | ProfileEditorDialog dlg(m_fact); |
93 | 94 | ||
94 | dlg.setCaption(tr("New Connection")); | 95 | dlg.setCaption(tr("New Connection")); |
95 | dlg.showMaximized(); | 96 | int ret = QPEApplication::execDialog( &dlg ); |
96 | int ret = dlg.exec(); | ||
97 | 97 | ||
98 | if(ret == QDialog::Accepted) | 98 | if(ret == QDialog::Accepted) |
99 | { | 99 | { |
100 | // TODO: Move into general profile save part | 100 | // TODO: Move into general profile save part |
101 | // assignments | 101 | // assignments |
102 | //QString type = dlg.term_type(); | 102 | //QString type = dlg.term_type(); |
103 | //if(type == "VT102") profile = Profile::VT102; | 103 | //if(type == "VT102") profile = Profile::VT102; |
104 | 104 | ||
105 | // get profile from editor | 105 | // get profile from editor |
106 | Profile p = dlg.profile(); | 106 | Profile p = dlg.profile(); |
107 | 107 | ||
108 | new ConfigListItem(lstView, p); | 108 | new ConfigListItem(lstView, p); |
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 2673335..3fe9040 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -1,34 +1,35 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qmenubar.h> | 4 | #include <qmenubar.h> |
5 | #include <qtoolbar.h> | 5 | #include <qtoolbar.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qwhatsthis.h> | 7 | #include <qwhatsthis.h> |
8 | #include <qfileinfo.h> | 8 | #include <qfileinfo.h> |
9 | 9 | ||
10 | #include <qpe/filemanager.h> | 10 | #include <qpe/filemanager.h> |
11 | #include <qpe/qpeapplication.h> | ||
11 | 12 | ||
12 | #include <opie/ofiledialog.h> | 13 | #include <opie/ofiledialog.h> |
13 | 14 | ||
14 | #include "TEmulation.h" | 15 | #include "TEmulation.h" |
15 | #include "profileeditordialog.h" | 16 | #include "profileeditordialog.h" |
16 | #include "configdialog.h" | 17 | #include "configdialog.h" |
17 | #include "default.h" | 18 | #include "default.h" |
18 | #include "profilemanager.h" | 19 | #include "profilemanager.h" |
19 | #include "mainwindow.h" | 20 | #include "mainwindow.h" |
20 | #include "tabwidget.h" | 21 | #include "tabwidget.h" |
21 | #include "transferdialog.h" | 22 | #include "transferdialog.h" |
22 | #include "function_keyboard.h" | 23 | #include "function_keyboard.h" |
23 | #include "emulation_handler.h" | 24 | #include "emulation_handler.h" |
24 | #include "script.h" | 25 | #include "script.h" |
25 | 26 | ||
26 | 27 | ||
27 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 28 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
28 | KeyTrans::loadAll(); | 29 | KeyTrans::loadAll(); |
29 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 30 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
30 | KeyTrans* s = KeyTrans::find(i ); | 31 | KeyTrans* s = KeyTrans::find(i ); |
31 | assert( s ); | 32 | assert( s ); |
32 | } | 33 | } |
33 | m_factory = new MetaFactory(); | 34 | m_factory = new MetaFactory(); |
34 | Default def(m_factory); | 35 | Default def(m_factory); |
@@ -289,51 +290,50 @@ void MainWindow::populateScripts() { | |||
289 | } | 290 | } |
290 | } | 291 | } |
291 | 292 | ||
292 | } | 293 | } |
293 | 294 | ||
294 | MainWindow::~MainWindow() { | 295 | MainWindow::~MainWindow() { |
295 | delete m_factory; | 296 | delete m_factory; |
296 | manager()->save(); | 297 | manager()->save(); |
297 | } | 298 | } |
298 | 299 | ||
299 | MetaFactory* MainWindow::factory() { | 300 | MetaFactory* MainWindow::factory() { |
300 | return m_factory; | 301 | return m_factory; |
301 | } | 302 | } |
302 | 303 | ||
303 | Session* MainWindow::currentSession() { | 304 | Session* MainWindow::currentSession() { |
304 | return m_curSession; | 305 | return m_curSession; |
305 | } | 306 | } |
306 | 307 | ||
307 | QList<Session> MainWindow::sessions() { | 308 | QList<Session> MainWindow::sessions() { |
308 | return m_sessions; | 309 | return m_sessions; |
309 | } | 310 | } |
310 | 311 | ||
311 | void MainWindow::slotNew() { | 312 | void MainWindow::slotNew() { |
312 | ProfileEditorDialog dlg(factory() ); | 313 | ProfileEditorDialog dlg(factory() ); |
313 | dlg.showMaximized(); | ||
314 | dlg.setCaption( tr("New Connection") ); | 314 | dlg.setCaption( tr("New Connection") ); |
315 | int ret = dlg.exec(); | 315 | int ret = QPEApplication::execDialog( &dlg ); |
316 | 316 | ||
317 | if ( ret == QDialog::Accepted ) { | 317 | if ( ret == QDialog::Accepted ) { |
318 | create( dlg.profile() ); | 318 | create( dlg.profile() ); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | void MainWindow::slotRecordScript() { | 322 | void MainWindow::slotRecordScript() { |
323 | if (currentSession()) { | 323 | if (currentSession()) { |
324 | currentSession()->emulationHandler()->startRecording(); | 324 | currentSession()->emulationHandler()->startRecording(); |
325 | m_saveScript->setEnabled(true); | 325 | m_saveScript->setEnabled(true); |
326 | m_recordScript->setEnabled(false); | 326 | m_recordScript->setEnabled(false); |
327 | } | 327 | } |
328 | } | 328 | } |
329 | 329 | ||
330 | void MainWindow::slotSaveScript() { | 330 | void MainWindow::slotSaveScript() { |
331 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { | 331 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { |
332 | QMap<QString, QStringList> map; | 332 | QMap<QString, QStringList> map; |
333 | QStringList text; | 333 | QStringList text; |
334 | text << "text/plain"; | 334 | text << "text/plain"; |
335 | map.insert(tr("Script"), text ); | 335 | map.insert(tr("Script"), text ); |
336 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | 336 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); |
337 | if (!filename.isEmpty()) { | 337 | if (!filename.isEmpty()) { |
338 | QFileInfo info(filename); | 338 | QFileInfo info(filename); |
339 | if (info.extension(FALSE) != "script") | 339 | if (info.extension(FALSE) != "script") |
@@ -404,51 +404,50 @@ void MainWindow::slotTerminate() { | |||
404 | slotClose(); | 404 | slotClose(); |
405 | /* FIXME move to the next session */ | 405 | /* FIXME move to the next session */ |
406 | } | 406 | } |
407 | 407 | ||
408 | 408 | ||
409 | 409 | ||
410 | 410 | ||
411 | 411 | ||
412 | 412 | ||
413 | void MainWindow::slotQuickLaunch() { | 413 | void MainWindow::slotQuickLaunch() { |
414 | Profile prof = manager()->profile( "default" ); | 414 | Profile prof = manager()->profile( "default" ); |
415 | if ( prof.name() == "default" ) { | 415 | if ( prof.name() == "default" ) { |
416 | create( prof ); | 416 | create( prof ); |
417 | } else { | 417 | } else { |
418 | Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); | 418 | Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); |
419 | newProf.setAutoConnect( true ); | 419 | newProf.setAutoConnect( true ); |
420 | create( newProf ); | 420 | create( newProf ); |
421 | slotSaveSession(); | 421 | slotSaveSession(); |
422 | } | 422 | } |
423 | 423 | ||
424 | } | 424 | } |
425 | 425 | ||
426 | void MainWindow::slotConfigure() { | 426 | void MainWindow::slotConfigure() { |
427 | ConfigDialog conf( manager()->all(), factory() ); | 427 | ConfigDialog conf( manager()->all(), factory() ); |
428 | conf.showMaximized(); | ||
429 | 428 | ||
430 | int ret = conf.exec(); | 429 | int ret = QPEApplication::execDialog( &conf ); |
431 | 430 | ||
432 | if ( QDialog::Accepted == ret ) { | 431 | if ( QDialog::Accepted == ret ) { |
433 | manager()->setProfiles( conf.list() ); | 432 | manager()->setProfiles( conf.list() ); |
434 | manager()->save(); | 433 | manager()->save(); |
435 | populateProfiles(); | 434 | populateProfiles(); |
436 | } | 435 | } |
437 | } | 436 | } |
438 | /* | 437 | /* |
439 | * we will remove | 438 | * we will remove |
440 | * this window from the tabwidget | 439 | * this window from the tabwidget |
441 | * remove it from the list | 440 | * remove it from the list |
442 | * delete it | 441 | * delete it |
443 | * and set the currentSession() | 442 | * and set the currentSession() |
444 | */ | 443 | */ |
445 | void MainWindow::slotClose() { | 444 | void MainWindow::slotClose() { |
446 | if (!currentSession() ) | 445 | if (!currentSession() ) |
447 | return; | 446 | return; |
448 | 447 | ||
449 | Session* ses = currentSession(); | 448 | Session* ses = currentSession(); |
450 | qWarning("removing! currentSession %s", currentSession()->name().latin1() ); | 449 | qWarning("removing! currentSession %s", currentSession()->name().latin1() ); |
451 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ | 450 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ |
452 | m_curSession = NULL; | 451 | m_curSession = NULL; |
453 | tabWidget()->remove( /*currentSession()*/ses ); | 452 | tabWidget()->remove( /*currentSession()*/ses ); |
454 | /*it's autodelete */ | 453 | /*it's autodelete */ |
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index e552990..3466e3a 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp | |||
@@ -1,24 +1,27 @@ | |||
1 | |||
2 | #include <qpe/qpeapplication.h> | ||
3 | |||
1 | #include <qlabel.h> | 4 | #include <qlabel.h> |
2 | #include <qlayout.h> | 5 | #include <qlayout.h> |
3 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
4 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
5 | #include <qhbox.h> | 8 | #include <qhbox.h> |
6 | 9 | ||
7 | #include "modemconfigwidget.h" | 10 | #include "modemconfigwidget.h" |
8 | #include "dialdialog.h" | 11 | #include "dialdialog.h" |
9 | 12 | ||
10 | namespace { | 13 | namespace { |
11 | void setCurrent( const QString& str, QComboBox* bo ) { | 14 | void setCurrent( const QString& str, QComboBox* bo ) { |
12 | uint b = bo->count(); | 15 | uint b = bo->count(); |
13 | for (int i = 0; i < bo->count(); i++ ) { | 16 | for (int i = 0; i < bo->count(); i++ ) { |
14 | if ( bo->text(i) == str ) { | 17 | if ( bo->text(i) == str ) { |
15 | bo->setCurrentItem( i ); | 18 | bo->setCurrentItem( i ); |
16 | return; | 19 | return; |
17 | } | 20 | } |
18 | } | 21 | } |
19 | bo->insertItem( str ); | 22 | bo->insertItem( str ); |
20 | bo->setCurrentItem( b ); | 23 | bo->setCurrentItem( b ); |
21 | } | 24 | } |
22 | } | 25 | } |
23 | 26 | ||
24 | ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, | 27 | ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, |
@@ -216,40 +219,38 @@ void ModemConfigWidget::save( Profile& prof ) { | |||
216 | stop = 15; | 219 | stop = 15; |
217 | break; | 220 | break; |
218 | case IOLayerBase::Stop_Two: | 221 | case IOLayerBase::Stop_Two: |
219 | stop = 2; | 222 | stop = 2; |
220 | break; | 223 | break; |
221 | } | 224 | } |
222 | 225 | ||
223 | prof.writeEntry( "Flow", flow ); | 226 | prof.writeEntry( "Flow", flow ); |
224 | prof.writeEntry( "Parity", parity ); | 227 | prof.writeEntry( "Parity", parity ); |
225 | prof.writeEntry( "Speed", speed ); | 228 | prof.writeEntry( "Speed", speed ); |
226 | prof.writeEntry("DataBits", data); | 229 | prof.writeEntry("DataBits", data); |
227 | prof.writeEntry("StopBits", stop); | 230 | prof.writeEntry("StopBits", stop); |
228 | prof.writeEntry( "Number", m_telNumber->text() ); | 231 | prof.writeEntry( "Number", m_telNumber->text() ); |
229 | 232 | ||
230 | 233 | ||
231 | atConf->writeConfig(prof); | 234 | atConf->writeConfig(prof); |
232 | } | 235 | } |
233 | 236 | ||
234 | void ModemConfigWidget::slotAT() { | 237 | void ModemConfigWidget::slotAT() { |
235 | // ATConfigDialog conf( this, "ATConfig", true ); | 238 | // ATConfigDialog conf( this, "ATConfig", true ); |
236 | // josef/Max I know why don't you create the stuff on the stack | 239 | // josef/Max I know why don't you create the stuff on the stack |
237 | // but making it a TopLevel Dialog and ignoring | 240 | // but making it a TopLevel Dialog and ignoring |
238 | // cancel is not fun either... | 241 | // cancel is not fun either... |
239 | // what to do? FIXME!!! -zecke | 242 | // what to do? FIXME!!! -zecke |
240 | atConf->showMaximized(); | 243 | if ( QPEApplication::execDialog( atConf ) != QDialog::Accepted ) { |
241 | if ( atConf->exec() != QDialog::Accepted ) { | ||
242 | // reload old settings | 244 | // reload old settings |
243 | } | 245 | } |
244 | } | 246 | } |
245 | 247 | ||
246 | void ModemConfigWidget::slotDial() { | 248 | void ModemConfigWidget::slotDial() { |
247 | DialDialog dial( this, "DialConfig", true ); | 249 | DialDialog dial( this, "DialConfig", true ); |
248 | if(!m_telNumber->text().isEmpty()) { | 250 | if(!m_telNumber->text().isEmpty()) { |
249 | dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ \\.\\,]"), "")); | 251 | dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ \\.\\,]"), "")); |
250 | } | 252 | } |
251 | dial.showMaximized(); | 253 | if ( QPEApplication::execDialog( &dial ) == QDialog::Accepted ) { |
252 | if ( dial.exec() == QDialog::Accepted ) { | ||
253 | m_telNumber->setText( dial.number() ); | 254 | m_telNumber->setText( dial.number() ); |
254 | } | 255 | } |
255 | } | 256 | } |
diff --git a/noncore/apps/opie-reader/CloseDialog.cpp b/noncore/apps/opie-reader/CloseDialog.cpp index 741fa67..d7c2652 100644 --- a/noncore/apps/opie-reader/CloseDialog.cpp +++ b/noncore/apps/opie-reader/CloseDialog.cpp | |||
@@ -1,18 +1,21 @@ | |||
1 | #include "CloseDialog.h" | 1 | #include "CloseDialog.h" |
2 | #include "qlayout.h" | 2 | #include "qlayout.h" |
3 | 3 | ||
4 | #include <qpe/qpeapplication.h> | ||
5 | |||
4 | CCloseDialog::CCloseDialog(const QString& fname, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) | 6 | CCloseDialog::CCloseDialog(const QString& fname, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) |
5 | { | 7 | { |
6 | setCaption(tr("Tidy-up")); | 8 | setCaption(tr("Tidy-up")); |
7 | QVBoxLayout *tmp = new QVBoxLayout(this); | 9 | QVBoxLayout *tmp = new QVBoxLayout(this); |
8 | QVButtonGroup* vb = new QVButtonGroup(tr("Delete"), this); | 10 | QVButtonGroup* vb = new QVButtonGroup(tr("Delete"), this); |
9 | tmp->addWidget(vb); | 11 | tmp->addWidget(vb); |
10 | QString filestring = tr("Delete") + " " + fname; | 12 | QString filestring = tr("Delete") + " " + fname; |
11 | file = new QCheckBox(filestring, vb); | 13 | file = new QCheckBox(filestring, vb); |
12 | marks = new QCheckBox(tr("Delete Bookmarks"), vb); | 14 | marks = new QCheckBox(tr("Delete Bookmarks"), vb); |
13 | config = new QCheckBox(tr("Delete Configuration"), vb); | 15 | config = new QCheckBox(tr("Delete Configuration"), vb); |
14 | file->setChecked(false); | 16 | file->setChecked(false); |
15 | marks->setChecked(true); | 17 | marks->setChecked(true); |
16 | config->setChecked(true); | 18 | config->setChecked(true); |
17 | if (fs) showMaximized(); | 19 | if (fs) |
20 | QPEApplication::showDialog( this ); | ||
18 | } | 21 | } |
diff --git a/noncore/apps/opie-reader/Prefs.cpp b/noncore/apps/opie-reader/Prefs.cpp index e5320d9..5150ca5 100644 --- a/noncore/apps/opie-reader/Prefs.cpp +++ b/noncore/apps/opie-reader/Prefs.cpp | |||
@@ -6,48 +6,50 @@ | |||
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #include "useqpe.h" | 9 | #include "useqpe.h" |
10 | #include "Prefs.h" | 10 | #include "Prefs.h" |
11 | 11 | ||
12 | #include <qcheckbox.h> | 12 | #include <qcheckbox.h> |
13 | #include <qlabel.h> | 13 | #include <qlabel.h> |
14 | #include <qpushbutton.h> | 14 | #include <qpushbutton.h> |
15 | #include <qspinbox.h> | 15 | #include <qspinbox.h> |
16 | #include <qlayout.h> | 16 | #include <qlayout.h> |
17 | #include <qvariant.h> | 17 | #include <qvariant.h> |
18 | #include <qtooltip.h> | 18 | #include <qtooltip.h> |
19 | #include <qwhatsthis.h> | 19 | #include <qwhatsthis.h> |
20 | #include <qcombobox.h> | 20 | #include <qcombobox.h> |
21 | #include <qbuttongroup.h> | 21 | #include <qbuttongroup.h> |
22 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
23 | #ifdef USEQPE | 23 | #ifdef USEQPE |
24 | #include <qpe/menubutton.h> | 24 | #include <qpe/menubutton.h> |
25 | #include <qpe/fontdatabase.h> | 25 | #include <qpe/fontdatabase.h> |
26 | #else | 26 | #else |
27 | #include <qfontdatabase.h> | 27 | #include <qfontdatabase.h> |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #include <qpe/qpeapplication.h> | ||
31 | |||
30 | CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl ) | 32 | CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl ) |
31 | : QWidget( parent, name, fl ) | 33 | : QWidget( parent, name, fl ) |
32 | { | 34 | { |
33 | QHBoxLayout* hb = new QHBoxLayout(this); | 35 | QHBoxLayout* hb = new QHBoxLayout(this); |
34 | QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, tr("Text"), this); | 36 | QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, tr("Text"), this); |
35 | hb->addWidget(bg); | 37 | hb->addWidget(bg); |
36 | 38 | ||
37 | StripCR = new QCheckBox( bg ); | 39 | StripCR = new QCheckBox( bg ); |
38 | StripCR->setText( tr( "Strip CR" ) ); | 40 | StripCR->setText( tr( "Strip CR" ) ); |
39 | 41 | ||
40 | Dehyphen = new QCheckBox( bg ); | 42 | Dehyphen = new QCheckBox( bg ); |
41 | Dehyphen->setText( tr( "Dehyphen" ) ); | 43 | Dehyphen->setText( tr( "Dehyphen" ) ); |
42 | 44 | ||
43 | SingleSpace = new QCheckBox( bg ); | 45 | SingleSpace = new QCheckBox( bg ); |
44 | SingleSpace->setText( tr( "Single Space" ) ); | 46 | SingleSpace->setText( tr( "Single Space" ) ); |
45 | 47 | ||
46 | Unindent = new QCheckBox( bg ); | 48 | Unindent = new QCheckBox( bg ); |
47 | Unindent->setText( tr( "Unindent" ) ); | 49 | Unindent->setText( tr( "Unindent" ) ); |
48 | 50 | ||
49 | Reparagraph = new QCheckBox( bg ); | 51 | Reparagraph = new QCheckBox( bg ); |
50 | Reparagraph->setText( tr( "Reparagraph" ) ); | 52 | Reparagraph->setText( tr( "Reparagraph" ) ); |
51 | 53 | ||
52 | DoubleSpace = new QCheckBox( bg ); | 54 | DoubleSpace = new QCheckBox( bg ); |
53 | DoubleSpace->setText( tr( "Double Space" ) ); | 55 | DoubleSpace->setText( tr( "Double Space" ) ); |
@@ -406,49 +408,50 @@ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
406 | } | 408 | } |
407 | 409 | ||
408 | CMiscPrefs::~CMiscPrefs() | 410 | CMiscPrefs::~CMiscPrefs() |
409 | { | 411 | { |
410 | // no need to delete child widgets, Qt does it all for us | 412 | // no need to delete child widgets, Qt does it all for us |
411 | } | 413 | } |
412 | 414 | ||
413 | CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) | 415 | CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) |
414 | { | 416 | { |
415 | setCaption(tr( "OpieReader Settings" ) ); | 417 | setCaption(tr( "OpieReader Settings" ) ); |
416 | QTabWidget* td = new QTabWidget(this); | 418 | QTabWidget* td = new QTabWidget(this); |
417 | layout = new CLayoutPrefs(this); | 419 | layout = new CLayoutPrefs(this); |
418 | layout2 = new CLayoutPrefs2(this); | 420 | layout2 = new CLayoutPrefs2(this); |
419 | misc = new CMiscPrefs(this); | 421 | misc = new CMiscPrefs(this); |
420 | button = new CButtonPrefs(this); | 422 | button = new CButtonPrefs(this); |
421 | inter = new CInterPrefs(this); | 423 | inter = new CInterPrefs(this); |
422 | td->addTab(layout, tr("Layout")); | 424 | td->addTab(layout, tr("Layout")); |
423 | td->addTab(layout2, tr("Layout(2)")); | 425 | td->addTab(layout2, tr("Layout(2)")); |
424 | td->addTab(inter, tr("Locale")); | 426 | td->addTab(inter, tr("Locale")); |
425 | td->addTab(misc, tr("Misc")); | 427 | td->addTab(misc, tr("Misc")); |
426 | td->addTab(button, tr("Buttons")); | 428 | td->addTab(button, tr("Buttons")); |
427 | QVBoxLayout* v = new QVBoxLayout(this); | 429 | QVBoxLayout* v = new QVBoxLayout(this); |
428 | v->addWidget(td); | 430 | v->addWidget(td); |
429 | 431 | ||
430 | if (fs) showMaximized(); | 432 | if (fs) |
433 | QPEApplication::showDialog( this ); | ||
431 | } | 434 | } |
432 | 435 | ||
433 | 436 | ||
434 | /* | 437 | /* |
435 | 438 | ||
436 | Unicode | 439 | Unicode |
437 | Ideo/Word | 440 | Ideo/Word |
438 | Width | 441 | Width |
439 | Encoding | 442 | Encoding |
440 | 443 | ||
441 | */ | 444 | */ |
442 | 445 | ||
443 | #include "CEncoding_tables.h" | 446 | #include "CEncoding_tables.h" |
444 | 447 | ||
445 | CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl ) | 448 | CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl ) |
446 | : QWidget( parent, name, fl ) | 449 | : QWidget( parent, name, fl ) |
447 | { | 450 | { |
448 | QHBoxLayout* hb = new QHBoxLayout(this); | 451 | QHBoxLayout* hb = new QHBoxLayout(this); |
449 | 452 | ||
450 | QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("International"), this); | 453 | QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("International"), this); |
451 | 454 | ||
452 | hb->addWidget(gb); | 455 | hb->addWidget(gb); |
453 | 456 | ||
454 | QLabel *TextLabel; | 457 | QLabel *TextLabel; |
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp index f10020a..07af597 100644 --- a/noncore/apps/opie-reader/QTReaderApp.cpp +++ b/noncore/apps/opie-reader/QTReaderApp.cpp | |||
diff --git a/noncore/apps/opie-reader/ToolbarPrefs.cpp b/noncore/apps/opie-reader/ToolbarPrefs.cpp index 361bf97..d878829 100644 --- a/noncore/apps/opie-reader/ToolbarPrefs.cpp +++ b/noncore/apps/opie-reader/ToolbarPrefs.cpp | |||
@@ -2,69 +2,71 @@ | |||
2 | ** Form implementation generated from reading ui file 'Prefs.ui' | 2 | ** Form implementation generated from reading ui file 'Prefs.ui' |
3 | ** | 3 | ** |
4 | ** Created: Tue Feb 11 23:53:35 2003 | 4 | ** Created: Tue Feb 11 23:53:35 2003 |
5 | ** by: The User Interface Compiler (uic) | 5 | ** by: The User Interface Compiler (uic) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #include "useqpe.h" | 9 | #include "useqpe.h" |
10 | #include "ToolbarPrefs.h" | 10 | #include "ToolbarPrefs.h" |
11 | 11 | ||
12 | #include <qcheckbox.h> | 12 | #include <qcheckbox.h> |
13 | #include <qlabel.h> | 13 | #include <qlabel.h> |
14 | #include <qpushbutton.h> | 14 | #include <qpushbutton.h> |
15 | #include <qspinbox.h> | 15 | #include <qspinbox.h> |
16 | #include <qlayout.h> | 16 | #include <qlayout.h> |
17 | #include <qvariant.h> | 17 | #include <qvariant.h> |
18 | #include <qtooltip.h> | 18 | #include <qtooltip.h> |
19 | #include <qwhatsthis.h> | 19 | #include <qwhatsthis.h> |
20 | #include <qcombobox.h> | 20 | #include <qcombobox.h> |
21 | #include <qbuttongroup.h> | 21 | #include <qbuttongroup.h> |
22 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
23 | #ifdef USEQPE | 23 | #ifdef USEQPE |
24 | #include <qpe/menubutton.h> | 24 | #include <qpe/menubutton.h> |
25 | #endif | 25 | #endif |
26 | #include <qpe/qpeapplication.h> | ||
26 | 27 | ||
27 | CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir ) | 28 | CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir ) |
28 | { | 29 | { |
29 | setCaption(tr( "Toolbar Settings" ) ); | 30 | setCaption(tr( "Toolbar Settings" ) ); |
30 | QTabWidget* td = new QTabWidget(this); | 31 | QTabWidget* td = new QTabWidget(this); |
31 | misc = new CMiscBarPrefs(this); | 32 | misc = new CMiscBarPrefs(this); |
32 | filebar = new CFileBarPrefs(config, this); | 33 | filebar = new CFileBarPrefs(config, this); |
33 | navbar = new CNavBarPrefs(config, this); | 34 | navbar = new CNavBarPrefs(config, this); |
34 | viewbar = new CViewBarPrefs(config, this); | 35 | viewbar = new CViewBarPrefs(config, this); |
35 | markbar = new CMarkBarPrefs(config, this); | 36 | markbar = new CMarkBarPrefs(config, this); |
36 | indbar = new CIndBarPrefs(config, this); | 37 | indbar = new CIndBarPrefs(config, this); |
37 | td->addTab(filebar, tr("File")); | 38 | td->addTab(filebar, tr("File")); |
38 | td->addTab(navbar, tr("Navigation")); | 39 | td->addTab(navbar, tr("Navigation")); |
39 | td->addTab(viewbar, tr("View")); | 40 | td->addTab(viewbar, tr("View")); |
40 | td->addTab(markbar, tr("Marks")); | 41 | td->addTab(markbar, tr("Marks")); |
41 | td->addTab(indbar, tr("Indicators")); | 42 | td->addTab(indbar, tr("Indicators")); |
42 | td->addTab(misc, tr("Policy")); | 43 | td->addTab(misc, tr("Policy")); |
43 | QVBoxLayout* v = new QVBoxLayout(this); | 44 | QVBoxLayout* v = new QVBoxLayout(this); |
44 | v->addWidget(td); | 45 | v->addWidget(td); |
45 | 46 | ||
46 | if (fs) showMaximized(); | 47 | if (fs) |
48 | QPEApplication::showDialog( this ); | ||
47 | } | 49 | } |
48 | 50 | ||
49 | /* | 51 | /* |
50 | CBarPrefs1::CBarPrefs1( Config& _config, QWidget* parent, const char* name, WFlags fl ) | 52 | CBarPrefs1::CBarPrefs1( Config& _config, QWidget* parent, const char* name, WFlags fl ) |
51 | : QWidget( parent, name, fl ), config(_config) | 53 | : QWidget( parent, name, fl ), config(_config) |
52 | { | 54 | { |
53 | config.setGroup( "Toolbar" ); | 55 | config.setGroup( "Toolbar" ); |
54 | QVBoxLayout* vb = new QVBoxLayout(this); | 56 | QVBoxLayout* vb = new QVBoxLayout(this); |
55 | 57 | ||
56 | QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "File", this); | 58 | QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "File", this); |
57 | vb->addWidget(bg); | 59 | vb->addWidget(bg); |
58 | 60 | ||
59 | open = new QCheckBox( tr("Open"), bg ); | 61 | open = new QCheckBox( tr("Open"), bg ); |
60 | open->setChecked(config.readBoolEntry( "Open", false )); | 62 | open->setChecked(config.readBoolEntry( "Open", false )); |
61 | connect(open, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 63 | connect(open, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
62 | close = new QCheckBox( tr("Close"), bg ); | 64 | close = new QCheckBox( tr("Close"), bg ); |
63 | close->setChecked(config.readBoolEntry( "Close", false )); | 65 | close->setChecked(config.readBoolEntry( "Close", false )); |
64 | connect(close, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 66 | connect(close, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
65 | info = new QCheckBox( tr("Info"), bg ); | 67 | info = new QCheckBox( tr("Info"), bg ); |
66 | info->setChecked(config.readBoolEntry( "Info", false )); | 68 | info->setChecked(config.readBoolEntry( "Info", false )); |
67 | connect(info, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 69 | connect(info, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
68 | twotouch = new QCheckBox( tr("Two/One\nTouch"), bg ); | 70 | twotouch = new QCheckBox( tr("Two/One\nTouch"), bg ); |
69 | twotouch->setChecked(config.readBoolEntry( "Two/One Touch", false )); | 71 | twotouch->setChecked(config.readBoolEntry( "Two/One Touch", false )); |
70 | connect(twotouch, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 72 | connect(twotouch, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
diff --git a/noncore/apps/opie-reader/URLDialog.cpp b/noncore/apps/opie-reader/URLDialog.cpp index dd4568b..e572c80 100644 --- a/noncore/apps/opie-reader/URLDialog.cpp +++ b/noncore/apps/opie-reader/URLDialog.cpp | |||
@@ -1,14 +1,17 @@ | |||
1 | #include "URLDialog.h" | 1 | #include "URLDialog.h" |
2 | #include "qlayout.h" | 2 | #include "qlayout.h" |
3 | 3 | ||
4 | #include <qpe/qpeapplication.h> | ||
5 | |||
4 | CURLDialog::CURLDialog(const QString& fname, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) | 6 | CURLDialog::CURLDialog(const QString& fname, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) |
5 | { | 7 | { |
6 | setCaption(tr("Save URL")); | 8 | setCaption(tr("Save URL")); |
7 | QVBoxLayout *tmp = new QVBoxLayout(this); | 9 | QVBoxLayout *tmp = new QVBoxLayout(this); |
8 | QVButtonGroup* vb = new QVButtonGroup(fname, this); | 10 | QVButtonGroup* vb = new QVButtonGroup(fname, this); |
9 | tmp->addWidget(vb); | 11 | tmp->addWidget(vb); |
10 | m_clipboard = new QCheckBox(tr("Clipboard"), vb); | 12 | m_clipboard = new QCheckBox(tr("Clipboard"), vb); |
11 | m_localfile = new QCheckBox(tr("Local file"), vb); | 13 | m_localfile = new QCheckBox(tr("Local file"), vb); |
12 | m_globalfile = new QCheckBox(tr("Global file"), vb); | 14 | m_globalfile = new QCheckBox(tr("Global file"), vb); |
13 | if (fs) showMaximized(); | 15 | if (fs) |
16 | QPEApplication::showDialog( this ); | ||
14 | } | 17 | } |
diff --git a/noncore/apps/opie-reader/fileBrowser.cpp b/noncore/apps/opie-reader/fileBrowser.cpp index 9cd371d..05f2c31 100644 --- a/noncore/apps/opie-reader/fileBrowser.cpp +++ b/noncore/apps/opie-reader/fileBrowser.cpp | |||
@@ -1,48 +1,50 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | 2 | ||
3 | Derived from a file browser which was | 3 | Derived from a file browser which was |
4 | 4 | ||
5 | ** copyright 2001 ljp ljp@llornkcor.com | 5 | ** copyright 2001 ljp ljp@llornkcor.com |
6 | 6 | ||
7 | Extensive modification by Tim Wentford to allow it to work in rotated mode | 7 | Extensive modification by Tim Wentford to allow it to work in rotated mode |
8 | 8 | ||
9 | ****************************************************************************/ | 9 | ****************************************************************************/ |
10 | #include "fileBrowser.h" | 10 | #include "fileBrowser.h" |
11 | 11 | ||
12 | #include "QtrListView.h" | 12 | #include "QtrListView.h" |
13 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
14 | #include <qpushbutton.h> | 14 | #include <qpushbutton.h> |
15 | #include <qfile.h> | 15 | #include <qfile.h> |
16 | #include <qmessagebox.h> | 16 | #include <qmessagebox.h> |
17 | #ifndef _WINDOWS | 17 | #ifndef _WINDOWS |
18 | #include <unistd.h> | 18 | #include <unistd.h> |
19 | #endif | 19 | #endif |
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | #ifdef _WINDOWS | 21 | #ifdef _WINDOWS |
22 | #include <direct.h> | 22 | #include <direct.h> |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #include <qpe/qpeapplication.h> | ||
26 | |||
25 | #include "opie.h" | 27 | #include "opie.h" |
26 | 28 | ||
27 | fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter, const QString iPath ) | 29 | fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter, const QString iPath ) |
28 | : QDialog( parent, name, true, | 30 | : QDialog( parent, name, true, |
29 | fl/* | WStyle_Customize | WStyle_Tool*/), | 31 | fl/* | WStyle_Customize | WStyle_Tool*/), |
30 | filterspec(QDir::All) | 32 | filterspec(QDir::All) |
31 | { | 33 | { |
32 | // showMaximized(); | 34 | // showMaximized(); |
33 | if ( !name ) | 35 | if ( !name ) |
34 | setName( "fileBrowser" ); | 36 | setName( "fileBrowser" ); |
35 | /* | 37 | /* |
36 | if (parent != NULL) | 38 | if (parent != NULL) |
37 | { | 39 | { |
38 | #ifdef OPIE | 40 | #ifdef OPIE |
39 | move(0,0); | 41 | move(0,0); |
40 | resize( parent->width(), parent->height() ); | 42 | resize( parent->width(), parent->height() ); |
41 | #else | 43 | #else |
42 | setGeometry(parent->x(), parent->y(), parent->width(), parent->height() ); | 44 | setGeometry(parent->x(), parent->y(), parent->width(), parent->height() ); |
43 | #endif | 45 | #endif |
44 | } | 46 | } |
45 | */ | 47 | */ |
46 | // showFullScreen(); | 48 | // showFullScreen(); |
47 | setCaption(tr( "Browse for file" ) ); | 49 | setCaption(tr( "Browse for file" ) ); |
48 | filterStr=filter; | 50 | filterStr=filter; |
@@ -94,49 +96,50 @@ fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, boo | |||
94 | connect( m_filename, SIGNAL( returnPressed() ), this, SLOT( onReturn() )); | 96 | connect( m_filename, SIGNAL( returnPressed() ), this, SLOT( onReturn() )); |
95 | } | 97 | } |
96 | else | 98 | else |
97 | { | 99 | { |
98 | m_filename = NULL; | 100 | m_filename = NULL; |
99 | } | 101 | } |
100 | 102 | ||
101 | if (QFileInfo(iPath).exists()) | 103 | if (QFileInfo(iPath).exists()) |
102 | { | 104 | { |
103 | currentDir.setPath(iPath); | 105 | currentDir.setPath(iPath); |
104 | #ifdef _WINDOWS | 106 | #ifdef _WINDOWS |
105 | _chdir(iPath.latin1()); | 107 | _chdir(iPath.latin1()); |
106 | #else | 108 | #else |
107 | chdir(iPath.latin1()); | 109 | chdir(iPath.latin1()); |
108 | #endif | 110 | #endif |
109 | } | 111 | } |
110 | else | 112 | else |
111 | { | 113 | { |
112 | currentDir.setPath(QDir::currentDirPath()); | 114 | currentDir.setPath(QDir::currentDirPath()); |
113 | chdir(QDir::currentDirPath().latin1()); | 115 | chdir(QDir::currentDirPath().latin1()); |
114 | } | 116 | } |
115 | 117 | ||
116 | populateList(); | 118 | populateList(); |
117 | 119 | ||
118 | if (modal) showMaximized(); | 120 | if (modal) |
121 | QPEApplication::showDialog( this ); | ||
119 | } | 122 | } |
120 | 123 | ||
121 | void fileBrowser::resizeEvent(QResizeEvent* e) | 124 | void fileBrowser::resizeEvent(QResizeEvent* e) |
122 | { | 125 | { |
123 | ListView->setColumnWidth(1,(ListView->width())/4); | 126 | ListView->setColumnWidth(1,(ListView->width())/4); |
124 | ListView->setColumnWidth(0,ListView->width()-20-ListView->columnWidth(1)); | 127 | ListView->setColumnWidth(0,ListView->width()-20-ListView->columnWidth(1)); |
125 | } | 128 | } |
126 | 129 | ||
127 | fileBrowser::~fileBrowser() | 130 | fileBrowser::~fileBrowser() |
128 | { | 131 | { |
129 | } | 132 | } |
130 | 133 | ||
131 | 134 | ||
132 | void fileBrowser::populateList() | 135 | void fileBrowser::populateList() |
133 | { | 136 | { |
134 | ListView->clear(); | 137 | ListView->clear(); |
135 | ////qDebug(currentDir.canonicalPath()); | 138 | ////qDebug(currentDir.canonicalPath()); |
136 | // currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::NoSymLinks ); | 139 | // currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::NoSymLinks ); |
137 | currentDir.setFilter( filterspec ); | 140 | currentDir.setFilter( filterspec ); |
138 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 141 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
139 | currentDir.setMatchAllDirs(TRUE); | 142 | currentDir.setMatchAllDirs(TRUE); |
140 | 143 | ||
141 | currentDir.setNameFilter(filterStr); | 144 | currentDir.setNameFilter(filterStr); |
142 | // currentDir.setNameFilter("*.txt;*.etx"); | 145 | // currentDir.setNameFilter("*.txt;*.etx"); |
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index bd98aca..3d3c688 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp | |||
@@ -1,47 +1,50 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Opie Sheet (formerly Sheet/Qt) | 11 | * Opie Sheet (formerly Sheet/Qt) |
12 | * by Serdar Ozler <sozler@sitebest.com> | 12 | * by Serdar Ozler <sozler@sitebest.com> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "mainwindow.h" | 15 | #include "mainwindow.h" |
16 | 16 | ||
17 | #include <qpe/filemanager.h> | 17 | #include <qpe/filemanager.h> |
18 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
19 | #include <qpe/resource.h> | 19 | #include <qpe/resource.h> |
20 | #include <qpe/qpeapplication.h> | ||
21 | |||
20 | #include <qmessagebox.h> | 22 | #include <qmessagebox.h> |
21 | #include <qfile.h> | 23 | #include <qfile.h> |
22 | #include <qtranslator.h> | 24 | #include <qtranslator.h> |
23 | #include <qradiobutton.h> | 25 | #include <qradiobutton.h> |
26 | |||
24 | #include "cellformat.h" | 27 | #include "cellformat.h" |
25 | #include "numberdlg.h" | 28 | #include "numberdlg.h" |
26 | #include "textdlg.h" | 29 | #include "textdlg.h" |
27 | #include "sortdlg.h" | 30 | #include "sortdlg.h" |
28 | #include "finddlg.h" | 31 | #include "finddlg.h" |
29 | 32 | ||
30 | #define DEFAULT_NUM_ROWS 300 | 33 | #define DEFAULT_NUM_ROWS 300 |
31 | #define DEFAULT_NUM_COLS (26*3) | 34 | #define DEFAULT_NUM_COLS (26*3) |
32 | #define DEFAULT_NUM_SHEETS 3 | 35 | #define DEFAULT_NUM_SHEETS 3 |
33 | 36 | ||
34 | MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) | 37 | MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) |
35 | :QMainWindow(parent, n, fl) | 38 | :QMainWindow(parent, n, fl) |
36 | { | 39 | { |
37 | // initialize variables | 40 | // initialize variables |
38 | documentModified=FALSE; | 41 | documentModified=FALSE; |
39 | 42 | ||
40 | // construct objects | 43 | // construct objects |
41 | currentDoc=0; | 44 | currentDoc=0; |
42 | fileSelector=new FileSelector("application/sheet-qt", this, QString::null); | 45 | fileSelector=new FileSelector("application/sheet-qt", this, QString::null); |
43 | ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE); | 46 | ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE); |
44 | connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide())); | 47 | connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide())); |
45 | connect(fileSelector, SIGNAL(newSelected(const DocLnk &)), this, SLOT(selectorFileNew(const DocLnk &))); | 48 | connect(fileSelector, SIGNAL(newSelected(const DocLnk &)), this, SLOT(selectorFileNew(const DocLnk &))); |
46 | connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), this, SLOT(selectorFileOpen(const DocLnk &))); | 49 | connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), this, SLOT(selectorFileOpen(const DocLnk &))); |
47 | connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk &)),this,SLOT(slotImportExcel(const DocLnk &))); | 50 | connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk &)),this,SLOT(slotImportExcel(const DocLnk &))); |
@@ -726,49 +729,49 @@ typeSheet *MainWindow::findSheet(const QString &name) | |||
726 | if (tempSheet->name==name) | 729 | if (tempSheet->name==name) |
727 | return tempSheet; | 730 | return tempSheet; |
728 | return NULL; | 731 | return NULL; |
729 | } | 732 | } |
730 | 733 | ||
731 | void MainWindow::slotSheetChanged(const QString &name) | 734 | void MainWindow::slotSheetChanged(const QString &name) |
732 | { | 735 | { |
733 | sheet->copySheetData(&findSheet(sheet->getName())->data); | 736 | sheet->copySheetData(&findSheet(sheet->getName())->data); |
734 | sheet->setName(name); | 737 | sheet->setName(name); |
735 | sheet->setSheetData(&findSheet(name)->data); | 738 | sheet->setSheetData(&findSheet(name)->data); |
736 | sheet->ReCalc(); | 739 | sheet->ReCalc(); |
737 | } | 740 | } |
738 | 741 | ||
739 | void MainWindow::addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w) | 742 | void MainWindow::addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w) |
740 | { | 743 | { |
741 | QAction *action=new QAction(text, menuText, 0, this); | 744 | QAction *action=new QAction(text, menuText, 0, this); |
742 | action->setToolTip(tip); | 745 | action->setToolTip(tip); |
743 | connect(action, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 746 | connect(action, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
744 | action->addTo(w); | 747 | action->addTo(w); |
745 | } | 748 | } |
746 | 749 | ||
747 | void MainWindow::slotFormatCells() | 750 | void MainWindow::slotFormatCells() |
748 | { | 751 | { |
749 | CellFormat dialogCellFormat(this); | 752 | CellFormat dialogCellFormat(this); |
750 | dialogCellFormat.showMaximized(); | 753 | QPEApplication::showDialog( &dialogCellFormat ); |
751 | dialogCellFormat.exec(sheet); | 754 | dialogCellFormat.exec(sheet); |
752 | } | 755 | } |
753 | 756 | ||
754 | void MainWindow::slotEditPaste() | 757 | void MainWindow::slotEditPaste() |
755 | { | 758 | { |
756 | sheet->editPaste(); | 759 | sheet->editPaste(); |
757 | } | 760 | } |
758 | 761 | ||
759 | void MainWindow::slotEditPasteContents() | 762 | void MainWindow::slotEditPasteContents() |
760 | { | 763 | { |
761 | sheet->editPaste(TRUE); | 764 | sheet->editPaste(TRUE); |
762 | } | 765 | } |
763 | 766 | ||
764 | void MainWindow::slotRowHeight() | 767 | void MainWindow::slotRowHeight() |
765 | { | 768 | { |
766 | int row1, row2, col1, col2; | 769 | int row1, row2, col1, col2; |
767 | sheet->getSelection(&row1, &col1, &row2, &col2); | 770 | sheet->getSelection(&row1, &col1, &row2, &col2); |
768 | 771 | ||
769 | NumberDialog dialogNumber(this); | 772 | NumberDialog dialogNumber(this); |
770 | if (dialogNumber.exec(tr("Row Height"), tr("&Height of each row:"), sheet->rowHeight(row1))==QDialog::Accepted) | 773 | if (dialogNumber.exec(tr("Row Height"), tr("&Height of each row:"), sheet->rowHeight(row1))==QDialog::Accepted) |
771 | { | 774 | { |
772 | int newHeight=dialogNumber.getValue(), row; | 775 | int newHeight=dialogNumber.getValue(), row; |
773 | for (row=row1; row<=row2; ++row) | 776 | for (row=row1; row<=row2; ++row) |
774 | sheet->setRowHeight(row, newHeight); | 777 | sheet->setRowHeight(row, newHeight); |
@@ -946,63 +949,63 @@ void MainWindow::slotSheetRemove() | |||
946 | { | 949 | { |
947 | if (comboSheets->count()<2) | 950 | if (comboSheets->count()<2) |
948 | { | 951 | { |
949 | QMessageBox::warning(this, tr("Error"), tr("There is only one sheet!")); | 952 | QMessageBox::warning(this, tr("Error"), tr("There is only one sheet!")); |
950 | return; | 953 | return; |
951 | } | 954 | } |
952 | if (QMessageBox::information(this, tr("Remove Sheet"), tr("Are you sure?"), QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) | 955 | if (QMessageBox::information(this, tr("Remove Sheet"), tr("Are you sure?"), QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) |
953 | { | 956 | { |
954 | typeSheet *tempSheet=findSheet(sheet->getName()); | 957 | typeSheet *tempSheet=findSheet(sheet->getName()); |
955 | for (int i=0; i<comboSheets->count(); ++i) | 958 | for (int i=0; i<comboSheets->count(); ++i) |
956 | if (comboSheets->text(i)==tempSheet->name) | 959 | if (comboSheets->text(i)==tempSheet->name) |
957 | { | 960 | { |
958 | comboSheets->removeItem(i); | 961 | comboSheets->removeItem(i); |
959 | break; | 962 | break; |
960 | } | 963 | } |
961 | comboSheets->setCurrentItem(0); | 964 | comboSheets->setCurrentItem(0); |
962 | slotSheetChanged(comboSheets->currentText()); | 965 | slotSheetChanged(comboSheets->currentText()); |
963 | listSheets.remove(tempSheet); | 966 | listSheets.remove(tempSheet); |
964 | } | 967 | } |
965 | } | 968 | } |
966 | 969 | ||
967 | void MainWindow::slotDataSort() | 970 | void MainWindow::slotDataSort() |
968 | { | 971 | { |
969 | SortDialog dialogSort(this); | 972 | SortDialog dialogSort(this); |
970 | dialogSort.showMaximized(); | 973 | QPEApplication::showDialog( &dialogSort ); |
971 | dialogSort.exec(sheet); | 974 | dialogSort.exec(sheet); |
972 | } | 975 | } |
973 | 976 | ||
974 | void MainWindow::slotDocModified() | 977 | void MainWindow::slotDocModified() |
975 | { | 978 | { |
976 | documentModified=TRUE; | 979 | documentModified=TRUE; |
977 | } | 980 | } |
978 | 981 | ||
979 | void MainWindow::slotInsertCells() | 982 | void MainWindow::slotInsertCells() |
980 | { | 983 | { |
981 | QDialog dialogInsert(this, 0, TRUE); | 984 | QDialog dialogInsert(this, 0, TRUE); |
982 | dialogInsert.resize(180, 130); | 985 | dialogInsert.resize(180, 130); |
983 | dialogInsert.setCaption(tr("Insert Cells")); | 986 | dialogInsert.setCaption(tr("Insert Cells")); |
984 | 987 | ||
985 | QVButtonGroup *group=new QVButtonGroup(tr("&Type"), &dialogInsert); | 988 | QVButtonGroup *group=new QVButtonGroup(tr("&Type"), &dialogInsert); |
986 | group->setGeometry(10, 10, 160, 110); | 989 | group->setGeometry(10, 10, 160, 110); |
987 | QRadioButton *radio=new QRadioButton(tr("Shift cells &down"), group); | 990 | QRadioButton *radio=new QRadioButton(tr("Shift cells &down"), group); |
988 | radio=new QRadioButton(tr("Shift cells &right"), group); | 991 | radio=new QRadioButton(tr("Shift cells &right"), group); |
989 | radio=new QRadioButton(tr("Entire ro&w"), group); | 992 | radio=new QRadioButton(tr("Entire ro&w"), group); |
990 | radio=new QRadioButton(tr("Entire &column"), group); | 993 | radio=new QRadioButton(tr("Entire &column"), group); |
991 | group->setButton(0); | 994 | group->setButton(0); |
992 | 995 | ||
993 | if (dialogInsert.exec()==QDialog::Accepted) | 996 | if (dialogInsert.exec()==QDialog::Accepted) |
994 | switch (group->id(group->selected())) | 997 | switch (group->id(group->selected())) |
995 | { | 998 | { |
996 | case 0: sheet->insertRows(1, FALSE); break; | 999 | case 0: sheet->insertRows(1, FALSE); break; |
997 | case 1: sheet->insertColumns(1, FALSE); break; | 1000 | case 1: sheet->insertColumns(1, FALSE); break; |
998 | case 2: sheet->insertRows(1, TRUE); break; | 1001 | case 2: sheet->insertRows(1, TRUE); break; |
999 | case 3: sheet->insertColumns(1, TRUE); break; | 1002 | case 3: sheet->insertColumns(1, TRUE); break; |
1000 | } | 1003 | } |
1001 | } | 1004 | } |
1002 | 1005 | ||
1003 | void MainWindow::slotDataFindReplace() | 1006 | void MainWindow::slotDataFindReplace() |
1004 | { | 1007 | { |
1005 | FindDialog dialogFind(this); | 1008 | FindDialog dialogFind(this); |
1006 | dialogFind.showMaximized(); | 1009 | QPEApplication::showDialog( &dialogFind ); |
1007 | dialogFind.exec(sheet); | 1010 | dialogFind.exec(sheet); |
1008 | } | 1011 | } |
diff --git a/noncore/apps/tableviewer/ui/tveditview.cpp b/noncore/apps/tableviewer/ui/tveditview.cpp index 23e2b42..20a24c8 100644 --- a/noncore/apps/tableviewer/ui/tveditview.cpp +++ b/noncore/apps/tableviewer/ui/tveditview.cpp | |||
@@ -19,73 +19,75 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | 21 | ||
22 | /* The edit view widget. For each key in the DB display an | 22 | /* The edit view widget. For each key in the DB display an |
23 | * appropriate edit box, and a 'key' button to change that particular | 23 | * appropriate edit box, and a 'key' button to change that particular |
24 | * key information (delete or edit). | 24 | * key information (delete or edit). |
25 | * | 25 | * |
26 | * Bottem line should be a 'new key' button. Should be able to scroll | 26 | * Bottem line should be a 'new key' button. Should be able to scroll |
27 | * in both directions. | 27 | * in both directions. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "tveditview.h" | 30 | #include "tveditview.h" |
31 | #include "commonwidgets.h" | 31 | #include "commonwidgets.h" |
32 | 32 | ||
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qgrid.h> | 34 | #include <qgrid.h> |
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qcheckbox.h> | 37 | #include <qcheckbox.h> |
38 | #include <qlist.h> | 38 | #include <qlist.h> |
39 | #include <qlabel.h> | 39 | #include <qlabel.h> |
40 | #include <qscrollview.h> | 40 | #include <qscrollview.h> |
41 | #include <qsignalmapper.h> | 41 | #include <qsignalmapper.h> |
42 | 42 | ||
43 | #include <qpe/qpeapplication.h> | ||
44 | |||
43 | TVEditView::TVEditView(TableState *s, DataElem *d, QWidget* parent, | 45 | TVEditView::TVEditView(TableState *s, DataElem *d, QWidget* parent, |
44 | const char *name, WFlags fl ) : QDialog(parent, name, true, fl) | 46 | const char *name, WFlags fl ) : QDialog(parent, name, true, fl) |
45 | { | 47 | { |
46 | if (!name) | 48 | if (!name) |
47 | setName("TVEditView"); | 49 | setName("TVEditView"); |
48 | 50 | ||
49 | QVBoxLayout *layout = new QVBoxLayout(this, 0); /* only so that will resize | 51 | QVBoxLayout *layout = new QVBoxLayout(this, 0); /* only so that will resize |
50 | correctly in other | 52 | correctly in other |
51 | widgets */ | 53 | widgets */ |
52 | 54 | ||
53 | toggles = new QSignalMapper(this); | 55 | toggles = new QSignalMapper(this); |
54 | QScrollView *sv = new QScrollView(this, 0); | 56 | QScrollView *sv = new QScrollView(this, 0); |
55 | sv->setResizePolicy(QScrollView::AutoOneFit); | 57 | sv->setResizePolicy(QScrollView::AutoOneFit); |
56 | 58 | ||
57 | layout->addWidget(sv); | 59 | layout->addWidget(sv); |
58 | 60 | ||
59 | editDisplay = new QGrid(3, sv, 0); | 61 | editDisplay = new QGrid(3, sv, 0); |
60 | editDisplay->setSpacing(3); | 62 | editDisplay->setSpacing(3); |
61 | sv->addChild(editDisplay); | 63 | sv->addChild(editDisplay); |
62 | 64 | ||
63 | connect(toggles, SIGNAL(mapped(int)), this, SLOT(toggleEnabled(int))); | 65 | connect(toggles, SIGNAL(mapped(int)), this, SLOT(toggleEnabled(int))); |
64 | 66 | ||
65 | setData(s, d); | 67 | setData(s, d); |
66 | #ifdef Q_WS_QWS | 68 | #ifdef Q_WS_QWS |
67 | showMaximized(); | 69 | QPEApplication::showDialog( this ); |
68 | #endif | 70 | #endif |
69 | } | 71 | } |
70 | 72 | ||
71 | TVEditView::~TVEditView() | 73 | TVEditView::~TVEditView() |
72 | { | 74 | { |
73 | } | 75 | } |
74 | 76 | ||
75 | /*! set up the widgets in the grid, Set up initial values */ | 77 | /*! set up the widgets in the grid, Set up initial values */ |
76 | void TVEditView::setData(TableState *t, DataElem *d) | 78 | void TVEditView::setData(TableState *t, DataElem *d) |
77 | { | 79 | { |
78 | 80 | ||
79 | /* TODO need to somehow clear old children... a delete of each | 81 | /* TODO need to somehow clear old children... a delete of each |
80 | * child? */ | 82 | * child? */ |
81 | keyIds.clear(); | 83 | keyIds.clear(); |
82 | 84 | ||
83 | KeyListIterator it(*t->kRep); | 85 | KeyListIterator it(*t->kRep); |
84 | 86 | ||
85 | int i = 0; | 87 | int i = 0; |
86 | while(it.current()) { | 88 | while(it.current()) { |
87 | if (t->kRep->validIndex(it.currentKey())) { | 89 | if (t->kRep->validIndex(it.currentKey())) { |
88 | new QLabel(it.current()->name(), editDisplay); | 90 | new QLabel(it.current()->name(), editDisplay); |
89 | keyIds.insert(i, it.currentKey()); | 91 | keyIds.insert(i, it.currentKey()); |
90 | if (d->hasValidValue(it.currentKey())) { | 92 | if (d->hasValidValue(it.currentKey())) { |
91 | switch(it.current()->type()) { | 93 | switch(it.current()->type()) { |
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp index 0182127..b03e846 100644 --- a/noncore/apps/tableviewer/ui/tvfilterview.cpp +++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp | |||
@@ -5,48 +5,50 @@ | |||
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tvfilterview.h" | 20 | #include "tvfilterview.h" |
21 | #include <qtoolbutton.h> | 21 | #include <qtoolbutton.h> |
22 | #include <qcombobox.h> | 22 | #include <qcombobox.h> |
23 | #include <qlistview.h> | 23 | #include <qlistview.h> |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qheader.h> | 25 | #include <qheader.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | 28 | ||
29 | #include <qpe/qpeapplication.h> | ||
30 | |||
29 | TVFilterView::TVFilterView(TableState *t, QWidget* parent, | 31 | TVFilterView::TVFilterView(TableState *t, QWidget* parent, |
30 | const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl) | 32 | const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl) |
31 | { | 33 | { |
32 | if ( !name ) | 34 | if ( !name ) |
33 | setName( "Filter View" ); | 35 | setName( "Filter View" ); |
34 | 36 | ||
35 | QVBoxLayout *vlayout = new QVBoxLayout(this); | 37 | QVBoxLayout *vlayout = new QVBoxLayout(this); |
36 | 38 | ||
37 | display = new QListView(this, "display"); | 39 | display = new QListView(this, "display"); |
38 | display->addColumn("Key"); | 40 | display->addColumn("Key"); |
39 | display->addColumn("Constraint"); | 41 | display->addColumn("Constraint"); |
40 | display->addColumn("Value"); | 42 | display->addColumn("Value"); |
41 | display->header()->setClickEnabled(FALSE); | 43 | display->header()->setClickEnabled(FALSE); |
42 | display->header()->setResizeEnabled(FALSE); | 44 | display->header()->setResizeEnabled(FALSE); |
43 | 45 | ||
44 | vlayout->addWidget(display); | 46 | vlayout->addWidget(display); |
45 | 47 | ||
46 | QHBoxLayout *hlayout = new QHBoxLayout; | 48 | QHBoxLayout *hlayout = new QHBoxLayout; |
47 | hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); | 49 | hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); |
48 | 50 | ||
49 | newFilterButton = new QPushButton(this, "new Filter"); | 51 | newFilterButton = new QPushButton(this, "new Filter"); |
50 | newFilterButton->setMaximumSize(QSize(50, 32767)); | 52 | newFilterButton->setMaximumSize(QSize(50, 32767)); |
51 | newFilterButton->setText("New"); | 53 | newFilterButton->setText("New"); |
52 | hlayout->addWidget(newFilterButton); | 54 | hlayout->addWidget(newFilterButton); |
@@ -74,49 +76,49 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, | |||
74 | hlayout2->addWidget(label); | 76 | hlayout2->addWidget(label); |
75 | 77 | ||
76 | keyEntry = new TVFilterKeyEntry(this, "key entry"); | 78 | keyEntry = new TVFilterKeyEntry(this, "key entry"); |
77 | keyEntry->setEnabled(FALSE); | 79 | keyEntry->setEnabled(FALSE); |
78 | 80 | ||
79 | vlayout->addLayout(hlayout2); | 81 | vlayout->addLayout(hlayout2); |
80 | vlayout->addWidget(keyEntry); | 82 | vlayout->addWidget(keyEntry); |
81 | 83 | ||
82 | connect(newFilterButton, SIGNAL( clicked() ), this, SLOT( newTerm() )); | 84 | connect(newFilterButton, SIGNAL( clicked() ), this, SLOT( newTerm() )); |
83 | connect(deleteFilterButton, SIGNAL( clicked() ), this, SLOT( deleteTerm())); | 85 | connect(deleteFilterButton, SIGNAL( clicked() ), this, SLOT( deleteTerm())); |
84 | connect(clearFilterButton, SIGNAL( clicked() ), this, SLOT( clearTerms())); | 86 | connect(clearFilterButton, SIGNAL( clicked() ), this, SLOT( clearTerms())); |
85 | 87 | ||
86 | connect(keyEntry, SIGNAL(valueChanged()), this, SLOT( updateTerm() )); | 88 | connect(keyEntry, SIGNAL(valueChanged()), this, SLOT( updateTerm() )); |
87 | connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() )); | 89 | connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() )); |
88 | 90 | ||
89 | connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, | 91 | connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, |
90 | SLOT(setTerm(QListViewItem *))); | 92 | SLOT(setTerm(QListViewItem *))); |
91 | 93 | ||
92 | ts = t; | 94 | ts = t; |
93 | current = 0; | 95 | current = 0; |
94 | terms.setAutoDelete(true); | 96 | terms.setAutoDelete(true); |
95 | do_filter = false; | 97 | do_filter = false; |
96 | 98 | ||
97 | #ifdef Q_WS_QWS | 99 | #ifdef Q_WS_QWS |
98 | showMaximized(); | 100 | QPEApplication::showDialog( this ); |
99 | #endif | 101 | #endif |
100 | } | 102 | } |
101 | 103 | ||
102 | /*! | 104 | /*! |
103 | Destroys the TVFilterView widget | 105 | Destroys the TVFilterView widget |
104 | */ | 106 | */ |
105 | TVFilterView::~TVFilterView() | 107 | TVFilterView::~TVFilterView() |
106 | { | 108 | { |
107 | } | 109 | } |
108 | 110 | ||
109 | void TVFilterView::rebuildData() | 111 | void TVFilterView::rebuildData() |
110 | { | 112 | { |
111 | } | 113 | } |
112 | 114 | ||
113 | void TVFilterView::reset() | 115 | void TVFilterView::reset() |
114 | { | 116 | { |
115 | keyNameCombo->clear(); | 117 | keyNameCombo->clear(); |
116 | keyIds.clear(); | 118 | keyIds.clear(); |
117 | } | 119 | } |
118 | 120 | ||
119 | void TVFilterView::rebuildKeys() | 121 | void TVFilterView::rebuildKeys() |
120 | { | 122 | { |
121 | int i; | 123 | int i; |
122 | 124 | ||
diff --git a/noncore/apps/tableviewer/ui/tvkeyedit.cpp b/noncore/apps/tableviewer/ui/tvkeyedit.cpp index 4849e87..c22ecd3 100644 --- a/noncore/apps/tableviewer/ui/tvkeyedit.cpp +++ b/noncore/apps/tableviewer/ui/tvkeyedit.cpp | |||
@@ -5,48 +5,50 @@ | |||
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tvkeyedit.h" | 20 | #include "tvkeyedit.h" |
21 | #include <qtoolbutton.h> | 21 | #include <qtoolbutton.h> |
22 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
23 | #include <qcombobox.h> | 23 | #include <qcombobox.h> |
24 | #include <qlistview.h> | 24 | #include <qlistview.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
28 | 28 | ||
29 | #include <qpe/qpeapplication.h> | ||
30 | |||
29 | /* QList view item... ?? that can store and update the values that I will | 31 | /* QList view item... ?? that can store and update the values that I will |
30 | * be changing */ | 32 | * be changing */ |
31 | 33 | ||
32 | class TVKEListViewItem : public QListViewItem | 34 | class TVKEListViewItem : public QListViewItem |
33 | { | 35 | { |
34 | public: | 36 | public: |
35 | TVKEListViewItem(QString n, TVVariant::KeyType kt, int p, QListView *parent) : | 37 | TVKEListViewItem(QString n, TVVariant::KeyType kt, int p, QListView *parent) : |
36 | QListViewItem(parent) | 38 | QListViewItem(parent) |
37 | { | 39 | { |
38 | name = n; | 40 | name = n; |
39 | keyType = kt; | 41 | keyType = kt; |
40 | position = p; | 42 | position = p; |
41 | } | 43 | } |
42 | 44 | ||
43 | QString text(int i) const | 45 | QString text(int i) const |
44 | { | 46 | { |
45 | if(i) { | 47 | if(i) { |
46 | return TVVariant::typeToName(keyType); | 48 | return TVVariant::typeToName(keyType); |
47 | } | 49 | } |
48 | return name; | 50 | return name; |
49 | } | 51 | } |
50 | 52 | ||
51 | /* always sort by key index, ignore i */ | 53 | /* always sort by key index, ignore i */ |
52 | QString key(int, bool) const | 54 | QString key(int, bool) const |
@@ -114,49 +116,49 @@ TVKeyEdit::TVKeyEdit(TableState *t, QWidget* parent, const char *name, | |||
114 | 116 | ||
115 | KeyListIterator it(*ts->kRep); | 117 | KeyListIterator it(*ts->kRep); |
116 | while(it.current()) { | 118 | while(it.current()) { |
117 | if(t->kRep->validIndex(it.currentKey())) { | 119 | if(t->kRep->validIndex(it.currentKey())) { |
118 | new TVKEListViewItem(it.current()->name(), | 120 | new TVKEListViewItem(it.current()->name(), |
119 | it.current()->type(), | 121 | it.current()->type(), |
120 | it.currentKey(), | 122 | it.currentKey(), |
121 | display); | 123 | display); |
122 | } | 124 | } |
123 | ++it; | 125 | ++it; |
124 | } | 126 | } |
125 | num_keys = ts->kRep->getNumFields(); | 127 | num_keys = ts->kRep->getNumFields(); |
126 | if(display->childCount() > 0) { | 128 | if(display->childCount() > 0) { |
127 | display->setCurrentItem(display->firstChild()); | 129 | display->setCurrentItem(display->firstChild()); |
128 | setTerm(display->currentItem()); | 130 | setTerm(display->currentItem()); |
129 | } else { | 131 | } else { |
130 | deleteKeyButton->setEnabled(FALSE); | 132 | deleteKeyButton->setEnabled(FALSE); |
131 | clearKeysButton->setEnabled(FALSE); | 133 | clearKeysButton->setEnabled(FALSE); |
132 | keyNameEdit->setEnabled(FALSE); | 134 | keyNameEdit->setEnabled(FALSE); |
133 | keyTypeEdit->setEnabled(FALSE); | 135 | keyTypeEdit->setEnabled(FALSE); |
134 | } | 136 | } |
135 | 137 | ||
136 | display->setSorting(0); | 138 | display->setSorting(0); |
137 | #ifdef Q_WS_QWS | 139 | #ifdef Q_WS_QWS |
138 | showMaximized(); | 140 | QPEApplication::showDialog( this ); |
139 | #endif | 141 | #endif |
140 | } | 142 | } |
141 | 143 | ||
142 | /*! | 144 | /*! |
143 | Destroys the TVKeyEdit widget | 145 | Destroys the TVKeyEdit widget |
144 | */ | 146 | */ |
145 | TVKeyEdit::~TVKeyEdit() | 147 | TVKeyEdit::~TVKeyEdit() |
146 | { | 148 | { |
147 | } | 149 | } |
148 | 150 | ||
149 | /* SLOTS */ | 151 | /* SLOTS */ |
150 | void TVKeyEdit::newTerm() | 152 | void TVKeyEdit::newTerm() |
151 | { | 153 | { |
152 | /* new item, make current Item */ | 154 | /* new item, make current Item */ |
153 | int i; | 155 | int i; |
154 | 156 | ||
155 | i = working_state.addKey("<New Key>", TVVariant::String); | 157 | i = working_state.addKey("<New Key>", TVVariant::String); |
156 | //working_state.setNewFlag(i, TRUE); | 158 | //working_state.setNewFlag(i, TRUE); |
157 | TVKEListViewItem *nItem = new TVKEListViewItem("<New Key>", | 159 | TVKEListViewItem *nItem = new TVKEListViewItem("<New Key>", |
158 | TVVariant::String, | 160 | TVVariant::String, |
159 | i, | 161 | i, |
160 | display); | 162 | display); |
161 | display->setCurrentItem(nItem); | 163 | display->setCurrentItem(nItem); |
162 | setTerm(nItem); | 164 | setTerm(nItem); |
diff --git a/noncore/apps/tinykate/libkate/view/kateview.cpp b/noncore/apps/tinykate/libkate/view/kateview.cpp index af3b30d..794fbdb 100644 --- a/noncore/apps/tinykate/libkate/view/kateview.cpp +++ b/noncore/apps/tinykate/libkate/view/kateview.cpp | |||
@@ -63,48 +63,49 @@ | |||
63 | #include <qfileinfo.h> | 63 | #include <qfileinfo.h> |
64 | #include <qfile.h> | 64 | #include <qfile.h> |
65 | #include <qevent.h> | 65 | #include <qevent.h> |
66 | #include <qdir.h> | 66 | #include <qdir.h> |
67 | #include <qvbox.h> | 67 | #include <qvbox.h> |
68 | #include <qprintdialog.h> | 68 | #include <qprintdialog.h> |
69 | #include <qpaintdevicemetrics.h> | 69 | #include <qpaintdevicemetrics.h> |
70 | #include <qiodevice.h> | 70 | #include <qiodevice.h> |
71 | #include <qbuffer.h> | 71 | #include <qbuffer.h> |
72 | #include <qfocusdata.h> | 72 | #include <qfocusdata.h> |
73 | #include <klocale.h> | 73 | #include <klocale.h> |
74 | #include <kglobal.h> | 74 | #include <kglobal.h> |
75 | #include <kdebug.h> | 75 | #include <kdebug.h> |
76 | #include <kmessagebox.h> | 76 | #include <kmessagebox.h> |
77 | #include <qregexp.h> | 77 | #include <qregexp.h> |
78 | #include <kdialogbase.h> | 78 | #include <kdialogbase.h> |
79 | #include <klineeditdlg.h> | 79 | #include <klineeditdlg.h> |
80 | #include <qapplication.h> | 80 | #include <qapplication.h> |
81 | #include <kfiledialog.h> | 81 | #include <kfiledialog.h> |
82 | #include <kiconloader.h> | 82 | #include <kiconloader.h> |
83 | #include "../document/katetextline.h" | 83 | #include "../document/katetextline.h" |
84 | #include "kateviewdialog.h" | 84 | #include "kateviewdialog.h" |
85 | #include "kateundohistory.h" | 85 | #include "kateundohistory.h" |
86 | #include <qlayout.h> | 86 | #include <qlayout.h> |
87 | #include <qpe/qpeapplication.h> | ||
87 | 88 | ||
88 | KateViewInternal::KateViewInternal(KateView *view, KateDocument *doc) : QWidget(view) | 89 | KateViewInternal::KateViewInternal(KateView *view, KateDocument *doc) : QWidget(view) |
89 | { | 90 | { |
90 | waitForPreHighlight=-1; | 91 | waitForPreHighlight=-1; |
91 | myView = view; | 92 | myView = view; |
92 | myDoc = doc; | 93 | myDoc = doc; |
93 | 94 | ||
94 | iconBorderWidth = 16; | 95 | iconBorderWidth = 16; |
95 | iconBorderHeight = 800; | 96 | iconBorderHeight = 800; |
96 | 97 | ||
97 | QWidget::setCursor(ibeamCursor); | 98 | QWidget::setCursor(ibeamCursor); |
98 | setBackgroundMode(NoBackground); | 99 | setBackgroundMode(NoBackground); |
99 | 100 | ||
100 | setFocusPolicy(StrongFocus); | 101 | setFocusPolicy(StrongFocus); |
101 | 102 | ||
102 | xScroll = new QScrollBar(QScrollBar::Horizontal,myView); | 103 | xScroll = new QScrollBar(QScrollBar::Horizontal,myView); |
103 | yScroll = new QScrollBar(QScrollBar::Vertical,myView); | 104 | yScroll = new QScrollBar(QScrollBar::Vertical,myView); |
104 | connect(xScroll,SIGNAL(valueChanged(int)),SLOT(changeXPos(int))); | 105 | connect(xScroll,SIGNAL(valueChanged(int)),SLOT(changeXPos(int))); |
105 | connect(yScroll,SIGNAL(valueChanged(int)),SLOT(changeYPos(int))); | 106 | connect(yScroll,SIGNAL(valueChanged(int)),SLOT(changeYPos(int))); |
106 | connect(yScroll,SIGNAL(valueChanged(int)),myView,SIGNAL(scrollValueChanged(int))); | 107 | connect(yScroll,SIGNAL(valueChanged(int)),myView,SIGNAL(scrollValueChanged(int))); |
107 | connect( doc, SIGNAL (preHighlightChanged(long)),this,SLOT(slotPreHighlightUpdate(long))); | 108 | connect( doc, SIGNAL (preHighlightChanged(long)),this,SLOT(slotPreHighlightUpdate(long))); |
108 | 109 | ||
109 | xPos = 0; | 110 | xPos = 0; |
110 | yPos = 0; | 111 | yPos = 0; |
@@ -2306,50 +2307,49 @@ void KateView::configDialog() | |||
2306 | (new QVBoxLayout(page))->setAutoAdd(true); | 2307 | (new QVBoxLayout(page))->setAutoAdd(true); |
2307 | 2308 | ||
2308 | EditConfigTab *editConfig = new EditConfigTab(page, this); | 2309 | EditConfigTab *editConfig = new EditConfigTab(page, this); |
2309 | 2310 | ||
2310 | 2311 | ||
2311 | 2312 | ||
2312 | HighlightDialogPage *hlPage; | 2313 | HighlightDialogPage *hlPage; |
2313 | HlManager *hlManager; | 2314 | HlManager *hlManager; |
2314 | HlDataList hlDataList; | 2315 | HlDataList hlDataList; |
2315 | ItemStyleList defaultStyleList; | 2316 | ItemStyleList defaultStyleList; |
2316 | 2317 | ||
2317 | hlManager = HlManager::self(); | 2318 | hlManager = HlManager::self(); |
2318 | 2319 | ||
2319 | defaultStyleList.setAutoDelete(true); | 2320 | defaultStyleList.setAutoDelete(true); |
2320 | hlManager->getDefaults(defaultStyleList); | 2321 | hlManager->getDefaults(defaultStyleList); |
2321 | 2322 | ||
2322 | hlDataList.setAutoDelete(true); | 2323 | hlDataList.setAutoDelete(true); |
2323 | //this gets the data from the KateConfig object | 2324 | //this gets the data from the KateConfig object |
2324 | hlManager->getHlDataList(hlDataList); | 2325 | hlManager->getHlDataList(hlDataList); |
2325 | 2326 | ||
2326 | page=kd->addPage(i18n("Highlighting")); | 2327 | page=kd->addPage(i18n("Highlighting")); |
2327 | (new QVBoxLayout(page))->setAutoAdd(true); | 2328 | (new QVBoxLayout(page))->setAutoAdd(true); |
2328 | 2329 | ||
2329 | hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page); | 2330 | hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page); |
2330 | kd->showMaximized(); | 2331 | if ( QPEApplication::execDialog( kd )) { |
2331 | if (kd->exec()) { | ||
2332 | // color options | 2332 | // color options |
2333 | colorConfig->getColors(colors); | 2333 | colorConfig->getColors(colors); |
2334 | myDoc->setFont (fontConfig->getFont()); | 2334 | myDoc->setFont (fontConfig->getFont()); |
2335 | 2335 | ||
2336 | applyColors(); | 2336 | applyColors(); |
2337 | // indent options | 2337 | // indent options |
2338 | indentConfig->getData(this); | 2338 | indentConfig->getData(this); |
2339 | // select options | 2339 | // select options |
2340 | selectConfig->getData(this); | 2340 | selectConfig->getData(this); |
2341 | // edit options | 2341 | // edit options |
2342 | editConfig->getData(this); | 2342 | editConfig->getData(this); |
2343 | // spell checker | 2343 | // spell checker |
2344 | hlManager->setHlDataList(hlDataList); | 2344 | hlManager->setHlDataList(hlDataList); |
2345 | hlManager->setDefaults(defaultStyleList); | 2345 | hlManager->setDefaults(defaultStyleList); |
2346 | hlPage->saveData(); | 2346 | hlPage->saveData(); |
2347 | } | 2347 | } |
2348 | 2348 | ||
2349 | // delete kd; | 2349 | // delete kd; |
2350 | 2350 | ||
2351 | #endif | 2351 | #endif |
2352 | } | 2352 | } |
2353 | 2353 | ||
2354 | int KateView::getHl() { | 2354 | int KateView::getHl() { |
2355 | return myDoc->highlightNum(); | 2355 | return myDoc->highlightNum(); |
diff --git a/noncore/apps/zsafe/scqtfileedit.cpp b/noncore/apps/zsafe/scqtfileedit.cpp index effd86b..7a3d906 100644 --- a/noncore/apps/zsafe/scqtfileedit.cpp +++ b/noncore/apps/zsafe/scqtfileedit.cpp | |||
@@ -7,48 +7,50 @@ | |||
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /* $Id$ */ | 9 | /* $Id$ */ |
10 | 10 | ||
11 | /*************************************************************************** | 11 | /*************************************************************************** |
12 | * * | 12 | * * |
13 | * This program is free software; you can redistribute it and/or modify * | 13 | * This program is free software; you can redistribute it and/or modify * |
14 | * it under the terms of the GNU General Public License as published by * | 14 | * it under the terms of the GNU General Public License as published by * |
15 | * the Free Software Foundation; either version 2 of the License, or * | 15 | * the Free Software Foundation; either version 2 of the License, or * |
16 | * (at your option) any later version. * | 16 | * (at your option) any later version. * |
17 | * * | 17 | * * |
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | #include <stdio.h> | 19 | #include <stdio.h> |
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | 21 | ||
22 | #include "qdir.h" | 22 | #include "qdir.h" |
23 | #include "qdialog.h" | 23 | #include "qdialog.h" |
24 | #include "qpixmap.h" | 24 | #include "qpixmap.h" |
25 | #include "qlistview.h" | 25 | #include "qlistview.h" |
26 | #include "qlineedit.h" | 26 | #include "qlineedit.h" |
27 | #include "qtoolbutton.h" | 27 | #include "qtoolbutton.h" |
28 | 28 | ||
29 | #include "scqtfileedit.h" | 29 | #include "scqtfileedit.h" |
30 | 30 | ||
31 | #include <qpe/qpeapplication.h> | ||
32 | |||
31 | // #define DEBUGFILEEDIT | 33 | // #define DEBUGFILEEDIT |
32 | 34 | ||
33 | /* XPM */ | 35 | /* XPM */ |
34 | static const char* const file_xpm[]={ | 36 | static const char* const file_xpm[]={ |
35 | "16 16 5 1", | 37 | "16 16 5 1", |
36 | ". c #7f7f7f", | 38 | ". c #7f7f7f", |
37 | "# c None", | 39 | "# c None", |
38 | "c c #000000", | 40 | "c c #000000", |
39 | "b c #bfbfbf", | 41 | "b c #bfbfbf", |
40 | "a c #ffffff", | 42 | "a c #ffffff", |
41 | "################", | 43 | "################", |
42 | "..........######", | 44 | "..........######", |
43 | ".aaaaaaaab.#####", | 45 | ".aaaaaaaab.#####", |
44 | ".aaaaaaaaba.####", | 46 | ".aaaaaaaaba.####", |
45 | ".aaaaaaaacccc###", | 47 | ".aaaaaaaacccc###", |
46 | ".aaaaaaaaaabc###", | 48 | ".aaaaaaaaaabc###", |
47 | ".aaaaaaaaaabc###", | 49 | ".aaaaaaaaaabc###", |
48 | ".aaaaaaaaaabc###", | 50 | ".aaaaaaaaaabc###", |
49 | ".aaaaaaaaaabc###", | 51 | ".aaaaaaaaaabc###", |
50 | ".aaaaaaaaaabc###", | 52 | ".aaaaaaaaaabc###", |
51 | ".aaaaaaaaaabc###", | 53 | ".aaaaaaaaaabc###", |
52 | ".aaaaaaaaaabc###", | 54 | ".aaaaaaaaaabc###", |
53 | ".aaaaaaaaaabc###", | 55 | ".aaaaaaaaaabc###", |
54 | ".aaaaaaaaaabc###", | 56 | ".aaaaaaaaaabc###", |
@@ -137,49 +139,49 @@ ScQtFileEditDlg::ScQtFileEditDlg( QWidget *parent, const char *name, | |||
137 | { | 139 | { |
138 | // ListView->setRootIsDecorated ( TRUE ); | 140 | // ListView->setRootIsDecorated ( TRUE ); |
139 | 141 | ||
140 | #ifdef DEBUGFILEEDIT | 142 | #ifdef DEBUGFILEEDIT |
141 | printf ("\nScQtFileEditDlg:: constructor name=%s", name ); | 143 | printf ("\nScQtFileEditDlg:: constructor name=%s", name ); |
142 | printf ("\n path=%s", (const char *)path ); | 144 | printf ("\n path=%s", (const char *)path ); |
143 | printf ("\n filter=%s", (const char *)filter ); | 145 | printf ("\n filter=%s", (const char *)filter ); |
144 | printf ("\n parent=%p", parent ); | 146 | printf ("\n parent=%p", parent ); |
145 | fflush(stdout); | 147 | fflush(stdout); |
146 | #endif | 148 | #endif |
147 | 149 | ||
148 | bpath = path; | 150 | bpath = path; |
149 | bfilter = filter; | 151 | bfilter = filter; |
150 | exflag = false; | 152 | exflag = false; |
151 | 153 | ||
152 | ListView->setAllColumnsShowFocus( TRUE ); | 154 | ListView->setAllColumnsShowFocus( TRUE ); |
153 | ListView->setColumnAlignment( 1, Qt::AlignRight ); | 155 | ListView->setColumnAlignment( 1, Qt::AlignRight ); |
154 | 156 | ||
155 | fileIcon = new QPixmap( (const char **)file_xpm); | 157 | fileIcon = new QPixmap( (const char **)file_xpm); |
156 | dirIcon = new QPixmap( (const char **)closed_xpm); | 158 | dirIcon = new QPixmap( (const char **)closed_xpm); |
157 | linkIcon = new QPixmap( (const char **)link_file_xpm); | 159 | linkIcon = new QPixmap( (const char **)link_file_xpm); |
158 | cdToParentIcon = new QPixmap( (const char **)cdtoparent_xpm); | 160 | cdToParentIcon = new QPixmap( (const char **)cdtoparent_xpm); |
159 | 161 | ||
160 | #ifdef QWS | 162 | #ifdef QWS |
161 | showMaximized(); | 163 | QPEApplication::execDialog( this ); |
162 | #endif | 164 | #endif |
163 | 165 | ||
164 | mkdirflag = false; | 166 | mkdirflag = false; |
165 | MkDirButton->setEnabled( false ); | 167 | MkDirButton->setEnabled( false ); |
166 | 168 | ||
167 | initDirCombo( bpath ); | 169 | initDirCombo( bpath ); |
168 | initTypeCombo( bfilter ); | 170 | initTypeCombo( bfilter ); |
169 | 171 | ||
170 | dirstr = tr("dir"); | 172 | dirstr = tr("dir"); |
171 | filestr = tr("file"); | 173 | filestr = tr("file"); |
172 | linkstr = tr("link"); | 174 | linkstr = tr("link"); |
173 | 175 | ||
174 | rFlag = false; | 176 | rFlag = false; |
175 | 177 | ||
176 | showTimer.stop(); | 178 | showTimer.stop(); |
177 | connect( &showTimer, SIGNAL(timeout()), SLOT( slotShowDir() ) ); | 179 | connect( &showTimer, SIGNAL(timeout()), SLOT( slotShowDir() ) ); |
178 | 180 | ||
179 | fmode = QDir::All; | 181 | fmode = QDir::All; |
180 | fnfilter = false; | 182 | fnfilter = false; |
181 | fsorting = false; | 183 | fsorting = false; |
182 | 184 | ||
183 | } | 185 | } |
184 | 186 | ||
185 | ScQtFileEditDlg::~ScQtFileEditDlg() | 187 | ScQtFileEditDlg::~ScQtFileEditDlg() |
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index ee1da77..bdd2aed 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -754,56 +754,50 @@ void ZSafe::editPwd() | |||
754 | NewDialog *dialog = new NewDialog(this, tr("Edit Entry"), TRUE); | 754 | NewDialog *dialog = new NewDialog(this, tr("Edit Entry"), TRUE); |
755 | #ifdef WIN32 | 755 | #ifdef WIN32 |
756 | dialog->setCaption ("Qt " + tr("Edit Entry")); | 756 | dialog->setCaption ("Qt " + tr("Edit Entry")); |
757 | dialog->setGeometry(200, 250, 220, 310 ); | 757 | dialog->setGeometry(200, 250, 220, 310 ); |
758 | #endif | 758 | #endif |
759 | 759 | ||
760 | // set the labels | 760 | // set the labels |
761 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); | 761 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); |
762 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); | 762 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); |
763 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); | 763 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); |
764 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); | 764 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); |
765 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); | 765 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); |
766 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); | 766 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); |
767 | 767 | ||
768 | // set the fields | 768 | // set the fields |
769 | dialog->NameField->setText(selectedItem->text (0)); | 769 | dialog->NameField->setText(selectedItem->text (0)); |
770 | dialog->UsernameField->setText(selectedItem->text (1)); | 770 | dialog->UsernameField->setText(selectedItem->text (1)); |
771 | dialog->PasswordField->setText(selectedItem->text (2)); | 771 | dialog->PasswordField->setText(selectedItem->text (2)); |
772 | QString comment = selectedItem->text (3); | 772 | QString comment = selectedItem->text (3); |
773 | comment.replace (QRegExp("<br>"), "\n"); | 773 | comment.replace (QRegExp("<br>"), "\n"); |
774 | dialog->Field5->setText(selectedItem->text (4)); | 774 | dialog->Field5->setText(selectedItem->text (4)); |
775 | dialog->Field6->setText(selectedItem->text (5)); | 775 | dialog->Field6->setText(selectedItem->text (5)); |
776 | dialog->CommentField->insertLine(comment); | 776 | dialog->CommentField->insertLine(comment); |
777 | dialog->CommentField->setCursorPosition(0,0); | 777 | dialog->CommentField->setCursorPosition(0,0); |
778 | #ifdef DESKTOP | 778 | |
779 | #ifndef WIN32 | 779 | DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); |
780 | dialog->show(); | ||
781 | #endif | ||
782 | #else | ||
783 | dialog->showMaximized(); | ||
784 | #endif | ||
785 | DialogCode result = (DialogCode) dialog->exec(); | ||
786 | 780 | ||
787 | #ifdef DESKTOP | 781 | #ifdef DESKTOP |
788 | result = Accepted; | 782 | result = Accepted; |
789 | #endif | 783 | #endif |
790 | if (result == Accepted) | 784 | if (result == Accepted) |
791 | { | 785 | { |
792 | modified = true; | 786 | modified = true; |
793 | // edit the selected item | 787 | // edit the selected item |
794 | QString name = dialog->NameField->text(); | 788 | QString name = dialog->NameField->text(); |
795 | selectedItem->setText (0, tr (name)); | 789 | selectedItem->setText (0, tr (name)); |
796 | QString user = dialog->UsernameField->text(); | 790 | QString user = dialog->UsernameField->text(); |
797 | selectedItem->setText (1, tr (user)); | 791 | selectedItem->setText (1, tr (user)); |
798 | QString pwd = dialog->PasswordField->text(); | 792 | QString pwd = dialog->PasswordField->text(); |
799 | selectedItem->setText (2, tr (pwd)); | 793 | selectedItem->setText (2, tr (pwd)); |
800 | QString comment = dialog->CommentField->text(); | 794 | QString comment = dialog->CommentField->text(); |
801 | comment.replace (QRegExp("\n"), "<br>"); | 795 | comment.replace (QRegExp("\n"), "<br>"); |
802 | selectedItem->setText (3, tr (comment)); | 796 | selectedItem->setText (3, tr (comment)); |
803 | QString f5 = dialog->Field5->text(); | 797 | QString f5 = dialog->Field5->text(); |
804 | selectedItem->setText (4, tr (f5)); | 798 | selectedItem->setText (4, tr (f5)); |
805 | QString f6 = dialog->Field6->text(); | 799 | QString f6 = dialog->Field6->text(); |
806 | selectedItem->setText (5, tr (f6)); | 800 | selectedItem->setText (5, tr (f6)); |
807 | } | 801 | } |
808 | 802 | ||
809 | delete dialog; | 803 | delete dialog; |
@@ -819,56 +813,50 @@ void ZSafe::newPwd() | |||
819 | if (!selectedItem) | 813 | if (!selectedItem) |
820 | return; | 814 | return; |
821 | 815 | ||
822 | if (!isCategory(selectedItem)) | 816 | if (!isCategory(selectedItem)) |
823 | selectedItem = selectedItem->parent(); | 817 | selectedItem = selectedItem->parent(); |
824 | 818 | ||
825 | if (isCategory(selectedItem)) | 819 | if (isCategory(selectedItem)) |
826 | { | 820 | { |
827 | QString cat = selectedItem->text(0); | 821 | QString cat = selectedItem->text(0); |
828 | 822 | ||
829 | // open the 'New Entry' dialog | 823 | // open the 'New Entry' dialog |
830 | NewDialog *dialog = new NewDialog(this, tr("New Entry"), TRUE); | 824 | NewDialog *dialog = new NewDialog(this, tr("New Entry"), TRUE); |
831 | #ifdef WIN32 | 825 | #ifdef WIN32 |
832 | dialog->setCaption ("Qt " + tr("New Entry")); | 826 | dialog->setCaption ("Qt " + tr("New Entry")); |
833 | dialog->setGeometry(200, 250, 220, 310 ); | 827 | dialog->setGeometry(200, 250, 220, 310 ); |
834 | #endif | 828 | #endif |
835 | // set the labels | 829 | // set the labels |
836 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); | 830 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); |
837 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); | 831 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); |
838 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); | 832 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); |
839 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); | 833 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); |
840 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); | 834 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); |
841 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); | 835 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); |
842 | retype: | 836 | retype: |
843 | #ifdef DESKTOP | 837 | |
844 | #ifndef WIN32 | 838 | DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); |
845 | dialog->show(); | ||
846 | #endif | ||
847 | #else | ||
848 | dialog->showMaximized(); | ||
849 | #endif | ||
850 | DialogCode result = (DialogCode) dialog->exec(); | ||
851 | #ifdef DESKTOP | 839 | #ifdef DESKTOP |
852 | result = Accepted; | 840 | result = Accepted; |
853 | #endif | 841 | #endif |
854 | 842 | ||
855 | if (result == Accepted) | 843 | if (result == Accepted) |
856 | { | 844 | { |
857 | 845 | ||
858 | QString name = dialog->NameField->text(); | 846 | QString name = dialog->NameField->text(); |
859 | if (cat == name) | 847 | if (cat == name) |
860 | { | 848 | { |
861 | QMessageBox::critical( 0, tr("ZSafe"), | 849 | QMessageBox::critical( 0, tr("ZSafe"), |
862 | tr("Entry name must be different\nfrom the category name.") ); | 850 | tr("Entry name must be different\nfrom the category name.") ); |
863 | goto retype; // it's not a good programming style :-) | 851 | goto retype; // it's not a good programming style :-) |
864 | } | 852 | } |
865 | 853 | ||
866 | modified = true; | 854 | modified = true; |
867 | // add the new item | 855 | // add the new item |
868 | QListViewItem *i = new ShadedListItem (0, selectedItem); | 856 | QListViewItem *i = new ShadedListItem (0, selectedItem); |
869 | i->setOpen (TRUE); | 857 | i->setOpen (TRUE); |
870 | 858 | ||
871 | i->setText (0, tr (name)); | 859 | i->setText (0, tr (name)); |
872 | QString user = dialog->UsernameField->text(); | 860 | QString user = dialog->UsernameField->text(); |
873 | i->setText (1, tr (user)); | 861 | i->setText (1, tr (user)); |
874 | QString pwd = dialog->PasswordField->text(); | 862 | QString pwd = dialog->PasswordField->text(); |
@@ -1167,54 +1155,49 @@ void ZSafe::showInfo( QListViewItem *_item) | |||
1167 | text += "<u><b>"; | 1155 | text += "<u><b>"; |
1168 | text += getFieldLabel (selectedItem, "6", tr("Field 5")); | 1156 | text += getFieldLabel (selectedItem, "6", tr("Field 5")); |
1169 | text += ":<br> </b></u><blockquote>"; | 1157 | text += ":<br> </b></u><blockquote>"; |
1170 | text += entry; | 1158 | text += entry; |
1171 | text += "</blockquote>"; | 1159 | text += "</blockquote>"; |
1172 | // text += "<br>"; | 1160 | // text += "<br>"; |
1173 | } | 1161 | } |
1174 | 1162 | ||
1175 | entry = selectedItem->text(3); | 1163 | entry = selectedItem->text(3); |
1176 | if (!entry.isEmpty() && entry.compare(" ")) | 1164 | if (!entry.isEmpty() && entry.compare(" ")) |
1177 | { | 1165 | { |
1178 | text += "<u><b>"; | 1166 | text += "<u><b>"; |
1179 | text += getFieldLabel (selectedItem, "4", tr("Comment")); | 1167 | text += getFieldLabel (selectedItem, "4", tr("Comment")); |
1180 | text += ":<br> </b></u>"; | 1168 | text += ":<br> </b></u>"; |
1181 | QString comment = selectedItem->text(3); | 1169 | QString comment = selectedItem->text(3); |
1182 | comment.replace (QRegExp("\n"), "<br>"); | 1170 | comment.replace (QRegExp("\n"), "<br>"); |
1183 | text += comment; | 1171 | text += comment; |
1184 | // text += "<br>"; | 1172 | // text += "<br>"; |
1185 | } | 1173 | } |
1186 | 1174 | ||
1187 | text += "</body></html>"; | 1175 | text += "</body></html>"; |
1188 | 1176 | ||
1189 | infoForm->InfoText->setText(text); | 1177 | infoForm->InfoText->setText(text); |
1190 | infoForm->hide(); | 1178 | infoForm->hide(); |
1191 | #ifdef DESKTOP | 1179 | QPEApplication::showDialog( infoForm ); |
1192 | infoForm->show(); | ||
1193 | #else | ||
1194 | infoForm->showMaximized(); | ||
1195 | #endif | ||
1196 | |||
1197 | } | 1180 | } |
1198 | } | 1181 | } |
1199 | 1182 | ||
1200 | void ZSafe::listViewSelected( QListViewItem *_item) | 1183 | void ZSafe::listViewSelected( QListViewItem *_item) |
1201 | { | 1184 | { |
1202 | if (!_item) | 1185 | if (!_item) |
1203 | return; | 1186 | return; |
1204 | if (selectedItem != NULL) | 1187 | if (selectedItem != NULL) |
1205 | selectedItem->setSelected(FALSE); | 1188 | selectedItem->setSelected(FALSE); |
1206 | 1189 | ||
1207 | selectedItem = _item; | 1190 | selectedItem = _item; |
1208 | 1191 | ||
1209 | #ifndef DESKTOP | 1192 | #ifndef DESKTOP |
1210 | // set the column text dependent on the selected item | 1193 | // set the column text dependent on the selected item |
1211 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); | 1194 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); |
1212 | ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2"))); | 1195 | ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2"))); |
1213 | ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3"))); | 1196 | ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3"))); |
1214 | ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment"))); | 1197 | ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment"))); |
1215 | ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4"))); | 1198 | ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4"))); |
1216 | ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); | 1199 | ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); |
1217 | #endif | 1200 | #endif |
1218 | #ifdef WIN32 | 1201 | #ifdef WIN32 |
1219 | // set the column text dependent on the selected item | 1202 | // set the column text dependent on the selected item |
1220 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); | 1203 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); |
diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp index 25c8919..2fa8d1f 100644 --- a/noncore/comm/keypebble/kvnc.cpp +++ b/noncore/comm/keypebble/kvnc.cpp | |||
@@ -106,66 +106,63 @@ KVNC::KVNC( QWidget *parent, const char *name, WFlags f) : QMainWindow( 0, name | |||
106 | 106 | ||
107 | QAction *o = new QAction( tr( "Open Bookmark" ), Resource::loadPixmap( "fileopen" ), | 107 | QAction *o = new QAction( tr( "Open Bookmark" ), Resource::loadPixmap( "fileopen" ), |
108 | QString::null, 0, this, 0 ); | 108 | QString::null, 0, this, 0 ); |
109 | connect( o, SIGNAL( activated() ), | 109 | connect( o, SIGNAL( activated() ), |
110 | this, SLOT( openConnection() ) ); | 110 | this, SLOT( openConnection() ) ); |
111 | o->addTo( bar ); | 111 | o->addTo( bar ); |
112 | 112 | ||
113 | QAction *d = new QAction( tr( "Delete Bookmark" ), Resource::loadPixmap( "trash" ), | 113 | QAction *d = new QAction( tr( "Delete Bookmark" ), Resource::loadPixmap( "trash" ), |
114 | QString::null, 0, this, 0 ); | 114 | QString::null, 0, this, 0 ); |
115 | connect( d, SIGNAL( activated() ), | 115 | connect( d, SIGNAL( activated() ), |
116 | this, SLOT( deleteBookmark() ) ); | 116 | this, SLOT( deleteBookmark() ) ); |
117 | d->addTo( bar ); | 117 | d->addTo( bar ); |
118 | } | 118 | } |
119 | 119 | ||
120 | KVNC::~KVNC() | 120 | KVNC::~KVNC() |
121 | { | 121 | { |
122 | 122 | ||
123 | } | 123 | } |
124 | 124 | ||
125 | void KVNC::newConnection() | 125 | void KVNC::newConnection() |
126 | { | 126 | { |
127 | curServer=new KRFBServer; | 127 | curServer=new KRFBServer; |
128 | 128 | ||
129 | KVNCConnDlg dlg( curServer,this); | 129 | KVNCConnDlg dlg( curServer,this); |
130 | dlg.showMaximized(); | 130 | if ( QPEApplication::execDialog( &dlg )) { |
131 | if (dlg.exec()) { | ||
132 | if (!curServer->name.isEmpty()) | 131 | if (!curServer->name.isEmpty()) |
133 | bookmarkSelector->addBookmark(curServer); | 132 | bookmarkSelector->addBookmark(curServer); |
134 | canvas->openConnection(*curServer); | 133 | canvas->openConnection(*curServer); |
135 | } else | 134 | } else |
136 | curServer=0; | 135 | curServer=0; |
137 | } | 136 | } |
138 | 137 | ||
139 | void KVNC::openConnection( QString name) | 138 | void KVNC::openConnection( QString name) |
140 | { | 139 | { |
141 | curServer=bookmarkSelector->getServer(name); | 140 | curServer=bookmarkSelector->getServer(name); |
142 | 141 | ||
143 | if (curServer) { | 142 | if (curServer) { |
144 | KVNCConnDlg dlg( curServer,this); | 143 | KVNCConnDlg dlg( curServer,this); |
145 | dlg.showMaximized(); | 144 | if ( QPEApplication::execDialog( &dlg ) ) { |
146 | |||
147 | if ( dlg.exec() ) { | ||
148 | canvas->openConnection(*curServer); | 145 | canvas->openConnection(*curServer); |
149 | bookmarkSelector->writeBookmarks(); | 146 | bookmarkSelector->writeBookmarks(); |
150 | } else | 147 | } else |
151 | curServer=0; | 148 | curServer=0; |
152 | } | 149 | } |
153 | } | 150 | } |
154 | 151 | ||
155 | void KVNC::openConnection( void ) | 152 | void KVNC::openConnection( void ) |
156 | { | 153 | { |
157 | openConnection( bookmarkSelector->selectedBookmark()); | 154 | openConnection( bookmarkSelector->selectedBookmark()); |
158 | } | 155 | } |
159 | 156 | ||
160 | void KVNC::openConnection( QListBoxItem * item) | 157 | void KVNC::openConnection( QListBoxItem * item) |
161 | { | 158 | { |
162 | if (item) | 159 | if (item) |
163 | openConnection(item->text()); | 160 | openConnection(item->text()); |
164 | } | 161 | } |
165 | 162 | ||
166 | void KVNC::setupActions() | 163 | void KVNC::setupActions() |
167 | { | 164 | { |
168 | cornerMenu = new QPopupMenu( this ); | 165 | cornerMenu = new QPopupMenu( this ); |
169 | 166 | ||
170 | fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 ); | 167 | fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 ); |
171 | connect( fullScreenAction, SIGNAL(activated()), | 168 | connect( fullScreenAction, SIGNAL(activated()), |