summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 88dbd4f..cbf6096 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1589,194 +1589,198 @@ void MainWindow::keyBindings()
i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
i18n("<p><b>White</b>: Item readonly</p>\n");
displayText( text, cap);
}
void MainWindow::aboutAutoSaving()
{
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");
KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
}
void MainWindow::aboutKnownBugs()
{
QMessageBox* msg;
msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
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")+
i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
i18n("\nor report them in the bugtracker on\n") +
i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
msg->exec();
delete msg;
}
QString MainWindow::defaultFileName()
{
return locateLocal( "data", "korganizer/mycalendar.ics" );
}
QString MainWindow::syncFileName()
{
#ifdef DESKTOP_VERSION
return locateLocal( "tmp", "synccalendar.ics" );
#else
return QString( "/tmp/synccalendar.ics" );
#endif
}
#include "koglobals.h"
#include <kcalendarsystem.h>
void MainWindow::updateWeek(QDate seda)
{
int weekNum = KGlobal::locale()->weekNum ( seda );
mWeekPixmap.fill( mWeekBgColor );
QPainter p ( &mWeekPixmap );
p.setFont( mWeekFont );
p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
p.end();
QIconSet icon3 ( mWeekPixmap );
mWeekAction->setIconSet ( icon3 );
}
void MainWindow::updateWeekNum(const DateList &selectedDates)
{
updateWeek( selectedDates.first() );
}
void MainWindow::processIncidenceSelection( Incidence *incidence )
{
if ( !incidence ) {
mShowAction->setMenuText( i18n("Show") );
enableIncidenceActions( false );
mNewSubTodoAction->setEnabled( false );
setCaptionToDates();
return;
}
QString startString = "";
if ( incidence->typeID() != todoID ) {
if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
if ( incidence->doesFloat() ) {
startString += ": "+incidence->dtStartDateStr( true );
startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
} else {
startString = ": "+incidence->dtStartStr(true);
startString += " --- "+((Event*)incidence)->dtEndStr(true);
}
} else {
if ( incidence->dtStart().time() != incidence->dtEnd().time() )
startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
"-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
if ( incidence->isBirthday() || incidence->isAnniversary() ) {
bool ok;
QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
if ( ok ) {
int years = noc.date().year() - incidence->dtStart().date().year();
startString += i18n(" (%1 y.)"). arg( years );
}
}
else
startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
}
}
+ else {
+ if ( (( KCal::Todo*)incidence)->percentComplete() == 100 )
+ startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) );
else
startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
+ }
if ( !incidence->location().isEmpty() )
startString += " (" +incidence->location()+")";
setCaption( incidence->summary()+startString);
enableIncidenceActions( true );
if ( incidence->typeID() == eventID ) {
mShowAction->setMenuText( i18n("Show Event") );
mNewSubTodoAction->setEnabled( false );
} else if ( incidence->typeID() == todoID ) {
mShowAction->setMenuText( i18n("Show Todo") );
mNewSubTodoAction->setEnabled( true );
} else {
mShowAction->setMenuText( i18n("Show") );
mNewSubTodoAction->setEnabled( false );
}
}
void MainWindow::enableIncidenceActions( bool enabled )
{
mShowAction->setEnabled( enabled );
mEditAction->setEnabled( enabled );
mDeleteAction->setEnabled( enabled );
mCloneAction->setEnabled( enabled );
mMoveAction->setEnabled( enabled );
#ifndef DESKTOP_VERSION
mBeamAction->setEnabled( enabled );
#endif
mCancelAction->setEnabled( enabled );
}
void MainWindow::importOL()
{
#ifdef _OL_IMPORT_
mView->clearAllViews();
KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
id->exec();
delete id;
mView->calendar()->checkAlarmForIncidence( 0, true );
mView->updateView();
#endif
}
void MainWindow::importBday()
{
int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
i18n("Import!"), i18n("Cancel"), 0,
0, 1 );
if ( result == 0 ) {
mView->importBday();
}
}
void MainWindow::importQtopia()
{
//#ifndef DESKTOP_VERSION
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");
#ifdef DESKTOP_VERSION
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");
#endif
int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
i18n("Import!"), i18n("Cancel"), 0,
0, 1 );
if ( result == 0 ) {
#ifndef DESKTOP_VERSION
QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
#else
QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
#endif
mView->importQtopia( categories, datebook, todolist );
}
mView->calendar()->reInitAlarmSettings();
#if 0
int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
i18n("Not supported \non desktop!\n"),
i18n("Ok"), i18n("Cancel"), 0,
0, 1 );
#endif
}
void MainWindow::saveOnClose()
{
KOPrefs *p = KOPrefs::instance();
p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
if ( filterToolBar ) {
p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
}
#ifdef DESKTOP_VERSION