summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/mainwindow.cpp26
-rw-r--r--korganizer/mainwindow.h1
3 files changed, 24 insertions, 5 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 9e7f18c..6560877 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -171,193 +171,193 @@ KOPrefs::KOPrefs() :
// qDebug(" KPrefs::setCurrentGroup(Fonts); ");
QFont fon = KGlobalSettings::generalFont();
addItemFont("TimeBar Font",&mTimeBarFont,fon );
addItemFont("MonthView Font",&mMonthViewFont,fon);
addItemFont("AgendaView Font",&mAgendaViewFont,fon);
addItemFont("MarcusBains Font",&mMarcusBainsFont,fon);
addItemFont("TimeLabels Font",&mTimeLabelsFont,fon);
addItemFont("TodoView Font",&mTodoViewFont,fon);
addItemFont("ListView Font",&mListViewFont,fon);
addItemFont("DateNavigator Font",&mDateNavigatorFont,fon);
addItemFont("EditBox Font",&mEditBoxFont,fon);
addItemFont("JournalView Font",&mJornalViewFont,fon);
addItemFont("WhatsNextView Font",&mWhatsNextFont,fon);
addItemFont("EventView Font",&mEventViewFont,fon);
KPrefs::setCurrentGroup("RemoteSyncing");
addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
addItemInt("LastSyncTime",&mLastSyncTime,0);
#ifdef _WIN32_
QString hdp= locateLocal("data","korganizer")+"\\\\";
#else
QString hdp= locateLocal("data","korganizer")+"/";
#endif
KPrefs::setCurrentGroup("LoadSaveFileNames");
addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
KPrefs::setCurrentGroup("Locale");
addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
KPrefs::setCurrentGroup("Colors");
addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
addItemBool("MonthViewWeek",&mMonthViewWeek,false);
addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
addItemBool("UseAppColors",&mUseAppColors,false);
KPrefs::setCurrentGroup("Views");
addItemBool("Block Popup Menu",&mBlockPopupMenu,false);
addItemBool("Show Date Navigator",&mShowDateNavigator,true);
addItemInt("Hour Size",&mHourSize,8);
addItemBool("Show Daily Recurrences",&mDailyRecur,true);
addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
addItemBool("ShowShortMonthName",&mMonthShowShort,false);
addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
#ifdef DESKTOP_VERION
addItemBool("Enable ToolTips",&mEnableToolTips,true);
#else
addItemBool("Enable ToolTips",&mEnableToolTips,false);
#endif
addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
- addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,true);
+ addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false);
addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
#ifdef DESKTOP_VERSION
addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
#else
addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
#endif
addItemInt("Day Begins",&mDayBegins,7);
addItemInt("Working Hours Start",&mWorkingHoursStart,8);
addItemInt("Working Hours End",&mWorkingHoursEnd,17);
addItemBool("Exclude Holidays",&mExcludeHolidays,true);
addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
addItemBool("Full View Month",&mFullViewMonth,true);
addItemBool("Full View Todo",&mFullViewTodo,true);
addItemBool("Quick Todo",&mEnableQuickTodo,false);
addItemInt("Next X Days",&mNextXDays,3);
KPrefs::setCurrentGroup("Printer");
KPrefs::setCurrentGroup("Layout");
addItemBool("CompactDialogs",&mCompactDialogs,false);
addItemBool("VerticalScreen",&mVerticalScreen,true);
KPrefs::setCurrentGroup("KOrganizer Plugins");
addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
KPrefs::setCurrentGroup("Group Scheduling");
addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
addItemStringList("AdditionalMails",&mAdditionalMails,"");
addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
KPrefs::setCurrentGroup( "Editors" );
addItemStringList( "EventTemplates", &mEventTemplates );
addItemStringList( "TodoTemplates", &mTodoTemplates );
addItemInt("DestinationPolicy",&mDestination,standardDestination);
KPrefs::setCurrentGroup( "ViewOptions" );
addItemBool("EVshowDetails",&mEVshowDetails,true);
addItemBool("EVshowCreated",&mEVshowCreated,true);
addItemBool("EVshowChanged",&mEVshowChanged,true);
addItemBool("WTshowDetails",&mWTshowDetails,false);
addItemBool("WTshowCreated",&mWTshowCreated,false);
addItemBool("WTshowChanged",&mWTshowChanged,false);
mCalendars.setAutoDelete( true );
}
KOPrefs::~KOPrefs()
{
if (mInstance == this)
mInstance = insd.setObject(0);
mCalendars.setAutoDelete( true );
mCalendars.clear();
//qDebug("KOPrefs::~KOPrefs() ");
}
KOPrefs *KOPrefs::instance()
{
if (!mInstance) {
mInstance = insd.setObject(new KOPrefs());
mInstance->readConfig();
}
return mInstance;
}
void KOPrefs::usrSetDefaults()
{
}
void KOPrefs::fillMailDefaults()
{
if (mName.isEmpty()) mName = i18n("Anonymous");
if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
}
void KOPrefs::setTimeZoneIdDefault()
{
;
}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index bfae1b5..5249300 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1025,240 +1025,243 @@ void MainWindow::initActions()
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
actionMenu->insertSeparator();
action = new QAction( "manage cat", i18n("Edit category list..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
actionMenu->insertSeparator();
icon = loadPixmap( pathString + "configure" );
action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( edit_options() ) );
action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ),
this, SLOT( calHint() ) );
action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( edit_global_options() ) );
if ( KOPrefs::instance()->mShowFullMenu ) {
actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
}
// actionMenu->insertSeparator();
action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
this );
action->addTo( importMenu_X );
connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
action = new QAction( "import_quick", i18n("Import last file"), 0,
this );
action->addTo( importMenu_X );
connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
importMenu_X->insertSeparator();
action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
this );
action->addTo( importMenu_X );
connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
//#ifndef DESKTOP_VERSION
importMenu_X->insertSeparator();
action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
this );
action->addTo( importMenu_X );
connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
//#else
#ifdef _OL_IMPORT_
importMenu_X->insertSeparator();
action = new QAction( "import_ol", i18n("Import from OL"), 0,
this );
action->addTo( importMenu_X );
connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
#endif
//#endif
//importMenu->insertSeparator();
#if 0
action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
#endif
action = new QAction( "save_cal", i18n("Save Backup..."), 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
importMenu->insertSeparator();
importMenu->insertItem( i18n("Import"), importMenu_X );
//importMenu->insertSeparator();
action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
this );
action->addTo( exportMenu_X );
connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
//LR
QPopupMenu *ex2phone = new QPopupMenu( this );
ex2phone->insertItem(i18n("Complete calendar..."), 1 );
ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
importMenu->insertItem( i18n("Export"), exportMenu_X );
+ mPrintSelAction = 0;
#ifndef DESKTOP_VERSION
//importMenu->insertSeparator();
brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
this );
brAction->addTo( beamMenu_X );
brAction->setToggleAction (true ) ;
connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
importMenu->insertItem( i18n("Beam"), beamMenu_X );
#else
//importMenu->insertSeparator();
icon = loadPixmap( pathString + "print" );
action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ),
this, SLOT( printCal() ) );
- icon = loadPixmap( pathString + "print" );
+ icon = loadPixmap( pathString + "week" );
action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ),
this, SLOT( printSel() ) );
+ icon = loadPixmap( pathString + "whatsnext" );
action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ),
mView->viewManager(), SLOT( slotprintWNV() ) );
- icon = loadPixmap( pathString + "print" );
+ icon = loadPixmap( pathString + "list" );
action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ),
this, SLOT( printListView() ) );
+ icon = loadPixmap( pathString + "newevent" );
action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ),
mView, SLOT( slotprintSelInc() ) );
-
+ mPrintSelAction = action;
importMenu->insertItem( i18n("Print"), beamMenu_X );
#endif
importMenu->insertSeparator();
action = new QAction( "beam all", i18n("Save"), 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
action = new QAction( "beam all", i18n("Exit (+save)"), 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
//menuBar->insertItem( "Configure",configureMenu );
//configureMenu->insertItem( "Toolbar",configureToolBarMenu );
icon = loadPixmap( "korganizer/korganizer" );
action = new QAction( "Whats New", i18n("What's new?"), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( whatsNew() ) );
action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( features() ) );
action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( keyBindings() ) );
action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( storagehowto() ) );
action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( timetrackinghowto() ) );
action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( synchowto() ) );
action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( kdesynchowto() ) );
action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( multisynchowto() ) );
action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( aboutAutoSaving() ) );
action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( aboutKnownBugs() ) );
action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( usertrans() ) );
action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( faq() ) );
action = new QAction( "licence", i18n("Licence..."), 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( licence() ) );
action = new QAction( "about", i18n("About..."), 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( about() ) );
//menuBar->insertSeparator();
// ******************************************************
// menubar icons
//menuBar->insertItem( iconToolBar );
//xdays_action
if (p-> mShowIconNewEvent)
ne_action->addTo( iconToolBar );
if (p->mShowIconNewTodo )
nt_action->addTo( iconToolBar );
if (p-> mShowIconSearch)
search_action->addTo( iconToolBar );
if (p-> mShowIconWhatsThis)
QWhatsThis::whatsThisButton ( iconToolBar );
if (p-> mShowIconNext)
whatsnext_action->addTo( viewToolBar );
if (p-> mShowIconNextDays)
xdays_action->addTo( viewToolBar );
if (p-> mShowIconJournal)
viewjournal_action->addTo( viewToolBar );
@@ -1647,205 +1650,220 @@ void MainWindow::aboutKnownBugs()
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 );
}
+ static QPixmap jP = SmallIcon( "journal" );
+ static QPixmap eP = SmallIcon( "newevent" );
+ static QPixmap tP = SmallIcon( "newtodo" );
+#ifdef DESKTOP_VERSION
+ QIconSet icon;
+ if ( incidence->typeID() == todoID )
+ icon = QIconSet ( tP );
+ else if ( incidence->typeID() == eventID )
+ icon = QIconSet ( eP );
+ else if ( incidence->typeID() == journalID )
+ icon = QIconSet ( jP );
+ mPrintSelAction->setIconSet ( icon );
+#endif
}
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
+#else
+ mPrintSelAction->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
QPoint myP;
myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
if ( p->mToolBarHor )
p->mToolBarUp = myP.y() > height()/2;
else
p->mToolBarUp = myP.x() > width()/2;
myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
if ( p->mToolBarHorV )
p->mToolBarUpV = myP.y() > height()/2;
else
p->mToolBarUpV = myP.x() > width()/2 ;
myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
if ( p->mToolBarHorN )
p->mToolBarUpN = myP.y() > height()/2;
else
p->mToolBarUpN = myP.x() > width()/2 ;
if ( filterToolBar ) {
myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
if ( p->mToolBarHorF )
p->mToolBarUpF = myP.y() > height()/2;
else
p->mToolBarUpF = myP.x() > width()/2 ;
}
#else
if ( p->mToolBarHor )
p->mToolBarUp = iconToolBar->y() > height()/2;
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 41d5807..d648f14 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -62,112 +62,113 @@ class MainWindow : public QMainWindow
void usertrans();
void features();
void synchowto();
void storagehowto();
void timetrackinghowto();
void kdesynchowto();
void multisynchowto();
void whatsNew();
void keyBindings();
void aboutAutoSaving();;
void aboutKnownBugs();
void processIncidenceSelection( Incidence * );
void importQtopia();
void importBday();
void importOL();
void importIcal();
void importFile( QString, bool );
void quickImportIcal();
void slotModifiedChanged( bool );
void save();
void backupAllFiles();
void saveStopTimer();
void configureToolBar( int );
void printSel();
void printCal();
void printListView();
void saveCalendar();
void loadCalendar();
void exportVCalendar();
void fillFilterMenu();
void fillFilterMenuTB();
void selectFilter( int );
void fillFilterMenuPopup();
void selectFilterPopup( int );
void exportToPhone( int );
void toggleBeamReceive();
void disableBR(bool);
signals:
void selectWeek ( int );
private slots:
void showConfigureAgenda();
void getFile( bool );
void syncFileRequest();
protected:
void hideEvent ( QHideEvent * );
QString sentSyncFile();
void displayText( QString, QString);
void enableIncidenceActions( bool );
private:
bool mBRdisabled;
#ifndef DESKTOP_VERSION
QCopChannel* infrared;
#endif
QAction* brAction;
KSyncManager* mSyncManager;
bool mClosed;
void saveOnClose();
bool mFlagKeyPressed;
bool mBlockAtStartup;
QPEToolBar *iconToolBar;
QPEToolBar *viewToolBar;
QPEToolBar *navigatorToolBar;
QPEToolBar *filterToolBar;
QMenuBar *filterMenubar;
QPopupMenu * filterPopupMenu;
QPopupMenu * mCurrentItemMenu;
void initActions();
void setDefaultPreferences();
void resizeEvent( QResizeEvent* e);
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
QPopupMenu *configureToolBarMenu;
QPopupMenu *selectFilterMenu;
QPopupMenu *selectFilterMenuTB;
QPopupMenu *configureAgendaMenu, *syncMenu;
CalendarLocal *mCalendar;
CalendarView *mView;
QAction *mNewSubTodoAction;
QAction *mWeekAction;
QFont mWeekFont;
QPixmap mWeekPixmap;
QColor mWeekBgColor;
QAction *mShowAction;
QAction *mEditAction;
QAction *mDeleteAction;
QAction *mCloneAction;
QAction *mMoveAction;
QAction *mBeamAction;
QAction *mCancelAction;
+ QAction *mPrintSelAction;
QAction *mToggleNav;
QAction *mToggleFilter;
QAction *mToggleAllday;
QAction *actionFilterMenuTB;
void closeEvent( QCloseEvent* ce );
QTimer mSaveTimer;
//bool mBlockSaveFlag;
bool mCalendarModifiedFlag;
QPixmap loadPixmap( QString );
QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix;
};
#endif