summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-31 11:26:51 (UTC)
committer zautrix <zautrix>2005-03-31 11:26:51 (UTC)
commitc0fa26aa3b33c293853bdd7d028ddb0545e33c85 (patch) (unidiff)
tree12bbb65fb6d235415bd7a7007c1e019ccfcf97ac /korganizer
parentf39d5000ed2f9a436ee94cbd42f840651afa89d6 (diff)
downloadkdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.zip
kdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.tar.gz
kdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.tar.bz2
many fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 09a0880..d98915b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1346,205 +1346,207 @@ void MainWindow::exportToPhone( int mode )
1346 delete cal; 1346 delete cal;
1347} 1347}
1348 1348
1349 1349
1350void MainWindow::setDefaultPreferences() 1350void MainWindow::setDefaultPreferences()
1351{ 1351{
1352 KOPrefs *p = KOPrefs::instance(); 1352 KOPrefs *p = KOPrefs::instance();
1353 1353
1354 p->mCompactDialogs = true; 1354 p->mCompactDialogs = true;
1355 p->mConfirm = true; 1355 p->mConfirm = true;
1356 // p->mEnableQuickTodo = false; 1356 // p->mEnableQuickTodo = false;
1357 1357
1358} 1358}
1359 1359
1360QString MainWindow::resourcePath() 1360QString MainWindow::resourcePath()
1361{ 1361{
1362 return KGlobal::iconLoader()->iconPath(); 1362 return KGlobal::iconLoader()->iconPath();
1363} 1363}
1364 1364
1365void MainWindow::displayText( QString text ,QString cap ) 1365void MainWindow::displayText( QString text ,QString cap )
1366{ 1366{
1367 QDialog dia( this, "name", true ); ; 1367 QDialog dia( this, "name", true ); ;
1368 dia.setCaption( cap ); 1368 dia.setCaption( cap );
1369 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1369 QVBoxLayout* lay = new QVBoxLayout( &dia );
1370 lay->setSpacing( 3 ); 1370 lay->setSpacing( 3 );
1371 lay->setMargin( 3 ); 1371 lay->setMargin( 3 );
1372 QTextBrowser tb ( &dia ); 1372 QTextBrowser tb ( &dia );
1373 lay->addWidget( &tb ); 1373 lay->addWidget( &tb );
1374 tb.setText( text ); 1374 tb.setText( text );
1375#ifdef DESKTOP_VERSION 1375#ifdef DESKTOP_VERSION
1376 dia.resize( 640, 480); 1376 dia.resize( 640, 480);
1377#else 1377#else
1378 dia.showMaximized(); 1378 dia.showMaximized();
1379#endif 1379#endif
1380 dia.exec(); 1380 dia.exec();
1381} 1381}
1382 1382
1383void MainWindow::features() 1383void MainWindow::features()
1384{ 1384{
1385 1385
1386 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1386 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1387} 1387}
1388 1388
1389void MainWindow::usertrans() 1389void MainWindow::usertrans()
1390{ 1390{
1391 1391
1392 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1392 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1393} 1393}
1394 1394
1395void MainWindow::kdesynchowto() 1395void MainWindow::kdesynchowto()
1396{ 1396{
1397 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1397 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1398} 1398}
1399void MainWindow::multisynchowto() 1399void MainWindow::multisynchowto()
1400{ 1400{
1401 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1401 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1402} 1402}
1403void MainWindow::synchowto() 1403void MainWindow::synchowto()
1404{ 1404{
1405 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1405 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1406} 1406}
1407void MainWindow::faq() 1407void MainWindow::faq()
1408{ 1408{
1409 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1409 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1410 1410
1411} 1411}
1412void MainWindow::whatsNew() 1412void MainWindow::whatsNew()
1413{ 1413{
1414 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1414 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1415 1415
1416} 1416}
1417void MainWindow::licence() 1417void MainWindow::licence()
1418{ 1418{
1419 KApplication::showLicence(); 1419 KApplication::showLicence();
1420 1420
1421} 1421}
1422void MainWindow::about() 1422void MainWindow::about()
1423{ 1423{
1424 QString version; 1424 QString version;
1425#include <../version> 1425#include <../version>
1426 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1426 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1427 i18n("KOrganizer/Platform-independent\n") + 1427 i18n("KOrganizer/Platform-independent\n") +
1428 "(KO/Pi) " + version + " - " + 1428 "(KO/Pi) " + version + " - " +
1429 1429
1430#ifdef DESKTOP_VERSION 1430#ifdef DESKTOP_VERSION
1431 i18n("Desktop Edition\n") + 1431 i18n("Desktop Edition\n") +
1432#else 1432#else
1433 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1433 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1434#endif 1434#endif
1435 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!") ); 1435 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!") );
1436} 1436}
1437void MainWindow::keyBindings() 1437void MainWindow::keyBindings()
1438{ 1438{
1439 QString cap = i18n("KO/Pi Keys + Colors"); 1439 QString cap = i18n("KO/Pi Keys + Colors");
1440 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1440 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1441 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1441 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1442 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1443 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1442 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1444 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1443 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1445 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1444 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1446 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1445 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1447 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1446 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1448 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1447 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1449 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1448 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1450 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1449 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1451 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1450 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1452 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1451 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1453 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1452 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1454 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1453 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1455 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1454 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ 1456 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1455 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1457 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1456 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1458 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1457 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1459 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1458 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1460 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1459 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1461 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1460 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1462 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1461 i18n("<p><h3>In agenda view:</h3></p>\n") + 1463 i18n("<p><h3>In agenda view:</h3></p>\n") +
1462 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1464 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1463 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1465 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1464 i18n("<p><h3>In todo view:</h3></p>\n") + 1466 i18n("<p><h3>In todo view:</h3></p>\n") +
1465 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1467 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1466 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1468 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1467 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1469 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1468 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1470 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1469 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1471 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1470 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1472 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1471 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1473 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1472 i18n("<p><h3>In list view:</h3></p>\n") + 1474 i18n("<p><h3>In list view:</h3></p>\n") +
1473 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1475 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1474 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1476 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1475 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1477 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1476 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1478 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1477 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1479 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1478 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1480 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1479 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1481 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1480 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1482 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1481 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1483 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1482 i18n("<p><b>E</b>: Edit item</p>\n") + 1484 i18n("<p><b>E</b>: Edit item</p>\n") +
1483 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1485 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1484 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1486 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1485 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1487 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1486 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1488 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1487 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1489 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1488 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1490 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1489 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1491 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1490 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1492 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1491 i18n("<p><b>White</b>: Item readonly</p>\n"); 1493 i18n("<p><b>White</b>: Item readonly</p>\n");
1492 displayText( text, cap); 1494 displayText( text, cap);
1493} 1495}
1494void MainWindow::aboutAutoSaving() 1496void MainWindow::aboutAutoSaving()
1495{ 1497{
1496 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"); 1498 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");
1497 1499
1498 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1500 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1499 1501
1500} 1502}
1501void MainWindow::aboutKnownBugs() 1503void MainWindow::aboutKnownBugs()
1502{ 1504{
1503 QMessageBox* msg; 1505 QMessageBox* msg;
1504 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1506 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1505 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")+ 1507 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")+
1506 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1508 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1507 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1509 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1508 i18n("\nor report them in the bugtracker on\n") + 1510 i18n("\nor report them in the bugtracker on\n") +
1509 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1511 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1510 QMessageBox::NoIcon, 1512 QMessageBox::NoIcon,
1511 QMessageBox::Ok, 1513 QMessageBox::Ok,
1512 QMessageBox::NoButton, 1514 QMessageBox::NoButton,
1513 QMessageBox::NoButton); 1515 QMessageBox::NoButton);
1514 msg->exec(); 1516 msg->exec();
1515 delete msg; 1517 delete msg;
1516 1518
1517} 1519}
1518 1520
1519QString MainWindow::defaultFileName() 1521QString MainWindow::defaultFileName()
1520{ 1522{
1521 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1523 return locateLocal( "data", "korganizer/mycalendar.ics" );
1522} 1524}
1523QString MainWindow::syncFileName() 1525QString MainWindow::syncFileName()
1524{ 1526{
1525#ifdef DESKTOP_VERSION 1527#ifdef DESKTOP_VERSION
1526 return locateLocal( "tmp", "synccalendar.ics" ); 1528 return locateLocal( "tmp", "synccalendar.ics" );
1527#else 1529#else
1528 return QString( "/tmp/synccalendar.ics" ); 1530 return QString( "/tmp/synccalendar.ics" );
1529#endif 1531#endif
1530} 1532}
1531#include "koglobals.h" 1533#include "koglobals.h"
1532#include <kcalendarsystem.h> 1534#include <kcalendarsystem.h>
1533void MainWindow::updateWeek(QDate seda) 1535void MainWindow::updateWeek(QDate seda)
1534{ 1536{
1535 int weekNum = KGlobal::locale()->weekNum ( seda ); 1537 int weekNum = KGlobal::locale()->weekNum ( seda );
1536 mWeekPixmap.fill( mWeekBgColor ); 1538 mWeekPixmap.fill( mWeekBgColor );
1537 QPainter p ( &mWeekPixmap ); 1539 QPainter p ( &mWeekPixmap );
1538 p.setFont( mWeekFont ); 1540 p.setFont( mWeekFont );
1539 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1541 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1540 p.end(); 1542 p.end();
1541 QIconSet icon3 ( mWeekPixmap ); 1543 QIconSet icon3 ( mWeekPixmap );
1542 mWeekAction->setIconSet ( icon3 ); 1544 mWeekAction->setIconSet ( icon3 );
1543 1545
1544} 1546}
1545void MainWindow::updateWeekNum(const DateList &selectedDates) 1547void MainWindow::updateWeekNum(const DateList &selectedDates)
1546{ 1548{
1547 updateWeek( selectedDates.first() ); 1549 updateWeek( selectedDates.first() );
1548} 1550}
1549void MainWindow::processIncidenceSelection( Incidence *incidence ) 1551void MainWindow::processIncidenceSelection( Incidence *incidence )
1550{ 1552{
@@ -1807,216 +1809,216 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1807 // qDebug(" ignore %d",e->isAutoRepeat() ); 1809 // qDebug(" ignore %d",e->isAutoRepeat() );
1808 return; 1810 return;
1809 } 1811 }
1810 if (! e->isAutoRepeat() ) 1812 if (! e->isAutoRepeat() )
1811 mFlagKeyPressed = true; 1813 mFlagKeyPressed = true;
1812 KOPrefs *p = KOPrefs::instance(); 1814 KOPrefs *p = KOPrefs::instance();
1813 bool showSelectedDates = false; 1815 bool showSelectedDates = false;
1814 int size; 1816 int size;
1815 int pro = 0; 1817 int pro = 0;
1816 //qDebug("MainWindow::keyPressEvent "); 1818 //qDebug("MainWindow::keyPressEvent ");
1817 switch ( e->key() ) { 1819 switch ( e->key() ) {
1818 case Qt::Key_Right: 1820 case Qt::Key_Right:
1819 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1821 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1820 mView->goNextMonth(); 1822 mView->goNextMonth();
1821 else 1823 else
1822 mView->goNext(); 1824 mView->goNext();
1823 showSelectedDates = true; 1825 showSelectedDates = true;
1824 break; 1826 break;
1825 case Qt::Key_Left: 1827 case Qt::Key_Left:
1826 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1828 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1827 mView->goPreviousMonth(); 1829 mView->goPreviousMonth();
1828 else 1830 else
1829 mView->goPrevious(); 1831 mView->goPrevious();
1830 showSelectedDates = true; 1832 showSelectedDates = true;
1831 break; 1833 break;
1832 case Qt::Key_Down: 1834 case Qt::Key_Down:
1833 mView->viewManager()->agendaView()->scrollOneHourDown(); 1835 mView->viewManager()->agendaView()->scrollOneHourDown();
1834 break; 1836 break;
1835 case Qt::Key_Up: 1837 case Qt::Key_Up:
1836 mView->viewManager()->agendaView()->scrollOneHourUp(); 1838 mView->viewManager()->agendaView()->scrollOneHourUp();
1837 break; 1839 break;
1838 case Qt::Key_K: 1840 case Qt::Key_K:
1839 mView->viewManager()->showMonthViewWeek(); 1841 mView->viewManager()->showMonthViewWeek();
1840 break; 1842 break;
1841 case Qt::Key_I: 1843 case Qt::Key_I:
1842 mView->showIncidence(); 1844 mView->showIncidence();
1843 break; 1845 break;
1844 case Qt::Key_Delete: 1846 case Qt::Key_Delete:
1845 case Qt::Key_Backspace: 1847 case Qt::Key_Backspace:
1846 mView->deleteIncidence(); 1848 mView->deleteIncidence();
1847 break; 1849 break;
1848 case Qt::Key_D: 1850 case Qt::Key_D:
1849 mView->viewManager()->showDayView(); 1851 mView->viewManager()->showDayView();
1850 showSelectedDates = true; 1852 showSelectedDates = true;
1851 break; 1853 break;
1852 case Qt::Key_O: 1854 case Qt::Key_O:
1853 mView->toggleFilerEnabled( ); 1855 mView->toggleFilerEnabled( );
1854 break; 1856 break;
1855 case Qt::Key_0: 1857 case Qt::Key_0:
1856 case Qt::Key_1: 1858 case Qt::Key_1:
1857 case Qt::Key_2: 1859 case Qt::Key_2:
1858 case Qt::Key_3: 1860 case Qt::Key_3:
1859 case Qt::Key_4: 1861 case Qt::Key_4:
1860 case Qt::Key_5: 1862 case Qt::Key_5:
1861 case Qt::Key_6: 1863 case Qt::Key_6:
1862 case Qt::Key_7: 1864 case Qt::Key_7:
1863 case Qt::Key_8: 1865 case Qt::Key_8:
1864 case Qt::Key_9: 1866 case Qt::Key_9:
1865 pro = e->key()-48; 1867 pro = e->key()-48;
1866 if ( pro == 0 ) 1868 if ( pro == 0 )
1867 pro = 10; 1869 pro = 10;
1868 if ( e->state() == Qt::ControlButton) 1870 if ( e->state() == Qt::ControlButton)
1869 pro += 10; 1871 pro += 10;
1870 break; 1872 break;
1871 case Qt::Key_M: 1873 case Qt::Key_M:
1872 mView->viewManager()->showMonthView(); 1874 mView->viewManager()->showMonthView();
1873 showSelectedDates = true; 1875 showSelectedDates = true;
1874 break; 1876 break;
1875 case Qt::Key_Insert: 1877 case Qt::Key_Insert:
1876 mView->newEvent(); 1878 mView->newEvent();
1877 break; 1879 break;
1878 case Qt::Key_S : 1880 case Qt::Key_S :
1879 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1881 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1880 mView->newSubTodo(); 1882 mView->newSubTodo();
1881 else 1883 else
1882 mView->dialogManager()->showSearchDialog(); 1884 mView->dialogManager()->showSearchDialog();
1883 break; 1885 break;
1884 case Qt::Key_Y : 1886 case Qt::Key_Y :
1885 case Qt::Key_Z : 1887 case Qt::Key_Z :
1886 mView->viewManager()->showWorkWeekView(); 1888 mView->viewManager()->showWorkWeekView();
1887 showSelectedDates = true; 1889 showSelectedDates = true;
1888 break; 1890 break;
1889 case Qt::Key_U : 1891 case Qt::Key_U :
1890 mView->viewManager()->showWeekView(); 1892 mView->viewManager()->showWeekView();
1891 showSelectedDates = true; 1893 showSelectedDates = true;
1892 break; 1894 break;
1893 case Qt::Key_H : 1895 case Qt::Key_H :
1894 keyBindings(); 1896 keyBindings();
1895 break; 1897 break;
1896 case Qt::Key_W: 1898 case Qt::Key_W:
1897 mView->viewManager()->showWhatsNextView(); 1899 mView->viewManager()->showWhatsNextView();
1898 break; 1900 break;
1899 case Qt::Key_L: 1901 case Qt::Key_L:
1900 mView->viewManager()->showListView(); 1902 mView->viewManager()->showListView();
1901 break; 1903 break;
1902 case Qt::Key_N: 1904 case Qt::Key_N:
1903 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1905 mView->viewManager()->showNextView();
1904 mView->viewManager()->showNextView();
1905 else {
1906 mView->viewManager()->showNextXView();
1907 showSelectedDates = true;
1908 }
1909 break; 1906 break;
1910 case Qt::Key_V: 1907 case Qt::Key_V:
1911 mView->viewManager()->showTodoView(); 1908 mView->viewManager()->showTodoView();
1912 break; 1909 break;
1913 case Qt::Key_C: 1910 case Qt::Key_C:
1914 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1911 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1915 break; 1912 break;
1916 case Qt::Key_P: 1913 case Qt::Key_P:
1917 mView->showDatePicker( ); 1914 mView->showDatePicker( );
1918 break; 1915 break;
1919 case Qt::Key_F: 1916 case Qt::Key_F:
1920 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1917 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1921 mView->editFilters(); 1918 mView->editFilters();
1922 else 1919 else
1923 mView->toggleFilter(); 1920 mView->toggleFilter();
1924 break; 1921 break;
1925 case Qt::Key_X: 1922 case Qt::Key_X:
1926 mView->toggleDateNavigatorWidget(); 1923 if ( e->state() == Qt::ControlButton )
1924 mView->toggleDateNavigatorWidget();
1925 else {
1926 mView->viewManager()->showNextXView();
1927 showSelectedDates = true;
1928 }
1927 break; 1929 break;
1928 case Qt::Key_Space: 1930 case Qt::Key_Space:
1929 mView->toggleExpand(); 1931 mView->toggleExpand();
1930 break; 1932 break;
1931 case Qt::Key_A: 1933 case Qt::Key_A:
1932 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 1934 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
1933 mView->showNextAlarms(); 1935 mView->showNextAlarms();
1934 else 1936 else
1935 mView->toggleAllDaySize(); 1937 mView->toggleAllDaySize();
1936 break; 1938 break;
1937 case Qt::Key_T: 1939 case Qt::Key_T:
1938 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1940 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1939 mView->newTodo(); 1941 mView->newTodo();
1940 else { 1942 else {
1941 mView->goToday(); 1943 mView->goToday();
1942 showSelectedDates = true; 1944 showSelectedDates = true;
1943 } 1945 }
1944 break; 1946 break;
1945 case Qt::Key_J: 1947 case Qt::Key_J:
1946 mView->viewManager()->showJournalView(); 1948 mView->viewManager()->showJournalView();
1947 break; 1949 break;
1948 case Qt::Key_B: 1950 case Qt::Key_B:
1949 mView->editIncidenceDescription();; 1951 mView->editIncidenceDescription();;
1950 break; 1952 break;
1951 // case Qt::Key_Return: 1953 // case Qt::Key_Return:
1952 case Qt::Key_E: 1954 case Qt::Key_E:
1953 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1955 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1954 mView->newEvent(); 1956 mView->newEvent();
1955 else 1957 else
1956 mView->editIncidence(); 1958 mView->editIncidence();
1957 break; 1959 break;
1958 case Qt::Key_Plus: 1960 case Qt::Key_Plus:
1959 size = p->mHourSize +2; 1961 size = p->mHourSize +2;
1960 if ( size <= 22 ) 1962 if ( size <= 22 )
1961 configureAgenda( size ); 1963 configureAgenda( size );
1962 break; 1964 break;
1963 case Qt::Key_Minus: 1965 case Qt::Key_Minus:
1964 size = p->mHourSize - 2; 1966 size = p->mHourSize - 2;
1965 if ( size >= 4 ) 1967 if ( size >= 4 )
1966 configureAgenda( size ); 1968 configureAgenda( size );
1967 break; 1969 break;
1968 1970
1969 1971
1970 default: 1972 default:
1971 e->ignore(); 1973 e->ignore();
1972 } 1974 }
1973 if ( pro > 0 ) { 1975 if ( pro > 0 ) {
1974 mView->selectFilter( pro-1 ); 1976 mView->selectFilter( pro-1 );
1975 } 1977 }
1976 if ( showSelectedDates ) { 1978 if ( showSelectedDates ) {
1977 ;// setCaptionToDates(); 1979 ;// setCaptionToDates();
1978 } 1980 }
1979 1981
1980} 1982}
1981void MainWindow::fillFilterMenuTB() 1983void MainWindow::fillFilterMenuTB()
1982{ 1984{
1983 selectFilterMenuTB->clear(); 1985 selectFilterMenuTB->clear();
1984 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 1986 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
1985 selectFilterMenuTB->insertSeparator(); 1987 selectFilterMenuTB->insertSeparator();
1986 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 1988 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
1987 1989
1988 selectFilterMenuTB->insertSeparator(); 1990 selectFilterMenuTB->insertSeparator();
1989 QPtrList<CalFilter> fili = mView->filters(); 1991 QPtrList<CalFilter> fili = mView->filters();
1990 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1992 CalFilter *curfilter = mView->filterView()->selectedFilter();
1991 CalFilter *filter = fili.first(); 1993 CalFilter *filter = fili.first();
1992 int iii = 2; 1994 int iii = 2;
1993 bool checkitem = mView->filterView()->filtersEnabled(); 1995 bool checkitem = mView->filterView()->filtersEnabled();
1994 while(filter) { 1996 while(filter) {
1995 selectFilterMenuTB->insertItem( filter->name(), iii ); 1997 selectFilterMenuTB->insertItem( filter->name(), iii );
1996 if ( filter == curfilter) 1998 if ( filter == curfilter)
1997 selectFilterMenuTB->setItemChecked( iii, checkitem ); 1999 selectFilterMenuTB->setItemChecked( iii, checkitem );
1998 filter = fili.next(); 2000 filter = fili.next();
1999 ++iii; 2001 ++iii;
2000 } 2002 }
2001 if ( !checkitem ) 2003 if ( !checkitem )
2002 selectFilterMenuTB->setItemChecked( 1, true ); 2004 selectFilterMenuTB->setItemChecked( 1, true );
2003 2005
2004 int x = 0; 2006 int x = 0;
2005 int y = iconToolBar->height(); 2007 int y = iconToolBar->height();
2006 int dX = 0; 2008 int dX = 0;
2007 int dY = 0; 2009 int dY = 0;
2008 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2010 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2009 if ( iconToolBar->y() > height()/2 ) { 2011 if ( iconToolBar->y() > height()/2 ) {
2010 dY = selectFilterMenuTB->sizeHint().height()+8; 2012 dY = selectFilterMenuTB->sizeHint().height()+8;
2011 y = 0; 2013 y = 0;
2012 } 2014 }
2013 } else { 2015 } else {
2014 if ( iconToolBar->x() > width()/2 ) { // right side 2016 if ( iconToolBar->x() > width()/2 ) { // right side
2015 x=0; 2017 x=0;
2016 dX= selectFilterMenuTB->sizeHint().width()+8; 2018 dX= selectFilterMenuTB->sizeHint().width()+8;
2017 y = 0; 2019 y = 0;
2018 } else { 2020 } else {
2019 x= iconToolBar->width(); 2021 x= iconToolBar->width();
2020 y = 0; 2022 y = 0;
2021 } 2023 }
2022 } 2024 }