-rw-r--r-- | core/launcher/launcher.cpp | 289 | ||||
-rw-r--r-- | core/pim/today/changelog | 1 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 6 |
3 files changed, 148 insertions, 148 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index a0f04f1..59b38e3 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -513,116 +513,116 @@ void Launcher::showMaximized() | |||
513 | } | 513 | } |
514 | 514 | ||
515 | void Launcher::doMaximize() | 515 | void Launcher::doMaximize() |
516 | { | 516 | { |
517 | QMainWindow::showMaximized(); | 517 | QMainWindow::showMaximized(); |
518 | } | 518 | } |
519 | 519 | ||
520 | void Launcher::updateMimeTypes() | 520 | void Launcher::updateMimeTypes() |
521 | { | 521 | { |
522 | MimeType::clear(); | 522 | MimeType::clear(); |
523 | updateMimeTypes(rootFolder); | 523 | updateMimeTypes(rootFolder); |
524 | } | 524 | } |
525 | 525 | ||
526 | void Launcher::updateMimeTypes(AppLnkSet* folder) | 526 | void Launcher::updateMimeTypes(AppLnkSet* folder) |
527 | { | 527 | { |
528 | for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) { | 528 | for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) { |
529 | AppLnk *app = it.current(); | 529 | AppLnk *app = it.current(); |
530 | if ( app->type() == "Folder" ) | 530 | if ( app->type() == "Folder" ) |
531 | updateMimeTypes((AppLnkSet *)app); | 531 | updateMimeTypes((AppLnkSet *)app); |
532 | else { | 532 | else { |
533 | MimeType::registerApp(*app); | 533 | MimeType::registerApp(*app); |
534 | } | 534 | } |
535 | } | 535 | } |
536 | } | 536 | } |
537 | /** This is a HACK.... | 537 | /** This is a HACK.... |
538 | * Reason: scanning huge mediums, microdirvers for examples | 538 | * Reason: scanning huge mediums, microdirvers for examples |
539 | * consomes time. To avoid that we invented the MediumMountCheck | 539 | * consomes time. To avoid that we invented the MediumMountCheck |
540 | * | 540 | * |
541 | * a) the user globally disabled medium checking. We can ignore | 541 | * a) the user globally disabled medium checking. We can ignore |
542 | * all removable medium | 542 | * all removable medium |
543 | * b) the user enabled medium checking globally and we need to use this mimefilter | 543 | * b) the user enabled medium checking globally and we need to use this mimefilter |
544 | * c) the user enabled medium checking on a per medium bases | 544 | * c) the user enabled medium checking on a per medium bases |
545 | * c1) we already checked and its not ask again turns | 545 | * c1) we already checked and its not ask again turns |
546 | * c2) we need to ask and then apply the mimefilter | 546 | * c2) we need to ask and then apply the mimefilter |
547 | */ | 547 | */ |
548 | void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | 548 | void Launcher::loadDocs() // ok here comes a hack belonging to Global:: |
549 | { | 549 | { |
550 | delete docsFolder; | 550 | delete docsFolder; |
551 | docsFolder = new DocLnkSet; | 551 | docsFolder = new DocLnkSet; |
552 | 552 | ||
553 | DocLnkSet *tmp = 0; | 553 | DocLnkSet *tmp = 0; |
554 | QString home = QString(getenv("HOME")) + "/Documents"; | 554 | QString home = QString(getenv("HOME")) + "/Documents"; |
555 | tmp = new DocLnkSet( home , QString::null); | 555 | tmp = new DocLnkSet( home , QString::null); |
556 | docsFolder->appendFrom( *tmp ); | 556 | docsFolder->appendFrom( *tmp ); |
557 | delete tmp; | 557 | delete tmp; |
558 | 558 | ||
559 | Config mediumCfg( "medium"); | 559 | Config mediumCfg( "medium"); |
560 | mediumCfg.setGroup("main"); | 560 | mediumCfg.setGroup("main"); |
561 | // a) -zecke we don't want to check | 561 | // a) -zecke we don't want to check |
562 | if(!mediumCfg.readBoolEntry("use", true ) ) | 562 | if(!mediumCfg.readBoolEntry("use", true ) ) |
563 | return; | 563 | return; |
564 | 564 | ||
565 | // find out wich filesystems are new in this round | 565 | // find out wich filesystems are new in this round |
566 | // We will do this by having a timestamp inside each mountpoint | 566 | // We will do this by having a timestamp inside each mountpoint |
567 | // if the current timestamp doesn't match this is a new file system and | 567 | // if the current timestamp doesn't match this is a new file system and |
568 | // come up with our MediumMountGui :) let the hacking begin | 568 | // come up with our MediumMountGui :) let the hacking begin |
569 | int stamp = uidgen.generate(); | 569 | int stamp = uidgen.generate(); |
570 | 570 | ||
571 | QString newStamp = QString::number( stamp ); // generates newtime Stamp | 571 | QString newStamp = QString::number( stamp ); // generates newtime Stamp |
572 | StorageInfo storage; | 572 | StorageInfo storage; |
573 | const QList<FileSystem> &fileSystems = storage.fileSystems(); | 573 | const QList<FileSystem> &fileSystems = storage.fileSystems(); |
574 | QListIterator<FileSystem> it ( fileSystems ); | 574 | QListIterator<FileSystem> it ( fileSystems ); |
575 | 575 | ||
576 | // b) | 576 | // b) |
577 | if( mediumCfg.readBoolEntry("global", true ) ){ | 577 | if( mediumCfg.readBoolEntry("global", true ) ){ |
578 | QString mime = configToMime(&mediumCfg).join(";"); | 578 | QString mime = configToMime(&mediumCfg).join(";"); |
579 | for( ; it.current(); ++it ){ | 579 | for( ; it.current(); ++it ){ |
580 | if( (*it)->isRemovable() ){ | 580 | if( (*it)->isRemovable() ){ |
581 | tmp = new DocLnkSet( (*it)->path(), mime ); | 581 | tmp = new DocLnkSet( (*it)->path(), mime ); |
582 | docsFolder->appendFrom( *tmp ); | 582 | docsFolder->appendFrom( *tmp ); |
583 | delete tmp; | 583 | delete tmp; |
584 | } | 584 | } |
585 | } // done | 585 | } // done |
586 | return; // save the else | 586 | return; // save the else |
587 | } | 587 | } |
588 | // c) zecke | 588 | // c) zecke |
589 | for ( ; it.current(); ++it ) { | 589 | for ( ; it.current(); ++it ) { |
590 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it | 590 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it |
591 | Config cfg( (*it)->path() + "/.opiestorage.cf", Config::File); | 591 | Config cfg( (*it)->path() + "/.opiestorage.cf", Config::File); |
592 | cfg.setGroup("main"); | 592 | cfg.setGroup("main"); |
593 | QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() ); | 593 | QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() ); |
594 | /** This medium is uptodate | 594 | /** This medium is uptodate |
595 | */ | 595 | */ |
596 | if( stamp == m_timeStamp ){ // ok we know this card | 596 | if( stamp == m_timeStamp ){ // ok we know this card |
597 | cfg.writeEntry("timestamp", newStamp ); //just write a new timestamp | 597 | cfg.writeEntry("timestamp", newStamp ); //just write a new timestamp |
598 | // we need to scan the list now. Hopefully the cache will be there | 598 | // we need to scan the list now. Hopefully the cache will be there |
599 | // read the mimetypes from the config and search for documents | 599 | // read the mimetypes from the config and search for documents |
600 | QStringList mimetypes = configToMime( &cfg); | 600 | QStringList mimetypes = configToMime( &cfg); |
601 | tmp = new DocLnkSet( (*it)->path(), mimetypes.join(";") ); | 601 | tmp = new DocLnkSet( (*it)->path(), mimetypes.join(";") ); |
602 | docsFolder->appendFrom( *tmp ); | 602 | docsFolder->appendFrom( *tmp ); |
603 | delete tmp; | 603 | delete tmp; |
604 | 604 | ||
605 | }else{ // come up with the gui cause this a new card | 605 | }else{ // come up with the gui cause this a new card |
606 | MediumMountGui medium(&cfg, (*it)->path() ); | 606 | MediumMountGui medium(&cfg, (*it)->path() ); |
607 | if( medium.check() ){ // we did not ask before or ask again is off | 607 | if( medium.check() ){ // we did not ask before or ask again is off |
608 | /** c2) */ | 608 | /** c2) */ |
609 | if( medium.exec() ){ // he clicked yes so search it | 609 | if( medium.exec() ){ // he clicked yes so search it |
610 | // speicher | 610 | // speicher |
611 | //cfg.read(); // cause of a race we need to reread - fixed | 611 | //cfg.read(); // cause of a race we need to reread - fixed |
612 | cfg.setGroup("main"); | 612 | cfg.setGroup("main"); |
613 | cfg.writeEntry("timestamp", newStamp ); | 613 | cfg.writeEntry("timestamp", newStamp ); |
614 | cfg.write(); | 614 | cfg.write(); |
615 | tmp = new DocLnkSet( (*it)->path(), medium.mimeTypes().join(";" ) ); | 615 | tmp = new DocLnkSet( (*it)->path(), medium.mimeTypes().join(";" ) ); |
616 | docsFolder->appendFrom( *tmp ); | 616 | docsFolder->appendFrom( *tmp ); |
617 | delete tmp; | 617 | delete tmp; |
618 | }// no else | 618 | }// no else |
619 | /** c1) */ | 619 | /** c1) */ |
620 | }else{ // we checked | 620 | }else{ // we checked |
621 | // do something different see what we need to do | 621 | // do something different see what we need to do |
622 | // let's see if we should check the device | 622 | // let's see if we should check the device |
623 | cfg.setGroup("main" ); | 623 | cfg.setGroup("main" ); |
624 | bool check = cfg.readBoolEntry("autocheck", true ); | 624 | bool check = cfg.readBoolEntry("autocheck", true ); |
625 | if( check ){ // find the documents | 625 | if( check ){ // find the documents |
626 | tmp = new DocLnkSet( (*it)->path(), configToMime(&cfg ).join(";") ); | 626 | tmp = new DocLnkSet( (*it)->path(), configToMime(&cfg ).join(";") ); |
627 | docsFolder->appendFrom( *tmp ); | 627 | docsFolder->appendFrom( *tmp ); |
628 | delete tmp; | 628 | delete tmp; |
@@ -697,249 +697,248 @@ void Launcher::properties( AppLnk *appLnk ) | |||
697 | connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); | 697 | connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); |
698 | prop.showMaximized(); | 698 | prop.showMaximized(); |
699 | prop.exec(); | 699 | prop.exec(); |
700 | in_lnk_props = FALSE; | 700 | in_lnk_props = FALSE; |
701 | if ( got_lnk_change ) { | 701 | if ( got_lnk_change ) { |
702 | updateLink(lnk_change); | 702 | updateLink(lnk_change); |
703 | } | 703 | } |
704 | } | 704 | } |
705 | } | 705 | } |
706 | 706 | ||
707 | void Launcher::updateLink(const QString& link) | 707 | void Launcher::updateLink(const QString& link) |
708 | { | 708 | { |
709 | if (link.isNull()) | 709 | if (link.isNull()) |
710 | updateTabs(); | 710 | updateTabs(); |
711 | else if (link.isEmpty()) | 711 | else if (link.isEmpty()) |
712 | updateDocs(); | 712 | updateDocs(); |
713 | else | 713 | else |
714 | tabs->updateLink(link); | 714 | tabs->updateLink(link); |
715 | } | 715 | } |
716 | 716 | ||
717 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | 717 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) |
718 | { | 718 | { |
719 | QDataStream stream( data, IO_ReadOnly ); | 719 | QDataStream stream( data, IO_ReadOnly ); |
720 | if ( msg == "closing(QString)" ){ | 720 | if ( msg == "closing(QString)" ){ |
721 | QString app; | 721 | QString app; |
722 | stream >> app; | 722 | stream >> app; |
723 | qWarning("app closed %s", app.latin1() ); | 723 | qWarning("app closed %s", app.latin1() ); |
724 | MRUList::removeTask( app ); | 724 | MRUList::removeTask( app ); |
725 | }else if ( msg == "linkChanged(QString)" ) { | 725 | }else if ( msg == "linkChanged(QString)" ) { |
726 | QString link; | 726 | QString link; |
727 | stream >> link; | 727 | stream >> link; |
728 | if ( in_lnk_props ) { | 728 | if ( in_lnk_props ) { |
729 | got_lnk_change = TRUE; | 729 | got_lnk_change = TRUE; |
730 | lnk_change = link; | 730 | lnk_change = link; |
731 | } else { | 731 | } else { |
732 | updateLink(link); | 732 | updateLink(link); |
733 | } | 733 | } |
734 | } else if ( msg == "busy()" ) { | 734 | } else if ( msg == "busy()" ) { |
735 | emit busy(); | 735 | emit busy(); |
736 | } else if ( msg == "notBusy(QString)" ) { | 736 | } else if ( msg == "notBusy(QString)" ) { |
737 | QString app; | 737 | QString app; |
738 | stream >> app; | 738 | stream >> app; |
739 | tabs->setBusy(FALSE); | 739 | tabs->setBusy(FALSE); |
740 | emit notBusy(app); | 740 | emit notBusy(app); |
741 | } else if ( msg == "mkdir(QString)" ) { | 741 | } else if ( msg == "mkdir(QString)" ) { |
742 | QString dir; | 742 | QString dir; |
743 | stream >> dir; | 743 | stream >> dir; |
744 | if ( !dir.isEmpty() ) | 744 | if ( !dir.isEmpty() ) |
745 | mkdir( dir ); | 745 | mkdir( dir ); |
746 | } else if ( msg == "rdiffGenSig(QString,QString)" ) { | 746 | } else if ( msg == "rdiffGenSig(QString,QString)" ) { |
747 | QString baseFile, sigFile; | 747 | QString baseFile, sigFile; |
748 | stream >> baseFile >> sigFile; | 748 | stream >> baseFile >> sigFile; |
749 | QRsync::generateSignature( baseFile, sigFile ); | 749 | QRsync::generateSignature( baseFile, sigFile ); |
750 | } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) { | 750 | } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) { |
751 | QString baseFile, sigFile, deltaFile; | 751 | QString baseFile, sigFile, deltaFile; |
752 | stream >> baseFile >> sigFile >> deltaFile; | 752 | stream >> baseFile >> sigFile >> deltaFile; |
753 | QRsync::generateDiff( baseFile, sigFile, deltaFile ); | 753 | QRsync::generateDiff( baseFile, sigFile, deltaFile ); |
754 | } else if ( msg == "rdiffApplyPatch(QString,QString)" ) { | 754 | } else if ( msg == "rdiffApplyPatch(QString,QString)" ) { |
755 | QString baseFile, deltaFile; | 755 | QString baseFile, deltaFile; |
756 | stream >> baseFile >> deltaFile; | 756 | stream >> baseFile >> deltaFile; |
757 | if ( !QFile::exists( baseFile ) ) { | 757 | if ( !QFile::exists( baseFile ) ) { |
758 | QFile f( baseFile ); | 758 | QFile f( baseFile ); |
759 | f.open( IO_WriteOnly ); | 759 | f.open( IO_WriteOnly ); |
760 | f.close(); | 760 | f.close(); |
761 | } | 761 | } |
762 | QRsync::applyDiff( baseFile, deltaFile ); | 762 | QRsync::applyDiff( baseFile, deltaFile ); |
763 | QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" ); | 763 | QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" ); |
764 | e << baseFile; | 764 | e << baseFile; |
765 | } else if ( msg == "rdiffCleanup()" ) { | 765 | } else if ( msg == "rdiffCleanup()" ) { |
766 | mkdir( "/tmp/rdiff" ); | 766 | mkdir( "/tmp/rdiff" ); |
767 | QDir dir; | 767 | QDir dir; |
768 | dir.setPath( "/tmp/rdiff" ); | 768 | dir.setPath( "/tmp/rdiff" ); |
769 | QStringList entries = dir.entryList(); | 769 | QStringList entries = dir.entryList(); |
770 | for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) | 770 | for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) |
771 | dir.remove( *it ); | 771 | dir.remove( *it ); |
772 | } else if ( msg == "sendHandshakeInfo()" ) { | 772 | } else if ( msg == "sendHandshakeInfo()" ) { |
773 | QString home = getenv( "HOME" ); | 773 | QString home = getenv( "HOME" ); |
774 | QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" ); | 774 | QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" ); |
775 | e << home; | 775 | e << home; |
776 | int locked = (int) Desktop::screenLocked(); | 776 | int locked = (int) Desktop::screenLocked(); |
777 | e << locked; | 777 | e << locked; |
778 | // register an app for autostart | 778 | // register an app for autostart |
779 | // if clear is send the list is cleared. | 779 | // if clear is send the list is cleared. |
780 | } else if ( msg == "autoStart(QString)" ) { | 780 | } else if ( msg == "autoStart(QString)" ) { |
781 | QString appName; | 781 | QString appName; |
782 | stream >> appName; | 782 | stream >> appName; |
783 | Config cfg( "autostart" ); | 783 | Config cfg( "autostart" ); |
784 | cfg.setGroup( "AutoStart" ); | 784 | cfg.setGroup( "AutoStart" ); |
785 | if ( appName.compare("clear") == 0){ | 785 | if ( appName.compare("clear") == 0){ |
786 | cfg.writeEntry("Apps", ""); | 786 | cfg.writeEntry("Apps", ""); |
787 | } | 787 | } |
788 | } else if ( msg == "autoStart(QString,QString)" ) { | 788 | } else if ( msg == "autoStart(QString,QString)" ) { |
789 | QString modifier, appName; | 789 | QString modifier, appName; |
790 | stream >> modifier >> appName; | 790 | stream >> modifier >> appName; |
791 | Config cfg( "autostart" ); | 791 | Config cfg( "autostart" ); |
792 | cfg.setGroup( "AutoStart" ); | 792 | cfg.setGroup( "AutoStart" ); |
793 | if ( modifier.compare("add") == 0 ){ | 793 | if ( modifier.compare("add") == 0 ){ |
794 | // only add if appname is entered | 794 | // only add if appname is entered |
795 | if (!appName.isEmpty()) { | 795 | if (!appName.isEmpty()) { |
796 | cfg.writeEntry("Apps", appName); | 796 | cfg.writeEntry("Apps", appName); |
797 | } | 797 | } |
798 | } else if (modifier.compare("remove") == 0 ) { | 798 | } else if (modifier.compare("remove") == 0 ) { |
799 | // need to change for multiple entries | 799 | // need to change for multiple entries |
800 | // actually remove is right now simular to clear, but in future there | 800 | // actually remove is right now simular to clear, but in future there |
801 | // should be multiple apps in autostart possible. | 801 | // should be multiple apps in autostart possible. |
802 | QString checkName; | 802 | QString checkName; |
803 | checkName = cfg.readEntry("Apps", ""); | 803 | checkName = cfg.readEntry("Apps", ""); |
804 | if (checkName == appName) { | 804 | if (checkName == appName) { |
805 | cfg.writeEntry("Apps", ""); | 805 | cfg.writeEntry("Apps", ""); |
806 | } | 806 | } |
807 | } | 807 | } |
808 | // case the autostart feature should be delayed | 808 | // case the autostart feature should be delayed |
809 | } else if ( msg == "autoStart(QString, QString, QString)") { | 809 | } else if ( msg == "autoStart(QString, QString, QString)") { |
810 | QString modifier, appName, delay; | 810 | QString modifier, appName, delay; |
811 | stream >> modifier >> appName >> delay; | 811 | stream >> modifier >> appName >> delay; |
812 | Config cfg( "autostart" ); | 812 | Config cfg( "autostart" ); |
813 | cfg.setGroup( "AutoStart" ); | 813 | cfg.setGroup( "AutoStart" ); |
814 | if ( modifier.compare("add") == 0 ){ | 814 | if ( modifier.compare("add") == 0 ){ |
815 | // only add it appname is entered | 815 | // only add it appname is entered |
816 | if (!appName.isEmpty()) { | 816 | if (!appName.isEmpty()) { |
817 | cfg.writeEntry("Apps", appName); | 817 | cfg.writeEntry("Apps", appName); |
818 | cfg.writeEntry("Delay", delay); | 818 | cfg.writeEntry("Delay", delay); |
819 | } | 819 | } |
820 | } else { | 820 | } else { |
821 | } | 821 | } |
822 | } else if ( msg == "sendCardInfo()" ) { | 822 | } else if ( msg == "sendCardInfo()" ) { |
823 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); | 823 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); |
824 | const QList<FileSystem> &fs = storage->fileSystems(); | 824 | const QList<FileSystem> &fs = storage->fileSystems(); |
825 | QListIterator<FileSystem> it ( fs ); | 825 | QListIterator<FileSystem> it ( fs ); |
826 | QString s; | 826 | QString s; |
827 | QString homeDir = getenv("HOME"); | 827 | QString homeDir = getenv("HOME"); |
828 | QString hardDiskHome; | 828 | QString hardDiskHome; |
829 | for ( ; it.current(); ++it ) { | 829 | for ( ; it.current(); ++it ) { |
830 | if ( (*it)->isRemovable() ) | 830 | if ( (*it)->isRemovable() ) |
831 | s += (*it)->name() + "=" + (*it)->path() + "/Documents " | 831 | s += (*it)->name() + "=" + (*it)->path() + "/Documents " |
832 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) | 832 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) |
833 | + " " + (*it)->options() + ";"; | 833 | + " " + (*it)->options() + ";"; |
834 | else if ( (*it)->disk() == "/dev/mtdblock1" || | 834 | else if ( (*it)->disk() == "/dev/mtdblock1" || |
835 | (*it)->disk() == "/dev/mtdblock/1" ) | 835 | (*it)->disk() == "/dev/mtdblock/1" ) |
836 | s += (*it)->name() + "=" + homeDir + "/Documents " | 836 | s += (*it)->name() + "=" + homeDir + "/Documents " |
837 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) | 837 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) |
838 | + " " + (*it)->options() + ";"; | 838 | + " " + (*it)->options() + ";"; |
839 | else if ( (*it)->name().contains( "Hard Disk") && | 839 | else if ( (*it)->name().contains( "Hard Disk") && |
840 | homeDir.contains( (*it)->path() ) && | 840 | homeDir.contains( (*it)->path() ) && |
841 | (*it)->path().length() > hardDiskHome.length() ) | 841 | (*it)->path().length() > hardDiskHome.length() ) |
842 | hardDiskHome = | 842 | hardDiskHome = |
843 | (*it)->name() + "=" + homeDir + "/Documents " | 843 | (*it)->name() + "=" + homeDir + "/Documents " |
844 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) | 844 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) |
845 | + " " + (*it)->options() + ";"; | 845 | + " " + (*it)->options() + ";"; |
846 | } | 846 | } |
847 | if ( !hardDiskHome.isEmpty() ) | 847 | if ( !hardDiskHome.isEmpty() ) |
848 | s += hardDiskHome; | 848 | s += hardDiskHome; |
849 | 849 | ||
850 | e << s; | 850 | e << s; |
851 | } else if ( msg == "sendSyncDate(QString)" ) { | 851 | } else if ( msg == "sendSyncDate(QString)" ) { |
852 | QString app; | 852 | QString app; |
853 | stream >> app; | 853 | stream >> app; |
854 | Config cfg( "qpe" ); | 854 | Config cfg( "qpe" ); |
855 | cfg.setGroup("SyncDate"); | 855 | cfg.setGroup("SyncDate"); |
856 | QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); | 856 | QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); |
857 | e << app << cfg.readEntry( app ); | 857 | e << app << cfg.readEntry( app ); |
858 | //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(), | 858 | //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(), |
859 | //cfg.readEntry( app ).latin1() ); | 859 | //cfg.readEntry( app ).latin1() ); |
860 | } else if ( msg == "setSyncDate(QString,QString)" ) { | 860 | } else if ( msg == "setSyncDate(QString,QString)" ) { |
861 | QString app, date; | 861 | QString app, date; |
862 | stream >> app >> date; | 862 | stream >> app >> date; |
863 | Config cfg( "qpe" ); | 863 | Config cfg( "qpe" ); |
864 | cfg.setGroup("SyncDate"); | 864 | cfg.setGroup("SyncDate"); |
865 | cfg.writeEntry( app, date ); | 865 | cfg.writeEntry( app, date ); |
866 | //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1()); | 866 | //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1()); |
867 | } else if ( msg == "startSync(QString)" ) { | 867 | } else if ( msg == "startSync(QString)" ) { |
868 | QString what; | 868 | QString what; |
869 | stream >> what; | 869 | stream >> what; |
870 | delete syncDialog; syncDialog = 0; | 870 | delete syncDialog; syncDialog = 0; |
871 | syncDialog = new SyncDialog( this, "syncProgress", FALSE, | 871 | syncDialog = new SyncDialog( this, "syncProgress", FALSE, |
872 | WStyle_Tool | WStyle_Customize | | 872 | WStyle_Tool | WStyle_Customize | |
873 | Qt::WStyle_StaysOnTop ); | 873 | Qt::WStyle_StaysOnTop ); |
874 | syncDialog->showMaximized(); | 874 | syncDialog->showMaximized(); |
875 | syncDialog->whatLabel->setText( "<b>" + what + "</b>" ); | 875 | syncDialog->whatLabel->setText( "<b>" + what + "</b>" ); |
876 | connect( syncDialog->buttonCancel, SIGNAL( clicked() ), | 876 | connect( syncDialog->buttonCancel, SIGNAL( clicked() ), |
877 | SLOT( cancelSync() ) ); | 877 | SLOT( cancelSync() ) ); |
878 | } | 878 | } else if ( msg == "stopSync()") { |
879 | else if ( msg == "stopSync()") { | 879 | delete syncDialog; syncDialog = 0; |
880 | delete syncDialog; syncDialog = 0; | ||
881 | } else if ( msg == "getAllDocLinks()" ) { | 880 | } else if ( msg == "getAllDocLinks()" ) { |
882 | loadDocs(); | 881 | loadDocs(); |
883 | 882 | ||
884 | QString contents; | 883 | QString contents; |
885 | 884 | ||
886 | for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) { | 885 | for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) { |
887 | DocLnk *doc = it.current(); | 886 | DocLnk *doc = it.current(); |
888 | QFileInfo fi( doc->file() ); | 887 | QFileInfo fi( doc->file() ); |
889 | if ( !fi.exists() ) | 888 | if ( !fi.exists() ) |
890 | continue; | 889 | continue; |
891 | 890 | ||
892 | bool fake = !doc->linkFileKnown(); | 891 | bool fake = !doc->linkFileKnown(); |
893 | if ( !fake ) { | 892 | if ( !fake ) { |
894 | QFile f( doc->linkFile() ); | 893 | QFile f( doc->linkFile() ); |
895 | if ( f.open( IO_ReadOnly ) ) { | 894 | if ( f.open( IO_ReadOnly ) ) { |
896 | QTextStream ts( &f ); | 895 | QTextStream ts( &f ); |
897 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | 896 | ts.setEncoding( QTextStream::UnicodeUTF8 ); |
898 | contents += ts.read(); | 897 | contents += ts.read(); |
899 | f.close(); | 898 | f.close(); |
900 | } else | 899 | } else |
901 | fake = TRUE; | 900 | fake = TRUE; |
902 | } | 901 | } |
903 | if (fake) { | 902 | if (fake) { |
904 | contents += "[Desktop Entry]\n"; | 903 | contents += "[Desktop Entry]\n"; |
905 | contents += "Categories = " + Qtopia::Record::idsToString( doc->categories() ) + "\n"; | 904 | contents += "Categories = " + Qtopia::Record::idsToString( doc->categories() ) + "\n"; |
906 | contents += "File = "+doc->file()+"\n"; | 905 | contents += "File = "+doc->file()+"\n"; |
907 | contents += "Name = "+doc->name()+"\n"; | 906 | contents += "Name = "+doc->name()+"\n"; |
908 | contents += "Type = "+doc->type()+"\n"; | 907 | contents += "Type = "+doc->type()+"\n"; |
909 | } | 908 | } |
910 | contents += QString("Size = %1\n").arg( fi.size() ); | 909 | contents += QString("Size = %1\n").arg( fi.size() ); |
911 | } | 910 | } |
912 | 911 | ||
913 | //qDebug( "sending length %d", contents.length() ); | 912 | //qDebug( "sending length %d", contents.length() ); |
914 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); | 913 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); |
915 | e << contents; | 914 | e << contents; |
916 | 915 | ||
917 | qDebug( "================ \n\n%s\n\n===============", | 916 | qDebug( "================ \n\n%s\n\n===============", |
918 | contents.latin1() ); | 917 | contents.latin1() ); |
919 | 918 | ||
920 | delete docsFolder; | 919 | delete docsFolder; |
921 | docsFolder = 0; | 920 | docsFolder = 0; |
922 | } | 921 | } |
923 | } | 922 | } |
924 | 923 | ||
925 | void Launcher::cancelSync() | 924 | void Launcher::cancelSync() |
926 | { | 925 | { |
927 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); | 926 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); |
928 | } | 927 | } |
929 | 928 | ||
930 | void Launcher::storageChanged() | 929 | void Launcher::storageChanged() |
931 | { | 930 | { |
932 | if ( in_lnk_props ) { | 931 | if ( in_lnk_props ) { |
933 | got_lnk_change = TRUE; | 932 | got_lnk_change = TRUE; |
934 | lnk_change = ""; | 933 | lnk_change = ""; |
935 | } else { | 934 | } else { |
936 | updateDocs(); | 935 | updateDocs(); |
937 | } | 936 | } |
938 | } | 937 | } |
939 | 938 | ||
940 | 939 | ||
941 | bool Launcher::mkdir(const QString &localPath) | 940 | bool Launcher::mkdir(const QString &localPath) |
942 | { | 941 | { |
943 | QDir fullDir(localPath); | 942 | QDir fullDir(localPath); |
944 | if (fullDir.exists()) | 943 | if (fullDir.exists()) |
945 | return true; | 944 | return true; |
diff --git a/core/pim/today/changelog b/core/pim/today/changelog index 93bbcac..73de50d 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog | |||
@@ -1,26 +1,27 @@ | |||
1 | 0.3.4 | 1 | 0.3.4 |
2 | 2 | ||
3 | * "fill our business card now a clickable label" | ||
3 | * Several bugfixes regarding todo section. | 4 | * Several bugfixes regarding todo section. |
4 | 5 | ||
5 | 0.3.3 | 6 | 0.3.3 |
6 | 7 | ||
7 | * Changed the logo so it better scales to bigger display and also | 8 | * Changed the logo so it better scales to bigger display and also |
8 | made the "Today" string translatable. | 9 | made the "Today" string translatable. |
9 | * some am/pm fixes | 10 | * some am/pm fixes |
10 | * clickable labels now in libopie | 11 | * clickable labels now in libopie |
11 | 12 | ||
12 | 0.3.2 | 13 | 0.3.2 |
13 | 14 | ||
14 | * Autostart is now more configurable. You can decide how long | 15 | * Autostart is now more configurable. You can decide how long |
15 | the ipaq has to has been suspended, before autostart is triggered.(Opie | 16 | the ipaq has to has been suspended, before autostart is triggered.(Opie |
16 | only) | 17 | only) |
17 | * am/pm time optinal (autodetect) | 18 | * am/pm time optinal (autodetect) |
18 | 19 | ||
19 | 0.3.1 | 20 | 0.3.1 |
20 | 21 | ||
21 | * fixed the wrong color of the buttons | 22 | * fixed the wrong color of the buttons |
22 | * better translation (thanks carsten and others) | 23 | * better translation (thanks carsten and others) |
23 | * fixes memory leaks | 24 | * fixes memory leaks |
24 | * bugfixes in calendar part, now location and note are working again. | 25 | * bugfixes in calendar part, now location and note are working again. |
25 | 26 | ||
26 | 0.3.0 | 27 | 0.3.0 |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 06cfa01..9e9d31f 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -114,55 +114,55 @@ void Today::setOwnerField() { | |||
114 | } else { | 114 | } else { |
115 | OwnerField->setText( "<b>" + tr ("Please fill out the business card")+" </b>"); | 115 | OwnerField->setText( "<b>" + tr ("Please fill out the business card")+" </b>"); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | /* | 119 | /* |
120 | * Set the owner field with a given QString, for example per qcop. | 120 | * Set the owner field with a given QString, for example per qcop. |
121 | */ | 121 | */ |
122 | void Today::setOwnerField(QString &message) { | 122 | void Today::setOwnerField(QString &message) { |
123 | if (!message.isEmpty()) { | 123 | if (!message.isEmpty()) { |
124 | OwnerField->setText("<b>" + message + "</b>"); | 124 | OwnerField->setText("<b>" + message + "</b>"); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | /* | 128 | /* |
129 | * Autostart, uses the new (opie only) autostart method in the launcher code. | 129 | * Autostart, uses the new (opie only) autostart method in the launcher code. |
130 | * If registered against that today ist started on each resume. | 130 | * If registered against that today ist started on each resume. |
131 | */ | 131 | */ |
132 | void Today::autoStart() { | 132 | void Today::autoStart() { |
133 | Config cfg("today"); | 133 | Config cfg("today"); |
134 | cfg.setGroup("Autostart"); | 134 | cfg.setGroup("Autostart"); |
135 | int AUTOSTART = cfg.readNumEntry("autostart",1); | 135 | int AUTOSTART = cfg.readNumEntry("autostart",1); |
136 | // qDebug(QString("%1").arg(AUTOSTART)); | 136 | // qDebug(QString("%1").arg(AUTOSTART)); |
137 | if (AUTOSTART) { | 137 | if (AUTOSTART) { |
138 | QCopEnvelope e("QPE/System", "autoStart(QString, QString, QString)"); | 138 | QCopEnvelope e("QPE/System", "autoStart(QString,QString,QString)"); |
139 | e << QString("add"); | 139 | e << QString("add"); |
140 | e << QString("today"); | 140 | e << QString("today"); |
141 | e << AUTOSTART_TIMER; | 141 | e << AUTOSTART_TIMER; |
142 | } else { | 142 | } else { |
143 | qDebug("Nun in else bei autostart"); | 143 | qDebug("Nun in else bei autostart"); |
144 | QCopEnvelope e("QPE/System", "autoStart(QString, QString)"); | 144 | QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); |
145 | e << QString("remove"); | 145 | e << QString("remove"); |
146 | e << QString("today"); | 146 | e << QString("today"); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | /* | 150 | /* |
151 | * Repaint method. Reread all fields. | 151 | * Repaint method. Reread all fields. |
152 | */ | 152 | */ |
153 | void Today::draw() { | 153 | void Today::draw() { |
154 | init(); | 154 | init(); |
155 | getDates(); | 155 | getDates(); |
156 | getMail(); | 156 | getMail(); |
157 | 157 | ||
158 | // if the todolist.xml file was not modified in between, do not parse it. | 158 | // if the todolist.xml file was not modified in between, do not parse it. |
159 | if (checkIfModified() || NEW_START==1) { | 159 | if (checkIfModified() || NEW_START==1) { |
160 | if (todo) delete todo; | 160 | if (todo) delete todo; |
161 | todo = new ToDoDB; | 161 | todo = new ToDoDB; |
162 | getTodo(); | 162 | getTodo(); |
163 | } | 163 | } |
164 | 164 | ||
165 | // how often refresh | 165 | // how often refresh |
166 | QTimer::singleShot( 20*1000, this, SLOT(draw() ) ); | 166 | QTimer::singleShot( 20*1000, this, SLOT(draw() ) ); |
167 | } | 167 | } |
168 | 168 | ||
@@ -400,56 +400,56 @@ void Today::getTodo() { | |||
400 | // not the overdues, we allready got them, and not if we are | 400 | // not the overdues, we allready got them, and not if we are |
401 | // over the maxlines | 401 | // over the maxlines |
402 | if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { | 402 | if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { |
403 | tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; | 403 | tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; |
404 | ammount++; | 404 | ammount++; |
405 | } | 405 | } |
406 | } | 406 | } |
407 | } | 407 | } |
408 | 408 | ||
409 | 409 | ||
410 | if (count > 0) { | 410 | if (count > 0) { |
411 | if( count == 1 ) { | 411 | if( count == 1 ) { |
412 | output = tr("There is <b> 1</b> active task: <br>" ); | 412 | output = tr("There is <b> 1</b> active task: <br>" ); |
413 | } else { | 413 | } else { |
414 | output = tr("There are <b> %1</b> active tasks: <br>").arg(count); | 414 | output = tr("There are <b> %1</b> active tasks: <br>").arg(count); |
415 | } | 415 | } |
416 | output += tmpout; | 416 | output += tmpout; |
417 | } else { | 417 | } else { |
418 | output = tr("No active tasks"); | 418 | output = tr("No active tasks"); |
419 | } | 419 | } |
420 | 420 | ||
421 | TodoField->setText(tr(output)); | 421 | TodoField->setText(tr(output)); |
422 | } | 422 | } |
423 | 423 | ||
424 | |||
425 | /* | 424 | /* |
426 | * launch addressbook (personal card) | 425 | * launch addressbook (personal card) |
427 | */ | 426 | */ |
428 | void Today::editCard() { | 427 | void Today::editCard() { |
429 | QCopEnvelope w("QPE/System", "execute(QString)"); | 428 | QCopEnvelope w("QPE/System", "execute(QString)"); |
430 | w << QString("addressbook"); | 429 | w << QString("addressbook"); |
431 | 430 | ||
431 | // while( !QCopChannel::isRegistered("QPE/Addressbook")) | ||
432 | QCopEnvelope v("QPE/Addressbook", "editPersonalAndClose()"); | 432 | QCopEnvelope v("QPE/Addressbook", "editPersonalAndClose()"); |
433 | } | 433 | } |
434 | 434 | ||
435 | /* | 435 | /* |
436 | * launches datebook | 436 | * launches datebook |
437 | */ | 437 | */ |
438 | void Today::startDatebook() { | 438 | void Today::startDatebook() { |
439 | QCopEnvelope e("QPE/System", "execute(QString)"); | 439 | QCopEnvelope e("QPE/System", "execute(QString)"); |
440 | e << QString("datebook"); | 440 | e << QString("datebook"); |
441 | } | 441 | } |
442 | 442 | ||
443 | /* | 443 | /* |
444 | * starts the edit dialog as known from datebook | 444 | * starts the edit dialog as known from datebook |
445 | */ | 445 | */ |
446 | 446 | ||
447 | 447 | ||
448 | extern QPEApplication *todayApp; | 448 | extern QPEApplication *todayApp; |
449 | 449 | ||
450 | void Today::editEvent(const Event &e) { | 450 | void Today::editEvent(const Event &e) { |
451 | startDatebook(); | 451 | startDatebook(); |
452 | 452 | ||
453 | while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); | 453 | while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); |
454 | QCopEnvelope env("QPE/Datebook", "editEvent(int)"); | 454 | QCopEnvelope env("QPE/Datebook", "editEvent(int)"); |
455 | env << e.uid(); | 455 | env << e.uid(); |