-rw-r--r-- | core/pim/datebook/datebook.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 7dcf156..db2058b 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -795,33 +795,38 @@ void DateBook::slotNewEventFromKey( const QString &str ) | |||
795 | // We get to here from a key pressed in the Day View | 795 | // We get to here from a key pressed in the Day View |
796 | // So we can assume some things. We want the string | 796 | // So we can assume some things. We want the string |
797 | // passed in to be part of the description. | 797 | // passed in to be part of the description. |
798 | QDateTime start, end; | 798 | QDateTime start, end; |
799 | if ( views->visibleWidget() == dayView ) { | 799 | if ( views->visibleWidget() == dayView ) { |
800 | dayView->selectedDates( start, end ); | 800 | dayView->selectedDates( start, end ); |
801 | } else if ( views->visibleWidget() == monthView ) { | 801 | } else if ( views->visibleWidget() == monthView ) { |
802 | QDate d = monthView->selectedDate(); | 802 | QDate d = monthView->selectedDate(); |
803 | start = end = d; | 803 | start = end = d; |
804 | start.setTime( QTime( 10, 0 ) ); | 804 | start.setTime( QTime( 10, 0 ) ); |
805 | end.setTime( QTime( 12, 0 ) ); | 805 | end.setTime( QTime( 12, 0 ) ); |
806 | } else if ( views->visibleWidget() == weekView ) { | 806 | } else if ( views->visibleWidget() == weekView ) { |
807 | QDate d = weekView->date(); | 807 | QDate d = weekView->date(); |
808 | start = end = d; | 808 | start = end = d; |
809 | start.setTime( QTime( 10, 0 ) ); | 809 | start.setTime( QTime( 10, 0 ) ); |
810 | end.setTime( QTime( 12, 0 ) ); | 810 | end.setTime( QTime( 12, 0 ) ); |
811 | } | 811 | } else if ( views->visibleWidget() == weekLstView ) { |
812 | QDate d = weekLstView->date(); | ||
813 | start = end = d; | ||
814 | start.setTime( QTime( 10, 0 ) ); | ||
815 | end.setTime( QTime( 12, 0 ) ); | ||
816 | } | ||
812 | slotNewEntry(start, end, str); | 817 | slotNewEntry(start, end, str); |
813 | } | 818 | } |
814 | void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str) { | 819 | void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str) { |
815 | // argh! This really needs to be encapsulated in a class | 820 | // argh! This really needs to be encapsulated in a class |
816 | // or function. | 821 | // or function. |
817 | QDialog newDlg( this, 0, TRUE ); | 822 | QDialog newDlg( this, 0, TRUE ); |
818 | newDlg.setCaption( DateEntryBase::tr("New Event") ); | 823 | newDlg.setCaption( DateEntryBase::tr("New Event") ); |
819 | DateEntry *e; | 824 | DateEntry *e; |
820 | QVBoxLayout *vb = new QVBoxLayout( &newDlg ); | 825 | QVBoxLayout *vb = new QVBoxLayout( &newDlg ); |
821 | QScrollView *sv = new QScrollView( &newDlg ); | 826 | QScrollView *sv = new QScrollView( &newDlg ); |
822 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 827 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
823 | sv->setFrameStyle( QFrame::NoFrame ); | 828 | sv->setFrameStyle( QFrame::NoFrame ); |
824 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 829 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
825 | vb->addWidget( sv ); | 830 | vb->addWidget( sv ); |
826 | 831 | ||
827 | Event ev; | 832 | Event ev; |