author | zautrix <zautrix> | 2005-07-29 18:10:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-29 18:10:22 (UTC) |
commit | 48a8fa71f1985fea9df4981808796ef65f0f974a (patch) (unidiff) | |
tree | 960705d669093b067b9ce06456e2aea5aeb92958 | |
parent | 9553b882522708477d131d0d9a2c581724940ba3 (diff) | |
download | kdepimpi-48a8fa71f1985fea9df4981808796ef65f0f974a.zip kdepimpi-48a8fa71f1985fea9df4981808796ef65f0f974a.tar.gz kdepimpi-48a8fa71f1985fea9df4981808796ef65f0f974a.tar.bz2 |
fix
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 98a820d..7ce0251 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1512,516 +1512,516 @@ void MainWindow::setDefaultPreferences() | |||
1512 | 1512 | ||
1513 | QString MainWindow::resourcePath() | 1513 | QString MainWindow::resourcePath() |
1514 | { | 1514 | { |
1515 | return KGlobal::iconLoader()->iconPath(); | 1515 | return KGlobal::iconLoader()->iconPath(); |
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | void MainWindow::displayText( QString text ,QString cap ) | 1518 | void MainWindow::displayText( QString text ,QString cap ) |
1519 | { | 1519 | { |
1520 | QDialog dia( this, "name", true ); ; | 1520 | QDialog dia( this, "name", true ); ; |
1521 | dia.setCaption( cap ); | 1521 | dia.setCaption( cap ); |
1522 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1522 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1523 | lay->setSpacing( 3 ); | 1523 | lay->setSpacing( 3 ); |
1524 | lay->setMargin( 3 ); | 1524 | lay->setMargin( 3 ); |
1525 | QTextBrowser tb ( &dia ); | 1525 | QTextBrowser tb ( &dia ); |
1526 | lay->addWidget( &tb ); | 1526 | lay->addWidget( &tb ); |
1527 | tb.setText( text ); | 1527 | tb.setText( text ); |
1528 | #ifdef DESKTOP_VERSION | 1528 | #ifdef DESKTOP_VERSION |
1529 | dia.resize( 640, 480); | 1529 | dia.resize( 640, 480); |
1530 | #else | 1530 | #else |
1531 | dia.showMaximized(); | 1531 | dia.showMaximized(); |
1532 | #endif | 1532 | #endif |
1533 | dia.exec(); | 1533 | dia.exec(); |
1534 | } | 1534 | } |
1535 | 1535 | ||
1536 | void MainWindow::features() | 1536 | void MainWindow::features() |
1537 | { | 1537 | { |
1538 | 1538 | ||
1539 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1539 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1540 | } | 1540 | } |
1541 | 1541 | ||
1542 | void MainWindow::usertrans() | 1542 | void MainWindow::usertrans() |
1543 | { | 1543 | { |
1544 | 1544 | ||
1545 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1545 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | void MainWindow::storagehowto() | 1548 | void MainWindow::storagehowto() |
1549 | { | 1549 | { |
1550 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); | 1550 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); |
1551 | } | 1551 | } |
1552 | void MainWindow::timetrackinghowto() | 1552 | void MainWindow::timetrackinghowto() |
1553 | { | 1553 | { |
1554 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); | 1554 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); |
1555 | } | 1555 | } |
1556 | void MainWindow::kdesynchowto() | 1556 | void MainWindow::kdesynchowto() |
1557 | { | 1557 | { |
1558 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1558 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1559 | } | 1559 | } |
1560 | void MainWindow::multisynchowto() | 1560 | void MainWindow::multisynchowto() |
1561 | { | 1561 | { |
1562 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1562 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1563 | } | 1563 | } |
1564 | void MainWindow::synchowto() | 1564 | void MainWindow::synchowto() |
1565 | { | 1565 | { |
1566 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1566 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1567 | } | 1567 | } |
1568 | void MainWindow::faq() | 1568 | void MainWindow::faq() |
1569 | { | 1569 | { |
1570 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1570 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1571 | 1571 | ||
1572 | } | 1572 | } |
1573 | void MainWindow::whatsNew() | 1573 | void MainWindow::whatsNew() |
1574 | { | 1574 | { |
1575 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1575 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1576 | 1576 | ||
1577 | } | 1577 | } |
1578 | void MainWindow::licence() | 1578 | void MainWindow::licence() |
1579 | { | 1579 | { |
1580 | KApplication::showLicence(); | 1580 | KApplication::showLicence(); |
1581 | 1581 | ||
1582 | } | 1582 | } |
1583 | void MainWindow::about() | 1583 | void MainWindow::about() |
1584 | { | 1584 | { |
1585 | QString version; | 1585 | QString version; |
1586 | #include <../version> | 1586 | #include <../version> |
1587 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1587 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1588 | i18n("KOrganizer/Platform-independent\n") + | 1588 | i18n("KOrganizer/Platform-independent\n") + |
1589 | "(KO/Pi) " + version + " - " + | 1589 | "(KO/Pi) " + version + " - " + |
1590 | 1590 | ||
1591 | #ifdef DESKTOP_VERSION | 1591 | #ifdef DESKTOP_VERSION |
1592 | i18n("Desktop Edition\n") + | 1592 | i18n("Desktop Edition\n") + |
1593 | #else | 1593 | #else |
1594 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1594 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1595 | #endif | 1595 | #endif |
1596 | 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!") ); | 1596 | 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!") ); |
1597 | } | 1597 | } |
1598 | void MainWindow::keyBindings() | 1598 | void MainWindow::keyBindings() |
1599 | { | 1599 | { |
1600 | QString cap = i18n("KO/Pi Keys + Colors"); | 1600 | QString cap = i18n("KO/Pi Keys + Colors"); |
1601 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1601 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1602 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1602 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1603 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + | 1603 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + |
1604 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + | 1604 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + |
1605 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1605 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1606 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1606 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1607 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ | 1607 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ |
1608 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1608 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1609 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1609 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1610 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ | 1610 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ |
1611 | i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+ | 1611 | i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+ |
1612 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1612 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1613 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1613 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1614 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1614 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1615 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1615 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1616 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1616 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1617 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1617 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1618 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ | 1618 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ |
1619 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1619 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1620 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1620 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1621 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1621 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1622 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1622 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1623 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1623 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1624 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1624 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1625 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1625 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1626 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1626 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1627 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1627 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1628 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1628 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1629 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1629 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1630 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1630 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1631 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1631 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1632 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1632 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1633 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1633 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1634 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1634 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1635 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1635 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1636 | i18n("<p><h3>In list view:</h3></p>\n") + | 1636 | i18n("<p><h3>In list view:</h3></p>\n") + |
1637 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1637 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1638 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1638 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1639 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1639 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1640 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1640 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1641 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1641 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1642 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1642 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1643 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1643 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1644 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1644 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1645 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1645 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1646 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1646 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1647 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1647 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1648 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1648 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1649 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1649 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1650 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1650 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1651 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1651 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1652 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1652 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1653 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1653 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1654 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1654 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1655 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1655 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1656 | displayText( text, cap); | 1656 | displayText( text, cap); |
1657 | } | 1657 | } |
1658 | void MainWindow::aboutAutoSaving() | 1658 | void MainWindow::aboutAutoSaving() |
1659 | { | 1659 | { |
1660 | 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"); | 1660 | 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"); |
1661 | 1661 | ||
1662 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1662 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1663 | 1663 | ||
1664 | } | 1664 | } |
1665 | void MainWindow::aboutKnownBugs() | 1665 | void MainWindow::aboutKnownBugs() |
1666 | { | 1666 | { |
1667 | QMessageBox* msg; | 1667 | QMessageBox* msg; |
1668 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1668 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1669 | 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")+ | 1669 | 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")+ |
1670 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1670 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1671 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1671 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1672 | i18n("\nor report them in the bugtracker on\n") + | 1672 | i18n("\nor report them in the bugtracker on\n") + |
1673 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1673 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1674 | QMessageBox::NoIcon, | 1674 | QMessageBox::NoIcon, |
1675 | QMessageBox::Ok, | 1675 | QMessageBox::Ok, |
1676 | QMessageBox::NoButton, | 1676 | QMessageBox::NoButton, |
1677 | QMessageBox::NoButton); | 1677 | QMessageBox::NoButton); |
1678 | msg->exec(); | 1678 | msg->exec(); |
1679 | delete msg; | 1679 | delete msg; |
1680 | 1680 | ||
1681 | } | 1681 | } |
1682 | 1682 | ||
1683 | QString MainWindow::defaultFileName() | 1683 | QString MainWindow::defaultFileName() |
1684 | { | 1684 | { |
1685 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1685 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1686 | } | 1686 | } |
1687 | QString MainWindow::syncFileName() | 1687 | QString MainWindow::syncFileName() |
1688 | { | 1688 | { |
1689 | #ifdef DESKTOP_VERSION | 1689 | #ifdef DESKTOP_VERSION |
1690 | return locateLocal( "tmp", "synccalendar.ics" ); | 1690 | return locateLocal( "tmp", "synccalendar.ics" ); |
1691 | #else | 1691 | #else |
1692 | return QString( "/tmp/synccalendar.ics" ); | 1692 | return QString( "/tmp/synccalendar.ics" ); |
1693 | #endif | 1693 | #endif |
1694 | } | 1694 | } |
1695 | #include "koglobals.h" | 1695 | #include "koglobals.h" |
1696 | #include <kcalendarsystem.h> | 1696 | #include <kcalendarsystem.h> |
1697 | void MainWindow::updateWeek(QDate seda) | 1697 | void MainWindow::updateWeek(QDate seda) |
1698 | { | 1698 | { |
1699 | int weekNum = KGlobal::locale()->weekNum ( seda ); | 1699 | int weekNum = KGlobal::locale()->weekNum ( seda ); |
1700 | mWeekPixmap.fill( mWeekBgColor ); | 1700 | mWeekPixmap.fill( mWeekBgColor ); |
1701 | QPainter p ( &mWeekPixmap ); | 1701 | QPainter p ( &mWeekPixmap ); |
1702 | p.setFont( mWeekFont ); | 1702 | p.setFont( mWeekFont ); |
1703 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1703 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1704 | p.end(); | 1704 | p.end(); |
1705 | QIconSet icon3 ( mWeekPixmap ); | 1705 | QIconSet icon3 ( mWeekPixmap ); |
1706 | mWeekAction->setIconSet ( icon3 ); | 1706 | mWeekAction->setIconSet ( icon3 ); |
1707 | 1707 | ||
1708 | } | 1708 | } |
1709 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1709 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1710 | { | 1710 | { |
1711 | updateWeek( selectedDates.first() ); | 1711 | updateWeek( selectedDates.first() ); |
1712 | } | 1712 | } |
1713 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1713 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1714 | { | 1714 | { |
1715 | if ( !incidence ) { | 1715 | if ( !incidence ) { |
1716 | mShowAction->setMenuText( i18n("Show") ); | 1716 | mShowAction->setMenuText( i18n("Show") ); |
1717 | enableIncidenceActions( false ); | 1717 | enableIncidenceActions( false ); |
1718 | mNewSubTodoAction->setEnabled( false ); | 1718 | mNewSubTodoAction->setEnabled( false ); |
1719 | setCaptionToDates(); | 1719 | setCaptionToDates(); |
1720 | return; | 1720 | return; |
1721 | } | 1721 | } |
1722 | QString startString = ""; | 1722 | QString startString = ""; |
1723 | if ( incidence->typeID() != todoID ) { | 1723 | if ( incidence->typeID() != todoID ) { |
1724 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1724 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1725 | if ( incidence->doesFloat() ) { | 1725 | if ( incidence->doesFloat() ) { |
1726 | startString += ": "+incidence->dtStartDateStr( true ); | 1726 | startString += ": "+incidence->dtStartDateStr( true ); |
1727 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1727 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1728 | } else { | 1728 | } else { |
1729 | startString = ": "+incidence->dtStartStr(true); | 1729 | startString = ": "+incidence->dtStartStr(true); |
1730 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1730 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1731 | } | 1731 | } |
1732 | } else { | 1732 | } else { |
1733 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1733 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1734 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1734 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1735 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1735 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1736 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1736 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1737 | bool ok; | 1737 | bool ok; |
1738 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1738 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1739 | if ( ok ) { | 1739 | if ( ok ) { |
1740 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1740 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1741 | startString += i18n(" (%1 y.)"). arg( years ); | 1741 | startString += i18n(" (%1 y.)"). arg( years ); |
1742 | } | 1742 | } |
1743 | } | 1743 | } |
1744 | else | 1744 | else |
1745 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1745 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1746 | } | 1746 | } |
1747 | } | 1747 | } |
1748 | else { | 1748 | else { |
1749 | if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) | 1749 | if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) |
1750 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); | 1750 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); |
1751 | else | 1751 | else |
1752 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1752 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1753 | } | 1753 | } |
1754 | if ( !incidence->location().isEmpty() ) | 1754 | if ( !incidence->location().isEmpty() ) |
1755 | startString += " (" +incidence->location()+")"; | 1755 | startString += " (" +incidence->location()+")"; |
1756 | setCaption( incidence->summary()+startString); | 1756 | setCaption( incidence->summary()+startString); |
1757 | enableIncidenceActions( true ); | 1757 | enableIncidenceActions( true ); |
1758 | if ( incidence->typeID() == eventID ) { | 1758 | if ( incidence->typeID() == eventID ) { |
1759 | mShowAction->setMenuText( i18n("Show Event") ); | 1759 | mShowAction->setMenuText( i18n("Show Event") ); |
1760 | mNewSubTodoAction->setEnabled( false ); | 1760 | mNewSubTodoAction->setEnabled( false ); |
1761 | } else if ( incidence->typeID() == todoID ) { | 1761 | } else if ( incidence->typeID() == todoID ) { |
1762 | mShowAction->setMenuText( i18n("Show Todo") ); | 1762 | mShowAction->setMenuText( i18n("Show Todo") ); |
1763 | mNewSubTodoAction->setEnabled( true ); | 1763 | mNewSubTodoAction->setEnabled( true ); |
1764 | } else { | 1764 | } else { |
1765 | mShowAction->setMenuText( i18n("Show") ); | 1765 | mShowAction->setMenuText( i18n("Show") ); |
1766 | mNewSubTodoAction->setEnabled( false ); | 1766 | mNewSubTodoAction->setEnabled( false ); |
1767 | } | 1767 | } |
1768 | #ifdef DESKTOP_VERSION | ||
1768 | static QPixmap jP = SmallIcon( "journal" ); | 1769 | static QPixmap jP = SmallIcon( "journal" ); |
1769 | static QPixmap eP = SmallIcon( "newevent" ); | 1770 | static QPixmap eP = SmallIcon( "newevent" ); |
1770 | static QPixmap tP = SmallIcon( "newtodo" ); | 1771 | static QPixmap tP = SmallIcon( "newtodo" ); |
1771 | #ifdef DESKTOP_VERSION | ||
1772 | QIconSet icon; | 1772 | QIconSet icon; |
1773 | if ( incidence->typeID() == todoID ) | 1773 | if ( incidence->typeID() == todoID ) |
1774 | icon = QIconSet ( tP ); | 1774 | icon = QIconSet ( tP ); |
1775 | else if ( incidence->typeID() == eventID ) | 1775 | else if ( incidence->typeID() == eventID ) |
1776 | icon = QIconSet ( eP ); | 1776 | icon = QIconSet ( eP ); |
1777 | else if ( incidence->typeID() == journalID ) | 1777 | else if ( incidence->typeID() == journalID ) |
1778 | icon = QIconSet ( jP ); | 1778 | icon = QIconSet ( jP ); |
1779 | mPrintSelAction->setIconSet ( icon ); | 1779 | mPrintSelAction->setIconSet ( icon ); |
1780 | #endif | 1780 | #endif |
1781 | } | 1781 | } |
1782 | 1782 | ||
1783 | void MainWindow::enableIncidenceActions( bool enabled ) | 1783 | void MainWindow::enableIncidenceActions( bool enabled ) |
1784 | { | 1784 | { |
1785 | mShowAction->setEnabled( enabled ); | 1785 | mShowAction->setEnabled( enabled ); |
1786 | mEditAction->setEnabled( enabled ); | 1786 | mEditAction->setEnabled( enabled ); |
1787 | mDeleteAction->setEnabled( enabled ); | 1787 | mDeleteAction->setEnabled( enabled ); |
1788 | 1788 | ||
1789 | mCloneAction->setEnabled( enabled ); | 1789 | mCloneAction->setEnabled( enabled ); |
1790 | mMoveAction->setEnabled( enabled ); | 1790 | mMoveAction->setEnabled( enabled ); |
1791 | #ifndef DESKTOP_VERSION | 1791 | #ifndef DESKTOP_VERSION |
1792 | mBeamAction->setEnabled( enabled ); | 1792 | mBeamAction->setEnabled( enabled ); |
1793 | #else | 1793 | #else |
1794 | mPrintSelAction->setEnabled( enabled ); | 1794 | mPrintSelAction->setEnabled( enabled ); |
1795 | #endif | 1795 | #endif |
1796 | mCancelAction->setEnabled( enabled ); | 1796 | mCancelAction->setEnabled( enabled ); |
1797 | } | 1797 | } |
1798 | 1798 | ||
1799 | void MainWindow::importOL() | 1799 | void MainWindow::importOL() |
1800 | { | 1800 | { |
1801 | #ifdef _OL_IMPORT_ | 1801 | #ifdef _OL_IMPORT_ |
1802 | mView->clearAllViews(); | 1802 | mView->clearAllViews(); |
1803 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1803 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1804 | id->exec(); | 1804 | id->exec(); |
1805 | delete id; | 1805 | delete id; |
1806 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1806 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1807 | mView->updateView(); | 1807 | mView->updateView(); |
1808 | #endif | 1808 | #endif |
1809 | } | 1809 | } |
1810 | void MainWindow::importBday() | 1810 | void MainWindow::importBday() |
1811 | { | 1811 | { |
1812 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), | 1812 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1813 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1813 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1814 | i18n("Import!"), i18n("Cancel"), 0, | 1814 | i18n("Import!"), i18n("Cancel"), 0, |
1815 | 0, 1 ); | 1815 | 0, 1 ); |
1816 | if ( result == 0 ) { | 1816 | if ( result == 0 ) { |
1817 | mView->importBday(); | 1817 | mView->importBday(); |
1818 | 1818 | ||
1819 | } | 1819 | } |
1820 | 1820 | ||
1821 | 1821 | ||
1822 | } | 1822 | } |
1823 | void MainWindow::importQtopia() | 1823 | void MainWindow::importQtopia() |
1824 | { | 1824 | { |
1825 | //#ifndef DESKTOP_VERSION | 1825 | //#ifndef DESKTOP_VERSION |
1826 | 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"); | 1826 | 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"); |
1827 | #ifdef DESKTOP_VERSION | 1827 | #ifdef DESKTOP_VERSION |
1828 | 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"); | 1828 | 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"); |
1829 | #endif | 1829 | #endif |
1830 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1830 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1831 | i18n("Import!"), i18n("Cancel"), 0, | 1831 | i18n("Import!"), i18n("Cancel"), 0, |
1832 | 0, 1 ); | 1832 | 0, 1 ); |
1833 | if ( result == 0 ) { | 1833 | if ( result == 0 ) { |
1834 | #ifndef DESKTOP_VERSION | 1834 | #ifndef DESKTOP_VERSION |
1835 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1835 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1836 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1836 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1837 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1837 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1838 | #else | 1838 | #else |
1839 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1839 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1840 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1840 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1841 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1841 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1842 | #endif | 1842 | #endif |
1843 | mView->importQtopia( categories, datebook, todolist ); | 1843 | mView->importQtopia( categories, datebook, todolist ); |
1844 | } | 1844 | } |
1845 | mView->calendar()->reInitAlarmSettings(); | 1845 | mView->calendar()->reInitAlarmSettings(); |
1846 | #if 0 | 1846 | #if 0 |
1847 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1847 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1848 | i18n("Not supported \non desktop!\n"), | 1848 | i18n("Not supported \non desktop!\n"), |
1849 | i18n("Ok"), i18n("Cancel"), 0, | 1849 | i18n("Ok"), i18n("Cancel"), 0, |
1850 | 0, 1 ); | 1850 | 0, 1 ); |
1851 | 1851 | ||
1852 | #endif | 1852 | #endif |
1853 | } | 1853 | } |
1854 | 1854 | ||
1855 | void MainWindow::saveOnClose() | 1855 | void MainWindow::saveOnClose() |
1856 | { | 1856 | { |
1857 | KOPrefs *p = KOPrefs::instance(); | 1857 | KOPrefs *p = KOPrefs::instance(); |
1858 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1858 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1859 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | 1859 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); |
1860 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | 1860 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); |
1861 | if ( filterToolBar ) { | 1861 | if ( filterToolBar ) { |
1862 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | 1862 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); |
1863 | } | 1863 | } |
1864 | #ifdef DESKTOP_VERSION | 1864 | #ifdef DESKTOP_VERSION |
1865 | 1865 | ||
1866 | QPoint myP; | 1866 | QPoint myP; |
1867 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1867 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1868 | if ( p->mToolBarHor ) | 1868 | if ( p->mToolBarHor ) |
1869 | p->mToolBarUp = myP.y() > height()/2; | 1869 | p->mToolBarUp = myP.y() > height()/2; |
1870 | else | 1870 | else |
1871 | p->mToolBarUp = myP.x() > width()/2; | 1871 | p->mToolBarUp = myP.x() > width()/2; |
1872 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1872 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1873 | if ( p->mToolBarHorV ) | 1873 | if ( p->mToolBarHorV ) |
1874 | p->mToolBarUpV = myP.y() > height()/2; | 1874 | p->mToolBarUpV = myP.y() > height()/2; |
1875 | else | 1875 | else |
1876 | p->mToolBarUpV = myP.x() > width()/2 ; | 1876 | p->mToolBarUpV = myP.x() > width()/2 ; |
1877 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1877 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1878 | if ( p->mToolBarHorN ) | 1878 | if ( p->mToolBarHorN ) |
1879 | p->mToolBarUpN = myP.y() > height()/2; | 1879 | p->mToolBarUpN = myP.y() > height()/2; |
1880 | else | 1880 | else |
1881 | p->mToolBarUpN = myP.x() > width()/2 ; | 1881 | p->mToolBarUpN = myP.x() > width()/2 ; |
1882 | if ( filterToolBar ) { | 1882 | if ( filterToolBar ) { |
1883 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1883 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1884 | if ( p->mToolBarHorF ) | 1884 | if ( p->mToolBarHorF ) |
1885 | p->mToolBarUpF = myP.y() > height()/2; | 1885 | p->mToolBarUpF = myP.y() > height()/2; |
1886 | else | 1886 | else |
1887 | p->mToolBarUpF = myP.x() > width()/2 ; | 1887 | p->mToolBarUpF = myP.x() > width()/2 ; |
1888 | } | 1888 | } |
1889 | #else | 1889 | #else |
1890 | if ( p->mToolBarHor ) | 1890 | if ( p->mToolBarHor ) |
1891 | p->mToolBarUp = iconToolBar->y() > height()/2; | 1891 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1892 | else | 1892 | else |
1893 | p->mToolBarUp = iconToolBar->x() > width()/2; | 1893 | p->mToolBarUp = iconToolBar->x() > width()/2; |
1894 | if ( p->mToolBarHorV ) | 1894 | if ( p->mToolBarHorV ) |
1895 | p->mToolBarUpV = viewToolBar->y() > height()/2; | 1895 | p->mToolBarUpV = viewToolBar->y() > height()/2; |
1896 | else | 1896 | else |
1897 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; | 1897 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; |
1898 | 1898 | ||
1899 | if ( p->mToolBarHorN ) | 1899 | if ( p->mToolBarHorN ) |
1900 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; | 1900 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; |
1901 | else | 1901 | else |
1902 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | 1902 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; |
1903 | if ( filterToolBar ) { | 1903 | if ( filterToolBar ) { |
1904 | if ( p->mToolBarHorF ) | 1904 | if ( p->mToolBarHorF ) |
1905 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1905 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1906 | else | 1906 | else |
1907 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1907 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1908 | } | 1908 | } |
1909 | #endif | 1909 | #endif |
1910 | save(); | 1910 | save(); |
1911 | mView->writeSettings(); | 1911 | mView->writeSettings(); |
1912 | mView->checkSuspendAlarm(); | 1912 | mView->checkSuspendAlarm(); |
1913 | } | 1913 | } |
1914 | void MainWindow::slotModifiedChanged( bool ) | 1914 | void MainWindow::slotModifiedChanged( bool ) |
1915 | { | 1915 | { |
1916 | if ( mBlockAtStartup ) | 1916 | if ( mBlockAtStartup ) |
1917 | return; | 1917 | return; |
1918 | 1918 | ||
1919 | int msec; | 1919 | int msec; |
1920 | if ( mCalendarModifiedFlag ) { | 1920 | if ( mCalendarModifiedFlag ) { |
1921 | //qDebug(" MainWindow timer is running "); | 1921 | //qDebug(" MainWindow timer is running "); |
1922 | return; | 1922 | return; |
1923 | } | 1923 | } |
1924 | // we store the changes after 1 minute, | 1924 | // we store the changes after 1 minute, |
1925 | // and for safety reasons after 10 minutes again | 1925 | // and for safety reasons after 10 minutes again |
1926 | if ( !mSyncManager->blockSave() ) | 1926 | if ( !mSyncManager->blockSave() ) |
1927 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1927 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1928 | else | 1928 | else |
1929 | msec = 1000 * 600; | 1929 | msec = 1000 * 600; |
1930 | mSaveTimer.start( msec, true ); // 1 minute | 1930 | mSaveTimer.start( msec, true ); // 1 minute |
1931 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1931 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1932 | mCalendarModifiedFlag = true; | 1932 | mCalendarModifiedFlag = true; |
1933 | } | 1933 | } |
1934 | void MainWindow::saveStopTimer() | 1934 | void MainWindow::saveStopTimer() |
1935 | { | 1935 | { |
1936 | mSaveTimer.stop(); | 1936 | mSaveTimer.stop(); |
1937 | } | 1937 | } |
1938 | void MainWindow::backupAllFiles() | 1938 | void MainWindow::backupAllFiles() |
1939 | { | 1939 | { |
1940 | QDate reference ( 2000,1,1); | 1940 | QDate reference ( 2000,1,1); |
1941 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1941 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1942 | setCaption(i18n("Creating backup ... please wait ..." )); | 1942 | setCaption(i18n("Creating backup ... please wait ..." )); |
1943 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); | 1943 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); |
1944 | // we need the file path, the backup dir and the number of bups as param | 1944 | // we need the file path, the backup dir and the number of bups as param |
1945 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 1945 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
1946 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 1946 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
1947 | bupDir = KGlobalSettings::backupDataDir(); | 1947 | bupDir = KGlobalSettings::backupDataDir(); |
1948 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1948 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1949 | if ( retval == 0 ) { | 1949 | if ( retval == 0 ) { |
1950 | setCaption(i18n("Backup cancelled" )); | 1950 | setCaption(i18n("Backup cancelled" )); |
1951 | qDebug("KO: Backup cancelled. Will try again tomorrow "); | 1951 | qDebug("KO: Backup cancelled. Will try again tomorrow "); |
1952 | // retval == 0 : backup skipped for today, try again tomorrow | 1952 | // retval == 0 : backup skipped for today, try again tomorrow |
1953 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; | 1953 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; |
1954 | } else if ( retval == 1 ){ | 1954 | } else if ( retval == 1 ){ |
1955 | qDebug("KO: Backup created."); | 1955 | qDebug("KO: Backup created."); |
1956 | // backup ok | 1956 | // backup ok |
1957 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 1957 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
1958 | KopiCalendarFile * cal = calendars.first(); | 1958 | KopiCalendarFile * cal = calendars.first(); |
1959 | cal = calendars.next(); | 1959 | cal = calendars.next(); |
1960 | while ( cal ) { | 1960 | while ( cal ) { |
1961 | if ( !cal->mErrorOnLoad ) { | 1961 | if ( !cal->mErrorOnLoad ) { |
1962 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1962 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1963 | } | 1963 | } |
1964 | cal = calendars.next(); | 1964 | cal = calendars.next(); |
1965 | } | 1965 | } |
1966 | KOPrefs::instance()->mLastBackupDate = daysTo; | 1966 | KOPrefs::instance()->mLastBackupDate = daysTo; |
1967 | setCaption(i18n("Backup succesfully finished" )); | 1967 | setCaption(i18n("Backup succesfully finished" )); |
1968 | } else if ( retval == 2 ){ | 1968 | } else if ( retval == 2 ){ |
1969 | setCaption(i18n("Backup globally disabled" )); | 1969 | setCaption(i18n("Backup globally disabled" )); |
1970 | qDebug("KO: Backup globally cancelled."); | 1970 | qDebug("KO: Backup globally cancelled."); |
1971 | // backup globally cancelled | 1971 | // backup globally cancelled |
1972 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 1972 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
1973 | } | 1973 | } |
1974 | // retval == 3: do nothing, try again later | 1974 | // retval == 3: do nothing, try again later |
1975 | } | 1975 | } |
1976 | void MainWindow::save() | 1976 | void MainWindow::save() |
1977 | { | 1977 | { |
1978 | 1978 | ||
1979 | if ( mView->viewManager()->journalView() ) | 1979 | if ( mView->viewManager()->journalView() ) |
1980 | mView->viewManager()->journalView()->checkModified(); | 1980 | mView->viewManager()->journalView()->checkModified(); |
1981 | if ( !mCalendarModifiedFlag ) { | 1981 | if ( !mCalendarModifiedFlag ) { |
1982 | qDebug("KO: Calendar not modified. Nothing saved."); | 1982 | qDebug("KO: Calendar not modified. Nothing saved."); |
1983 | return; | 1983 | return; |
1984 | } | 1984 | } |
1985 | if ( mSyncManager->blockSave() ) { | 1985 | if ( mSyncManager->blockSave() ) { |
1986 | return; | 1986 | return; |
1987 | } | 1987 | } |
1988 | mSyncManager->setBlockSave(true); | 1988 | mSyncManager->setBlockSave(true); |
1989 | if ( mView->checkAllFileVersions() ) { | 1989 | if ( mView->checkAllFileVersions() ) { |
1990 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ | 1990 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ |
1991 | QDate reference ( 2000,1,1); | 1991 | QDate reference ( 2000,1,1); |
1992 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1992 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1993 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { | 1993 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { |
1994 | backupAllFiles(); | 1994 | backupAllFiles(); |
1995 | } | 1995 | } |
1996 | ; // KPimGlobalPrefs::instance()->mLastBackupDate | 1996 | ; // KPimGlobalPrefs::instance()->mLastBackupDate |
1997 | } | 1997 | } |
1998 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1998 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1999 | if ( !isMinimized () ) | 1999 | if ( !isMinimized () ) |
2000 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 2000 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
2001 | qDebug("KO: Start saving data to file!"); | 2001 | qDebug("KO: Start saving data to file!"); |
2002 | mView->saveCalendars(); | 2002 | mView->saveCalendars(); |
2003 | mCalendarModifiedFlag = false; | 2003 | mCalendarModifiedFlag = false; |
2004 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 2004 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
2005 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 2005 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
2006 | QString savemes; | 2006 | QString savemes; |
2007 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 2007 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
2008 | if ( !isMinimized () ) | 2008 | if ( !isMinimized () ) |
2009 | setCaption(savemes); | 2009 | setCaption(savemes); |
2010 | else | 2010 | else |
2011 | qDebug(savemes); | 2011 | qDebug(savemes); |
2012 | } else { | 2012 | } else { |
2013 | setCaption(i18n("Saving cancelled!")); | 2013 | setCaption(i18n("Saving cancelled!")); |
2014 | mCalendarModifiedFlag = false; | 2014 | mCalendarModifiedFlag = false; |
2015 | slotModifiedChanged( true ); | 2015 | slotModifiedChanged( true ); |
2016 | } | 2016 | } |
2017 | mSyncManager->setBlockSave( false ); | 2017 | mSyncManager->setBlockSave( false ); |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 2020 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
2021 | { | 2021 | { |
2022 | if ( !e->isAutoRepeat() ) { | 2022 | if ( !e->isAutoRepeat() ) { |
2023 | mFlagKeyPressed = false; | 2023 | mFlagKeyPressed = false; |
2024 | } | 2024 | } |
2025 | } | 2025 | } |
2026 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 2026 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
2027 | { | 2027 | { |