summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-30 06:57:43 (UTC)
committer zautrix <zautrix>2005-06-30 06:57:43 (UTC)
commit0bcf4379652b763423d0c1843cb8ab8945b798bd (patch) (unidiff)
tree3a0d6457c8457204423c1aa0c9946de479f79881
parent0e4ec4bb2a13a89d3d6145ea076a5734481cb252 (diff)
downloadkdepimpi-0bcf4379652b763423d0c1843cb8ab8945b798bd.zip
kdepimpi-0bcf4379652b763423d0c1843cb8ab8945b798bd.tar.gz
kdepimpi-0bcf4379652b763423d0c1843cb8ab8945b798bd.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp1
-rw-r--r--korganizer/mainwindow.cpp6
2 files changed, 2 insertions, 5 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 51ae0a0..7a96aa5 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -1,236 +1,235 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// 24//
25// View of Journal entries 25// View of Journal entries
26 26
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qscrollview.h> 28#include <qscrollview.h>
29#include <qpopupmenu.h> 29#include <qpopupmenu.h>
30#include <qhbox.h> 30#include <qhbox.h>
31#include <qpushbutton.h> 31#include <qpushbutton.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <qapplication.h> 34#include <qapplication.h>
35 35
36#include <klocale.h> 36#include <klocale.h>
37#include <kdebug.h> 37#include <kdebug.h>
38#include "koprefs.h" 38#include "koprefs.h"
39#include <kglobal.h> 39#include <kglobal.h>
40 40
41#include <libkcal/calendar.h> 41#include <libkcal/calendar.h>
42 42
43#include "journalentry.h" 43#include "journalentry.h"
44 44
45#include "kojournalview.h" 45#include "kojournalview.h"
46using namespace KOrg; 46using namespace KOrg;
47 47
48KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, 48KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
49 const char *name) 49 const char *name)
50 : KOrg::BaseView(calendar, parent, name) 50 : KOrg::BaseView(calendar, parent, name)
51{ 51{
52 mCalendar = calendar; 52 mCalendar = calendar;
53 QScrollView * sv = new QScrollView( this ); 53 QScrollView * sv = new QScrollView( this );
54 QHBoxLayout * hbl = new QHBoxLayout( this ); 54 QHBoxLayout * hbl = new QHBoxLayout( this );
55 hbl->addWidget( sv ); 55 hbl->addWidget( sv );
56 parWid = new QWidget( sv->viewport() ); 56 parWid = new QWidget( sv->viewport() );
57 sv->addChild(parWid); 57 sv->addChild(parWid);
58 sv->setResizePolicy( QScrollView:: AutoOneFit ); 58 sv->setResizePolicy( QScrollView:: AutoOneFit );
59 mTopLayout = new QVBoxLayout(parWid); 59 mTopLayout = new QVBoxLayout(parWid);
60 QHBox * vb = new QHBox ( parWid ); 60 QHBox * vb = new QHBox ( parWid );
61 QPushButton * newJournal = new QPushButton( vb ); 61 QPushButton * newJournal = new QPushButton( vb );
62 QPixmap icon; 62 QPixmap icon;
63 if ( QApplication::desktop()->width() < 321 ) 63 if ( QApplication::desktop()->width() < 321 )
64 icon = SmallIcon("ko16old"); 64 icon = SmallIcon("ko16old");
65 else 65 else
66 icon = SmallIcon("ko24old"); 66 icon = SmallIcon("ko24old");
67 newJournal->setPixmap (icon ) ; 67 newJournal->setPixmap (icon ) ;
68 int size = newJournal->sizeHint().height(); 68 int size = newJournal->sizeHint().height();
69 newJournal->setFixedSize( size, size ); 69 newJournal->setFixedSize( size, size );
70 mDateLabel = new QLabel ( vb ); 70 mDateLabel = new QLabel ( vb );
71 mTopLayout->addWidget( vb ); 71 mTopLayout->addWidget( vb );
72 mDateLabel->setMargin(1); 72 mDateLabel->setMargin(1);
73 mDateLabel->setAlignment(AlignCenter); 73 mDateLabel->setAlignment(AlignCenter);
74 connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); 74 connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) );
75 getNewEntry(); 75 getNewEntry();
76} 76}
77 77
78KOJournalView::~KOJournalView() 78KOJournalView::~KOJournalView()
79{ 79{
80} 80}
81 81
82int KOJournalView::currentDateCount() 82int KOJournalView::currentDateCount()
83{ 83{
84 return 0; 84 return 0;
85} 85}
86JournalEntry* KOJournalView::getNewEntry() 86JournalEntry* KOJournalView::getNewEntry()
87{ 87{
88 JournalEntry* Entry = new JournalEntry(mCalendar,parWid); 88 JournalEntry* Entry = new JournalEntry(mCalendar,parWid);
89 jEntries.append( Entry ); 89 jEntries.append( Entry );
90 mTopLayout->addWidget(Entry); 90 mTopLayout->addWidget(Entry);
91 Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); 91 Entry->setFont ( KOPrefs::instance()->mJornalViewFont );
92 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; 92 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ;
93 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; 93 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ;
94 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; 94 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ;
95 return Entry; 95 return Entry;
96} 96}
97 97
98QPtrList<Incidence> KOJournalView::selectedIncidences() 98QPtrList<Incidence> KOJournalView::selectedIncidences()
99{ 99{
100 QPtrList<Incidence> eventList; 100 QPtrList<Incidence> eventList;
101 101
102 return eventList; 102 return eventList;
103} 103}
104void KOJournalView::updateConfig() 104void KOJournalView::updateConfig()
105{ 105{
106 JournalEntry* mEntry = jEntries.first(); 106 JournalEntry* mEntry = jEntries.first();
107 while ( mEntry ) { 107 while ( mEntry ) {
108 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); 108 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
109 mEntry = jEntries.next(); 109 mEntry = jEntries.next();
110 } 110 }
111} 111}
112void KOJournalView::updateView() 112void KOJournalView::updateView()
113{ 113{
114 JournalEntry* mEntry = jEntries.first(); 114 JournalEntry* mEntry = jEntries.first();
115 while ( mEntry ) { 115 while ( mEntry ) {
116 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); 116 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
117 mEntry = jEntries.next(); 117 mEntry = jEntries.next();
118 } 118 }
119 showDates( mDate, QDate() ); 119 showDates( mDate, QDate() );
120} 120}
121void KOJournalView::checkModified() 121void KOJournalView::checkModified()
122{ 122{
123 qDebug("checkmod ");
124 flushView(); 123 flushView();
125} 124}
126void KOJournalView::flushView() 125void KOJournalView::flushView()
127{ 126{
128 static bool ff = false; 127 static bool ff = false;
129 if ( ff ) return; 128 if ( ff ) return;
130 ff = true; 129 ff = true;
131 JournalEntry* mEntry = jEntries.first(); 130 JournalEntry* mEntry = jEntries.first();
132 while ( mEntry ) { 131 while ( mEntry ) {
133 mEntry->flushEntry(); 132 mEntry->flushEntry();
134 mEntry = jEntries.next(); 133 mEntry = jEntries.next();
135 } 134 }
136 ff = false; 135 ff = false;
137} 136}
138 137
139void KOJournalView::clearList() 138void KOJournalView::clearList()
140{ 139{
141 JournalEntry* mEntry = jEntries.first(); 140 JournalEntry* mEntry = jEntries.first();
142 while ( mEntry ) { 141 while ( mEntry ) {
143 mEntry->clear(); 142 mEntry->clear();
144 mEntry = jEntries.next(); 143 mEntry = jEntries.next();
145 } 144 }
146} 145}
147void KOJournalView::newJournal() 146void KOJournalView::newJournal()
148{ 147{
149 //qDebug(" KOJournalView::newJournal()"); 148 //qDebug(" KOJournalView::newJournal()");
150 flushView(); 149 flushView();
151 Journal* mJournal = new Journal; 150 Journal* mJournal = new Journal;
152 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); 151 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
153 mCalendar->addJournal(mJournal); 152 mCalendar->addJournal(mJournal);
154 showDates( mDate, QDate() ); 153 showDates( mDate, QDate() );
155} 154}
156 155
157void KOJournalView::showOnly ( Journal* j ) 156void KOJournalView::showOnly ( Journal* j )
158{ 157{
159 //qDebug("showOnly %x ", j); 158 //qDebug("showOnly %x ", j);
160 flushView(); 159 flushView();
161 if ( j == 0 ) { 160 if ( j == 0 ) {
162 showDates( mDate, QDate() ); 161 showDates( mDate, QDate() );
163 return; 162 return;
164 } 163 }
165 QPtrList<Journal> jl; 164 QPtrList<Journal> jl;
166 jl.append ( j ); 165 jl.append ( j );
167 showList( jl ); 166 showList( jl );
168 JournalEntry* mEntry = jEntries.first(); 167 JournalEntry* mEntry = jEntries.first();
169 mEntry->setShowOnly(); 168 mEntry->setShowOnly();
170} 169}
171void KOJournalView::showList(QPtrList<Journal> jl) 170void KOJournalView::showList(QPtrList<Journal> jl)
172{ 171{
173 //qDebug("KOJournalView::showList %d",jl.count() ); 172 //qDebug("KOJournalView::showList %d",jl.count() );
174 JournalEntry* mEntry = jEntries.first(); 173 JournalEntry* mEntry = jEntries.first();
175 JournalEntry* firstEntry = mEntry; 174 JournalEntry* firstEntry = mEntry;
176 int count = jl.count(); 175 int count = jl.count();
177 int iii = 0; 176 int iii = 0;
178 while ( iii < count ) { 177 while ( iii < count ) {
179 if ( !mEntry ) { 178 if ( !mEntry ) {
180 mEntry = getNewEntry(); 179 mEntry = getNewEntry();
181 mEntry->show(); 180 mEntry->show();
182 mEntry->setVisibleMode( true ); 181 mEntry->setVisibleMode( true );
183 mEntry->setDate(mDate); 182 mEntry->setDate(mDate);
184 mEntry->setJournal(jl.at(iii)); 183 mEntry->setJournal(jl.at(iii));
185 mEntry = 0; 184 mEntry = 0;
186 } else { 185 } else {
187 mEntry->setDate(mDate); 186 mEntry->setDate(mDate);
188 mEntry->setJournal(jl.at(iii)); 187 mEntry->setJournal(jl.at(iii));
189 mEntry->show(); 188 mEntry->show();
190 mEntry->setVisibleMode( true ); 189 mEntry->setVisibleMode( true );
191 mEntry = jEntries.next(); 190 mEntry = jEntries.next();
192 } 191 }
193 ++iii; 192 ++iii;
194 } 193 }
195 while ( mEntry ) { 194 while ( mEntry ) {
196 mEntry->setDate(mDate); 195 mEntry->setDate(mDate);
197 mEntry->clear(); 196 mEntry->clear();
198 if ( mEntry != firstEntry ) { 197 if ( mEntry != firstEntry ) {
199 mEntry->hide(); 198 mEntry->hide();
200 mEntry->setVisibleMode( false ); 199 mEntry->setVisibleMode( false );
201 } 200 }
202 else { 201 else {
203 mEntry->setVisibleMode( true ); 202 mEntry->setVisibleMode( true );
204 mEntry->show(); 203 mEntry->show();
205 } 204 }
206 mEntry = jEntries.next(); 205 mEntry = jEntries.next();
207 } 206 }
208} 207}
209 208
210void KOJournalView::showDates(const QDate &start, const QDate &) 209void KOJournalView::showDates(const QDate &start, const QDate &)
211{ 210{
212 mDate = start; 211 mDate = start;
213 mDateLabel-> setText(KGlobal::locale()->formatDate(mDate)); 212 mDateLabel-> setText(KGlobal::locale()->formatDate(mDate));
214 QPtrList<Journal> jl = calendar()->journals4Date( start ); 213 QPtrList<Journal> jl = calendar()->journals4Date( start );
215 showList( jl ); 214 showList( jl );
216} 215}
217 216
218void KOJournalView::showEvents(QPtrList<Event>) 217void KOJournalView::showEvents(QPtrList<Event>)
219{ 218{
220 // After new creation of list view no events are selected. 219 // After new creation of list view no events are selected.
221// emit incidenceSelected( 0 ); 220// emit incidenceSelected( 0 );
222} 221}
223 222
224void KOJournalView::changeEventDisplay(Event *, int /*action*/) 223void KOJournalView::changeEventDisplay(Event *, int /*action*/)
225{ 224{
226 updateView(); 225 updateView();
227} 226}
228 227
229void KOJournalView::keyPressEvent ( QKeyEvent * e ) 228void KOJournalView::keyPressEvent ( QKeyEvent * e )
230{ 229{
231 //qDebug("keyPressEven "); 230 //qDebug("keyPressEven ");
232 if ( e->state() == Qt::ControlButton ) { 231 if ( e->state() == Qt::ControlButton ) {
233 if ( e->key () == Qt::Key_Right || e->key () == Qt::Key_Left ) 232 if ( e->key () == Qt::Key_Right || e->key () == Qt::Key_Left )
234 e->ignore(); 233 e->ignore();
235 } 234 }
236} 235}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index fb6d6ec..23537a6 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1454,772 +1454,770 @@ void MainWindow::displayText( QString text ,QString cap )
1454 lay->setMargin( 3 ); 1454 lay->setMargin( 3 );
1455 QTextBrowser tb ( &dia ); 1455 QTextBrowser tb ( &dia );
1456 lay->addWidget( &tb ); 1456 lay->addWidget( &tb );
1457 tb.setText( text ); 1457 tb.setText( text );
1458#ifdef DESKTOP_VERSION 1458#ifdef DESKTOP_VERSION
1459 dia.resize( 640, 480); 1459 dia.resize( 640, 480);
1460#else 1460#else
1461 dia.showMaximized(); 1461 dia.showMaximized();
1462#endif 1462#endif
1463 dia.exec(); 1463 dia.exec();
1464} 1464}
1465 1465
1466void MainWindow::features() 1466void MainWindow::features()
1467{ 1467{
1468 1468
1469 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1469 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1470} 1470}
1471 1471
1472void MainWindow::usertrans() 1472void MainWindow::usertrans()
1473{ 1473{
1474 1474
1475 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1475 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1476} 1476}
1477 1477
1478void MainWindow::storagehowto() 1478void MainWindow::storagehowto()
1479{ 1479{
1480 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); 1480 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
1481} 1481}
1482void MainWindow::timetrackinghowto() 1482void MainWindow::timetrackinghowto()
1483{ 1483{
1484 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); 1484 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" );
1485} 1485}
1486void MainWindow::kdesynchowto() 1486void MainWindow::kdesynchowto()
1487{ 1487{
1488 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1488 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1489} 1489}
1490void MainWindow::multisynchowto() 1490void MainWindow::multisynchowto()
1491{ 1491{
1492 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1492 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1493} 1493}
1494void MainWindow::synchowto() 1494void MainWindow::synchowto()
1495{ 1495{
1496 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1496 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1497} 1497}
1498void MainWindow::faq() 1498void MainWindow::faq()
1499{ 1499{
1500 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1500 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1501 1501
1502} 1502}
1503void MainWindow::whatsNew() 1503void MainWindow::whatsNew()
1504{ 1504{
1505 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1505 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1506 1506
1507} 1507}
1508void MainWindow::licence() 1508void MainWindow::licence()
1509{ 1509{
1510 KApplication::showLicence(); 1510 KApplication::showLicence();
1511 1511
1512} 1512}
1513void MainWindow::about() 1513void MainWindow::about()
1514{ 1514{
1515 QString version; 1515 QString version;
1516#include <../version> 1516#include <../version>
1517 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1517 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1518 i18n("KOrganizer/Platform-independent\n") + 1518 i18n("KOrganizer/Platform-independent\n") +
1519 "(KO/Pi) " + version + " - " + 1519 "(KO/Pi) " + version + " - " +
1520 1520
1521#ifdef DESKTOP_VERSION 1521#ifdef DESKTOP_VERSION
1522 i18n("Desktop Edition\n") + 1522 i18n("Desktop Edition\n") +
1523#else 1523#else
1524 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1524 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1525#endif 1525#endif
1526 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); 1526 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
1527} 1527}
1528void MainWindow::keyBindings() 1528void MainWindow::keyBindings()
1529{ 1529{
1530 QString cap = i18n("KO/Pi Keys + Colors"); 1530 QString cap = i18n("KO/Pi Keys + Colors");
1531 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1531 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1532 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1532 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1533 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + 1533 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1534 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1534 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1535 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1535 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1536 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1536 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1537 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ 1537 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+
1538 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1538 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1539 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1539 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1540 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ 1540 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1541 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1541 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1542 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1542 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1543 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1543 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1544 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1544 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1545 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1545 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1546 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1546 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1547 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ 1547 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1548 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1548 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1549 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1549 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1550 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1550 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1551 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1551 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1552 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1552 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1553 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1553 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1554 i18n("<p><h3>In agenda view:</h3></p>\n") + 1554 i18n("<p><h3>In agenda view:</h3></p>\n") +
1555 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1555 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1556 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1556 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1557 i18n("<p><h3>In todo view:</h3></p>\n") + 1557 i18n("<p><h3>In todo view:</h3></p>\n") +
1558 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1558 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1559 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1559 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1560 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1560 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1561 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1561 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1562 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1562 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1563 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1563 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1564 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1564 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1565 i18n("<p><h3>In list view:</h3></p>\n") + 1565 i18n("<p><h3>In list view:</h3></p>\n") +
1566 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1566 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1567 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1567 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1568 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1568 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1569 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1569 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1570 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1570 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1571 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1571 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1572 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1572 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1573 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1573 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1574 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1574 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1575 i18n("<p><b>E</b>: Edit item</p>\n") + 1575 i18n("<p><b>E</b>: Edit item</p>\n") +
1576 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1576 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1577 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1577 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1578 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1578 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1579 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1579 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1580 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1580 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1581 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1581 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1582 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1582 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1583 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1583 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1584 i18n("<p><b>White</b>: Item readonly</p>\n"); 1584 i18n("<p><b>White</b>: Item readonly</p>\n");
1585 displayText( text, cap); 1585 displayText( text, cap);
1586} 1586}
1587void MainWindow::aboutAutoSaving() 1587void MainWindow::aboutAutoSaving()
1588{ 1588{
1589 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1589 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1590 1590
1591 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1591 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1592 1592
1593} 1593}
1594void MainWindow::aboutKnownBugs() 1594void MainWindow::aboutKnownBugs()
1595{ 1595{
1596 QMessageBox* msg; 1596 QMessageBox* msg;
1597 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1597 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1598 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1598 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1599 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1599 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1600 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1600 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1601 i18n("\nor report them in the bugtracker on\n") + 1601 i18n("\nor report them in the bugtracker on\n") +
1602 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1602 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1603 QMessageBox::NoIcon, 1603 QMessageBox::NoIcon,
1604 QMessageBox::Ok, 1604 QMessageBox::Ok,
1605 QMessageBox::NoButton, 1605 QMessageBox::NoButton,
1606 QMessageBox::NoButton); 1606 QMessageBox::NoButton);
1607 msg->exec(); 1607 msg->exec();
1608 delete msg; 1608 delete msg;
1609 1609
1610} 1610}
1611 1611
1612QString MainWindow::defaultFileName() 1612QString MainWindow::defaultFileName()
1613{ 1613{
1614 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1614 return locateLocal( "data", "korganizer/mycalendar.ics" );
1615} 1615}
1616QString MainWindow::syncFileName() 1616QString MainWindow::syncFileName()
1617{ 1617{
1618#ifdef DESKTOP_VERSION 1618#ifdef DESKTOP_VERSION
1619 return locateLocal( "tmp", "synccalendar.ics" ); 1619 return locateLocal( "tmp", "synccalendar.ics" );
1620#else 1620#else
1621 return QString( "/tmp/synccalendar.ics" ); 1621 return QString( "/tmp/synccalendar.ics" );
1622#endif 1622#endif
1623} 1623}
1624#include "koglobals.h" 1624#include "koglobals.h"
1625#include <kcalendarsystem.h> 1625#include <kcalendarsystem.h>
1626void MainWindow::updateWeek(QDate seda) 1626void MainWindow::updateWeek(QDate seda)
1627{ 1627{
1628 int weekNum = KGlobal::locale()->weekNum ( seda ); 1628 int weekNum = KGlobal::locale()->weekNum ( seda );
1629 mWeekPixmap.fill( mWeekBgColor ); 1629 mWeekPixmap.fill( mWeekBgColor );
1630 QPainter p ( &mWeekPixmap ); 1630 QPainter p ( &mWeekPixmap );
1631 p.setFont( mWeekFont ); 1631 p.setFont( mWeekFont );
1632 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1632 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1633 p.end(); 1633 p.end();
1634 QIconSet icon3 ( mWeekPixmap ); 1634 QIconSet icon3 ( mWeekPixmap );
1635 mWeekAction->setIconSet ( icon3 ); 1635 mWeekAction->setIconSet ( icon3 );
1636 1636
1637} 1637}
1638void MainWindow::updateWeekNum(const DateList &selectedDates) 1638void MainWindow::updateWeekNum(const DateList &selectedDates)
1639{ 1639{
1640 updateWeek( selectedDates.first() ); 1640 updateWeek( selectedDates.first() );
1641} 1641}
1642void MainWindow::processIncidenceSelection( Incidence *incidence ) 1642void MainWindow::processIncidenceSelection( Incidence *incidence )
1643{ 1643{
1644 1644
1645 if ( !incidence ) { 1645 if ( !incidence ) {
1646 enableIncidenceActions( false ); 1646 enableIncidenceActions( false );
1647 1647
1648 mNewSubTodoAction->setEnabled( false ); 1648 mNewSubTodoAction->setEnabled( false );
1649 setCaptionToDates(); 1649 setCaptionToDates();
1650 return; 1650 return;
1651 1651
1652 } 1652 }
1653 1653
1654 //KGlobal::locale()->formatDateTime(nextA, true); 1654 //KGlobal::locale()->formatDateTime(nextA, true);
1655 QString startString = ""; 1655 QString startString = "";
1656 if ( incidence->typeID() != todoID ) { 1656 if ( incidence->typeID() != todoID ) {
1657 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1657 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1658 if ( incidence->doesFloat() ) { 1658 if ( incidence->doesFloat() ) {
1659 startString += ": "+incidence->dtStartDateStr( true ); 1659 startString += ": "+incidence->dtStartDateStr( true );
1660 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1660 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1661 1661
1662 } else { 1662 } else {
1663 startString = ": "+incidence->dtStartStr(true); 1663 startString = ": "+incidence->dtStartStr(true);
1664 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1664 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1665 1665
1666 } 1666 }
1667 1667
1668 } else { 1668 } else {
1669 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1669 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1670 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1670 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1671 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1671 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1672 1672
1673 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1673 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1674 bool ok; 1674 bool ok;
1675 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1675 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1676 if ( ok ) { 1676 if ( ok ) {
1677 int years = noc.date().year() - incidence->dtStart().date().year(); 1677 int years = noc.date().year() - incidence->dtStart().date().year();
1678 startString += i18n(" (%1 y.)"). arg( years ); 1678 startString += i18n(" (%1 y.)"). arg( years );
1679 } 1679 }
1680 } 1680 }
1681 else 1681 else
1682 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1682 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1683 } 1683 }
1684 1684
1685 } 1685 }
1686 else 1686 else
1687 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1687 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1688 if ( !incidence->location().isEmpty() ) 1688 if ( !incidence->location().isEmpty() )
1689 startString += " (" +incidence->location()+")"; 1689 startString += " (" +incidence->location()+")";
1690 setCaption( incidence->summary()+startString); 1690 setCaption( incidence->summary()+startString);
1691 1691
1692 enableIncidenceActions( true ); 1692 enableIncidenceActions( true );
1693 1693
1694 if ( incidence->typeID() == eventID ) { 1694 if ( incidence->typeID() == eventID ) {
1695 mShowAction->setText( i18n("Show Event...") ); 1695 mShowAction->setText( i18n("Show Event...") );
1696 mEditAction->setText( i18n("Edit Event...") ); 1696 mEditAction->setText( i18n("Edit Event...") );
1697 mDeleteAction->setText( i18n("Delete Event...") ); 1697 mDeleteAction->setText( i18n("Delete Event...") );
1698 1698
1699 mNewSubTodoAction->setEnabled( false ); 1699 mNewSubTodoAction->setEnabled( false );
1700 } else if ( incidence->typeID() == todoID ) { 1700 } else if ( incidence->typeID() == todoID ) {
1701 mShowAction->setText( i18n("Show Todo...") ); 1701 mShowAction->setText( i18n("Show Todo...") );
1702 mEditAction->setText( i18n("Edit Todo...") ); 1702 mEditAction->setText( i18n("Edit Todo...") );
1703 mDeleteAction->setText( i18n("Delete Todo...") ); 1703 mDeleteAction->setText( i18n("Delete Todo...") );
1704 1704
1705 mNewSubTodoAction->setEnabled( true ); 1705 mNewSubTodoAction->setEnabled( true );
1706 } else { 1706 } else {
1707 mShowAction->setText( i18n("Show...") ); 1707 mShowAction->setText( i18n("Show...") );
1708 mShowAction->setText( i18n("Edit...") ); 1708 mShowAction->setText( i18n("Edit...") );
1709 mShowAction->setText( i18n("Delete...") ); 1709 mShowAction->setText( i18n("Delete...") );
1710 1710
1711 mNewSubTodoAction->setEnabled( false ); 1711 mNewSubTodoAction->setEnabled( false );
1712 } 1712 }
1713} 1713}
1714 1714
1715void MainWindow::enableIncidenceActions( bool enabled ) 1715void MainWindow::enableIncidenceActions( bool enabled )
1716{ 1716{
1717 mShowAction->setEnabled( enabled ); 1717 mShowAction->setEnabled( enabled );
1718 mEditAction->setEnabled( enabled ); 1718 mEditAction->setEnabled( enabled );
1719 mDeleteAction->setEnabled( enabled ); 1719 mDeleteAction->setEnabled( enabled );
1720 1720
1721 mCloneAction->setEnabled( enabled ); 1721 mCloneAction->setEnabled( enabled );
1722 mMoveAction->setEnabled( enabled ); 1722 mMoveAction->setEnabled( enabled );
1723 mBeamAction->setEnabled( enabled ); 1723 mBeamAction->setEnabled( enabled );
1724 mCancelAction->setEnabled( enabled ); 1724 mCancelAction->setEnabled( enabled );
1725} 1725}
1726 1726
1727void MainWindow::importOL() 1727void MainWindow::importOL()
1728{ 1728{
1729#ifdef _OL_IMPORT_ 1729#ifdef _OL_IMPORT_
1730 mView->clearAllViews(); 1730 mView->clearAllViews();
1731 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1731 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1732 id->exec(); 1732 id->exec();
1733 delete id; 1733 delete id;
1734 mView->calendar()->checkAlarmForIncidence( 0, true ); 1734 mView->calendar()->checkAlarmForIncidence( 0, true );
1735 mView->updateView(); 1735 mView->updateView();
1736#endif 1736#endif
1737} 1737}
1738void MainWindow::importBday() 1738void MainWindow::importBday()
1739{ 1739{
1740 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1740 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1741 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1741 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1742 i18n("Import!"), i18n("Cancel"), 0, 1742 i18n("Import!"), i18n("Cancel"), 0,
1743 0, 1 ); 1743 0, 1 );
1744 if ( result == 0 ) { 1744 if ( result == 0 ) {
1745 mView->importBday(); 1745 mView->importBday();
1746 1746
1747 } 1747 }
1748 1748
1749 1749
1750} 1750}
1751void MainWindow::importQtopia() 1751void MainWindow::importQtopia()
1752{ 1752{
1753 //#ifndef DESKTOP_VERSION 1753 //#ifndef DESKTOP_VERSION
1754 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1754 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1755#ifdef DESKTOP_VERSION 1755#ifdef DESKTOP_VERSION
1756 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1756 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1757#endif 1757#endif
1758 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1758 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1759 i18n("Import!"), i18n("Cancel"), 0, 1759 i18n("Import!"), i18n("Cancel"), 0,
1760 0, 1 ); 1760 0, 1 );
1761 if ( result == 0 ) { 1761 if ( result == 0 ) {
1762#ifndef DESKTOP_VERSION 1762#ifndef DESKTOP_VERSION
1763 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1763 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1764 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1764 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1765 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1765 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1766#else 1766#else
1767 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1767 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1768 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1768 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1769 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1769 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1770#endif 1770#endif
1771 mView->importQtopia( categories, datebook, todolist ); 1771 mView->importQtopia( categories, datebook, todolist );
1772 } 1772 }
1773 mView->calendar()->reInitAlarmSettings(); 1773 mView->calendar()->reInitAlarmSettings();
1774#if 0 1774#if 0
1775 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1775 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1776 i18n("Not supported \non desktop!\n"), 1776 i18n("Not supported \non desktop!\n"),
1777 i18n("Ok"), i18n("Cancel"), 0, 1777 i18n("Ok"), i18n("Cancel"), 0,
1778 0, 1 ); 1778 0, 1 );
1779 1779
1780#endif 1780#endif
1781} 1781}
1782 1782
1783void MainWindow::saveOnClose() 1783void MainWindow::saveOnClose()
1784{ 1784{
1785 KOPrefs *p = KOPrefs::instance(); 1785 KOPrefs *p = KOPrefs::instance();
1786 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1786 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1787 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1787 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1788 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1788 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1789 if ( filterToolBar ) { 1789 if ( filterToolBar ) {
1790 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1790 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1791 } 1791 }
1792#ifdef DESKTOP_VERSION 1792#ifdef DESKTOP_VERSION
1793 1793
1794 QPoint myP; 1794 QPoint myP;
1795 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1795 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1796 if ( p->mToolBarHor ) 1796 if ( p->mToolBarHor )
1797 p->mToolBarUp = myP.y() > height()/2; 1797 p->mToolBarUp = myP.y() > height()/2;
1798 else 1798 else
1799 p->mToolBarUp = myP.x() > width()/2; 1799 p->mToolBarUp = myP.x() > width()/2;
1800 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1800 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1801 if ( p->mToolBarHorV ) 1801 if ( p->mToolBarHorV )
1802 p->mToolBarUpV = myP.y() > height()/2; 1802 p->mToolBarUpV = myP.y() > height()/2;
1803 else 1803 else
1804 p->mToolBarUpV = myP.x() > width()/2 ; 1804 p->mToolBarUpV = myP.x() > width()/2 ;
1805 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1805 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1806 if ( p->mToolBarHorN ) 1806 if ( p->mToolBarHorN )
1807 p->mToolBarUpN = myP.y() > height()/2; 1807 p->mToolBarUpN = myP.y() > height()/2;
1808 else 1808 else
1809 p->mToolBarUpN = myP.x() > width()/2 ; 1809 p->mToolBarUpN = myP.x() > width()/2 ;
1810 if ( filterToolBar ) { 1810 if ( filterToolBar ) {
1811 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1811 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1812 if ( p->mToolBarHorF ) 1812 if ( p->mToolBarHorF )
1813 p->mToolBarUpF = myP.y() > height()/2; 1813 p->mToolBarUpF = myP.y() > height()/2;
1814 else 1814 else
1815 p->mToolBarUpF = myP.x() > width()/2 ; 1815 p->mToolBarUpF = myP.x() > width()/2 ;
1816 } 1816 }
1817#else 1817#else
1818 if ( p->mToolBarHor ) 1818 if ( p->mToolBarHor )
1819 p->mToolBarUp = iconToolBar->y() > height()/2; 1819 p->mToolBarUp = iconToolBar->y() > height()/2;
1820 else 1820 else
1821 p->mToolBarUp = iconToolBar->x() > width()/2; 1821 p->mToolBarUp = iconToolBar->x() > width()/2;
1822 if ( p->mToolBarHorV ) 1822 if ( p->mToolBarHorV )
1823 p->mToolBarUpV = viewToolBar->y() > height()/2; 1823 p->mToolBarUpV = viewToolBar->y() > height()/2;
1824 else 1824 else
1825 p->mToolBarUpV = viewToolBar->x() > width()/2 ; 1825 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1826 1826
1827 if ( p->mToolBarHorN ) 1827 if ( p->mToolBarHorN )
1828 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1828 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1829 else 1829 else
1830 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1830 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1831 if ( filterToolBar ) { 1831 if ( filterToolBar ) {
1832 if ( p->mToolBarHorF ) 1832 if ( p->mToolBarHorF )
1833 p->mToolBarUpF = filterToolBar->y() > height()/2; 1833 p->mToolBarUpF = filterToolBar->y() > height()/2;
1834 else 1834 else
1835 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1835 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1836 } 1836 }
1837#endif 1837#endif
1838 if ( mView->viewManager()->journalView() ) 1838
1839 mView->viewManager()->journalView()->checkModified(); 1839 save();
1840 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1841 save();
1842 mView->writeSettings(); 1840 mView->writeSettings();
1843} 1841}
1844void MainWindow::slotModifiedChanged( bool changed ) 1842void MainWindow::slotModifiedChanged( bool changed )
1845{ 1843{
1846 if ( mBlockAtStartup ) 1844 if ( mBlockAtStartup )
1847 return; 1845 return;
1848 1846
1849 int msec; 1847 int msec;
1850 // we store the changes after 1 minute, 1848 // we store the changes after 1 minute,
1851 // and for safety reasons after 10 minutes again 1849 // and for safety reasons after 10 minutes again
1852 if ( !mSyncManager->blockSave() ) 1850 if ( !mSyncManager->blockSave() )
1853 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1851 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1854 else 1852 else
1855 msec = 1000 * 600; 1853 msec = 1000 * 600;
1856 mSaveTimer.start( msec, true ); // 1 minute 1854 mSaveTimer.start( msec, true ); // 1 minute
1857 qDebug("KO: Saving File in %d secs!", msec/1000); 1855 qDebug("KO: Saving File in %d secs!", msec/1000);
1858 mCalendarModifiedFlag = true; 1856 mCalendarModifiedFlag = true;
1859} 1857}
1860void MainWindow::saveStopTimer() 1858void MainWindow::saveStopTimer()
1861{ 1859{
1862 mSaveTimer.stop(); 1860 mSaveTimer.stop();
1863} 1861}
1864void MainWindow::backupAllFiles() 1862void MainWindow::backupAllFiles()
1865{ 1863{
1866 QDate reference ( 2000,1,1); 1864 QDate reference ( 2000,1,1);
1867 int daysTo = reference.daysTo ( QDate::currentDate() ); 1865 int daysTo = reference.daysTo ( QDate::currentDate() );
1868 setCaption(i18n("Creating backup ... please wait ..." )); 1866 setCaption(i18n("Creating backup ... please wait ..." ));
1869 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); 1867 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
1870 // we need the file path, the backup dir and the number of bups as param 1868 // we need the file path, the backup dir and the number of bups as param
1871 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 1869 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
1872 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 1870 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
1873 bupDir = KGlobalSettings::backupDataDir(); 1871 bupDir = KGlobalSettings::backupDataDir();
1874 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1872 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1875 if ( retval == 0 ) { 1873 if ( retval == 0 ) {
1876 setCaption(i18n("Backup cancelled" )); 1874 setCaption(i18n("Backup cancelled" ));
1877 qDebug("KO: Backup cancelled. Will try again tomorrow "); 1875 qDebug("KO: Backup cancelled. Will try again tomorrow ");
1878 // retval == 0 : backup skipped for today, try again tomorrow 1876 // retval == 0 : backup skipped for today, try again tomorrow
1879 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; 1877 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
1880 } else if ( retval == 1 ){ 1878 } else if ( retval == 1 ){
1881 qDebug("KO: Backup created."); 1879 qDebug("KO: Backup created.");
1882 // backup ok 1880 // backup ok
1883 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1881 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1884 KopiCalendarFile * cal = calendars.first(); 1882 KopiCalendarFile * cal = calendars.first();
1885 cal = calendars.next(); 1883 cal = calendars.next();
1886 while ( cal ) { 1884 while ( cal ) {
1887 if ( !cal->mErrorOnLoad ) { 1885 if ( !cal->mErrorOnLoad ) {
1888 int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1886 int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1889 } 1887 }
1890 cal = calendars.next(); 1888 cal = calendars.next();
1891 } 1889 }
1892 KOPrefs::instance()->mLastBackupDate = daysTo; 1890 KOPrefs::instance()->mLastBackupDate = daysTo;
1893 setCaption(i18n("Backup succesfully finished" )); 1891 setCaption(i18n("Backup succesfully finished" ));
1894 } else if ( retval == 2 ){ 1892 } else if ( retval == 2 ){
1895 setCaption(i18n("Backup globally disabled" )); 1893 setCaption(i18n("Backup globally disabled" ));
1896 qDebug("KO: Backup globally cancelled."); 1894 qDebug("KO: Backup globally cancelled.");
1897 // backup globally cancelled 1895 // backup globally cancelled
1898 KPimGlobalPrefs::instance()->mBackupEnabled = false; 1896 KPimGlobalPrefs::instance()->mBackupEnabled = false;
1899 } 1897 }
1900 // retval == 3: do nothing, try again later 1898 // retval == 3: do nothing, try again later
1901} 1899}
1902void MainWindow::save() 1900void MainWindow::save()
1903{ 1901{
1904 if ( mView->viewManager()->journalView() ) 1902 if ( mView->viewManager()->journalView() )
1905 mView->viewManager()->journalView()->checkModified(); 1903 mView->viewManager()->journalView()->checkModified();
1906 if ( !mCalendarModifiedFlag ) { 1904 if ( !mCalendarModifiedFlag ) {
1907 qDebug("KO: Calendar not modified. Nothing saved."); 1905 qDebug("KO: Calendar not modified. Nothing saved.");
1908 return; 1906 return;
1909 } 1907 }
1910 if ( mSyncManager->blockSave() ) 1908 if ( mSyncManager->blockSave() )
1911 return; 1909 return;
1912 mSyncManager->setBlockSave(true); 1910 mSyncManager->setBlockSave(true);
1913 if ( mView->checkAllFileVersions() ) { 1911 if ( mView->checkAllFileVersions() ) {
1914 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ 1912 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
1915 QDate reference ( 2000,1,1); 1913 QDate reference ( 2000,1,1);
1916 int daysTo = reference.daysTo ( QDate::currentDate() ); 1914 int daysTo = reference.daysTo ( QDate::currentDate() );
1917 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { 1915 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {
1918 backupAllFiles(); 1916 backupAllFiles();
1919 } 1917 }
1920 ; // KPimGlobalPrefs::instance()->mLastBackupDate 1918 ; // KPimGlobalPrefs::instance()->mLastBackupDate
1921 } 1919 }
1922 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1920 QTime neededSaveTime = QDateTime::currentDateTime().time();
1923 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1921 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1924 qDebug("KO: Start saving data to file!"); 1922 qDebug("KO: Start saving data to file!");
1925 mView->saveCalendars(); 1923 mView->saveCalendars();
1926 mCalendarModifiedFlag = false; 1924 mCalendarModifiedFlag = false;
1927 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1925 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1928 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1926 qDebug("KO: Needed %d ms for saving.",msNeeded );
1929 QString savemes; 1927 QString savemes;
1930 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1928 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1931 setCaption(savemes); 1929 setCaption(savemes);
1932 } else 1930 } else
1933 setCaption(i18n("Saving cancelled!")); 1931 setCaption(i18n("Saving cancelled!"));
1934 mSyncManager->setBlockSave( false ); 1932 mSyncManager->setBlockSave( false );
1935} 1933}
1936 1934
1937void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1935void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1938{ 1936{
1939 if ( !e->isAutoRepeat() ) { 1937 if ( !e->isAutoRepeat() ) {
1940 mFlagKeyPressed = false; 1938 mFlagKeyPressed = false;
1941 } 1939 }
1942} 1940}
1943void MainWindow::keyPressEvent ( QKeyEvent * e ) 1941void MainWindow::keyPressEvent ( QKeyEvent * e )
1944{ 1942{
1945 qApp->processEvents(); 1943 qApp->processEvents();
1946 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1944 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1947 e->ignore(); 1945 e->ignore();
1948 // qDebug(" ignore %d",e->isAutoRepeat() ); 1946 // qDebug(" ignore %d",e->isAutoRepeat() );
1949 return; 1947 return;
1950 } 1948 }
1951 if (! e->isAutoRepeat() ) 1949 if (! e->isAutoRepeat() )
1952 mFlagKeyPressed = true; 1950 mFlagKeyPressed = true;
1953 KOPrefs *p = KOPrefs::instance(); 1951 KOPrefs *p = KOPrefs::instance();
1954 bool showSelectedDates = false; 1952 bool showSelectedDates = false;
1955 int size; 1953 int size;
1956 int pro = 0; 1954 int pro = 0;
1957 //qDebug("MainWindow::keyPressEvent "); 1955 //qDebug("MainWindow::keyPressEvent ");
1958 switch ( e->key() ) { 1956 switch ( e->key() ) {
1959 case Qt::Key_Right: 1957 case Qt::Key_Right:
1960 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1958 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1961 mView->goNextMonth(); 1959 mView->goNextMonth();
1962 else 1960 else
1963 mView->goNext(); 1961 mView->goNext();
1964 showSelectedDates = true; 1962 showSelectedDates = true;
1965 break; 1963 break;
1966 case Qt::Key_Left: 1964 case Qt::Key_Left:
1967 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1965 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1968 mView->goPreviousMonth(); 1966 mView->goPreviousMonth();
1969 else 1967 else
1970 mView->goPrevious(); 1968 mView->goPrevious();
1971 showSelectedDates = true; 1969 showSelectedDates = true;
1972 break; 1970 break;
1973 case Qt::Key_Down: 1971 case Qt::Key_Down:
1974 mView->viewManager()->agendaView()->scrollOneHourDown(); 1972 mView->viewManager()->agendaView()->scrollOneHourDown();
1975 break; 1973 break;
1976 case Qt::Key_Up: 1974 case Qt::Key_Up:
1977 mView->viewManager()->agendaView()->scrollOneHourUp(); 1975 mView->viewManager()->agendaView()->scrollOneHourUp();
1978 break; 1976 break;
1979 case Qt::Key_K: 1977 case Qt::Key_K:
1980 mView->viewManager()->showMonthViewWeek(); 1978 mView->viewManager()->showMonthViewWeek();
1981 break; 1979 break;
1982 case Qt::Key_I: 1980 case Qt::Key_I:
1983 mView->showIncidence(); 1981 mView->showIncidence();
1984 break; 1982 break;
1985 case Qt::Key_Delete: 1983 case Qt::Key_Delete:
1986 case Qt::Key_Backspace: 1984 case Qt::Key_Backspace:
1987 mView->deleteIncidence(); 1985 mView->deleteIncidence();
1988 break; 1986 break;
1989 case Qt::Key_D: 1987 case Qt::Key_D:
1990 mView->viewManager()->showDayView(); 1988 mView->viewManager()->showDayView();
1991 showSelectedDates = true; 1989 showSelectedDates = true;
1992 break; 1990 break;
1993 case Qt::Key_O: 1991 case Qt::Key_O:
1994 mView->toggleFilerEnabled( ); 1992 mView->toggleFilerEnabled( );
1995 break; 1993 break;
1996 case Qt::Key_0: 1994 case Qt::Key_0:
1997 case Qt::Key_1: 1995 case Qt::Key_1:
1998 case Qt::Key_2: 1996 case Qt::Key_2:
1999 case Qt::Key_3: 1997 case Qt::Key_3:
2000 case Qt::Key_4: 1998 case Qt::Key_4:
2001 case Qt::Key_5: 1999 case Qt::Key_5:
2002 case Qt::Key_6: 2000 case Qt::Key_6:
2003 case Qt::Key_7: 2001 case Qt::Key_7:
2004 case Qt::Key_8: 2002 case Qt::Key_8:
2005 case Qt::Key_9: 2003 case Qt::Key_9:
2006 pro = e->key()-48; 2004 pro = e->key()-48;
2007 if ( pro == 0 ) 2005 if ( pro == 0 )
2008 pro = 10; 2006 pro = 10;
2009 if ( e->state() == Qt::ControlButton) 2007 if ( e->state() == Qt::ControlButton)
2010 pro += 10; 2008 pro += 10;
2011 break; 2009 break;
2012 case Qt::Key_M: 2010 case Qt::Key_M:
2013 mView->viewManager()->showMonthView(); 2011 mView->viewManager()->showMonthView();
2014 showSelectedDates = true; 2012 showSelectedDates = true;
2015 break; 2013 break;
2016 case Qt::Key_Insert: 2014 case Qt::Key_Insert:
2017 mView->newEvent(); 2015 mView->newEvent();
2018 break; 2016 break;
2019 case Qt::Key_S : 2017 case Qt::Key_S :
2020 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 2018 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
2021 mView->newSubTodo(); 2019 mView->newSubTodo();
2022 else 2020 else
2023 mView->dialogManager()->showSearchDialog(); 2021 mView->dialogManager()->showSearchDialog();
2024 break; 2022 break;
2025 case Qt::Key_Y : 2023 case Qt::Key_Y :
2026 case Qt::Key_Z : 2024 case Qt::Key_Z :
2027 mView->viewManager()->showWorkWeekView(); 2025 mView->viewManager()->showWorkWeekView();
2028 showSelectedDates = true; 2026 showSelectedDates = true;
2029 break; 2027 break;
2030 case Qt::Key_U : 2028 case Qt::Key_U :
2031 mView->viewManager()->showWeekView(); 2029 mView->viewManager()->showWeekView();
2032 showSelectedDates = true; 2030 showSelectedDates = true;
2033 break; 2031 break;
2034 case Qt::Key_H : 2032 case Qt::Key_H :
2035 keyBindings(); 2033 keyBindings();
2036 break; 2034 break;
2037 case Qt::Key_W: 2035 case Qt::Key_W:
2038 mView->viewManager()->showWhatsNextView(); 2036 mView->viewManager()->showWhatsNextView();
2039 break; 2037 break;
2040 case Qt::Key_L: 2038 case Qt::Key_L:
2041 mView->viewManager()->showListView(); 2039 mView->viewManager()->showListView();
2042 break; 2040 break;
2043 case Qt::Key_N: 2041 case Qt::Key_N:
2044 mView->viewManager()->showNextView(); 2042 mView->viewManager()->showNextView();
2045 break; 2043 break;
2046 case Qt::Key_V: 2044 case Qt::Key_V:
2047 mView->viewManager()->showTodoView(); 2045 mView->viewManager()->showTodoView();
2048 break; 2046 break;
2049 case Qt::Key_C: 2047 case Qt::Key_C:
2050 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 2048 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
2051 break; 2049 break;
2052 case Qt::Key_P: 2050 case Qt::Key_P:
2053 mView->showDatePicker( ); 2051 mView->showDatePicker( );
2054 break; 2052 break;
2055 case Qt::Key_F: 2053 case Qt::Key_F:
2056 mView->editFilters(); 2054 mView->editFilters();
2057 break; 2055 break;
2058 case Qt::Key_R: 2056 case Qt::Key_R:
2059 mView->toggleFilter(); 2057 mView->toggleFilter();
2060 break; 2058 break;
2061 case Qt::Key_X: 2059 case Qt::Key_X:
2062 if ( e->state() == Qt::ControlButton ) 2060 if ( e->state() == Qt::ControlButton )
2063 mView->toggleDateNavigatorWidget(); 2061 mView->toggleDateNavigatorWidget();
2064 else { 2062 else {
2065 mView->viewManager()->showNextXView(); 2063 mView->viewManager()->showNextXView();
2066 showSelectedDates = true; 2064 showSelectedDates = true;
2067 } 2065 }
2068 break; 2066 break;
2069 case Qt::Key_Space: 2067 case Qt::Key_Space:
2070 mView->toggleExpand(); 2068 mView->toggleExpand();
2071 break; 2069 break;
2072 case Qt::Key_A: 2070 case Qt::Key_A:
2073 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 2071 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
2074 mView->showNextAlarms(); 2072 mView->showNextAlarms();
2075 else 2073 else
2076 mView->toggleAllDaySize(); 2074 mView->toggleAllDaySize();
2077 break; 2075 break;
2078 case Qt::Key_T: 2076 case Qt::Key_T:
2079 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2077 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2080 mView->newTodo(); 2078 mView->newTodo();
2081 else { 2079 else {
2082 mView->goToday(); 2080 mView->goToday();
2083 showSelectedDates = true; 2081 showSelectedDates = true;
2084 } 2082 }
2085 break; 2083 break;
2086 case Qt::Key_J: 2084 case Qt::Key_J:
2087 mView->viewManager()->showJournalView(); 2085 mView->viewManager()->showJournalView();
2088 break; 2086 break;
2089 case Qt::Key_B: 2087 case Qt::Key_B:
2090 mView->editIncidenceDescription();; 2088 mView->editIncidenceDescription();;
2091 break; 2089 break;
2092 // case Qt::Key_Return: 2090 // case Qt::Key_Return:
2093 case Qt::Key_E: 2091 case Qt::Key_E:
2094 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2092 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2095 mView->newEvent(); 2093 mView->newEvent();
2096 else 2094 else
2097 mView->editIncidence(); 2095 mView->editIncidence();
2098 break; 2096 break;
2099 case Qt::Key_Plus: 2097 case Qt::Key_Plus:
2100 size = p->mHourSize +2; 2098 size = p->mHourSize +2;
2101 if ( size <= 22 ) 2099 if ( size <= 22 )
2102 configureAgenda( size ); 2100 configureAgenda( size );
2103 break; 2101 break;
2104 case Qt::Key_Minus: 2102 case Qt::Key_Minus:
2105 size = p->mHourSize - 2; 2103 size = p->mHourSize - 2;
2106 if ( size >= 4 ) 2104 if ( size >= 4 )
2107 configureAgenda( size ); 2105 configureAgenda( size );
2108 break; 2106 break;
2109 2107
2110 2108
2111 default: 2109 default:
2112 e->ignore(); 2110 e->ignore();
2113 } 2111 }
2114 if ( pro > 0 ) { 2112 if ( pro > 0 ) {
2115 selectFilter( pro+1 ); 2113 selectFilter( pro+1 );
2116 } 2114 }
2117 if ( showSelectedDates ) { 2115 if ( showSelectedDates ) {
2118 ;// setCaptionToDates(); 2116 ;// setCaptionToDates();
2119 } 2117 }
2120 2118
2121} 2119}
2122void MainWindow::fillFilterMenuTB() 2120void MainWindow::fillFilterMenuTB()
2123{ 2121{
2124 selectFilterMenuTB->clear(); 2122 selectFilterMenuTB->clear();
2125 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2123 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2126 selectFilterMenuTB->insertSeparator(); 2124 selectFilterMenuTB->insertSeparator();
2127 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2125 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2128 2126
2129 selectFilterMenuTB->insertSeparator(); 2127 selectFilterMenuTB->insertSeparator();
2130 QPtrList<CalFilter> fili = mView->filters(); 2128 QPtrList<CalFilter> fili = mView->filters();
2131 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2129 CalFilter *curfilter = mView->filterView()->selectedFilter();
2132 CalFilter *filter = fili.first(); 2130 CalFilter *filter = fili.first();
2133 int iii = 2; 2131 int iii = 2;
2134 bool checkitem = mView->filterView()->filtersEnabled(); 2132 bool checkitem = mView->filterView()->filtersEnabled();
2135 while(filter) { 2133 while(filter) {
2136 selectFilterMenuTB->insertItem( filter->name(), iii ); 2134 selectFilterMenuTB->insertItem( filter->name(), iii );
2137 if ( filter == curfilter) 2135 if ( filter == curfilter)
2138 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2136 selectFilterMenuTB->setItemChecked( iii, checkitem );
2139 filter = fili.next(); 2137 filter = fili.next();
2140 ++iii; 2138 ++iii;
2141 } 2139 }
2142 if ( !checkitem ) 2140 if ( !checkitem )
2143 selectFilterMenuTB->setItemChecked( 1, true ); 2141 selectFilterMenuTB->setItemChecked( 1, true );
2144 2142
2145 int x = 0; 2143 int x = 0;
2146 int y = iconToolBar->height(); 2144 int y = iconToolBar->height();
2147 int dX = 0; 2145 int dX = 0;
2148 int dY = 0; 2146 int dY = 0;
2149 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2147 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2150 if ( iconToolBar->y() > height()/2 ) { 2148 if ( iconToolBar->y() > height()/2 ) {
2151 dY = selectFilterMenuTB->sizeHint().height()+8; 2149 dY = selectFilterMenuTB->sizeHint().height()+8;
2152 y = 0; 2150 y = 0;
2153 } 2151 }
2154 } else { 2152 } else {
2155 if ( iconToolBar->x() > width()/2 ) { // right side 2153 if ( iconToolBar->x() > width()/2 ) { // right side
2156 x=0; 2154 x=0;
2157 dX= selectFilterMenuTB->sizeHint().width()+8; 2155 dX= selectFilterMenuTB->sizeHint().width()+8;
2158 y = 0; 2156 y = 0;
2159 } else { 2157 } else {
2160 x= iconToolBar->width(); 2158 x= iconToolBar->width();
2161 y = 0; 2159 y = 0;
2162 } 2160 }
2163 } 2161 }
2164 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2162 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2165 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2163 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2166} 2164}
2167void MainWindow::fillFilterMenu() 2165void MainWindow::fillFilterMenu()
2168{ 2166{
2169 selectFilterMenu->clear(); 2167 selectFilterMenu->clear();
2170 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2168 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2171 selectFilterMenu->insertSeparator(); 2169 selectFilterMenu->insertSeparator();
2172 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2170 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2173 2171
2174 selectFilterMenu->insertSeparator(); 2172 selectFilterMenu->insertSeparator();
2175 QPtrList<CalFilter> fili = mView->filters(); 2173 QPtrList<CalFilter> fili = mView->filters();
2176 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2174 CalFilter *curfilter = mView->filterView()->selectedFilter();
2177 CalFilter *filter = fili.first(); 2175 CalFilter *filter = fili.first();
2178 int iii = 2; 2176 int iii = 2;
2179 bool checkitem = mView->filterView()->filtersEnabled(); 2177 bool checkitem = mView->filterView()->filtersEnabled();
2180 while(filter) { 2178 while(filter) {
2181 selectFilterMenu->insertItem( filter->name(), iii ); 2179 selectFilterMenu->insertItem( filter->name(), iii );
2182 if ( filter == curfilter) 2180 if ( filter == curfilter)
2183 selectFilterMenu->setItemChecked( iii, checkitem ); 2181 selectFilterMenu->setItemChecked( iii, checkitem );
2184 filter = fili.next(); 2182 filter = fili.next();
2185 ++iii; 2183 ++iii;
2186 } 2184 }
2187 if ( !checkitem ) 2185 if ( !checkitem )
2188 selectFilterMenu->setItemChecked( 1, true ); 2186 selectFilterMenu->setItemChecked( 1, true );
2189} 2187}
2190void MainWindow::fillFilterMenuPopup() 2188void MainWindow::fillFilterMenuPopup()
2191{ 2189{
2192 filterPopupMenu->clear(); 2190 filterPopupMenu->clear();
2193 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2191 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2194 2192
2195 filterPopupMenu->insertSeparator(); 2193 filterPopupMenu->insertSeparator();
2196 QPtrList<CalFilter> fili = mView->filters(); 2194 QPtrList<CalFilter> fili = mView->filters();
2197 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2195 CalFilter *curfilter = mView->filterView()->selectedFilter();
2198 CalFilter *filter = fili.first(); 2196 CalFilter *filter = fili.first();
2199 int iii = 1; 2197 int iii = 1;
2200 bool checkitem = mView->filterView()->filtersEnabled(); 2198 bool checkitem = mView->filterView()->filtersEnabled();
2201 while(filter) { 2199 while(filter) {
2202 filterPopupMenu->insertItem( filter->name(), iii ); 2200 filterPopupMenu->insertItem( filter->name(), iii );
2203 if ( filter == curfilter) 2201 if ( filter == curfilter)
2204 filterPopupMenu->setItemChecked( iii, checkitem ); 2202 filterPopupMenu->setItemChecked( iii, checkitem );
2205 filter = fili.next(); 2203 filter = fili.next();
2206 ++iii; 2204 ++iii;
2207 } 2205 }
2208 if ( !checkitem ) 2206 if ( !checkitem )
2209 filterPopupMenu->setItemChecked( 0, true ); 2207 filterPopupMenu->setItemChecked( 0, true );
2210} 2208}
2211void MainWindow::selectFilter( int fil ) 2209void MainWindow::selectFilter( int fil )
2212{ 2210{
2213 2211
2214 if ( fil == 0 ) { 2212 if ( fil == 0 ) {
2215 mView->editFilters( ); 2213 mView->editFilters( );
2216 } else if ( fil == 1 ){ 2214 } else if ( fil == 1 ){
2217 if ( mView->filterView()->filtersEnabled() ) 2215 if ( mView->filterView()->filtersEnabled() )
2218 mView->toggleFilerEnabled( ); 2216 mView->toggleFilerEnabled( );
2219 } else { 2217 } else {
2220 if ( !mView->filterView()->filtersEnabled() ) { 2218 if ( !mView->filterView()->filtersEnabled() ) {
2221 mView->filterView()->blockSignals( true ); 2219 mView->filterView()->blockSignals( true );
2222 mView->toggleFilerEnabled( ); 2220 mView->toggleFilerEnabled( );
2223 mView->filterView()->blockSignals( false ); 2221 mView->filterView()->blockSignals( false );
2224 } 2222 }
2225 mView->selectFilter( fil-2 ); 2223 mView->selectFilter( fil-2 );