summaryrefslogtreecommitdiff
authorumopapisdn <umopapisdn>2003-03-24 07:45:52 (UTC)
committer umopapisdn <umopapisdn>2003-03-24 07:45:52 (UTC)
commit4a0041efd5cc7e08063c09b02858fcd9c2b59880 (patch) (unidiff)
tree3948d60e0b94a2a821b4d87c0b1b985c5abdbff8
parent0e1275a67cae2435c0ac8cee2252f91737c2e10a (diff)
downloadopie-4a0041efd5cc7e08063c09b02858fcd9c2b59880.zip
opie-4a0041efd5cc7e08063c09b02858fcd9c2b59880.tar.gz
opie-4a0041efd5cc7e08063c09b02858fcd9c2b59880.tar.bz2
Bugfix: (bug #0000722) - Date-Popup in calendar-find dialog only appears shortly and then closes. This is due to the fact that the date-popup
appears on top of the button just pressed, and when the mouseup event fires, it is on the date-popup, so this fix just moves the find dialog to the topleft corner, which makes sure that the date-popup doesn't appear underneath the clicking position.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index db2058b..fa509d9 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -863,96 +863,97 @@ void DateBook::setDocument( const QString &filename )
863 863
864 QValueList<Event> tl = Event::readVCalendar( filename ); 864 QValueList<Event> tl = Event::readVCalendar( filename );
865 for( QValueList<Event>::Iterator it = tl.begin(); it != tl.end(); ++it ) { 865 for( QValueList<Event>::Iterator it = tl.begin(); it != tl.end(); ++it ) {
866 db->addEvent( *it ); 866 db->addEvent( *it );
867 } 867 }
868} 868}
869 869
870static const char * beamfile = "/tmp/obex/event.vcs"; 870static const char * beamfile = "/tmp/obex/event.vcs";
871 871
872void DateBook::beamEvent( const Event &e ) 872void DateBook::beamEvent( const Event &e )
873{ 873{
874 qDebug("trying to beamn"); 874 qDebug("trying to beamn");
875 unlink( beamfile ); // delete if exists 875 unlink( beamfile ); // delete if exists
876 mkdir("/tmp/obex/", 0755); 876 mkdir("/tmp/obex/", 0755);
877 Event::writeVCalendar( beamfile, e ); 877 Event::writeVCalendar( beamfile, e );
878 Ir *ir = new Ir( this ); 878 Ir *ir = new Ir( this );
879 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 879 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
880 QString description = e.description(); 880 QString description = e.description();
881 ir->send( beamfile, description, "text/x-vCalendar" ); 881 ir->send( beamfile, description, "text/x-vCalendar" );
882} 882}
883 883
884void DateBook::beamDone( Ir *ir ) 884void DateBook::beamDone( Ir *ir )
885{ 885{
886 delete ir; 886 delete ir;
887 unlink( beamfile ); 887 unlink( beamfile );
888} 888}
889 889
890void DateBook::slotFind() 890void DateBook::slotFind()
891{ 891{
892 // move it to the day view... 892 // move it to the day view...
893 viewDay(); 893 viewDay();
894 FindDialog frmFind( "Calendar", this ); 894 FindDialog frmFind( "Calendar", this );
895 frmFind.setUseDate( true ); 895 frmFind.setUseDate( true );
896 frmFind.setDate( currentDate() ); 896 frmFind.setDate( currentDate() );
897 QObject::connect( &frmFind, 897 QObject::connect( &frmFind,
898 SIGNAL(signalFindClicked(const QString&, const QDate&, 898 SIGNAL(signalFindClicked(const QString&, const QDate&,
899 bool, bool, int)), 899 bool, bool, int)),
900 this, 900 this,
901 SLOT(slotDoFind(const QString&, const QDate&, 901 SLOT(slotDoFind(const QString&, const QDate&,
902 bool, bool, int)) ); 902 bool, bool, int)) );
903 QObject::connect( this, 903 QObject::connect( this,
904 SIGNAL(signalNotFound()), 904 SIGNAL(signalNotFound()),
905 &frmFind, 905 &frmFind,
906 SLOT(slotNotFound()) ); 906 SLOT(slotNotFound()) );
907 QObject::connect( this, 907 QObject::connect( this,
908 SIGNAL(signalWrapAround()), 908 SIGNAL(signalWrapAround()),
909 &frmFind, 909 &frmFind,
910 SLOT(slotWrapAround()) ); 910 SLOT(slotWrapAround()) );
911 frmFind.move(0,0);
911 frmFind.exec(); 912 frmFind.exec();
912 inSearch = false; 913 inSearch = false;
913} 914}
914 915
915bool catComp( QArray<int> cats, int category ) 916bool catComp( QArray<int> cats, int category )
916{ 917{
917 bool returnMe; 918 bool returnMe;
918 int i, 919 int i,
919 count; 920 count;
920 921
921 count = int(cats.count()); 922 count = int(cats.count());
922 returnMe = false; 923 returnMe = false;
923 if ( (category == -1 && count == 0) || category == -2 ) 924 if ( (category == -1 && count == 0) || category == -2 )
924 returnMe = true; 925 returnMe = true;
925 else { 926 else {
926 for ( i = 0; i < count; i++ ) { 927 for ( i = 0; i < count; i++ ) {
927 if ( category == cats[i] ) { 928 if ( category == cats[i] ) {
928 returnMe = true; 929 returnMe = true;
929 break; 930 break;
930 } 931 }
931 } 932 }
932 } 933 }
933 return returnMe; 934 return returnMe;
934} 935}
935 936
936 937
937void DateBook::slotDoFind( const QString& txt, const QDate &dt, 938void DateBook::slotDoFind( const QString& txt, const QDate &dt,
938 bool caseSensitive, bool /*backwards*/, 939 bool caseSensitive, bool /*backwards*/,
939 int category ) 940 int category )
940{ 941{
941 QDateTime dtEnd( QDate(3001, 1, 1), QTime(0, 0, 0) ), 942 QDateTime dtEnd( QDate(3001, 1, 1), QTime(0, 0, 0) ),
942 next; 943 next;
943 944
944 QRegExp r( txt ); 945 QRegExp r( txt );
945 r.setCaseSensitive( caseSensitive ); 946 r.setCaseSensitive( caseSensitive );
946 947
947 948
948 static Event rev, 949 static Event rev,
949 nonrev; 950 nonrev;
950 if ( !inSearch ) { 951 if ( !inSearch ) {
951 rev.setStart( QDateTime(QDate(1960, 1, 1), QTime(0, 0, 0)) ); 952 rev.setStart( QDateTime(QDate(1960, 1, 1), QTime(0, 0, 0)) );
952 nonrev.setStart( rev.start() ); 953 nonrev.setStart( rev.start() );
953 inSearch = true; 954 inSearch = true;
954 } 955 }
955 static QDate searchDate = dt; 956 static QDate searchDate = dt;
956 static bool wrapAround = true; 957 static bool wrapAround = true;
957 bool candidtate; 958 bool candidtate;
958 candidtate = false; 959 candidtate = false;