summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp148
-rw-r--r--korganizer/calendarview.h32
-rw-r--r--korganizer/calprintbase.cpp102
-rw-r--r--korganizer/calprinter.cpp23
-rw-r--r--korganizer/calprinter.h18
-rw-r--r--korganizer/calprintplugins.cpp4
-rw-r--r--korganizer/cellitem.cpp14
-rw-r--r--korganizer/cellitem.h4
-rw-r--r--korganizer/datenavigatorcontainer.cpp2
-rw-r--r--korganizer/datenavigatorcontainer.h5
-rw-r--r--korganizer/filteredit_base.cpp40
-rw-r--r--korganizer/filteredit_base.h42
-rw-r--r--korganizer/filtereditdialog.cpp11
-rw-r--r--korganizer/filtereditdialog.h6
-rw-r--r--korganizer/incomingdialog.cpp30
-rw-r--r--korganizer/incomingdialog.h10
-rw-r--r--korganizer/incomingdialog_base.cpp14
-rw-r--r--korganizer/incomingdialog_base.h22
-rw-r--r--korganizer/interfaces/korganizer/baseview.h8
-rw-r--r--korganizer/interfaces/korganizer/calendarviewbase.h4
-rw-r--r--korganizer/journalentry.cpp39
-rw-r--r--korganizer/journalentry.h9
-rw-r--r--korganizer/kdatenavigator.cpp20
-rw-r--r--korganizer/kdatenavigator.h11
-rw-r--r--korganizer/koagenda.cpp169
-rw-r--r--korganizer/koagenda.h43
-rw-r--r--korganizer/koagendaitem.cpp70
-rw-r--r--korganizer/koagendaitem.h17
-rw-r--r--korganizer/koagendaview.cpp78
-rw-r--r--korganizer/koagendaview.h52
-rw-r--r--korganizer/kocounterdialog.h2
-rw-r--r--korganizer/kodaymatrix.cpp47
-rw-r--r--korganizer/kodaymatrix.h14
-rw-r--r--korganizer/kodialogmanager.cpp8
-rw-r--r--korganizer/kodialogmanager.h4
-rw-r--r--korganizer/koeditordetails.cpp38
-rw-r--r--korganizer/koeditordetails.h12
-rw-r--r--korganizer/koeditorgeneral.cpp39
-rw-r--r--korganizer/koeditorgeneral.h21
-rw-r--r--korganizer/koeditorgeneralevent.cpp32
-rw-r--r--korganizer/koeditorgeneralevent.h12
-rw-r--r--korganizer/koeditorgeneraltodo.cpp39
-rw-r--r--korganizer/koeditorgeneraltodo.h16
-rw-r--r--korganizer/koeditorrecurrence.cpp94
-rw-r--r--korganizer/koeditorrecurrence.h30
-rw-r--r--korganizer/koeventeditor.cpp43
-rw-r--r--korganizer/koeventpopupmenu.cpp17
-rw-r--r--korganizer/koeventpopupmenu.h16
-rw-r--r--korganizer/koeventview.cpp4
-rw-r--r--korganizer/koeventview.h4
-rw-r--r--korganizer/koeventviewer.cpp37
-rw-r--r--korganizer/koeventviewer.h17
-rw-r--r--korganizer/koeventviewerdialog.cpp5
-rw-r--r--korganizer/koeventviewerdialog.h5
-rw-r--r--korganizer/kofilterview.cpp48
-rw-r--r--korganizer/kofilterview.h36
-rw-r--r--korganizer/koimportoldialog.cpp30
-rw-r--r--korganizer/koimportoldialog.h4
-rw-r--r--korganizer/koincidenceeditor.cpp10
-rw-r--r--korganizer/kojournalview.cpp36
-rw-r--r--korganizer/kojournalview.h15
-rw-r--r--korganizer/kolistview.cpp193
-rw-r--r--korganizer/kolistview.h42
-rw-r--r--korganizer/komonthview.cpp218
-rw-r--r--korganizer/komonthview.h57
-rw-r--r--korganizer/koprefs.cpp8
-rw-r--r--korganizer/koprefs.h11
-rw-r--r--korganizer/koprefsdialog.cpp138
-rw-r--r--korganizer/koprefsdialog.h12
-rw-r--r--korganizer/korganizer.pro57
-rw-r--r--korganizer/korganizerE.pro6
-rw-r--r--korganizer/kotimespanview.cpp20
-rw-r--r--korganizer/kotimespanview.h6
-rw-r--r--korganizer/kotodoeditor.cpp43
-rw-r--r--korganizer/kotodoview.cpp198
-rw-r--r--korganizer/kotodoview.h58
-rw-r--r--korganizer/kotodoviewitem.cpp42
-rw-r--r--korganizer/kotodoviewitem.h14
-rw-r--r--korganizer/koviewmanager.cpp8
-rw-r--r--korganizer/kowhatsnextview.cpp38
-rw-r--r--korganizer/kowhatsnextview.h20
-rw-r--r--korganizer/ktimeedit.cpp89
-rw-r--r--korganizer/ktimeedit.h7
-rw-r--r--korganizer/lineview.cpp2
-rw-r--r--korganizer/lineview.h8
-rw-r--r--korganizer/main.cpp10
-rw-r--r--korganizer/mainwindow.cpp316
-rw-r--r--korganizer/mainwindow.h68
-rw-r--r--korganizer/navigatorbar.cpp29
-rw-r--r--korganizer/navigatorbar.h7
-rw-r--r--korganizer/outgoingdialog.cpp28
-rw-r--r--korganizer/outgoingdialog.h10
-rw-r--r--korganizer/outgoingdialog_base.cpp18
-rw-r--r--korganizer/outgoingdialog_base.h22
-rw-r--r--korganizer/publishdialog.cpp18
-rw-r--r--korganizer/publishdialog.h4
-rw-r--r--korganizer/publishdialog_base.cpp27
-rw-r--r--korganizer/publishdialog_base.h28
-rw-r--r--korganizer/savetemplatedialog.cpp7
-rw-r--r--korganizer/searchdialog.cpp43
-rw-r--r--korganizer/searchdialog.h16
-rw-r--r--korganizer/statusdialog.cpp9
-rw-r--r--korganizer/timeline.cpp6
-rw-r--r--korganizer/timeline.h4
-rw-r--r--korganizer/timespanview.cpp22
-rw-r--r--korganizer/timespanview.h10
106 files changed, 2091 insertions, 1688 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 8385bcc..c1a2f76 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -11,64 +11,70 @@
Laszlo Boloni (boloni@cs.purdue.edu)
Copyright (c) 2000, 2001, 2002
Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include <qapplication.h>
#include <qradiobutton.h>
-#include <qbuttongroup.h>
+#include <q3buttongroup.h>
#include <qlayout.h>
#include <qclipboard.h>
#include <qcursor.h>
#include <qmessagebox.h>
-#include <qprogressbar.h>
-#include <qmultilineedit.h>
+#include <q3progressbar.h>
+#include <q3multilineedit.h>
#include <qtimer.h>
-#include <qwidgetstack.h>
-#include <qptrlist.h>
+#include <q3widgetstack.h>
+#include <q3ptrlist.h>
#include <qregexp.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#include <qfile.h>
#include <qdir.h>
#ifndef KORG_NOSPLITTER
#include <qsplitter.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <QKeyEvent>
+#include <Q3Frame>
+#include <QLabel>
+#include <Q3ValueList>
#endif
#include <kglobal.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include <knotifyclient.h>
#include <kconfig.h>
#include <libkdepim/ksyncprefsdialog.h>
#include <krun.h>
#include <kdirwatch.h>
#include <libkdepim/kdatepicker.h>
#include <libkdepim/ksyncprofile.h>
#include <libkdepim/kpimglobalprefs.h>
#include <libkcal/vcaldrag.h>
#include <libkcal/icaldrag.h>
#include <libkcal/icalformat.h>
#include <libkcal/vcalformat.h>
#include <libkcal/scheduler.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/journal.h>
@@ -107,61 +113,61 @@
#include "koagenda.h"
#include "kodialogmanager.h"
#include "outgoingdialog.h"
#include "incomingdialog.h"
#include "datenavigatorcontainer.h"
#include "statusdialog.h"
#include "kdatenavigator.h"
#include "kotodoview.h"
#include "datenavigator.h"
#include "resourceview.h"
#include "navigatorbar.h"
#include "searchdialog.h"
#include "mainwindow.h"
#include "categoryeditdialog.h"
#include "calendarview.h"
#ifndef DESKTOP_VERSION
#include <qtopia/alarmserver.h>
#endif
#ifndef _WIN32_
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#else
-#include <qprocess.h>
+#include <q3process.h>
#endif
#ifdef DESKTOP_VERSION
#include <kabc/stdaddressbook.h>
#endif
using namespace KOrg;
using namespace KCal;
extern int globalFlagBlockAgenda;
extern int globalFlagBlockStartup;
-MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
+MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms,QDateTime start ) : Q3TextBrowser(parent)
{
mAlarms = alarms;
viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
QString mText = "<table width=\"100%\">\n";
//mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
#ifdef DESKTOP_VERSION
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
#else
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
#endif
// mText += "<img src=\"";
// mText += ipath;
// mText += "\">";
//mEventDate = QDate::currentDate();
#ifdef DESKTOP_VERSION
mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>";
#else
mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>";
#endif
//mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
Incidence * inc = getNextInc( start );
int time = 0;
@@ -256,89 +262,89 @@ void MissedAlarmTextBrowser::setSource(const QString & n)
#ifdef DESKTOP_VERSION
emit showIncidence(n.mid(8));
#else
emit showIncidence(n.mid(6));
#endif
return;
} else if (n.startsWith("todo:")) {
#ifdef DESKTOP_VERSION
emit showIncidence(n.mid(7));
#else
emit showIncidence(n.mid(5));
#endif
return;
}
}
class KOBeamPrefs : public QDialog
{
public:
KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("Beam Options") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
- QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
+ Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("File format"), this );
lay->addWidget( format );
format->setExclusive ( true ) ;
- QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
+ Q3ButtonGroup* time = new Q3ButtonGroup(1, Qt::Horizontal, i18n("Time format"), this );
lay->addWidget( time ); time->setExclusive ( true ) ;
vcal = new QRadioButton(" vCalendar ", format );
ical = new QRadioButton(" iCalendar ", format );
vcal->setChecked( true );
tz = new QRadioButton(i18n(" With timezone "), time );
local = new QRadioButton(i18n(" Local time "), time );
tz->setChecked( true );
QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
lay->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
resize( 200, 200 );
}
bool beamVcal() { return vcal->isChecked(); }
bool beamLocal() { return local->isChecked(); }
private:
QRadioButton* vcal, *ical, *local, *tz;
};
class KOCatPrefs : public QDialog
{
public:
KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("Manage new Categories") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this );
lay->addWidget( lab );
- QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
+ Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this );
lay->addWidget( format );
format->setExclusive ( true ) ;
addCatBut = new QRadioButton(i18n("Add to category list"), format );
new QRadioButton(i18n("Remove from Events/Todos"), format );
addCatBut->setChecked( true );
QPushButton * ok = new QPushButton( i18n("Change category list now!"), this );
lay->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
resize( 200, 200 );
}
bool addCat() { return addCatBut->isChecked(); }
private:
QRadioButton* addCatBut;
};
CalendarView::CalendarView( CalendarResources *calendar,
QWidget *parent, const char *name )
: CalendarViewBase( parent, name ),
@@ -352,178 +358,178 @@ CalendarView::CalendarView( CalendarResources *calendar,
init();
}
CalendarView::CalendarView( Calendar *calendar,
QWidget *parent, const char *name )
: CalendarViewBase( parent, name ),
mCalendar( calendar ),
mResourceManager( 0 )
{
mEventEditor = 0;
mTodoEditor = 0;
init();
}
void CalendarView::init()
{
mMultiResourceSync = false;
flag_blockConflict = false;
flag_blockScrollBar = false;
flag_checkFileFirsttime = true;
flag_clearallviewsEventDisplay = false;
flag_clearallviewsupdateView = false;
mNextAlarmDateTime = QDateTime::currentDateTime();
- setFocusPolicy (NoFocus );
+ setFocusPolicy (Qt::NoFocus );
mViewerCallerIsSearchDialog = false;
mBlockShowDates = false;
mConflictingEvent = 0;
mDatePickerMode = 0;
mCurrentSyncDevice = "";
mViewManager = new KOViewManager( this );
mDialogManager = new KODialogManager( this );
mEventViewerDialog = 0;
mModified = false;
mReadOnly = false;
mSelectedIncidence = 0;
mCalPrinter = 0;
mFilters.setAutoDelete(true);
mCalendar->registerObserver( this );
// TODO: Make sure that view is updated, when calendar is changed.
mStorage = new FileStorage( mCalendar );
mNavigator = new DateNavigator( this, "datevav", mViewManager );
- QBoxLayout *topLayout = (QBoxLayout*)layout();
+ Q3BoxLayout *topLayout = (Q3BoxLayout*)layout();
#ifndef KORG_NOSPLITTER
// create the main layout frames.
mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
topLayout->addWidget(mPanner);
mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
"CalendarView::LeftFrame");
mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
"CalendarView::DateNavigator" );
mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
mTodoList->setNavigator( mNavigator );
mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
#ifdef KORG_NORESOURCEVIEW
mResourceView = 0;
#else
if ( mResourceManager ) {
mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
mResourceView->updateView();
connect( mResourceView, SIGNAL( resourcesChanged() ),
SLOT( updateView() ) );
} else {
mResourceView = 0;
}
#endif
QWidget *rightBox = new QWidget( mPanner );
- QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
+ Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox );
- mRightFrame = new QWidgetStack( rightBox );
+ mRightFrame = new Q3WidgetStack( rightBox );
rightLayout->addWidget( mRightFrame, 1 );
mLeftFrame = mLeftSplitter;
#else
//QWidget *mainBox = new QWidget( this );
//QWidget *leftFrame = new QWidget( mainBox );
//QBoxLayout * mainBoxLayout;
if ( KOPrefs::instance()->mVerticalScreen ) {
//mainBoxLayout = new QVBoxLayout(mainBox);
//leftFrameLayout = new QHBoxLayout(leftFrame );
mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
} else {
//mainBoxLayout = new QHBoxLayout(mainBox);
//leftFrameLayout = new QVBoxLayout(leftFrame );
mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
}
mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
//QBoxLayout * leftFrameLayout;
topLayout->addWidget( mMainFrame );
#ifdef DESKTOP_VERSION
- mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this );
+ mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,Qt::Horizontal, this );
topLayout->addWidget( mDateScrollBar );
connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
if ( QApplication::desktop()->width() < 800 )
mDateScrollBar->hide();
#endif
//mainBoxLayout->addWidget (mLeftFrame);
mDateNavigator = new DateNavigatorContainer( mLeftFrame,
"CalendarView::DateNavigator" );
#if 0
// FIXME
mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
"CalendarView::DateNavigator", QDate::currentDate());
#endif
// mDateNavigator->blockSignals( true );
//leftFrameLayout->addWidget( mDateNavigator );
mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
connect( mCalEditView, SIGNAL( requestCalendarInfo( int ) ),this, SLOT( displayCalendarInfo( int ) ) );
mTodoList->setNavigator( mNavigator );
#if 0
if ( QApplication::desktop()->width() < 480 ) {
leftFrameLayout->addWidget(mFilterView);
leftFrameLayout->addWidget(mTodoList, 2 );
} else {
leftFrameLayout->addWidget(mTodoList,2 );
leftFrameLayout->addWidget(mFilterView );
}
#endif
mFilterView->hide();
mCalEditView->hide();
QWidget *rightBox = new QWidget( mMainFrame );
//mainBoxLayout->addWidget ( rightBox, 10 );
- QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
- mRightFrame = new QWidgetStack( rightBox );
+ Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox );
+ mRightFrame = new Q3WidgetStack( rightBox );
rightLayout->addWidget( mRightFrame, 10 );
//mLeftFrame = (QWidget *)leftFrame;
if ( KOPrefs::instance()->mVerticalScreen ) {
//mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
//mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
//mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
//leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
} else {
//mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
//mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
//leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
}
if ( !KOPrefs::instance()->mShowDateNavigator)
mDateNavigator->hide();
//qDebug("Calendarview Size %d %d ", width(), height());
#endif
connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
SLOT( showDates( const KCal::DateList & ) ) );
connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
@@ -595,51 +601,51 @@ void CalendarView::init()
this, SLOT ( todo_resub( Todo *,Todo * ) ) );
connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
SLOT( updateTodo( Todo *, int ) ) );
connect( this, SIGNAL( todoModified( Todo *, int )), this,
SLOT( changeTodoDisplay( Todo *, int ) ) );
connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
connect(QApplication::clipboard(),SIGNAL(dataChanged()),
SLOT(checkClipboard()));
connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
SLOT( processTodoListSelection( Incidence * ) ) );
connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
// kdDebug() << "CalendarView::CalendarView() done" << endl;
- mDateFrame = new QVBox(0,0,WType_Popup);
+ mDateFrame = new Q3VBox(0,0,Qt::WType_Popup);
//mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
- mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
+ mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised );
mDateFrame->setLineWidth(3);
mDateFrame->hide();
mDateFrame->setCaption( i18n( "Pick a date to display"));
mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
mEventEditor = mDialogManager->getEventEditor();
mTodoEditor = mDialogManager->getTodoEditor();
mFlagEditDescription = false;
mSuspendTimer = new QTimer( this );
mAlarmTimer = new QTimer( this );
mRecheckAlarmTimer = new QTimer( this );
connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
mAlarmDialog = new AlarmDialog( this );
connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
mAlarmDialog->setServerNotification( false );
mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
@@ -648,65 +654,65 @@ void CalendarView::init()
connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
#endif
mDateNavigator->setCalendar( mCalendar );
}
CalendarView::~CalendarView()
{
// kdDebug() << "~CalendarView()" << endl;
//qDebug("CalendarView::~CalendarView() ");
delete mDialogManager;
delete mViewManager;
delete mStorage;
delete mDateFrame ;
delete mEventViewerDialog;
//kdDebug() << "~CalendarView() done" << endl;
}
void CalendarView::nextConflict( bool all, bool allday )
{
if ( flag_blockConflict ) return;
flag_blockConflict = true;
- QPtrList<Event> testlist = mCalendar->events();
+ Q3PtrList<Event> testlist = mCalendar->events();
Event * test = testlist.first();
while ( test ) {
test->setTagged( false );
test = testlist.next();
}
QTime st ( 0,0,0);
if ( mViewManager->currentView() == mViewManager->agendaView() )
st = mViewManager->agendaView()->agenda()->getEndTime();
//qDebug("time %s ", st.toString().latin1());
QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
QDateTime conflict;
QDateTime retVal;
bool found = false;
Event * cE = 0;
Event * cE2 = 0;
- QPtrList<Event> testlist2 = testlist;
+ Q3PtrList<Event> testlist2 = testlist;
test = testlist.first();
bool skip = false;
topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
//QTime tm;
//tm.start();
while ( test ) {
qApp->processEvents();
skip = false;
if ( !all ) skip = ( allday != test->doesFloat() );
if ( !skip ) {
if ( found )
skip = !test->matchTime( &startDT, &conflict );
else
skip = !test->matchTime( &startDT, 0 );
}
if ( !skip ) {
Event * test2 = testlist2.first();
while ( test2 ) {
skip = test2->isTagged();
if ( !skip && !all ) skip = ( allday != test2->doesFloat() );
if ( !skip ) {
if ( found )
skip = !test2->matchTime( &startDT, &conflict );
else
@@ -814,102 +820,102 @@ void CalendarView::scrollBarValue(int val )
}
void CalendarView::updateView(const QDate &start, const QDate &end)
{
#ifdef DESKTOP_VERSION
if ( ! mDateScrollBar->draggingSlider () ) {
int dof = start.dayOfYear();
//qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() );
if ( dof != mDateScrollBar->value() ) {
mDateScrollBar->blockSignals( true );
mDateScrollBar->setValue( start.dayOfYear());
mDateScrollBar->blockSignals( false );
}
}
#endif
mTodoList->updateView();
mViewManager->updateView(start, end);
//mDateNavigator->updateView();
}
void CalendarView::checkFiles()
{
QString message;
- QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
+ Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
while ( cal ) {
if ( cal->mErrorOnLoad ) {
message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
}
cal = calendars.next();
}
if ( !message.isEmpty() ) {
message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
KMessageBox::error(this,message, i18n("Loading of calendar(s) failed"));
}
if ( flag_checkFileFirsttime ) {
flag_checkFileFirsttime = false;
QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
}
}
void CalendarView::checkAlarms()
{
KConfig *config = KOGlobals::config();
config->setGroup( "AppRun" );
QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
- int daysto = dt.daysTo( QDate::currentDate() );
+ int daysto = dt.daysTo( (QDateTime)QDate::currentDate() );
int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
dt = dt.addDays( days );
int secto = dt.secsTo( QDateTime::currentDateTime() );
int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
//qDebug("KO: Reading program stop %d ", secs);
//secs -= ( 3600 * 24*3 ); // debug only
QDateTime latest = dt.addSecs ( secs );
qDebug("KO: Last termination on %s ", latest.toString().latin1());
//qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
- QPtrList<Incidence> el = mCalendar->rawIncidences();
- QPtrList<Incidence> al;
+ Q3PtrList<Incidence> el = mCalendar->rawIncidences();
+ Q3PtrList<Incidence> al;
Incidence* inL = el.first();
QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
while ( inL ) {
bool ok = false;
int offset = 0;
QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
if ( ok ) {
//qDebug("OK %s",next.toString().latin1());
if ( next < cur ) {
al.append( inL );
//qDebug("found missed alarm: %s ", inL->summary().latin1() );
}
}
inL = el.next();
}
if ( al.count() ) {
- QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
+ QDialog* dia = new QDialog( this, "huhu", false, Qt::WDestructiveClose | Qt::WStyle_StaysOnTop );
dia->setCaption( i18n("KO/Pi: Missing alarms!") );
- QVBoxLayout* lay = new QVBoxLayout( dia );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( dia );
lay->setSpacing( 0 );
lay->setMargin( 0 );
MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
lay->addWidget( matb );
if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
int wid = 210;
int x = QApplication::desktop()->width() - wid - 7;
int y = QApplication::desktop()->height() - wid - 70;
dia->setGeometry ( x,y,wid,wid);
} else {
int si = 220;
if ( QApplication::desktop()->width() > 470 )
si = 400;
dia->resize(si,si/2);
}
dia->setBackgroundColor( QColor( 255, 255, 255 ) );
dia->show();
}
#if 0
// for creating timetracker test data
qDebug("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc ");
Todo * nt;
@@ -1195,49 +1201,49 @@ void CalendarView::computeAlarm( QString msg )
return;
}
if ( mess.left( 10 ) == "proc_alarm") {
bool error = false;
int len = mess.mid( 10 ).find("+++");
if ( len < 2 )
error = true;
else {
tempfilename = mess.mid( 10, len );
if ( !QFile::exists( tempfilename ) )
error = true;
}
if ( error ) {
mAlarmMessage = "Procedure Alarm\nError - File not found\n";
mAlarmMessage += mess.mid( 10+len+3+9 );
} else {
//QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
//qDebug("-----system command %s ",tempfilename.latin1() );
#ifndef _WIN32_
if ( vfork () == 0 ) {
execl ( tempfilename.latin1(), 0 );
return;
}
#else
- QProcess* p = new QProcess();
+ Q3Process* p = new Q3Process();
p->addArgument( tempfilename.latin1() );
p->start();
return;
#endif
return;
}
//qDebug("+++++++system command %s ",tempfilename.latin1() );
}
if ( mess.left( 11 ) == "audio_alarm") {
bool error = false;
int len = mess.mid( 11 ).find("+++");
if ( len < 2 )
error = true;
else {
tempfilename = mess.mid( 11, len );
if ( !QFile::exists( tempfilename ) )
error = true;
}
if ( ! error ) {
filename = tempfilename;
}
mAlarmMessage = mess.mid( 11+len+3+9 );
@@ -1245,80 +1251,80 @@ void CalendarView::computeAlarm( QString msg )
}
if ( mess.left( 9 ) == "cal_alarm") {
mAlarmMessage = mess.mid( 9 ) ;
}
startAlarm( mAlarmMessage, filename );
}
void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
{
//qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
mSuspendAlarmNotification = noti;
int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
//qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
mSuspendTimer->start( ms , true );
#ifdef DESKTOP_VERSION
if ( QApplication::desktop()->width() < 1024 ) {
QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti;
//qDebug("nextsuspendalarm = \n%s ",mess.latin1() );
QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm";
QFile file( fn );
- if (!file.open( IO_WriteOnly ) ) {
+ if (!file.open( QIODevice::WriteOnly ) ) {
qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1());
} else {
- QTextStream ts( &file );
+ Q3TextStream ts( &file );
ts << mess;
file.close();
}
}
#endif
}
void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
{
mNextAlarmDateTime = qdt;
//qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
#ifndef DESKTOP_VERSION
AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
#endif
return;
}
#ifdef DESKTOP_VERSION
if ( QApplication::desktop()->width() < 1024 ) {
QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti;
//qDebug("nextalarm = \n%s ",mess.latin1() );
QString fn = QDir::homeDirPath() + "/.kopi_next_alarm";
QFile file( fn );
- if (!file.open( IO_WriteOnly ) ) {
+ if (!file.open( QIODevice::WriteOnly ) ) {
qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1());
} else {
- QTextStream ts( &file );
+ Q3TextStream ts( &file );
ts << mess;
file.close();
}
}
#endif
int maxSec;
//maxSec = 5; //testing only
maxSec = 86400+3600; // one day+1hour
mAlarmNotification = noti;
int sec = QDateTime::currentDateTime().secsTo( qdt );
if ( sec > maxSec ) {
mRecheckAlarmTimer->start( maxSec * 1000 );
// qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
return;
} else {
mRecheckAlarmTimer->stop();
}
//qDebug("Alarm timer started with secs: %d ", sec);
mAlarmTimer->start( sec * 1000 , true );
}
// called by mRecheckAlarmTimer to get next alarm
// we need this, because a QTimer has only a max range of 25 days
void CalendarView::recheckTimerAlarm()
@@ -1549,104 +1555,104 @@ Event* CalendarView::getLastSyncEvent()
lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice );
if (!lse) {
qDebug("KO: New last Syncevent created for local: %s",mCurrentSyncDevice.latin1() );
lse = new Event();
lse->setUid( "last-syncEvent-"+mCurrentSyncDevice );
QString sum = "";
if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) )
sum = "E: ";
lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event"));
lse->setDtStart( mLastCalendarSync );
lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
lse->setCategories( i18n("SyncEvent") );
lse->setReadOnly( true );
lse->setCalID( 1 );
mCalendar->addEvent( lse );
} else
qDebug("KO: Last Syncevent on local found");
return lse;
}
// we check, if the to delete event has a id for a profile
// if yes, we set this id in the profile to delete
-void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
+void CalendarView::checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete )
{
if ( lastSync.count() == 0 ) {
//qDebug(" lastSync.count() == 0");
return;
}
if ( toDelete->typeID() == journalID )
return;
Event* eve = lastSync.first();
while ( eve ) {
QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
if ( !id.isEmpty() ) {
QString des = eve->description();
QString pref = "e";
if ( toDelete->typeID() == todoID )
pref = "t";
des += pref+ id + ",";
eve->setReadOnly( false );
eve->setDescription( des );
//qDebug("setdes %s ", des.latin1());
eve->setReadOnly( true );
}
eve = lastSync.next();
}
}
void CalendarView::checkExternalId( Incidence * inc )
{
- QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
+ Q3PtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
checkExternSyncEvent( lastSync, inc );
}
// SSSSSSSSSSSSSSSSSSSSSS
bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
{
bool syncOK = true;
int addedEvent = 0;
int addedEventR = 0;
int deletedEventR = 0;
int deletedEventL = 0;
int changedLocal = 0;
int changedRemote = 0;
int filteredIN = 0;
int filteredOUT = 0;
//QPtrList<Event> el = local->rawEvents();
Event* eventR;
QString uid;
int take;
Event* eventRSync;
Event* eventLSync;
clearAllViews();
- QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
- QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
+ Q3PtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
+ Q3PtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
bool fullDateRange = false;
local->resetTempSyncStat();
mLastCalendarSync = QDateTime::currentDateTime();
if ( mSyncManager->syncWithDesktop() ) {
remote->resetPilotStat(1);
if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
} else {
qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
}
}
QDateTime modifiedCalendar = mLastCalendarSync;
eventLSync = getLastSyncEvent();
eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
if ( eventR ) {
qDebug("KO: Last-syncEvent on remote found ");
eventRSync = (Event*) eventR->clone();
remote->deleteEvent(eventR );
} else {
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
eventRSync = (Event*)eventLSync->clone();
} else {
@@ -1663,52 +1669,52 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
fullDateRange = true;
if ( ! fullDateRange ) {
if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
qDebug("KO: Sync: Set fulldate to true! Local: %s --- Remote: %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
//qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
fullDateRange = true;
}
}
if ( mSyncManager->syncWithDesktop() ) {
fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
}
if ( fullDateRange )
mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
else
mLastCalendarSync = eventLSync->dtStart();
// for resyncing if own file has changed
if ( mCurrentSyncDevice == "deleteaftersync" ) {
mLastCalendarSync = loadedFileVersion;
//qDebug("setting mLastCalendarSync ");
}
//qDebug("*************************** ");
qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
- QPtrList<Incidence> er = remote->rawIncidences();
+ Q3PtrList<Incidence> er = remote->rawIncidences();
Incidence* inR = er.first();
Incidence* inL;
- QProgressBar bar( er.count(),0 );
+ Q3ProgressBar bar( er.count(),0 );
bar.setCaption (i18n("Syncing - close to abort!") );
// ************** setting up filter *************
CalFilter *filterIN = 0;
CalFilter *filterOUT = 0;
CalFilter *filter = mFilters.first();
while(filter) {
if ( filter->name() == mSyncManager->mFilterInCal )
filterIN = filter;
if ( filter->name() == mSyncManager->mFilterOutCal )
filterOUT = filter;
filter = mFilters.next();
}
int w = 300;
if ( QApplication::desktop()->width() < 320 )
w = 220;
int h = bar.sizeHint().height() ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
bar.show();
int modulo = (er.count()/10)+1;
int incCounter = 0;
while ( inR ) {
@@ -1810,49 +1816,49 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
}
} else {
if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
inR->setLastModified( modifiedCalendar );
inL = inR->clone();
inL->setIDStr( ":" );
inL->setCalID_block( 0 );// add to default cal
local->addIncidence( inL );
++addedEvent;
} else {
checkExternSyncEvent(eventRSyncSharp, inR);
remote->deleteIncidence( inR );
++deletedEventR;
}
}
} else {
++filteredIN;
}
}
}
inR = er.next();
}
- QPtrList<Incidence> el = local->rawIncidences();
+ Q3PtrList<Incidence> el = local->rawIncidences();
inL = el.first();
modulo = (el.count()/10)+1;
bar.setCaption (i18n("Add / remove events") );
bar.setTotalSteps ( el.count() ) ;
bar.show();
incCounter = 0;
while ( inL ) {
qApp->processEvents();
if ( ! bar.isVisible() )
return false;
if ( incCounter % modulo == 0 )
bar.setProgress( incCounter );
++incCounter;
uid = inL->uid();
bool skipIncidence = false;
if ( uid.left(15) == QString("last-syncEvent-") )
skipIncidence = true;
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
skipIncidence = true;
if ( !skipIncidence ) {
inR = remote->incidenceForUid( uid , true, true );
if ( ! inR ) {
@@ -2027,49 +2033,49 @@ void CalendarView::syncExternal( int mode )
sharpFormat = new SharpFormat () ;
loadSuccess = sharpFormat->load( calendar, mCalendar );
} else
#endif
if ( mode == 1 ) { // phone
phoneFormat = new PhoneFormat (mCurrentSyncDevice,
mSyncManager->mPhoneDevice,
mSyncManager->mPhoneConnection,
mSyncManager->mPhoneModel);
loadSuccess = phoneFormat->load( calendar,mCalendar);
} else {
emit tempDisableBR(false);
return;
}
if ( loadSuccess ) {
getEventViewerDialog()->setSyncMode( true );
syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
getEventViewerDialog()->setSyncMode( false );
qApp->processEvents();
if ( syncOK ) {
if ( mSyncManager->mWriteBackFile )
{
- QPtrList<Incidence> iL = mCalendar->rawIncidences();
+ Q3PtrList<Incidence> iL = mCalendar->rawIncidences();
Incidence* inc = iL.first();
if ( phoneFormat ) {
while ( inc ) {
inc->removeID(mCurrentSyncDevice);
inc = iL.next();
}
}
#ifndef DESKTOP_VERSION
if ( sharpFormat )
sharpFormat->save(calendar);
#endif
if ( phoneFormat )
phoneFormat->save(calendar);
iL = calendar->rawIncidences();
inc = iL.first();
Incidence* loc;
while ( inc ) {
if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
loc = mCalendar->incidence(inc->uid() );
if ( loc ) {
loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
}
}
@@ -2094,49 +2100,49 @@ void CalendarView::syncExternal( int mode )
}
delete calendar;
updateView();
emit tempDisableBR(false);
return ;//syncOK;
}
bool CalendarView::importBday()
{
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
int curCal = mCalendar->defaultCalendar();
int bd = mCalEditView->getBirtdayID();
if ( bd == 0 )
return false;
mCalendar->setDefaultCalendar( bd );
KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
KABC::AddressBook::Iterator it;
int count = 0;
for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
++count;
}
- QProgressBar bar(count,0 );
+ Q3ProgressBar bar(count,0 );
int w = 300;
if ( QApplication::desktop()->width() < 320 )
w = 220;
int h = bar.sizeHint().height() ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
bar.show();
bar.setCaption (i18n("Reading addressbook - close to abort!") );
qApp->processEvents();
count = 0;
int addCount = 0;
KCal::Attendee* a = 0;
for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
if ( ! bar.isVisible() )
return false;
bar.setProgress( count++ );
qApp->processEvents();
//qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
if ( (*it).birthday().date().isValid() ){
a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
++addCount;
}
@@ -2165,49 +2171,49 @@ bool CalendarView::importBday()
// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
const QStringList& anniversaryList, const QStringList& realNameList,
const QStringList& emailList, const QStringList& assembledNameList,
const QStringList& uidList)
{
//qDebug("KO::CalendarView::insertBirthdays");
if (uid == this->name())
{
int curCal = mCalendar->defaultCalendar();
int bd = mCalEditView->getBirtdayID();
if ( bd == 0 )
return;
mCalendar->setDefaultCalendar( bd );
int count = birthdayList.count();
int addCount = 0;
KCal::Attendee* a = 0;
//qDebug("CalView 1 %i", count);
- QProgressBar bar(count,0 );
+ Q3ProgressBar bar(count,0 );
int w = 300;
if ( QApplication::desktop()->width() < 320 )
w = 220;
int h = bar.sizeHint().height() ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
bar.show();
bar.setCaption (i18n("inserting birthdays - close to abort!") );
qApp->processEvents();
QDate birthday;
QDate anniversary;
QString realName;
QString email;
QString assembledName;
QString uid;
bool ok = true;
for ( int i = 0; i < count; i++)
{
if ( ! bar.isVisible() )
return;
bar.setProgress( i );
qApp->processEvents();
@@ -2329,63 +2335,63 @@ bool CalendarView::importQtopia( const QString &categories,
}
setModified( true );
}
} else {
QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
question, i18n("Ok")) ;
}
delete calendar;
updateView();
return syncOK;
#endif
}
void CalendarView::setSyncEventsReadOnly()
{
mCalendar->setSyncEventsReadOnly();
}
bool CalendarView::loadCalendars()
{
- QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
+ Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
mCalendar->setDefaultCalendar( 1 );
openCalendar( MainWindow::defaultFileName(), false );
cal = calendars.next();
while ( cal ) {
addCalendar( cal );
cal = calendars.next();
}
restoreCalendarSettings();
return true;
}
bool CalendarView::restoreCalendarSettings()
{
- QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
+ Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
while ( cal ) {
mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
if ( cal->isStandard )
mCalendar->setDefaultCalendar( cal->mCalNumber );
cal = calendars.next();
}
setSyncEventsReadOnly();
mCalendar->reInitAlarmSettings();
updateUnmanagedViews();
updateView();
return true;
}
void CalendarView::addCalendarId( int id )
{
KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
if ( cal )
addCalendar( cal );
}
bool CalendarView::addCalendar( KopiCalendarFile * cal )
{
cal->mErrorOnLoad = false;
@@ -2508,49 +2514,49 @@ bool CalendarView::checkFileChanged(QString fn)
QFileInfo finf ( fn );
if ( !finf.exists() )
return true;
QDateTime dt = finf.lastModified ();
if ( dt <= loadedFileVersion )
return false;
return true;
}
void CalendarView::watchSavedFile()
{
QFileInfo finf ( MainWindow::defaultFileName());
if ( !finf.exists() )
return;
QDateTime dt = finf.lastModified ();
if ( dt < loadedFileVersion ) {
//qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
return;
}
loadedFileVersion = dt;
}
bool CalendarView::checkAllFileVersions()
{
- QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
+ Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
mCalendar->setDefaultCalendar( 1 );
mCalendar->setDefaultCalendarEnabledOnly();
if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
if ( !checkFileVersion(MainWindow::defaultFileName())) {
restoreCalendarSettings();
return false;
}
}
cal = calendars.next();
QDateTime storeTemp = loadedFileVersion;
while ( cal ) {
if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
mCalendar->setDefaultCalendar( cal->mCalNumber );
mCalendar->setDefaultCalendarEnabledOnly();
loadedFileVersion = cal->mLoadDt.addSecs( 15 );
if ( !checkFileVersion(cal->mFileName )) {
loadedFileVersion = storeTemp;
restoreCalendarSettings();
return false;
}
}
cal = calendars.next();
}
@@ -2570,49 +2576,49 @@ bool CalendarView::checkFileVersion(QString fn)
int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) ,
i18n("KO/Pi Warning"),i18n("Overwrite"),
i18n("Sync+save"));
if ( km == KMessageBox::Cancel )
return false;
if ( km == KMessageBox::Yes )
return true;
setSyncDevice("deleteaftersync" );
mSyncManager->mAskForPreferences = true;
mSyncManager->mSyncAlgoPrefs = 3;
mSyncManager->mWriteBackFile = false;
mSyncManager->mWriteBackExistingOnly = false;
mSyncManager->mShowSyncSummary = false;
mMultiResourceSync = false;
syncCalendar( fn, 3 );
Event * e = getLastSyncEvent();
if ( e )
mCalendar->deleteEvent( e );
return true;
}
bool CalendarView::saveCalendars()
{
- QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
+ Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
mCalendar->setDefaultCalendar( 1 );
mCalendar->setDefaultCalendarEnabledOnly();
QString saveError;
if ( !saveCalendar( MainWindow::defaultFileName() ) )
saveError = cal->mName +"\n";
cal = calendars.next();
while ( cal ) {
if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
mCalendar->setDefaultCalendar( cal->mCalNumber );
mCalendar->setDefaultCalendarEnabledOnly();
if ( saveCalendar( cal->mFileName ) )
cal->mLoadDt = QDateTime::currentDateTime();
else
saveError += cal->mName + "\n";
}
cal = calendars.next();
}
restoreCalendarSettings();
//saveError = "test error";
if ( !saveError.isEmpty() ) {
saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError;
KMessageBox::error(this, saveError, i18n("Error saving data"));
return false;
@@ -2674,49 +2680,49 @@ void CalendarView::closeCalendar()
mCalendar->close();
setModified(false);
updateView();
}
void CalendarView::archiveCalendar()
{
mDialogManager->showArchiveDialog();
}
void CalendarView::readSettings()
{
// mViewManager->showAgendaView();
QString str;
//qDebug("CalendarView::readSettings() ");
// read settings from the KConfig, supplying reasonable
// defaults where none are to be found
KConfig *config = KOGlobals::config();
#ifndef KORG_NOSPLITTER
config->setGroup("KOrganizer Geometry");
- QValueList<int> sizes = config->readIntListEntry("Separator1");
+ Q3ValueList<int> sizes = config->readIntListEntry("Separator1");
if (sizes.count() != 2) {
sizes << mDateNavigator->minimumSizeHint().width();
sizes << 300;
}
mPanner->setSizes(sizes);
sizes = config->readIntListEntry("Separator2");
if ( ( mResourceView && sizes.count() == 4 ) ||
( !mResourceView && sizes.count() == 3 ) ) {
mLeftSplitter->setSizes(sizes);
}
#endif
globalFlagBlockAgenda = 1;
mViewManager->showAgendaView();
//mViewManager->readSettings( config );
mTodoList->restoreLayout(config,QString("Todo Layout"));
readFilterSettings(config);
#ifdef DESKTOP_VERSION
config->setGroup("WidgetLayout");
QStringList list;
list = config->readListEntry("MainLayout");
int x,y,w,h;
if ( ! list.isEmpty() ) {
@@ -2742,49 +2748,49 @@ void CalendarView::readSettings()
}
list = config->readListEntry("EditTodoLayout");
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
h = list[3].toInt();
KApplication::testCoords( &x,&y,&w,&h );
mTodoEditor->setGeometry(x,y,w,h);
}
list = config->readListEntry("ViewerLayout");
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
h = list[3].toInt();
KApplication::testCoords( &x,&y,&w,&h );
getEventViewerDialog()->setGeometry(x,y,w,h);
}
#endif
config->setGroup( "Views" );
int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
- QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
+ Q3ValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
int resetval = 0;
int maxVal = 0;
if (sizes.count() != 3) {
if ( KOPrefs::instance()->mVerticalScreen ) {
resetval = mDateNavigator->sizeHint().width()+2;
} else {
resetval = mDateNavigator->sizeHint().height()+2;
}
}
if ( resetval ) {
sizes.clear();
if ( KOPrefs::instance()->mVerticalScreen ) {
maxVal = QApplication::desktop()->width() -10;
} else {
maxVal = QApplication::desktop()->height()-10;
}
sizes << resetval;
if ( maxVal < resetval + resetval)
resetval = maxVal - resetval;
sizes << resetval;
sizes << 100;
}
mLeftFrame->setSizes(sizes);
@@ -2821,78 +2827,78 @@ void CalendarView::readSettings()
QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
}
void CalendarView::checkSuspendAlarm()
{
if ( mSuspendTimer->isActive() ) {
KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
}
}
void CalendarView::writeSettings()
{
// kdDebug() << "CalendarView::writeSettings" << endl;
KConfig *config = KOGlobals::config();
mViewManager->writeSettings( config );
mTodoList->saveLayout(config,QString("Todo Layout"));
mDialogManager->writeSettings( config );
//KOPrefs::instance()->usrWriteConfig();
KOPrefs::instance()->writeConfig();
writeFilterSettings(config);
config->setGroup( "AppRun" );
QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
- int days = dt.daysTo( QDate::currentDate() );
+ int days = dt.daysTo( (QDateTime)QDate::currentDate() );
dt = dt.addDays( days );
int secs = dt.secsTo( QDateTime::currentDateTime() );
config->writeEntry( "LatestProgramStopDays", days );
config->writeEntry( "LatestProgramStopSecs", secs );
//qDebug("KO: Writing stop time: %d ", secs);
//qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
//QDateTime latest = dt.addSecs ( secs );
//qDebug("KO: Termination on %s ", latest.toString().latin1());
config->setGroup( "Views" );
config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
#if 0
qDebug("********************* ");
qDebug("Testcode secsto ");
QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
int secsto = dt_nodaylight.secsTo( dt_daylight );
QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
qDebug("********************* testcode end");
#endif
- QValueList<int> listINT = mLeftFrame->sizes();
+ Q3ValueList<int> listINT = mLeftFrame->sizes();
config->writeEntry("Left Splitter Frame",listINT);
- QValueList<int> listINT2 = mMainFrame->sizes();
+ Q3ValueList<int> listINT2 = mMainFrame->sizes();
config->writeEntry("Main Splitter Frame",listINT2);
#ifdef DESKTOP_VERSION
config->setGroup("WidgetLayout");
QStringList list ;//= config->readListEntry("MainLayout");
int x,y,w,h;
QWidget* wid;
wid = topLevelWidget();
x = wid->geometry().x();
y = wid->geometry().y();
w = wid->width();
h = wid->height();
list.clear();
list << QString::number( x );
list << QString::number( y );
list << QString::number( w );
list << QString::number( h );
config->writeEntry("MainLayout",list );
wid = mEventEditor;
x = wid->geometry().x();
y = wid->geometry().y();
w = wid->width();
h = wid->height();
list.clear();
@@ -3145,49 +3151,49 @@ void CalendarView::checkConflictForEvent()
if (!KOPrefs::instance()->mConfirm)
return;
if ( ! mConflictingEvent ) return;
Event * conflictingEvent = mConflictingEvent;
mConflictingEvent = 0;
QDateTime current = QDateTime::currentDateTime();
if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
return;
}
CalFilter *filterIN = 0;
CalFilter *filterALL = 0;
CalFilter *filter = mFilters.first();
while(filter) {
if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem)
filterIN = filter;
if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem )
filterALL = filter;
filter = mFilters.next();
}
if ( filterIN ) {
if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
return;
}
}
- QPtrList<Event> testlist = mCalendar->events();
+ Q3PtrList<Event> testlist = mCalendar->events();
Event * test = testlist.first();
QDateTime conflict;
QDateTime retVal;
bool found = false;
Event * cE = 0;
bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
if ( !conflictingEvent->doesFloat() ) {
chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
}
topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
while ( test ) {
qApp->processEvents();
bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad );
if ( !skip ) {
if ( !KOPrefs::instance()->mIncludeFree && test->transparency() == KCal::Event::Transparent )
skip = true;
}
if ( !skip ) {
if ( filterALL ) {
if ( !filterALL->filterCalendarItem( test ) ) {
skip = true;
@@ -3407,70 +3413,70 @@ void CalendarView::slotSelectPickerDate( QDate d)
else
emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
mMoveIncidence = newInc;
#endif
}
QTime tim = mMoveIncidence->dtStart().time();
int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
QDateTime dt ( d,tim );
mMoveIncidence->setDtStart( dt );
((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
} else if ( mMoveIncidence->typeID() == journalID ) {
QTime tim = mMoveIncidence->dtStart().time();
QDateTime dt ( d,tim );
mMoveIncidence->setDtStart( dt );
updateView();
}
mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
}
}
void CalendarView::removeCategories()
{
- QPtrList<Incidence> incList = mCalendar->rawIncidences();
+ Q3PtrList<Incidence> incList = mCalendar->rawIncidences();
QStringList catList = KOPrefs::instance()->mCustomCategories;
QStringList catIncList;
QStringList newCatList;
Incidence* inc = incList.first();
uint i;
while ( inc ) {
newCatList.clear();
catIncList = inc->categories() ;
for( i = 0; i< catIncList.count(); ++i ) {
if ( catList.contains (catIncList[i]))
newCatList.append( catIncList[i] );
}
newCatList.sort();
inc->setCategories( newCatList.join(",") );
inc = incList.next();
}
}
int CalendarView::addCategories()
{
- QPtrList<Incidence> incList = mCalendar->rawIncidences();
+ Q3PtrList<Incidence> incList = mCalendar->rawIncidences();
QStringList catList = KOPrefs::instance()->mCustomCategories;
QStringList catIncList;
Incidence* inc = incList.first();
uint i;
int count = 0;
while ( inc ) {
catIncList = inc->categories() ;
for( i = 0; i< catIncList.count(); ++i ) {
if ( !catList.contains (catIncList[i])) {
catList.append( catIncList[i] );
//qDebug("add cat %s ", catIncList[i].latin1());
++count;
}
}
inc = incList.next();
}
catList.sort();
KOPrefs::instance()->mCustomCategories = catList;
return count;
}
void CalendarView::editCategories()
{
qDebug("CalendarView::editCategories() ");
@@ -3486,65 +3492,65 @@ void CalendarView::manageCategories()
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
if ( !cp->exec() ) {
delete cp;
return;
}
int count = 0;
if ( cp->addCat() ) {
count = addCategories();
if ( count ) {
topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
writeSettings();
} else
topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
} else {
removeCategories();
updateView();
}
delete cp;
}
void CalendarView::beamIncidence(Incidence * Inc)
{
- QPtrList<Incidence> delSel ;
+ Q3PtrList<Incidence> delSel ;
delSel.append(Inc);
beamIncidenceList( delSel );
}
void CalendarView::beamCalendar()
{
- QPtrList<Incidence> delSel = mCalendar->rawIncidences();
+ Q3PtrList<Incidence> delSel = mCalendar->rawIncidences();
//qDebug("beamCalendar() ");
beamIncidenceList( delSel );
}
void CalendarView::beamFilteredCalendar()
{
- QPtrList<Incidence> delSel = mCalendar->incidences();
+ Q3PtrList<Incidence> delSel = mCalendar->incidences();
//qDebug("beamFilteredCalendar() ");
beamIncidenceList( delSel );
}
-void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
+void CalendarView::beamIncidenceList(Q3PtrList<Incidence> delSel )
{
KOBeamPrefs beamDialog;
if ( beamDialog.exec () == QDialog::Rejected )
return;
#ifdef DESKTOP_VERSION
QString fn = locateLocal( "tmp", "kopibeamfile" );
#else
QString fn = "/tmp/kopibeamfile";
#endif
QString mes;
bool createbup = true;
if ( createbup ) {
QString description = "\n";
CalendarLocal* cal = new CalendarLocal();
if ( beamDialog.beamLocal() )
cal->setLocalTime();
else
cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
Incidence *incidence = delSel.first();
bool addText = false;
if ( delSel.count() < 10 )
addText = true;
else {
@@ -4294,49 +4300,49 @@ void CalendarView::schedule_publish(Incidence *incidence)
Event *event = 0;
Todo *todo = 0;
if (incidence == 0) {
incidence = mViewManager->currentView()->selectedIncidences().first();
if (incidence == 0) {
incidence = mTodoList->selectedIncidences().first();
}
}
if ( incidence && incidence->typeID() == eventID ) {
event = static_cast<Event *>(incidence);
} else {
if ( incidence && incidence->typeID() == todoID ) {
todo = static_cast<Todo *>(incidence);
}
}
if (!event && !todo) {
KMessageBox::sorry(this,i18n("No event selected."));
return;
}
PublishDialog *publishdlg = new PublishDialog();
if (incidence->attendeeCount()>0) {
- QPtrList<Attendee> attendees = incidence->attendees();
+ Q3PtrList<Attendee> attendees = incidence->attendees();
attendees.first();
while ( attendees.current()!=0 ) {
publishdlg->addAttendee(attendees.current());
attendees.next();
}
}
bool send = true;
if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
if ( publishdlg->exec() != QDialog::Accepted )
send = false;
}
if ( send ) {
OutgoingDialog *dlg = mDialogManager->outgoingDialog();
if ( event ) {
Event *ev = new Event(*event);
ev->registerObserver(0);
ev->clearAttendees();
if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
delete(ev);
}
} else {
if ( todo ) {
Todo *ev = new Todo(*todo);
ev->registerObserver(0);
@@ -4703,90 +4709,90 @@ void CalendarView::showDates(const DateList &selectedDates)
selDates = KGlobal::locale()->formatDate( date, true);
if (selectedDates.first() < selectedDates.last() )
selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
else {
QString addString;
if ( date == QDateTime::currentDateTime().date() )
addString = i18n("Today");
else if ( date == QDateTime::currentDateTime().date().addDays(1) )
addString = i18n("Tomorrow");
else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
addString = i18n("Yesterday");
else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
addString = i18n("Day before yesterday");
else if ( date == QDateTime::currentDateTime().date().addDays(2) )
addString = i18n("Day after tomorrow");
if ( !addString.isEmpty() ) {
topLevelWidget()->setCaption( addString+", " + selDates );
return;
}
}
topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
}
-QPtrList<CalFilter> CalendarView::filters()
+Q3PtrList<CalFilter> CalendarView::filters()
{
return mFilters;
}
void CalendarView::editFilters()
{
// kdDebug() << "CalendarView::editFilters()" << endl;
CalFilter *filter = mFilters.first();
while(filter) {
filter = mFilters.next();
}
mDialogManager->showFilterEditDialog(&mFilters);
updateFilter();
}
void CalendarView::toggleFilter()
{
if ( mLeftFrame->isHidden() ) {
toggleExpand();
showFilter( true );
} else
showFilter(! mCalEditView->isVisible());
}
KOFilterView *CalendarView::filterView()
{
return mFilterView;
}
void CalendarView::selectFilter( int fil )
{
mFilterView->setSelectedFilter( fil );
updateUnmanagedViews();
}
void CalendarView::showFilter(bool visible)
{
#if 1
if (visible) {
mCalEditView->readConfig();
mCalEditView->show();
- QValueList<int> sizes;
+ Q3ValueList<int> sizes;
sizes = mLeftFrame->sizes();
if ( sizes.count() == 4 && sizes[3] < 20 ) {
sizes.clear();
sizes << 100;
sizes << 0;
sizes << 0;
sizes << 100;
mLeftFrame->setSizes(sizes);
}
#if 0
sizes = mLeftFrame->sizes();
int ccc = 0;
while ( ccc < sizes.count()) {
qDebug("size %d %d ", ccc, sizes[ccc]);
++ccc;
}
#endif
}
else {
mCalEditView->hide();
}
#else
if (visible) mFilterView->show();
@@ -4825,78 +4831,78 @@ void CalendarView::filterEdited()
mFilterView->updateFilters();
updateFilter();
writeSettings();
}
void CalendarView::takeOverEvent()
{
Incidence *incidence = currentSelection();
if (!incidence) return;
incidence->setOrganizer(KOPrefs::instance()->email());
incidence->recreate();
incidence->setReadOnly(false);
updateView();
}
void CalendarView::takeOverCalendar()
{
// TODO: Create Calendar::allIncidences() function and use it here
clearAllViews();
- QPtrList<Event> events = mCalendar->events();
+ Q3PtrList<Event> events = mCalendar->events();
for(uint i=0; i<events.count(); ++i) {
events.at(i)->setOrganizer(KOPrefs::instance()->email());
events.at(i)->recreate();
events.at(i)->setReadOnly(false);
}
- QPtrList<Todo> todos = mCalendar->todos();
+ Q3PtrList<Todo> todos = mCalendar->todos();
for(uint i=0; i<todos.count(); ++i) {
todos.at(i)->setOrganizer(KOPrefs::instance()->email());
todos.at(i)->recreate();
todos.at(i)->setReadOnly(false);
}
- QPtrList<Journal> journals = mCalendar->journals();
+ Q3PtrList<Journal> journals = mCalendar->journals();
for(uint i=0; i<journals.count(); ++i) {
journals.at(i)->setOrganizer(KOPrefs::instance()->email());
journals.at(i)->recreate();
journals.at(i)->setReadOnly(false);
}
updateView();
}
void CalendarView::showIntro()
{
kdDebug() << "To be implemented." << endl;
}
-QWidgetStack *CalendarView::viewStack()
+Q3WidgetStack *CalendarView::viewStack()
{
return mRightFrame;
}
QWidget *CalendarView::leftFrame()
{
return ( QWidget *)mLeftFrame;
}
DateNavigator *CalendarView::dateNavigator()
{
return mNavigator;
}
KDateNavigator* CalendarView::dateNavigatorWidget()
{
return mDateNavigator->navigatorView();
}
void CalendarView::toggleDateNavigatorWidget()
{
KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
if (!KOPrefs::instance()->mShowDateNavigator )
mDateNavigator->hide();
@@ -5039,76 +5045,76 @@ void CalendarView::deleteIncidence(Incidence *incidence)
return;
}
if ( incidence ) {
DeleteIncidenceVisitor v;
v.act( incidence, this );
}
}
void CalendarView::lookForOutgoingMessages()
{
OutgoingDialog *ogd = mDialogManager->outgoingDialog();
ogd->loadMessages();
}
void CalendarView::lookForIncomingMessages()
{
IncomingDialog *icd = mDialogManager->incomingDialog();
icd->retrieve();
}
bool CalendarView::removeCompletedSubTodos( Todo* t )
{
bool deleteTodo = true;
- QPtrList<Incidence> subTodos;
+ Q3PtrList<Incidence> subTodos;
Incidence *aTodo;
subTodos = t->relations();
for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
if (! removeCompletedSubTodos( (Todo*) aTodo ))
deleteTodo = false;
}
if ( deleteTodo ) {
if ( t->isCompleted() && !t->doesRecur()) {
checkExternalId( t );
mCalendar->deleteTodo( t );
changeTodoDisplay( t,KOGlobals::EVENTDELETED );
}
else
deleteTodo = false;
}
return deleteTodo;
}
void CalendarView::purgeCompleted()
{
int result = KMessageBox::warningContinueCancel(this,
i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge"));
if (result == KMessageBox::Continue) {
- QPtrList<Todo> todoCal;
- QPtrList<Todo> rootTodos;
+ Q3PtrList<Todo> todoCal;
+ Q3PtrList<Todo> rootTodos;
//QPtrList<Incidence> rel;
Todo *aTodo;
todoCal = calendar()->todos();
for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
if ( !aTodo->relatedTo() )
rootTodos.append( aTodo );
}
for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
removeCompletedSubTodos( aTodo );
}
updateView();
}
}
void CalendarView::slotCalendarChanged()
{
;
}
void CalendarView::keyPressEvent ( QKeyEvent *e)
{
//qDebug("CalendarView::keyPressEvent ");
e->ignore();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 60b1276..b4eada7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -3,152 +3,154 @@
Copyright (c) 2000, 2001
Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef CALENDARVIEW_H
#define CALENDARVIEW_H
-#include <qframe.h>
+#include <q3frame.h>
#include <qlayout.h>
#include <qwidget.h>
-#include <qptrlist.h>
-#include <qvbox.h>
+#include <q3ptrlist.h>
+#include <q3vbox.h>
#include <qmap.h>
#include <qscrollbar.h>
+//Added by qt3to4:
+#include <QKeyEvent>
#ifndef DESKTOP_VERSION
#include <qtopia/ir.h>
#else
#define Ir char
#endif
#include <libkcal/calendar.h>
#include <libkcal/scheduler.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <KDGanttMinimizeSplitter.h>
#include <korganizer/calendarviewbase.h>
#include <ksyncmanager.h>
//#include <koprefs.h>
-class QWidgetStack;
+class Q3WidgetStack;
class QSplitter;
class KopiCalendarFile;
class CalPrinter;
class KOFilterView;
class KOCalEditView;
class KOViewManager;
class KODialogManager;
class KOTodoView;
class KDateNavigator;
class DateNavigatorContainer;
class DateNavigator;
class KOIncidenceEditor;
class KDatePicker;
class ResourceView;
class KOEventEditor;
class KOTodoEditor ;
class KOEventViewerDialog;
class KOBeamPrefs;
class KSyncProfile;
class AlarmDialog;
class KCal::Attendee;
namespace KCal { class FileStorage; }
using namespace KCal;
/**
This is the main calendar widget. It provides the different vies on t he
calendar data as well as the date navigator. It also handles synchronisation
of the different views and controls the different dialogs like preferences,
event editor, search dialog etc.
@short main calendar view widget
@author Cornelius Schumacher
*/
-#include <qtextbrowser.h>
+#include <q3textbrowser.h>
#include <qtextcodec.h>
-class MissedAlarmTextBrowser : public QTextBrowser {
+class MissedAlarmTextBrowser : public Q3TextBrowser {
Q_OBJECT
public:
- MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start);
+ MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms ,QDateTime start);
~MissedAlarmTextBrowser();
void setSource(const QString & n);
private:
Incidence * getNextInc(QDateTime start );
- QPtrList<Incidence> mAlarms;
+ Q3PtrList<Incidence> mAlarms;
signals:
void showIncidence( QString uid);
};
class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface
{
Q_OBJECT
public:
/**
Constructs a new calendar view widget.
@param calendar calendar document
@param parent parent window
@param name Qt internal widget object name
*/
CalendarView( CalendarResources *calendar, QWidget *parent = 0,
const char *name = 0 );
CalendarView( Calendar *calendar, QWidget *parent = 0,
const char *name = 0 );
virtual ~CalendarView();
Calendar *calendar() { return mCalendar; }
KOViewManager *viewManager();
KODialogManager *dialogManager();
QDate startDate();
QDate endDate();
- QWidgetStack *viewStack();
+ Q3WidgetStack *viewStack();
QWidget *leftFrame();
DateNavigator *dateNavigator();
KDateNavigator *dateNavigatorWidget();
void addView(KOrg::BaseView *);
void showView(KOrg::BaseView *);
KOEventViewerDialog* getEventViewerDialog();
Incidence *currentSelection();
void checkSuspendAlarm();
void mergeFile( QString fn );
void mergeFileResource( QString fn ,QString res);
signals:
void save ();
void saveStopTimer ();
void tempDisableBR(bool);
/** This todo has been modified */
void todoModified(Todo *, int);
/** when change is made to options dialog, the topwidget will catch this
* and emit this signal which notifies all widgets which have registered
* for notification to update their settings. */
void configChanged();
@@ -420,49 +422,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void setModified(bool modified=true);
/** query if the calendar is read-only. */
bool isReadOnly();
/** set state of calendar to read-only */
void setReadOnly(bool readOnly=true);
void eventUpdated(Incidence *);
/* iTIP scheduling actions */
void schedule_publish(Incidence *incidence = 0);
void schedule_request(Incidence *incidence = 0);
void schedule_refresh(Incidence *incidence = 0);
void schedule_cancel(Incidence *incidence = 0);
void schedule_add(Incidence *incidence = 0);
void schedule_reply(Incidence *incidence = 0);
void schedule_counter(Incidence *incidence = 0);
void schedule_declinecounter(Incidence *incidence = 0);
void schedule_publish_freebusy(int daysToPublish = 30);
void openAddressbook();
void editFilters();
void toggleFilerEnabled();
- QPtrList<CalFilter> filters();
+ Q3PtrList<CalFilter> filters();
void toggleFilter();
void showFilter(bool visible);
void updateFilter();
void filterEdited();
void selectFilter( int );
KOFilterView *filterView();
void showIntro();
/** Move the curdatepient view date to today */
void goToday();
/** Move to the next date(s) in the current view */
void goNext();
/** Move to the previous date(s) in the current view */
void goPrevious();
/** Move to the next date(s) in the current view */
void goNextMonth();
/** Move to the previous date(s) in the current view */
void goPreviousMonth();
void toggleExpand();
@@ -474,49 +476,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
/** Look for new messages in the outbox */
void lookForOutgoingMessages();
void processMainViewSelection( Incidence * );
void processTodoListSelection( Incidence * );
void processIncidenceSelection( Incidence * );
void purgeCompleted();
bool removeCompletedSubTodos( Todo* );
void slotCalendarChanged();
bool importBday();
bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
bool importQtopia( const QString &categoriesFile,
const QString &datebookFile,
const QString &tasklistFile );
void syncExternal( int mode );
void slotSelectPickerDate( QDate ) ;
void showDatePicker() ;
void showDatePickerPopup() ;
void moveIncidence(Incidence *) ;
void beamIncidence(Incidence *) ;
void beamCalendar() ;
void beamFilteredCalendar() ;
- void beamIncidenceList(QPtrList<Incidence>) ;
+ void beamIncidenceList(Q3PtrList<Incidence>) ;
void manageCategories();
void editCategories();
int addCategories();
void removeCategories();
void setSyncDevice( QString );
void setSyncName( QString );
void showDay( QDate );
void undo_delete();
protected slots:
void resetFocus();
void scrollBarValue(int);
void slotViewerClosed();
void timerAlarm();
void suspendAlarm();
void beamDone( Ir *ir );
/** Select a view or adapt the current view to display the specified dates. */
void showDates( const KCal::DateList & );
void selectWeekNum ( int );
void checkConflictForEvent();
public:
void createRunningDate4Todo( Todo * runT, QDateTime start , QDateTime end, int secLenRunning, int secLenPausing,int dayInterval );
// show a standard warning
// returns KMsgBox::yesNoCancel()
@@ -554,92 +556,92 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
private:
#ifdef DESKTOP_VERSION
QScrollBar * mDateScrollBar;
#endif
bool flag_blockConflict;
bool flag_blockScrollBar;
bool flag_checkFileFirsttime;
bool flag_clearallviewsEventDisplay;
bool flag_clearallviewsupdateView;
QDateTime mNextAlarmDateTime;
bool mViewerCallerIsSearchDialog;
bool mBlockShowDates;
KSyncManager* mSyncManager;
AlarmDialog * mAlarmDialog;
QString mAlarmNotification;
QString mSuspendAlarmNotification;
QTimer* mSuspendTimer;
QTimer* mAlarmTimer;
QTimer* mRecheckAlarmTimer;
void computeAlarm( QString );
void startAlarm( QString, QString );
void setSyncEventsReadOnly();
QDateTime loadedFileVersion;
- void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete );
+ void checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete );
void checkExternalId( Incidence * inc );
int mGlobalSyncMode;
QString mCurrentSyncDevice;
QString mCurrentSyncName;
void init();
int mDatePickerMode;
bool mFlagEditDescription;
QDateTime mLastCalendarSync;
void createPrinter();
void calendarModified( bool, Calendar * );
CalPrinter *mCalPrinter;
QSplitter *mPanner;
QSplitter *mLeftSplitter;
KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame;
- QWidgetStack *mRightFrame;
+ Q3WidgetStack *mRightFrame;
KDatePicker* mDatePicker;
- QVBox* mDateFrame;
+ Q3VBox* mDateFrame;
DateNavigatorContainer *mDateNavigator; // widget showing small month view.
KOFilterView *mFilterView;
KOCalEditView *mCalEditView;
ResourceView *mResourceView;
// calendar object for this viewing instance
Calendar *mCalendar;
CalendarResourceManager *mResourceManager;
FileStorage *mStorage;
DateNavigator *mNavigator;
KOViewManager *mViewManager;
KODialogManager *mDialogManager;
// Calendar filters
- QPtrList<CalFilter> mFilters;
+ Q3PtrList<CalFilter> mFilters;
// various housekeeping variables.
bool mModified; // flag indicating if calendar is modified
bool mReadOnly; // flag indicating if calendar is read-only
QDate mSaveSingleDate;
Incidence *mSelectedIncidence;
Incidence *mMoveIncidence;
QDate mMoveIncidenceOldDate;
KOTodoView *mTodoList;
KOEventEditor * mEventEditor;
KOTodoEditor * mTodoEditor;
KOEventViewerDialog * mEventViewerDialog;
void keyPressEvent ( QKeyEvent *e) ;
//QMap<Incidence*,KOIncidenceEditor*> mDialogList;
};
class CalendarViewVisitor : public Incidence::Visitor
{
public:
CalendarViewVisitor() : mView( 0 ) {}
bool act( Incidence *incidence, CalendarView *view )
diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp
index 7b7d54c..ecb9e03 100644
--- a/korganizer/calprintbase.cpp
+++ b/korganizer/calprintbase.cpp
@@ -4,53 +4,55 @@
Copyright (c) 1998 Preston Brown
Copyright (c) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qpainter.h>
#include <qlayout.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
-#include <qptrlist.h>
-#include <qintdict.h>
+#include <q3ptrlist.h>
+#include <q3intdict.h>
#include <qfontmetrics.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kcalendarsystem.h>
#include <kprinter.h>
#include <libkcal/todo.h>
#include <libkcal/event.h>
#include <libkcal/calendar.h>
#include "koprefs.h"
#include "koglobals.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include "cellitem.h"
#include "calprintbase.h"
#ifndef KORG_NOPRINTER
//#include "calprintbase.moc"
@@ -124,50 +126,50 @@ void setCategoryColors( QPainter &p, Incidence *incidence)
if (cat.isEmpty())
bgColor = KOPrefs::instance()->mEventColor;
else
bgColor = *(KOPrefs::instance()->categoryColor(cat));
QColor textColor = Qt::black;//getTextColor(bgColor);
p.setPen( textColor );
p.setBrush( bgColor );
}
CalPrintBase::CalPrintBase( KPrinter *printer, Calendar *cal, KConfig *cfg )
: QObject(), mPrinter( printer ), mCalendar( cal ), mConfig( cfg )
{
}
CalPrintBase::~CalPrintBase()
{
}
QWidget *CalPrintBase::configWidget( QWidget *w )
{
- QFrame *wdg = new QFrame( w );
- QVBoxLayout *layout = new QVBoxLayout( wdg );
+ Q3Frame *wdg = new Q3Frame( w );
+ Q3VBoxLayout *layout = new Q3VBoxLayout( wdg );
QLabel *title = new QLabel( description(), wdg );
QFont titleFont( title->font() );
titleFont.setPointSize( 20 );
titleFont.setBold( true );
title->setFont( titleFont );
layout->addWidget( title );
layout->addWidget( new QLabel( longDescription(), wdg ) );
layout->addSpacing( 20 );
layout->addWidget( new QLabel( i18n("This printing style does not "
"have any configuration options."),
wdg ) );
layout->addStretch();
return wdg;
}
#include <qapplication.h>
void CalPrintBase::doPrint()
{
QPainter p;
mPrinter->setColorMode( (mUseColors)?(KPrinter::Color):(KPrinter::GrayScale));
//#define DUMMY_PRINTER
#ifdef DUMMY_PRINTER
@@ -264,174 +266,174 @@ void CalPrintBase::drawHeader( QPainter &p, QString title,
right, y+2, smallMonthWidth, height-4);
right-=10;
}
// Print the titles...
QFont font("helvetica", 18, QFont::Bold);
p.setFont(font);
QRect textRect( x+5, y+5, right-10-x, height-10 );
p.drawText( textRect, Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak, title );
}
void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd,
int x, int y, int width, int height)
{
bool firstCol = true;
QDate monthDate(QDate(qd.year(), qd.month(), 1));
QDate monthDate2;
int month = monthDate.month();
// draw the title
p.setFont(QFont("helvetica", 7, QFont::Bold));
// int lineSpacing = p.fontMetrics().lineSpacing();
const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem();
- p.drawText(x, y, width, height/4, AlignCenter, calSys->monthName( qd ) );
+ p.drawText(x, y, width, height/4, Qt::AlignCenter, calSys->monthName( qd ) );
int cellWidth = width/7;
int cellHeight = height/8;
QString tmpStr;
// correct begin of week
int weekdayCol = weekdayColumn( qd.dayOfWeek() );
monthDate2 = monthDate.addDays(-weekdayCol);
// draw days of week
p.setFont(QFont("helvetica", 7, QFont::Bold));
for (int col = 0; col < 7; col++) {
// tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek()));
tmpStr=calSys->weekDayName( monthDate2 )[0].upper();
p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight,
- AlignCenter, tmpStr);
+ Qt::AlignCenter, tmpStr);
monthDate2 = monthDate2.addDays(1);
}
// draw separator line
p.drawLine(x, y+height/4+cellHeight, x+width, y+height/4+cellHeight);
for (int row = 0; row < 5; row++) {
for (int col = 0; col < 7; col++) {
if (monthDate.month() != month)
break;
if (firstCol) {
firstCol = true;
col = weekdayColumn( monthDate.dayOfWeek() );
}
p.drawText( x+col*cellWidth,
y+height/4+cellHeight+(row*cellHeight),
- cellWidth, cellHeight, AlignCenter,
+ cellWidth, cellHeight, Qt::AlignCenter,
tmpStr.setNum(monthDate.day()) );
monthDate = monthDate.addDays(1);
}
}
}
///////////////////////////////////////////////////////////////////////////////
/*
* This routine draws a header box over the main part of the calendar
* containing the days of the week.
*/
void CalPrintBase::drawDaysOfWeek(QPainter &p,
const QDate &fromDate, const QDate &toDate,
int x, int y, int width, int height)
{
int cellWidth = width/(fromDate.daysTo( toDate )+1);
int currx=x;
QDate cellDate(fromDate);
while (cellDate<=toDate) {
drawDaysOfWeekBox(p, cellDate, currx, y, cellWidth, height);
currx+=cellWidth;
cellDate = cellDate.addDays(1);
}
}
void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd,
int x, int y, int width, int height)
{
const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem();
p.setFont( QFont( "helvetica", 10, QFont::Bold ) );
p.drawRect( x, y, width, height );
// p.fillRect( x+1, y+1,
// width-2, height-2,
// QBrush( Dense7Pattern ) );
- p.drawText( x+5, y, width-10, height, AlignCenter | AlignVCenter,
+ p.drawText( x+5, y, width-10, height, Qt::AlignCenter | Qt::AlignVCenter,
calSys->weekDayName( qd ) );
}
void CalPrintBase::drawTimeLine(QPainter &p,
const QTime &fromTime, const QTime &toTime,
int x, int y, int width, int height)
{
p.drawRect(x, y, width, height);
int totalsecs=fromTime.secsTo(toTime);
float minlen=(float)height*60./(float)totalsecs;
float cellHeight=(60.*(float)minlen);
float currY=y;
QTime curTime( fromTime );
QTime endTime( toTime );
if ( fromTime.minute() > 30 )
curTime = QTime( fromTime.hour()+1, 0, 0 );
else if ( fromTime.minute() > 0 ) {
curTime = QTime( fromTime.hour(), 30, 0 );
float yy = currY + minlen*(float)fromTime.secsTo( curTime )/60.;
p.drawLine( x+width/2, (int)yy, x+width, (int)yy );
curTime = QTime( fromTime.hour()+1, 0, 0 );
}
currY += ( fromTime.secsTo(curTime)*minlen/60 );
while ( curTime < endTime ) {
p.drawLine( x, (int)currY, x+width, (int)currY );
int newY=(int)(currY+cellHeight/2.);
QString numStr;
if (newY < y+height) {
p.drawLine(x+width/2, (int)newY, x+width, (int)newY);
// draw the time:
if ( !KGlobal::locale()->use12Clock() ) {
numStr.setNum(curTime.hour());
if (cellHeight > 30) {
p.setFont(QFont("helvetica", 16, QFont::Bold));
} else {
p.setFont(QFont("helvetica", 12, QFont::Bold));
}
p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight,
- AlignTop|AlignRight, numStr);
+ Qt::AlignTop|Qt::AlignRight, numStr);
p.setFont(QFont("helvetica", 10, QFont::Normal));
p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3,
- AlignTop | AlignLeft, "00");
+ Qt::AlignTop | Qt::AlignLeft, "00");
} else {
QTime time( curTime.hour(), 0 );
numStr = KGlobal::locale()->formatTime( time );
p.setFont(QFont("helvetica", 14, QFont::Bold));
p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3,
- AlignTop|AlignLeft, numStr);
+ Qt::AlignTop|Qt::AlignLeft, numStr);
}
currY+=cellHeight;
} // enough space for half-hour line and time
if (curTime.secsTo(endTime)>3600)
curTime=curTime.addSecs(3600);
else curTime=endTime;
} // currTime<endTime
}
///////////////////////////////////////////////////////////////////////////////
/** prints the all-day box for the agenda print view. if expandable is set,
height is the cell height of a single cell, and the returned height will
be the total height used for the all-day events. If !expandable, only one
cell will be used, and multiple events are concatenated using ", ".
*/
void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList,
const QDate &qd, bool expandable,
int x, int y, int width, int &height)
{
Event::List::Iterator it, itold;
int offset=y;
@@ -451,70 +453,70 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList,
holiday->setDtEnd(qd);
holiday->setFloats(true);
holiday->setCategories(i18n("Holiday"));
eventList.prepend(holiday);
}
#endif
Event *currEvent = 0;
// First, print all floating events
while( it!=eventList.end() ) {
currEvent=*it;
itold=it;
++it;
if ( currEvent->doesFloat() ) {
// set the colors according to the categories
QString text = currEvent->summary() ;
if ( ! currEvent->location().isEmpty() )
text += " ("+currEvent->location()+")";
if (expandable) {
if (mUseColors)
setCategoryColors(p, currEvent);
p.drawRect( x, offset, width, height );
p.drawText( x+5, offset+5, width-10, height-10,
- AlignCenter | AlignVCenter | AlignJustify | WordBreak,
+ Qt::AlignCenter | Qt::AlignVCenter | Qt::AlignJustify | Qt::WordBreak,
text );
// reset the colors
p.setBrush( oldBrush );
p.setPen( oldPen );
p.setBackgroundColor(oldBgColor);
offset += height;
} else {
//if (!multiDayStr.isEmpty()) multiDayStr+=", ";
multiDayStr += text+"\n";
}
eventList.remove( itold );
}
}
if (!expandable) {
p.drawRect(x, offset, width, height);
if (!multiDayStr.isEmpty()) {
// p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) );
p.drawText( x+5, offset+5, width-10, height-10,
- AlignLeft | AlignTop | AlignJustify ,
+ Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify ,
multiDayStr);
}
} else {
height=offset-y;
}
}
void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
const QDate &qd, bool expandable,
QTime &fromTime, QTime &toTime,
int x, int y, int width, int height )
{
p.drawRect( x, y, width, height );
Event *event;
if ( expandable ) {
// Adapt start/end times to include complete events
Event::List::ConstIterator it;
for ( it = events.begin(); it != events.end(); ++it ) {
event = *it;
if ( event->dtStart().time() < fromTime )
fromTime = event->dtStart().time();
@@ -539,232 +541,232 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
QTime curTime( QTime( fromTime.hour(), 0, 0 ) );
currY += fromTime.secsTo( curTime ) * minlen / 60;
while ( curTime < toTime && curTime.isValid() ) {
if ( currY > y ) p.drawLine( x, int( currY ), x + width, int( currY ) );
currY += cellHeight / 2;
if ( ( currY > y ) && ( currY < y + height ) ) {
QPen oldPen( p.pen() );
p.setPen( QColor( 192, 192, 192 ) );
p.drawLine( x, int( currY ), x + width, int( currY ) );
p.setPen( oldPen );
} // enough space for half-hour line
if ( curTime.secsTo( toTime ) > 3600 )
curTime = curTime.addSecs( 3600 );
else curTime = toTime;
currY += cellHeight / 2;
}
QDateTime startPrintDate = QDateTime( qd, fromTime );
QDateTime endPrintDate = QDateTime( qd, toTime );
// Calculate horizontal positions and widths of events taking into account
// overlapping events
- QPtrList<KOrg::CellItem> cells;
+ Q3PtrList<KOrg::CellItem> cells;
cells.setAutoDelete( true );
Event::List::ConstIterator itEvents;
for( itEvents = events.begin(); itEvents != events.end(); ++itEvents ) {
cells.append( new PrintCellItem( *itEvents, qd ) );
}
- QPtrListIterator<KOrg::CellItem> it1( cells );
+ Q3PtrListIterator<KOrg::CellItem> it1( cells );
for( it1.toFirst(); it1.current(); ++it1 ) {
KOrg::CellItem *placeItem = it1.current();
KOrg::CellItem::placeItem( cells, placeItem );
}
QPen oldPen = p.pen();
QColor oldBgColor = p.backgroundColor();
QBrush oldBrush = p.brush();
p.setFont( QFont( "helvetica", 10 ) );
//p.setBrush( QBrush( Dense7Pattern ) );
for( it1.toFirst(); it1.current(); ++it1 ) {
PrintCellItem *placeItem = static_cast<PrintCellItem *>( it1.current() );
drawAgendaItem( placeItem, p, qd, startPrintDate, endPrintDate, minlen, x,
y, width );
p.setBrush( oldBrush );
p.setPen( oldPen );
p.setBackgroundColor( oldBgColor );
}
- p.setBrush( QBrush( NoBrush ) );
+ p.setBrush( QBrush( Qt::NoBrush ) );
}
void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p,
const QDate &qd,
const QDateTime &startPrintDate,
const QDateTime &endPrintDate,
float minlen, int x, int y, int width )
{
Event *event = item->event();
// set the colors according to the categories
if ( mUseColors ) setCategoryColors( p, event );
else p.setBrush( Qt::white );
// start/end of print area for event
QDateTime startTime = event->dtStart();
QDateTime endTime = event->dtEnd();
if ( event->doesRecur() ) {
startTime.setDate( qd );
endTime.setDate( qd );
}
if ( ( startTime < endPrintDate && endTime > startPrintDate ) ||
( endTime > startPrintDate && startTime < endPrintDate ) ) {
if ( startTime < startPrintDate ) startTime = startPrintDate;
if ( endTime > endPrintDate ) endTime = endPrintDate;
int eventLength = int( startTime.secsTo( endTime ) / 60. * minlen );
int currentyPos = int( y + startPrintDate.secsTo( startTime ) *
minlen / 60. );
int currentWidth = width / item->subCells();
int currentX = x + item->subCell() * currentWidth;
QString text = KGlobal::locale()->formatTime(event->dtStart().time())+
"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+
" "+event->summary();
if ( !event->location().isEmpty() )
text += " (" +event->location()+")";
// p.save();
QPen pe = p.pen();
pe.setWidth( 2 );
p.setPen( pe );
p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 );
p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3,
- AlignLeft | AlignTop | AlignJustify | WordBreak,
+ Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify | Qt::TextWordWrap,
text);
// p.restore();
}
}
void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
int x, int y, int width, int height,
bool fullDate)
{
QString dayNumStr;
QString ampm;
const KLocale*local = KGlobal::locale();
// This has to be localized
if (fullDate) {
dayNumStr = local->formatDate(qd);
} else {
dayNumStr = QString::number( qd.day() );
}
p.eraseRect( x, y, width, height );
p.drawRect( x, y, width, height );
// p.fillRect( x+1, y+1, width-2,height, QBrush(Dense7Pattern) );
p.drawRect( x, y, width, mSubHeaderHeight );
//p.fillRect( x+1, y+1, width-2, mSubHeaderHeight-2, QBrush(Dense7Pattern) );
QString hstring;
#ifndef KORG_NOPLUGINS
hstring=KOCore::self()->holiday(qd);
#endif
if (!hstring.isEmpty()) {
p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) );
- p.drawText( x+5, y, width-25, mSubHeaderHeight, AlignLeft | AlignVCenter,
+ p.drawText( x+5, y, width-25, mSubHeaderHeight, Qt::AlignLeft | Qt::AlignVCenter,
hstring );
}
p.setFont(QFont("helvetica", 10, QFont::Bold));
if ( fullDate) {
// use short date format, if long date is too long
QFontMetrics fm ( p.font() );
if ( fm.width( dayNumStr ) > width -10 )
dayNumStr = local->formatDate(qd, true);
}
- p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter,
+ p.drawText(x+5, y, width-10, mSubHeaderHeight, Qt::AlignRight | Qt::AlignVCenter,
dayNumStr);
Event::List eventList;
eventList.fill( mCalendar->events( qd, true ));
Todo::List todos;
todos.fill( mCalendar->todos( qd ));
QString outStr;
p.setFont( QFont( "helvetica", 8 ) );
int lineSpacing = p.fontMetrics().lineSpacing();
int textY=mSubHeaderHeight+3; // gives the relative y-coord of the next printed entry
Event::List::ConstIterator it;
int entryCount = eventList.count() +todos.count();
if ( p.fontMetrics().lineSpacing()* entryCount > height-textY ) {
if ( (p.fontMetrics().lineSpacing()-1) * entryCount > height-textY ) {
p.setFont( QFont( "helvetica", 7 ) );
if ( (p.fontMetrics().lineSpacing()-1) * entryCount > height-textY )
p.setFont( QFont( "helvetica", 6 ) );
}
lineSpacing = p.fontMetrics().lineSpacing()-1;
}
// qDebug("fm %d %d %d ",p.fontMetrics().height(), eventList.count() , height-textY );
for( it = eventList.begin(); it != eventList.end() && textY<height; ++it ) {
Event *currEvent = *it;
if (currEvent->doesFloat() || currEvent->isMultiDay())
outStr = currEvent->summary();
else {
if ( fullDate ) {
outStr = KGlobal::locale()->formatTime( currEvent->dtStart().time())+
"-"+KGlobal::locale()->formatTime( currEvent->dtEnd().time())+
" "+ currEvent->summary();
if ( ! currEvent->location().isEmpty() )
outStr += " (" + currEvent->location()+")";
} else {
QTime t1 = currEvent->dtStart().time();
outStr = local->formatTime(t1);
outStr += " " + currEvent->summary();
}
} // doesFloat
p.drawText(x+5, y+textY, width-10, lineSpacing,
- AlignLeft|AlignBottom, outStr);
+ Qt::AlignLeft|Qt::AlignBottom, outStr);
textY+=lineSpacing;
}
if ( textY<height ) {
Todo::List::ConstIterator it2;
for( it2 = todos.begin(); it2 != todos.end() && textY<height; ++it2 ) {
Todo *todo = *it2;
QString text;
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
text += KGlobal::locale()->formatTime(todo->dtDue().time());
text += " ";
}
}
text += i18n("To-Do: %1").arg(todo->summary());
p.drawText(x+5, y+textY, width-10, lineSpacing,
- AlignLeft|AlignBottom, text);
+ Qt::AlignLeft|Qt::AlignBottom, text);
textY+=lineSpacing;
}
}
}
///////////////////////////////////////////////////////////////////////////////
void CalPrintBase::drawWeek(QPainter &p, const QDate &qd,
int x, int y, int width, int height)
{
QDate weekDate = qd;
bool portrait = ( mPrinter->orientation() == KPrinter::Portrait );
int cellWidth, cellHeight;
int vcells;
if (portrait) {
cellWidth = width/2;
vcells=3;
} else {
cellWidth = width/6;
vcells=1;
}
cellHeight = height/vcells;
@@ -828,217 +830,215 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers,
int yoffset = mSubHeaderHeight;
int xoffset = 0;
QDate monthDate(QDate(qd.year(), qd.month(), 1));
QDate monthFirst(monthDate);
QDate monthLast(monthDate.addMonths(1).addDays(-1));
int weekdayCol = weekdayColumn( monthDate.dayOfWeek() );
monthDate = monthDate.addDays(-weekdayCol);
int rows=(weekdayCol + qd.daysInMonth() - 1)/7 +1;
int cellHeight = (height-yoffset) / rows;
if (weeknumbers) {
QFont oldFont(p.font());
QFont newFont(p.font());
newFont.setPointSize(7);
p.setFont(newFont);
xoffset += 18;
QDate weekDate(monthDate);
for (int row = 0; row<rows; row++) {
int calWeek = weekDate.weekNumber();
QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight);
- p.drawText( rc, AlignRight|AlignVCenter, QString::number(calWeek) );
+ p.drawText( rc, Qt::AlignRight|Qt::AlignVCenter, QString::number(calWeek) );
weekDate = weekDate.addDays(7);
}
p.setFont(oldFont);
}
drawDaysOfWeek( p, monthDate, monthDate.addDays(6), x+xoffset, y, width-xoffset, mSubHeaderHeight );
int cellWidth = (width-xoffset) / 7;
QColor back = p.backgroundColor();
bool darkbg = false;
for (int row = 0; row < rows; row++) {
for (int col = 0; col < 7; col++) {
// show days from previous/next month with a grayed background
if ( (monthDate < monthFirst) || (monthDate > monthLast) ) {
p.setBackgroundColor( QColor( 240, 240, 240) );
darkbg = true;
}
drawDayBox(p, monthDate, x+xoffset+col*cellWidth, y+yoffset+row*cellHeight, cellWidth, cellHeight);
if ( darkbg ) {
p.setBackgroundColor( back );
darkbg = false;
}
monthDate = monthDate.addDays(1);
}
}
}
///////////////////////////////////////////////////////////////////////////////
void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &p, bool connectSubTodos,
bool desc, int pospriority, int possummary, int posDueDt, int level,
int x, int &y, int width, int &height, int pageHeight,
TodoParentStart *r )
{
if ( !completed && item->isCompleted() )
return;
QString outStr;
// int fontHeight = 10;
const KLocale *local = KGlobal::locale();
int priority=item->priority();
int posdue=posDueDt;
if (posdue<0) posdue=x+width;
QRect rect;
TodoParentStart startpt;
// This list keeps all starting points of the parent todos so the connection
// lines of the tree can easily be drawn (needed if a new page is started)
- static QPtrList<TodoParentStart> startPoints;
+ static Q3PtrList<TodoParentStart> startPoints;
if (level<1) {
startPoints.clear();
}
// size of item
outStr=item->summary();
if ( ! item->location().isEmpty() )
outStr += " ("+item->location()+")";
if ( item->hasDueDate() && posDueDt>=0 ) {
outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]";
}
int left = possummary+(level*10);
- rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr);
+ rect = p.boundingRect(left, y, (posdue-left-5),-1, Qt::WordBreak, outStr);
//qDebug("bottom1 %d ", rect.bottom() );
if ( !item->description().isEmpty() && desc ) {
outStr = item->description();
rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1,
- WordBreak, outStr );
+ Qt::WordBreak, outStr );
}
//qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight );
// if too big make new page
if ( rect.bottom() > y+height) {
// first draw the connection lines from parent todos:
if (level > 0 && connectSubTodos) {
TodoParentStart *rct;
for ( rct = startPoints.first(); rct; rct = startPoints.next() ) {
int start;
int center = rct->mRect.left() + (rct->mRect.width()/2);
int to = p.viewport().bottom();
// draw either from start point of parent or from top of the page
if (rct->mSamePage)
start = rct->mRect.bottom() + 1;
else
start = p.viewport().top();
- p.moveTo( center, start );
- p.lineTo( center, to );
+ p.drawLine( center, start, center, to );
rct->mSamePage=false;
}
}
y=0;
height=pageHeight-y;
mPrinter->newPage();
}
// If this is a sub-item, r will not be 0, and we want the LH side of the priority line up
//to the RH side of the parent item's priority
if (r && pospriority >= 0 ) {
pospriority = r->mRect.right() + 1;
}
// Priority
outStr.setNum(priority);
- rect = p.boundingRect(pospriority, y + 10, 5, -1, AlignCenter, outStr);
+ rect = p.boundingRect(pospriority, y + 10, 5, -1, Qt::AlignCenter, outStr);
// Make it a more reasonable size
rect.setWidth(19);
rect.setHeight(19);
if ( priority > 0 && pospriority>=0 ) {
- p.drawText(rect, AlignCenter, outStr);
+ p.drawText(rect, Qt::AlignCenter, outStr);
p.drawRect(rect);
// cross out the rectangle for completed items
if ( item->isCompleted() ) {
p.drawLine( rect.topLeft(), rect.bottomRight() );
p.drawLine( rect.topRight(), rect.bottomLeft() );
} else if (item->cancelled() ) {
QPen pen = p.pen();
- p.setPen ( QPen ( black, 2) );
+ p.setPen ( QPen ( Qt::black, 2) );
p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 );
p.setPen( pen );
}
}
startpt.mRect = rect; //save for later
// Connect the dots
if (level > 0 && connectSubTodos) {
int bottom;
int center( r->mRect.left() + (r->mRect.width()/2)+1 );
if (r->mSamePage )
bottom = r->mRect.bottom();//lutz + 1;
else
bottom = 0;
int to( rect.top() + (rect.height()/2)+1 );
int endx( rect.left() );
- p.moveTo(center, bottom);
- p.lineTo(center, to);
- p.lineTo(endx, to);
+ p.drawLine(center,bottom, center,to);
+ p.drawLine(center,to, endx,to);
}
// if completed, use strike out font
// LR does not work - font is underlined, not striked out
//QFont ft=p.font();
//ft.setStrikeOut( item->isCompleted() );
//p.setFont( ft );
// summary
outStr=item->summary();
if ( ! item->location().isEmpty() )
outStr += " ("+item->location()+")";
if ( item->hasDueDate() && posDueDt>=0 ) {
outStr += " [" +item->dtDueStr(true)+"]";
}
rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)),
- -1, WordBreak, outStr);
+ -1, Qt::WordBreak, outStr);
QRect newrect;
- p.drawText( rect, WordBreak, outStr, -1, &newrect );
+ p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect );
//ft.setStrikeOut(false);
// p.setFont(ft);
// due
// if ( item->hasDueDate() && posDueDt>=0 ) {
// outStr = local->formatDate(item->dtDue().date(),true);
// rect = p.boundingRect(posdue, y, x+width, -1, AlignTop|AlignLeft, outStr);
// p.drawText(rect, AlignTop|AlignLeft, outStr);
// }
if ( !item->description().isEmpty() && desc ) {
y=newrect.bottom() + 5;
outStr = item->description();
rect = p.boundingRect( left+20, y, x+width-(left+10), -1,
- WordBreak, outStr );
- p.drawText( rect, WordBreak, outStr, -1, &newrect );
+ Qt::WordBreak, outStr );
+ p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect );
}
// Set the new line position
y=newrect.bottom() + 10; //set the line position
// If the item has subitems, we need to call ourselves recursively
Incidence::List l;l.fill( item->relations());
Incidence::List::ConstIterator it;
startPoints.append( &startpt );
for( it = l.begin(); it != l.end(); ++it ) {
count++;
drawTodo( completed, count, static_cast<Todo *>( *it ), p, connectSubTodos,
desc, pospriority, possummary, posDueDt, level+1,
x, y, width, height, pageHeight, &startpt);
}
startPoints.remove(&startpt);
}
int CalPrintBase::weekdayColumn( int weekday )
{
return ( weekday + 7 - KGlobal::locale()->weekStartDay() ) % 7;
}
void CalPrintBase::drawSplitWeek( QPainter &p, const QDate &fd,
@@ -1117,108 +1117,108 @@ void CalPrintBase::drawSplitWeek( QPainter &p, const QDate &fd,
break;
case 6:
drawSplitDay( p, curDay, columnWidth, pageHeight,
int( columnWidth * 2.5 ) );
if ( curDay < toDay )
mPrinter->newPage();
curWeek = curWeek.addDays( 7 );
break;
}
curDay = curDay.addDays(1);
} while (curDay <= toDay);
}
void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd,
const QDate &td,
const QDate &,
int width, int )
{
int tempStore = mSubHeaderHeight;
mSubHeaderHeight+= mSubHeaderHeight;
KLocale *local = KGlobal::locale();
QFont font("helvetica", 18, QFont::Bold);
- QPen penA( black,0);
- QPen penB( black,3);
+ QPen penA( Qt::black,0);
+ QPen penB( Qt::black,3);
p.setFont(font);
int lineSpacing = p.fontMetrics().lineSpacing();
QString title;
QString myOwner(mCalendar->getOwner());
if ( fd.month() == td.month() ) {
title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' '
+ '-' + ' ' + QString::number(td.day());
} else {
title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' '
+ '-' + ' ' + local->monthName(td.month(), false) + ' ' + QString::number(td.day());
}
// Grrrrrrr! why can't I set the font to a serif font?!?!?
QFont serifFont("Helvetica", 30);
// serifFont.setFamily("Serif");
// serifFont.setWeight(87);
// serifFont.setItalic(true);
p.setFont(serifFont);
QFontInfo info(p.font());
lineSpacing = p.fontMetrics().lineSpacing();
- p.drawText(0, lineSpacing * 0, width, lineSpacing, AlignRight |AlignTop, title );
+ p.drawText(0, lineSpacing * 0, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title );
title.truncate(0);
p.setPen(penB );
p.drawLine(200, lineSpacing * 1, width, lineSpacing * 1);
p.setPen(penA );
p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE));
title += QString::number(fd.year());
- p.drawText(0, lineSpacing * 1, width, lineSpacing, AlignRight |AlignTop, title );
+ p.drawText(0, lineSpacing * 1, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title );
mSubHeaderHeight = tempStore ;
}
void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
int height, int offsetLeft )
{
int tempStore = mSubHeaderHeight;
mSubHeaderHeight+= mSubHeaderHeight;
int startHour = KOPrefs::instance()->mDayBegins;
int endHour = 20;
int offset = mHeaderHeight + mSubHeaderHeight + 10;
Event::List eventList; eventList.fill( mCalendar->events( qd, true ));
Event::List::Iterator it;
Event *currEvent;
KLocale *local = KGlobal::locale();
QString dayName;
dayName = local->weekDayName(qd.dayOfWeek()) + ' ' + ' ' + QString::number(qd.day());
//p.setBrush(QBrush(black));
// width+1 to make sure there's a continuous, black bar across the top.
p.setPen( QPen(Qt::black,2));
p.drawRect(offsetLeft, mHeaderHeight + 5, width +1, mSubHeaderHeight);
p.setPen( Qt::black);
p.setFont(QFont("helvetica", 12, QFont::Bold, true));
p.drawText(offsetLeft, mHeaderHeight + 5,
- width, mSubHeaderHeight, AlignHCenter | AlignVCenter,
+ width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter,
dayName);
p.setPen( QPen(Qt::black,2));
p.setFont(QFont("helvetica", 12));
p.setBrush(Qt::white);
it = eventList.begin();
int allDays = 0;
/*
while( it != eventList.end() ) {
Event *currEvent = *it;
if ( currEvent->doesFloat() ) {
p.drawRect( offsetLeft, offset, width, 35 );
p.drawText( offsetLeft + 5, offset + 10, width - 10, 30,
AlignLeft | AlignTop, currEvent->summary() );
offset += 40;
allDays++;
it = eventList.remove( it );
} else {
++it;
}
}
*/
//p.setBrush(QBrush());
int tmpEnd;
@@ -1233,74 +1233,74 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
int hours = endHour - startHour;
int cellHeight = (height-offset) / hours; // hour increments.
p.setFont(QFont("helvetica", 12));
//p.setBrush(QBrush(Dense7Pattern));
p.setBrush(Qt::white);
for ( it = eventList.begin(); it != eventList.end(); ++it ) {
Event *currEvent = *it;
int startTime = currEvent->dtStart().time().hour();
int endTime = currEvent->dtEnd().time().hour();
float minuteInc = cellHeight / 60.0;
if ((startTime >= startHour) && (endTime <= (startHour + hours))) {
startTime -= startHour;
int startMinuteOff = (int) (minuteInc *
currEvent->dtStart().time().minute());
QString text = currEvent->summary() ;
if ( ! currEvent->location().isEmpty() )
text += "\n("+currEvent->location()+")";
int endMinuteOff = (int) (minuteInc * currEvent->dtEnd().time().minute());
int cheight = (int) (minuteInc *
currEvent->dtStart().secsTo(currEvent->dtEnd()) / 60 );
p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight,
width-4, cheight);
p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24,
- cheight-10, AlignHCenter | AlignTop, text);
+ cheight-10, Qt::AlignHCenter | Qt::AlignTop, text);
}
}
- p.setBrush(QBrush(NoBrush));
+ p.setBrush(QBrush(Qt::NoBrush));
mSubHeaderHeight = tempStore ;
}
void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth,
int height )
{
int tempStore = mSubHeaderHeight;
mSubHeaderHeight+= mSubHeaderHeight;
int startHour = KOPrefs::instance()->mDayBegins;
int endHour = 20;
int offset = mHeaderHeight + mSubHeaderHeight + 10;
int hours = endHour - startHour;
int cellHeight = (height-offset) / hours; // hour increments.
QString numStr;
for (int i = 0; i < hours; i++) {
- p.setPen(QPen(black,1));
+ p.setPen(QPen(Qt::black,1));
p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight);
- p.setPen(QPen(gray,0));
+ p.setPen(QPen(Qt::gray,0));
p.drawLine(37, offset+i*cellHeight+(cellHeight/2),
width, offset+i*cellHeight+(cellHeight/2));
- p.setPen(QPen(black,0));
+ p.setPen(QPen(Qt::black,0));
if ( !KGlobal::locale()->use12Clock() ) {
numStr.setNum(i+startHour);
if (cellHeight > 40) {
p.setFont(QFont("helvetica", 16, QFont::Bold));
} else {
p.setFont(QFont("helvetica", 14, QFont::Bold));
}
p.drawText(0, offset+i*cellHeight, 33, cellHeight/2,
- AlignTop|AlignRight, numStr);
+ Qt::AlignTop|Qt::AlignRight, numStr);
p.setFont(QFont("helvetica", 12, QFont::Bold));
p.drawText(37, offset+i*cellHeight, 45, cellHeight/2,
- AlignTop | AlignLeft, "00");
+ Qt::AlignTop | Qt::AlignLeft, "00");
} else {
QTime time( i + startHour, 0 );
numStr = KGlobal::locale()->formatTime( time );
p.setFont(QFont("helvetica", 12, QFont::Bold));
p.drawText(4, offset+i*cellHeight, 70, cellHeight/2,
- AlignTop|AlignLeft, numStr);
+ Qt::AlignTop|Qt::AlignLeft, numStr);
}
} mSubHeaderHeight = tempStore ;
}
#endif
diff --git a/korganizer/calprinter.cpp b/korganizer/calprinter.cpp
index 0cdf28e..d4bf988 100644
--- a/korganizer/calprinter.cpp
+++ b/korganizer/calprinter.cpp
@@ -1,56 +1,59 @@
/*
This file is part of KOrganizer.
Copyright (c) 1998 Preston Brown
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qvbuttongroup.h>
-#include <qwidgetstack.h>
+// #include <qvbuttongroup.h>
+#include <q3widgetstack.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qlabel.h>
-#include <qvbox.h>
+#include <q3vbox.h>
#include <qsplitter.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3PtrList>
#include <kprinter.h>
#include <kglobal.h>
#include <ksimpleconfig.h>
#include <kmessagebox.h>
#include <kdebug.h>
//#include <kdeversion.h>
#include "koprefsdialog.h"
#include "calprinter.h"
#ifndef KORG_NOPRINTER
//#include "calprinter.moc"
#include "calprintplugins.h"
CalPrinter::CalPrinter( QWidget *parent, Calendar *calendar )
: QObject( parent, "CalPrinter" )
{
mCalendar = calendar;
mParent = parent;
mPrinter = new KPrinter;
mPrinter->setOrientation( KPrinter::Portrait );
mConfig = new KConfig(locateLocal("config","korganizer_printing.rc" ));
@@ -153,79 +156,79 @@ void CalPrinter::doPrint( CalPrintBase *selectedStyle, bool preview )
case eOrientPortrait:
mPrinter->setOrientation( KPrinter::Portrait );
break;
case eOrientLandscape:
mPrinter->setOrientation( KPrinter::Landscape );
break;
case eOrientPrinter:
default:
break;
}
selectedStyle->doPrint();
}
//mPrinter->setPreviewOnly( false );
}
///////////////////////////////////////////////////////////////////////////////
void CalPrinter::updateConfig()
{
}
/****************************************************************************/
-CalPrintDialog::CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p,
+CalPrintDialog::CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p,
QWidget *parent, const char *name )
: KDialogBase( parent, name, /*modal*/true, i18n("Print"), Ok | Cancel ),
mPrinter( p ), mPrintPlugins( plugins )
{
- QVBox *page = new QVBox(this);//makeVBoxMainWidget();
+ Q3VBox *page = new Q3VBox(this);//makeVBoxMainWidget();
setMainWidget( page );
- QHBox *printerLayout = new QHBox( page );
+ Q3HBox *printerLayout = new Q3HBox( page );
mPrinterLabel = new QLabel( printerLayout );
QPushButton *setupButton = new QPushButton( i18n("&Setup Printer..."),
printerLayout );
setupButton->setSizePolicy( QSizePolicy(
(QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0,
0, 0, setupButton->sizePolicy().hasHeightForWidth() ) );
QSplitter *splitter = new QSplitter( page );
- splitter->setOrientation( QSplitter::Horizontal );
+ splitter->setOrientation( Qt::Horizontal );
- mTypeGroup = new QVButtonGroup( i18n("View Type"), splitter, "buttonGroup" );
+ mTypeGroup = new Q3VButtonGroup( i18n("View Type"), splitter, "buttonGroup" );
// use the minimal width possible = max width of the radio buttons, not extensible
/* mTypeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4,
(QSizePolicy::SizeType)5, 0, 0,
mTypeGroup->sizePolicy().hasHeightForWidth() ) );*/
QWidget *splitterRight = new QWidget( splitter, "splitterRight" );
- QGridLayout *splitterRightLayout = new QGridLayout( splitterRight );
+ Q3GridLayout *splitterRightLayout = new Q3GridLayout( splitterRight );
splitterRightLayout->setMargin( marginHint() );
splitterRightLayout->setSpacing( spacingHint() );
- mConfigArea = new QWidgetStack( splitterRight, "configWidgetStack" );
+ mConfigArea = new Q3WidgetStack( splitterRight, "configWidgetStack" );
splitterRightLayout->addMultiCellWidget( mConfigArea, 0,0, 0,1 );
QLabel *orientationLabel = new QLabel( i18n("Page &orientation:"),
splitterRight, "orientationLabel" );
splitterRightLayout->addWidget( orientationLabel, 1, 0 );
mOrientationSelection = new QComboBox( splitterRight, "orientationCombo" );
mOrientationSelection->insertItem( i18n("Use Default of Selected Style") );
mOrientationSelection->insertItem( i18n("Use Default Setting of Printer") );
mOrientationSelection->insertItem( i18n("Portrait") );
mOrientationSelection->insertItem( i18n("Landscape") );
splitterRightLayout->addWidget( mOrientationSelection, 1, 1 );
// signals and slots connections
connect( setupButton, SIGNAL( clicked() ), SLOT( setupPrinter() ) );
connect( mTypeGroup, SIGNAL( clicked( int ) ), SLOT( setPrintType( int ) ) );
// buddies
orientationLabel->setBuddy( mOrientationSelection );
CalPrintBase *plug = mPrintPlugins.first();
QRadioButton *radioButton;
int id = 0;
while ( plug ) {
diff --git a/korganizer/calprinter.h b/korganizer/calprinter.h
index 7b58f4f..e065779 100644
--- a/korganizer/calprinter.h
+++ b/korganizer/calprinter.h
@@ -1,66 +1,68 @@
+//Added by qt3to4:
+#include <QLabel>
/*
This file is part of KOrganizer.
Copyright (c) 1998 Preston Brown
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _CALPRINTER_H
#define _CALPRINTER_H
// #define KORG_NOPRINTER
#ifndef KORG_NOPRINTER
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kdialogbase.h>
#include <korganizer/baseview.h>
#include "calprintbase.h"
using namespace KCal;
-class QVButtonGroup;
-class QWidgetStack;
+class Q3VButtonGroup;
+class Q3WidgetStack;
class KPrinter;
class CalPrintDialog;
class KConfig;
class QComboBox;
class QLabel;
/**
CalPrinter is a class for printing Calendars. It can print in several
different formats (day, week, month). It also provides a way for setting
up the printer and remembering these preferences.
*/
class CalPrinter : public QObject, public KOrg::CalPrinterBase
{
Q_OBJECT
public:
enum ePrintOrientation {
eOrientPlugin=0,
eOrientPrinter,
eOrientPortrait,
eOrientLandscape
};
public:
@@ -73,70 +75,70 @@ class CalPrinter : public QObject, public KOrg::CalPrinterBase
void init( KPrinter *printer, Calendar *calendar );
void setupPrinter();
/**
Set date range to be printed.
\param start Start date
\param end End date
*/
void setDateRange( const QDate &start, const QDate &end );
public slots:
void updateConfig();
private slots:
void doPrint( CalPrintBase *selectedStyle, bool preview );
public:
void preview( PrintType type, const QDate &fd, const QDate &td );
void print( PrintType type, const QDate &fd, const QDate &td );
protected:
- QPtrList<CalPrintBase> mPrintPlugins;
+ Q3PtrList<CalPrintBase> mPrintPlugins;
private:
KPrinter *mPrinter;
Calendar *mCalendar;
QWidget *mParent;
KConfig *mConfig;
CalPrintDialog *mPrintDialog;
};
class CalPrintDialog : public KDialogBase
{
Q_OBJECT
public:
- CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p,
+ CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p,
QWidget *parent = 0, const char *name = 0 );
virtual ~CalPrintDialog();
CalPrintBase *selectedPlugin();
CalPrinter::ePrintOrientation orientation() { return mOrientation; }
public slots:
void setPrintType( int );
void setPreview( bool );
protected slots:
void slotOk();
void setupPrinter();
void setPrinterLabel();
signals:
void okClicked();
private:
KPrinter *mPrinter;
- QVButtonGroup *mTypeGroup;
- QWidgetStack *mConfigArea;
- QPtrList<CalPrintBase> mPrintPlugins;
+ Q3VButtonGroup *mTypeGroup;
+ Q3WidgetStack *mConfigArea;
+ Q3PtrList<CalPrintBase> mPrintPlugins;
QLabel *mPrinterLabel;
QString mPreviewText;
QComboBox *mOrientationSelection;
CalPrinter::ePrintOrientation mOrientation;
};
#endif
#endif
diff --git a/korganizer/calprintplugins.cpp b/korganizer/calprintplugins.cpp
index bc35ca4..9b6dc6e 100644
--- a/korganizer/calprintplugins.cpp
+++ b/korganizer/calprintplugins.cpp
@@ -4,53 +4,53 @@
Copyright (c) 1998 Preston Brown
Copyright (c) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qpainter.h>
-#include <qdatetimeedit.h>
+#include <q3datetimeedit.h>
#include <qdatetime.h>
#include <qcheckbox.h>
#include <qlineedit.h>
-#include <qbuttongroup.h>
+#include <q3buttongroup.h>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
#include <kprinter.h>
#include <kconfig.h>
#include <kcalendarsystem.h>
#include <libkcal/todo.h>
#include <libkcal/calendar.h>
#include <libkdepim/kdateedit.h>
#include "koprefs.h"
#include "koglobals.h"
#include "calprintplugins.h"
#ifndef KORG_NOPRINTER
//#include "calprintplugins.moc"
#define LEFT_DISTANCE 45
/**************************************************************
* Print Day
diff --git a/korganizer/cellitem.cpp b/korganizer/cellitem.cpp
index 61d06ac..1fd703c 100644
--- a/korganizer/cellitem.cpp
+++ b/korganizer/cellitem.cpp
@@ -6,93 +6,95 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include "cellitem.h"
#include <klocale.h>
#include <kdebug.h>
-#include <qintdict.h>
+#include <q3intdict.h>
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KOrg;
QString CellItem::label() const
{
return i18n("<undefined>");
}
-QPtrList<CellItem> CellItem::placeItem( QPtrList<CellItem> cells,
+Q3PtrList<CellItem> CellItem::placeItem( Q3PtrList<CellItem> cells,
CellItem *placeItem )
{
kdDebug(5855) << "Placing " << placeItem->label() << endl;
- QPtrList<KOrg::CellItem> conflictItems;
+ Q3PtrList<KOrg::CellItem> conflictItems;
int maxSubCells = 0;
- QIntDict<KOrg::CellItem> subCellDict;
+ Q3IntDict<KOrg::CellItem> subCellDict;
// Find all items which are in same cell
- QPtrListIterator<KOrg::CellItem> it2( cells );
+ Q3PtrListIterator<KOrg::CellItem> it2( cells );
for( it2.toFirst(); it2.current(); ++it2 ) {
KOrg::CellItem *item = it2.current();
if ( item == placeItem ) continue;
if ( item->overlaps( placeItem ) ) {
kdDebug(5855) << " Overlaps: " << item->label() << endl;
conflictItems.append( item );
if ( item->subCells() > maxSubCells ) maxSubCells = item->subCells();
subCellDict.insert( item->subCell(), item );
}
}
if ( conflictItems.count() > 0 ) {
// Look for unused sub cell and insert item
int i;
for( i = 0; i < maxSubCells; ++i ) {
kdDebug(5855) << " Trying subcell " << i << endl;
if ( !subCellDict.find( i ) ) {
kdDebug(5855) << " Use subcell " << i << endl;
placeItem->setSubCell( i );
break;
}
}
if ( i == maxSubCells ) {
kdDebug(5855) << " New subcell " << i << endl;
placeItem->setSubCell( maxSubCells );
maxSubCells++; // add new item to number of sub cells
}
kdDebug(5855) << " Sub cells: " << maxSubCells << endl;
// Write results to item to be placed
conflictItems.append( placeItem );
placeItem->setSubCells( maxSubCells );
- QPtrListIterator<KOrg::CellItem> it3( conflictItems );
+ Q3PtrListIterator<KOrg::CellItem> it3( conflictItems );
for( it3.toFirst(); it3.current(); ++it3 ) {
(*it3)->setSubCells( maxSubCells );
}
// Todo: Adapt subCells of items conflicting with conflicting items
} else {
kdDebug(5855) << " no conflicts" << endl;
placeItem->setSubCell( 0 );
placeItem->setSubCells( 1 );
}
return conflictItems;
}
diff --git a/korganizer/cellitem.h b/korganizer/cellitem.h
index 72773d0..b917bd5 100644
--- a/korganizer/cellitem.h
+++ b/korganizer/cellitem.h
@@ -4,63 +4,63 @@
Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KORG_CELLITEM_H
#define KORG_CELLITEM_H
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
namespace KOrg {
class CellItem
{
public:
CellItem()
: mSubCells( 0 ), mSubCell( -1 )
{
}
void setSubCells( int v ) { mSubCells = v; }
int subCells() const { return mSubCells; }
void setSubCell( int v ) { mSubCell = v; }
int subCell() const { return mSubCell; }
virtual bool overlaps( CellItem *other ) const = 0;
virtual QString label() const;
/**
Place item \arg placeItem into stripe containing items \arg cells in a
way that items don't overlap.
\return Placed items
*/
- static QPtrList<CellItem> placeItem( QPtrList<CellItem> cells,
+ static Q3PtrList<CellItem> placeItem( Q3PtrList<CellItem> cells,
CellItem *placeItem );
private:
int mSubCells;
int mSubCell;
};
}
#endif
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index ea510f1..53507d3 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -13,48 +13,50 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <kdebug.h>
#include <klocale.h>
//#include "koglobals.h"
#include "navigatorbar.h"
#include "kdatenavigator.h"
#include <kcalendarsystem.h>
#include "datenavigatorcontainer.h"
#include "koprefs.h"
+//Added by qt3to4:
+#include <QResizeEvent>
DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
const char *name )
: QWidget( parent, name ), mCalendar( 0 ),
mHorizontalCount( 1 ), mVerticalCount( 1 )
{
mResizeEnabled = false;
mExtraViews.setAutoDelete( true );
mNavigatorView = new KDateNavigator( this, name );
mNavigatorView->hide();
connectNavigatorView( mNavigatorView );
//setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
mLastDisplayedDN = 0;
mUpdateTimer = new QTimer( this );
connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
mFirstSelectedDate = QDate::currentDate();
mSelectedDateCount = 1;
}
DateNavigatorContainer::~DateNavigatorContainer()
{
}
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index 87cc59f..75d387c 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -1,24 +1,27 @@
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <Q3PtrList>
/*
This file is part of KOrganizer.
Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
@@ -79,31 +82,31 @@ class DateNavigatorContainer: public QWidget
void goNextYear();
void goPrevYear();
void showMonth( const QDate & );
void monthSelected( int month );
protected:
void computeMonthSelected( int month , bool forceEmit );
void jumpMonth( int month );
void resizeEvent( QResizeEvent * );
void setBaseDates();
void connectNavigatorView( KDateNavigator *v );
private:
bool mResizeEnabled;
QTimer* mUpdateTimer;
int mLastDisplayedDN;
QDate mFirstSelectedDate;
int mSelectedDateCount;
KDateNavigator *mNavigatorView;
KCal::Calendar *mCalendar;
- QPtrList<KDateNavigator> mExtraViews;
+ Q3PtrList<KDateNavigator> mExtraViews;
int mHorizontalCount;
int mVerticalCount;
};
#endif
diff --git a/korganizer/filteredit_base.cpp b/korganizer/filteredit_base.cpp
index 505edf6..9425963 100644
--- a/korganizer/filteredit_base.cpp
+++ b/korganizer/filteredit_base.cpp
@@ -1,136 +1,140 @@
/****************************************************************************
** Form implementation generated from reading ui file 'filteredit_base.ui'
**
** Created: Fr Jan 21 21:25:30 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "filteredit_base.h"
#include <qvariant.h>
#include <qpushbutton.h>
-#include <qframe.h>
-#include <qbuttongroup.h>
+#include <q3frame.h>
+#include <q3buttongroup.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include <qradiobutton.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3HBoxLayout>
+#include <Q3VBoxLayout>
#include "tr.h"
/*
* Constructs a FilterEdit_base as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
-FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl )
+FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, Qt::WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "FilterEdit_base" );
- FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout");
+ FilterEdit_baseLayout = new Q3VBoxLayout( this, 0, 0, "FilterEdit_baseLayout");
- mCriteriaFrame = new QFrame( this, "mCriteriaFrame" );
- mCriteriaFrame->setFrameShape( QFrame::StyledPanel );
- mCriteriaFrame->setFrameShadow( QFrame::Raised );
- mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout");
+ mCriteriaFrame = new Q3Frame( this, "mCriteriaFrame" );
+ mCriteriaFrame->setFrameShape( Q3Frame::StyledPanel );
+ mCriteriaFrame->setFrameShadow( Q3Frame::Raised );
+ mCriteriaFrameLayout = new Q3VBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout");
- ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" );
+ ButtonGroup1 = new Q3ButtonGroup( mCriteriaFrame, "ButtonGroup1" );
ButtonGroup1->setColumnLayout(0, Qt::Vertical );
ButtonGroup1->layout()->setSpacing( 6 );
ButtonGroup1->layout()->setMargin( 6 );
- ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
+ ButtonGroup1Layout = new Q3GridLayout( ButtonGroup1->layout() );
ButtonGroup1Layout->setAlignment( Qt::AlignTop );
- layout4 = new QHBoxLayout( 0, 0, 6, "layout4");
+ layout4 = new Q3HBoxLayout( 0, 0, 6, "layout4");
mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" );
layout4->addWidget( mCatShowCheck );
mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" );
layout4->addWidget( mCatHideCheck );
mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" );
layout4->addWidget( mCatEditButton );
ButtonGroup1Layout->addLayout( layout4, 0, 0 );
- mCatList = new QListBox( ButtonGroup1, "mCatList" );
+ mCatList = new Q3ListBox( ButtonGroup1, "mCatList" );
ButtonGroup1Layout->addWidget( mCatList, 1, 0 );
mCriteriaFrameLayout->addWidget( ButtonGroup1 );
- layout7 = new QHBoxLayout( 0, 0, 6, "layout7");
+ layout7 = new Q3HBoxLayout( 0, 0, 6, "layout7");
textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" );
layout7->addWidget( textLabel1 );
mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" );
layout7->addWidget( mRecurringCheck );
mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" );
layout7->addWidget( mCompletedCheck );
mCriteriaFrameLayout->addLayout( layout7 );
- layout9 = new QHBoxLayout( 0, 0, 6, "layout9");
+ layout9 = new Q3HBoxLayout( 0, 0, 6, "layout9");
textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" );
layout9->addWidget( textLabel1_2 );
mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" );
layout9->addWidget( mEventCheck );
mTodoCheck = new QCheckBox( mCriteriaFrame, "mTodoCheck" );
layout9->addWidget( mTodoCheck );
mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" );
layout9->addWidget( mJournalCheck );
mCriteriaFrameLayout->addLayout( layout9 );
- layout2 = new QHBoxLayout( 0, 0, 0, "layout2");
+ layout2 = new Q3HBoxLayout( 0, 0, 0, "layout2");
textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" );
layout2->addWidget( textLabel2 );
mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" );
layout2->addWidget( mPublicCheck );
mPrivateCheck = new QCheckBox( mCriteriaFrame, "mPrivateCheck" );
layout2->addWidget( mPrivateCheck );
mConfidentialCheck = new QCheckBox( mCriteriaFrame, "mConfidentialCheck" );
mConfidentialCheck->setChecked( FALSE );
layout2->addWidget( mConfidentialCheck );
mCriteriaFrameLayout->addLayout( layout2 );
FilterEdit_baseLayout->addWidget( mCriteriaFrame );
languageChange();
resize( QSize(300, 200).expandedTo(minimumSizeHint()) );
- clearWState( WState_Polished );
}
/*
* Destroys the object and frees any allocated resources
*/
FilterEdit_base::~FilterEdit_base()
{
// no need to delete child widgets, Qt does it all for us
}
/*
* Sets the strings of the subwidgets using the current
* language.
*/
void FilterEdit_base::languageChange()
{
setCaption( tr( "FilterEditor" ) );
ButtonGroup1->setTitle( tr( "Categories" ) );
mCatShowCheck->setText( tr( "Include" ) );
mCatHideCheck->setText( tr( "Exclude" ) );
mCatEditButton->setText( tr( "Edit Selection..." ) );
textLabel1->setText( tr( "Exclude" ) );
if (QApplication::desktop()->width() > 480 ) {
mCompletedCheck->setText( tr( "completed to-dos" ) );
diff --git a/korganizer/filteredit_base.h b/korganizer/filteredit_base.h
index 13a02c3..135f6fa 100644
--- a/korganizer/filteredit_base.h
+++ b/korganizer/filteredit_base.h
@@ -1,69 +1,75 @@
/****************************************************************************
** Form interface generated from reading ui file 'filteredit_base.ui'
**
** Created: Fr Jan 21 21:25:30 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef FILTEREDIT_BASE_H
#define FILTEREDIT_BASE_H
#include <qvariant.h>
#include <qwidget.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3Frame>
+#include <Q3GridLayout>
+#include <Q3HBoxLayout>
+#include <QLabel>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
+class Q3VBoxLayout;
+class Q3HBoxLayout;
+class Q3GridLayout;
class QSpacerItem;
-class QFrame;
-class QButtonGroup;
+class Q3Frame;
+class Q3ButtonGroup;
class QRadioButton;
class QPushButton;
-class QListBox;
-class QListBoxItem;
+class Q3ListBox;
+class Q3ListBoxItem;
class QLabel;
class QCheckBox;
class FilterEdit_base : public QWidget
{
Q_OBJECT
public:
- FilterEdit_base( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ FilterEdit_base( QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0 );
~FilterEdit_base();
- QFrame* mCriteriaFrame;
- QButtonGroup* ButtonGroup1;
+ Q3Frame* mCriteriaFrame;
+ Q3ButtonGroup* ButtonGroup1;
QRadioButton* mCatShowCheck;
QRadioButton* mCatHideCheck;
QPushButton* mCatEditButton;
- QListBox* mCatList;
+ Q3ListBox* mCatList;
QLabel* textLabel1;
QCheckBox* mRecurringCheck;
QCheckBox* mCompletedCheck;
QLabel* textLabel1_2;
QCheckBox* mEventCheck;
QCheckBox* mTodoCheck;
QCheckBox* mJournalCheck;
QLabel* textLabel2;
QCheckBox* mPublicCheck;
QCheckBox* mPrivateCheck;
QCheckBox* mConfidentialCheck;
protected:
- QVBoxLayout* FilterEdit_baseLayout;
- QVBoxLayout* mCriteriaFrameLayout;
- QGridLayout* ButtonGroup1Layout;
- QHBoxLayout* layout4;
- QHBoxLayout* layout7;
- QHBoxLayout* layout9;
- QHBoxLayout* layout2;
+ Q3VBoxLayout* FilterEdit_baseLayout;
+ Q3VBoxLayout* mCriteriaFrameLayout;
+ Q3GridLayout* ButtonGroup1Layout;
+ Q3HBoxLayout* layout4;
+ Q3HBoxLayout* layout7;
+ Q3HBoxLayout* layout9;
+ Q3HBoxLayout* layout2;
protected slots:
virtual void languageChange();
};
#endif // FILTEREDIT_BASE_H
diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp
index df84911..a3cff49 100644
--- a/korganizer/filtereditdialog.cpp
+++ b/korganizer/filtereditdialog.cpp
@@ -5,103 +5,108 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlayout.h>
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qapplication.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3PtrList>
+
+#include <QDesktopWidget>
#include <kdebug.h>
#include <klocale.h>
#include <klineeditdlg.h>
#include <kmessagebox.h>
#include <libkdepim/categoryselectdialog.h>
#include "koprefs.h"
#include "filteredit_base.h"
#include "filtereditdialog.h"
//#include "filtereditdialog.moc"
// TODO: Make dialog work on a copy of the filters objects.
class ComboFilterBox: public QComboBox
{
public:
ComboFilterBox( QWidget *parent=0, const char *name=0) :
QComboBox( parent,name ) { }
void popupBox() { popup(); }
};
-FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent,
+FilterEditDialog::FilterEditDialog(Q3PtrList<CalFilter> *filters,QWidget *parent,
const char *name) :
KDialogBase(parent,name,true,i18n("Edit Calendar Filters"),
Ok|Apply|Cancel)
{
mFilters = filters;
QWidget *mainWidget = new QWidget(this);
setMainWidget(mainWidget);
mSelectionCombo = new ComboFilterBox(mainWidget);
connect(mSelectionCombo,SIGNAL(activated(int)),SLOT(filterSelected()));
// mSelectionCombo->setEditable ( true );
QPushButton *addButton = new QPushButton(i18n("Add Filter"),mainWidget);
connect(addButton,SIGNAL(clicked()),SLOT(slotAdd()));
addButton->setMaximumSize( addButton->sizeHint());
mRemoveButton = new QPushButton( i18n("Remove"), mainWidget );
connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemove() ) );
mRemoveButton->setMaximumSize( mRemoveButton->sizeHint());
QPushButton *upButton = new QPushButton(i18n("Up"),mainWidget);
upButton->setMaximumSize( upButton->sizeHint());
connect(upButton,SIGNAL(clicked()),SLOT(slotUp()));
mEditor = new FilterEdit_base(mainWidget);
- QGridLayout *topLayout = new QGridLayout(mainWidget,2,2);
+ Q3GridLayout *topLayout = new Q3GridLayout(mainWidget,2,2);
topLayout->setSpacing(spacingHint());
topLayout->addWidget(mSelectionCombo,0,0);
topLayout->addWidget(upButton,0,1);
topLayout->addWidget(addButton,0,2);
topLayout->addWidget(mRemoveButton,0,3);
topLayout->addMultiCellWidget(mEditor,1,1,0,3);
mSelectionCombo->setMaximumWidth ( QApplication::desktop()->width() -
addButton->maximumWidth() -
mRemoveButton->maximumWidth() -
upButton->maximumWidth() -
spacingHint() * 5 );
connect(mEditor->mCatEditButton,SIGNAL(clicked()),
SLOT(editCategorySelection()));
// Clicking cancel exits the dialog without saving
connect(this,SIGNAL(cancelClicked()),SLOT(reject()));
updateFilterList();
}
FilterEditDialog::~FilterEditDialog()
{
}
void FilterEditDialog::slotUp()
{
diff --git a/korganizer/filtereditdialog.h b/korganizer/filtereditdialog.h
index 42aa3da..c1a52ed 100644
--- a/korganizer/filtereditdialog.h
+++ b/korganizer/filtereditdialog.h
@@ -2,85 +2,85 @@
This file is part of KOrganizer.
Copyright (c) 2001, 2002 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _FILTEREDITDIALOG_H
#define _FILTEREDITDIALOG_H
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kdialogbase.h>
#include <libkcal/calfilter.h>
class QComboBox;
class ComboFilterBox;
class QPushButton;
class FilterEdit_base;
using namespace KCal;
/**
This is the class to add/edit a calendar filter.
@short Creates a dialog box to create/edit a calendar filter
@author Cornelius Schumacher
*/
class FilterEditDialog : public KDialogBase
{
Q_OBJECT
public:
- FilterEditDialog(QPtrList<CalFilter> *,QWidget *parent=0, const char *name=0);
+ FilterEditDialog(Q3PtrList<CalFilter> *,QWidget *parent=0, const char *name=0);
virtual ~FilterEditDialog();
public slots:
void updateFilterList();
signals:
void filterChanged();
protected slots:
void slotDefault();
void slotApply();
void slotOk();
void accept();
void slotAdd();
void slotUp();
void slotRemove();
void filterSelected();
void editCategorySelection();
void updateCategorySelection(const QStringList &categories);
protected:
void readFilter(CalFilter *);
void writeFilter(CalFilter *);
private:
- QPtrList<CalFilter> *mFilters;
+ Q3PtrList<CalFilter> *mFilters;
ComboFilterBox *mSelectionCombo;
QPushButton *mRemoveButton;
FilterEdit_base *mEditor;
QStringList mCategories;
};
#endif
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp
index fe78356..c2402d4 100644
--- a/korganizer/incomingdialog.cpp
+++ b/korganizer/incomingdialog.cpp
@@ -1,85 +1,87 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <qlistview.h>
+#include <q3listview.h>
#include <qfile.h>
#include <qdir.h>
#include <qmap.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <libkcal/incidence.h>
#include <libkcal/event.h>
#include <libkcal/calendar.h>
#include <libkcal/freebusy.h>
#include <libkcal/attendee.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#ifndef KORG_NOMAIL
#include "mailscheduler.h"
#else
#include <libkcal/dummyscheduler.h>
#endif
#include "incomingdialog.h"
#include "koeventviewerdialog.h"
#include "kocounterdialog.h"
#include "koprefs.h"
#ifndef KORG_NOKABC
#define KORG_NOKABC
//#include <kabc/stdaddressbook.h>
#define size count
#endif
-ScheduleItemIn::ScheduleItemIn(QListView *parent,IncidenceBase *ev,
+ScheduleItemIn::ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev,
Scheduler::Method method,ScheduleMessage::Status status)
- : QListViewItem(parent)
+ : Q3ListViewItem(parent)
{
mIncidence = ev;
mMethod = method;
mStatus = status;
setText(6,Scheduler::translatedMethodName(mMethod)+" ");
setText(7,ScheduleMessage::statusName(status));
}
/* Visitor */
ScheduleItemVisitor::ScheduleItemVisitor(ScheduleItemIn *item)
{
mItem = item;
}
ScheduleItemVisitor::~ScheduleItemVisitor()
{
}
bool ScheduleItemVisitor::visit(Event *e)
{
mItem->setText(0,e->summary());
mItem->setText(1,e->dtStartDateStr());
if (e->doesFloat()) {
@@ -114,83 +116,83 @@ bool ScheduleItemVisitor::visit(Todo *e)
mItem->setText(1,e->dtDueDateStr());
if (!e->doesFloat()) {
mItem->setText(2,e->dtDueTimeStr());
}
}
mItem->setText(5,e->organizer()+" ");
return true;
}
bool ScheduleItemVisitor::visit(Journal *)
{
return false;
}
/*
* Constructs a IncomingDialog which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing,
- QWidget* parent,const char* name,bool modal,WFlags fl) :
+ QWidget* parent,const char* name,bool modal,Qt::WFlags fl) :
IncomingDialog_base(parent,name,modal,fl)
{
mCalendar = calendar;
mOutgoing = outgoing;
#ifndef KORG_NOMAIL
mScheduler = new MailScheduler(mCalendar);
#else
mScheduler = new DummyScheduler(mCalendar);
#endif
- mMessageListView->setColumnAlignment(1,AlignHCenter);
- mMessageListView->setColumnAlignment(2,AlignHCenter);
- mMessageListView->setColumnAlignment(3,AlignHCenter);
- mMessageListView->setColumnAlignment(4,AlignHCenter);
- QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)),
- this,SLOT(showEvent(QListViewItem *)));
+ mMessageListView->setColumnAlignment(1,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(2,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(3,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(4,Qt::AlignHCenter);
+ QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)),
+ this,SLOT(showEvent(Q3ListViewItem *)));
retrieve();
}
/*
* Destroys the object and frees any allocated resources
*/
IncomingDialog::~IncomingDialog()
{
// no need to delete child widgets, Qt does it all for us
}
void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing)
{
mOutgoing = outgoing;
}
void IncomingDialog::retrieve()
{
- QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions();
+ Q3PtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions();
ScheduleMessage *message;
for(message = messages.first();message;message = messages.next()) {
IncidenceBase *inc = message->event();
Scheduler::Method method = (Scheduler::Method)message->method();
ScheduleMessage::Status status = message->status();
ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status);
if(inc->typeID() != freebusyID ) {
Incidence *incidence = static_cast<Incidence *>(inc);
ScheduleItemVisitor v(item);
if (!incidence->accept(v)) delete item;
} else {
FreeBusy *fb = static_cast<FreeBusy *>(item->event());
item->setText(0, "FreeBusy");
item->setText(1, KGlobal::locale()->formatDate( fb->dtStart().date() ) );
item->setText(2, KGlobal::locale()->formatTime( fb->dtStart().time() ) );
item->setText(3, KGlobal::locale()->formatDate( fb->dtEnd().date() ) );
item->setText(4, KGlobal::locale()->formatTime( fb->dtEnd().time() ) );
item->setText(5, fb->organizer());
}
automaticAction(item);
}
emit numMessagesChanged(mMessageListView->childCount());
@@ -231,66 +233,66 @@ bool IncomingDialog::acceptMessage(ScheduleItemIn *item)
return incomeDeclineCounter(item);
break;
case Scheduler::Add:
return incomeAdd(item);
break;
case Scheduler::Request:
return incomeRequest(item);
break;
default:
return incomeDefault(item);
}
return false;
}
void IncomingDialog::rejectMessage()
{
ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem();
if (item) {
mScheduler->deleteTransaction(item->event());
delete item;
emit numMessagesChanged(mMessageListView->childCount());
}
}
-void IncomingDialog::showEvent(QListViewItem *item)
+void IncomingDialog::showEvent(Q3ListViewItem *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
if( incidence && incidence->typeID() == eventID ) {
Event *event = static_cast<Event *>(incidence);
KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
eventViewer->setEvent(event);
eventViewer->show();
}
}
bool IncomingDialog::incomeRefresh(ScheduleItemIn *item)
{
Event *ev = mCalendar->event(item->event()->uid());
if (ev) {
//user interaction before??
Attendee *att;
- QPtrList<Attendee> attlist = ev->attendees();
+ Q3PtrList<Attendee> attlist = ev->attendees();
for (att=attlist.first(); att; att=attlist.next()) {
Event *event = new Event(*ev);
mOutgoing->addMessage(event,Scheduler::Request,att->email());
delete(event);
}
mScheduler->deleteTransaction(item->event());
delete item;
emit numMessagesChanged(mMessageListView->childCount());
return true;
}
mScheduler->deleteTransaction(item->event());
delete item;
emit numMessagesChanged(mMessageListView->childCount());
return false;
}
bool IncomingDialog::incomeCounter(ScheduleItemIn *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
// currently only events supportet - attetion at insertion below!
if ( incidence->typeID() != eventID ) return false;
Event *counterEvent = static_cast<Event *>( incidence );
@@ -493,36 +495,36 @@ bool IncomingDialog::automaticAction(ScheduleItemIn *item)
}
}
}
return autoAction;
}
bool IncomingDialog::checkOrganizerInAddressbook(QString organizer)
{
bool inBook = false;
#ifndef KORG_NOKABC
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
KABC::Addressee::List addressList;
addressList = add_book->findByEmail(organizer);
if ( addressList.size()>0 ) inBook = true;
#endif
return inBook;
}
bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc)
{
bool inBook = false;
#ifndef KORG_NOKABC
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
KABC::Addressee::List addressList;
- QPtrList <Attendee> attendees;
+ Q3PtrList <Attendee> attendees;
Attendee *att;
attendees = inc->attendees();
for (att=attendees.first();att;att=attendees.next()) {
addressList = add_book->findByEmail(att->email());
if (addressList.size()>0 ) inBook = true;
}
#endif
return inBook;
}
//#include "incomingdialog.moc"
diff --git a/korganizer/incomingdialog.h b/korganizer/incomingdialog.h
index 413ce6a..e002b25 100644
--- a/korganizer/incomingdialog.h
+++ b/korganizer/incomingdialog.h
@@ -1,110 +1,110 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef INCOMINGDIALOG_H
#define INCOMINGDIALOG_H
-#include <qlistview.h>
+#include <q3listview.h>
#include <libkcal/calendar.h>
#include <libkcal/scheduler.h>
#include "incomingdialog_base.h"
#include "outgoingdialog.h"
using namespace KCal;
-class ScheduleItemIn : public QListViewItem
+class ScheduleItemIn : public Q3ListViewItem
{
public:
- ScheduleItemIn(QListView *parent,IncidenceBase *ev,Scheduler::Method method,
+ ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev,Scheduler::Method method,
ScheduleMessage::Status status);
virtual ~ScheduleItemIn() {}
IncidenceBase *event() { return mIncidence; }
Scheduler::Method method() { return mMethod; }
ScheduleMessage::Status status() { return mStatus; }
private:
IncidenceBase *mIncidence;
Scheduler::Method mMethod;
ScheduleMessage::Status mStatus;
};
/**
This class provides the initialisation of a ScheduleItemIn for calendar
components using the Incidence::Visitor.
*/
class ScheduleItemVisitor : public Incidence::Visitor
{
public:
ScheduleItemVisitor(ScheduleItemIn *);
~ScheduleItemVisitor();
bool visit(Event *);
bool visit(Todo *);
bool visit(Journal *);
private:
ScheduleItemIn *mItem;
};
class IncomingDialog : public IncomingDialog_base
{
Q_OBJECT
public:
IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing,
- QWidget* parent=0,const char* name=0,bool modal=false,WFlags fl=0);
+ QWidget* parent=0,const char* name=0,bool modal=false,Qt::WFlags fl=0);
~IncomingDialog();
void setOutgoingDialog(OutgoingDialog *outgoing);
signals:
void calendarUpdated();
void numMessagesChanged(int);
public slots:
void retrieve();
protected slots:
void acceptAllMessages();
void acceptMessage();
void rejectMessage();
- void showEvent(QListViewItem *);
+ void showEvent(Q3ListViewItem *);
protected:
bool acceptMessage(ScheduleItemIn *item);
bool incomeRefresh(ScheduleItemIn *item);
bool incomeCounter(ScheduleItemIn *item);
bool incomeDeclineCounter(ScheduleItemIn *item);
bool incomeAdd(ScheduleItemIn *item);
bool incomeRequest(ScheduleItemIn *item);
bool incomeDefault(ScheduleItemIn *item);
bool automaticAction(ScheduleItemIn *item);
private:
bool checkAttendeesInAddressbook(IncidenceBase *inc);
bool checkOrganizerInAddressbook(QString organizer);
Calendar *mCalendar;
Scheduler *mScheduler;
OutgoingDialog *mOutgoing;
};
#endif // INCOMINGDIALOG_H
diff --git a/korganizer/incomingdialog_base.cpp b/korganizer/incomingdialog_base.cpp
index 8589803..5c5ace4 100644
--- a/korganizer/incomingdialog_base.cpp
+++ b/korganizer/incomingdialog_base.cpp
@@ -1,69 +1,71 @@
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/incomingdialog_base.ui'
**
** Created: Sat Mar 29 22:31:27 2003
** by: The User Interface Compiler ()
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "incomingdialog_base.h"
#include <qvariant.h>
-#include <qheader.h>
-#include <qlistview.h>
+#include <q3header.h>
+#include <q3listview.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
/*
* Constructs a IncomingDialog_base as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
-IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl )
+IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "IncomingDialog_base" );
- IncomingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout");
+ IncomingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout");
PushButton4 = new QPushButton( this, "PushButton4" );
IncomingDialog_baseLayout->addWidget( PushButton4, 0, 1 );
PushButton7 = new QPushButton( this, "PushButton7" );
PushButton7->setDefault( TRUE );
IncomingDialog_baseLayout->addWidget( PushButton7, 5, 1 );
- mMessageListView = new QListView( this, "mMessageListView" );
+ mMessageListView = new Q3ListView( this, "mMessageListView" );
mMessageListView->addColumn( tr2i18n( "Summary" ) );
mMessageListView->addColumn( tr2i18n( "Start Date" ) );
mMessageListView->addColumn( tr2i18n( "Start Time" ) );
mMessageListView->addColumn( tr2i18n( "End Date" ) );
mMessageListView->addColumn( tr2i18n( "End Time" ) );
mMessageListView->addColumn( tr2i18n( "Organizer" ) );
mMessageListView->addColumn( tr2i18n( "Method" ) );
mMessageListView->addColumn( tr2i18n( "Status" ) );
mMessageListView->setAllColumnsShowFocus( FALSE );
IncomingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 5, 0, 0 );
PushButton7_2 = new QPushButton( this, "PushButton7_2" );
IncomingDialog_baseLayout->addWidget( PushButton7_2, 3, 1 );
PushButton8 = new QPushButton( this, "PushButton8" );
IncomingDialog_baseLayout->addWidget( PushButton8, 1, 1 );
PushButton9 = new QPushButton( this, "PushButton9" );
IncomingDialog_baseLayout->addWidget( PushButton9, 2, 1 );
QSpacerItem* spacer = new QSpacerItem( 20, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
diff --git a/korganizer/incomingdialog_base.h b/korganizer/incomingdialog_base.h
index 7732384..537ef86 100644
--- a/korganizer/incomingdialog_base.h
+++ b/korganizer/incomingdialog_base.h
@@ -1,51 +1,55 @@
/****************************************************************************
** Form interface generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/incomingdialog_base.ui'
**
** Created: Sat Mar 29 22:24:26 2003
** by: The User Interface Compiler ()
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef INCOMINGDIALOG_BASE_H
#define INCOMINGDIALOG_BASE_H
#include <qvariant.h>
#include <qdialog.h>
-
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QListView;
-class QListViewItem;
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3GridLayout>
+#include <Q3HBoxLayout>
+
+class Q3VBoxLayout;
+class Q3HBoxLayout;
+class Q3GridLayout;
+class Q3ListView;
+class Q3ListViewItem;
class QPushButton;
class IncomingDialog_base : public QDialog
{
Q_OBJECT
public:
- IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~IncomingDialog_base();
QPushButton* PushButton4;
QPushButton* PushButton7;
- QListView* mMessageListView;
+ Q3ListView* mMessageListView;
QPushButton* PushButton7_2;
QPushButton* PushButton8;
QPushButton* PushButton9;
protected:
- QGridLayout* IncomingDialog_baseLayout;
+ Q3GridLayout* IncomingDialog_baseLayout;
protected slots:
virtual void languageChange();
virtual void acceptAllMessages();
virtual void acceptMessage();
virtual void rejectMessage();
virtual void retrieve();
};
#endif // INCOMINGDIALOG_BASE_H
diff --git a/korganizer/interfaces/korganizer/baseview.h b/korganizer/interfaces/korganizer/baseview.h
index 2ac9de1..c828573 100644
--- a/korganizer/interfaces/korganizer/baseview.h
+++ b/korganizer/interfaces/korganizer/baseview.h
@@ -3,50 +3,50 @@
Copyright (c) 1999 Cornelius Schumacher <schumacher@kde.org>
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef KORG_BASEVIEW_H
#define KORG_BASEVIEW_H
// $Id$
// KOBaseView is the abstract base class of all calendar views.
#include <qwidget.h>
-#include <qptrlist.h>
-#include <qvaluelist.h>
+#include <q3ptrlist.h>
+#include <q3valuelist.h>
#include <klocale.h>
#include <kdebug.h>
#include <kmessagebox.h>
#include <libkcal/event.h>
#include <libkcal/calendar.h>
using namespace KCal;
class CalPrinter;
namespace KOrg {
class CalPrinterBase
{
public:
enum PrintType { Day, Week, Month, Todolist };
};
/**
This class provides an interface for all views being displayed within the main
calendar view. It has functions to update the view, to specify date range and
@@ -67,49 +67,49 @@ class BaseView : public QWidget
@param cal Pointer to the calendar object from which events
will be retrieved for display.
@param parent parent widget.
@param name name of this widget.
*/
BaseView(Calendar *cal, QWidget *parent = 0, const char *name = 0) :
QWidget(parent, name), mCalendar(cal) {}
/**
Destructor. Views will do view-specific cleanups here.
*/
virtual ~BaseView() {}
/**
Return calendar object of this view.
*/
Calendar *calendar() { return mCalendar; }
/**
@return a list of selected events. Most views can probably only
select a single event at a time, but some may be able to select
more than one.
*/
- virtual QPtrList<Incidence> selectedIncidences() = 0;
+ virtual Q3PtrList<Incidence> selectedIncidences() = 0;
/**
@return a list of the dates of selected events. Most views can probably only
select a single event at a time, but some may be able to select
more than one.
*/
virtual DateList selectedDates() = 0;
/**
Generate a print preview of this event view.
@param calPrinter Calendar printer object used for printing
@param fd from date
@param td to date
*/
/*
The date parameters should be determined by the view itself and not given as
parameters. At the moment I just move the code from the topwidget to the
individual views.
*/
virtual void printPreview(CalPrinter *,
const QDate &, const QDate &)
{
KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n"
@@ -132,49 +132,49 @@ class BaseView : public QWidget
*/
virtual int currentDateCount() = 0;
/** Return if this view is a view for displaying events. */
virtual bool isEventView() { return false; }
virtual bool isMonthView() { return false; }
public slots:
/**
Show incidences for the given date range. The date range actually shown may be
different from the requested range, depending on the particular requirements
of the view.
@param start Start of date range.
@param end End of date range.
*/
virtual void showDates( const QDate &start, const QDate &end ) = 0;
/**
Show given events. Depending on the actual view it might not be possible to
show all given events.
@param eventList a list of events to show.
*/
- virtual void showEvents(QPtrList<Event> eventList) = 0;
+ virtual void showEvents(Q3PtrList<Event> eventList) = 0;
/**
Updates the current display to reflect changes that may have happened
in the calendar since the last display refresh.
*/
virtual void updateView() = 0;
/**
Write all unsaved data back to calendar store.
*/
virtual void flushView() {}
/**
Updates the current display to reflect the changes to one particular event.
*/
virtual void changeEventDisplay(Event *, int) = 0;
/**
Re-reads the KOrganizer configuration and picks up relevant
changes which are applicable to the view.
*/
virtual void updateConfig() {}
/**
diff --git a/korganizer/interfaces/korganizer/calendarviewbase.h b/korganizer/interfaces/korganizer/calendarviewbase.h
index 3c715b1..1f49357 100644
--- a/korganizer/interfaces/korganizer/calendarviewbase.h
+++ b/korganizer/interfaces/korganizer/calendarviewbase.h
@@ -2,64 +2,66 @@
This file is part of the KOrganizer interfaces.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef KORG_CALENDARVIEWBASE_H
#define KORG_CALENDARVIEWBASE_H
// $Id$
#include <qwidget.h>
#include <qlayout.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
#include <libkcal/calendar.h>
#include <korganizer/baseview.h>
namespace KOrg {
/**
@short interface for main calendar view widget
@author Cornelius Schumacher
*/
class CalendarViewBase : public QWidget
{
Q_OBJECT
public:
CalendarViewBase(QWidget *parent, const char *name) :
- QWidget(parent,name) {new QVBoxLayout(this);}
+ QWidget(parent,name) {new Q3VBoxLayout(this);}
virtual ~CalendarViewBase() {};
virtual KCal::Calendar *calendar() = 0;
virtual QDate startDate() = 0;
virtual QDate endDate() = 0;
virtual Incidence *currentSelection() = 0;
virtual void addView(KOrg::BaseView *) = 0;
/** changes the view to be the currently selected view */
virtual void showView(KOrg::BaseView *) = 0;
public slots:
virtual void updateView() = 0;
};
}
#endif
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 5269af7..2814c61 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -5,93 +5,100 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
//
// Journal Entry
#include <qlabel.h>
#include <qlayout.h>
-#include <qvbox.h>
+#include <q3vbox.h>
#include <qfile.h>
#include <qdir.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qtextcodec.h>
#include <qpixmap.h>
#include <qpushbutton.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <Q3Frame>
+#include <QKeyEvent>
+#include <QEvent>
+#include <Q3VBoxLayout>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#include <ktextedit.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include "koprefs.h"
#include <klineedit.h>
#include <kdialog.h>
#include "kolocationbox.h"
#include <libkcal/journal.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#include "journalentry.h"
//#include "journalentry.moc"
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#endif
JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
- QFrame(parent)
+ Q3Frame(parent)
{
int fac = 5;
heiHint = QApplication::desktop()->height();
if ( heiHint > 800 )
fac += 2;
heiHint = heiHint / fac;
showOnlyMode = false;
mCalendar = calendar;
mJournal = 0;
visibleMode = true;
- QHBox * vb = new QHBox ( this );
+ Q3HBox * vb = new Q3HBox ( this );
QPixmap iconp;
vb->setMargin ( KDialog::marginHint()-1 );
QPushButton * toggleJournal = new QPushButton( vb );
iconp = SmallIcon("1updownarrow");
toggleJournal->setPixmap (iconp ) ;
QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb);
mTitle = new KOLocationBox(TRUE, vb, 30);
mTitle->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
mCalendarBox = new QComboBox(vb);
mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
#ifndef DESKTOP_VERSION
mTitle->setSizeLimit( 8 );
mCalendarBox->setSizeLimit( 8 );
#endif
vb->setStretchFactor ( mTitle, 8 );
int limit = 3;
if ( QApplication::desktop()->width() < 640 )
limit = 6;
vb->setStretchFactor ( mCalendarBox, limit );
//mTitleLabel->setMargin(0);
//mTitleLabel->setAlignment(AlignCenter);
QPushButton * loadTemplate = new QPushButton( vb );
QPushButton * saveTemplate = new QPushButton( vb );
if ( QApplication::desktop()->width() < 321 )
@@ -108,133 +115,133 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
loadTemplate->setFixedSize( size, size );
saveTemplate->setFixedSize( size, size );
int widwid = size;
if ( QApplication::desktop()->width() < 320 )
widwid = size/2+1;
toggleJournal->setFixedSize( widwid , size );
mTitle->setFixedHeight( size+4);
mCalendarBox->setFixedHeight( size+4);
mEditor = new KTextEdit(this);
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold );
#endif
mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width();
mDeskWid = QApplication::desktop()->width();
int maxwid = mDeskWid - mMaxWidDiff;
if ( QApplication::desktop()->width() < 640 ) {
mTitle->setMaximumWidth( maxwid/2 +20 );
mCalendarBox->setMaximumWidth( maxwid/2 -20);
} else {
mTitle->setMaximumWidth( (maxwid/4)*3);
mCalendarBox->setMaximumWidth( maxwid/2 );
}
//mCalendarBox->setMaximumWidth( maxwid/2 -20 );
mEditor->setWordWrap( KTextEdit::WidgetWidth );
- QBoxLayout *topLayout = new QVBoxLayout(this);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
topLayout->addWidget(vb);
topLayout->addWidget(mEditor);
mEditor->installEventFilter(this);
installEventFilter(this);
mTitle->installEventFilter(this);
- setFocusPolicy (QWidget::NoFocus);
+ setFocusPolicy (Qt::NoFocus);
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
mTitle->load( KOLocationBox::SUMMARYJOURNAL );
mTitle->lineEdit ()->setText("");
}
JournalEntry::~JournalEntry()
{
//qDebug("JournalEntry::~JournalEntry() ");
}
void JournalEntry::resizeEvent(QResizeEvent* e )
{
#ifndef DESKTOP_VERSION
if ( mDeskWid != QApplication::desktop()->width() ) {
mDeskWid == QApplication::desktop()->width();
int maxwid = mDeskWid - mMaxWidDiff;
if ( QApplication::desktop()->width() < 640 ) {
mTitle->setMaximumWidth( maxwid/2 +20 );
mCalendarBox->setMaximumWidth( maxwid/2 -20);
}
else {
mTitle->setMaximumWidth( (maxwid/4)*3);
mCalendarBox->setMaximumWidth( maxwid/2 );
}
//mCalendarBox->setMaximumWidth( maxwid/2 -20 );
}
//setMaximumWidth( QApplication::desktop()->width() );
//qDebug("MAXXX %d ", QApplication::desktop()->width());
#endif
- QFrame::resizeEvent( e );
+ Q3Frame::resizeEvent( e );
}
QSize JournalEntry::sizeHint() const
{
return QSize ( 240, heiHint );
}
void JournalEntry::slotSaveTemplate()
{
QString fileName =locateLocal( "templates", "journals" );
QDir t_dir;
if ( !t_dir.exists(fileName) )
t_dir.mkdir ( fileName );
fileName += "/journal";
fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this );
if ( fileName.length() == 0 )
return;
QFile fileIn( fileName );
- if (!fileIn.open( IO_WriteOnly ) ) {
+ if (!fileIn.open( QIODevice::WriteOnly ) ) {
KMessageBox::error( this, i18n("Error saving template file\n '%1'.")
.arg( fileName ) );
return;
}
// QString text;
- QTextStream tsIn( &fileIn );
+ Q3TextStream tsIn( &fileIn );
tsIn.setCodec( QTextCodec::codecForName("utf8") );
tsIn << mEditor->text();
fileIn.close();
}
void JournalEntry::slotLoadTemplate()
{
QString fileName =locateLocal( "templates", "journals" );
QDir t_dir;
if ( !t_dir.exists(fileName) )
t_dir.mkdir ( fileName );
fileName += "/journal";
fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this );
if ( fileName.length() == 0 )
return;
QFile fileIn( fileName );
- if (!fileIn.open( IO_ReadOnly ) ) {
+ if (!fileIn.open( QIODevice::ReadOnly ) ) {
KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
.arg( fileName ) );
return;
}
- QTextStream tsIn( &fileIn );
+ Q3TextStream tsIn( &fileIn );
tsIn.setCodec( QTextCodec::codecForName("utf8") );
QString text = tsIn.read();
fileIn.close();
int line, col;
mEditor->getCursorPosition (& line, & col );
mEditor-> insertAt ( text, line, col, true );
//mEditor->setIgnoreMark( true );
}
void JournalEntry::setDate(const QDate &date)
{
showOnlyMode = false;
writeJournal();
mDate = date;
fillCalendar( mCalendar->defaultCalendar() );
}
void JournalEntry::fillCalendar( int setToID )
{
mCalendarBox->clear();
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
int std = 0;
int count = 0;
while ( kkf ) {
if ( (!kkf->mErrorOnLoad &&! kkf->isReadOnly) || setToID == kkf->mCalNumber ) {
if ( setToID ) {
@@ -295,68 +302,68 @@ void JournalEntry::setJournal(Journal *journal, bool saveJournal )
mTitle->setEnabled (!journal->isReadOnly() );
mEditor->setReadOnly ( journal->isReadOnly() );
mCalendarBox->setEnabled (!journal->isReadOnly() );
fillCalendar( mJournal->calID() );
}
Journal *JournalEntry::journal() const
{
return mJournal;
}
void JournalEntry::clear()
{
mJournal = 0;
mEditor->setText("");
mTitle->load( KOLocationBox::SUMMARYJOURNAL );
mTitle->lineEdit ()->setText("");
}
bool JournalEntry::eventFilter( QObject *o, QEvent *e )
{
// kdDebug() << "JournalEntry::event received " << e->type() << endl;
if ( isVisible() ) {
- mEditor->setFocusPolicy (QWidget::StrongFocus);
- mTitle->setFocusPolicy (QWidget::StrongFocus);
+ mEditor->setFocusPolicy (Qt::StrongFocus);
+ mTitle->setFocusPolicy (Qt::StrongFocus);
} else {
- mEditor->setFocusPolicy (QWidget::NoFocus);
- mTitle->setFocusPolicy (QWidget::NoFocus);
+ mEditor->setFocusPolicy (Qt::NoFocus);
+ mTitle->setFocusPolicy (Qt::NoFocus);
}
if ( e->type() == QEvent::FocusOut ) {
writeJournal();
}
if ( e->type() == QEvent::KeyPress ) {
QKeyEvent * k = (QKeyEvent *) e;
if ( !isVisible() )
return true;
if ( k->state() == Qt::ControlButton ) {
k->ignore();
//return true;
}
}
- return QFrame::eventFilter( o, e ); // standard event processing
+ return Q3Frame::eventFilter( o, e ); // standard event processing
}
void JournalEntry::writeJournal()
{
if ( !visibleMode ) return;
if ( !mTitle->isEnabled() ) return;
if (mEditor->text().isEmpty() && mTitle->currentText().isEmpty()) {
if ( mJournal ) {
Journal* j = mJournal;
mJournal = 0;
bool conf = KOPrefs::instance()->mConfirm;
KOPrefs::instance()->mConfirm = false;
emit deleteJournal(j);
KOPrefs::instance()->mConfirm = conf;
}
return;
}
// kdDebug() << "JournalEntry::writeJournal()..." << endl;
if (!mJournal) {
mJournal = new Journal;
mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
mCalendar->addJournal(mJournal);
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index ee17da8..0adebe9 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -4,61 +4,66 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef JOURNALENTRY_H
#define JOURNALENTRY_H
//
// Widget showing one Journal entry
-#include <qframe.h>
+#include <q3frame.h>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QEvent>
+#include <QLabel>
+#include <QKeyEvent>
#include <libkcal/calendar.h>
class QLabel;
class KTextEdit;
class QComboBox;
class KLineEdit;
class KOLocationBox;
using namespace KCal;
-class JournalEntry : public QFrame {
+class JournalEntry : public Q3Frame {
Q_OBJECT
public:
JournalEntry(Calendar *,QWidget *parent);
virtual ~JournalEntry();
void setJournal(Journal *, bool saveJournal = true );
Journal *journal() const;
void setDate(const QDate &);
void clear();
void flushEntry();
void setShowOnly();
QSize sizeHint() const;
void setVisibleMode( bool b ) { visibleMode = b;}
void fillCalendar( int id = 0 );
void resizeEvent(QResizeEvent* e ) ;
KTextEdit * editor() {return mEditor;};
protected slots:
void slotSaveTemplate();
void slotLoadTemplate();
void toggleShowJournal();
void setVisibleOn();
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 6697602..ecc7a2f 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -1,128 +1,132 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qstring.h>
-#include <qkeycode.h>
+#include <qnamespace.h>
#include <qlayout.h>
#include <qtimer.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
#include <qapplication.h>
+//Added by qt3to4:
+#include <QWheelEvent>
+#include <Q3GridLayout>
+#include <QEvent>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
#include "koglobals.h"
#include "koprefs.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include <kcalendarsystem.h>
#include "navigatorbar.h"
#include "kdatenavigator.h"
KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
- : QFrame(parent, name),
+ : Q3Frame(parent, name),
updateTimer(0L)
{
- setFrameStyle(QFrame::NoFrame);
+ setFrameStyle(Q3Frame::NoFrame);
QDate startDate = QDate::currentDate();
- QGridLayout *topLayout = new QGridLayout(this,8,8);
+ Q3GridLayout *topLayout = new Q3GridLayout(this,8,8);
if (! startDate.isValid()) {
qDebug("KDateNavigator::invalid startdate ");
startDate = QDate::currentDate();
}
mMonthSignalOffset = 0;
mSelectedDates.append(startDate);
m_MthYr = startDate;
m_bShowWeekNums = true;
setFont( KOPrefs::instance()->mDateNavigatorFont );
mNavigatorBar = new NavigatorBar( startDate, this );
topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 );
//mNavigatorBar->resize( 1,1);
connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) );
connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
// get the day of the week on the first day
QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
m_fstDayOfWk = dayone.dayOfWeek();
int i;
// Set up the heading fields.
for( i = 0; i < 7; i++ ) {
headings[i] = new QLabel("",this);
//headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
- headings[i]->setAlignment(AlignCenter);
+ headings[i]->setAlignment(Qt::AlignCenter);
headings[i]->installEventFilter(this);
topLayout->addWidget(headings[i],1,i+1);
}
// Create the weeknumber labels
for( i = 0; i < 6; i++ ) {
weeknos[i] = new QLabel(this);
- weeknos[i]->setAlignment(AlignCenter );
+ weeknos[i]->setAlignment(Qt::AlignCenter );
//weeknos[i]->setFont(QFont("Arial", 10));
if(!m_bShowWeekNums) {
weeknos[i]->hide();
}
weeknos[i]->installEventFilter(this);
topLayout->addWidget(weeknos[i],i+2,0);
}
daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
- daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+ daymatrix->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken);
daymatrix->setLineWidth(1);
connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
SIGNAL( datesSelected( const KCal::DateList & ) ) );
connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
SIGNAL( eventDropped( Event * ) ) );
topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
// read settings from configuration file.
updateConfig();
enableRollover(FollowMonth);
mySizeHint = sizeHintTwoButtons();
myFullSizeHint = sizeHintTwoButtons( 4 );
mFontChanged = false;
//resize ( 3,3 );
}
void KDateNavigator::changeFont ( QFont fo )
{
setFont( fo );
mNavigatorBar->resetFont( fo );
}
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 780ebb8..2cbca76 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -2,64 +2,67 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KDATENAVIGATOR_H
#define KDATENAVIGATOR_H
-#include <qframe.h>
+#include <q3frame.h>
#include <qdatetime.h>
#include <qlabel.h>
+//Added by qt3to4:
+#include <QWheelEvent>
+#include <QEvent>
#include <libkcal/calendar.h>
#include "kodaymatrix.h"
class QPushButton;
class QTimer;
class KCalendarSystem;
class NavigatorBar;
-class KDateNavigator: public QFrame
+class KDateNavigator: public Q3Frame
{
Q_OBJECT
public:
KDateNavigator( QWidget *parent = 0,const char *name = 0 );
~KDateNavigator();
/** The DateNavigator automatically checks for
* the passage of midnight. If rollover type is
* set to None, no signals are emitted and no
* processing is done. With rollover set to
* FollowDay, the day highlighter changes at
* midnight and dayPassed() is emitted.
* With FollowMonth, it has the same effect
* as FollowDay but also adjusts the month that is
* visible and emits monthPassed() when the month changes.
*/
enum RolloverType { None, FollowDay, FollowMonth } ;
void enableRollover( RolloverType );
void setShowWeekNums( bool enabled );
void setCalendar( Calendar * );
void setBaseDate( const QDate & , bool doRepaint = true );
QDate baseDate() const { return m_MthYr;}
@@ -112,50 +115,50 @@ class KDateNavigator: public QFrame
* off at a particular wall-clock time, we need this,
* which calls passedMidnight() at the right moments.
*/
void possiblyPastMidnight();
/** handles updating the view when midnight has come by due to idle time.
*
*/
void passedMidnight();
void slotMonthSelected( int m );
protected:
void updateDates();
void wheelEvent (QWheelEvent *);
bool eventFilter (QObject *,QEvent *);
private:
QSize mySizeHint;
QSize myFullSizeHint;
bool mFontChanged;
int mMonthSignalOffset;
NavigatorBar *mNavigatorBar;
- QFrame *headingSep;
- QFrame *weeknumSep;
+ Q3Frame *headingSep;
+ Q3Frame *weeknumSep;
QLabel *headings[7];
QLabel *weeknos[7];
KODayMatrix *daymatrix;
KCal::DateList mSelectedDates;
QDate m_MthYr;
int m_fstDayOfWk;
bool m_bShowWeekNums;
int dayNum(int row, int col);
int dayToIndex(int dayNum);
Calendar *mCalendar;
KCalendarSystem *mCalendarSystem;
const QString *curHeaders;
/** used to update the day view periodically, in particular every
* midnight to move the "today" rectangle.
*/
QTimer *updateTimer;
QDate lastDayChecked;
RolloverType updateRollover;
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 1d4d6de..fe59787 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -8,83 +8,94 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _WIN32_
#define protected public
#include <qwidget.h>
#undef protected
#endif
-#include <qintdict.h>
+#include <q3intdict.h>
#include <qdatetime.h>
#include <qapplication.h>
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
#include <qcursor.h>
#include <qpainter.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QLabel>
+#include <QPixmap>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <Q3MemArray>
+#include <QEvent>
+#include <Q3Frame>
+#include <Q3PtrList>
#include <kdebug.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kglobal.h>
#include "koagendaitem.h"
#include "koprefs.h"
#include "koglobals.h"
#include "koagenda.h"
#include <libkcal/event.h>
#include <libkcal/todo.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#endif
//extern bool globalFlagBlockPainting;
extern int globalFlagBlockAgenda;
extern int globalFlagBlockAgendaItemPaint;
extern int globalFlagBlockAgendaItemUpdate;
extern int globalFlagBlockStartup;
////////////////////////////////////////////////////////////////////////////
MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name)
- : QFrame(_agenda->viewport(),name), agenda(_agenda)
+ : Q3Frame(_agenda->viewport(),name), agenda(_agenda)
{
setLineWidth(0);
setMargin(0);
setBackgroundColor(Qt::red);
minutes = new QTimer(this);
connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc()));
minutes->start(0, true);
mTimeBox = new QLabel(this);
mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom);
QPalette pal = mTimeBox->palette();
pal.setColor(QColorGroup::Foreground, Qt::red);
mTimeBox->setPalette(pal);
//mTimeBox->setAutoMask(true);
agenda->addChild(mTimeBox);
oldToday = -1;
}
MarcusBains::~MarcusBains()
{
//delete minutes;
}
void MarcusBains::hideMe()
@@ -148,143 +159,143 @@ void MarcusBains::updateLocation(bool recalculate)
mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds));
mTimeBox->adjustSize();
// the -2 below is there because there is a bug in this program
// somewhere, where the last column of this widget is a few pixels
// narrower than the other columns.
int offs = (today==agenda->columns()-1) ? -4 : 0;
agenda->moveChild(mTimeBox,
x+agenda->gridSpacingX()-mTimeBox->width()+offs-1,
y-mTimeBox->height());
mTimeBox->raise();
//mTimeBox->setAutoMask(true);
int secs = QTime::currentTime().second();
minutes->start( (60 - secs +1)*1000 ,true);
}
////////////////////////////////////////////////////////////////////////////
/*
Create an agenda widget with rows rows and columns columns.
*/
KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
- const char *name,WFlags f) :
- QScrollView(parent,name,f)
+ const char *name,Qt::WFlags f) :
+ Q3ScrollView(parent,name,f)
{
mAllAgendaPopup = 0;
mColumns = columns;
mRows = rows;
mGridSpacingY = rowSize;
mAllDayMode = false;
#ifndef DESKTOP_VERSION
//QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
mHolidayMask = 0;
init();
connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) );
}
/*
Create an agenda widget with columns columns and one row. This is used for
all-day events.
*/
-KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) :
- QScrollView(parent,name,f)
+KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,Qt::WFlags f) :
+ Q3ScrollView(parent,name,f)
{
mAllAgendaPopup = 0;
blockResize = false;
mColumns = columns;
mRows = 1;
//qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize);
mGridSpacingY = KOPrefs::instance()->mAllDaySize;
mAllDayMode = true;
#ifndef DESKTOP_VERSION
//QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
mHolidayMask = 0;
init();
}
KOAgenda::~KOAgenda()
{
if(mMarcusBains) delete mMarcusBains;
}
Incidence *KOAgenda::selectedIncidence() const
{
return (mSelectedItem ? mSelectedItem->incidence() : 0);
}
QDate KOAgenda::selectedIncidenceDate() const
{
return (mSelectedItem ? mSelectedItem->itemDate() : QDate());
}
void KOAgenda::init()
{
mPopupTimer = new QTimer(this);
connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
- mNewItemPopup = new QPopupMenu( this );
+ mNewItemPopup = new Q3PopupMenu( this );
connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
QString pathString = "";
if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
if ( QApplication::desktop()->width() < 480 )
pathString += "icons16/";
} else
pathString += "iconsmini/";
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
mNewItemPopup->insertSeparator ( );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"day" ), i18n("Day view"),3 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next week"),4 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"month" ), i18n("This month"),6 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
#ifndef _WIN32_
- int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase
- viewport()->setWFlags ( wflags);
+ Qt::WindowFlags wflags = viewport()-> windowFlags() |Qt::WRepaintNoErase;//WResizeNoErase
+ viewport()->setWindowFlags ( wflags);
#endif
mGridSpacingX = 80;
mResizeBorderWidth = 8;
mScrollBorderWidth = 8;
mScrollDelay = 30;
mScrollOffset = 10;
mPaintPixmap.resize( 20,20);
//enableClipper(true);
// Grab key strokes for keyboard navigation of agenda. Seems to have no
// effect. Has to be fixed.
- setFocusPolicy(WheelFocus);
+ setFocusPolicy(Qt::WheelFocus);
connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp()));
connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown()));
connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize()));
mStartCellX = 0;
mStartCellY = 0;
mCurrentCellX = 0;
mCurrentCellY = 0;
mSelectionCellX = 0;
mSelectionYTop = 0;
mSelectionHeight = 0;
mOldLowerScrollValue = -1;
mOldUpperScrollValue = -1;
mClickedItem = 0;
mActionItem = 0;
mActionType = NOP;
mItemMoved = false;
mSelectedItem = 0;
@@ -374,53 +385,53 @@ void KOAgenda::changeColumns(int columns)
return;
}
clear();
mColumns = columns;
computeSizes();
if(mMarcusBains) mMarcusBains->hideMe();
}
/*
This is the eventFilter function, which gets all events from the KOAgendaItems
contained in the agenda. It has to handle moving and resizing for all items.
*/
bool KOAgenda::eventFilter ( QObject *object, QEvent *event )
{
// kdDebug() << "KOAgenda::eventFilter" << endl;
switch(event->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseButtonDblClick:
case QEvent::MouseButtonRelease:
case QEvent::MouseMove:
return eventFilter_mouse(object, static_cast<QMouseEvent *>(event));
case (QEvent::Leave):
if (!mActionItem)
- setCursor(arrowCursor);
+ setCursor(Qt::arrowCursor);
return true;
default:
- return QScrollView::eventFilter(object,event);
+ return Q3ScrollView::eventFilter(object,event);
}
}
void KOAgenda::popupMenu()
{
mPopupTimer->stop();
if ( mPopupKind == 1 || mPopupKind == 3 ) {
if (mActionItem ) {
endItemAction();
}
mLeftMouseDown = false; // no more leftMouse computation
if (mPopupItem) {
//mClickedItem = mPopupItem;
selectItem(mPopupItem);
if ( mAllAgendaPopup && KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 1 )
mAllAgendaPopup->installEventFilter( this );
emit showIncidencePopupSignal(mPopupItem->incidence());
}
} else if ( mPopupKind == 2 || mPopupKind == 4 ) {
if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action
endSelectAction( false ); // do not emit new event signal
mLeftMouseDown = false; // no more leftMouse computation
}
if ( KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 2 )
@@ -484,53 +495,53 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
if ( me->type() == QEvent::MouseButtonRelease ) {
mAllAgendaPopup->removeEventFilter( this );
int dX = me->globalPos().x() - mPopupPos.x();;
if ( dX < 0 )
dX = -dX;
int dY = me->globalPos().y() - mPopupPos.y();
if ( dY < 0 )
dY = -dY;
if ( dX > blockmoveDist || dY > blockmoveDist ) {
mAllAgendaPopup->hide();
}
}
return true;
}
QPoint viewportPos;
if (object != viewport()) {
blockmoveDist = blockmoveDist*2;
viewportPos = ((QWidget *)object)->mapToParent(me->pos());
} else {
viewportPos = me->pos();
}
bool objIsNotViewport = (object != viewport());
bool leftButt = false;
#ifdef DESKTOP_VERSION
- leftButt = (me->button() == LeftButton);
+ leftButt = (me->button() == Qt::LeftButton);
#endif
switch (me->type()) {
case QEvent::MouseButtonPress:
- if (me->button() == LeftButton) {
+ if (me->button() == Qt::LeftButton) {
mPopupTimer->start( 600 );
mLeftMouseDown = true;
}
blockMoving = true;
startX = viewportPos.x();
startY = viewportPos.y();
mPopupPos = me->globalPos();
if ( objIsNotViewport && !leftButt ) {
KOAgendaItem * tempItem = (KOAgendaItem *)object;
if (mAllDayMode) {
if ( tempItem->height() > 10 ) {
int minV = tempItem->height()/4;
if ( minV > (blockmoveDist/2)-2 ) {
if ( minV > blockmoveDist )
minV = blockmoveDist;
else
minV = (blockmoveDist/2);
}
bool border = false;
int diff = tempItem->y() - viewportPos.y();
if ( diff < 0 )
diff *= -1;
if ( diff < minV ) {
border = true;
@@ -557,120 +568,120 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
}
bool border = false;
int diff = tempItem->x() - viewportPos.x();
if ( diff < 0 )
diff *= -1;
if ( diff < minH ) {
border = true;
objIsNotViewport = false;
}
if ( ! border ) {
diff = tempItem->x() + tempItem->width() - viewportPos.x();
if ( diff < 0 )
diff *= -1;
if ( diff < minH ) {
border = true;
objIsNotViewport = false;
}
}
}
}
}
if ( objIsNotViewport ) {
mPopupItem = (KOAgendaItem *)object;
mPopupKind = 1;
- if (me->button() == RightButton) {
+ if (me->button() == Qt::RightButton) {
mPopupKind = 3;
popupMenu();
- } else if (me->button() == LeftButton) {
+ } else if (me->button() == Qt::LeftButton) {
mActionItem = (KOAgendaItem *)object;
if (mActionItem) {
emit signalClearSelection();
slotClearSelection();
selectItem(mActionItem);
Incidence *incidence = mActionItem->incidence();
if ( incidence->isReadOnly() /*|| incidence->doesRecur() */) {
mActionItem = 0;
} else {
startItemAction(viewportPos);
}
}
}
} else { // ---------- viewport()
mPopupItem = 0;
mPopupKind = 2;
selectItem(0);
mActionItem = 0;
- if (me->button() == RightButton) {
+ if (me->button() == Qt::RightButton) {
int x,y;
viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
int gx,gy;
contentsToGrid(x,y,gx,gy);
mCurrentCellX = gx;
mCurrentCellY = gy;
mStartCellX = gx;
mStartCellY = gy;
mPopupKind = 4;
popupMenu();
- } else if (me->button() == LeftButton) {
- setCursor(arrowCursor);
+ } else if (me->button() == Qt::LeftButton) {
+ setCursor(Qt::arrowCursor);
startSelectAction(viewportPos);
}
}
break;
case QEvent::MouseButtonRelease:
- if (me->button() == LeftButton ) {
+ if (me->button() == Qt::LeftButton ) {
mPopupTimer->stop();
}
if (object != viewport()) {
- if (me->button() == LeftButton && mLeftMouseDown) {
+ if (me->button() == Qt::LeftButton && mLeftMouseDown) {
if (mActionItem) {
QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos));
//qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 );
if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) {
mScrollUpTimer.stop();
mScrollDownTimer.stop();
mActionItem->resetMove();
placeSubCells( mActionItem );
// emit startDragSignal( mActionItem->incidence() );
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
mActionItem = 0;
mActionType = NOP;
mItemMoved = 0;
mLeftMouseDown = false;
return true;
}
endItemAction();
}
}
} else { // ---------- viewport()
- if (me->button() == LeftButton && mLeftMouseDown ) { //left click
+ if (me->button() == Qt::LeftButton && mLeftMouseDown ) { //left click
endSelectAction( true ); // emit new event signal
}
}
- if (me->button() == LeftButton)
+ if (me->button() == Qt::LeftButton)
mLeftMouseDown = false;
break;
case QEvent::MouseMove:
//qDebug("mm ");
if ( !mLeftMouseDown )
return false;
if ( blockMoving ) {
int dX, dY;
dX = startX - viewportPos.x();
if ( dX < 0 )
dX = -dX;
dY = viewportPos.y() - startY;
if ( dY < 0 )
dY = -dY;
//qDebug("%d %d %d ", dX, dY , blockmoveDist );
if ( dX > blockmoveDist || dY > blockmoveDist ) {
blockMoving = false;
}
}
if ( ! blockMoving )
mPopupTimer->stop();
if (object != viewport()) {
@@ -829,218 +840,218 @@ void KOAgenda::endSelectAction( bool emitNewEvent )
emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY);
if ( emitNewEvent && mStartCellY < mCurrentCellY ) {
emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY);
}
}
void KOAgenda::startItemAction(QPoint viewportPos)
{
int x,y;
viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
int gx,gy;
contentsToGrid(x,y,gx,gy);
mStartCellX = gx;
mStartCellY = gy;
mCurrentCellX = gx;
mCurrentCellY = gy;
bool allowResize = ( mActionItem->incidence()->typeID() != todoID );
if (mAllDayMode) {
int gridDistanceX = (x - gx * mGridSpacingX);
if ( allowResize && gridDistanceX < mResizeBorderWidth &&
mActionItem->cellX() == mCurrentCellX) {
mActionType = RESIZELEFT;
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth &&
mActionItem->cellXWidth() == mCurrentCellX) {
mActionType = RESIZERIGHT;
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else {
mActionType = MOVE;
mActionItem->startMove();
- setCursor(sizeAllCursor);
+ setCursor(Qt::sizeAllCursor);
}
} else {
int gridDistanceY = (y - gy * mGridSpacingY);
if (allowResize && gridDistanceY < mResizeBorderWidth &&
mActionItem->cellYTop() == mCurrentCellY &&
!mActionItem->firstMultiItem()) {
mActionType = RESIZETOP;
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth &&
mActionItem->cellYBottom() == mCurrentCellY &&
!mActionItem->lastMultiItem()) {
mActionType = RESIZEBOTTOM;
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else {
mActionType = MOVE;
mActionItem->startMove();
- setCursor(sizeAllCursor);
+ setCursor(Qt::sizeAllCursor);
}
}
}
void KOAgenda::performItemAction(QPoint viewportPos)
{
// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl;
// QPoint point = viewport()->mapToGlobal(viewportPos);
// kdDebug() << "Global: " << point.x() << "," << point.y() << endl;
// point = clipper()->mapFromGlobal(point);
// kdDebug() << "clipper: " << point.x() << "," << point.y() << endl;
// kdDebug() << "visible height: " << visibleHeight() << endl;
int x,y;
viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
// kdDebug() << "contents: " << x << "," << y << "\n" << endl;
int gx,gy;
contentsToGrid(x,y,gx,gy);
QPoint clipperPos = clipper()->
mapFromGlobal(viewport()->mapToGlobal(viewportPos));
// Cursor left active agenda area.
// This starts a drag.
if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/
clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) {
if ( mActionType == MOVE ) {
mScrollUpTimer.stop();
mScrollDownTimer.stop();
mActionItem->resetMove();
placeSubCells( mActionItem );
// emit startDragSignal( mActionItem->incidence() );
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
mActionItem = 0;
mActionType = NOP;
mItemMoved = 0;
return;
}
} else {
switch ( mActionType ) {
case MOVE:
- setCursor( sizeAllCursor );
+ setCursor( Qt::sizeAllCursor );
break;
case RESIZETOP:
case RESIZEBOTTOM:
- setCursor( sizeVerCursor );
+ setCursor( Qt::sizeVerCursor );
break;
case RESIZELEFT:
case RESIZERIGHT:
- setCursor( sizeHorCursor );
+ setCursor( Qt::sizeHorCursor );
break;
default:
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
}
}
// Scroll if item was moved to upper or lower end of agenda.
if (clipperPos.y() < mScrollBorderWidth) {
mScrollUpTimer.start(mScrollDelay);
} else if (visibleHeight() - clipperPos.y() <
mScrollBorderWidth) {
mScrollDownTimer.start(mScrollDelay);
} else {
mScrollUpTimer.stop();
mScrollDownTimer.stop();
}
// Move or resize item if necessary
if (mCurrentCellX != gx || mCurrentCellY != gy) {
mItemMoved = true;
mActionItem->raise();
if (mActionType == MOVE) {
// Move all items belonging to a multi item
KOAgendaItem *moveItem = mActionItem->firstMultiItem();
bool isMultiItem = (moveItem || mActionItem->lastMultiItem());
if (!moveItem) moveItem = mActionItem;
while (moveItem) {
int dy;
if (isMultiItem) dy = 0;
else dy = gy - mCurrentCellY;
moveItem->moveRelative(gx - mCurrentCellX,dy);
int x,y;
gridToContents(moveItem->cellX(),moveItem->cellYTop(),x,y);
int diff = moveItem->resizeMe(mGridSpacingX, mGridSpacingX* moveItem->cellWidth(),
mGridSpacingY * moveItem->cellHeight());
moveItem->raise();
moveChild(moveItem,x+diff,y);
moveItem = moveItem->nextMultiItem();
}
} else if (mActionType == RESIZETOP) {
if (mCurrentCellY <= mActionItem->cellYBottom()) {
mActionItem->expandTop(gy - mCurrentCellY);
mActionItem->resize(mActionItem->width(),
mGridSpacingY * mActionItem->cellHeight());
int x,y;
gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y);
//moveChild(mActionItem,childX(mActionItem),y);
- QScrollView::moveChild( mActionItem,childX(mActionItem),y );
+ Q3ScrollView::moveChild( mActionItem,childX(mActionItem),y );
}
} else if (mActionType == RESIZEBOTTOM) {
if (mCurrentCellY >= mActionItem->cellYTop()) {
mActionItem->expandBottom(gy - mCurrentCellY);
mActionItem->resize(mActionItem->width(),
mGridSpacingY * mActionItem->cellHeight());
}
} else if (mActionType == RESIZELEFT) {
if (mCurrentCellX <= mActionItem->cellXWidth()) {
mActionItem->expandLeft(gx - mCurrentCellX);
int diff = mActionItem->resizeMe(mGridSpacingX ,
mGridSpacingX * mActionItem->cellWidth(),
mActionItem->height());
int x,y;
gridToContents(mActionItem->cellX(),mActionItem->cellYTop(),x,y);
moveChild(mActionItem,x+diff,childY(mActionItem));
}
} else if (mActionType == RESIZERIGHT) {
if (mCurrentCellX >= mActionItem->cellX()) {
mActionItem->expandRight(gx - mCurrentCellX);
mActionItem->resizeMe(mGridSpacingX, mGridSpacingX * mActionItem->cellWidth(),
mActionItem->height());
}
}
mCurrentCellX = gx;
mCurrentCellY = gy;
}
}
void KOAgenda::endItemAction()
{
if ( mItemMoved ) {
KOAgendaItem *placeItem = mActionItem->firstMultiItem();
if ( !placeItem ) {
placeItem = mActionItem;
}
if ( placeItem->incidence()->doesRecur() ) {
Incidence* oldInc = placeItem->incidence();
placeItem->recreateIncidence();
emit addToCalSignal(placeItem->incidence(), oldInc );
}
int type = mActionType;
if ( mAllDayMode )
type = -1;
KOAgendaItem *modifiedItem = placeItem;
//emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */);
- QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems();
+ Q3PtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems();
KOAgendaItem *item;
if ( placeItem->incidence()->typeID() == todoID ) {
mSelectedItem = 0;
//qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth());
modifiedItem->mLastMoveXPos = mCurrentCellX;
emit itemModified( modifiedItem, mActionType );
}
else {
globalFlagBlockAgendaItemPaint = 1;
for ( item=oldconflictItems.first(); item != 0;
item=oldconflictItems.next() ) {
placeSubCells(item);
}
while ( placeItem ) {
//qDebug("placeItem %s ", placeItem->incidence()->summary().latin1());
oldconflictItems = placeItem->conflictItems();
for ( item=oldconflictItems.first(); item != 0;
item=oldconflictItems.next() ) {
placeSubCells(item);
}
placeSubCells( placeItem );
@@ -1089,114 +1100,114 @@ void KOAgenda::endItemAction()
item->repaint(false);
}
placeItem = placeItem->nextMultiItem();
}
/*
oldconflictItems = modifiedItem->conflictItems();
for ( item=oldconflictItems.first(); item != 0;
item=oldconflictItems.next() ) {
globalFlagBlockAgendaItemUpdate = 0;
item->paintMe(false);
globalFlagBlockAgendaItemUpdate = 1;
item->repaint(false);
}
*/
}
}
if ( mActionItem )
emit incidenceSelected( mActionItem->incidence() );
mScrollUpTimer.stop();
mScrollDownTimer.stop();
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
mActionItem = 0;
mActionType = NOP;
mItemMoved = 0;
}
void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos)
{
// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl;
// QPoint point = viewport()->mapToGlobal(viewportPos);
// kdDebug() << "Global: " << point.x() << "," << point.y() << endl;
// point = clipper()->mapFromGlobal(point);
// kdDebug() << "clipper: " << point.x() << "," << point.y() << endl;
int x,y;
viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
// kdDebug() << "contents: " << x << "," << y << "\n" << endl;
int gx,gy;
contentsToGrid(x,y,gx,gy);
// Change cursor to resize cursor if appropriate
if (mAllDayMode) {
int gridDistanceX = (x - gx * mGridSpacingX);
if (gridDistanceX < mResizeBorderWidth &&
moveItem->cellX() == gx) {
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth &&
moveItem->cellXWidth() == gx) {
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else {
- setCursor(arrowCursor);
+ setCursor(Qt::arrowCursor);
}
} else {
int gridDistanceY = (y - gy * mGridSpacingY);
if (gridDistanceY < mResizeBorderWidth &&
moveItem->cellYTop() == gy &&
!moveItem->firstMultiItem()) {
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth &&
moveItem->cellYBottom() == gy &&
!moveItem->lastMultiItem()) {
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else {
- setCursor(arrowCursor);
+ setCursor(Qt::arrowCursor);
}
}
}
/*
Place item in cell and take care that multiple items using the same cell do
not overlap. This method is not yet optimal. It doesn´t use the maximum space
it can get in all cases.
At the moment the method has a bug: When an item is placed only the sub cell
widths of the items are changed, which are within the Y region the item to
place spans. When the sub cell width change of one of this items affects a
cell, where other items are, which do not overlap in Y with the item to place,
the display gets corrupted, although the corruption looks quite nice.
*/
void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
{
- QPtrList<KOAgendaItem> conflictItems;
+ Q3PtrList<KOAgendaItem> conflictItems;
int maxSubCells = 0;
- QIntDict<KOAgendaItem> subCellDict(7);
+ Q3IntDict<KOAgendaItem> subCellDict(7);
KOAgendaItem *item;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if (item != placeItem) {
if (placeItem->cellX() <= item->cellXWidth() &&
placeItem->cellXWidth() >= item->cellX()) {
if ((placeItem->cellYTop() <= item->cellYBottom()) &&
(placeItem->cellYBottom() >= item->cellYTop())) {
conflictItems.append(item);
if (item->subCells() > maxSubCells)
maxSubCells = item->subCells();
subCellDict.insert(item->subCell(),item);
}
}
}
}
if (conflictItems.count() > 0) {
// Look for unused sub cell and insert item
int i;
for(i=0;i<maxSubCells;++i) {
if (!subCellDict.find(i)) {
placeItem->setSubCell(i);
break;
@@ -1219,49 +1230,49 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
item=conflictItems.next() ) {
item->setSubCells(maxSubCells);
int diff = 0;
if (mAllDayMode) {
diff = item->resizeMe( mGridSpacingX, item->cellWidth() * mGridSpacingX, newSubCellWidth);
} else {
item->resize(newSubCellWidth, item->cellHeight() * mGridSpacingY);
}
int x,y;
gridToContents(item->cellX(),item->cellYTop(),x,y);
if (mAllDayMode) {
y += item->subCell() * newSubCellWidth;
} else {
x += item->subCell() * newSubCellWidth;
}
moveChild(item,x+diff,y);
// qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y);
//item->updateItem();
}
// Adjust sub cell geometry of all conflict items of all conflict items
for ( item=conflictItems.first(); item != 0;
item=conflictItems.next() ) {
if ( placeItem != item ) {
KOAgendaItem *item2;
- QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems();
+ Q3PtrList<KOAgendaItem> conflictItems2 = item->conflictItems();
for ( item2=conflictItems2.first(); item2 != 0;
item2=conflictItems2.next() ) {
if ( item2->subCells() != maxSubCells) {
item2->setSubCells(maxSubCells);
int diff = 0;
if (mAllDayMode) {
diff = item2->resizeMe(mGridSpacingX, item2->cellWidth() * mGridSpacingX, newSubCellWidth);
} else {
item2->resize(newSubCellWidth, item2->cellHeight() * mGridSpacingY);
}
int x,y;
gridToContents(item2->cellX(),item2->cellYTop(),x,y);
if (mAllDayMode) {
y += item2->subCell() * newSubCellWidth;
} else {
x += item2->subCell() * newSubCellWidth;
}
moveChild(item2,x+diff,y);
//qDebug("setttttt %d %s",maxSubCells, item2->text().latin1() );
}
}
}
}
} else {
@@ -1304,103 +1315,103 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) {
qDebug("WAU ");
drawContentsToPainter();
}
#endif
QPaintDevice* pd = p->device();
p->end();
int vx, vy;
int selectionX = KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - mSelectionCellX) * mGridSpacingX :
mSelectionCellX * mGridSpacingX;
contentsToViewport ( cx, cy, vx,vy);
//qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ;
if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) {
if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) {
int vxSel, vySel;
contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel);
int off = mSelectionHeight;
if ( vySel < 0 )
off += vySel;
//qDebug("OFF %d %d %d", off,vySel, vy );
- bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP);
+ bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,QPainter::CompositionMode_Source);
} else {
- bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
+ bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source);
}
}
if ( mSelectionHeight > 0 ) {
//qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
// bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
int hei = mSelectionHeight;
int offset = 0;
while ( hei > 0 ) {
int p_hei = 5;
if ( hei < 5 ) p_hei = hei;
hei -= 5;
- bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
+ bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source);
offset += 5;
}
}
}
p->begin( pd );
} else {
#if 0
qDebug("mCurPixWid %d %d ",mCurPixWid, contentsWidth() );
if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) {
qDebug("WAUWAU ");
drawContentsToPainter();
}
#endif
QPaintDevice* pd = p->device();
p->end();
int vx, vy;
int selectionX = KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - mSelectionCellX) * mGridSpacingX :
mSelectionCellX * mGridSpacingX;
contentsToViewport ( cx, cy, vx,vy);
// qDebug(" %d %d %d %d ", cx, cy, cw,ch) ;
if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
- bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
+ bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source);
if ( mSelectionHeight > 0 ) {
//qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
//bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
int hei = mSelectionHeight;
int offset = 0;
while ( hei > 0 ) {
int p_hei = 5;
if ( hei < 5 ) p_hei = hei;
hei -= 5;
- bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
+ bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source);
offset += 5;
}
}
}
p->begin( pd );
}
}
void KOAgenda::finishUpdate()
{
KOAgendaItem *item;
globalFlagBlockAgendaItemPaint = 1;
// Adjust sub cell geometry of all conflict items of all conflict items of all conflict items ... of the conflict item with the max number of conflictitems
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if ( !item->checkLayout() ) {
//qDebug(" conflictitem found ");
int newSubCellWidth;
int diff = 0;
if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells();
else newSubCellWidth = mGridSpacingX / item->subCells();
if (mAllDayMode) {
@@ -1555,56 +1566,56 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
(mColumns - 1 - mSelectionCellX) * mGridSpacingX :
mSelectionCellX * mGridSpacingX;
// Draw selection
if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
// TODO: paint only part within cx,cy,cw,ch
p->fillRect( selectionX, mSelectionYTop, mGridSpacingX,
mSelectionHeight, KOPrefs::instance()->mHighlightColor );
}
*/
// Draw vertical lines of grid
int x = ((int)(cx/mGridSpacingX))*mGridSpacingX;
if ( mGridSpacingX > 0 ) {
while (x < cx + cw) {
p->drawLine(x,cy,x,cy+ch);
x+=mGridSpacingX;
}
}
// Draw horizontal lines of grid
int y = ((int)(cy/lGridSpacingY))*lGridSpacingY;
if ( lGridSpacingY > 0 ) {
while (y < cy + ch) {
- p->setPen( SolidLine );
+ p->setPen( Qt::SolidLine );
p->drawLine(cx,y,cx+cw,y);
y+=lGridSpacingY;
- p->setPen( DotLine );
+ p->setPen( Qt::DotLine );
p->drawLine(cx,y,cx+cw,y);
y+=lGridSpacingY;
}
- p->setPen( SolidLine );
+ p->setPen( Qt::SolidLine );
}
mPixPainter.end() ;
}
/*
Convert srcollview contents coordinates to agenda grid coordinates.
*/
void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy)
{
gx = KOGlobals::self()->reverseLayout() ? mColumns - 1 - x/mGridSpacingX :
x/mGridSpacingX;
gy = y/mGridSpacingY;
}
/*
Convert agenda grid coordinates to scrollview contents coordinates.
*/
void KOAgenda::gridToContents (int gx, int gy, int& x, int& y)
{
x = KOGlobals::self()->reverseLayout() ? (mColumns - 1 - gx)*mGridSpacingX:
gx*mGridSpacingX;
y = gy*mGridSpacingY;
}
@@ -1696,111 +1707,111 @@ KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo )
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if ( item->incidence() == todo ) {
mItems.remove();
return item;
}
}
return 0;
}
void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
{
// ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
KOAgendaItem *item;
item = getItemForTodo ( todo );
//qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove);
if ( item ) {
blockSignals( true );
//qDebug("item found ");
item->hide();
item->setCellX(-2, -1 );
item->select(false);
mUnusedItems.append( item );
mItems.remove( item );
- QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
+ Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
KOAgendaItem *itemit;
//globalFlagBlockAgendaItemPaint = 1;
for ( itemit=oldconflictItems.first(); itemit != 0;
itemit=oldconflictItems.next() ) {
if ( itemit != item )
placeSubCells(itemit);
}
qApp->processEvents();
//globalFlagBlockAgendaItemPaint = 0;
for ( itemit=oldconflictItems.first(); itemit != 0;
itemit=oldconflictItems.next() ) {
globalFlagBlockAgendaItemUpdate = 0;
if ( itemit != item )
itemit->repaintMe();
globalFlagBlockAgendaItemUpdate = 1;
//qDebug("sigleshot ");
QTimer::singleShot( 0, itemit, SLOT ( repaintItem() ));
//itemit->repaint( false ); repaintItem()
}
blockSignals( false );
}
if ( remove ) {
//qDebug("remove****************************************** ");
return;
}
if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda )
return;
//qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
QDate currentDate = QDate::currentDate();
- bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda );
+ bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda );
QDateTime dt;
if ( todo->hasCompletedDate() )
dt = todo->completed();
else
dt = todo->dtDue();
if ( overdue ) {
days += todo->dtDue().date().daysTo( currentDate );
}
else
currentDate = dt.date();
if (( todo->doesFloat() || overdue) && !todo->hasCompletedDate() ) {
if ( ! mAllDayMode ) return;
// aldayagenda
globalFlagBlockAgendaItemPaint = 1;
item = insertAllDayItem(todo, currentDate,days, days);
item->show();
}
else {
if ( mAllDayMode ) return;
// mAgenda
globalFlagBlockAgendaItemPaint = 1;
int endY = timeToY(dt.time()) - 1;
int hi = 12/KOPrefs::instance()->mHourSize;
int startY = endY - 1-hi;
item = insertItem(todo,currentDate,days,startY,endY);
item->show();
}
qApp->processEvents();
globalFlagBlockAgendaItemPaint = 0;
- QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
+ Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
KOAgendaItem *itemit;
for ( itemit=oldconflictItems.first(); itemit != 0;
itemit=oldconflictItems.next() ) {
globalFlagBlockAgendaItemUpdate = 0;
itemit->repaintMe();
globalFlagBlockAgendaItemUpdate = 1;
itemit->repaint();
}
globalFlagBlockAgendaItemUpdate = 0;
item->repaintMe();
globalFlagBlockAgendaItemUpdate = 1;
item->repaint();
}
/*
Insert KOAgendaItem into agenda.
*/
KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom)
{
if (mAllDayMode) {
qDebug("KOAgenda: calling insertItem in all-day mode is illegal. ");
return 0;
}
KOAgendaItem *agendaItem = getNewItem(event,qd,viewport());
@@ -1846,49 +1857,49 @@ KOAgendaItem *KOAgenda::insertAllDayItem (Incidence *event,QDate qd,int XBegin,i
//addChild(agendaItem,XBegin*mGridSpacingX,0);
mItems.append(agendaItem);
placeSubCells(agendaItem);
//agendaItem->show();
return agendaItem;
}
void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
int YTop,int YBottom)
{
if (mAllDayMode) {
;
return;
}
int cellX,cellYTop,cellYBottom;
QString newtext;
int width = XEnd - XBegin + 1;
int count = 0;
KOAgendaItem *current = 0;
- QPtrList<KOAgendaItem> multiItems;
+ Q3PtrList<KOAgendaItem> multiItems;
for (cellX = XBegin;cellX <= XEnd;++cellX) {
if (cellX == XBegin) cellYTop = YTop;
else cellYTop = 0;
if (cellX == XEnd) cellYBottom = YBottom;
else cellYBottom = rows() - 1;
newtext = QString("(%1/%2): ").arg(++count).arg(width);
newtext.append(event->summary());
current = insertItem(event,qd,cellX,cellYTop,cellYBottom);
current->setText(newtext);
multiItems.append(current);
}
KOAgendaItem *next = 0;
KOAgendaItem *last = multiItems.last();
KOAgendaItem *first = multiItems.first();
KOAgendaItem *setFirst,*setLast;
current = first;
while (current) {
next = multiItems.next();
if (current == first) setFirst = 0;
else setFirst = first;
if (current == last) setLast = 0;
else setLast = last;
@@ -1906,49 +1917,49 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
// Preferred one.
// But it doesn´t hurt, so it stays.
// if (mAllDayMode) {
// return QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
// } else {
// return QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
// }
//}
void KOAgenda::finishResize ( )
{
//qDebug("finishResize+++++++++++++++++++++++++++++++ ( ) ");
if ( globalFlagBlockAgenda == 0 ) {
finishUpdate();
//qDebug("finishUpdate() called ");
}
}
/*
Overridden from QScrollView to provide proper resizing of KOAgendaItems.
*/
void KOAgenda::resizeEvent ( QResizeEvent *ev )
{
mSelectionHeight = 0;
mResizeTimer.start( 150 , true );
computeSizes();
- QScrollView::resizeEvent( ev );
+ Q3ScrollView::resizeEvent( ev );
return;
}
void KOAgenda::computeSizes()
{
if ( globalFlagBlockStartup )
return;
int frameOffset = frameWidth() * 2 +1;
if (mAllDayMode) {
mGridSpacingX = (width()-frameOffset) / mColumns;
mGridSpacingY = height() - 2 * frameWidth() - 1;
resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY + 1);
// mGridSpacingY = height();
// resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
KOAgendaItem *item;
int subCellWidth;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
subCellWidth = mGridSpacingY / item->subCells();
int diff = 0;
diff = item->resizeMe(mGridSpacingX ,mGridSpacingX * item->cellWidth(),subCellWidth);
moveChild(item,(KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - item->cellX()) * mGridSpacingX :
item->cellX() * mGridSpacingX) + diff,
@@ -1995,49 +2006,49 @@ void KOAgenda::computeSizes()
checkScrollBoundaries();
drawContentsToPainter();
viewport()->repaint(false);
}
void KOAgenda::scrollUp()
{
scrollBy(0,-mScrollOffset);
}
void KOAgenda::scrollDown()
{
scrollBy(0,mScrollOffset);
}
void KOAgenda::popupAlarm()
{
if (!mClickedItem) {
qDebug("KOAgenda::popupAlarm() called without having a clicked item ");
return;
}
// TODO: deal correctly with multiple alarms
Alarm* alarm;
- QPtrList<Alarm> list(mClickedItem->incidence()->alarms());
+ Q3PtrList<Alarm> list(mClickedItem->incidence()->alarms());
for(alarm=list.first();alarm;alarm=list.next()) {
alarm->toggleAlarm();
}
emit itemModified( mClickedItem , KOGlobals::EVENTEDITED );
mClickedItem->paintMe( true );
mClickedItem->repaint( false );
}
/*
Calculates the minimum width
*/
int KOAgenda::minimumWidth() const
{
// TODO:: develop a way to dynamically determine the minimum width
int min = 100;
return min;
}
void KOAgenda::updateConfig()
{
if ( viewport()->backgroundColor() != KOPrefs::instance()->mAgendaBgColor)
viewport()->setBackgroundColor(KOPrefs::instance()->mAgendaBgColor);
if ( mAllDayMode ) {
@@ -2086,173 +2097,173 @@ void KOAgenda::checkScrollBoundaries(int v)
void KOAgenda::deselectItem()
{
if (mSelectedItem.isNull()) return;
mSelectedItem->select(false);
mSelectedItem = 0;
}
void KOAgenda::selectItem(KOAgendaItem *item)
{
if ((KOAgendaItem *)mSelectedItem == item) return;
deselectItem();
if (item == 0) {
emit incidenceSelected( 0 );
return;
}
mSelectedItem = item;
mSelectedItem->select();
emit incidenceSelected( mSelectedItem->incidence() );
}
// This function seems never be called.
void KOAgenda::keyPressEvent( QKeyEvent *kev )
{
switch(kev->key()) {
- case Key_PageDown:
+ case Qt::Key_PageDown:
verticalScrollBar()->addPage();
break;
- case Key_PageUp:
+ case Qt::Key_PageUp:
verticalScrollBar()->subtractPage();
break;
- case Key_Down:
+ case Qt::Key_Down:
verticalScrollBar()->addLine();
break;
- case Key_Up:
+ case Qt::Key_Up:
verticalScrollBar()->subtractLine();
break;
default:
;
}
}
void KOAgenda::calculateWorkingHours()
{
// mWorkingHoursEnable = KOPrefs::instance()->mEnableWorkingHours;
mWorkingHoursEnable = !mAllDayMode;
mWorkingHoursYTop = mGridSpacingY *
KOPrefs::instance()->mWorkingHoursStart * 4;
mWorkingHoursYBottom = mGridSpacingY *
KOPrefs::instance()->mWorkingHoursEnd * 4 - 1;
}
DateList KOAgenda::dateList() const
{
return mSelectedDates;
}
void KOAgenda::setDateList(const DateList &selectedDates)
{
mSelectedDates = selectedDates;
}
-void KOAgenda::setHolidayMask(QMemArray<bool> *mask)
+void KOAgenda::setHolidayMask(Q3MemArray<bool> *mask)
{
mHolidayMask = mask;
/*
kdDebug() << "HolidayMask: ";
for(uint i=0;i<mask->count();++i) {
kdDebug() << (mask->at(i) ? "*" : "o");
}
kdDebug() << endl;
*/
}
void KOAgenda::contentsMousePressEvent ( QMouseEvent *event )
{
- QScrollView::contentsMousePressEvent(event);
+ Q3ScrollView::contentsMousePressEvent(event);
}
void KOAgenda::storePosition()
{
//mContentPosition
int max = mGridSpacingY*4*24;
if ( contentsY() < 5 && max > viewport()->height()*3/2 )
mContentPosition = 0;
else if ( contentsY() + viewport()->height() > max - 5 && max > viewport()->height()*3/2)
mContentPosition = -1.0;
else
mContentPosition = ((float) max)/ ((float)(contentsY()+ ( viewport()->height()/2)));
//qDebug("mContentPosition %f %d %d %d",mContentPosition , max, contentsY() ,viewport()->height());
}
void KOAgenda::restorePosition()
{
int posY;
int max = mGridSpacingY*4*24;
if ( mContentPosition < 0 )
posY = max-viewport()->height();
else
if ( mContentPosition == 0 )
posY = 0;
else
posY = (int) ((max/mContentPosition)-(viewport()->height()/2));
setContentsPos (0, posY );
//qDebug("posY %d hei %d", posY, max);
}
void KOAgenda::moveChild( QWidget *w, int x , int y )
{
++x;
- QScrollView::moveChild( w, x , y );
+ Q3ScrollView::moveChild( w, x , y );
}
#include <qmessagebox.h>
#ifdef DESKTOP_VERSION
#include <qprinter.h>
#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <q3paintdevicemetrics.h>
#endif
void KOAgenda::printSelection()
{
#ifdef DESKTOP_VERSION
if ( mStartCellY == mCurrentCellY ) {
QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
i18n("Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. "),
i18n("OK"), 0, 0,
0, 1 );
return;
}
float dx, dy;
int x,y,w,h;
x= 0;
w= contentsWidth()+2;
// h= contentsHeight();
y = mGridSpacingY*mStartCellY;
h = mGridSpacingY*(mCurrentCellY+1)-y+2;
//return;
QPrinter* printer = new QPrinter();
if ( !printer->setup()) {
delete printer;
return;
}
QPainter p( printer );
- QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer );
+ Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( printer );
QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() );
//date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true );
int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height();
// p.drawText( 0, 0, date );
int offset = m.width()/8;
// compute the scale
dx = ((float) m.width()-offset) / (float)w;
dy = (float)(m.height() - ( 2 * hei )-offset ) / (float)h;
float scale;
// scale to fit the width or height of the paper
if ( dx < dy )
scale = dx;
else
scale = dy;
// set the scale
p.drawText( (int) (offset* scale), (int) (offset* scale*3/4), date );
uint selDay;
float widOffset = ((float) m.width()-offset) / ((float)(mSelectedDates.count()));
float startX = 1;
for ( selDay = 0; selDay < mSelectedDates.count(); ++selDay)
{
QString text = KGlobal::locale()->formatDate( mSelectedDates[selDay],true );
p.setClipRect((int) (offset* scale+startX) , 0, (int) (widOffset-4), (int) (offset* scale+(2*hei* scale)) );
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 380ce62..0708341 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -2,143 +2,152 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOAGENDA_H
#define KOAGENDA_H
-#include <qscrollview.h>
+#include <q3scrollview.h>
#include <qtimer.h>
-#include <qmemarray.h>
+#include <q3memarray.h>
#include <qpainter.h>
#include <qpixmap.h>
-#include <qguardedptr.h>
+#include <qpointer.h>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <Q3Frame>
+#include <QLabel>
+#include <QMouseEvent>
+#include <Q3PtrList>
+#include <Q3PopupMenu>
+#include <QKeyEvent>
+#include <QEvent>
#include "koagendaitem.h"
#include "koeventview.h"
-class QPopupMenu;
+class Q3PopupMenu;
class QTime;
class KConfig;
-class QFrame;
+class Q3Frame;
class KOAgenda;
class KCal::Event;
class KCal::Todo;
using namespace KCal;
-class MarcusBains : public QFrame {
+class MarcusBains : public Q3Frame {
Q_OBJECT
public:
MarcusBains(KOAgenda *agenda=0,const char *name=0);
virtual ~MarcusBains();
void hideMe();
public slots:
void updateLocation(bool recalculate=false);
void updateLoc();
private:
int todayColumn();
QTimer *minutes;
QLabel *mTimeBox;
KOAgenda *agenda;
QTime oldTime;
int oldToday;
};
-class KOAgenda : public QScrollView
+class KOAgenda : public Q3ScrollView
{
Q_OBJECT
public:
enum MouseActionType { NOP, MOVE, SELECT,
RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT };
KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0,
- const char * name=0, WFlags f=0 );
+ const char * name=0, Qt::WFlags f=0 );
KOAgenda ( int columns, QWidget * parent=0,
- const char * name=0, WFlags f=0 );
+ const char * name=0, Qt::WFlags f=0 );
virtual ~KOAgenda();
bool mInvalidPixmap;
Incidence *selectedIncidence() const;
QDate selectedIncidenceDate() const;
virtual bool eventFilter ( QObject *, QEvent * );
void contentsToGrid (int x, int y, int& gx, int& gy);
void gridToContents (int gx, int gy, int& x, int& y);
int timeToY (const QTime &time);
QTime gyToTime (int y);
void setStartHour(int startHour);
KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom);
KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd);
void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
int YTop,int YBottom);
void changeColumns(int columns);
int columns() { return mColumns; }
int rows() { return mRows; }
int gridSpacingX() const { return mGridSpacingX; }
int gridSpacingY() const { return mGridSpacingY; }
// virtual QSizePolicy sizePolicy() const;
void clear();
void clearSelection();
void hideUnused();
/** Calculates the minimum width */
virtual int minimumWidth() const;
/** Update configuration from preference settings */
void updateConfig();
void checkScrollBoundaries();
- void setHolidayMask(QMemArray<bool> *);
+ void setHolidayMask(Q3MemArray<bool> *);
void setDateList(const DateList &selectedDates);
DateList dateList() const;
void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false);
void finishUpdate();
void printSelection();
void storePosition();
void restorePosition();
void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; }
void shrinkPixmap();
QTime getEndTime();
bool invalidPixmap();
public slots:
void slotContentMove(int,int);
void categoryChanged(Incidence * inc);
void slotClearSelection();
void popupMenu();
void newItem( int );
void moveChild( QWidget *, int, int );
void scrollUp();
void scrollDown();
void updateTodo( Todo * t, int , bool );
void popupAlarm();
@@ -256,53 +265,53 @@ class KOAgenda : public QScrollView
// Cells to store Move and Resize coordiantes
int mStartCellX;
int mStartCellY;
int mCurrentCellX;
int mCurrentCellY;
// Working Hour coordiantes
bool mWorkingHoursEnable;
int mWorkingHoursYTop;
int mWorkingHoursYBottom;
// Selection
int mSelectionCellX;
int mSelectionYTop;
int mSelectionHeight;
// List of dates to be displayed
DateList mSelectedDates;
// The KOAgendaItem, which has been right-clicked last
KOAgendaItem *mClickedItem;
// The KOAgendaItem, which is being moved/resized
- QGuardedPtr<KOAgendaItem> mActionItem;
+ QPointer<KOAgendaItem> mActionItem;
// Currently selected item
- QGuardedPtr<KOAgendaItem> mSelectedItem;
+ QPointer<KOAgendaItem> mSelectedItem;
// The Marcus Bains Line widget.
MarcusBains *mMarcusBains;
void computeSizes();
MouseActionType mActionType;
bool mItemMoved;
// List of all Items contained in agenda
- QPtrList<KOAgendaItem> mItems;
- QPtrList<KOAgendaItem> mUnusedItems;
+ Q3PtrList<KOAgendaItem> mItems;
+ Q3PtrList<KOAgendaItem> mUnusedItems;
KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport);
- QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems
- QPopupMenu *mNewItemPopup;
+ Q3PopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems
+ Q3PopupMenu *mNewItemPopup;
int mOldLowerScrollValue;
int mOldUpperScrollValue;
KOAgendaItem * getItemForTodo ( Todo * todo );
- QMemArray<bool> *mHolidayMask;
+ Q3MemArray<bool> *mHolidayMask;
int mCurPixWid;
int mCurPixHei;
};
#endif // KOAGENDA_H
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 407424d..0f9a38f 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -1,159 +1,169 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <qlabel.h>
#include <qlayout.h>
-#include <qhbox.h>
-#include <qvbox.h>
+#include <q3hbox.h>
+#include <q3vbox.h>
#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qdragobject.h>
+#include <q3whatsthis.h>
+#include <q3dragobject.h>
#include <qdrawutil.h>
#include <qpainter.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3PtrList>
+#include <QPixmap>
+#include <QDragEnterEvent>
+#include <QDropEvent>
+#include <QResizeEvent>
+#include <QMouseEvent>
+#include <QEvent>
+#include <QPaintEvent>
#include <kiconloader.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#define AGENDA_ICON_SIZE 5
#else
#include <qapplication.h>
#define AGENDA_ICON_SIZE 7
#endif
#include <libkcal/icaldrag.h>
#include <libkcal/vcaldrag.h>
#include <libkcal/kincidenceformatter.h>
extern int globalFlagBlockAgenda;
extern int globalFlagBlockAgendaItemPaint;
extern int globalFlagBlockAgendaItemUpdate;
#include "koprefs.h"
#include "koagendaitem.h"
//#include "koagendaitem.moc"
//--------------------------------------------------------------------------
QToolTipGroup *KOAgendaItem::mToolTipGroup = 0;
//--------------------------------------------------------------------------
-class KOAgendaItemWhatsThis :public QWhatsThis
+class KOAgendaItemWhatsThis :public Q3WhatsThis
{
public:
- KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { };
+ KOAgendaItemWhatsThis( KOAgendaItem* view ) : Q3WhatsThis( view ),_view (view) { };
protected:
virtual QString text( const QPoint& )
{
return _view->getWhatsThisText() ;
}
private:
KOAgendaItem * _view;
};
KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday,
- const char *name,WFlags) :
+ const char *name,Qt::WFlags) :
QWidget(parent, name), mIncidence(incidence), mDate(qd)
{
#ifndef DESKTOP_VERSION
//QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
#endif
mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this);
- int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase
- setWFlags ( wflags);
+ Qt::WindowFlags wflags = windowFlags() |Qt::WRepaintNoErase;// WResizeNoErase
+ setWindowFlags ( wflags);
mAllDay = allday;
init ( incidence, qd );
//setMouseTracking(true);
//setAcceptDrops(true);
xPaintCoord = -1;
yPaintCoord = -1;
}
QString KOAgendaItem::getWhatsThisText()
{
if ( mIncidence )
return KIncidenceFormatter::instance()->getFormattedText( mIncidence,
KOPrefs::instance()->mWTshowDetails,
KOPrefs::instance()->mWTshowCreated,
KOPrefs::instance()->mWTshowChanged);
return "KOAgendaItem::getWhatsThisText()::internal error";
}
void KOAgendaItem::initColor ()
{
if ( (mIncidence->typeID() == todoID ) &&
( !((static_cast<Todo*>(mIncidence))->isCompleted()) &&
((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) {
- if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date())
+ if ( (static_cast<Todo*>(mIncidence))->dtDue() < (QDateTime)QDateTime::currentDateTime().date())
mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
else
mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
}
else {
QStringList categories = mIncidence->categories();
QString cat = categories.first();
if (cat.isEmpty()) {
if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) )
mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
else
mBackgroundColor =KOPrefs::instance()->defaultColor( mIncidence->calID() );
} else {
mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) {
if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
mBackgroundColor = KOPrefs::instance()->mTodoDoneColor;
}
}
}
QColor BackgroundColor ( mBackgroundColor );
if ( mIncidence->calID() > 1 ) {
//BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() );
}
mColorGroup = QColorGroup( BackgroundColor.light(),
BackgroundColor.dark(),BackgroundColor.light(),
- BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ;
+ BackgroundColor.dark(),BackgroundColor, Qt::black, BackgroundColor) ;
setBackgroundColor( mBackgroundColor );
mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250);
}
void KOAgendaItem::init ( Incidence *incidence, QDate qd )
{
mIncidence = incidence;
mDate = qd;
mFirstMultiItem = 0;
mNextMultiItem = 0;
mLastMultiItem = 0;
computeText();
initColor();
mConflictItems.clear();
setCellXY(0,0,1);
setCellXWidth(0);
setSubCell(0);
setSubCells(1);
setMultiItem(0,0,0);
startMove();
mSelected = true;
select(false);
QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont);
mFontPixelSize = fontinf.height();;
hide();
@@ -207,98 +217,98 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
if ( mIncidence->calID() > 1 ) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, KOPrefs::instance()->defaultColor( mIncidence->calID() ) );
p->drawRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x-1, yOff*( 1 +AGENDA_ICON_SIZE)+y-1, AGENDA_ICON_SIZE+2, AGENDA_ICON_SIZE+2 );
if ( horLayout ){
++xOff;
++x;
}
else {
++yOff;
++y;
}
}
if (mIncidence->cancelled() && height() < 20 ) {
int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) {
- p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
+ p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::red );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->doesRecur()) {
- p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue );
+ p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::blue );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->description().length() > 0) {
- p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen );
+ p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkGreen );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->isReadOnly()) {
- p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white );
+ p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::white );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->attendeeCount()>0) {
if (mIncidence->organizer() == KOPrefs::instance()->email()) {
- p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black );
+ p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::black );
if ( horLayout )
++xOff;
else
++yOff;
} else {
Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
if (me!=0) {
} else {
- p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow );
+ p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::yellow );
if ( horLayout )
++xOff;
else
++yOff;
}
- p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow );
+ p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkYellow );
if ( horLayout )
++xOff;
else
++yOff;
}
}
return ( yOff || xOff );
}
void KOAgendaItem::select(bool selected)
{
//qDebug("select %d %d",firstMultiItem(), nextMultiItem() );
if (mSelected == selected) return;
mSelected = selected;
if ( ! isVisible() )
return;
if ( firstMultiItem() )
firstMultiItem()->select( selected );
if ( !firstMultiItem() && nextMultiItem() ) {
KOAgendaItem * placeItem = nextMultiItem();
while ( placeItem ) {
@@ -399,75 +409,75 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
}
}
bool addIcon = false;
if ( ! small || w > 3 * h || h > 3* w )
addIcon = updateIcons( paint, horLayout );
//qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0);
qDrawWinPanel (paint, x, yy, w, h, mColorGroup, selected ,0);
//qDebug("draw rect %d %d %d %d ",x, yy, w, h );
if ( ! small ) {
x += 3; yy += 3;w -= 6; h-= 5;
} else {
x += 2; yy += 1;w -= 4; h-= 4;
if ( nfh < 6.01 ) {
yy -= 2;
h += 4;
}
else
if ( nfh < h -2 )
++yy;
}
int align;
#ifndef DESKTOP_VERSION
- align = ( AlignLeft|WordBreak|AlignTop);
+ align = ( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop);
#else
- align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
+ align = ( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop);
#endif
if ( addIcon ) {
if ( ! horLayout ) {
x += AGENDA_ICON_SIZE+3;
w -= (AGENDA_ICON_SIZE+3);
}
else {
yy+= AGENDA_ICON_SIZE+2;
h -=(AGENDA_ICON_SIZE+3);
}
}
if ( mWhiteText )
- paint->setPen ( white);
+ paint->setPen ( Qt::white);
if ( x < 0 ) {
w = w+x-3;
x = 3;
if ( !horLayout && addIcon )
x += AGENDA_ICON_SIZE+3;
if ( w > parentWidget()->width() ){
w = parentWidget()->width() - 6;
#ifndef DESKTOP_VERSION
- align = ( AlignHCenter|WordBreak|AlignTop);
+ align = ( Qt::AlignHCenter|Qt::TextWordWrap|Qt::AlignTop);
#else
- align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop);
+ align = ( Qt::AlignHCenter|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop);
#endif
}
}
QRect dr;
if ( w + x > parentWidget()->width() )
w = parentWidget()->width()-x;
paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr );
//qDebug("%d %d %d %d ", x, yy, w, h );
if ( mIncidence->cancelled() ){
small = ( height() < 20 );
if ( ! small ) {
QFontMetrics fm ( paint->font() );
paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2);
}
}
pa.end();
}
@@ -540,49 +550,49 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
if ( mAllDay )
paintFrom = paintPixAllday();
else
paintFrom = paintPix();
}
xx += rx;
if ( xx < 0 ) {
rw = rw + xx;
rx -= xx;
xx = 0;
if ( rw <= 1 ) {
//qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
return;
}
}
if ( paintFrom->width() < xx+rw ) {
rw = paintFrom->width() - xx;
if ( rw <= 1 ) {
//qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
return;
}
}
//qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
- bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
+ bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,QPainter::CompositionMode_Source);
}
void KOAgendaItem::computeText()
{
mDisplayedText = mIncidence->summary();
if ( (mIncidence->typeID() == todoID ) ) {
if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
else if ( !(mIncidence->doesFloat()))
mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
}
} else {
if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
if ( mAllDay ) {
if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
int dur = 1+ (static_cast<Event*>(mIncidence))->dtStart().date().daysTo( (static_cast<Event*>(mIncidence))->dtEnd().date() );
mDisplayedText += " ("+QString::number( dur )+i18n(" days") +")" ;
if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
if ( mIncidence->doesRecur() ) {
mDisplayedText += " (" + mIncidence->recurrence()->recurrenceText() + ")";
} else {
@@ -607,49 +617,49 @@ void KOAgendaItem::computeText()
tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
}
else {
tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr();
tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr();
}
}
else if ( mIncidence->typeID() == todoID ) {
if (mIncidence->hasStartDate())
tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr();
if (((Todo*)mIncidence)->hasDueDate())
tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr();
}
} else if ( mIncidence->typeID() == todoID ) {
if (mIncidence->hasStartDate())
tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr();
if (((Todo*)mIncidence)->hasDueDate())
tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr();
}
if (!mIncidence->location().isEmpty()) {
tipText += "\n"+i18n("Location: ")+mIncidence->location();
}
- QToolTip::add(this,tipText,toolTipGroup(),"");
+ QToolTip::add(this,tipText /*TODO:hacker: ,toolTipGroup(),"" */);
#endif
}
void KOAgendaItem::updateItem()
{
computeText();
//qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y());
paintMe( mSelected );
repaint( false);
}
void KOAgendaItem::resizeEvent ( QResizeEvent *ev )
{
//qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1());
paintMe( mSelected );
repaint( false );
}
/*
Return height of item in units of agenda cells
*/
int KOAgendaItem::cellHeight()
{
int ret = mCellYBottom - mCellYTop + 1;
@@ -774,92 +784,92 @@ void KOAgendaItem::expandBottom(int dy)
int newYTop = cellYTop();
int newYBottom = cellYBottom() + dy;
if (newYBottom < newYTop) newYBottom = newYTop;
setCellY(newYTop, newYBottom);
}
void KOAgendaItem::expandLeft(int dx)
{
int newX = cellX() + dx;
int newXWidth = cellXWidth();
if (newX > newXWidth) newX = newXWidth;
setCellX(newX,newXWidth);
}
void KOAgendaItem::expandRight(int dx)
{
int newX = cellX();
int newXWidth = cellXWidth() + dx;
if (newXWidth < newX) newXWidth = newX;
setCellX(newX,newXWidth);
}
QToolTipGroup *KOAgendaItem::toolTipGroup()
{
- if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0);
+ /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */
return mToolTipGroup;
}
void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e )
{
#ifndef KORG_NODND
if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) ||
- !QTextDrag::canDecode( e ) ) {
+ !Q3TextDrag::canDecode( e ) ) {
e->ignore();
return;
}
e->accept();
#endif
}
void KOAgendaItem::dropEvent( QDropEvent *e )
{
#ifndef KORG_NODND
QString text;
- if(QTextDrag::decode(e,text))
+ if(Q3TextDrag::decode(e,text))
{
kdDebug() << "Dropped : " << text << endl;
QStringList emails = QStringList::split(",",text);
for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
kdDebug() << " Email: " << (*it) << endl;
int pos = (*it).find("<");
QString name = (*it).left(pos);
QString email = (*it).mid(pos);
if (!email.isEmpty()) {
mIncidence->addAttendee(new Attendee(name,email));
}
}
}
#endif
}
-QPtrList<KOAgendaItem> KOAgendaItem::conflictItems()
+Q3PtrList<KOAgendaItem> KOAgendaItem::conflictItems()
{
return mConflictItems;
}
-void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci)
+void KOAgendaItem::setConflictItems(Q3PtrList<KOAgendaItem> ci)
{
mConflictItems = ci;
KOAgendaItem *item;
for ( item=mConflictItems.first(); item != 0;
item=mConflictItems.next() ) {
item->addConflictItem(this);
}
}
void KOAgendaItem::addConflictItem(KOAgendaItem *ci)
{
if (mConflictItems.find(ci)<0)
mConflictItems.append(ci);
}
bool KOAgendaItem::checkLayout()
{
if ( !mConflictItems.count() )
return true;
int max = 0;
KOAgendaItem *item;
for ( item=mConflictItems.first(); item != 0;
item=mConflictItems.next() ) {
if ( item->subCells() > max )
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 27ee720..17cf975 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -1,72 +1,79 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KOAGENDAITEM_H
#define KOAGENDAITEM_H
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
#include <qpixmap.h>
#include <qdatetime.h>
#include <qpalette.h>
+//Added by qt3to4:
+#include <QDropEvent>
+#include <QPaintEvent>
+#include <QResizeEvent>
+#include <Q3PtrList>
+#include <QEvent>
+#include <QDragEnterEvent>
#include <libkcal/incidence.h>
class KOAgendaItemWhatsThis;
class QToolTipGroup;
class QDragEnterEvent;
class QDropEvent;
using namespace KCal;
/*
The KOAgendaItem has to make sure that it receives all mouse events, which are
to be used for dragging and resizing. That means it has to be installed as
eventfiler for its children, if it has children, and it has to pass mouse
events from the cildren to itself. See eventFilter().
*/
class KOAgendaItem : public QWidget
{
Q_OBJECT
public:
KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0,
- WFlags f=0 );
+ Qt::WFlags f=0 );
~KOAgendaItem();
QString getWhatsThisText();
void init ( Incidence *incidence, QDate qd );
int cellX() { return mCellX; }
int cellXWidth() { return mCellXWidth; }
int cellYTop() { return mCellYTop; }
int cellYBottom() { return mCellYBottom; }
int cellHeight();
int cellWidth();
int subCell() { return mSubCell; }
int subCells() { return mSubCells; }
void setCellXY(int X, int YTop, int YBottom);
void setCellY(int YTop, int YBottom);
void setCellX(int XLeft, int XRight);
void setCellXWidth(int xwidth);
void setSubCell(int subCell);
void setSubCells(int subCells);
/** Start movement */
void startMove();
/** Reset to original values */
void resetMove();
@@ -75,50 +82,50 @@ class KOAgendaItem : public QWidget
void expandBottom(int dy);
void expandLeft(int dx);
void expandRight(int dx);
int mLastMoveXPos;
void setMultiItem(KOAgendaItem *first,KOAgendaItem *next,
KOAgendaItem *last);
KOAgendaItem *firstMultiItem() { return mFirstMultiItem; }
KOAgendaItem *nextMultiItem() { return mNextMultiItem; }
KOAgendaItem *lastMultiItem() { return mLastMultiItem; }
Incidence *incidence() const { return mIncidence; }
QDate itemDate() { return mDate; }
/** Update the date of this item's occurence (not in the event) */
void setItemDate(QDate qd);
void setText ( const QString & text ) { mDisplayedText = text; }
QString text () { return mDisplayedText; }
virtual bool eventFilter ( QObject *, QEvent * );
static QToolTipGroup *toolTipGroup();
- QPtrList<KOAgendaItem> conflictItems();
- void setConflictItems(QPtrList<KOAgendaItem>);
+ Q3PtrList<KOAgendaItem> conflictItems();
+ void setConflictItems(Q3PtrList<KOAgendaItem>);
void addConflictItem(KOAgendaItem *ci);
void paintMe( bool, QPainter* painter = 0 );
void repaintMe();
static QPixmap * paintPix();
static QPixmap * paintPixAllday();
void updateItem();
void computeText();
void recreateIncidence();
bool checkLayout();
void initColor ();
bool isAllDay() { return mAllDay; }
int resizeMe( int grid, int wid, int hei, bool invalidWidth = false );
public slots:
bool updateIcons( QPainter *, bool );
void select(bool=true);
void repaintItem();
protected:
void dragEnterEvent(QDragEnterEvent *e);
void dropEvent(QDropEvent *e);
void paintEvent ( QPaintEvent * );
void resizeEvent ( QResizeEvent *ev );
private:
@@ -140,28 +147,28 @@ class KOAgendaItem : public QWidget
int mStartCellYTop,mStartCellYBottom;
int mLastMovePos;
// Multi item pointers
KOAgendaItem *mFirstMultiItem;
KOAgendaItem *mNextMultiItem;
KOAgendaItem *mLastMultiItem;
int mFontPixelSize;
Incidence *mIncidence; // corresponding event or todo
QDate mDate; //date this events occurs (for recurrence)
//void showIcon( QLabel*, int );
//QLabel *mTodoIconLabel;
//QLabel *mItemLabel;
//QWidget *mIconBox;
//QLabel *mIconAlarm,*mIconRecur,*mIconReadonly;
//QLabel *mIconReply,*mIconGroup,*mIconOrganizer;
//QLabel *mIconMoreInfo;
static QToolTipGroup *mToolTipGroup;
QColor mBackgroundColor;
QColorGroup mColorGroup;
QString mDisplayedText;
bool mSelected;
- QPtrList<KOAgendaItem> mConflictItems;
+ Q3PtrList<KOAgendaItem> mConflictItems;
};
#endif // KOAGENDAITEM_H
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 6e65a03..87993ae 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1,122 +1,134 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qhbox.h>
-#include <qvbox.h>
+#include <q3hbox.h>
+#include <q3vbox.h>
#include <qlabel.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qlayout.h>
#ifndef KORG_NOSPLITTER
#include <qsplitter.h>
#endif
#include <qfont.h>
#include <qfontmetrics.h>
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
#include <qtooltip.h>
#include <qpainter.h>
#include <qpushbutton.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QPixmap>
+#include <QMouseEvent>
+#include <Q3GridLayout>
+#include <Q3ValueList>
+#include <QKeyEvent>
+#include <Q3HBoxLayout>
+#include <Q3VBoxLayout>
+#include <QPaintEvent>
+#include <Q3PtrList>
#include <kapplication.h>
#include <KDGanttMinimizeSplitter.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kconfig.h>
#include <kglobal.h>
#include "calendarview.h"
#include "koviewmanager.h"
#include <libkcal/calendar.h>
#include <libkcal/icaldrag.h>
#include <libkcal/dndfactory.h>
#include <kcalendarsystem.h>
#include "koglobals.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include "koprefs.h"
#include "koagenda.h"
#include "koagendaitem.h"
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koagendaview.h"
//#include "koagendaview.moc"
//extern bool globalFlagBlockPainting;
extern int globalFlagBlockAgenda;
extern int globalFlagBlockStartup;
extern int globalFlagBlockAgendaItemPaint;
extern int globalFlagBlockAgendaItemUpdate;
extern int globalFlagBlockLabel;
using namespace KOrg;
#define IDLETIMEOUT 45
-TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) :
- QScrollView(parent,name,f)
+TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,Qt::WFlags f) :
+ Q3ScrollView(parent,name,f)
{
myPix.resize( 1, 1 );
mRows = rows;
mRedrawNeeded = true;
setMinimumHeight( 20 );
mCellHeight = KOPrefs::instance()->mHourSize*4;
enableClipper(true);
setHScrollBarMode(AlwaysOff);
setVScrollBarMode(AlwaysOff);
resizeContents(50,mRows * mCellHeight);
- viewport()->setBackgroundMode( PaletteBackground );
+ viewport()->setBackgroundMode( Qt::PaletteBackground );
}
void TimeLabels::setCellHeight(int height)
{
mCellHeight = height;
}
/*
Optimization so that only the "dirty" portion of the scroll view
is redrawn. Unfortunately, this is not called by default paintEvent() method.
*/
void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
{
cx = contentsX() + frameWidth()*2;
cw = contentsWidth() ;
// end of workaround
int cell = ((int)(cy/mCellHeight));
int y = cell * mCellHeight;
QFontMetrics fm = fontMetrics();
QString hour;
QString suffix = "am";
int timeHeight = fm.ascent();
@@ -262,49 +274,49 @@ void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e )
tSize = 4;
if ( tSize > 22 )
tSize = 22;
tSize = (tSize/2)*2;
if ( tSize == KOPrefs::instance()->mHourSize )
return;
KOPrefs::instance()->mHourSize = tSize;
emit scaleChanged();
}
/** This is called in response to repaint() */
void TimeLabels::paintEvent(QPaintEvent*)
{
// kdDebug() << "paintevent..." << endl;
// this is another hack!
// QPainter painter(this);
//QString c
repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight());
}
////////////////////////////////////////////////////////////////////////////
EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name)
- : QFrame(parent,name)
+ : Q3Frame(parent,name)
{
mColumns = 1;
mTopBox = 0;
mLocation = loc;
mTopLayout = 0;
mPaintWidget = 0;
mXOffset = 0;
if (mLocation == Top) mPixmap = SmallIcon("1uparrow");
else mPixmap = SmallIcon("1downarrow");
mEnabled.resize(mColumns);
mEnabled.fill( false );
setMinimumHeight(mPixmap.height());
}
EventIndicator::~EventIndicator()
{
}
void EventIndicator::drawContents(QPainter *p)
{
// kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl;
KDGanttSplitterHandle* han = 0;
if ( mPaintWidget )
@@ -372,121 +384,121 @@ void EventIndicator::enableColumn(int column, bool enable)
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
KOEventView (cal,parent,name)
{
flag_blockfillAgenda = false;
mBlockUpdating = true;
mStartHour = 8;
mSelectedDates.append(QDate::currentDate());
mLayoutDayLabels = 0;
mDayLabelsFrame = 0;
mDayLabels = 0;
bool isRTL = KOGlobals::self()->reverseLayout();
QPixmap expandPix;
if ( KOPrefs::instance()->mVerticalScreen ) {
expandPix = SmallIcon( "1updownarrow" );
} else {
expandPix = SmallIcon("1leftrightarrow" );
}
- QBoxLayout *topLayout = new QVBoxLayout(this);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
// Create day name labels for agenda columns
// Create agenda splitter
mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this);
mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
topLayout->addWidget( mSplitterAgenda );
- mAllDayFrame = new QHBox(mSplitterAgenda);
- mAllDayFrame->setFocusPolicy(NoFocus);
+ mAllDayFrame = new Q3HBox(mSplitterAgenda);
+ mAllDayFrame->setFocusPolicy(Qt::NoFocus);
QWidget *agendaFrame = new QWidget(mSplitterAgenda);
- agendaFrame->setFocusPolicy(NoFocus);
+ agendaFrame->setFocusPolicy(Qt::NoFocus);
// Create all-day agenda widget
- mDummyAllDayLeft = new QVBox( mAllDayFrame );
+ mDummyAllDayLeft = new Q3VBox( mAllDayFrame );
mExpandButton = new QPushButton(mDummyAllDayLeft);
mExpandButton->setPixmap( expandPix );
int widebut = mExpandButton->sizeHint().width()+4;
int heibut = mExpandButton->sizeHint().height()+4;
if ( heibut > widebut )
widebut = heibut ;
//mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
// QSizePolicy::Fixed ) );
mExpandButton->setFixedSize( widebut, widebut);
connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
- mExpandButton->setFocusPolicy(NoFocus);
+ mExpandButton->setFocusPolicy(Qt::NoFocus);
mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
- mAllDayAgenda->setFocusPolicy(NoFocus);
+ mAllDayAgenda->setFocusPolicy(Qt::NoFocus);
QLabel *dummyAllDayRight = new QLabel (mAllDayFrame);
// Create event context menu for all day agenda
//mAllDayAgendaPopup = eventPopup();
// Create agenda frame
- QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3);
+ Q3GridLayout *agendaLayout = new Q3GridLayout(agendaFrame,4,3);
// QHBox *agendaFrame = new QHBox(splitterAgenda);
// create event indicator bars
mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
#ifndef DESKTOP_VERSION
mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
#endif
- mDayLabelsFrame = new QHBox(agendaFrame);
+ mDayLabelsFrame = new Q3HBox(agendaFrame);
//topLayout->addWidget(mDayLabelsFrame);
- mDayLabels = new QFrame (mDayLabelsFrame);
- mLayoutDayLabels = new QHBoxLayout(mDayLabels);
+ mDayLabels = new Q3Frame (mDayLabelsFrame);
+ mLayoutDayLabels = new Q3HBoxLayout(mDayLabels);
agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2);
agendaLayout->addWidget(mEventIndicatorTop,1,1);
mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
agendaFrame);
agendaLayout->addWidget(mEventIndicatorBottom,3,1);
QWidget *dummyAgendaRight = new QWidget(agendaFrame);
agendaLayout->addWidget(dummyAgendaRight,1,2);
// Create time labels
mTimeLabels = new TimeLabels(24,agendaFrame);
agendaLayout->addWidget(mTimeLabels,2,0);
connect(mTimeLabels,SIGNAL( scaleChanged()),
this,SLOT(updateConfig()));
// Create agenda
mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2);
agendaLayout->setColStretch(1,1);
- mAgenda->setFocusPolicy(NoFocus);
+ mAgenda->setFocusPolicy(Qt::NoFocus);
// Create event context menu for agenda
mAllAgendaPopup = eventPopup();
#if 0
- mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")),
+ mAllAgendaPopup->addAdditionalItem(QIcon(SmallIcon("bell")),
i18n("Toggle Alarm"),mAgenda,
SLOT(popupAlarm()),true);
#endif
connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
connect(mAllAgendaPopup,SIGNAL(categoryChanged(Incidence *)),
this,SLOT(categoryChanged(Incidence *)));
mAgenda->setPopup( mAllAgendaPopup );
mAllDayAgenda->setPopup( mAllAgendaPopup );
// make connections between dependent widgets
mTimeLabels->setAgenda(mAgenda);
// Update widgets to reflect user preferences
// updateConfig();
// createDayLabels();
@@ -897,51 +909,51 @@ void KOAgendaView::createDayLabels()
//mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2);
if ( !appendLabels ) {
dayLabel = mDayLabelsList.next();
while ( dayLabel ) {
//qDebug("!dayLabel %d",dayLabel );
dayLabel->hide();
dayLabel = mDayLabelsList.next();
}
}
mDayLabelsFrame->setFixedHeight( newHight + 4 );
}
int KOAgendaView::maxDatesHint()
{
// Not sure about the max number of events, so return 0 for now.
return 0;
}
int KOAgendaView::currentDateCount()
{
return mSelectedDates.count();
}
-QPtrList<Incidence> KOAgendaView::selectedIncidences()
+Q3PtrList<Incidence> KOAgendaView::selectedIncidences()
{
- QPtrList<Incidence> selected;
+ Q3PtrList<Incidence> selected;
Incidence *incidence;
incidence = mAgenda->selectedIncidence();
if (incidence) selected.append(incidence);
incidence = mAllDayAgenda->selectedIncidence();
if (incidence) selected.append(incidence);
return selected;
}
DateList KOAgendaView::selectedDates()
{
DateList selected;
QDate qd;
qd = mAgenda->selectedIncidenceDate();
if (qd.isValid()) selected.append(qd);
qd = mAllDayAgenda->selectedIncidenceDate();
if (qd.isValid()) selected.append(qd);
return selected;
}
@@ -966,50 +978,50 @@ void KOAgendaView::updateConfig()
if ( mBlockUpdating )
return;
if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) {
int old = KOPrefs::instance()->mHourSize;
KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1;
//qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize );
}
// update config for children
mTimeLabels->updateConfig();
mAgenda->storePosition();
mAgenda->updateConfig();
mAllDayAgenda->updateConfig();
// widget synchronization
//TODO: find a better way, maybe signal/slot
mTimeLabels->positionChanged();
// for some reason, this needs to be called explicitly
mTimeLabels->repaint();
mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
// ToolTips displaying summary of events
- KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance()
- ->mEnableToolTips);
+ /* TODO:hacker: KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance()
+ ->mEnableToolTips); */
//setHolidayMasks();
//createDayLabels(); called by via updateView();
mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth());
updateView();
mAgenda->restorePosition();
}
void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
{
int xxx = item->cellX();
//qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() );
if ( xxx >= 0 && xxx < mMinY.count() && !item->isAllDay() ) {
if ( mMinY.at(xxx) > item->cellYTop() )
mMinY.at(xxx) = item->cellYTop();
if ( mMaxY.at(xxx) < item->cellYBottom() )
mMaxY.at(xxx) = item->cellYBottom();
}
QDateTime startDt,endDt;
QDate startDate;
@@ -1096,101 +1108,101 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
}
else
emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED);
item->updateItem();
}
void KOAgendaView::showDates( const QDate &start, const QDate &end )
{
// kdDebug() << "KOAgendaView::selectDates" << endl;
mSelectedDates.clear();
// qDebug("KOAgendaView::showDates ");
QDate d = start;
while (d <= end) {
mSelectedDates.append(d);
d = d.addDays( 1 );
}
// and update the view
fillAgenda();
}
-void KOAgendaView::showEvents(QPtrList<Event>)
+void KOAgendaView::showEvents(Q3PtrList<Event>)
{
kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl;
}
void KOAgendaView::changeEventDisplay(Event *, int)
{
// qDebug("KOAgendaView::changeEventDisplay ");
// kdDebug() << "KOAgendaView::changeEventDisplay" << endl;
// this should be re-written to be MUCH smarter. Right now we
// are just playing dumb.
fillAgenda();
}
void KOAgendaView::fillAgenda(const QDate &)
{
// qDebug("KOAgendaView::fillAgenda ");
fillAgenda();
}
void KOAgendaView::fillAgenda()
{
if ( globalFlagBlockStartup )
return;
if ( globalFlagBlockAgenda == 1 )
return;
if ( flag_blockfillAgenda )
return;
flag_blockfillAgenda = true;
//if ( globalFlagBlockAgenda == 2 )
//globalFlagBlockAgenda = 0;
// globalFlagBlockPainting = false;
if ( globalFlagBlockAgenda == 0 )
globalFlagBlockAgenda = 1;
// clearView();
//qDebug("fillAgenda()++++ ");
globalFlagBlockAgendaItemPaint = 1;
mAllDayAgenda->changeColumns(mSelectedDates.count());
mAgenda->changeColumns(mSelectedDates.count());
qApp->processEvents();
mEventIndicatorTop->changeColumns(mSelectedDates.count());
mEventIndicatorBottom->changeColumns(mSelectedDates.count());
setHolidayMasks();
mMinY.resize(mSelectedDates.count());
mMaxY.resize(mSelectedDates.count());
- QPtrList<Event> dayEvents;
+ Q3PtrList<Event> dayEvents;
// ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
// Therefore, gtodoset all of them.
- QPtrList<Todo> todos = calendar()->todos();
+ Q3PtrList<Todo> todos = calendar()->todos();
mAgenda->setDateList(mSelectedDates);
QDate today = QDate::currentDate();
DateList::ConstIterator dit;
int curCol = 0;
int maxCol = mSelectedDates.count()-1;
for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) {
QDate currentDate = *dit;
// kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString()
// << endl;
dayEvents = calendar()->events(currentDate,false);
// Default values, which can never be reached
mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1;
mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1;
unsigned int numEvent;
//qDebug("+++++NUMEVENT %d", dayEvents.count());
for(numEvent=0;numEvent<dayEvents.count();++numEvent) {
Event *event = dayEvents.at(numEvent);
if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") )
@@ -1279,49 +1291,49 @@ void KOAgendaView::fillAgenda()
if (endY > mMaxY[curCol]) mMaxY[curCol] = endY;
} else {
mMinY[curCol] = mAgenda->timeToY(QTime(0,0));
mMaxY[curCol] = mAgenda->timeToY(QTime(23,59));
}
} else {
int startY = mAgenda->timeToY(event->dtStart().time());
int endY = mAgenda->timeToY(event->dtEnd().time()) - 1;
if (endY < startY) endY = startY;
mAgenda->insertItem(event,currentDate,curCol,startY,endY);
if (startY < mMinY[curCol]) mMinY[curCol] = startY;
if (endY > mMaxY[curCol]) mMaxY[curCol] = endY;
}
}
// ---------- [display Todos --------------
unsigned int numTodo;
for (numTodo = 0; numTodo < todos.count(); ++numTodo) {
Todo *todo = todos.at(numTodo);
if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) continue;
// ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
// Already completed items can be displayed on their original due date
//if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda
- bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda;
+ bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)today) && KOPrefs::instance()->mShowTodoInAgenda;
bool fillIn = false;
if ( todo->hasCompletedDate() && todo->completed().date() == currentDate )
fillIn = true;
if ( ! fillIn && !todo->hasCompletedDate() )
fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue);
if ( fillIn ) {
if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue
if ( KOPrefs::instance()->mShowTodoInAgenda )
mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol);
}
else {
QDateTime dt;
if ( todo->hasCompletedDate() )
dt = todo->completed();
else
dt = todo->dtDue();;
int endY = mAgenda->timeToY(dt.time()) - 1;
int hi = (18/KOPrefs::instance()->mHourSize);
//qDebug("hei %d ",KOPrefs::instance()->mHourSize);
int startY = endY -hi;
mAgenda->insertItem(todo,currentDate,curCol,startY,endY);
@@ -1482,87 +1494,87 @@ void KOAgendaView::updateEventIndicatorBottom(int newY)
void KOAgendaView::startDrag(Event *event)
{
#ifndef KORG_NODND
DndFactory factory( calendar() );
ICalDrag *vd = factory.createDrag(event,this);
if (vd->drag()) {
kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl;
}
#endif
}
void KOAgendaView::readSettings()
{
readSettings(KOGlobals::config());
}
void KOAgendaView::readSettings(KConfig *config)
{
// kdDebug() << "KOAgendaView::readSettings()" << endl;
config->setGroup("Views");
//#ifndef KORG_NOSPLITTER
- QValueList<int> sizes = config->readIntListEntry("Separator AgendaView");
+ Q3ValueList<int> sizes = config->readIntListEntry("Separator AgendaView");
if (sizes.count() == 2) {
if ( sizes[0] < 20 ) {
sizes[1] = sizes[1] +20 - sizes[0];
sizes[0] = 20;
}
mSplitterAgenda->setSizes(sizes);
// qDebug("read %d %d ",sizes[0],sizes[1] );
}
//#endif
// updateConfig();
}
void KOAgendaView::writeSettings(KConfig *config)
{
// kdDebug() << "KOAgendaView::writeSettings()" << endl;
config->setGroup("Views");
//#ifndef KORG_NOSPLITTER
- QValueList<int> list = mSplitterAgenda->sizes();
+ Q3ValueList<int> list = mSplitterAgenda->sizes();
config->writeEntry("Separator AgendaView",list);
//qDebug("write %d %d ", list[0],list[1] );
//#endif
}
void KOAgendaView::setHolidayMasks()
{
mHolidayMask.resize(mSelectedDates.count());
uint i;
for(i=0;i<mSelectedDates.count();++i) {
QDate date = mSelectedDates[i];
bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6);
bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7);
bool showHoliday = false;
if ( KOPrefs::instance()->mExcludeHolidays ) {
- QPtrList<Event> events = calendar()->events( date, true );
+ Q3PtrList<Event> events = calendar()->events( date, true );
Event *event;
for( event = events.first(); event; event = events.next() ) {
if ( event->isHoliday()) {
showHoliday = true;
break;
}
}
}
#ifndef KORG_NOPLUGINS
bool showHoliday = KOPrefs::instance()->mExcludeHolidays &&
!KOCore::self()->holiday(date).isEmpty();
#endif
bool showDay = showSaturday || showSunday || showHoliday;
if (showDay) {
mHolidayMask.at(i) = true;
} else {
mHolidayMask.at(i) = false;
}
}
mAgenda->setHolidayMask(&mHolidayMask);
@@ -1642,49 +1654,49 @@ void KOAgendaView::setInitStartHour()
if ( KOPrefs::instance()->mCenterOnCurrentTime )
setStartHour( QTime::currentTime ().hour() );
else
setStartHour( KOPrefs::instance()->mDayBegins );
}
void KOAgendaView::updateTodo( Todo * t, int )
{
if ( !isVisible() )
return;
bool remove = false;
bool removeAD = false;
QDate da;
if ( t->hasCompletedDate() )
da = t->completed().date();
else
da = t->dtDue().date();
if ( ! t->hasDueDate() && !t->hasCompletedDate() ) {
remove = true;
removeAD = true;
}
else {
- bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ;
+ bool overdue = (!t->isCompleted()) && (t->dtDue() < (QDateTime)QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ;
if ( overdue &&
QDate::currentDate() >= mSelectedDates.first() &&
QDate::currentDate() <= mSelectedDates.last()) {
removeAD = false;
remove = true;
}
else {
if ( da < mSelectedDates.first() ||
da > mSelectedDates.last() ) {
remove = true;
removeAD = true;
} else {
remove = t->doesFloat() && !t->hasCompletedDate();
removeAD = !remove;
}
}
}
int days = mSelectedDates.first().daysTo( da );
//qDebug("daysto %d %d %d", days, remove,removeAD );
mAgenda->updateTodo( t , days, remove);
if ( KOPrefs::instance()->mShowTodoInAgenda )
mAllDayAgenda->updateTodo( t , days, removeAD);
//qDebug("KOAgendaView::updateTodo( Todo *, int ) ");
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 5e68146..3b871d9 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -2,211 +2,221 @@
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOAGENDAVIEW_H
#define KOAGENDAVIEW_H
-#include <qscrollview.h>
+#include <q3scrollview.h>
#include <qdatetime.h>
#include <qpushbutton.h>
#include <qlayout.h>
+#include <Q3BoxLayout>
#ifndef DESKTOP_VERSION
#include <qksplitter.h>
#else
#include <qsplitter.h>
#endif
-#include <qmemarray.h>
+#include <q3memarray.h>
+//Added by qt3to4:
+#include <QPaintEvent>
+#include <QResizeEvent>
+#include <Q3Frame>
+#include <QPixmap>
+#include <QLabel>
+#include <QMouseEvent>
+#include <Q3PtrList>
+#include <QKeyEvent>
#include "koeventview.h"
-class QHBox;
-class QFrame;
+class Q3HBox;
+class Q3Frame;
class QLabel;
class QPushButton;
class CalendarView;
class KOAgenda;
class KOAgendaItem;
class KConfig;
class KDGanttMinimizeSplitter;
class KOAgendaButton : public QPushButton
{
Q_OBJECT
public:
KOAgendaButton( QWidget *parent=0, const char *name=0 ) :
QPushButton( parent, name )
{
mNum = -3;
setFlat( true );
- setFocusPolicy(NoFocus);
+ setFocusPolicy(Qt::NoFocus);
setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding ));
connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) );
};
QSize sizeHint () const { return QSize( 5,5) ;}
void setNum( int n) { mNum = n; }
private slots:
void bClicked() {emit numClicked( mNum);}
signals:
void numClicked( int );
private:
int mNum;
};
-class TimeLabels : public QScrollView {
+class TimeLabels : public Q3ScrollView {
Q_OBJECT
public:
- TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0);
+ TimeLabels(int rows,QWidget *parent=0,const char *name=0,Qt::WFlags f=0);
void setCellHeight(int height);
/** Calculates the minimum width */
virtual int minimumWidth() const;
/** updates widget's internal state */
void updateConfig();
/** */
void setAgenda(KOAgenda* agenda);
/** */
virtual void paintEvent(QPaintEvent* e);
void contentsMousePressEvent ( QMouseEvent * ) ;
void contentsMouseReleaseEvent ( QMouseEvent * );
void contentsMouseMoveEvent ( QMouseEvent * );
public slots:
/** update time label positions */
void positionChanged();
signals:
void scaleChanged();
protected:
void drawContents(QPainter *p,int cx, int cy, int cw, int ch);
private:
QPixmap myPix;
bool mRedrawNeeded;
int mMiniWidth;
int mMouseDownY;
QString mOrgCap;
int mRows;
int mCellHeight;
/** */
KOAgenda* mAgenda;
};
-class EventIndicator : public QFrame {
+class EventIndicator : public Q3Frame {
Q_OBJECT
public:
enum Location { Top, Bottom };
EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0);
virtual ~EventIndicator();
void changeColumns(int columns);
void setPaintWidget( KDGanttMinimizeSplitter* );
void setXOffset( int );
void enableColumn(int column, bool enable);
protected:
void drawContents(QPainter *);
private:
int mXOffset;
KDGanttMinimizeSplitter* mPaintWidget;
int mColumns;
- QHBox *mTopBox;
- QBoxLayout *mTopLayout;
+ Q3HBox *mTopBox;
+ Q3BoxLayout *mTopLayout;
Location mLocation;
QPixmap mPixmap;
- QMemArray<bool> mEnabled;
+ Q3MemArray<bool> mEnabled;
};
/**
KOAgendaView is the agenda-like view used to display events in an one or
multi-day view.
*/
class KOAgendaView : public KOEventView {
Q_OBJECT
public:
KOAgendaView(Calendar *cal,QWidget *parent = 0,const char *name = 0 );
virtual ~KOAgendaView();
void setStartHour( int );
void toggleAllDay();
/** Returns maximum number of days supported by the koagendaview */
virtual int maxDatesHint();
/** Returns number of currently shown dates. */
virtual int currentDateCount();
/** returns the currently selected events */
- virtual QPtrList<Incidence> selectedIncidences();
+ virtual Q3PtrList<Incidence> selectedIncidences();
/** returns the currently selected events */
virtual DateList selectedDates();
/** Remove all events from view */
void clearView();
void clearList();
KOAgenda *agenda() { return mAgenda;}
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
/** start-datetime of selection */
QDateTime selectionStart() {return mTimeSpanBegin;}
/** end-datetime of selection */
QDateTime selectionEnd() {return mTimeSpanEnd;}
/** returns true if selection is for whole day */
bool selectedIsAllDay() {return mTimeSpanInAllDay;}
/** make selected start/end invalid */
void deleteSelectedDateTime();
void repaintAgenda();
public slots:
void setInitStartHour();
virtual void updateView();
virtual void updateConfig();
virtual void showDates(const QDate &start, const QDate &end);
- virtual void showEvents(QPtrList<Event> eventList);
+ virtual void showEvents(Q3PtrList<Event> eventList);
void updateTodo( Todo *, int );
void changeEventDisplay(Event *, int);
void clearSelection();
void newTodo(int gx,int gy);
void newEvent(int gx,int gy);
void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd);
void newEventAllDay(int gx, int gy);
void newTodoAllDay(int gx, int gy);
void startDrag(Event *);
void readSettings();
void readSettings(KConfig *);
void writeSettings(KConfig *);
void setContentsPos(int y);
void scrollOneHourUp();
void scrollOneHourDown();
void addToCalSlot(Incidence *, Incidence *);
void slotShowDateView( int, int );
@@ -239,61 +249,61 @@ class KOAgendaView : public KOEventView {
*/
void setHolidayMasks();
protected slots:
void slotIdleTimeout();
void categoryChanged( Incidence * );
void slotDaylabelClicked( int );
/** Update event belonging to agenda item */
void updateEventDates(KOAgendaItem *item, int mode = -1);
//void updateMovedTodo();
void updateEventIndicatorTop(int newY);
void updateEventIndicatorBottom(int newY);
/** Updates data for selected timespan */
void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd);
/** Updates data for selected timespan for all day event*/
void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd);
private:
bool flag_blockfillAgenda;
QTimer* mIdleTimer;
QDateTime mIdleStart;
// view widgets
- QFrame *mDayLabels;
- QHBox *mDayLabelsFrame;
- QBoxLayout *mLayoutDayLabels;
- QFrame *mAllDayFrame;
+ Q3Frame *mDayLabels;
+ Q3HBox *mDayLabelsFrame;
+ Q3BoxLayout *mLayoutDayLabels;
+ Q3Frame *mAllDayFrame;
KOAgenda *mAllDayAgenda;
KOAgenda *mAgenda;
TimeLabels *mTimeLabels;
QWidget *mDummyAllDayLeft;
KDGanttMinimizeSplitter* mSplitterAgenda;
QPushButton *mExpandButton;
DateList mSelectedDates; // List of dates to be displayed
int mViewType;
bool mWeekStartsMonday;
int mStartHour;
KOEventPopupMenu *mAllAgendaPopup;
//KOEventPopupMenu *mAllDayAgendaPopup;
EventIndicator *mEventIndicatorTop;
EventIndicator *mEventIndicatorBottom;
- QMemArray<int> mMinY;
- QMemArray<int> mMaxY;
+ Q3MemArray<int> mMinY;
+ Q3MemArray<int> mMaxY;
- QMemArray<bool> mHolidayMask;
+ Q3MemArray<bool> mHolidayMask;
- QPtrList<KOAgendaButton> mDayLabelsList;
+ Q3PtrList<KOAgendaButton> mDayLabelsList;
QDateTime mTimeSpanBegin;
QDateTime mTimeSpanEnd;
bool mTimeSpanInAllDay;
void keyPressEvent ( QKeyEvent * e );
};
#endif // KOAGENDAVIEW_H
diff --git a/korganizer/kocounterdialog.h b/korganizer/kocounterdialog.h
index c8dcf45..493d9e1 100644
--- a/korganizer/kocounterdialog.h
+++ b/korganizer/kocounterdialog.h
@@ -1,49 +1,49 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KOCOUNTERDIALOG_H
#define KOCOUNTERDIALOG_H
//
// Viewer dialog for counter events.
//
-#include <qtextview.h>
+#include <q3textview.h>
#include <kdialogbase.h>
#include <libkcal/event.h>
using namespace KCal;
class KOEventViewer;
class KOCounterDialog : public KDialogBase {
Q_OBJECT
public:
KOCounterDialog(QWidget *parent=0,const char *name=0);
virtual ~KOCounterDialog();
void setEvent(Event *event);
void addEvent(Event *event);
void setTodo(Todo *event);
void addText(QString text);
private:
KOEventViewer *mEventViewer;
};
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 52fd1e8..4f681b3 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -3,176 +3,185 @@
Copyright (c) 2001 Eitzenberger Thomas <thomas.eitzenberger@siemens.at>
Parts of the source code have been copied from kdpdatebutton.cpp
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source ode for Qt in the source distribution.
*/
#include <qevent.h>
#include <qpainter.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <qtimer.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
+//Added by qt3to4:
+#include <QDragLeaveEvent>
+#include <Q3Frame>
+#include <QDragEnterEvent>
+#include <QDragMoveEvent>
+#include <QDropEvent>
+#include <QResizeEvent>
+#include <QMouseEvent>
+#include <QPaintEvent>
#include <kglobal.h>
#include <kdebug.h>
#include <klocale.h>
#include <libkcal/vcaldrag.h>
#include <libkcal/icaldrag.h>
#include <libkcal/dndfactory.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#include <kcalendarsystem.h>
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include "koprefs.h"
#include "koglobals.h"
#include "kodaymatrix.h"
// ============================================================================
// D Y N A M I C T I P
// ============================================================================
DynamicTip::DynamicTip( QWidget * parent )
- : QToolTip( parent )
+ /* TODO:hacker: : QToolTip( parent ) */
{
matrix = (KODayMatrix*)parent;
}
-class KODaymatrixWhatsThis :public QWhatsThis
+class KODaymatrixWhatsThis :public Q3WhatsThis
{
public:
- KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;};
+ KODaymatrixWhatsThis( KODayMatrix* view ) : Q3WhatsThis( view ),_view (view) { ;};
~KODaymatrixWhatsThis() { ; };
protected:
virtual QString text( const QPoint& p )
{
return _view->getWhatsThisText( p ) ;
}
private:
KODayMatrix * _view;
};
void DynamicTip::maybeTip( const QPoint &pos )
{
//calculate which cell of the matrix the mouse is in
QRect sz = matrix->frameRect();
int dheight = sz.height()*7 / 42;
int dwidth = sz.width() / 7;
int row = pos.y()/dheight;
int col = pos.x()/dwidth;
QRect rct(col*dwidth, row*dheight, dwidth, dheight);
// kdDebug() << "DynamicTip::maybeTip matrix cell index [" <<
// col << "][" << row << "] => " <<(col+row*7) << endl;
//show holiday names only
QString str = matrix->getHolidayLabel(col+row*7);
if (str.isEmpty()) return;
- tip(rct, str);
+ /* TODO:hacker: tip(rct, str);*/
}
// ============================================================================
// K O D A Y M A T R I X
// ============================================================================
const int KODayMatrix::NOSELECTION = -1000;
const int KODayMatrix::NUMDAYS = 42;
KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
- : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 )
+ : Q3Frame( parent, name , Qt::WNoAutoErase ), mCalendar( 0 )
{
mLastView = -1;
oldW = 0;
oldH = 0;
myPix.resize( 150, 120 );
mRedrawNeeded = true;
mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
mPendingUpdateBeforeRepaint = false;
mouseDown = false;
// initialize dynamic arrays
bDays.resize ( NUMDAYS );
pDays.resize ( NUMDAYS );
hDays.resize ( NUMDAYS );
eDays.resize ( NUMDAYS );
days = new QDate[NUMDAYS];
daylbls = new QString[NUMDAYS];
//events = new int[NUMDAYS];
mToolTip = new DynamicTip(this);
// set default values used for drawing the matrix
mDefaultBackColor = palette().active().base();
mDefaultTextColor = palette().active().foreground();
mDefaultTextColorShaded = getShadedColor(mDefaultTextColor);
mHolidayColorShaded = getShadedColor(KOPrefs::instance()->mHolidayColor);
mSelectedDaysColor = QColor("white");
mTodayMarginWidth = 2;
mSelEnd = mSelStart = NOSELECTION;
setAcceptDrops(true);
//setFont( QFont("Arial", 10) );
mUpdateTimer = new QTimer( this );
connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() ));
mRepaintTimer = new QTimer( this );
connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() ));
mDayChanged = false;
updateView();
}
QString KODayMatrix::getWhatsThisText( QPoint p )
{
int tmp = getDayIndexFrom(p.x(), p.y());
if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar )
return QString();
QDate mDate = days[tmp];
- QPtrList<Event> eventlist = mCalendar->events(mDate);
+ Q3PtrList<Event> eventlist = mCalendar->events(mDate);
Event *event;
QStringList mToolTip;
for(event=eventlist.first();event != 0;event=eventlist.next()) {
QString mToolTipText;
QString text;
int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
if (event->isMultiDay()) {
QString prefix = "<->";multiday = 2;
QString time;
if ( event->doesRecur() ) {
if ( event->recursOn( mDate) ) {
prefix ="->" ;multiday = 1;
}
else {
int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
if ( event->recursOn( mDate.addDays( -days)) ) {
prefix ="<-" ;multiday = 3;
}
}
} else {
if (mDate == event->dtStart().date()) {
prefix ="->" ;multiday = 1;
} else if (mDate == event->dtEnd().date()) {
prefix ="<-" ;multiday = 3;
@@ -184,64 +193,64 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
else if ( mDate == event->dtEnd().date () )
time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
}
text = time + event->summary();
mToolTipText += prefix + text;
} else {
if (event->doesFloat()) {
text = event->summary();
mToolTipText += text;
}
else {
text = KGlobal::locale()->formatTime(event->dtStart().time());
text += " " + event->summary();
mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
}
}
if ( !event->location().isEmpty() )
mToolTipText += " (" + event->location() + ")";
//qDebug("TTT: %s ", mToolTipText.latin1());
mToolTip.append( deTag( mToolTipText ) );
}
mToolTip.sort();
if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
- QPtrList<Todo> todolist = mCalendar->todos(mDate);
+ Q3PtrList<Todo> todolist = mCalendar->todos(mDate);
Todo *todo;
for(todo=todolist.first();todo != 0;todo=todolist.next()) {
QString mToolTipText;
if ( !todo->doesFloat() )
mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" ";
mToolTipText += todo->summary();
if ( !todo->location().isEmpty() )
mToolTipText += " (" + todo->location() + ")";
mToolTipText = deTag( mToolTipText);
mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText;
mToolTip.append( mToolTipText );
}
}
if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
- QPtrList<Journal> j_list = mCalendar->journals4Date( mDate );
+ Q3PtrList<Journal> j_list = mCalendar->journals4Date( mDate );
Journal *j = j_list.first();
while ( j ) {
QString mToolTipText;
if ( !j->summary().isEmpty() ) {
mToolTipText = j->summary().left(30);
if ( j->summary().length() > 30 )
mToolTipText += " ...";
} else {
mToolTipText = j->description().left(25);
if ( j->description().length() > 25 )
mToolTipText += " ...";
mToolTipText = deTag( mToolTipText);
}
mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText;
mToolTip.append( mToolTipText );
j = j_list.next();
}
}
return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>");
}
QString KODayMatrix::deTag( QString mToolTipText )
{
@@ -420,49 +429,49 @@ void KODayMatrix::computeEvent(Event *event, int i )
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += i18n("Birthday") + ": "+event->summary();
if ( !event->location().isEmpty() )
holiStr += " (" + event->location() + ")";
bDays.setBit(i);
mHolidays[i] =holiStr ;
}
}
if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW )
eDays.setBit(i);
}
void KODayMatrix::updateViewTimed()
{
mUpdateTimer->stop();
if ( !mCalendar ) {
qDebug("NOT CAL ");
return;
}
#if 1
int i;
int timeSpan = NUMDAYS-1;
- QPtrList<Event> events = mCalendar->events();
+ Q3PtrList<Event> events = mCalendar->events();
Event *event;
QDateTime dt;
bool ok;
bDays.fill( false);
pDays.fill( false);
hDays.fill( false);
eDays.fill( false);
mHolidays.clear();
QDate mStartDate = days[0];
QDate endDate = mStartDate.addDays( timeSpan );
for( event = events.first(); event; event = events.next() ) { // for event
ushort recurType = event->doesRecur();
if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
(recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
continue;
}
if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
continue;
}
if ( event->doesRecur() ) {
bool last;
QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
QDateTime incidenceEnd;
int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
@@ -505,98 +514,98 @@ void KODayMatrix::updateViewTimed()
int st = event->dtStart().date().daysTo( endDate );
if ( st >= 0 ) { // start before timeend
int end = mStartDate.daysTo( event->dtEnd().date() );
if ( end >= 0 ) { // end after timestart --- got one!
//normalize
st = timeSpan - st;
if ( st < 0 ) st = 0;
if ( end > timeSpan ) end = timeSpan;
int iii;
for ( iii = st;iii<= end;++iii)
computeEvent( event, iii );
}
}
}
}
int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday
for(i = 0; i < NUMDAYS; i++) {
if ( ( (i+startDay) % 7 == 0 ) ) {
pDays.setBit(i);
}
}
if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
bDays.fill( false);
// insert due todos
- QPtrList<Todo> todos = mCalendar->todos( );
+ Q3PtrList<Todo> todos = mCalendar->todos( );
Todo *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
//insertTodo( todo );
if ( todo->hasDueDate() ) {
int day = mStartDate.daysTo( todo->dtDue().date() );
if ( day >= 0 && day < timeSpan + 1) {
int i = day;
QString holiStr = mHolidays[i];
pDays.setBit(i);
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += i18n("Todo") + ": "+todo->summary();
if ( !todo->location().isEmpty() )
holiStr += " (" + todo->location() + ")";
bDays.setBit(i);
mHolidays[i] =holiStr ;
eDays.setBit(i);
}
}
}
}
if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
bDays.fill( false);
// insert due todos
- QPtrList<Journal> todos = mCalendar->journals( );
+ Q3PtrList<Journal> todos = mCalendar->journals( );
Journal *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
int day = mStartDate.daysTo( todo->dtStart().date() );
if ( day >= 0 && day < timeSpan + 1) {
int i = day;
QString holiStr = mHolidays[i];
pDays.setBit(i);
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += i18n("Journal: ")+todo->summary().left(25);
if ( todo->summary().length() > 25 )
holiStr +="...";
bDays.setBit(i);
mHolidays[i] =holiStr ;
eDays.setBit(i);
}
}
}
#else
//qDebug("KODayMatrix::updateViewTimed ");
for(int i = 0; i < NUMDAYS; i++) {
// if events are set for the day then remember to draw it bold
- QPtrList<Event> eventlist = mCalendar->events(days[i]);
+ Q3PtrList<Event> eventlist = mCalendar->events(days[i]);
Event *event;
int numEvents = eventlist.count();
QString holiStr = "";
bDays.clearBit(i);
hDays.clearBit(i);
eDays.clearBit(i);
for(event=eventlist.first();event != 0;event=eventlist.next()) {
ushort recurType = event->recurrence()->doesRecur();
if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
(recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
numEvents--;
}
if ( event->isHoliday()) {
hDays.setBit(i);
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += event->summary();
if ( !event->location().isEmpty() )
holiStr += " (" + event->location() + ")";
}
if ( event->isBirthday()) {
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += i18n("Birthday") + ": "+event->summary();
@@ -654,49 +663,49 @@ void KODayMatrix::updateView(QDate actdate)
mDayChanged = true;
recalculateToday();
mRedrawNeeded = true;
}
//qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
if ( !isVisible() ) {
mPendingUpdateBeforeRepaint = true;
} else {
#ifdef DESKTOP_VERSION
//mRepaintTimer->start( 100 );
//updateViewTimed();
mUpdateTimer->start( 50 );
#else
mRepaintTimer->start( 250 );
mUpdateTimer->start( 500 );
#endif
}
}
void KODayMatrix::updateEvents()
{
if ( !mCalendar ) return;
for( int i = 0; i < NUMDAYS; i++ ) {
// if events are set for the day then remember to draw it bold
- QPtrList<Event> eventlist = mCalendar->events( days[ i ] );
+ Q3PtrList<Event> eventlist = mCalendar->events( days[ i ] );
int numEvents = eventlist.count();
Event *event;
for( event = eventlist.first(); event != 0;event=eventlist.next()) {
ushort recurType = event->doesRecur();
if ( ( recurType == Recurrence::rDaily &&
!KOPrefs::instance()->mDailyRecur ) ||
( recurType == Recurrence::rWeekly &&
!KOPrefs::instance()->mWeeklyRecur ) ) {
numEvents--;
}
if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
numEvents--;
}
}
if ( numEvents )
eDays.setBit(i);
else
eDays.clearBit(i);
}
}
const QDate& KODayMatrix::getDate(int offset)
{
@@ -718,62 +727,62 @@ QString KODayMatrix::getHolidayLabel(int offset)
int KODayMatrix::getDayIndexFrom(int x, int y)
{
int colModulo = (width()-2) % 7;
int rowModulo = (height()-2) % 6;
#if 0
return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ?
6 - x/daysize.width() : x/daysize.width());
#endif
int xVal = (x-colModulo/2-2)/daysize.width();
int yVal = (y-rowModulo/2-2)/daysize.height();
return 7*(yVal) + xVal;
}
// ----------------------------------------------------------------------------
// M O U S E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
void KODayMatrix::mousePressEvent (QMouseEvent* e)
{
- if ( e->button() == LeftButton )
+ if ( e->button() == Qt::LeftButton )
mouseDown = true;
mSelStart = getDayIndexFrom(e->x(), e->y());
if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1;
mSelInit = mSelStart;
mSelEnd = mSelStart;
mRedrawNeeded = true;
repaint(false);
}
void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
{
mRedrawNeeded = true;
- if ( e->button() == LeftButton )
+ if ( e->button() == Qt::LeftButton )
if ( ! mouseDown ) {
return;
}
else
mouseDown = false;
int tmp = getDayIndexFrom(e->x(), e->y());
if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
if (mSelInit > tmp) {
mSelEnd = mSelInit;
if (tmp != mSelStart) {
mSelStart = tmp;
repaint(false);
}
} else {
mSelStart = mSelInit;
//repaint only if selection has changed
if (tmp != mSelEnd) {
mSelEnd = tmp;
repaint(false);
}
}
@@ -1174,50 +1183,50 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
//qDebug("add %d %d -- %d %d ", col, addCol, row, addRow);
++addCol;//++addCol;
if ( row == 0)
addRow = 1;
p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight,
Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]);
// reset color to actual color
if (pDays.testBit(i)) {
p.setPen(actcol);
}
// reset bold font to plain font
if ( eDays.testBit(i)) {
QFont myFont = font();
myFont.setBold(false);
p.setFont(myFont);
}
}
p.setPen(mDefaultTextColor);
p.drawRect(0, 0, width(), height());
} else {
//qDebug("NO redraw ");
}
- bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP);
+ bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,QPainter::CompositionMode_Source);
mRedrawNeeded = false;
}
// ----------------------------------------------------------------------------
// R E SI Z E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
void KODayMatrix::resizeEvent(QResizeEvent * e)
{
QRect sz = frameRect();
daysize.setHeight(sz.height()*7 / NUMDAYS);
daysize.setWidth(sz.width() / 7);
- QFrame::resizeEvent( e );
+ Q3Frame::resizeEvent( e );
}
QSize KODayMatrix::sizeHint() const
{
QFontMetrics fm ( font() );
int wid = fm.width( "30") *7+3;
int hei = fm.height() * 6+3;
//qDebug("KODayMatrix::sizeHint()********************* %d %d", wid , hei);
return QSize ( wid, hei );
}
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index b96e08f..6edf7cd 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -5,74 +5,82 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KODAYMAT_H
#define _KODAYMAT_H
#include <libkcal/calendar.h>
#include <qstring.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qcolor.h>
#include <qpen.h>
#include <qdatetime.h>
#include <qtooltip.h>
#include <qpixmap.h>
#include <qbitarray.h>
#include <qmap.h>
+//Added by qt3to4:
+#include <QDragMoveEvent>
+#include <QDropEvent>
+#include <QDragLeaveEvent>
+#include <QPaintEvent>
+#include <QResizeEvent>
+#include <QMouseEvent>
+#include <QDragEnterEvent>
class QDragEnterEvent;
class QDragMoveEvent;
class QDragLeaveEvent;
class QDropEvent;
class KODayMatrix;
class KODaymatrixWhatsThis;
using namespace KCal;
/**
* small helper class to dynamically show tooltips inside the day matrix.
* This class asks the day matrix object for a appropriate label which
* is in our special case the name of the holiday or null if this day is no holiday.
*/
-class DynamicTip : public QToolTip
+class DynamicTip /* TODO:hacker: : public QToolTip */
{
public:
/**
* Constructor that expects a KODayMatrix object as parent.
*
* @param parent the parent KODayMatrix control.
*/
DynamicTip(QWidget* parent );
protected:
/**
* Qt's callback to ask the object to provide an approrpiate text for the
* tooltip to be shown.
*
* @param pos coordinates of the mouse.
*/
void maybeTip( const QPoint & pos);
private:
/** the parent control this tooltip is designed for. */
KODayMatrix* matrix;
@@ -82,49 +90,49 @@ private:
* replacement for kdpdatebuton.cpp that used 42 widgets for the day matrix to be displayed.
* Cornelius thought this was a waste of memory and a lot of overhead.
* In addition the selection was not very intuitive so I decided to rewrite it using a QFrame
* that draws the labels and allows for dragging selection while maintaining nearly full
* compatibility in behaviour with its predecessor.
*
* The following functionality has been changed:
*
* o when shifting events in the agenda view from one day to another the day matrix is updated now
* o TODO ET dragging an event to the matrix will MOVE not COPY the event to the new date.
* o no support for Ctrl+click to create groups of dates
* (This has not really been supported in the predecessor. It was not very intuitive nor was it
* user friendly.)
* This feature has been replaced with dragging a selection on the matrix. The matrix will
* automatically choose the appropriate selection (e.g. you are not any longer able to select
* two distinct groups of date selections as in the old class)
* o now that you can select more then a week it can happen that not all selected days are
* displayed in the matrix. However this is preferred to the alternative which would mean to
* adjust the selection and leave some days undisplayed while scrolling through the months
*
* @short day matrix widget of the KDateNavigator
*
* @author Eitzenberger Thomas
*/
-class KODayMatrix: public QFrame {
+class KODayMatrix: public Q3Frame {
Q_OBJECT
public:
/** constructor to create a day matrix widget.
*
* @param parent widget that is the parent of the day matrix. Normally this should
* be a KDateNavigator
* @param calendar instance of a calendar on which all calculations are based
* @param date start date of the matrix (is expected to be already fixed). It is
* assumed that this date is the first week day to be shown in the matrix.
* @param name name of the widget
*/
KODayMatrix( QWidget *parent, const char *name );
//KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name );
/** destructor that deallocates all dynamically allocated private members.
*/
~KODayMatrix();
/** updates the day matrix to start with the given date. Does all the necessary
* checks for holidays or events on a day and stores them for display later on.
* Does NOT update the view visually. Call repaint() for this.
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index ea30fac..deb1e46 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -20,48 +20,50 @@
*/
#include <libkdepim/categoryeditdialog.h>
#include "calendarview.h"
#include "incomingdialog.h"
#include "outgoingdialog.h"
#include "koprefsdialog.h"
#include "koeventeditor.h"
#include "koprefs.h"
#include "datenavigator.h"
#include "kotodoeditor.h"
#include "searchdialog.h"
#include "filtereditdialog.h"
#ifndef KORG_NOPLUGINS
#include "plugindialog.h"
#endif
#ifndef KORG_NOARCHIVE
#include "archivedialog.h"
#endif
#include "kconfig.h"
#include "kodialogmanager.h"
#include <kapplication.h>
+//Added by qt3to4:
+#include <Q3PtrList>
KODialogManager::KODialogManager( CalendarView *mainView ) :
QObject(), mMainView( mainView )
{
mOutgoingDialog = 0;
mIncomingDialog = 0;
mOptionsDialog = 0;
mSearchDialog = 0;
mArchiveDialog = 0;
mFilterEditDialog = 0;
mPluginDialog = 0;
// mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView);
//KOGlobals::fitDialogToScreen( mCategoryEditDialog );
}
KODialogManager::~KODialogManager()
{
delete mOutgoingDialog;
delete mIncomingDialog;
delete mOptionsDialog;
delete mSearchDialog;
#ifndef KORG_NOARCHIVE
delete mArchiveDialog;
@@ -167,50 +169,50 @@ void KODialogManager::showCategoryEditDialog()
void KODialogManager::hideSearchDialog()
{
if (mSearchDialog)
mSearchDialog->hide();
}
void KODialogManager::showSearchDialog()
{
if (!mSearchDialog) {
mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView);
KOListView * lview = mSearchDialog->listview();
connect(lview, SIGNAL(showIncidenceSignal(Incidence *)),
mMainView, SLOT(showIncidence(Incidence *)));
connect(lview, SIGNAL(editIncidenceSignal(Incidence *)),
mMainView, SLOT(editIncidence(Incidence *)));
connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)),
mMainView, SLOT(deleteIncidence(Incidence *)));
connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)),
mMainView, SLOT(cloneIncidence(Incidence *)));
connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)),
mMainView, SLOT(beamIncidence(Incidence *)));
connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)),
mMainView, SLOT(moveIncidence(Incidence *)));
- connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )),
- mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> )));
+ connect(lview, SIGNAL(beamIncidenceList(Q3PtrList<Incidence> )),
+ mMainView, SLOT(beamIncidenceList(Q3PtrList<Incidence> )));
connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig()));
connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList()));
// connect( lview, SIGNAL( incidenceSelected( Incidence * ) ),
// mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
#ifndef DESKTOP_VERSION
mSearchDialog->setMaximumSize( QApplication::desktop()->size());
mSearchDialog->showMaximized();
#else
KConfig *config = KOGlobals::config();
config->setGroup("WidgetLayout");
QStringList list;
list = config->readListEntry("SearchLayout");
int x,y,w,h;
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
h = list[3].toInt();
KApplication::testCoords( &x,&y,&w,&h );
mSearchDialog->setGeometry(x,y,w,h);
}
@@ -225,49 +227,49 @@ void KODialogManager::showSearchDialog()
#endif
mSearchDialog->raiseAndSelect();
}
SearchDialog * KODialogManager::getSearchDialog()
{
return mSearchDialog;
}
void KODialogManager::showArchiveDialog()
{
#ifndef KORG_NOARCHIVE
if (!mArchiveDialog) {
mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView);
connect(mArchiveDialog,SIGNAL(eventsDeleted()),
mMainView,SLOT(updateView()));
}
mArchiveDialog->show();
mArchiveDialog->raise();
// Workaround.
QApplication::restoreOverrideCursor();
#endif
}
-void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters)
+void KODialogManager::showFilterEditDialog(Q3PtrList<CalFilter> *filters)
{
if (!mFilterEditDialog) {
mFilterEditDialog = new FilterEditDialog(filters,mMainView);
connect(mFilterEditDialog,SIGNAL(filterChanged()),
mMainView,SLOT(filterEdited()));
}
#ifndef DESKTOP_VERSION
mFilterEditDialog->showMaximized();
#else
mFilterEditDialog->show();
#endif
mFilterEditDialog->raise();
}
void KODialogManager::showPluginDialog()
{
#ifndef KORG_NOPLUGINS
if (!mPluginDialog) {
mPluginDialog = new PluginDialog(mMainView);
connect(mPluginDialog,SIGNAL(configChanged()),
mMainView,SLOT(updateConfig()));
}
diff --git a/korganizer/kodialogmanager.h b/korganizer/kodialogmanager.h
index b68ddc2..00ad1df 100644
--- a/korganizer/kodialogmanager.h
+++ b/korganizer/kodialogmanager.h
@@ -4,49 +4,49 @@
Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KODIALOGMANAGER_H
#define KODIALOGMANAGER_H
#include <qobject.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <libkcal/calfilter.h>
class CalendarView;
class OutgoingDialog;
class IncomingDialog;
class KOPrefsDialog;
//namespace KPIM { class CategoryEditDialog; }
class KOEventEditor;
class KOTodoEditor;
class SearchDialog;
class ArchiveDialog;
class PluginDialog;
class KConfig;
class FilterEditDialog;
using namespace KCal;
/**
This class manages the dialogs used by the calendar view. It owns the objects
and handles creation and selection.
*/
class KODialogManager : public QObject
{
@@ -57,45 +57,45 @@ class KODialogManager : public QObject
/** Get an editor dialog for an Event. */
KOEventEditor *getEventEditor();
/** Get an editor dialog for a Todo. */
KOTodoEditor *getTodoEditor();
OutgoingDialog *outgoingDialog();
IncomingDialog *incomingDialog();
void writeSettings( KConfig *config);
void updateSearchDialog();
SearchDialog * getSearchDialog();
void setDocumentId( const QString &id );
public slots:
void showOptionsDialog( bool showSync = false);
void showGlobalOptionsDialog(bool showSync = false);
void showSyncOptions();
void showIncomingDialog();
void showOutgoingDialog();
// void showCategoryEditDialog();
void showSearchDialog();
void showArchiveDialog();
- void showFilterEditDialog(QPtrList<CalFilter> *filters);
+ void showFilterEditDialog(Q3PtrList<CalFilter> *filters);
void showPluginDialog();
void hideSearchDialog();
private:
void createOutgoingDialog();
void createIncomingDialog();
CalendarView *mMainView;
OutgoingDialog *mOutgoingDialog;
IncomingDialog *mIncomingDialog;
KOPrefsDialog *mOptionsDialog;
// KPIM::CategoryEditDialog *mCategoryEditDialog;
SearchDialog *mSearchDialog;
ArchiveDialog *mArchiveDialog;
FilterEditDialog *mFilterEditDialog;
PluginDialog *mPluginDialog;
};
#endif
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index 9a4b4ec..a01c838 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -1,56 +1,62 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in thse hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qfiledialog.h>
+#include <q3filedialog.h>
#include <qlayout.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
-#include <qwidgetstack.h>
+#include <q3vbox.h>
+#include <q3buttongroup.h>
+#include <q3vgroupbox.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
-#include <qapp.h>
+#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <QLabel>
+#include <Q3PtrList>
+#include <Q3VBoxLayout>
#include <klocale.h>
#include <kglobal.h>
#include <kdialog.h>
#include <kiconloader.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
#include <kabc/addresseedialog.h>
#else //DESKTOP_VERSION
#include <externalapphandler.h>
#endif //DESKTOP_VERSION
#endif
#include <libkcal/incidence.h>
#include "koprefs.h"
#include "koeditordetails.h"
template <>
@@ -59,109 +65,109 @@ CustomListViewItem<Attendee *>::~CustomListViewItem()
delete mData;
}
template <>
void CustomListViewItem<Attendee *>::updateItem()
{
setText(0,mData->name());
setText(1,mData->email());
setText(2,mData->roleStr());
setText(3,mData->statusStr());
if (mData->RSVP() && !mData->email().isEmpty()) {
setPixmap(4,SmallIcon("mailappt"));
setSortKey(4,"j");
}
else {
setPixmap(4,SmallIcon("nomailappt"));
setSortKey(4,"n");
}
}
KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
: QWidget( parent, name), mDisableItemUpdate( false )
{
- QGridLayout *topLayout = new QGridLayout(this);
+ Q3GridLayout *topLayout = new Q3GridLayout(this);
topLayout->setSpacing(spacing);
topLayout->setMargin(KDialog::marginHint()-2);
QString organizer = KOPrefs::instance()->email();
mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
mListView = new KListView(this,"mListView");
mListView->addColumn(i18n("Name"),180);
mListView->addColumn(i18n("Email"),180);
mListView->addColumn(i18n("Role"),60);
mListView->addColumn(i18n("Status"),100);
mListView->addColumn(i18n("RSVP"),35);
if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) {
int hei = 80;
if ( QApplication::desktop()->height() <= 240 )
hei = 60;
mListView->setFixedHeight(hei);
}
mListView->setAllColumnsShowFocus (true );
//mListView->setSingleClick( true );
- connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
+ connect(mListView,SIGNAL(selectionChanged(Q3ListViewItem *)),
SLOT(updateAttendeeInput()));
- connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )),
- SLOT(itemClicked(QListViewItem * ,const QPoint& , int )));
+ connect(mListView,SIGNAL(executed(Q3ListViewItem * ,const QPoint&, int )),
+ SLOT(itemClicked(Q3ListViewItem * ,const QPoint& , int )));
mRsvpButton = new QCheckBox(this);
mRsvpButton->setText(i18n("Request response"));
mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
QLabel *attendeeLabel = new QLabel(this);
attendeeLabel->setText(i18n("Name:"));
attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
mNameEdit = new QLineEdit(this);
connect(mNameEdit,SIGNAL(textChanged(const QString &)),
SLOT(updateAttendeeItem()));
QLabel *emailLabel = new QLabel(this);
emailLabel->setText(i18n("Email:"));
mEmailEdit = new QLineEdit(this);
connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
SLOT(updateAttendeeItem()));
QLabel *attendeeRoleLabel = new QLabel(this);
attendeeRoleLabel->setText(i18n("Role:"));
mRoleCombo = new QComboBox(false,this);
mRoleCombo->insertStringList(Attendee::roleList());
connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
QLabel *statusLabel = new QLabel(this);
statusLabel->setText( i18n("Status:") );
mStatusCombo = new QComboBox(false,this);
mStatusCombo->insertStringList(Attendee::statusList());
connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
QWidget *buttonBox = new QWidget(this);
- QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox);
+ Q3VBoxLayout *buttonLayout = new Q3VBoxLayout(buttonBox);
QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
buttonLayout->addWidget(newButton);
connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
buttonLayout->addWidget(mRemoveButton);
connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
// buttonLayout->addWidget(mAddressBookButton);
connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
//mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
if ( QApplication::desktop()->height() <= 240 ) {
mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
topLayout->addMultiCellWidget(mListView,1,1,0,5);
topLayout->addWidget(attendeeLabel,3,0);
topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
topLayout->addWidget(emailLabel,4,0);
topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
topLayout->addWidget(attendeeRoleLabel,5,0);
topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
topLayout->addWidget(statusLabel,5,3);
@@ -344,137 +350,137 @@ void KOEditorDetails::insertAttendee(Attendee *a)
mListView->setSelected( item, true );
}
void KOEditorDetails::setDefaults()
{
mRsvpButton->setChecked(true);
mListView->clear();
mdelAttendees.clear();
clearAttendeeInput();
mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email()));
mNameEdit->setText("");
mUidEdit = "";
mEmailEdit->setText("");
mRoleCombo->setCurrentItem( 0 );
mStatusCombo->setCurrentItem( 0 );
}
void KOEditorDetails::readEvent(Incidence *event)
{
setDefaults();
//mListView->clear();
//mdelAttendees.clear();
- QPtrList<Attendee> tmpAList = event->attendees();
+ Q3PtrList<Attendee> tmpAList = event->attendees();
Attendee *a;
for (a = tmpAList.first(); a; a = tmpAList.next())
insertAttendee(new Attendee(*a));
mListView->setSelected( mListView->firstChild(), true );
mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer()));
}
void KOEditorDetails::writeEvent(Incidence *event)
{
event->clearAttendees();
- QListViewItem *item;
+ Q3ListViewItem *item;
AttendeeListItem *a;
for (item = mListView->firstChild(); item;
item = item->nextSibling()) {
a = (AttendeeListItem *)item;
event->addAttendee(new Attendee(*(a->data())));
}
event->setOrganizer(KOPrefs::instance()->email());
}
void KOEditorDetails::cancelAttendeeEvent(Incidence *event)
{
event->clearAttendees();
Attendee * att;
for (att=mdelAttendees.first();att;att=mdelAttendees.next()) {
event->addAttendee(new Attendee(*att));
}
mdelAttendees.clear();
}
bool KOEditorDetails::validateInput()
{
return true;
}
void KOEditorDetails::updateAttendeeInput()
{
- QListViewItem *item = mListView->selectedItem();
+ Q3ListViewItem *item = mListView->selectedItem();
AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
if (aItem) {
fillAttendeeInput( aItem );
} else {
clearAttendeeInput();
}
}
void KOEditorDetails::clearAttendeeInput()
{
mNameEdit->setText("");
mUidEdit = "";
mEmailEdit->setText("");
mRoleCombo->setCurrentItem(0);
mStatusCombo->setCurrentItem(0);
mRsvpButton->setChecked(true);
setEnabledAttendeeInput( false );
}
void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem )
{
Attendee *a = aItem->data();
mDisableItemUpdate = true;
mNameEdit->setText(a->name());
mUidEdit = a->uid();
mEmailEdit->setText(a->email());
mRoleCombo->setCurrentItem(a->role());
mStatusCombo->setCurrentItem(a->status());
mRsvpButton->setChecked(a->RSVP());
mDisableItemUpdate = false;
setEnabledAttendeeInput( true );
}
void KOEditorDetails::setEnabledAttendeeInput( bool enabled )
{
mNameEdit->setEnabled( enabled );
mEmailEdit->setEnabled( enabled );
mRoleCombo->setEnabled( enabled );
mStatusCombo->setEnabled( enabled );
mRsvpButton->setEnabled( enabled );
mRemoveButton->setEnabled( enabled );
}
-void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c )
+void KOEditorDetails::itemClicked(Q3ListViewItem * item ,const QPoint & pnt, int c )
{
if ( item && c == 4 ) {
mRsvpButton->setChecked( !mRsvpButton->isChecked() );
updateAttendeeItem();
}
}
void KOEditorDetails::updateAttendeeItem()
{
if (mDisableItemUpdate) return;
- QListViewItem *item = mListView->selectedItem();
+ Q3ListViewItem *item = mListView->selectedItem();
AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
if ( !aItem ) return;
Attendee *a = aItem->data();
a->setName( mNameEdit->text() );
a->setUid( mUidEdit );
a->setEmail( mEmailEdit->text() );
if ( mEmailEdit->text().isEmpty() )
mRsvpButton->setChecked( false );
a->setRSVP( mRsvpButton->isChecked() );
a->setRole( Attendee::Role( mRoleCombo->currentItem() ) );
a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) );
aItem->updateItem();
}
diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h
index 5f8f6f2..40e896c 100644
--- a/korganizer/koeditordetails.h
+++ b/korganizer/koeditordetails.h
@@ -3,107 +3,107 @@
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOEDITORDETAILS_H
#define _KOEDITORDETAILS_H
#include <qmap.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
-#include <qmultilineedit.h>
+#include <q3multilineedit.h>
#include <klistview.h>
#include <qradiobutton.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kapplication.h>
#include <libkcal/event.h>
#include "ktimeedit.h"
#include "customlistviewitem.h"
class KDateEdit;
using namespace KCal;
typedef CustomListViewItem<Attendee *> AttendeeListItem;
class KOEditorDetails : public QWidget
{
Q_OBJECT
public:
KOEditorDetails (int spacing = 8,QWidget* parent = 0, const char* name = 0);
virtual ~KOEditorDetails();
/** Set widgets to default values */
void setDefaults();
/** Read event object and setup widgets accordingly */
void readEvent(Incidence *);
/** Write event settings to event object */
void writeEvent(Incidence *);
/** return a clone of the event with attendees to be canceld*/
void cancelAttendeeEvent(Incidence *);
/** Check if the input is valid. */
bool validateInput();
public slots:
void insertAttendee(Attendee *);
// called when the app recieves a list of name/email/uid (=addresses) from another app. Usually Ka/Pi
// The first parameter is a uniqueid. It can be used to identify if event
void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist);
protected slots:
void addNewAttendee();
void removeAttendee();
void openAddressBook();
void updateAttendeeInput();
void clearAttendeeInput();
void fillAttendeeInput(AttendeeListItem *);
- void itemClicked(QListViewItem *,const QPoint & pnt, int c);
+ void itemClicked(Q3ListViewItem *,const QPoint & pnt, int c);
void updateAttendeeItem();
void setEnabledAttendeeInput(bool);
private:
bool mDisableItemUpdate;
QLineEdit *mNameEdit;
QString mUidEdit;
QLineEdit *mEmailEdit;
KListView *mListView;
QComboBox* mRoleCombo;
QCheckBox* mRsvpButton;
QComboBox* mStatusCombo;
QLabel *mOrganizerLabel;
QPushButton* mAddButton;
QPushButton* mRemoveButton;
QPushButton* mAddressBookButton;
- QPtrList<Attendee> mdelAttendees;
+ Q3PtrList<Attendee> mdelAttendees;
};
#endif
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 21f220c..8105432 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -3,96 +3,103 @@
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qwidget.h>
#include <qtooltip.h>
#include <qlayout.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
-#include <qwidgetstack.h>
+#include <q3vbox.h>
+#include <q3buttongroup.h>
+#include <q3vgroupbox.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
#include <qtimer.h>
#include <qfile.h>
#include <qregexp.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <QLabel>
+#include <Q3GridLayout>
+#include <Q3PtrList>
+#include <Q3PopupMenu>
+#include <QDesktopWidget>
#include <kglobal.h>
#include <kdialog.h>
#include <kdebug.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <kstandarddirs.h>
#include <libkcal/todo.h>
#include <libkcal/event.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkdepim/kdateedit.h>
#include "koprefs.h"
#include "koglobals.h"
#include "koeditorgeneral.h"
#include "kolocationbox.h"
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
QObject( parent, name)
{
mNextFocus = 0;
}
KOEditorGeneral::~KOEditorGeneral()
{
}
-void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneral::initHeader(QWidget *parent,Q3BoxLayout *topLayout)
{
- QGridLayout *headerLayout = new QGridLayout(topLayout);
+ Q3GridLayout *headerLayout = new Q3GridLayout(topLayout);
#if 0
mOwnerLabel = new QLabel(i18n("Owner:"),parent);
headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
#endif
// 1 on pda
// 11 on desktop
headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 );
QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
headerLayout->addWidget(summaryLabel,0,0);
mSummaryEdit = new KOLocationBox(TRUE,parent, 50);
mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
//mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) );
//qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() );
int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2;
if ( QApplication::desktop()->width() > 320 )
mSummaryEdit->setMaximumHeight( hei +6 );
//qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding );
// SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink }
// mSummaryEdit = new QLineEdit(parent);
if ( QApplication::desktop()->height() < 320 )
headerLayout->addWidget(mSummaryEdit,0,1);
else
@@ -174,99 +181,99 @@ void KOEditorGeneral::showCatPopup()
mCatPopup->insertItem (*it, index );
//mCategory[index] = *it;
if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true);
++index;
}
}
void KOEditorGeneral::selectedCatPopup( int index )
{
QStringList categories = QStringList::split (",", mCategoriesLabel->text());
QString colcat = categories.first();
if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ())
categories.remove (KOPrefs::instance()->mCustomCategories[index]);
else
categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
categories.sort ();
if ( !colcat.isEmpty() ) {
if ( categories.find ( colcat ) != categories.end () ) {
categories.remove( colcat );
categories.prepend( colcat );
}
}
setCategories( categories.join(",") );
}
-void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
+void KOEditorGeneral::initCategories(QWidget *parent, Q3BoxLayout *topLayout)
{
- QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
- mCatPopup = new QPopupMenu ( parent );
+ Q3BoxLayout *categoriesLayout = new Q3HBoxLayout( topLayout );
+ mCatPopup = new Q3PopupMenu ( parent );
mCatPopup->setCheckable (true);
connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
mCategoriesButton = new QPushButton(parent);
mCategoriesButton->setText(i18n("Categories..."));
connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
//connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
categoriesLayout->addWidget(mCategoriesButton);
mCategoriesLabel = new QPushButton(parent);//new QLabel(parent);
mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
mCategoriesLabel->setPopup( mCatPopup );
//mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
categoriesLayout->addWidget(mCategoriesLabel,1);
}
-void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
+void KOEditorGeneral::initSecrecy(QWidget *parent, Q3BoxLayout *topLayout)
{
- QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *secrecyLayout = new Q3HBoxLayout( topLayout );
QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
secrecyLayout->addWidget(mCancelBox);
secrecyLayout->addWidget(secrecyLabel);
mSecrecyCombo = new QComboBox(parent);
mSecrecyCombo->insertStringList(Incidence::secrecyList());
secrecyLayout->addWidget(mSecrecyCombo);
}
-void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneral::initDescription(QWidget *parent,Q3BoxLayout *topLayout)
{
mDescriptionEdit = new KTextEdit(parent);
mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
mDescriptionEdit->append("");
mDescriptionEdit->setReadOnly(false);
mDescriptionEdit->setOverwriteMode(false);
mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
topLayout->addWidget(mDescriptionEdit);
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold );
#endif
}
-void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneral::initAlarm(QWidget *parent,Q3BoxLayout *topLayout)
{
- QBoxLayout *alarmLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *alarmLayout = new Q3HBoxLayout(topLayout);
//mAlarmBell = new QLabel(parent);
//mAlarmBell->setPixmap(SmallIcon("bell"));
//alarmLayout->addWidget(mAlarmBell);
if ( QApplication::desktop()->width() < 320 )
mAlarmButton = new QCheckBox(i18n("Rem."),parent);
else
mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
alarmLayout->addWidget(mAlarmButton);
mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus );
alarmLayout->addWidget(mAlarmTimeEdit);
mAlarmIncrCombo = new QComboBox(false, parent);
if ( QApplication::desktop()->width() < 320 ) {
mAlarmIncrCombo->insertItem(i18n("min"));
mAlarmIncrCombo->insertItem(i18n("hou"));
mAlarmIncrCombo->insertItem(i18n("day"));
mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() );
mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() );
} else {
mAlarmIncrCombo->insertItem(i18n("minute(s)"));
@@ -507,49 +514,49 @@ void KOEditorGeneral::readIncidence(Incidence *event)
mOwnerLabel->setText(i18n("Owner: ") + event->organizer());
#endif
enableAlarmEdit( event->isAlarmEnabled() );
//qDebug("KOEditorGeneral::readIncidence(Incidence *event) ");
if(!event->isAlarmEnabled()) {
// TODO: Implement a KPrefsComboItem to solve this in a clean way.
int alarmTime;
int a[] = { 1,5,10,15,30,60,180, 1440 };
int index = KOPrefs::instance()->mAlarmTime;
if (index < 0 || index > 7) {
alarmTime = 15;
} else {
alarmTime = a[index];
}
mAlarmTimeEdit->setValue(alarmTime);
}
mAlarmButton->setChecked( event->isAlarmEnabled() );
mSecrecyCombo->setCurrentItem(event->secrecy());
mCancelBox->setChecked( event->cancelled() );
mAlarmProgramButton->setOn(false);
mAlarmSoundButton->setOn(false);
// set up alarm stuff
- QPtrList<Alarm> alarms = event->alarms();
+ Q3PtrList<Alarm> alarms = event->alarms();
Alarm* alarm;
mAlarmIncrCombo->setCurrentItem(0);
for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) {
int offset;
if ( alarm->hasTime() ) {
QDateTime t = alarm->time();
offset = event->dtStart().secsTo( t );
} else {
offset = alarm->startOffset().asSeconds();
}
if ( offset != 0 ) {
offset = offset / -60; // make minutes
if (offset % 60 == 0) { // divides evenly into hours?
offset = offset / 60;
mAlarmIncrCombo->setCurrentItem(1);
if (offset % 24 == 0) { // divides evenly into days?
offset = offset / 24;
mAlarmIncrCombo->setCurrentItem(2);
}
}
}
mAlarmTimeEdit->setValue( offset );
if (alarm->type() == Alarm::Procedure) {
@@ -569,49 +576,49 @@ void KOEditorGeneral::readIncidence(Incidence *event)
mAlarmButton->setChecked(alarm->enabled());
enableAlarmEdit( alarm->enabled() );
//qDebug("nableAlarmEdit( alarm->enabled() )********* ");
// TODO: Deal with multiple alarms
break; // For now, stop after the first alarm
}
setCategories(event->categoriesStr());
}
void KOEditorGeneral::writeIncidence(Incidence *event)
{
// kdDebug() << "KOEditorGeneral::writeEvent()" << endl;
mLocationEdit->save(KOLocationBox::LOCATION);
event->setSummary(mSummaryEdit->currentText());
event->setLocation(mLocationEdit->currentText());
event->setDescription(mDescriptionEdit->text());
event->setCategories(mCategoriesLabel->text());
event->setSecrecy(mSecrecyCombo->currentItem());
event->setCancelled(mCancelBox->isChecked() );;
// alarm stuff
if (mAlarmButton->isChecked()) {
if (event->alarms().count() == 0)
event->newAlarm();
- QPtrList<Alarm> alarms = event->alarms();
+ Q3PtrList<Alarm> alarms = event->alarms();
Alarm *alarm;
for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
alarm->setEnabled(true);
int j = mAlarmTimeEdit->value()* -60;
if (mAlarmIncrCombo->currentItem() == 1)
j = j * 60;
else if (mAlarmIncrCombo->currentItem() == 2)
j = j * (60 * 24);
alarm->setStartOffset( j );
if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) {
alarm->setProcedureAlarm(mAlarmProgram);
}
else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
alarm->setAudioAlarm(mAlarmSound);
else
alarm->setType(Alarm::Invalid);
//alarm->setAudioAlarm("default");
// TODO: Deal with multiple alarms
break; // For now, stop after the first alarm
}
} else {
Alarm* alarm = event->alarms().first();
if ( alarm ) {
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h
index b10a5d4..45f26fd 100644
--- a/korganizer/koeditorgeneral.h
+++ b/korganizer/koeditorgeneral.h
@@ -2,85 +2,86 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOEDITORGENERAL_H
#define KOEDITORGENERAL_H
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
-#include <qpopupmenu.h>
-#include <qgroupbox.h>
+#include <q3popupmenu.h>
+#include <q3groupbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
-#include <qlistview.h>
+#include <q3listview.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qspinbox.h>
#include <qcombobox.h>
+#include <Q3BoxLayout>
#include <ktextedit.h>
#include <krestrictedline.h>
#include <libkcal/incidence.h>
#include "ktimeedit.h"
class KDateEdit;
class KOLocationBox;
using namespace KCal;
class KOEditorGeneral : public QObject
{
Q_OBJECT
public:
KOEditorGeneral (QObject* parent=0,const char* name=0);
virtual ~KOEditorGeneral();
void setFocusOn( int i );
- void initHeader(QWidget *,QBoxLayout *);
- void initDescription(QWidget *,QBoxLayout *);
- void initSecrecy(QWidget *,QBoxLayout *);
- void initCategories(QWidget *,QBoxLayout *);
- void initAlarm(QWidget *,QBoxLayout *);
+ void initHeader(QWidget *,Q3BoxLayout *);
+ void initDescription(QWidget *,Q3BoxLayout *);
+ void initSecrecy(QWidget *,Q3BoxLayout *);
+ void initCategories(QWidget *,Q3BoxLayout *);
+ void initAlarm(QWidget *,Q3BoxLayout *);
/** Set widgets to default values */
void setDefaults(bool allDay);
/** Read event object and setup widgets accordingly */
void readIncidence(Incidence *);
/** Write event settings to event object */
void writeIncidence(Incidence *);
/** Check if the input is valid. */
bool validateInput() { return true; }
void enableAlarm( bool enable );
void setSecrecy( int num );
int getCalendarID();
public slots:
void setCategories(const QString &);
void editCategories();
protected slots:
void enableAlarmEdit( bool enable );
void disableAlarmEdit( bool disable );
void alarmDisable( bool disable );
void pickAlarmSound();
void pickAlarmProgram();
@@ -94,32 +95,32 @@ class KOEditorGeneral : public QObject
void dateTimesChanged(QDateTime,QDateTime);
protected:
void fillCalCombo( int setToID = 0 );
int mNextFocus;
//QLineEdit *mSummaryEdit;
//QLineEdit *mLocationEdit;
KOLocationBox *mSummaryEdit;
KOLocationBox *mLocationEdit;
QComboBox *mCalendarBox;
QLabel *mAlarmBell;
QCheckBox *mAlarmButton;
QSpinBox *mAlarmTimeEdit;
QPushButton *mAlarmSoundButton;
QPushButton *mAlarmProgramButton;
QComboBox *mAlarmIncrCombo;
KTextEdit *mDescriptionEdit;
QLabel *mOwnerLabel;
QComboBox *mSecrecyCombo;
QCheckBox *mCancelBox;
QPushButton *mCategoriesButton;
QPushButton *mCategoriesLabel;
private:
- QPopupMenu * mCatPopup;
+ Q3PopupMenu * mCatPopup;
QString getFittingPath( const QString &) ;
QString mAlarmSound;
QString mAlarmProgram;
QString mAlarmMessage;
};
#endif
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp
index 2c6ed9f..73a4139 100644
--- a/korganizer/koeditorgeneralevent.cpp
+++ b/korganizer/koeditorgeneralevent.cpp
@@ -2,53 +2,59 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
#include <qlayout.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
-#include <qwidgetstack.h>
+#include <q3vbox.h>
+#include <q3buttongroup.h>
+#include <q3vgroupbox.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3GridLayout>
+#include <Q3Frame>
+#include <QLabel>
+#include <Q3VBoxLayout>
#include <kdebug.h>
#include <kglobal.h>
#include <kdialog.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <kstandarddirs.h>
#include <libkcal/event.h>
#include <libkdepim/kdateedit.h>
#include "koprefs.h"
#include "koeditorgeneralevent.h"
#include "kolocationbox.h"
KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent,
const char* name) :
KOEditorGeneral( parent, name)
{
mTemplate = false;
@@ -63,114 +69,114 @@ KOEditorGeneralEvent::~KOEditorGeneralEvent()
}
void KOEditorGeneralEvent::finishSetup()
{
//disabled
// QWidget::setTabOrder( mSummaryEdit, mLocationEdit );
// QWidget::setTabOrder( mLocationEdit, mStartDateEdit );
// QWidget::setTabOrder( mStartDateEdit, mStartTimeEdit );
// QWidget::setTabOrder( mStartTimeEdit, mEndDateEdit );
// QWidget::setTabOrder( mEndDateEdit, mEndTimeEdit );
// QWidget::setTabOrder( mEndTimeEdit, mNoTimeButton );
// QWidget::setTabOrder( mNoTimeButton, mAlarmButton );
// QWidget::setTabOrder( mAlarmButton, mAlarmTimeEdit );
// QWidget::setTabOrder( mFreeTimeCombo, mCategoriesButton );
// QWidget::setTabOrder( mCategoriesButton, mSecrecyCombo );
// QWidget::setTabOrder( mSecrecyCombo, mDescriptionEdit );
mSummaryEdit->load(KOLocationBox::SUMMARYEVENT);
mSummaryEdit->setFocus();
}
-void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneralEvent::initTime(QWidget *parent,Q3BoxLayout *topLayout)
{
- QBoxLayout *timeLayout = new QVBoxLayout(topLayout);
+ Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout);
- QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal,
+ Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal,
i18n("Date && Time"),parent);
timeLayout->addWidget(timeGroupBox);
timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() );
timeGroupBox->layout()->setMargin( KDialog::marginHint() );
- QFrame *timeBoxFrame = new QFrame(timeGroupBox);
+ Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox);
- QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3);
+ Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,2,3);
layoutTimeBox->setSpacing(topLayout->spacing());
mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame);
layoutTimeBox->addWidget(mStartDateLabel,0,0);
mStartDateEdit = new KDateEdit(timeBoxFrame);
layoutTimeBox->addWidget(mStartDateEdit,0,1);
mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
layoutTimeBox->addWidget(mStartTimeEdit,0,2);
mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame);
layoutTimeBox->addWidget(mEndDateLabel,1,0);
mEndDateEdit = new KDateEdit(timeBoxFrame);
layoutTimeBox->addWidget(mEndDateEdit,1,1);
mEndTimeEdit = new KOTimeEdit(timeBoxFrame);
layoutTimeBox->addWidget(mEndTimeEdit,1,2);
QWidget* duration = new QWidget( timeBoxFrame );
- QHBoxLayout *flagsBox = new QHBoxLayout( duration );
+ Q3HBoxLayout *flagsBox = new Q3HBoxLayout( duration );
mNoTimeButton = new QCheckBox(i18n("All day event"),duration);
flagsBox->addWidget(mNoTimeButton);
connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool)));
mDurationLabel = new QLabel( duration );
// if ( KOPrefs::instance()->mCompactDialogs ) {
//layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 );
//} else {
flagsBox->addWidget( mDurationLabel );
//}
flagsBox->setStretchFactor(mDurationLabel, 10 );
- mDurationLabel->setAlignment( AlignRight | AlignVCenter);
+ mDurationLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter);
layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 );
// time widgets are checked if they contain a valid time
connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)),
this, SLOT(startTimeChanged(QTime)));
connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)),
this, SLOT(endTimeChanged(QTime)));
// date widgets are checked if they contain a valid date
connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
this, SLOT(startDateChanged(QDate)));
connect(mEndDateEdit, SIGNAL(dateChanged(QDate)),
this, SLOT(endDateChanged(QDate)));
connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime)));
connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime)));
}
-void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneralEvent::initClass(QWidget *parent,Q3BoxLayout *topLayout)
{
- QBoxLayout *classLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *classLayout = new Q3HBoxLayout(topLayout);
QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent);
classLayout->addWidget(freeTimeLabel);
mFreeTimeCombo = new QComboBox(false, parent);
mFreeTimeCombo->insertItem(i18n("Busy"));
mFreeTimeCombo->insertItem(i18n("Free"));
classLayout->addWidget(mFreeTimeCombo);
}
void KOEditorGeneralEvent::timeStuffDisable(bool disable)
{
mStartTimeEdit->setEnabled( !disable );
mEndTimeEdit->setEnabled( !disable );
setDuration();
emitDateTimeStr();
}
void KOEditorGeneralEvent::dontAssociateTime(bool noTime)
{
timeStuffDisable(noTime);
//if(alarmButton->isChecked()) alarmStuffDisable(noTime);
allDayChanged(noTime);
diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h
index d798905..5d97a5c 100644
--- a/korganizer/koeditorgeneralevent.h
+++ b/korganizer/koeditorgeneralevent.h
@@ -2,78 +2,78 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOEDITORGENERALEVENT_H
#define _KOEDITORGENERALEVENT_H
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
-#include <qmultilineedit.h>
-#include <qlistview.h>
+#include <q3multilineedit.h>
+#include <q3listview.h>
#include <qradiobutton.h>
#include <krestrictedline.h>
#include "koeditorgeneral.h"
#include "ktimeedit.h"
class KDateEdit;
using namespace KCal;
class KOEditorGeneralEvent : public KOEditorGeneral
{
Q_OBJECT
public:
KOEditorGeneralEvent (QObject* parent=0,const char* name=0);
virtual ~KOEditorGeneralEvent();
- void initTime(QWidget *,QBoxLayout *);
- void initClass(QWidget *,QBoxLayout *);
+ void initTime(QWidget *,Q3BoxLayout *);
+ void initClass(QWidget *,Q3BoxLayout *);
void finishSetup();
/** Set widgets to default values */
void setDefaults(QDateTime from,QDateTime to,bool allDay);
/**
Read event object and setup widgets accordingly. If templ is true, the
event is read as template, i.e. the time and date information isn't set.
*/
void readEvent( Event *, bool tmpl = false );
/** Write event settings to event object */
void writeEvent(Event *);
/** Check if the input is valid. */
bool validateInput();
public slots:
void setDateTimes(QDateTime start, QDateTime end);
void setDuration();
protected slots:
void timeStuffDisable(bool disable);
void dontAssociateTime(bool noTime);
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index d32d5a5..baee9fc 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -1,56 +1,63 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qfiledialog.h>
+#include <q3filedialog.h>
#include <qlayout.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
-#include <qwidgetstack.h>
+#include <q3vbox.h>
+#include <q3buttongroup.h>
+#include <q3vgroupbox.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3GridLayout>
+#include <Q3Frame>
+#include <QLabel>
+#include <Q3VBoxLayout>
#include <kglobal.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <krestrictedline.h>
#include <kstandarddirs.h>
#include <kfiledialog.h>
#include <kdialog.h>
#include <libkcal/todo.h>
#include <libkdepim/kdateedit.h>
#include "koprefs.h"
#include "ktimeedit.h"
#include "koeditorgeneraltodo.h"
#include "kolocationbox.h"
KOEditorGeneralTodo::KOEditorGeneralTodo(QObject* parent,
const char* name)
: KOEditorGeneral( parent, name)
@@ -61,158 +68,158 @@ KOEditorGeneralTodo::~KOEditorGeneralTodo()
{
}
void KOEditorGeneralTodo::finishSetup()
{
// QWidget::setTabOrder(mSummaryEdit, mLocationEdit);
// QWidget::setTabOrder(mLocationEdit, mDueCheck);
// QWidget::setTabOrder(mDueCheck, mDueDateEdit);
// QWidget::setTabOrder(mDueDateEdit, mDueTimeEdit);
// QWidget::setTabOrder(mDueTimeEdit, mStartCheck);
// QWidget::setTabOrder(mStartCheck, mStartDateEdit);
// QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit);
// QWidget::setTabOrder(mStartTimeEdit, mTimeButton);
// QWidget::setTabOrder(mTimeButton, mCompletedCombo);
// QWidget::setTabOrder(mCompletedCombo, mPriorityCombo);
// QWidget::setTabOrder(mPriorityCombo, mAlarmButton);
// QWidget::setTabOrder(mAlarmButton, mCategoriesButton);
// QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo);
// QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit);
mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
mSummaryEdit->setFocus();
}
-void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initTime(QWidget *parent,Q3BoxLayout *topLayout)
{
- QBoxLayout *timeLayout = new QVBoxLayout(topLayout);
+ Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout);
- QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal,
+ Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal,
i18n("Date && Time"),parent);
timeLayout->addWidget(timeGroupBox);
timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 );
timeGroupBox->layout()->setMargin( KDialog::marginHint() );
- QFrame *timeBoxFrame = new QFrame(timeGroupBox);
+ Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox);
- QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3);
+ Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,3,3);
layoutTimeBox->setSpacing(KDialog::spacingHintSmall());
layoutTimeBox->setColStretch( 1, 1 );
mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame);
layoutTimeBox->addWidget(mStartCheck,0,0);
connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool)));
mStartDateEdit = new KDateEdit(timeBoxFrame);
layoutTimeBox->addWidget(mStartDateEdit,0,1);
mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
layoutTimeBox->addWidget(mStartTimeEdit,0,2);
mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame);
layoutTimeBox->addWidget(mDueCheck,1,0);
connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool)));
connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm()));
mDueDateEdit = new KDateEdit(timeBoxFrame);
layoutTimeBox->addWidget(mDueDateEdit,1,1);
mDueTimeEdit = new KOTimeEdit(timeBoxFrame);
layoutTimeBox->addWidget(mDueTimeEdit,1,2);
mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame);
layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1);
connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool)));
connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime)));
connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime)));
connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
this, SLOT(startDateChanged(QDate)));
// some more layouting
//layoutTimeBox->setColStretch(3,1);
}
-void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initCompletion(QWidget *parent, Q3BoxLayout *topLayout)
{
mCompletedCombo = new QComboBox(parent);
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 0 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 20 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 40 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 60 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 80 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n("100 %"));
connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int)));
topLayout->addWidget(mCompletedCombo);
mCompletedLabel = new QLabel(i18n("completed"),parent);
topLayout->addWidget(mCompletedLabel);
mCompleteDateEdit = new KDateEdit(parent);
topLayout->addWidget(mCompleteDateEdit );
mCompleteTimeEdit = new KOTimeEdit(parent);
topLayout->addWidget( mCompleteTimeEdit);
mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) );
mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime)));
if ( QApplication::desktop()->width() <= 480 ) {
if ( QApplication::desktop()->width() < 320 )
mCompleteDateEdit->setMaximumWidth( 85 );
else
mCompleteDateEdit->setMaximumWidth( 140 );
topLayout->setSpacing( 0 );
}
}
-void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initPriority(QWidget *parent, Q3BoxLayout *topLayout)
{
- QHBox* h = new QHBox ( parent );
+ Q3HBox* h = new Q3HBox ( parent );
topLayout->addWidget( h );
QLabel *priorityLabel = new QLabel(i18n("Priority:"), h);
// topLayout->addWidget(priorityLabel);
mPriorityCombo = new QComboBox( h );
mPriorityCombo->insertItem(i18n("1 (high)"));
mPriorityCombo->insertItem(i18n("2"));
mPriorityCombo->insertItem(i18n("3"));
mPriorityCombo->insertItem(i18n("4"));
mPriorityCombo->insertItem(i18n("5 (low)"));
//topLayout->addWidget(mPriorityCombo);
}
-void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initStatus(QWidget *parent,Q3BoxLayout *topLayout)
{
- QBoxLayout *statusLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *statusLayout = new Q3HBoxLayout(topLayout);
initCompletion( parent, statusLayout );
statusLayout->addStretch( 1 );
initPriority( parent, statusLayout );
}
void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
{
mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
mLocationEdit->load(KOLocationBox::LOCATION);
KOEditorGeneral::setDefaults(allDay);
mTimeButton->setChecked( !allDay );
mTimeButton->setEnabled( !allDay );
enableTimeEdits( !allDay );
if ( due.isValid() ) {
mDueCheck->setChecked(true);
enableDueEdit(true);
alarmDisable(false);
} else {
@@ -375,49 +382,49 @@ void KOEditorGeneralTodo::enableDueEdit(bool enable)
}
void KOEditorGeneralTodo::enableStartEdit( bool enable )
{
mStartDateEdit->setEnabled( enable );
if(mDueCheck->isChecked() || mStartCheck->isChecked()) {
mTimeButton->setEnabled(true);
}
else {
mTimeButton->setEnabled(false);
mTimeButton->setChecked(false);
}
if (enable) {
mStartTimeEdit->setEnabled( mTimeButton->isChecked() );
} else {
mStartTimeEdit->setEnabled( false );
}
emit datesChecked();
}
void KOEditorGeneralTodo::startDateChanged(QDate newdate)
{
if ( mDueCheck->isChecked() )
- emit dateTimesChanged(newdate,mDueDateEdit->date());
+ emit dateTimesChanged((QDateTime)newdate,(QDateTime)mDueDateEdit->date());
}
void KOEditorGeneralTodo::enableTimeEdits(bool enable)
{
if(mStartCheck->isChecked()) {
mStartTimeEdit->setEnabled( enable );
}
if(mDueCheck->isChecked()) {
mDueTimeEdit->setEnabled( enable );
}
}
void KOEditorGeneralTodo::showAlarm()
{
if ( mDueCheck->isChecked() ) {
alarmDisable(false);
}
else {
alarmDisable(true);
}
}
bool KOEditorGeneralTodo::validateInput()
{
if (mDueCheck->isChecked()) {
diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h
index 2e56a7a..2e97ff5 100644
--- a/korganizer/koeditorgeneraltodo.h
+++ b/korganizer/koeditorgeneraltodo.h
@@ -2,79 +2,79 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOEDITORGENERALTODO_H
#define _KOEDITORGENERALTODO_H
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
-#include <qmultilineedit.h>
-#include <qlistview.h>
+#include <q3multilineedit.h>
+#include <q3listview.h>
#include <qradiobutton.h>
#include "koeditorgeneral.h"
#include "koglobals.h"
class KRestrictedLine;
class KDateEdit;
using namespace KCal;
class KOEditorGeneralTodo : public KOEditorGeneral
{
Q_OBJECT
public:
KOEditorGeneralTodo (QObject* parent=0,const char* name=0);
virtual ~KOEditorGeneralTodo();
- void initTime(QWidget *, QBoxLayout *);
- void initStatus(QWidget *, QBoxLayout *);
- void initCompletion(QWidget *, QBoxLayout *);
- void initPriority(QWidget *, QBoxLayout *);
+ void initTime(QWidget *, Q3BoxLayout *);
+ void initStatus(QWidget *, Q3BoxLayout *);
+ void initCompletion(QWidget *, Q3BoxLayout *);
+ void initPriority(QWidget *, Q3BoxLayout *);
void finishSetup();
/** Set widgets to default values */
void setDefaults(QDateTime due,bool allDay);
/** Read todo object and setup widgets accordingly */
void readTodo(Todo *);
/** Write todo settings to event object */
void writeTodo(Todo *);
/** Check if the input is valid. */
bool validateInput();
/** The todo has been modified externally */
void modified (Todo*, int);
signals:
void openCategoryDialog();
void datesChecked();
protected slots:
void startDateChanged(QDate newdate);
void completedChanged(int);
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index e0380c4..e0ae3a0 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -1,216 +1,224 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000-2003 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qfiledialog.h>
+#include <q3filedialog.h>
#include <qlayout.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
-#include <qwidgetstack.h>
+#include <q3vbox.h>
+#include <q3buttongroup.h>
+#include <q3vgroupbox.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qspinbox.h>
#include <qcheckbox.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <QLabel>
+#include <Q3GridLayout>
+#include <Q3PtrList>
+#include <Q3Frame>
+#include <Q3VBoxLayout>
#include <kdialog.h>
#include <kglobal.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kdebug.h>
#include <knumvalidator.h>
#include <libkcal/event.h>
#include <libkcal/todo.h>
#include <libkdepim/kdateedit.h>
#include "koprefs.h"
#include "koeditorrecurrence.h"
/////////////////////////// RecurBase ///////////////////////////////
RecurBase::RecurBase( QWidget *parent, const char *name ) :
QWidget( parent, name )
{
mFrequencyEdit = new QSpinBox( 1, 9999, 1, this );
mFrequencyEdit->setValue( 1 );
}
QWidget *RecurBase::frequencyEdit()
{
return mFrequencyEdit;
}
void RecurBase::setFrequency( int f )
{
if ( f < 1 ) f = 1;
mFrequencyEdit->setValue( f );
}
int RecurBase::frequency()
{
return mFrequencyEdit->value();
}
/////////////////////////// RecurDaily ///////////////////////////////
RecurDaily::RecurDaily( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QHBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3HBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
QLabel *preLabel = new QLabel( i18n("Recur every"), this );
topLayout->addWidget( preLabel );
topLayout->addWidget( frequencyEdit() );
QLabel *postLabel = new QLabel( i18n("day(s)"), this );
topLayout->addWidget( postLabel );
}
/////////////////////////// RecurWeekly ///////////////////////////////
RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
//topLayout->addStretch( 1 );
- QBoxLayout *weeksLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *weeksLayout = new Q3HBoxLayout( topLayout );
QLabel *preLabel = new QLabel( i18n("Recur every"), this );
weeksLayout->addWidget( preLabel );
weeksLayout->addWidget( frequencyEdit() );
QLabel *postLabel = new QLabel( i18n("week(s) on:"), this );
weeksLayout->addWidget( postLabel );
- QHBox *dayBox = new QHBox( this );
- topLayout->addWidget( dayBox, 1, AlignVCenter );
+ Q3HBox *dayBox = new Q3HBox( this );
+ topLayout->addWidget( dayBox, 1, Qt::AlignVCenter );
// TODO: Respect start of week setting
for ( int i = 0; i < 7; ++i ) {
QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true );
int left = 1;
if ( QApplication::desktop()->width() > 480 ) {
++left;
if ( QApplication::desktop()->width() > 640 )
++left;
}
mDayBoxes[ i ] = new QCheckBox( weekDayName.left( left ), dayBox );
}
topLayout->addStretch( );
}
void RecurWeekly::setDays( const QBitArray &days )
{
for ( int i = 0; i < 7; ++i ) {
mDayBoxes[ i ]->setChecked( days.testBit( i ) );
}
}
QBitArray RecurWeekly::days()
{
QBitArray days( 7 );
for ( int i = 0; i < 7; ++i ) {
days.setBit( i, mDayBoxes[ i ]->isChecked() );
}
return days;
}
/////////////////////////// RecurMonthly ///////////////////////////////
RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
- QBoxLayout *freqLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout );
QLabel *preLabel = new QLabel( i18n("every"), this );
freqLayout->addWidget( preLabel );
freqLayout->addWidget( frequencyEdit() );
QLabel *postLabel = new QLabel( i18n("month(s)"), this );
freqLayout->addWidget( postLabel );
- QButtonGroup *buttonGroup = new QButtonGroup( this );
- buttonGroup->setFrameStyle( QFrame::NoFrame );
- topLayout->addWidget( buttonGroup, 1, AlignVCenter );
+ Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this );
+ buttonGroup->setFrameStyle( Q3Frame::NoFrame );
+ topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter );
- QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 );
+ Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 3, 2 );
buttonLayout->setSpacing( KDialog::spacingHint() );
buttonLayout->setMargin( KDialog::marginHintSmall() );
QString recurOnText;
if ( QApplication::desktop()->width() > 320 ) {
recurOnText = i18n("Recur on the");
}
mByDayRadio = new QRadioButton( recurOnText, buttonGroup );
buttonLayout->addWidget( mByDayRadio, 0, 0 );
- mByDayCombo = new QComboBox( buttonGroup );
+ mByDayCombo = new Q3ComboBox( buttonGroup );
mByDayCombo->setSizeLimit( 7 );
mByDayCombo->insertItem( i18n("1st") );
mByDayCombo->insertItem( i18n("2nd") );
mByDayCombo->insertItem( i18n("3rd") );
mByDayCombo->insertItem( i18n("4th") );
mByDayCombo->insertItem( i18n("5th") );
mByDayCombo->insertItem( i18n("6th") );
mByDayCombo->insertItem( i18n("7th") );
mByDayCombo->insertItem( i18n("8th") );
mByDayCombo->insertItem( i18n("9th") );
mByDayCombo->insertItem( i18n("10th") );
mByDayCombo->insertItem( i18n("11th") );
mByDayCombo->insertItem( i18n("12th") );
mByDayCombo->insertItem( i18n("13th") );
mByDayCombo->insertItem( i18n("14th") );
mByDayCombo->insertItem( i18n("15th") );
mByDayCombo->insertItem( i18n("16th") );
mByDayCombo->insertItem( i18n("17th") );
mByDayCombo->insertItem( i18n("18th") );
mByDayCombo->insertItem( i18n("19th") );
mByDayCombo->insertItem( i18n("20th") );
mByDayCombo->insertItem( i18n("21st") );
mByDayCombo->insertItem( i18n("22nd") );
mByDayCombo->insertItem( i18n("23rd") );
@@ -272,76 +280,76 @@ bool RecurMonthly::byPos()
{
return mByPosRadio->isChecked();
}
int RecurMonthly::day()
{
return mByDayCombo->currentItem() + 1;
}
int RecurMonthly::count()
{
return mByPosCountCombo->currentItem() + 1;
}
int RecurMonthly::weekday()
{
return mByPosWeekdayCombo->currentItem();
}
/////////////////////////// RecurYearly ///////////////////////////////
RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
- QBoxLayout *freqLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout );
QLabel *preLabel = new QLabel( i18n("every"), this );
freqLayout->addWidget( preLabel );
freqLayout->addWidget( frequencyEdit() );
QLabel *postLabel = new QLabel( i18n("year(s)"), this );
freqLayout->addWidget( postLabel );
- QButtonGroup *buttonGroup = new QButtonGroup( this );
- buttonGroup->setFrameStyle( QFrame::NoFrame );
- topLayout->addWidget( buttonGroup, 1, AlignVCenter );
+ Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this );
+ buttonGroup->setFrameStyle( Q3Frame::NoFrame );
+ topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter );
- QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 2, 3 );
+ Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 2, 3 );
mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup);
buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight);
mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup );
buttonLayout->addWidget( mByDayLabel, 0, 1 );
- mByMonthCombo = new QComboBox( buttonGroup );
+ mByMonthCombo = new Q3ComboBox( buttonGroup );
mByMonthCombo->insertItem( i18n("January") );
mByMonthCombo->insertItem( i18n("February") );
mByMonthCombo->insertItem( i18n("March") );
mByMonthCombo->insertItem( i18n("April") );
mByMonthCombo->insertItem( i18n("May") );
mByMonthCombo->insertItem( i18n("June") );
mByMonthCombo->insertItem( i18n("July") );
mByMonthCombo->insertItem( i18n("August") );
mByMonthCombo->insertItem( i18n("September") );
mByMonthCombo->insertItem( i18n("October") );
mByMonthCombo->insertItem( i18n("November") );
mByMonthCombo->insertItem( i18n("December") );
buttonLayout->addWidget( mByMonthCombo, 0, 2,Qt::AlignLeft );
if ( QApplication::desktop()->width() <= 640 ) {
mByMonthCombo->setSizeLimit( 6 );
}
mByDayRadio = new QRadioButton( i18n("On day "), buttonGroup);
buttonLayout->addWidget( mByDayRadio, 1, 0 , Qt::AlignRight);
mDayOfLabel = new QLabel( i18n("%1 of the year").arg(1), buttonGroup );
buttonLayout->addMultiCellWidget( mDayOfLabel, 1, 1, 1,3 );
}
@@ -362,69 +370,69 @@ void RecurYearly::setByMonth( int month, int day )
bool RecurYearly::byMonth()
{
return mByMonthRadio->isChecked();
}
bool RecurYearly::byDay()
{
return mByDayRadio->isChecked();
}
int RecurYearly::month()
{
return mByMonthCombo->currentItem() + 1;
}
int RecurYearly::day()
{
return mDay;//mByDayCombo->currentItem() + 1;
}
//////////////////////////// ExceptionsWidget //////////////////////////
ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) :
QWidget( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
- QGroupBox *groupBox = new QGroupBox( 1, Horizontal, i18n("Exceptions"),
+ Q3GroupBox *groupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Exceptions"),
this );
topLayout->addWidget( groupBox );
QWidget *box = new QWidget( groupBox );
- QGridLayout *boxLayout = new QGridLayout( box );
+ Q3GridLayout *boxLayout = new Q3GridLayout( box );
mExceptionDateEdit = new KDateEdit( box );
boxLayout->addWidget( mExceptionDateEdit, 0, 0 );
QPushButton *addExceptionButton = new QPushButton( i18n("Add"), box );
boxLayout->addWidget( addExceptionButton, 1, 0 );
QPushButton *changeExceptionButton = new QPushButton( i18n("Change"), box );
boxLayout->addWidget( changeExceptionButton, 2, 0 );
QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box );
boxLayout->addWidget( deleteExceptionButton, 3, 0 );
- mExceptionList = new QListBox( box );
+ mExceptionList = new Q3ListBox( box );
boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 );
boxLayout->setRowStretch( 4, 1 );
boxLayout->setColStretch( 1, 3 );
connect( addExceptionButton, SIGNAL( clicked() ),
SLOT( addException() ) );
connect( changeExceptionButton, SIGNAL( clicked() ),
SLOT( changeException() ) );
connect( deleteExceptionButton, SIGNAL( clicked() ),
SLOT( deleteException() ) );
if ( QApplication::desktop()->width() < 480 ) {
setMinimumWidth( 220 );
} else {
setMinimumWidth( 440 );
mExceptionDateEdit->setMinimumWidth( 200 );
}
}
void ExceptionsWidget::setDefaults( const QDateTime &from )
{
mExceptionList->clear();
mExceptionDates.clear();
mExceptionDateEdit->setDate( from.date() );
@@ -485,82 +493,82 @@ ExceptionsDialog::ExceptionsDialog( QWidget *parent, const char *name ) :
resize(220,10);
}
void ExceptionsDialog::setDefaults( const QDateTime &from )
{
mExceptions->setDefaults( from );
}
void ExceptionsDialog::setDates( const DateList &dates )
{
mExceptions->setDates( dates );
}
DateList ExceptionsDialog::dates()
{
return mExceptions->dates();
}
///////////////////////// RecurrenceRangeWidget ///////////////////////////
RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
const char *name )
: QWidget( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
- mRangeGroupBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Range"),
+ mRangeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Range"),
this );
topLayout->addWidget( mRangeGroupBox );
QWidget *rangeBox = new QWidget( mRangeGroupBox );
- QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox );
+ Q3VBoxLayout *rangeLayout = new Q3VBoxLayout( rangeBox );
rangeLayout->setSpacing( KDialog::spacingHint() );
rangeLayout->setMargin( KDialog::marginHintSmall() );
mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox );
rangeLayout->addWidget( mStartDateLabel );
- mRangeButtonGroup = new QButtonGroup;
+ mRangeButtonGroup = new Q3ButtonGroup;
mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox );
mRangeButtonGroup->insert( mNoEndDateButton );
rangeLayout->addWidget( mNoEndDateButton );
- QBoxLayout *durationLayout = new QHBoxLayout( rangeLayout );
+ Q3BoxLayout *durationLayout = new Q3HBoxLayout( rangeLayout );
durationLayout->setSpacing( KDialog::spacingHint() );
mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox );
mRangeButtonGroup->insert( mEndDurationButton );
durationLayout->addWidget( mEndDurationButton );
mEndDurationEdit = new QSpinBox( 1, 9999, 1, rangeBox );
durationLayout->addWidget( mEndDurationEdit );
QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox );
durationLayout ->addWidget( endDurationLabel );
- QBoxLayout *endDateLayout = new QHBoxLayout( rangeLayout );
+ Q3BoxLayout *endDateLayout = new Q3HBoxLayout( rangeLayout );
endDateLayout->setSpacing( KDialog::spacingHint() );
mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox );
mRangeButtonGroup->insert( mEndDateButton );
endDateLayout->addWidget( mEndDateButton );
mEndDateEdit = new KDateEdit( rangeBox );
endDateLayout->addWidget( mEndDateEdit );
//endDateLayout->addStretch( 1 );
connect( mNoEndDateButton, SIGNAL( toggled( bool ) ),
SLOT( showCurrentRange() ) );
connect( mEndDurationButton, SIGNAL( toggled( bool ) ),
SLOT( showCurrentRange() ) );
connect( mEndDateButton, SIGNAL( toggled( bool ) ),
SLOT( showCurrentRange() ) );
}
RecurrenceRangeWidget::~RecurrenceRangeWidget()
{
delete mRangeButtonGroup;
}
void RecurrenceRangeWidget::setDefaults( const QDateTime &from )
@@ -645,49 +653,49 @@ int RecurrenceRangeDialog::duration()
return mRecurrenceRangeWidget->duration();
}
void RecurrenceRangeDialog::setEndDate( const QDate &date )
{
mRecurrenceRangeWidget->setEndDate( date );
}
QDate RecurrenceRangeDialog::endDate()
{
return mRecurrenceRangeWidget->endDate();
}
void RecurrenceRangeDialog::setDateTimes( const QDateTime &start,
const QDateTime &end )
{
mRecurrenceRangeWidget->setDateTimes( start, end );
}
//////////////////////////// RecurrenceChooser ////////////////////////
RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) :
QWidget( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
mTypeCombo = new QComboBox( this );
mTypeCombo->insertItem( i18n("Daily") );
mTypeCombo->insertItem( i18n("Weekly") );
mTypeCombo->insertItem( i18n("Monthly") );
mTypeCombo->insertItem( i18n("Yearly") );
topLayout->addWidget( mTypeCombo );
connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) );
}
int RecurrenceChooser::type()
{
if ( mTypeCombo ) {
return mTypeCombo->currentItem();
} else {
if ( mDailyButton->isChecked() ) return Daily;
else if ( mWeeklyButton->isChecked() ) return Weekly;
else if ( mMonthlyButton->isChecked() ) return Monthly;
else return Yearly;
}
}
@@ -704,83 +712,83 @@ void RecurrenceChooser::setType( int type )
case Weekly:
mWeeklyButton->setChecked( true );
break;
case Monthly:
mMonthlyButton->setChecked( true );
break;
case Yearly:
default:
mYearlyButton->setChecked( true );
break;
}
}
}
void RecurrenceChooser::emitChoice()
{
emit chosen ( type() );
}
/////////////////////////////// Main Widget /////////////////////////////
KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
QWidget( parent, name )
{
- QGridLayout *topLayout = new QGridLayout( this, 2,2 );
+ Q3GridLayout *topLayout = new Q3GridLayout( this, 2,2 );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this );
connect( mEnabledCheck, SIGNAL( toggled( bool ) ),
SLOT( setEnabled( bool ) ) );
topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 );
- mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"),
+ mTimeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Time"),
this );
topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 );
if ( QApplication::desktop()->width() <= 640 ) {
mTimeGroupBox->hide();
}
// QFrame *timeFrame = new QFrame( mTimeGroupBox );
// QBoxLayout *layoutTimeFrame = new QHBoxLayout( timeFrame );
// layoutTimeFrame->setSpacing( KDialog::spacingHint() );
mDateTimeLabel = new QLabel( mTimeGroupBox );
// mDateTimeLabel = new QLabel( timeFrame );
// layoutTimeFrame->addWidget( mDateTimeLabel );
//mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) );
//mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) );
- mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this );
+ mRuleBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Rule"), this );
topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 );
mRecurrenceChooser = new RecurrenceChooser( mRuleBox );
connect( mRecurrenceChooser, SIGNAL( chosen( int ) ),
SLOT( showCurrentRule( int ) ) );
- mRuleStack = new QWidgetStack( mRuleBox );
+ mRuleStack = new Q3WidgetStack( mRuleBox );
mDaily = new RecurDaily( mRuleStack );
mRuleStack->addWidget( mDaily, 0 );
mWeekly = new RecurWeekly( mRuleStack );
mRuleStack->addWidget( mWeekly, 0 );
mMonthly = new RecurMonthly( mRuleStack );
mRuleStack->addWidget( mMonthly, 0 );
mYearly = new RecurYearly( mRuleStack );
mRuleStack->addWidget( mYearly, 0 );
showCurrentRule( mRecurrenceChooser->type() );
mRecurrenceRangeWidget = 0;
mRecurrenceRangeDialog = new RecurrenceRangeDialog( this );
mRecurrenceRange = mRecurrenceRangeDialog;
mRecurrenceRangeButton = new QPushButton( i18n("Recurrence Range..."),
this );
connect( mRecurrenceRangeButton, SIGNAL( clicked() ),
SLOT( showRecurrenceRangeDialog() ) );
mExceptionsWidget = 0;
@@ -875,50 +883,50 @@ void KOEditorRecurrence::setDefaults( QDateTime from, QDateTime to )
mExceptions->setDefaults( to );
mRecurrenceRange->setDefaults( to );
mRecurrenceChooser->setType( RecurrenceChooser::Weekly );
showCurrentRule( mRecurrenceChooser->type() );
mDaily->setFrequency( 1 );
mWeekly->setFrequency( 1 );
mMonthly->setFrequency( 1 );
mYearly->setFrequency( 1 );
setDefaultsDates( from, to );
}
void KOEditorRecurrence::readEvent(Incidence *event)
{
QDateTime dtEnd;
if ( event->typeID() == eventID )
dtEnd = ((Event*)event)->dtEnd();
else
dtEnd = ((Todo*)event)->dtDue();
setDefaults( event->dtStart(), dtEnd );
QBitArray rDays( 7 );
- QPtrList<Recurrence::rMonthPos> rmp;
- QPtrList<int> rmd;
+ Q3PtrList<Recurrence::rMonthPos> rmp;
+ Q3PtrList<int> rmd;
int day = 0;
int count = 0;
int month = 0;
setDateTimes( event->dtStart(), dtEnd );
int recurs = event->doesRecur();
mEnabledCheck->setChecked( recurs );
setEnabled( recurs );
int recurrenceType = RecurrenceChooser::Weekly;
if ( recurs ) {
Recurrence *r = event->recurrence();
int f = r->frequency();
switch ( recurs ) {
case Recurrence::rNone:
setDefaults( event->dtStart(), dtEnd );
break;
case Recurrence::rDaily:
recurrenceType = RecurrenceChooser::Daily;
mDaily->setFrequency( f );
break;
@@ -947,49 +955,49 @@ void KOEditorRecurrence::readEvent(Incidence *event)
break;
case Recurrence::rMonthlyDay:
recurrenceType = RecurrenceChooser::Monthly;
rmd = r->monthDays();
day = *rmd.first() - 1;
mMonthly->setByDay( day );
mMonthly->setFrequency( f );
break;
case Recurrence::rYearlyMonth:
{
recurrenceType = RecurrenceChooser::Yearly;
//qDebug("Recurrence::rYearlyMonth: ");
day = event->dtStart().date().day();
rmd = r->yearNums();
if ( rmd.count() > 0 )
month = *rmd.first();
else
month = event->dtStart().date().month() ;
mYearly->setByMonth( month, day );
#if 0
//qDebug("2day = %d ",day );
- QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
+ Q3PtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
int month;
if ( !monthlist.isEmpty() ) {
month = monthlist.first()->rPos ;
} else {
month = event->dtStart().date().month() ;
}
mYearly->setByMonth( day, month );
#endif
mYearly->setFrequency( f );
}
break;
case Recurrence::rYearlyDay:
//qDebug("Recurrence::rYearlyDay: ");
recurrenceType = RecurrenceChooser::Yearly;
mYearly->setByDay( event->dtStart().date().dayOfYear() );
mYearly->setFrequency( f );
break;
default:
setDefaults( event->dtStart(), dtEnd );
break;
}
}
mRecurrenceChooser->setType( recurrenceType );
diff --git a/korganizer/koeditorrecurrence.h b/korganizer/koeditorrecurrence.h
index 75e0c73..6c012bd 100644
--- a/korganizer/koeditorrecurrence.h
+++ b/korganizer/koeditorrecurrence.h
@@ -2,67 +2,69 @@
This file is part of KOrganizer.
Copyright (c) 2000-2003 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOEDITORRECURRENCE_H
#define _KOEDITORRECURRENCE_H
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
-#include <qmultilineedit.h>
-#include <qlistview.h>
+#include <q3multilineedit.h>
+#include <q3listview.h>
#include <qradiobutton.h>
-#include <qbuttongroup.h>
+#include <q3buttongroup.h>
+#include <Q3ListBox>
+#include <Q3ComboBox>
#include <kdialogbase.h>
#include <libkcal/event.h>
#include "ktimeedit.h"
-class QWidgetStack;
+class Q3WidgetStack;
class QSpinBox;
class KDateEdit;
using namespace KCal;
class RecurBase : public QWidget
{
public:
RecurBase( QWidget *parent = 0, const char *name = 0 );
void setFrequency( int );
int frequency();
QWidget *frequencyEdit();
private:
QSpinBox *mFrequencyEdit;
};
class RecurDaily : public RecurBase
{
public:
RecurDaily( QWidget *parent = 0, const char *name = 0 );
@@ -77,73 +79,73 @@ class RecurWeekly : public RecurBase
QBitArray days();
private:
QCheckBox *mDayBoxes[7];
};
class RecurMonthly : public RecurBase
{
public:
RecurMonthly( QWidget *parent = 0, const char *name = 0 );
void setByDay( int day );
void setByPos( int count, int weekday );
bool byDay();
bool byPos();
int day();
int count();
int weekday();
private:
QRadioButton *mByDayRadio;
- QComboBox *mByDayCombo;
+ Q3ComboBox *mByDayCombo;
QRadioButton *mByPosRadio;
QComboBox *mByPosCountCombo;
QComboBox *mByPosWeekdayCombo;
};
class RecurYearly : public RecurBase
{
public:
RecurYearly( QWidget *parent = 0, const char *name = 0 );
void setByDay( int doy );
void setByMonth( int month, int day );
bool byMonth();
bool byDay();
int month();
int day();
private:
int mDay;
QRadioButton *mByMonthRadio;
- QComboBox *mByMonthCombo;
+ Q3ComboBox *mByMonthCombo;
QLabel* mByDayLabel;
QLabel* mDayOfLabel;
QRadioButton *mByDayRadio;
};
class RecurrenceChooser : public QWidget
{
Q_OBJECT
public:
RecurrenceChooser( QWidget *parent = 0, const char *name = 0 );
enum { Daily, Weekly, Monthly, Yearly };
void setType( int );
int type();
signals:
void chosen( int );
protected slots:
void emitChoice();
private:
QComboBox *mTypeCombo;
@@ -159,49 +161,49 @@ class ExceptionsBase
public:
virtual void setDefaults( const QDateTime &from ) = 0;
virtual void setDates( const DateList & ) = 0;
virtual DateList dates() = 0;
};
class ExceptionsWidget : public QWidget, public ExceptionsBase
{
Q_OBJECT
public:
ExceptionsWidget( QWidget *parent = 0, const char *name = 0 );
void setDefaults( const QDateTime &from );
void setDates( const DateList & );
DateList dates();
protected slots:
void addException();
void changeException();
void deleteException();
private:
KDateEdit *mExceptionDateEdit;
- QListBox *mExceptionList;
+ Q3ListBox *mExceptionList;
DateList mExceptionDates;
};
class ExceptionsDialog : public KDialogBase, public ExceptionsBase
{
public:
ExceptionsDialog( QWidget *parent, const char *name = 0 );
void setDefaults( const QDateTime &from );
void setDates( const DateList & );
DateList dates();
private:
ExceptionsWidget *mExceptions;
};
class RecurrenceRangeBase
{
public:
virtual void setDefaults( const QDateTime &from ) = 0;
virtual void setDuration( int ) = 0;
virtual int duration() = 0;
@@ -214,50 +216,50 @@ class RecurrenceRangeBase
};
class RecurrenceRangeWidget : public QWidget, public RecurrenceRangeBase
{
Q_OBJECT
public:
RecurrenceRangeWidget( QWidget *parent = 0, const char *name = 0 );
~RecurrenceRangeWidget();
void setDefaults( const QDateTime &from );
void setDuration( int );
int duration();
void setEndDate( const QDate & );
QDate endDate();
void setDateTimes( const QDateTime &start,
const QDateTime &end = QDateTime() );
protected slots:
void showCurrentRange();
private:
- QButtonGroup *mRangeButtonGroup;
- QGroupBox *mRangeGroupBox;
+ Q3ButtonGroup *mRangeButtonGroup;
+ Q3GroupBox *mRangeGroupBox;
QLabel *mStartDateLabel;
QRadioButton *mNoEndDateButton;
QRadioButton *mEndDurationButton;
QSpinBox *mEndDurationEdit;
QRadioButton *mEndDateButton;
KDateEdit *mEndDateEdit;
};
class RecurrenceRangeDialog : public KDialogBase, public RecurrenceRangeBase
{
public:
RecurrenceRangeDialog( QWidget *parent = 0, const char *name = 0 );
void setDefaults( const QDateTime &from );
void setDuration( int );
int duration();
void setEndDate( const QDate & );
QDate endDate();
void setDateTimes( const QDateTime &start,
const QDateTime &end = QDateTime() );
@@ -279,49 +281,49 @@ class KOEditorRecurrence : public QWidget
/** Write event settings to event object */
void writeEvent( Incidence * );
/** Check if the input is valid. */
bool validateInput();
public slots:
void setDefaultsDates( QDateTime from, QDateTime to );
void setDefaults( QDateTime from, QDateTime to );
void setEnabled( bool );
void setDateTimes( QDateTime start, QDateTime end );
void setDateTimeStr( const QString & );
signals:
void dateTimesChanged( QDateTime start, QDateTime end );
protected slots:
void showCurrentRule( int );
void showExceptionsDialog();
void showRecurrenceRangeDialog();
private:
QCheckBox *mEnabledCheck;
- QGroupBox *mTimeGroupBox;
+ Q3GroupBox *mTimeGroupBox;
QLabel *mDateTimeLabel;
- QGroupBox *mRuleBox;
- QWidgetStack *mRuleStack;
+ Q3GroupBox *mRuleBox;
+ Q3WidgetStack *mRuleStack;
RecurrenceChooser *mRecurrenceChooser;
RecurDaily *mDaily;
RecurWeekly *mWeekly;
RecurMonthly *mMonthly;
RecurYearly *mYearly;
RecurrenceRangeBase *mRecurrenceRange;
RecurrenceRangeWidget *mRecurrenceRangeWidget;
RecurrenceRangeDialog *mRecurrenceRangeDialog;
QPushButton *mRecurrenceRangeButton;
ExceptionsBase *mExceptions;
ExceptionsDialog *mExceptionsDialog;
ExceptionsWidget *mExceptionsWidget;
QPushButton *mExceptionsButton;
};
#endif
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 3e87197..62ad250 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -1,56 +1,61 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qpixmap.h>
-#include <qhbox.h>
+#include <q3hbox.h>
#include <qtimer.h>
#include <qdir.h>
#include <qlayout.h>
-#include <qwidgetstack.h>
+#include <q3widgetstack.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3PtrList>
+#include <Q3VBoxLayout>
#include <kiconloader.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include "koprefs.h"
#include "koeventeditor.h"
extern int globalFlagBlockAgenda;
KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) :
KOIncidenceEditor( i18n("Edit Event"), calendar, parent )
{
mEvent = 0;
@@ -84,127 +89,127 @@ void KOEventEditor::init()
}
void KOEventEditor::reload()
{
if ( mEvent ) readEvent( mEvent );
}
void KOEventEditor::setSecrecy( int sec )
{
mGeneral->setSecrecy( sec );
}
void KOEventEditor::setCategories( QString s )
{
mGeneral->setCategories(s);
}
void KOEventEditor::setupGeneral()
{
mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" );
connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
if( KOPrefs::instance()->mCompactDialogs ) {
- QFrame *topFrame = addPage(i18n("General"));
- QBoxLayout *topLayout = new QVBoxLayout(topFrame);
+ Q3Frame *topFrame = addPage(i18n("General"));
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
topLayout->setSpacing(spacingHint()-1);
topLayout->setMargin(marginHint()-1);
topLayout->addStretch ( 1 );
mGeneral->initHeader(topFrame,topLayout);
topLayout->addStretch ( 1 );
mGeneral->initTime(topFrame,topLayout);
topLayout->addStretch ( 1 );
// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
mGeneral->initAlarm(topFrame,topLayout);
topLayout->addStretch ( 1 );
mGeneral->enableAlarm( false );
- QBoxLayout *buttonLayout;
+ Q3BoxLayout *buttonLayout;
if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 )
- buttonLayout = new QVBoxLayout( topLayout );
+ buttonLayout = new Q3VBoxLayout( topLayout );
else
- buttonLayout = new QHBoxLayout( topLayout );
- QHBox* buttonWidget = new QHBox (topFrame);
- QIconSet icon;
+ buttonLayout = new Q3HBoxLayout( topLayout );
+ Q3HBox* buttonWidget = new Q3HBox (topFrame);
+ QIcon icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileexport16");
else
icon = SmallIcon("fileexport");
QPushButton * loadTemplate = new QPushButton( buttonWidget);
QPushButton * saveTemplate = new QPushButton( buttonWidget);
saveTemplate->setIconSet (icon ) ;
int size = saveTemplate->sizeHint().height();
saveTemplate->setFixedSize( size, size );
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileimport16");
else
icon = SmallIcon("fileimport");
loadTemplate->setIconSet (icon ) ;
loadTemplate->setFixedSize( size, size );
buttonLayout->addWidget( buttonWidget );
mGeneral->initCategories( topFrame, buttonLayout );
topLayout->addStretch( 1 );
- QFrame *topFrame2 = addPage(i18n("Details"));
+ Q3Frame *topFrame2 = addPage(i18n("Details"));
- QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
+ Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2);
topLayout2->setSpacing(spacingHint()-1);
topLayout2->setMargin(marginHint()-1);
topLayout2->setSpacing(spacingHint());
mGeneral->initClass(topFrame2,topLayout2);
mGeneral->initSecrecy( topFrame2, topLayout2 );
mGeneral->initDescription(topFrame2,topLayout2);
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
} else {
- QFrame *topFrame = addPage(i18n("General"));
+ Q3Frame *topFrame = addPage(i18n("General"));
- QBoxLayout *topLayout = new QVBoxLayout(topFrame);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
topLayout->setSpacing(spacingHint());
mGeneral->initHeader(topFrame,topLayout);
mGeneral->initTime(topFrame,topLayout);
- QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout);
mGeneral->initAlarm(topFrame,alarmLineLayout);
mGeneral->initClass(topFrame,alarmLineLayout);
mGeneral->initDescription(topFrame,topLayout);
- QBoxLayout *detailsLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout);
mGeneral->initCategories( topFrame, detailsLayout );
mGeneral->initSecrecy( topFrame, detailsLayout );
}
mGeneral->finishSetup();
}
void KOEventEditor::setupRecurrence()
{
- QFrame *topFrame = addPage( i18n("Recurrence") );
- QBoxLayout *topLayout = new QVBoxLayout( topFrame );
+ Q3Frame *topFrame = addPage( i18n("Recurrence") );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
mRecurrence = new KOEditorRecurrence( topFrame );
topLayout->addWidget( mRecurrence );
}
void KOEventEditor::editEvent(Event *event, bool showDescription)
{
// init();
mEvent = event;
readEvent(mEvent);
if ( showDescription ) {
showPage( 1 );
mGeneral->setFocusOn( 1 );
} else {
showPage( 0 );
mGeneral->setFocusOn( 2 );
}
}
void KOEventEditor::newEvent( QDateTime from, QDateTime to, bool allDay )
{
// init();
@@ -335,49 +340,49 @@ int KOEventEditor::msgItemDelete()
{
return KMessageBox::warningContinueCancel(this,
i18n("This item will be permanently deleted."),
i18n("KOrganizer Confirmation"),i18n("Delete"));
}
void KOEventEditor::slotLoadTemplate()
{
QString fileName =locateLocal( "templates", "events" );
QDir t_dir;
if ( !t_dir.exists(fileName) )
t_dir.mkdir ( fileName );
fileName += "/event";
fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event template"), this );
if ( fileName.length() == 0 )
return;
CalendarLocal cal;
ICalFormat format;
if ( !format.load( &cal, fileName ) ) {
KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
.arg( fileName ) );
return ;
}
- QPtrList<Event> events = cal.events();
+ Q3PtrList<Event> events = cal.events();
Event* event = events.first();
if ( !event ) {
KMessageBox::error( this,
i18n("Template does not contain\na valid Event."));
} else {
kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl;
readEvent( event, true );
}
}
void KOEventEditor::slotSaveTemplate()
{
QString fileName =locateLocal( "templates", "events" );
QDir t_dir;
if ( !t_dir.exists(fileName) )
t_dir.mkdir ( fileName );
fileName += "/event";
fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Event template"), this );
if ( fileName.length() > 0 )
saveTemplate( fileName );
}
void KOEventEditor::saveTemplate( const QString &templateName )
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index fc4d9a4..81047c1 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -1,101 +1,104 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qcursor.h>
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3PopupMenu>
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <libkcal/event.h>
#include "koeventpopupmenu.h"
#include "koprefs.h"
-KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu()
+KOEventPopupMenu::KOEventPopupMenu(): Q3PopupMenu()
{
mCurrentIncidence = 0;
mHasAdditionalItems = false;
mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow())));
mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit())));
mEditOnlyItems.append(insertItem (i18n("&Delete..."),
this,SLOT(popupDelete())));
mEditOnlyItems.append(insertItem (i18n("&Clone..."),
this,SLOT(popupClone())));
mEditOnlyItems.append(insertItem (i18n("&Move..."),
this,SLOT(popupMove())));
#ifndef DESKTOP_VERSION
mEditOnlyItems.append(insertItem (i18n("&Beam..."),
this,SLOT(popupBeam())));
#endif
mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"),
this,SLOT(popupCancel())));
isDisabled = false;
- mCatPopup = new QPopupMenu ( this );
+ mCatPopup = new Q3PopupMenu ( this );
mCatPopup->setCheckable (true);
connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup()));
connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int )));
- mCalPopup = new QPopupMenu ( this );
+ mCalPopup = new Q3PopupMenu ( this );
mCalPopup->setCheckable (true);
connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup()));
connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int )));
//mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
//mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
insertItem (i18n("Categories"),mCatPopup );
insertItem (i18n("Calendar"),mCalPopup );
- QValueList<int>::Iterator it;
+ Q3ValueList<int>::Iterator it;
for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
mSingleOnlyItems.append(*it);
}
}
void KOEventPopupMenu::enableDefault( bool enable )
{
isDisabled = !enable;
- QValueList<int>::Iterator it;
+ Q3ValueList<int>::Iterator it;
for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) {
setItemEnabled(*it,enable);
}
}
void KOEventPopupMenu::fillCalPopup() // CAL
{
mCalPopup->clear();
if (!mCurrentIncidence) return;
bool readO = mCurrentIncidence->isReadOnly()|| isDisabled;
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
while ( kkf ) {
int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
mCalPopup->setItemEnabled( index, false );
mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID());
kkf = KOPrefs::instance()->mCalendars.next();
}
}
void KOEventPopupMenu::computeCalPopup( int index ) // CAL
{
if (!mCurrentIncidence) return;
mCurrentIncidence->setCalID( index );
emit categoryChanged( mCurrentIncidence );
@@ -125,58 +128,58 @@ void KOEventPopupMenu::computeCatPopup( int index )
QStringList categories = mCurrentIncidence->categories();
QString colcat = categories.first();
if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ())
categories.remove (KOPrefs::instance()->mCustomCategories[index]);
else
categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
categories.sort ();
if ( !colcat.isEmpty() ) {
if ( categories.find ( colcat ) != categories.end () ) {
categories.remove( colcat );
categories.prepend( colcat );
}
}
mCurrentIncidence->setCategories( categories );
emit categoryChanged( mCurrentIncidence );
}
void KOEventPopupMenu::showIncidencePopup(Incidence *incidence)
{
if ( !incidence) return;
mCurrentIncidence = incidence;
if (mCurrentIncidence) {
// Enable/Disabled menu items only valid for editable events.
if ( !isDisabled ) {
- QValueList<int>::Iterator it;
+ Q3ValueList<int>::Iterator it;
for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
setItemEnabled(*it,!mCurrentIncidence->isReadOnly());
}
}
popup(QCursor::pos());
}
}
-void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text,
+void KOEventPopupMenu::addAdditionalItem(const QIcon &icon,const QString &text,
const QObject *receiver, const char *member,
bool editOnly)
{
if (!mHasAdditionalItems) {
mHasAdditionalItems = true;
insertSeparator();
}
int id = insertItem(icon,text,receiver,member);
if (editOnly) mEditOnlyItems.append(id);
}
void KOEventPopupMenu::popupShow()
{
if (mCurrentIncidence) emit showIncidenceSignal(mCurrentIncidence);
}
void KOEventPopupMenu::popupEdit()
{
if (mCurrentIncidence) emit editIncidenceSignal(mCurrentIncidence);
}
void KOEventPopupMenu::popupDelete()
{
if (mCurrentIncidence) emit deleteIncidenceSignal(mCurrentIncidence);
diff --git a/korganizer/koeventpopupmenu.h b/korganizer/koeventpopupmenu.h
index e28745b..de5220b 100644
--- a/korganizer/koeventpopupmenu.h
+++ b/korganizer/koeventpopupmenu.h
@@ -5,79 +5,81 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOEVENTPOPUPMENU_H
#define KOEVENTPOPUPMENU_H
//
// Context menu for event views with standard event actions
//
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
+//Added by qt3to4:
+#include <Q3ValueList>
#include <libkcal/incidence.h>
using namespace KCal;
-class KOEventPopupMenu : public QPopupMenu {
+class KOEventPopupMenu : public Q3PopupMenu {
Q_OBJECT
public:
KOEventPopupMenu();
- void addAdditionalItem(const QIconSet &icon,const QString &text,
+ void addAdditionalItem(const QIcon &icon,const QString &text,
const QObject *receiver, const char *member,
bool editOnly=false);
public slots:
void showIncidencePopup(Incidence *);
void enableDefault( bool );
protected slots:
void popupShow();
void popupEdit();
void popupDelete();
void popupClone();
void popupCancel();
void popupMove();
void popupBeam();
void fillCatPopup();
void computeCatPopup( int );
void fillCalPopup();
void computeCalPopup( int );
signals:
void editIncidenceSignal(Incidence *);
void showIncidenceSignal(Incidence *);
void deleteIncidenceSignal(Incidence *);
void cloneIncidenceSignal(Incidence *);
void cancelIncidenceSignal(Incidence *);
void moveIncidenceSignal(Incidence *);
void beamIncidenceSignal(Incidence *);
void categoryChanged( Incidence * );
private:
Incidence *mCurrentIncidence;
bool mHasAdditionalItems;
- QValueList<int> mEditOnlyItems;
- QValueList<int> mSingleOnlyItems;
+ Q3ValueList<int> mEditOnlyItems;
+ Q3ValueList<int> mSingleOnlyItems;
bool isDisabled;
- QPopupMenu *mCatPopup;
- QPopupMenu *mCalPopup;
+ Q3PopupMenu *mCatPopup;
+ Q3PopupMenu *mCalPopup;
};
#endif
diff --git a/korganizer/koeventview.cpp b/korganizer/koeventview.cpp
index 1d26930..a4ba85e 100644
--- a/korganizer/koeventview.cpp
+++ b/korganizer/koeventview.cpp
@@ -1,48 +1,48 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
#include <qcursor.h>
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <libkcal/calendar.h>
#include "koprefs.h"
#include "koeventview.h"
using namespace KOrg;
//---------------------------------------------------------------------------
KOEventView::KOEventView(Calendar *cal,QWidget *parent,const char *name)
: KOrg::BaseView(cal,parent,name)
{
}
//---------------------------------------------------------------------------
KOEventView::~KOEventView()
{
}
@@ -52,49 +52,49 @@ KOEventView::~KOEventView()
KOEventPopupMenu *KOEventView::eventPopup()
{
KOEventPopupMenu *eventPopup = new KOEventPopupMenu;
connect(eventPopup,SIGNAL(editIncidenceSignal(Incidence *)),
SIGNAL(editIncidenceSignal(Incidence *)));
connect(eventPopup,SIGNAL(showIncidenceSignal(Incidence *)),
SIGNAL(showIncidenceSignal(Incidence *)));
connect(eventPopup,SIGNAL(deleteIncidenceSignal(Incidence *)),
SIGNAL(deleteIncidenceSignal(Incidence *)));
connect(eventPopup,SIGNAL(cancelIncidenceSignal(Incidence *)),
SIGNAL(cancelIncidenceSignal(Incidence *)));
connect(eventPopup,SIGNAL(cloneIncidenceSignal(Incidence *)),
SIGNAL(cloneIncidenceSignal(Incidence *)));
connect(eventPopup,SIGNAL(beamIncidenceSignal(Incidence *)),
SIGNAL(beamIncidenceSignal(Incidence *)));
connect(eventPopup,SIGNAL(moveIncidenceSignal(Incidence *)),
SIGNAL(moveIncidenceSignal(Incidence *)));
return eventPopup;
}
//---------------------------------------------------------------------------
-void KOEventView::showIncidencePopup(QPopupMenu *popup,Incidence *event)
+void KOEventView::showIncidencePopup(Q3PopupMenu *popup,Incidence *event)
{
mCurrentIncidence = event;
if (event) popup->popup(QCursor::pos());
}
//---------------------------------------------------------------------------
void KOEventView::popupShow()
{
emit showIncidenceSignal(mCurrentIncidence);
}
//---------------------------------------------------------------------------
void KOEventView::popupEdit()
{
emit editIncidenceSignal(mCurrentIncidence);
}
//---------------------------------------------------------------------------
void KOEventView::popupDelete()
{
emit deleteIncidenceSignal(mCurrentIncidence);
diff --git a/korganizer/koeventview.h b/korganizer/koeventview.h
index 77ec111..f28e68b 100644
--- a/korganizer/koeventview.h
+++ b/korganizer/koeventview.h
@@ -9,48 +9,50 @@
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOEVENTVIEW_H
#define _KOEVENTVIEW_H
#include <libkcal/calendar.h>
#include <libkcal/event.h>
#include <korganizer/baseview.h>
#include "koeventpopupmenu.h"
+//Added by qt3to4:
+#include <Q3PopupMenu>
using namespace KCal;
class CalPrinter;
/**
KOEventView is the abstract base class from which all other
calendar views for event data are derived. It provides methods for
displaying
appointments and events on one or more days. The actual number of
days that a view actually supports is not defined by this abstract class;
that is up to the classes that inherit from it. It also provides
methods for updating the display, retrieving the currently selected
event (or events), and the like.
@short Abstract class from which all event views are derived.
@author Preston Brown <pbrown@kde.org>
@see KOListView, KOAgendaView, KOWeekView, KOMonthView
*/
class KOEventView : public KOrg::BaseView
{
Q_OBJECT
public:
@@ -66,49 +68,49 @@ class KOEventView : public KOrg::BaseView
*/
virtual ~KOEventView();
/**
* provides a hint back to the caller on the maximum number of dates
* that the view supports. A return value of 0 means no maximum.
*/
virtual int maxDatesHint() = 0;
/**
* Construct a standard context menu for an event.
*/
KOEventPopupMenu *eventPopup();
/** This view is an view for displaying events. */
bool isEventView() { return true; }
public slots:
/**
* Show context menu for event.
* @param event event, which is to be manipulated by the menu actions
* @param popup a popop menu created with eventPopup()
*/
- void showIncidencePopup(QPopupMenu *popup, Incidence *event);
+ void showIncidencePopup(Q3PopupMenu *popup, Incidence *event);
/**
Perform the default action for an incidence, e.g. open the event editor,
when double-clicking an event in the agenda view.
*/
void defaultAction( Incidence * );
signals:
/**
* when the view changes the dates that are selected in one way or
* another, this signal is emitted. It should be connected back to
* the @see KDateNavigator object so that it changes appropriately,
* and any other objects that need to be aware that the list of
* selected dates has changed.
*/
void datesSelected(const DateList);
/**
* instructs the receiver to show the incidence in read-only mode.
*/
void showIncidenceSignal(Incidence *);
/**
* instructs the receiver to begin editing the incidence specified in
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index c0acf34..4df26a9 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -1,287 +1,292 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <qcstring.h>
-#include <qwhatsthis.h>
+#include <q3cstring.h>
+#include <q3whatsthis.h>
#include <qdialog.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include <qlabel.h>
#include <qlayout.h>
+//Added by qt3to4:
+#include <QKeyEvent>
+#include <Q3PtrList>
+#include <Q3VBoxLayout>
#include <klocale.h>
#include <kapplication.h>
#include <libkcal/event.h>
#include <libkcal/todo.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <krun.h>
#include <kglobal.h>
#include <kprocess.h>
#include "koprefs.h"
#include <kabc/stdaddressbook.h>
#ifndef KORG_NODCOP
#include <dcopclient.h>
#include "korganizer.h"
#include "koprefs.h"
#include "actionmanager.h"
#endif
#include "koeventviewer.h"
//#ifndef KORG_NOKABC
//#include <kabc/stdaddressbook.h>
//#define size count
//#endif
#ifdef DESKTOP_VERSION
#include <kabc/addresseedialog.h>
#include <kabc/addresseeview.h>
#include <qprinter.h>
#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <q3paintdevicemetrics.h>
#else //DESKTOP_VERSION
#include <qtopia/qcopenvelope_qws.h>
#endif //DESKTOP_VERSION
#include <externalapphandler.h>
KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
- : QTextBrowser(parent,name)
+ : Q3TextBrowser(parent,name)
{
mSyncMode = false;
mColorMode = 0;
}
KOEventViewer::~KOEventViewer()
{
}
void KOEventViewer::printMe()
{
#ifdef DESKTOP_VERSION
KOPrintPrefs pp ( this );
if (!pp.exec() )
return;
int scaleval = pp.printMode() ;
QPrinter printer;
if (!printer.setup() )
return;
QPainter p;
p.begin ( &printer );
- QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
+ Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
float dx, dy;
int wid = (m.width() * 9)/10;
dx = (float) wid/(float)contentsWidth ();
dy = (float)(m.height()) / (float)contentsHeight ();
float scale;
// scale to fit the width or height of the paper
if ( dx < dy )
scale = dx;
else
scale = dy;
p.translate( m.width()/10,0 );
if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
p.scale( scale, scale );
}
drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
p.end();
#endif
}
void KOEventViewer::setSource(const QString& n)
{
if ( n.left(8) == "todo_uid" ) {
int midstr = 9;
#ifdef DESKTOP_VERSION
midstr = 11;
#endif
//qDebug("-%s- ", n.mid(midstr).latin1());
emit showIncidence( n.mid(midstr) );
return;
}
if ( n.left(3) == "uid" )
#ifdef DESKTOP_VERSION
{
KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
KABC::AddressBook::Iterator it;
for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
// LR I do not understand, why the uid string is different on zaurus and desktop
QString uid = "uid://"+(*it).uid();
//qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1());
if (n == uid ) {
//qDebug("found %s ",(*it).mobileHomePhone().latin1() );
QDialog dia( this,"dia123", true );
dia.setCaption( i18n("Details of attendee") );
- QVBoxLayout lay ( &dia );
+ Q3VBoxLayout lay ( &dia );
KABC::AddresseeView av ( &dia );
av.setAddressee( (*it) );
lay.addWidget( &av );
if ( QApplication::desktop()->width() < 480 )
dia.resize( 220, 240);
else {
dia.resize( 400,400);
}
dia.exec();
break;
}
}
return;
}
#else
{
if ( "uid:organizer" == n ) {
ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
return;
}
- QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
+ Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees();
if (attendees.count()) {
Attendee *a;
for(a=attendees.first();a;a=attendees.next()) {
if ( "uid:"+a->uid() == n ) {
bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid());
return;
}
}
}
return;
}
//requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
// the result should now arrive through method insertAttendees
//QString uid = "uid:"+(*it).uid();
#endif
if ( n.left(6) == "mailto" ) {
// qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1());
//#ifndef DESKTOP_VERSION
if ( n.mid(7,3) == "ALL" ) {
mailToAttendees( true );
} else if ( n.mid(7,4) == "RSVP" ) {
mailToAttendees( false );
} else {
ExternalAppHandler::instance()->mailToOneContact( n.mid(7) );
//QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" );
//e << n.mid(7);
}
//#endif
}
#ifndef KORG_NODCOP
kdDebug() << "KOEventViewer::setSource(): " << n << endl;
QString tmpStr;
if (n.startsWith("mailto:")) {
KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
//emit showIncidence(n);
return;
} else if (n.startsWith("uid:")) {
DCOPClient *client = KApplication::kApplication()->dcopClient();
const QByteArray noParamData;
const QByteArray paramData;
QByteArray replyData;
- QCString replyTypeStr;
+ Q3CString replyTypeStr;
#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
bool foundAbbrowser = PING_ABBROWSER;
if (foundAbbrowser) {
//KAddressbook is already running, so just DCOP to it to bring up the contact editor
//client->send("kaddressbook","KAddressBookIface",
- QDataStream arg(paramData, IO_WriteOnly);
+ QDataStream arg(paramData, QIODevice::WriteOnly);
arg << n.mid(6);
client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
return;
} else {
/*
KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater.
We start it without its main interface
*/
KIconLoader* iconLoader = new KIconLoader();
QString iconPath = iconLoader->iconPath("go",KIcon::Small);
ActionManager::setStartedKAddressBook(true);
tmpStr = "kaddressbook --editor-only --uid ";
tmpStr += KProcess::quote(n.mid(6));
KRun::runCommand(tmpStr,"KAddressBook",iconPath);
return;
}
} else {
//QTextBrowser::setSource(n);
}
#endif
}
void KOEventViewer::mailToAttendees( bool all )
{
- QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
+ Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees();
if (attendees.count() == 0) return;
QStringList nameList;
QStringList emailList;
QStringList uidList;
Attendee* a;
for(a=attendees.first();a;a=attendees.next()) {
if ( !all && !a->RSVP() ) continue;
if (!a->email().isEmpty()) {
#ifndef DESKTOP_VERSION
nameList.append (a->realName() );
emailList.append (a->email() );
uidList.append (a->uid() );
#else
emailList.append(a->realName() +" <" + a->email() +">");
#endif
}
}
#ifndef DESKTOP_VERSION
QString uid = "ComposeMailUIpick2"+mMailSubject;
bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
#else
ExternalAppHandler::instance()->mailToMultipleContacts( emailList.join(","), mMailSubject );
#endif
}
void KOEventViewer::addTag(const QString & tag,const QString & text)
{
- int number=text.contains("\n");
+ int number=text.count("\n");
QString str = "<" + tag + ">";
QString tmpText=text;
QString tmpStr=str;
if(number !=-1)
{
if (number > 0) {
int pos=0;
QString tmp;
for(int i=0;i<=number;i++) {
pos=tmpText.find("\n");
tmp=tmpText.left(pos);
tmpText=tmpText.right(tmpText.length()-pos-1);
tmpStr+=tmp+"<br>";
}
}
else tmpStr += tmpText;
tmpStr+="</" + tag + ">";
mText.append(tmpStr);
}
else
{
str += text + "</" + tag + ">";
mText.append(str);
}
@@ -566,116 +571,116 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
}
}
if ( KOPrefs::instance()->mEVshowChanged ) {
if(wideScreen ){
addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
} else {
addTag("p",i18n("<b>Last modified: ") +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
}
}
if ( event->relatedTo() ) {
addTag("b",i18n("Parent todo:<br>"));
QString t_name = "[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] ";// +event->relatedTo()->summary());
mText += t_name;
mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">";
mText += deTag(event->relatedTo()->summary());
mText += "</a><br>";
// mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>");
}
- QPtrList<Incidence> Relations = event->relations();
+ Q3PtrList<Incidence> Relations = event->relations();
Incidence *to;
if ( Relations.first() )
addTag("b",i18n("Sub todos:<br>"));
for (to=Relations.first();to;to=Relations.next()) {
QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary());
mText += t_name;
mText += "<a href=\"todo_uid:" + to->uid() + "\">";
mText += deTag(to->summary());
mText += "</a><br>";
}
if ( KOPrefs::instance()->mEVshowDetails ) {
if (!event->description().isEmpty()) {
addTag("p",i18n("<b>Details: </b>"));
addTag("p",deTag(event->description()));
}
}
setText(mText);
}
void KOEventViewer::formatCategories(Incidence *event)
{
if (!event->categoriesStr().isEmpty()) {
if (event->categories().count() == 1) {
addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace());
} else {
addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ;
}
}
}
void KOEventViewer::formatAttendees(Incidence *event)
{
- QPtrList<Attendee> attendees = event->attendees();
+ Q3PtrList<Attendee> attendees = event->attendees();
if (attendees.count()) {
QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
addTag("h3",i18n("Organizer"));
mText.append("<ul><li>");
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
KABC::Addressee::List addressList;
addressList = add_book->findByEmail(event->organizer());
KABC::Addressee o = addressList.first();
if (!o.isEmpty() && addressList.size()<2) {
mText += "<a href=\"uid:" + o.uid() + "\">";
mText += o.formattedName();
mText += "</a>\n";
} else {
mText.append(event->organizer());
}
#else //DESKTOP_VERSION
mText += "<a href=\"uid:organizer\">";
mText += event->organizer();
mText += "</a>\n";
#endif //DESKTOP_VERSION
#else
mText.append(event->organizer());
#endif
- if (iconPath) {
+ if (!iconPath.isEmpty()) {
mText += " <a href=\"mailto:" + event->organizer() + "\">";
mText += "<IMG src=\"" + iconPath + "\">";
mText += "</a>\n";
}
mText.append("</li></ul>");
addTag("h3",i18n("Attendees"));
Attendee *a;
mText.append("<ul>");
int a_count = 0;
int a_count_nr = 0;
for(a=attendees.first();a;a=attendees.next()) {
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
if (a->name().isEmpty()) {
addressList = add_book->findByEmail(a->email());
KABC::Addressee o = addressList.first();
if (!o.isEmpty() && addressList.size()<2) {
mText += "<a href=\"uid:" + o.uid() + "\">";
mText += o.formattedName();
mText += "</a>\n";
} else {
mText += "<li>";
@@ -683,49 +688,49 @@ void KOEventViewer::formatAttendees(Incidence *event)
mText += "\n";
}
} else {
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
}
#else //DESKTOP_VERSION
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif //DESKTOP_VERSION
#else
//qDebug("nokabc ");
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif
if (!a->email().isEmpty()) {
- if (iconPath) {
+ if (!iconPath.isEmpty()) {
mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">";
if ( a->RSVP() ) {
++a_count_nr;
mText += "<IMG src=\"" + iconPath + "\">";
}
else {
++a_count;
mText += "<IMG src=\"" + NOiconPath + "\">";
}
mText += "</a>\n";
}
}
if (a->status() != Attendee::NeedsAction )
mText +="[" + a->statusStr() + "] ";
if (a->role() == Attendee::Chair )
mText +="(" + a->roleStr().left(1) + ".)";
}
mText.append("</li></ul>");
if ( (a_count+a_count_nr) > 1 ) {
mText += "<a href=\"mailto:ALL\">";
mText += i18n( "Mail to all" );
mText += "</a> ( ";
mText += "<IMG src=\"" + iconPath + "\">";
mText += i18n( " and " );
@@ -841,28 +846,28 @@ void KOEventViewer::addText(QString text)
}
QString KOEventViewer::deTag(QString text)
{
#if QT_VERSION >= 0x030000
text.replace( '<' , "&lt;" );
text.replace( '>' , "&gt;" );
#else
if ( text.find ('<') >= 0 ) {
text.replace( QRegExp("<") , "&lt;" );
}
if ( text.find ('>') >= 0 ) {
text.replace( QRegExp(">") , "&gt;" );
}
#endif
return text;
}
void KOEventViewer::keyPressEvent ( QKeyEvent * e )
{
switch ( e->key() ) {
case Qt::Key_Return:
case Qt::Key_Enter :
e->ignore();
break;
default:
- QTextBrowser::keyPressEvent ( e );
+ Q3TextBrowser::keyPressEvent ( e );
break;
}
}
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index 64eb4ff..3df667f 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -1,132 +1,135 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KOEVENTVIEWER_H
#define KOEVENTVIEWER_H
//
// Viewer widget for events.
//
-#include <qtextbrowser.h>
+#include <q3textbrowser.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <QKeyEvent>
#include <libkcal/event.h>
#include <libkcal/journal.h>
using namespace KCal;
#ifdef DESKTOP_VERSION
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qdialog.h>
#include <qlabel.h>
-#include <qbuttongroup.h>
+#include <q3buttongroup.h>
#include <kglobal.h>
class KOPrintPrefs : public QDialog
{
public:
KOPrintPrefs( QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("KO/Pi Printout") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 9 );
lay->setMargin( 9 );
QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this );
lay->addWidget( lab );
- lab->setAlignment( AlignCenter );
- QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this );
+ lab->setAlignment( Qt::AlignCenter );
+ Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Printout Mode"), this );
lay->addWidget( format );
format->setExclusive ( true ) ;
pmNo = new QRadioButton(i18n("Print unscaled"), format );
pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format );
new QRadioButton(i18n("Print scaled up/down to fit one page"), format );
pmScaledDown->setChecked( true );
QPushButton * ok = new QPushButton( i18n("OK"), this );
lay->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
}
int printMode()
{
if ( pmNo->isChecked() )
return 0;
if ( pmScaledDown->isChecked() )
return 1;
return 2;
}
private:
QRadioButton* pmNo;
QRadioButton* pmScaledDown;
};
#endif
-class KOEventViewer : public QTextBrowser {
+class KOEventViewer : public Q3TextBrowser {
Q_OBJECT
public:
KOEventViewer(QWidget *parent=0,const char *name=0);
virtual ~KOEventViewer();
void setSource(const QString &);
void setEvent(Event *event);
void addEvent(Event *event);
void setTodo(Todo *event, bool clearV = true );
void setJournal(Journal *jour, bool clearV = true );
void appendEvent(Event *event, int mode = 0 );
void appendTodo(Todo *event, int mode = 0 );
void appendJournal(Journal *jour, int mode = 0 );
void clearEvents(bool now=false);
void addText(QString text);
void setSyncMode( bool );
void setColorMode( int );
void mailToAttendees( bool all );
void printMe();
protected:
int mColorMode;
void addTag(const QString & tag,const QString & text);
void formatCategories(Incidence *event);
void formatAttendees(Incidence *event);
void formatReadOnly(Incidence *event);
void keyPressEvent ( QKeyEvent * e );
private:
- QTextBrowser *mEventTextView;
+ Q3TextBrowser *mEventTextView;
bool mSyncMode;
QString deTag(QString text);
QString mText;
QString mMailSubject;
Incidence* mCurrentIncidence;
signals:
void launchaddressbook(QString uid);
void showIncidence(QString uid);
};
#endif
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 2e936f3..3a37852 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -1,54 +1,57 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <klocale.h>
#include <libkcal/event.h>
#include <qtimer.h>
#include <qpushbutton.h>
+//Added by qt3to4:
+#include <QHideEvent>
+#include <QKeyEvent>
#include "koeventviewer.h"
#include <kmessagebox.h>
#include "koprefs.h"
#include <libkcal/todo.h>
-#include "qapp.h"
+#include "qapplication.h"
#include "koeventviewerdialog.h"
extern int globalFlagBlockAgenda;
KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
: KDialogBase(parent,name,
#ifndef DESKTOP_VERSION
true ,
#else
false,
#endif
i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
{
sendSignalViewerClosed = true;
mEventViewer = new KOEventViewer(this);
mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
setMainWidget(mEventViewer);
setButtonText(Ok, i18n("Edit") );
QObject::connect(findButton( Ok ),SIGNAL(clicked()),
SLOT(editIncidence()));
QObject::connect(this,SIGNAL(user1Clicked()),
SLOT(showIncidence()));
connect( mEventViewer, SIGNAL( showIncidence( QString ) ),SIGNAL( showIncidence( QString ) ));
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h
index 71696f4..947c10b 100644
--- a/korganizer/koeventviewerdialog.h
+++ b/korganizer/koeventviewerdialog.h
@@ -1,49 +1,52 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KOEVENTVIEWERDIALOG_H
#define KOEVENTVIEWERDIALOG_H
//
// Viewer dialog for events.
//
-#include <qtextview.h>
+#include <q3textview.h>
+//Added by qt3to4:
+#include <QKeyEvent>
+#include <QHideEvent>
#include <kdialogbase.h>
#include <libkcal/event.h>
using namespace KCal;
class KOEventViewer;
class KOEventViewerDialog : public KDialogBase {
Q_OBJECT
public:
KOEventViewerDialog(QWidget *parent=0,const char *name=0);
virtual ~KOEventViewerDialog();
void setEvent(Event *event);
void addEvent(Event *event);
void setTodo(Todo *event);
void setJournal(Journal *journal);
void setIncidence(Incidence *inc);
void addIncidence(Incidence *inc);
void addText(QString text);
void showMe();
void setSyncMode( bool );
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index ee9c9f6..8335ba9 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -6,70 +6,74 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qdialog.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qtextcodec.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
#include <qdir.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3Frame>
+#include <Q3PtrList>
#include <libkcal/calfilter.h>
#include "kofilterview.h"
#include "koprefs.h"
#include <kiconloader.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kcolorbutton.h>
#include <kmessagebox.h>
-KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent,
- const char* name,WFlags fl )
+KOFilterView::KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent,
+ const char* name,Qt::WFlags fl )
: KOFilterView_base(parent,name,fl)
{
mFilters = filterList;
connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters()));
}
KOFilterView::~KOFilterView()
{
// no need to delete child widgets, Qt does it all for us
}
bool KOFilterView::filtersEnabled()
{
return mEnabledCheck->isChecked();
}
void KOFilterView::setFiltersEnabled(bool set)
{
mEnabledCheck->setChecked(set);
emit filterChanged();
}
@@ -93,56 +97,56 @@ CalFilter *KOFilterView::selectedFilter()
}
void KOFilterView::setSelectedFilter(QString filterName)
{
int filter_num = mSelectionCombo->count();
int i;
for (i=0;i<filter_num;i++) {
if (mSelectionCombo->text(i)==filterName)
mSelectionCombo->setCurrentItem(i);
}
emit filterChanged();
}
void KOFilterView::setSelectedFilter( int fil )
{
if ( fil >= mSelectionCombo->count() )
return;
mSelectionCombo->setCurrentItem( fil );
emit filterChanged();
}
KOCalEditView::KOCalEditView(QWidget* parent,
const char* name )
- : QScrollView(parent,name)
+ : Q3ScrollView(parent,name)
{
mw = 0;
setResizePolicy( AutoOneFit );
- setFrameStyle ( QFrame::Panel | QFrame::Plain );
+ setFrameStyle ( Q3Frame::Panel | Q3Frame::Plain );
setLineWidth ( 1 );
setMidLineWidth ( 1 );
- setFocusPolicy(NoFocus);
+ setFocusPolicy(Qt::NoFocus);
}
KOCalEditView::~KOCalEditView()
{
// no need to delete child widgets, Qt does it all for us
}
void KOCalEditView::selectCal(int id ,bool b)
{
KOPrefs::instance()->getCalendar( id )->isEnabled = b;
emit calendarEnabled ( id, b );
emit needsUpdate();
}
void KOCalEditView::selectStdCal( int id )
{
KOCalRadioButton* it = mStdandardB.first();
while ( it ) {
it->blockSignals( true );
it->setChecked( it->num() == id );
it->blockSignals( false );
it = mStdandardB.next();
}
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
while ( kkf ) {
@@ -226,97 +230,97 @@ void KOCalEditView::infoCal( int id )
if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) {
emit calendarAdded( id );
emit needsUpdate();
QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) );
}
}
else {
emit requestCalendarInfo( id );
}
}
void KOCalEditView::readConfig()
{
mStdandardB.clear();
mEnabledB.clear();
mAlarmB.clear();
mROB.clear();
if ( mw ) delete mw;
mw = new QWidget ( viewport() );
addChild(mw);
int ii = 0;
- mainLayout = new QGridLayout ( mw , 2, 8 );
+ mainLayout = new Q3GridLayout ( mw , 2, 8 );
mainLayout->setMargin( 2 );
mainLayout->setSpacing( 2 );
QPushButton * addButT = new QPushButton ( mw );
- addButT->setFocusPolicy(NoFocus);
+ addButT->setFocusPolicy(Qt::NoFocus);
mainLayout->addWidget( addButT,0,0 );
addButT->setText( "D");
connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo()));
- QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") );
+ Q3WhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") );
//addBut->setPixmap ( SmallIcon("greenhook16"));
QPushButton *addBut = new QPushButton ( mw );
- addBut->setFocusPolicy(NoFocus);
+ addBut->setFocusPolicy(Qt::NoFocus);
mainLayout->addWidget( addBut,0,++ii );
addBut->setPixmap ( SmallIcon("eye"));
- QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") );
+ Q3WhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") );
connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
int max = addBut->sizeHint().height();
addBut->setMaximumWidth( max );
addButT->setFixedSize( QSize( max, max ) );
QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw );
mainLayout->addWidget( lab,0,++ii );
- QWhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") );
+ Q3WhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") );
//lab = new QLabel ( i18n(" "), mw );
//mainLayout->addWidget( lab,0,++ii );
//lab->setFixedWidth( 1 );
addBut = new QPushButton ( mw );
- addBut->setFocusPolicy(NoFocus);
+ addBut->setFocusPolicy(Qt::NoFocus);
mainLayout->addWidget( addBut,0,++ii );
addBut->setPixmap ( SmallIcon("bell"));
- QWhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") );
+ Q3WhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") );
connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
addBut->setMaximumWidth( addBut->sizeHint().height() );
addBut = new QPushButton ( mw );
- addBut->setFocusPolicy(NoFocus);
+ addBut->setFocusPolicy(Qt::NoFocus);
mainLayout->addWidget( addBut,0,++ii );
addBut->setPixmap ( SmallIcon("pencil"));
- QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") );
+ Q3WhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") );
connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
addBut->setMaximumWidth( addBut->sizeHint().height() );
lab = new QLabel ( "", mw );
mainLayout->addWidget( lab,0,++ii );
addBut = new QPushButton ( mw );
- addBut->setFocusPolicy(NoFocus);
+ addBut->setFocusPolicy(Qt::NoFocus);
mainLayout->addWidget( addBut,0,++ii );
addBut->setPixmap ( SmallIcon("plus"));
connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
- QWhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") );
+ Q3WhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") );
lab = new QLabel ( " ", mw );
mainLayout->addWidget( lab,0,++ii );
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
int row = 1;
bool errorLoadStandard = false;
while ( kkf ) {
int iii = 0;
KOCalRadioButton* rb = new KOCalRadioButton( mw );
mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb );
rb->setChecked( kkf->isStandard );
if ( kkf->isStandard && ( kkf->mErrorOnLoad || kkf->isReadOnly ) )
errorLoadStandard = true;
rb->setNum( kkf->mCalNumber );
connect (rb, SIGNAL (selectNum(int)), SLOT ( selectStdCal(int) ) );
if ( kkf->mErrorOnLoad || kkf->isReadOnly )
rb->setEnabled( false );
KOCalCheckButton* cb = new KOCalCheckButton( mw );
mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb );
cb->setChecked( kkf->isEnabled && !kkf->mErrorOnLoad );
cb->setNum( kkf->mCalNumber );
if ( kkf->mErrorOnLoad )
cb->setEnabled( false );
@@ -410,90 +414,90 @@ void KOCalEditView::addCal()
}
int KOCalEditView::addCalendar( QString name, QString file, bool ask )
{
file = QDir::convertSeparators( file );
QFileInfo fi ( file );
QString absFile = file;
bool isRelative = false;
if ( fi.isRelative() ) {
isRelative = true;
absFile = QDir::convertSeparators( KGlobalSettings::calendarDir()+file );
fi.setFile( absFile );
} else {
QString cd = QDir::convertSeparators( KGlobalSettings::calendarDir() );
if ( file.left( cd.length() ) == cd ) {
isRelative = true;
file = fi.fileName ();
fi.setFile( absFile );
}
}
if (!fi.exists() ) {
if ( ask )
if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No )
return 0;
QFile fileIn( absFile );
- if (!fileIn.open( IO_WriteOnly ) ) {
+ if (!fileIn.open( QIODevice::WriteOnly ) ) {
KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) );
return 0;
}
- QTextStream tsIn( &fileIn );
+ Q3TextStream tsIn( &fileIn );
tsIn.setCodec( QTextCodec::codecForName("utf8") );
tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n";
fileIn.close();
}
KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar();
kkf->mName = name;
kkf->mFileName = absFile;
kkf->mSavedFileName = file;
kkf->isRelative = isRelative;
emit calendarAdded( kkf->mCalNumber );
if ( ask )
emit needsUpdate();
QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
return kkf->mCalNumber;
}
int KOCalEditView::getBirtdayID()
{
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
while ( kkf ) {
if ( kkf->mName == i18n("Birthdays") )
return kkf->mCalNumber;
kkf = KOPrefs::instance()->mCalendars.next();
}
QString file = locateLocal( "data", "korganizer/birthdays.ics" );
return addCalendar( i18n("Birthdays"), file, false );
}
void KOCalEditView::enableAll()
{
toggleList( mEnabledB );
}
void KOCalEditView::enableAlarm()
{
toggleList( mAlarmB );
}
void KOCalEditView::disableRO()
{
toggleList( mROB, false );
}
-void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list , bool enable )
+void KOCalEditView::toggleList ( Q3PtrList<KOCalCheckButton> list , bool enable )
{
bool dis = !enable;
KOCalCheckButton* it = list.first();
while ( it ) {
if ( !it->isChecked() == enable && it->isEnabled() ) {
dis = !dis;
break;
}
it = list.next();
}
it = list.first();
while ( it ) {
if ( it->isEnabled() )
it->setChecked(dis);
it = list.next();
}
}
void KOCalEditView::deleteAll()
{
qDebug("delteAll");
}
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index 0dd423a..f1bbab4 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -5,77 +5,83 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOFILTERVIEW_H
#define KOFILTERVIEW_H
#include <qstring.h>
#include <qcheckbox.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qdialog.h>
-#include <qscrollview.h>
+#include <q3scrollview.h>
#include <qpushbutton.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3PtrList>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
#include <kconfig.h>
#include "kofilterview_base.h"
#include <libkcal/calfilter.h>
#include <kurlrequester.h>
#include <klineedit.h>
#include <kglobal.h>
#include <kmessagebox.h>
-class QGridLayout;
+class Q3GridLayout;
using namespace KCal;
class KONewCalPrefs : public QDialog
{
Q_OBJECT
public:
KONewCalPrefs( QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("Add new Calendar") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this );
lay->addWidget( lab );
nameE = new KLineEdit( this );
lay->addWidget( nameE );
lab = new QLabel( i18n("<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)"), this );
lay->addWidget( lab );
url = new KURLRequester ( this );
lay->addWidget( url );
QPushButton * ok = new QPushButton( i18n("OK"), this );
lay->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) );
connect (cancel, SIGNAL( clicked() ), this, SLOT ( reject()) );
int minwid = 440;
if ( QApplication::desktop()->width() < 480 ) minwid = 220;
setMinimumWidth( minwid );
resize(sizeHint() );
}
QString calName() { return nameE->text(); }
QString calFileName() { return url->url(); }
@@ -89,169 +95,169 @@ void checkValid() {
}
if ( url->url().isEmpty() ) {
KMessageBox::information( this, i18n("Sorry, the file name is empty!") );
url->setURL( nameE->text() + ".ics" );
return;
}
accept();
}
public:
KLineEdit* nameE;
KURLRequester *url;
};
class KOCalButton : public QPushButton
{
Q_OBJECT
public:
KOCalButton( QWidget *parent=0, const char *name=0 ) :
QPushButton( parent, name)
{
connect( this, SIGNAL( clicked() ),
SLOT( bottonClicked() ));
mNumber = -1;
- setFocusPolicy(NoFocus);
+ setFocusPolicy(Qt::NoFocus);
}
void setNum ( int num ) {mNumber = num; }
signals:
void selectNum ( int );
private:
int mNumber;
void keyPressEvent ( QKeyEvent * e )
{
e->ignore();
}
private slots :
void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); }
};
class KOCalCheckButton : public QCheckBox
{
Q_OBJECT
public:
KOCalCheckButton( QWidget *parent=0, const char *name=0 ) :
QCheckBox( parent, name)
{
connect( this, SIGNAL( toggled ( bool ) ),
SLOT( bottonClicked( bool ) ));
mNumber = -1;
- setFocusPolicy(NoFocus);
+ setFocusPolicy(Qt::NoFocus);
//setMaximumWidth( 10 );
}
void setNum ( int num ) {mNumber = num; }
signals:
void selectNum ( int, bool );
private:
int mNumber;
void keyPressEvent ( QKeyEvent * e )
{
e->ignore();
}
private slots :
void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); }
};
class KOCalRadioButton : public QRadioButton
{
Q_OBJECT
public:
KOCalRadioButton( QWidget *parent=0, const char *name=0 ) :
QRadioButton( parent, name)
{
connect( this, SIGNAL( toggled ( bool ) ),
SLOT( bottonClicked( bool ) ));
mNumber = -1;
- setFocusPolicy(NoFocus);
+ setFocusPolicy(Qt::NoFocus);
//setMaximumWidth( 10 );
}
int num() { return mNumber;}
void setNum ( int num ) {mNumber = num; }
signals:
void selectNum ( int );
private:
int mNumber;
void keyPressEvent ( QKeyEvent * e )
{
e->ignore();
}
private slots :
void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); }
};
class KOFilterView : public KOFilterView_base
{
Q_OBJECT
public:
- KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0);
+ KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, Qt::WFlags fl=0);
~KOFilterView();
void updateFilters();
bool filtersEnabled();
void setFiltersEnabled(bool);
CalFilter *selectedFilter();
void setSelectedFilter(QString);
void setSelectedFilter( int );
signals:
void filterChanged();
void editFilters();
private:
- QPtrList<CalFilter> *mFilters;
+ Q3PtrList<CalFilter> *mFilters;
};
-class KOCalEditView : public QScrollView
+class KOCalEditView : public Q3ScrollView
{
Q_OBJECT
public:
KOCalEditView( QWidget* parent=0,const char* name=0);
~KOCalEditView();
int addCalendar( QString calName, QString fileName, bool ask = true );
int getBirtdayID();
public slots:
void addCal();
void enableAll();
void enableAlarm();
void disableRO();
void deleteAll();
void selectStdCal(int);
void selectCal(int,bool );
void selectCalAlarm(int,bool );
void selectReadOnly(int,bool );
void setColor(const QColor &,int) ;
void deleteCal(int) ;
void infoCal(int) ;
void readConfig();
void defaultInfo();
void findNewStandard();
signals:
void alarmEnabled ( int cal, bool enable );
void calendarEnabled ( int cal, bool enable );
void calendarReadonly ( int cal, bool readonly );
void setCalendarDefault ( int cal );
void removeCalendar ( int cal );
void calendarAdded( int );
void needsUpdate();
void checkCalendar();
void requestCalendarInfo( int id );
private:
QWidget *mw;
- void toggleList ( QPtrList<KOCalCheckButton> , bool b = true );
- QPtrList<KOCalRadioButton> mStdandardB;
- QPtrList<KOCalCheckButton> mEnabledB;
- QPtrList<KOCalCheckButton> mAlarmB;
- QPtrList<KOCalCheckButton> mROB;
- QGridLayout* mainLayout;
+ void toggleList ( Q3PtrList<KOCalCheckButton> , bool b = true );
+ Q3PtrList<KOCalRadioButton> mStdandardB;
+ Q3PtrList<KOCalCheckButton> mEnabledB;
+ Q3PtrList<KOCalCheckButton> mAlarmB;
+ Q3PtrList<KOCalCheckButton> mROB;
+ Q3GridLayout* mainLayout;
};
#endif // KOFILTERVIEW_H
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp
index 79b97e8..63d044c 100644
--- a/korganizer/koimportoldialog.cpp
+++ b/korganizer/koimportoldialog.cpp
@@ -1,118 +1,118 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qpixmap.h>
#include <qlayout.h>
-#include <qprogressbar.h>
-#include <qprogressdialog.h>
-#include <qwidgetstack.h>
+#include <q3progressbar.h>
+#include <q3progressdialog.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
#include <qdir.h>
#include <qapplication.h>
-#include <qhbox.h>
+#include <q3hbox.h>
#include <qregexp.h>
-#include <qheader.h>
+#include <q3header.h>
#include <qdatetime.h>
-#include <qlistview.h>
+#include <q3listview.h>
#include <kdebug.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkdepim/kinputdialog.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include <kabc/stdaddressbook.h>
#include "koprefs.h"
#include "koglobals.h"
#include "koimportoldialog.h"
#include "../outport/msoutl9.h"
#include <ole2.h>
#include <comutil.h>
_Application gOlApp;
QDateTime mDdate2Qdtr( DATE dt)
{
COleDateTime odt;
SYSTEMTIME st;
odt = dt;
odt.GetAsSystemTime(st);
QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) );
return qdt;
}
-class OLEListViewItem : public QCheckListItem
+class OLEListViewItem : public Q3CheckListItem
{
public:
- OLEListViewItem( QListView *parent, QString text ) :
- QCheckListItem( parent, text, QCheckListItem::CheckBox ) { mData = 0; };
- OLEListViewItem( QListViewItem *after, QString text ) :
- QCheckListItem( after, text, QCheckListItem::CheckBox ) { mData = 0; };
+ OLEListViewItem( Q3ListView *parent, QString text ) :
+ Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { mData = 0; };
+ OLEListViewItem( Q3ListViewItem *after, QString text ) :
+ Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { mData = 0; };
~OLEListViewItem() {};
void setData( DWORD data ) {mData= data; };
DWORD data() { return mData ;};
private:
DWORD mData;
};
KOImportOLdialog::KOImportOLdialog( const QString &caption,
Calendar *calendar, QWidget *parent ) :
KDialogBase( Plain, caption, User1 | Close, Ok,
parent, caption, true, false, i18n("Import!") )
{
- QHBox * mw = new QHBox( this );
+ Q3HBox * mw = new Q3HBox( this );
setMainWidget( mw );
- mListView = new QListView( mw );
+ mListView = new Q3ListView( mw );
mListView->addColumn(i18n("Select Folder to import"));
mListView->addColumn(i18n("Content Type"));
mCalendar = calendar;
connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply()));
setupFolderView();
resize( sizeHint().width()+50, sizeHint().height()+50 );
}
KOImportOLdialog::~KOImportOLdialog()
{
}
void KOImportOLdialog::setupFolderView()
{
SCODE sc = ::OleInitialize(NULL);
if ( FAILED ( sc ) ) {
KMessageBox::information(this,"OLE initialisation failed");
return;
}
if(!gOlApp.CreateDispatch(_T("Outlook.Application"),NULL)){
KMessageBox::information(this,"Sorry, cannot access Outlook");
@@ -191,49 +191,49 @@ void KOImportOLdialog::addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent
void KOImportOLdialog::slotApply()
{
importedItems = 0;
OLEListViewItem* child = (OLEListViewItem*) mListView->firstChild();
while ( child ) {
if ( child->isOn()&& child->data() )
readCalendarData( child->data() );
child = (OLEListViewItem*) child->itemBelow();
}
QString mes = i18n("Importing complete.\n\n%1 items imported.").arg( importedItems);
KMessageBox::information(this,mes);
}
void KOImportOLdialog::readCalendarData( DWORD folder )
{
LPDISPATCH dispItem = (LPDISPATCH)folder;
dispItem->AddRef();
MAPIFolder mf(dispItem);
mf.m_lpDispatch->AddRef();
_Items folderItems;
_variant_t indx((long)0);
LPDISPATCH itm;
int i;
folderItems = mf.GetItems();
- QProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this );
+ Q3ProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this );
bar.setCaption (i18n("Importing!") );
int h = bar.sizeHint().height() ;
int w = 300;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
//bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
bar.show();
for(i=1; i <= folderItems.GetCount(); ++i)
{
qApp->processEvents();
if ( ! bar.isVisible() )
return ;
bar.setProgress( i );
bar.raise();
indx = (long)i;
itm = folderItems.Item(indx.Detach());
_AppointmentItem * pItem = (_AppointmentItem *)&itm;
ol2kopiCalendar( pItem );
itm->Release();
}
}
void KOImportOLdialog::slotOk()
{
QDialog::accept();
diff --git a/korganizer/koimportoldialog.h b/korganizer/koimportoldialog.h
index c8847c5..d66f099 100644
--- a/korganizer/koimportoldialog.h
+++ b/korganizer/koimportoldialog.h
@@ -10,75 +10,75 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOINCIDENCEEDITOR_H
#define KOINCIDENCEEDITOR_H
#include <kdialogbase.h>
#include <afxdisp.h>
#include <libkcal/calendar.h>
#include <libkcal/event.h>
class QDateTime;
-class QListView;
+class Q3ListView;
class OLEListViewItem;
class _AppointmentItem;
namespace KPIM { class CategorySelectDialog; }
using namespace KCal;
/**
This is the base class for the calendar component editors.
*/
class KOImportOLdialog : public KDialogBase
{
Q_OBJECT
public:
/**
Construct new IncidenceEditor.
*/
KOImportOLdialog( const QString &caption, Calendar *calendar,
QWidget *parent );
virtual ~KOImportOLdialog();
/** Initialize editor. This function creates the tab widgets. */
void init();
public slots:
signals:
protected slots:
void slotApply();
void slotOk();
void slotCancel();
protected:
void setupFolderView();
void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent);
void readCalendarData( DWORD folder );
void ol2kopiCalendar( _AppointmentItem * , bool computeRecurrence = true );
Calendar *mCalendar;
- QListView * mListView;
+ Q3ListView * mListView;
QString getUidByEmail( QString email );
private:
int importedItems;
};
#endif
diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp
index 236f6f9..2060ea1 100644
--- a/korganizer/koincidenceeditor.cpp
+++ b/korganizer/koincidenceeditor.cpp
@@ -1,54 +1,56 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qpixmap.h>
#include <qlayout.h>
-#include <qwidgetstack.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
#include <qdir.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
#include <kdebug.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkdepim/kinputdialog.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include "koprefs.h"
#include "koincidenceeditor.h"
KOIncidenceEditor::KOIncidenceEditor( const QString &caption,
Calendar *calendar, QWidget *parent ) :
KDialogBase( Tabbed, caption, Ok | Apply | Cancel |/* Default | */User1, Ok,
parent, caption, true, false ),
mSaveTemplateDialog( 0 )
{
mCalendar = calendar;
@@ -61,51 +63,51 @@ KOIncidenceEditor::KOIncidenceEditor( const QString &caption,
// showButton( Apply, false );
// } else {
showButton( Apply, false );
saveTemplateText = i18n("Ok+Agenda");
// }
setButtonText( User1, saveTemplateText );
//mCategoryDialog = new KPIM::CategorySelectDialog( KOPrefs::instance(), this );
// KOGlobals::fitDialogToScreen( mCategoryDialog );
//connect(mCategoryDialog,SIGNAL(editCategories()),SIGNAL(editCategories()));
//connect( this, SIGNAL( defaultClicked() ), SLOT( slotLoadTemplate() ) );
// connect( this, SIGNAL( user1Clicked() ), SLOT( slotSaveTemplate() ) );
connect( this, SIGNAL( user1Clicked() ), SLOT( slotShowIncidence() ) );
}
KOIncidenceEditor::~KOIncidenceEditor()
{
//delete mCategoryDialog;
}
void KOIncidenceEditor::setupAttendeesTab()
{
- QFrame *topFrame = addPage(i18n("Attendees"));
+ Q3Frame *topFrame = addPage(i18n("Attendees"));
- QBoxLayout *topLayout = new QVBoxLayout(topFrame);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
mDetails = new KOEditorDetails(spacingHint()-2,topFrame);
topLayout->addWidget(mDetails);
}
void KOIncidenceEditor::alarmWarning()
{
KMessageBox::information( 0, i18n("The alarm for this calendar\nis currently disabled!\nEnable it in resource settings."), i18n("Alarm disabled warning"));
}
void KOIncidenceEditor::slotApply()
{
processInput( false );
}
void KOIncidenceEditor::accept()
{
slotOk();
}
void KOIncidenceEditor::slotOk()
{
if ( processInput( false ) ) QDialog::accept();
}
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 406df5a..51594ff 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -4,122 +4,128 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
//
// View of Journal entries
#include <qlayout.h>
-#include <qscrollview.h>
-#include <qpopupmenu.h>
-#include <qhbox.h>
+#include <q3scrollview.h>
+#include <q3popupmenu.h>
+#include <q3hbox.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QPixmap>
+#include <Q3PtrList>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
#include <klocale.h>
#include <kdebug.h>
#include "koprefs.h"
#include <kglobal.h>
#include <ktextedit.h>
#include <libkcal/calendar.h>
#include "journalentry.h"
#include "kojournalview.h"
using namespace KOrg;
KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
const char *name)
: KOrg::BaseView(calendar, parent, name)
{
mCalendar = calendar;
- QHBox * vb = new QHBox ( this );
+ Q3HBox * vb = new Q3HBox ( this );
QPushButton * newJournal = new QPushButton( vb );
QPixmap icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("ko16old");
else
icon = SmallIcon("ko24old");
newJournal->setPixmap (icon ) ;
int size = newJournal->sizeHint().height();
newJournal->setFixedSize( size, size );
mDateLabel = new QLabel ( vb );
mDateLabel->setMargin(1);
- mDateLabel->setAlignment(AlignCenter);
- QScrollView * sv = new QScrollView( this );
- QVBoxLayout * hbl = new QVBoxLayout( this );
+ mDateLabel->setAlignment(Qt::AlignCenter);
+ Q3ScrollView * sv = new Q3ScrollView( this );
+ Q3VBoxLayout * hbl = new Q3VBoxLayout( this );
hbl->addWidget( vb );
hbl->addWidget( sv );
parWid = new QWidget( sv->viewport() );
sv->addChild(parWid);
- sv->setResizePolicy( QScrollView:: AutoOneFit );
- mTopLayout = new QVBoxLayout(parWid);
+ sv->setResizePolicy( Q3ScrollView:: AutoOneFit );
+ mTopLayout = new Q3VBoxLayout(parWid);
connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) );
getNewEntry();
}
KOJournalView::~KOJournalView()
{
}
int KOJournalView::currentDateCount()
{
return 0;
}
JournalEntry* KOJournalView::getNewEntry()
{
JournalEntry* Entry = new JournalEntry(mCalendar,parWid);
jEntries.append( Entry );
mTopLayout->addWidget(Entry);
Entry->setFont ( KOPrefs::instance()->mJornalViewFont );
connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ;
connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ;
connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ;
return Entry;
}
-QPtrList<Incidence> KOJournalView::selectedIncidences()
+Q3PtrList<Incidence> KOJournalView::selectedIncidences()
{
- QPtrList<Incidence> eventList;
+ Q3PtrList<Incidence> eventList;
return eventList;
}
void KOJournalView::updateConfig()
{
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
mEntry = jEntries.next();
}
}
void KOJournalView::updateView()
{
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
mEntry = jEntries.next();
}
showDates( mDate, QDate() );
}
void KOJournalView::checkModified()
{
flushView();
}
@@ -141,55 +147,55 @@ void KOJournalView::clearList()
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->clear();
mEntry = jEntries.next();
}
}
void KOJournalView::newJournal()
{
//qDebug(" KOJournalView::newJournal()");
flushView();
Journal* mJournal = new Journal;
mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
mCalendar->addJournal(mJournal);
showDates( mDate, QDate() );
}
void KOJournalView::showOnly ( Journal* j )
{
//qDebug("showOnly %x ", j);
flushView();
if ( j == 0 ) {
showDates( mDate, QDate() );
return;
}
- QPtrList<Journal> jl;
+ Q3PtrList<Journal> jl;
jl.append ( j );
showList( jl );
JournalEntry* mEntry = jEntries.first();
mEntry->setShowOnly();
}
-void KOJournalView::showList(QPtrList<Journal> jl)
+void KOJournalView::showList(Q3PtrList<Journal> jl)
{
static bool ff = false;
if ( ff ) return;
ff = true;
//qDebug("KOJournalView::showList %d",jl.count() );
JournalEntry* mEntry = jEntries.first();
JournalEntry* firstEntry = mEntry;
int count = jl.count();
int iii = 0;
QWidget* fw = qApp->focusWidget ();
while ( iii < count ) {
if ( !mEntry ) {
mEntry = getNewEntry();
mEntry->setVisibleMode( true );
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii), false);
mEntry->setVisibleMode( true );
mEntry->show();
mEntry = 0;
} else {
int xxx = -1, yyy = -1;
if ( ((QWidget*) mEntry->editor() ) == fw ) {
mEntry->editor()->getCursorPosition( &xxx,&yyy);
}
@@ -204,47 +210,47 @@ void KOJournalView::showList(QPtrList<Journal> jl)
mEntry = jEntries.next();
}
++iii;
}
while ( mEntry ) {
mEntry->setDate(mDate);
mEntry->clear();
if ( mEntry != firstEntry ) {
mEntry->hide();
mEntry->setVisibleMode( false );
}
else {
mEntry->setVisibleMode( true );
mEntry->show();
}
mEntry = jEntries.next();
}
ff = false;
}
void KOJournalView::showDates(const QDate &start, const QDate &)
{
mDate = start;
mDateLabel->setText(KGlobal::locale()->formatDate(mDate));
- QPtrList<Journal> jl = calendar()->journals4Date( start );
+ Q3PtrList<Journal> jl = calendar()->journals4Date( start );
showList( jl );
}
-void KOJournalView::showEvents(QPtrList<Event>)
+void KOJournalView::showEvents(Q3PtrList<Event>)
{
// After new creation of list view no events are selected.
// emit incidenceSelected( 0 );
}
void KOJournalView::changeEventDisplay(Event *, int /*action*/)
{
updateView();
}
void KOJournalView::keyPressEvent ( QKeyEvent * e )
{
//qDebug("keyPressEven ");
if ( e->state() == Qt::ControlButton ) {
if ( e->key () == Qt::Key_Right || e->key () == Qt::Key_Left )
e->ignore();
}
}
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h
index 7fa94ae..22f26cd 100644
--- a/korganizer/kojournalview.h
+++ b/korganizer/kojournalview.h
@@ -4,77 +4,82 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOJOURNALVIEW_H
#define _KOJOURNALVIEW_H
#include <korganizer/baseview.h>
#include <qlayout.h>
+//Added by qt3to4:
+#include <QKeyEvent>
+#include <Q3PtrList>
+#include <QLabel>
+#include <Q3BoxLayout>
class JournalEntry;
class QLabel;
/**
* This class provides a journal view.
* @short View for Journal components.
* @author Cornelius Schumacher <schumacher@kde.org>
* @see KOBaseView
*/
class KOJournalView : public KOrg::BaseView
{
Q_OBJECT
public:
KOJournalView(Calendar *calendar, QWidget *parent = 0,
const char *name = 0);
~KOJournalView();
virtual int currentDateCount();
void clearList();
- virtual QPtrList<Incidence> selectedIncidences();
+ virtual Q3PtrList<Incidence> selectedIncidences();
DateList selectedDates()
{DateList q;
return q;};
void checkModified();
signals:
void deleteJournal(Journal *);
public slots:
void showOnly ( Journal* );
void newJournal();
void updateView();
void flushView();
void updateConfig();
void showDates( const QDate &start, const QDate &end );
- void showEvents(QPtrList<Event> eventList);
+ void showEvents(Q3PtrList<Event> eventList);
void changeEventDisplay(Event *, int);
private:
- void showList(QPtrList<Journal> jl);
+ void showList(Q3PtrList<Journal> jl);
Calendar *mCalendar;
JournalEntry* getNewEntry();
- QPtrList<JournalEntry> jEntries;
+ Q3PtrList<JournalEntry> jEntries;
void keyPressEvent ( QKeyEvent * ) ;
- QBoxLayout *mTopLayout;
+ Q3BoxLayout *mTopLayout;
QWidget *parWid;
QLabel * mDateLabel;
QDate mDate;
};
#endif
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 192f8c0..0ea1d50 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1,100 +1,109 @@
/*
This file is part of KOrganizer.
Copyright (c) 1999 Preston Brown
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qlistview.h>
+#include <q3listview.h>
#include <qlayout.h>
#include <qlabel.h>
-#include <qpopupmenu.h>
-#include <qprogressbar.h>
+#include <q3popupmenu.h>
+#include <q3progressbar.h>
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qdialog.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qdir.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
#include <qregexp.h>
#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <q3paintdevicemetrics.h>
+//Added by qt3to4:
+#include <QPixmap>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <QEvent>
+#include <Q3VBoxLayout>
+#include <Q3PtrList>
+
+#include<QDesktopWidget>
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kglobal.h>
#include <libkdepim/kpimglobalprefs.h>
#include <libkcal/calendar.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include <libkcal/vcalformat.h>
#include <libkcal/recurrence.h>
#include <libkcal/filestorage.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkcal/kincidenceformatter.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koglobals.h"
#include "koprefs.h"
#include "kfiledialog.h"
#include "kolistview.h"
#include "koeventviewer.h"
extern QPixmap* sgListViewCompletedPix[6];
extern QPixmap* sgListViewJournalPix;
-class KOListViewWhatsThis :public QWhatsThis
+class KOListViewWhatsThis :public Q3WhatsThis
{
public:
- KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
+ KOListViewWhatsThis( QWidget *wid, KOListView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { };
protected:
virtual QString text( const QPoint& p)
{
return _view->getWhatsThisText(p) ;
}
private:
QWidget* _wid;
KOListView * _view;
};
ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
{
mItem = item;
mDate = date;
}
ListItemVisitor::~ListItemVisitor()
{
}
bool ListItemVisitor::visit(Event *e)
{
@@ -253,217 +262,217 @@ bool ListItemVisitor::visit(Journal * j)
return true;
}
KOListView::KOListView(Calendar *calendar, QWidget *parent,
const char *name)
: KOEventView(calendar, parent, name)
{
mActiveItem = 0;
mForceShowCompletedTodos = false;
mListView = new KOListViewListView(this);
mListView->addColumn(i18n("Summary"));
mListView->addColumn(i18n("Start Date"));
mListView->addColumn(i18n("Start Time"));
mListView->addColumn(i18n("End/Due Date"));
mListView->addColumn(i18n("End/Due Time"));
mListView->addColumn(i18n("Duration"));
mListView->addColumn(i18n("Alarm")); // alarm set?
mListView->addColumn(i18n("Recurs")); // recurs?
mListView->addColumn(i18n("Cancelled"));
mListView->addColumn(i18n("Categories"));
mListView->addColumn(i18n("Calendar"));
mListView->addColumn(i18n("Last Modified"));
- mListView->setColumnAlignment(0,AlignLeft);
- mListView->setColumnAlignment(1,AlignLeft);
- mListView->setColumnAlignment(2,AlignHCenter);
- mListView->setColumnAlignment(3,AlignLeft);
- mListView->setColumnAlignment(4,AlignHCenter);
- mListView->setColumnAlignment(5,AlignLeft);
- mListView->setColumnAlignment(6,AlignLeft);
- mListView->setColumnAlignment(7,AlignLeft);
- mListView->setColumnAlignment(8,AlignLeft);
- mListView->setColumnAlignment(9,AlignLeft);
- mListView->setColumnAlignment(10,AlignLeft);
- mListView->setColumnAlignment(11,AlignLeft);
+ mListView->setColumnAlignment(0,Qt::AlignLeft);
+ mListView->setColumnAlignment(1,Qt::AlignLeft);
+ mListView->setColumnAlignment(2,Qt::AlignHCenter);
+ mListView->setColumnAlignment(3,Qt::AlignLeft);
+ mListView->setColumnAlignment(4,Qt::AlignHCenter);
+ mListView->setColumnAlignment(5,Qt::AlignLeft);
+ mListView->setColumnAlignment(6,Qt::AlignLeft);
+ mListView->setColumnAlignment(7,Qt::AlignLeft);
+ mListView->setColumnAlignment(8,Qt::AlignLeft);
+ mListView->setColumnAlignment(9,Qt::AlignLeft);
+ mListView->setColumnAlignment(10,Qt::AlignLeft);
+ mListView->setColumnAlignment(11,Qt::AlignLeft);
mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this);
int iii = 0;
for ( iii = 0; iii< 12 ; ++iii )
- mListView->setColumnWidthMode( iii, QListView::Manual );
+ mListView->setColumnWidthMode( iii, Q3ListView::Manual );
- QBoxLayout *layoutTop = new QVBoxLayout(this);
+ Q3BoxLayout *layoutTop = new Q3VBoxLayout(this);
layoutTop->addWidget(mListView);
mListView->setFont ( KOPrefs::instance()->mListViewFont );
mPopupMenu = eventPopup();
- QPopupMenu* selPopup = new QPopupMenu ( this );
+ Q3PopupMenu* selPopup = new Q3PopupMenu ( this );
mPopupMenu->insertSeparator();
selPopup->insertItem(i18n("All"),this,
SLOT(allSelection()));
selPopup->insertItem(i18n("None"),this,
SLOT(clearSelection()));
selPopup->insertItem(i18n("Delete selected..."),this,
SLOT(deleteAll()));
mPopupMenu->insertItem(i18n("Selection"), selPopup );
- mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mPopupMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("Hide all selected"),this,
SLOT(hideAll()),true);
selPopup->insertSeparator();
- QPopupMenu * exportPO = new QPopupMenu ( this );
+ Q3PopupMenu * exportPO = new Q3PopupMenu ( this );
selPopup->insertItem( i18n("Export"), exportPO );
#ifdef DESKTOP_VERSION
mPopupMenu->insertSeparator();
- mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mPopupMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("Print complete list..."),this,
SLOT(printList()),true);
#endif
- mCalPopup = new QPopupMenu ( this );
+ mCalPopup = new Q3PopupMenu ( this );
selPopup->insertItem( i18n("Set Calendar"), mCalPopup );
selPopup->insertItem(i18n("Set categories")+"...",this,
SLOT(setCat()) );
selPopup->insertItem( i18n("Set alarm..."),this,
SLOT(setAlarm()));
#if 0
- mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mPopupMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("Set categories")+"...",this,
SLOT(setCat()),true);
- mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mPopupMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("Set alarm..."),this,
SLOT(setAlarm()),true);
#endif
QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this,
SLOT( populateCalPopup() ));
QObject::connect(mCalPopup,SIGNAL(activated( int )),this,
SLOT( setCalendar( int ) ));
QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this,
SLOT( catChanged( Incidence * ) ));
exportPO->insertItem( i18n("As iCal (ics) file..."),this,
SLOT(saveToFile()));
exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
SLOT(saveToFileVCS()));
exportPO->insertItem( i18n("Journal/Details..."),this,
SLOT(saveDescriptionToFile()));
// mPopupMenu->insertSeparator();
// mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
// i18n("Add Categ. to selected..."),this,
// SLOT(addCat()),true);
//mPopupMenu->insertSeparator();
#ifndef DESKTOP_VERSION
selPopup->insertSeparator();
selPopup->insertItem( i18n("Beam via IR..."),this,
SLOT(beamSelected()));
#if 0
- mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mPopupMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("Beam via IR"),this,
SLOT(beamSelected()),true);
#endif
#endif
/*
mPopupMenu = new QPopupMenu;
mPopupMenu->insertItem(i18n("Edit Event"), this,
SLOT (editEvent()));
mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
SLOT (deleteEvent()));
mPopupMenu->insertSeparator();
mPopupMenu->insertItem(i18n("Show Dates"), this,
SLOT(showDates()));
mPopupMenu->insertItem(i18n("Hide Dates"), this,
SLOT(hideDates()));
*/
QObject::connect(mListView,SIGNAL( newEvent()),
this,SIGNAL(signalNewEvent()));
- QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
- this,SLOT(defaultItemAction(QListViewItem *)));
- QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *,
+ QObject::connect(mListView,SIGNAL(doubleClicked(Q3ListViewItem *)),
+ this,SLOT(defaultItemAction(Q3ListViewItem *)));
+ QObject::connect(mListView,SIGNAL(rightButtonPressed( Q3ListViewItem *,
const QPoint &, int )),
- this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
- QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
- SLOT(processSelectionChange(QListViewItem *)));
+ this,SLOT(popupMenu(Q3ListViewItem *,const QPoint &,int)));
+ QObject::connect(mListView,SIGNAL(currentChanged(Q3ListViewItem *)),
+ SLOT(processSelectionChange(Q3ListViewItem *)));
QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
SIGNAL(showIncidenceSignal(Incidence *)) );
readSettings(KOGlobals::config(),"KOListView Layout");
}
KOListView::~KOListView()
{
delete mPopupMenu;
#if QT_VERSION >= 0x030000
#else
delete mKOListViewWhatsThis;
#endif
}
void KOListView::catChanged( Incidence* inc)
{
KOListViewItem* item = getItemForEvent(inc);
if (item) {
ListItemVisitor v(item, mStartDate );
inc->accept(v);
}
}
QString KOListView::getWhatsThisText(QPoint p)
{
KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p );
if ( item )
return KIncidenceFormatter::instance()->getFormattedText( item->data(),
KOPrefs::instance()->mWTshowDetails,
KOPrefs::instance()->mWTshowCreated,
KOPrefs::instance()->mWTshowChanged);
return i18n("That is the list view" );
}
void KOListView::setCalendar( int c )
{
int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ),
i18n("Continue"), i18n("Cancel"), 0,
0, 1 );
if ( result != 0 ) {
return;
}
- QPtrList<Incidence> delSel = getSelectedIncidences() ;
+ Q3PtrList<Incidence> delSel = getSelectedIncidences() ;
int icount = delSel.count();
if ( icount ) {
Incidence *incidence = delSel.first();
while ( incidence ) {
incidence->setCalID( c );
KOListViewItem * item = getItemForEvent( incidence );
if ( item ) {
ListItemVisitor v(item, mStartDate );
incidence->accept(v);
}
incidence = delSel.next();
}
}
- QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
+ Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
while ( cal ) {
mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
if ( cal->isStandard )
mCalendar->setDefaultCalendar( cal->mCalNumber );
cal = calendars.next();
}
mCalendar->setSyncEventsReadOnly();
mCalendar->reInitAlarmSettings();
}
void KOListView::populateCalPopup()
{
mCalPopup->clear();
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
while ( kkf ) {
int index = mCalPopup->insertItem( kkf->mName+"...", kkf->mCalNumber);
if ( kkf->mErrorOnLoad || kkf->isReadOnly )
mCalPopup->setItemEnabled( index, false );
kkf = KOPrefs::instance()->mCalendars.next();
}
}
@@ -476,139 +485,139 @@ void KOListView::updateList()
void KOListView::clearList()
{
clear ();
}
void KOListView::setCat()
{
bool set = true;
int result = KMessageBox::warningYesNoCancel(this,
i18n("Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?"),
i18n("Set categories"),
i18n("Add"),
i18n("Reset"));
if (result == KMessageBox::Cancel) return;
if (result == KMessageBox::Yes) set = false;
setCategories( set );
}
void KOListView::setAlarm()
{
KOAlarmPrefs kap( this);
if ( !kap.exec() )
return;
- QPtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos
+ Q3PtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos
Incidence* inc = delSel.first();
int count = 0;
while ( inc ) {
++count;
if (kap.mAlarmButton->isChecked()) {
if (inc->alarms().count() == 0)
inc->newAlarm();
Alarm *alarm = inc->alarms().first();
alarm->setEnabled(true);
int j = kap.mAlarmTimeEdit->value()* -60;
if (kap.mAlarmIncrCombo->currentItem() == 1)
j = j * 60;
else if (kap.mAlarmIncrCombo->currentItem() == 2)
j = j * (60 * 24);
alarm->setStartOffset( j );
if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) {
alarm->setProcedureAlarm(kap.mAlarmProgram);
}
else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn())
alarm->setAudioAlarm(kap.mAlarmSound);
else
alarm->setType(Alarm::Invalid);
} else {
- QPtrList<Alarm> alarms = inc->alarms();
+ Q3PtrList<Alarm> alarms = inc->alarms();
Alarm *alarm;
for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
alarm->setEnabled(false);
alarm->setType(Alarm::Invalid);
}
}
KOListViewItem* item = getItemForEvent(inc);
if (item) {
ListItemVisitor v(item, mStartDate );
inc->accept(v);
}
inc = delSel.next();
}
topLevelWidget()->setCaption( i18n("Changed alarm for %1 items").arg( count ) );
qDebug("KO: Set alarm for %d items", count);
calendar()->reInitAlarmSettings();
QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
}
void KOListView::setCategories( bool removeOld )
{
KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
csd->setColorEnabled();
if (! csd->exec()) {
delete csd;
return;
}
QStringList catList = csd->selectedCategories();
delete csd;
- QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;
+ Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;
Incidence* inc = delSel.first();
while ( inc ) {
if ( removeOld ) {
inc->setCategories( catList, false );
} else {
inc->addCategories( catList, false );
}
KOListViewItem* item = getItemForEvent(inc);
if (item) {
ListItemVisitor v(item, mStartDate );
inc->accept(v);
}
inc = delSel.next();
}
QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
}
void KOListView::beamSelected()
{
- QPtrList<Incidence> delSel = getSelectedIncidences() ;
+ Q3PtrList<Incidence> delSel = getSelectedIncidences() ;
if ( delSel.count() )
emit beamIncidenceList( delSel );
}
void KOListView::saveDescriptionToFile()
{
int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."),
i18n("Continue"), i18n("Cancel"), 0,
0, 1 );
if ( result != 0 ) {
return;
}
- QPtrList<Incidence> delSel = getSelectedIncidences() ;
+ Q3PtrList<Incidence> delSel = getSelectedIncidences() ;
int icount = delSel.count();
if ( icount ) {
QString fn = KOPrefs::instance()->mLastSaveFile;
fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
if ( fn == "" )
return;
QFileInfo info;
info.setFile( fn );
QString mes;
bool createbup = true;
if ( info. exists() ) {
mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
i18n("Overwrite!"), i18n("Cancel"), 0,
0, 1 );
if ( result != 0 ) {
createbup = false;
}
}
if ( createbup ) {
QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") +
KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false);
Incidence *incidence = delSel.first();
@@ -624,134 +633,134 @@ void KOListView::saveDescriptionToFile()
text +="\n(" + i18n("Location: ") + incidence->location()+ ")";
text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
text +="\n" + i18n("Description: ") + "\n"+ incidence->description();
++icount;
} else {
if ( !incidence->description().isEmpty() ) {
text += "\n************************************\n";
if ( incidence->typeID() == todoID )
text += i18n("To-Do: ");
text += incidence->summary();
if ( !incidence->location().isEmpty() )
text +="\n(" + i18n("Location: ") + incidence->location()+ ")";
if ( incidence->hasStartDate() )
text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false );
text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
text += "\n" + i18n("Description: ") + "\n" + incidence->description();
++icount;
}
}
incidence = delSel.next();
}
QFile file( fn );
- if (!file.open( IO_WriteOnly ) ) {
+ if (!file.open( QIODevice::WriteOnly ) ) {
topLevelWidget()->setCaption(i18n("File open error - nothing saved!") );
return;
}
- QTextStream ts( &file );
+ Q3TextStream ts( &file );
ts << text;
file.close();
//qDebug("%s ", text.latin1());
mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount );
KOPrefs::instance()->mLastSaveFile = fn;
topLevelWidget()->setCaption(mes);
}
}
}
void KOListView::saveToFileVCS()
{
writeToFile( false );
}
void KOListView::saveToFile()
{
writeToFile( true );
}
-QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos )
+Q3PtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos )
{
- QPtrList<Incidence> delSel ;
+ Q3PtrList<Incidence> delSel ;
bool addSubTodos = false;
bool askSubTodos = true;
- QListViewItem *item = mListView->firstChild ();
+ Q3ListViewItem *item = mListView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
Incidence* inc = ((KOListViewItem *)item)->data();
if ( ( addSubTodos && delSel.findRef( inc ) == -1) || !addSubTodos ) {
if ( (inc->typeID() == todoID && includeTodos) ||
(inc->typeID() == eventID && includeEvents) ||
(inc->typeID() == journalID && includeJournals) ) {
if ( inc->typeID() == todoID && onlyDueTodos ) {
if ( ((Todo*)inc)->hasDueDate() )
delSel.append( inc );
} else
delSel.append( inc );
}
}
if ( inc->typeID() == todoID ) {
Todo * todo = (Todo*) inc;
if ( todo->relations().count() ) {
if ( askSubTodos ) {
int result = KMessageBox::warningYesNoCancel(this,
i18n("One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?"),
i18n("Todo has subtodos"),
i18n("Yes"),
i18n("No"));
if ( result == KMessageBox::Cancel ) {
delSel.clear();
return delSel;
}
if (result == KMessageBox::Yes)
addSubTodos = true;
askSubTodos = false;
}
if ( addSubTodos ) {
- QPtrList<Incidence> tempSel ;
+ Q3PtrList<Incidence> tempSel ;
inc->addRelationsToList( &tempSel );
Incidence* tempinc = tempSel.first();
while ( tempinc ) {
if ( delSel.findRef( tempinc ) == -1 ) {
if ( tempinc->typeID() == todoID && onlyDueTodos ) {
if ( ((Todo*)tempinc)->hasDueDate() )
delSel.append( tempinc );
} else
delSel.append( tempinc );
}
tempinc = tempSel.next();
}
}
}
}
}
item = item->nextSibling();
}
return delSel;
}
void KOListView::writeToFile( bool iCal )
{
- QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;
+ Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;
if ( !iCal ) {
bool journal = false;
Incidence *incidence = delSel.first();
while ( incidence ) {
if ( incidence->typeID() == journalID ) {
journal = true;
break;
}
incidence = delSel.next();
}
if ( journal ) {
int result = KMessageBox::warningContinueCancel(this,
i18n("The journal entries can not be\nexported to a vCalendar file."),
i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
true);
if (result != KMessageBox::Continue) return;
}
}
if ( delSel.count() ) {
QString fn = KOPrefs::instance()->mLastSaveFile;
QString extension;
if ( iCal ) {
if ( fn.right( 4 ).lower() == ".vcs" ) {
fn = fn.left( fn.length() -3) + "ics";
@@ -782,133 +791,133 @@ void KOListView::writeToFile( bool iCal )
CalendarLocal cal;
cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
Incidence *incidence = delSel.first();
while ( incidence ) {
cal.addIncidence( incidence->clone() );
incidence = delSel.next();
}
if ( iCal ) {
ICalFormat format;
format.save( &cal, fn );
} else {
VCalFormat format;
format.save( &cal, fn );
}
mes = i18n("KO/Pi:Saved %1").arg(fn );
KOPrefs::instance()->mLastSaveFile = fn;
topLevelWidget()->setCaption(mes);
}
}
QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
}
void KOListView::hideAll()
{
- QPtrList<QListViewItem> delSel ;
- QListViewItem *item = mListView->firstChild ();
+ Q3PtrList<Q3ListViewItem> delSel ;
+ Q3ListViewItem *item = mListView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
delSel.append(item);
}
item = item->nextSibling();
}
item = delSel.first() ;
while ( item ) {
- QListViewItem * del = item;
+ Q3ListViewItem * del = item;
item = delSel.next();
delete del;
}
}
void KOListView::printList()
{
mListView->printList();
}
void KOListView::deleteAll()
{
- QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;;
+ Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;;
if ( delSel.count() ) {
int icount = delSel.count();
Incidence *incidence = delSel.first();
Incidence *toDelete;
KOPrefs *p = KOPrefs::instance();
bool confirm = p->mConfirm;
QString mess;
mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount );
if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) {
p->mConfirm = false;
int delCounter = 0;
QDialog dia ( this, "p-dialog", true );
QLabel lab (i18n("Close dialog to abort deletion!"), &dia );
- QVBoxLayout lay( &dia );
+ Q3VBoxLayout lay( &dia );
lay.setMargin(7);
lay.setSpacing(7);
lay.addWidget( &lab);
- QProgressBar bar( icount, &dia );
+ Q3ProgressBar bar( icount, &dia );
lay.addWidget( &bar);
int w = 220;
int h = 50;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
//dia.resize( 240,50 );
dia.show();
KOPrefs::instance()->mGlobalUpdateDisabled = true;
while ( incidence ) {
bar.setProgress( delCounter );
mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter );
dia.setCaption( mess );
qApp->processEvents();
toDelete = (incidence);
incidence = delSel.next();
emit deleteIncidenceSignal(toDelete );
if ( dia.result() != 0 )
break;
}
KOPrefs::instance()->mGlobalUpdateDisabled = false;
emit deleteIncidenceSignal( 0 );
mess = mess.sprintf( i18n("%d items remaining in list."), count() );
topLevelWidget ()->setCaption( mess );
p->mConfirm = confirm;
}
}
}
int KOListView::maxDatesHint()
{
return 0;
}
int KOListView::currentDateCount()
{
return 0;
}
-QPtrList<Incidence> KOListView::selectedIncidences()
+Q3PtrList<Incidence> KOListView::selectedIncidences()
{
- QPtrList<Incidence> eventList;
- QListViewItem *item = mListView->firstChild ();
+ Q3PtrList<Incidence> eventList;
+ Q3ListViewItem *item = mListView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
eventList.append(((KOListViewItem *)item)->data());
}
item = item->nextSibling();
}
// // QListViewItem *item = mListView->selectedItem();
//if (item) eventList.append(((KOListViewItem *)item)->data());
return eventList;
}
DateList KOListView::selectedDates()
{
DateList eventList;
return eventList;
}
void KOListView::showDates(bool show)
{
// Shouldn't we set it to a value greater 0? When showDates is called with
// show == true at first, then the columnwidths are set to zero.
@@ -966,106 +975,106 @@ void KOListView::updateConfig()
updateView();
}
void KOListView::setStartDate(const QDate &start)
{
mStartDate = start;
}
void KOListView::showDates(const QDate &start, const QDate &end)
{
clear();
mStartDate = start;
QDate date = start;
while( date <= end ) {
addEvents(calendar()->events(date));
addTodos(calendar()->todos(date));
addJournals( calendar()->journals4Date(date) );
date = date.addDays( 1 );
}
//emit incidenceSelected( 0 );
updateView();
}
-void KOListView::addEvents(QPtrList<Event> eventList)
+void KOListView::addEvents(Q3PtrList<Event> eventList)
{
Event *ev;
for(ev = eventList.first(); ev; ev = eventList.next()) {
addIncidence(ev);
}
if ( !mListView->currentItem() ){
updateView();
}
}
-void KOListView::addTodos(QPtrList<Todo> eventList)
+void KOListView::addTodos(Q3PtrList<Todo> eventList)
{
Todo *ev;
for(ev = eventList.first(); ev; ev = eventList.next()) {
addIncidence(ev);
}
if ( !mListView->currentItem() ){
updateView();
}
}
-void KOListView::addJournals(QPtrList<Journal> eventList)
+void KOListView::addJournals(Q3PtrList<Journal> eventList)
{
Journal *ev;
for(ev = eventList.first(); ev; ev = eventList.next()) {
addIncidence(ev);
}
if ( !mListView->currentItem() ){
updateView();
}
}
void KOListView::showCompletedTodos()
{
mForceShowCompletedTodos = true;
}
void KOListView::addIncidence(Incidence *incidence)
{
if ( mUidDict.find( incidence->uid() ) ) return;
// mListView->setFont ( KOPrefs::instance()->mListViewFont );
if ( incidence->typeID() == todoID ) {
if ( ! mForceShowCompletedTodos ) {
if ( !KOPrefs::instance()->mShowCompletedTodo && ((Todo*)incidence)->isCompleted() )
return;
}
}
mUidDict.insert( incidence->uid(), incidence );
KOListViewItem *item = new KOListViewItem( incidence, mListView );
ListItemVisitor v(item, mStartDate );
if (incidence->accept(v)) {
return;
}
else delete item;
}
-void KOListView::showEvents(QPtrList<Event> eventList)
+void KOListView::showEvents(Q3PtrList<Event> eventList)
{
clear();
addEvents(eventList);
// After new creation of list view no events are selected.
emit incidenceSelected( 0 );
}
int KOListView::count()
{
return mListView->childCount();
}
void KOListView::changeEventDisplay(Event *event, int action)
{
KOListViewItem *item;
switch(action) {
case KOGlobals::EVENTADDED:
addIncidence( event );
break;
case KOGlobals::EVENTEDITED:
item = getItemForEvent(event);
if (item) {
@@ -1074,385 +1083,385 @@ void KOListView::changeEventDisplay(Event *event, int action)
}
break;
case KOGlobals::EVENTDELETED:
item = getItemForEvent(event);
if (item) {
mUidDict.remove( event->uid() );
delete item;
}
break;
default:
;
}
}
KOListViewItem *KOListView::getItemForEvent(Incidence *event)
{
KOListViewItem *item = (KOListViewItem *)mListView->firstChild();
while (item) {
if (item->data() == event) return item;
item = (KOListViewItem *)item->nextSibling();
}
return 0;
}
-void KOListView::defaultItemAction(QListViewItem *i)
+void KOListView::defaultItemAction(Q3ListViewItem *i)
{
KOListViewItem *item = static_cast<KOListViewItem *>( i );
if ( item ) defaultAction( item->data() );
}
-void KOListView::popupMenu(QListViewItem *item,const QPoint &,int)
+void KOListView::popupMenu(Q3ListViewItem *item,const QPoint &,int)
{
mActiveItem = (KOListViewItem *)item;
if (mActiveItem) {
Incidence *incidence = mActiveItem->data();
mPopupMenu->enableDefault( !mListView->hasMultiSelection( item ) );
mPopupMenu->showIncidencePopup(incidence);
/*
if ( incidence && incidence->type() == "Event" ) {
Event *event = static_cast<Event *>( incidence );
mPopupMenu->showEventPopup(event);
}
*/
}
}
void KOListView::readSettings(KConfig *config, QString setting)
{
// qDebug("KOListView::readSettings ");
mListView->restoreLayout(config,setting);
}
void KOListView::writeSettings(KConfig *config, QString setting)
{
// qDebug("KOListView::writeSettings ");
mListView->saveLayout(config, setting);
}
-void KOListView::processSelectionChange(QListViewItem *)
+void KOListView::processSelectionChange(Q3ListViewItem *)
{
KOListViewItem *item =
static_cast<KOListViewItem *>( mListView->currentItem() );
if ( !item ) {
emit incidenceSelected( 0 );
} else {
emit incidenceSelected( item->data() );
}
}
void KOListView::clearSelection()
{
mListView->selectAll( false );
}
void KOListView::allSelection()
{
mListView->selectAll( true );
}
void KOListView::clear()
{
mListView->clear();
mUidDict.clear();
}
Incidence* KOListView::currentItem()
{
if ( mListView->currentItem() )
return ((KOListViewItem*) mListView->currentItem())->data();
return 0;
}
void KOListView::keyPressEvent ( QKeyEvent *e)
{
if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) {
deleteAll();
return;
}
e->ignore();
}
void KOListViewListView::keyPressEvent ( QKeyEvent *e)
{
switch ( e->key() ) {
case Qt::Key_Down:
- if ( e->state() == ShiftButton ) {
- QListViewItem* cn = currentItem();
+ if ( e->state() == Qt::ShiftButton ) {
+ Q3ListViewItem* cn = currentItem();
if ( !cn )
cn = firstChild();
if ( !cn )
return;
while ( cn->nextSibling() )
cn = cn->nextSibling();
setCurrentItem ( cn );
ensureItemVisible ( cn );
e->accept();
return;
}
- if ( e->state() == ControlButton ) {
+ if ( e->state() == Qt::ControlButton ) {
int count = childCount ();
int jump = count / 5;
- QListViewItem* cn;
+ Q3ListViewItem* cn;
cn = currentItem();
if ( ! cn )
return;
if ( jump == 0 )
jump = 1;
while ( jump && cn->nextSibling() ) {
cn = cn->nextSibling();
--jump;
}
setCurrentItem ( cn );
ensureItemVisible ( cn );
} else
- QListView::keyPressEvent ( e ) ;
+ Q3ListView::keyPressEvent ( e ) ;
e->accept();
break;
case Qt::Key_Up:
- if ( e->state() == ShiftButton ) {
- QListViewItem* cn = firstChild();
+ if ( e->state() == Qt::ShiftButton ) {
+ Q3ListViewItem* cn = firstChild();
if ( cn ) {
setCurrentItem ( cn );
ensureItemVisible ( cn );
}
e->accept();
return;
}
- if ( e->state() == ControlButton ) {
+ if ( e->state() == Qt::ControlButton ) {
int count = childCount ();
int jump = count / 5;
- QListViewItem* cn;
+ Q3ListViewItem* cn;
cn = currentItem();
if ( ! cn )
return;
if ( jump == 0 )
jump = 1;
while ( jump && cn->itemAbove ()) {
cn = cn->itemAbove ();
--jump;
}
setCurrentItem ( cn );
ensureItemVisible ( cn );
} else
- QListView::keyPressEvent ( e ) ;
+ Q3ListView::keyPressEvent ( e ) ;
e->accept();
break;
case Qt::Key_I: {
- QListViewItem* cn;
+ Q3ListViewItem* cn;
cn = currentItem();
if ( cn ) {
KOListViewItem* ci = (KOListViewItem*)( cn );
if ( ci ){
//emit showIncidence( ci->data());
cn = cn->nextSibling();
if ( cn ) {
setCurrentItem ( cn );
ensureItemVisible ( cn );
}
emit showIncidence( ci->data());
}
}
e->accept();
}
break;
case Qt::Key_Return:
case Qt::Key_Enter:
{
- QListViewItem* cn;
+ Q3ListViewItem* cn;
cn = currentItem();
if ( cn ) {
KOListViewItem* ci = (KOListViewItem*)( cn );
if ( ci ){
- if ( e->state() == ShiftButton )
+ if ( e->state() == Qt::ShiftButton )
ci->setSelected( false );
else
ci->setSelected( true );
cn = cn->nextSibling();
if ( cn ) {
setCurrentItem ( cn );
ensureItemVisible ( cn );
} else {
emit currentChanged( ci );
}
}
}
e->accept();
}
break;
default:
e->ignore();
}
}
KOListViewListView::KOListViewListView(KOListView * lv )
: KListView( lv, "kolistlistview", false )
{
mYMousePos = 0;
setAllColumnsShowFocus( true );
mPopupTimer = new QTimer(this);
connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
#ifndef DESKTOP_VERSION
//QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
#endif
- setSelectionMode( QListView::Multi );
+ setSelectionMode( Q3ListView::Multi );
setMultiSelection( true);
}
-bool KOListViewListView::hasMultiSelection(QListViewItem* item)
+bool KOListViewListView::hasMultiSelection(Q3ListViewItem* item)
{
- QListViewItem *qitem = firstChild ();
+ Q3ListViewItem *qitem = firstChild ();
while ( qitem ) {
if ( qitem->isSelected() && item != qitem )
return true;
qitem = qitem->nextSibling();
}
return false;
}
void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
if (!e) return;
QPoint vp = contentsToViewport(e->pos());
- QListViewItem *item = itemAt(vp);
+ Q3ListViewItem *item = itemAt(vp);
if (!item) {
emit newEvent();
return;
}
KListView::contentsMouseDoubleClickEvent(e);
}
#if 0
void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
{
//qDebug("contentsMousePressEvent++++ ");
KListView::contentsMousePressEvent( e );
- if ( e->button() == RightButton ) {
- QListViewItem* ci = currentItem();
+ if ( e->button() == Qt::RightButton ) {
+ Q3ListViewItem* ci = currentItem();
clearSelection () ;
if ( ci )
ci->setSelected( true );
}
}
void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
KListView::contentsMouseReleaseEvent(e);
}
void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
{
KListView::contentsMouseMoveEvent(e);
}
#endif
void KOListViewListView::popupMenu()
{
mPopupTimer->stop();
- QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton );
+ QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, Qt::RightButton , Qt::RightButton );
QApplication::postEvent( this->viewport(), e );
}
void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
{
//qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y());
mYMousePos = mapToGlobal( (e->pos())).y();
- if ( e->button() == LeftButton ) {
+ if ( e->button() == Qt::LeftButton ) {
mPopupTimer->start( 600 );
mEventPos = contentsToViewport(e->pos());
mEventGlobalPos = e->globalPos();
}
KListView::contentsMousePressEvent( e );
- if ( e->button() == RightButton ) {
- QListViewItem* ci = currentItem();
+ if ( e->button() == Qt::RightButton ) {
+ Q3ListViewItem* ci = currentItem();
//clearSelection();
if ( ci )
ci->setSelected( true );
}
}
void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
mPopupTimer->stop();
KListView::contentsMouseReleaseEvent(e);
}
void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
{
// qDebug("contentsMouseMoveEv....... ");
// qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() );
int diff = mYMousePos - mapToGlobal( (e->pos())).y();
if ( diff < 0 ) diff = -diff;
if ( diff > 15 )
mPopupTimer->stop();
else {
mEventPos = contentsToViewport(e->pos());
mEventGlobalPos = e->globalPos();
}
KListView::contentsMouseMoveEvent(e);
}
#define protected public
-#include <qheader.h>
+#include <q3header.h>
#undef protected
void KOListViewListView::printList()
{
#ifdef DESKTOP_VERSION
KOPrintPrefs pp ( this );
if (!pp.exec() )
return;
int scaleval = pp.printMode() ;
QPrinter printer;
if (!printer.setup() )
return;
clearSelection ();
QPainter p;
p.begin ( &printer );
p.setFont(font());
- QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
+ Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
float dx, dy;
int wid = (m.width() * 9)/10;
dx = (float) wid/(float)contentsWidth ();
dy = (float)(m.height()) / (float)contentsHeight ();
float scale;
// scale to fit the width or height of the paper
if ( dx < dy )
scale = dx;
else
scale = dy;
p.translate( m.width()/10,m.width()/10 );
if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
p.scale( scale, scale );
}
int cou = header()->count();
int iii;
QRect rect ( 0,0,0, header()->height());
for ( iii = 0; iii < cou; ++iii ) {
rect.setLeft ( header()->sectionPos( iii ) );
rect.setRight ( header()->sectionPos( iii ) + header()->sectionSize (iii));
header()->paintSection ( & p, header()->mapToIndex (iii), rect );
}
p.translate( 0, header()->height());
//drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () );
const QColorGroup &cg = colorGroup();
KOListViewItem* item = (KOListViewItem* )firstChild();
int yOff = 0;
while ( item ) {
p.translate( 0, yOff );
p.save();
for ( iii = 0; iii < cou; ++iii ) {
int align = columnAlignment( iii );
- if ( align == AlignAuto ) align = AlignLeft;
+ if ( align == Qt::AlignLeft ) align = Qt::AlignLeft;
p.restore();
p.save();
p.translate( header()->sectionPos( iii ), 0);
item->paintCell( &p, cg, iii, header()->sectionSize (iii), align );
}
yOff = item->height();
item = (KOListViewItem* )(item->itemBelow());
p.restore();
}
p.end();
#endif
}
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index 99d0561..9fb0b00 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -3,99 +3,105 @@
Copyright (c) 1999 Preston Brown
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOLISTVIEW_H
#define _KOLISTVIEW_H
-#include <qlistview.h>
+#include <q3listview.h>
#include <qmap.h>
-#include <qdict.h>
+#include <q3dict.h>
+//Added by qt3to4:
+#include <QMouseEvent>
+#include <Q3PtrList>
+#include <Q3PopupMenu>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
#include <klistview.h>
#include <libkcal/incidence.h>
#include "koeventview.h"
#include "customlistviewitem.h"
using namespace KCal;
class KOListViewWhatsThis;
#include <qpushbutton.h>
#include <qlayout.h>
#include <qdialog.h>
#include <qtimer.h>
#include <qcombobox.h>
#include <qspinbox.h>
#include <qtooltip.h>
#include <qcheckbox.h>
-#include <qhbox.h>
+#include <q3hbox.h>
#include <qlabel.h>
#include <kiconloader.h>
#include "kfiledialog.h"
#include "koprefs.h"
class KOAlarmPrefs : public QDialog
{
Q_OBJECT
public:
KOAlarmPrefs( QWidget *par=0, const char *name=0 ) :
QDialog( par, name, true )
{
setCaption( i18n("Alarm Options") );
- QVBoxLayout* alarmLayout = new QVBoxLayout( this );
+ Q3VBoxLayout* alarmLayout = new Q3VBoxLayout( this );
alarmLayout->setSpacing( 3 );
alarmLayout->setMargin( 3 );
QWidget *parent = this;
mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent);
alarmLayout->addWidget(mAlarmButton);
mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
mAlarmTimeEdit->setValue( 15 );
alarmLayout->addWidget(mAlarmTimeEdit);
mAlarmIncrCombo = new QComboBox(false, parent);
mAlarmIncrCombo->insertItem(i18n("minute(s)"));
mAlarmIncrCombo->insertItem(i18n("hour(s)"));
mAlarmIncrCombo->insertItem(i18n("day(s)"));
alarmLayout->addWidget(mAlarmIncrCombo);
- QHBox * hb = new QHBox ( parent );
+ Q3HBox * hb = new Q3HBox ( parent );
alarmLayout->addWidget(hb);
mAlarmSoundButton = new QPushButton(hb);
mAlarmSoundButton->setPixmap(SmallIcon("playsound"));
mAlarmSoundButton->setToggleButton(true);
connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound()));
mAlarmProgramButton = new QPushButton(hb);
mAlarmProgramButton->setPixmap(SmallIcon("run"));
mAlarmProgramButton->setToggleButton(true);
connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram()));
mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 );
mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 );
mAlarmLabel = new QLabel( this );
alarmLayout->addWidget( mAlarmLabel );
mAlarmLabel->setText( "..."+KOPrefs::instance()->mDefaultAlarmFile.right( 30 ) );
mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
mAlarmSoundButton->setOn( true );
QPushButton * ok = new QPushButton( i18n("Set Alarm!"), this );
alarmLayout->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
alarmLayout->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
resize( 200, 200 );
@@ -189,129 +195,129 @@ class ListItemVisitor : public Incidence::Visitor
bool visit(Journal *);
private:
KOListViewItem *mItem;
QDate mDate;
};
/**
This class provides a multi-column list view of events. It can
display events from one particular day or several days, it doesn't
matter. To use a view that only handles one day at a time, use
KODayListView.
@short multi-column list view of various events.
@author Preston Brown <pbrown@kde.org>
@see KOBaseView, KODayListView
*/
class KOListView;
class KOListViewListView : public KListView
{
Q_OBJECT
public:
KOListViewListView(KOListView * lv );
- bool hasMultiSelection(QListViewItem*);
+ bool hasMultiSelection(Q3ListViewItem*);
void printList();
signals:
void newEvent();
void showIncidence( Incidence* );
public slots:
void popupMenu();
private:
QPoint mEventPos;
QPoint mEventGlobalPos;
QTimer* mPopupTimer;
int mYMousePos;
void keyPressEvent ( QKeyEvent * ) ;
void contentsMouseDoubleClickEvent(QMouseEvent *e);
void contentsMousePressEvent(QMouseEvent *e);
void contentsMouseReleaseEvent(QMouseEvent *e);
void contentsMouseMoveEvent(QMouseEvent *e);
bool mMouseDown;
};
class KOListView : public KOEventView
{
Q_OBJECT
public:
KOListView(Calendar *calendar, QWidget *parent = 0,
const char *name = 0);
~KOListView();
virtual int maxDatesHint();
virtual int currentDateCount();
- virtual QPtrList<Incidence> selectedIncidences();
+ virtual Q3PtrList<Incidence> selectedIncidences();
virtual DateList selectedDates();
void showDates(bool show);
Incidence* currentItem();
- void addTodos(QPtrList<Todo> eventList);
- void addJournals(QPtrList<Journal> eventList);
+ void addTodos(Q3PtrList<Todo> eventList);
+ void addJournals(Q3PtrList<Journal> eventList);
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
void readSettings(KConfig *config, QString setting = "KOListView Layout");
void writeSettings(KConfig *config, QString setting = "KOListView Layout");
void updateList();
void clearList();
void setStartDate(const QDate &start);
int count();
QString getWhatsThisText(QPoint p);
- QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false );
+ Q3PtrList<Incidence> getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false );
void showCompletedTodos();
signals:
void signalNewEvent();
- void beamIncidenceList(QPtrList<Incidence>);
+ void beamIncidenceList(Q3PtrList<Incidence>);
public slots:
void hideAll();
void printList();
void resetFocus();
virtual void updateView();
virtual void showDates(const QDate &start, const QDate &end);
- virtual void showEvents(QPtrList<Event> eventList);
+ virtual void showEvents(Q3PtrList<Event> eventList);
void clearSelection();
void allSelection();
void clear();
void showDates();
void hideDates();
void deleteAll();
void saveToFile();
void saveToFileVCS();
void saveDescriptionToFile();
void beamSelected();
void updateConfig();
void setCat();
void setAlarm();
void setCategories( bool removeOld );
void changeEventDisplay(Event *, int);
- void defaultItemAction(QListViewItem *item);
- void popupMenu(QListViewItem *item,const QPoint &,int);
+ void defaultItemAction(Q3ListViewItem *item);
+ void popupMenu(Q3ListViewItem *item,const QPoint &,int);
void setCalendar( int c );
void populateCalPopup();
protected slots:
- void processSelectionChange(QListViewItem *);
+ void processSelectionChange(Q3ListViewItem *);
void catChanged( Incidence* );
protected:
void writeToFile( bool iCal );
- void addEvents(QPtrList<Event> eventList);
+ void addEvents(Q3PtrList<Event> eventList);
void addIncidence(Incidence *);
KOListViewItem *getItemForEvent(Incidence *event);
private:
bool mForceShowCompletedTodos;
- QPopupMenu* mCalPopup;
+ Q3PopupMenu* mCalPopup;
KOListViewWhatsThis *mKOListViewWhatsThis;
KOListViewListView *mListView;
KOEventPopupMenu *mPopupMenu;
KOListViewItem *mActiveItem;
- QDict<Incidence> mUidDict;
+ Q3Dict<Incidence> mUidDict;
QDate mStartDate;
void keyPressEvent ( QKeyEvent * ) ;
};
#endif
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 85e9166..ca55c43 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1,311 +1,323 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
#include <qfont.h>
#include <qfontmetrics.h>
-#include <qkeycode.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qwidgetstack.h>
+#include <qnamespace.h>
+#include <q3hbox.h>
+#include <q3vbox.h>
+#include <q3widgetstack.h>
#include <qpushbutton.h>
#include <qtooltip.h>
#include <qpainter.h>
#include <qtimer.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QLabel>
+#include <QPixmap>
+#include <QFocusEvent>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
+#include <Q3Frame>
+#include <Q3PointArray>
+#include <Q3PtrList>
#endif
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
#include <kiconloader.h>
#include <kcalendarsystem.h>
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koprefs.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include "koglobals.h"
#include <libkcal/kincidenceformatter.h>
#include "komonthview.h"
#define PIXMAP_SIZE 5
#ifdef DESKTOP_VERSION
QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
#endif
-class KNOWhatsThis :public QWhatsThis
+class KNOWhatsThis :public Q3WhatsThis
{
public:
- KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { };
+ KNOWhatsThis( KNoScrollListBox* sbox ) : Q3WhatsThis( sbox ), _wid( sbox) { };
//~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); };
protected:
virtual QString text( const QPoint& p)
{
return _wid->getWhatsThisText(p) ;
};
private:
KNoScrollListBox* _wid;
};
KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
- : QListBox(parent, name, WRepaintNoErase)
+ : Q3ListBox(parent, name, Qt::WNoAutoErase)
{
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
mBlockDeselect = false;
mWT = new KNOWhatsThis(this);
resetOnFocusIn = true;
- setVScrollBarMode(QScrollView::AlwaysOff);
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
KNoScrollListBox::~KNoScrollListBox()
{
#if QT_VERSION >= 0x030000
#else
delete mWT;
#endif
}
void KNoScrollListBox::focusInEvent ( QFocusEvent * e )
{
- QListBox::focusInEvent ( e );
+ Q3ListBox::focusInEvent ( e );
if ( count() ){
int ci = currentItem();
if ( ci < 0 ) ci = 0;
setCurrentItem( ci );
setSelected ( ci, true );
emit highlighted( item ( ci ) );
resetOnFocusIn = true;
if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) {
- QListBoxItem *fi = firstItem ();
+ Q3ListBoxItem *fi = firstItem ();
if (fi ) {
int ihei = fi->height( this );
int hei = numRows () * ihei;
if ( hei < height() - horizontalScrollBar()->height () ) {
- setVScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
}
else
- setVScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
if ( ihei *3 > height() ) {
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
else {
- setHScrollBarMode(QScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
} else {
- setVScrollBarMode(QScrollView::Auto);
- setHScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
}
}
}
void KNoScrollListBox::focusOutEvent ( QFocusEvent * e )
{
if ( ! mBlockDeselect ) {
int i = currentItem ();
if ( i >= 0 ) {
setSelected ( i, false );
}
- QListBox::focusOutEvent ( e );
+ Q3ListBox::focusOutEvent ( e );
}
- setVScrollBarMode(QScrollView::AlwaysOff);
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
if ( ! mBlockDeselect )
emit highlightIncidence( 0, (MonthViewCell*)this, 0 );
mBlockDeselect = false;
}
QString KNoScrollListBox::getWhatsThisText(QPoint p)
{
- QListBoxItem* item = itemAt ( p );
+ Q3ListBoxItem* item = itemAt ( p );
if ( ! item ) {
return i18n("Click in the cell\nto add an event!");
}
return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(),
KOPrefs::instance()->mWTshowDetails,
KOPrefs::instance()->mWTshowCreated,
KOPrefs::instance()->mWTshowChanged);
}
void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
{
//qDebug("KNoScrollListBox::keyPressEvent ");
switch(e->key()) {
- case Key_Right:
+ case Qt::Key_Right:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
return;
}
scrollBy(10,0);
break;
- case Key_Left:
+ case Qt::Key_Left:
if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
return;
}
scrollBy(-10,0);
break;
- case Key_Up:
+ case Qt::Key_Up:
if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
}
if ( count() ) {
if ( currentItem() == 0 ) {
emit prevCell();
} else {
setCurrentItem((currentItem()+count()-1)%count());
if(!itemVisible(currentItem())) {
if((unsigned int) currentItem() == (count()-1)) {
setTopItem(currentItem()-numItemsVisible()+1);
} else {
setTopItem(topItem()-1);
}
}
}
}
break;
- case Key_Down:
+ case Qt::Key_Down:
if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
}
if ( count () ) {
if ( ((uint)currentItem()+1) == count () ) {
emit nextCell();
} else {
setCurrentItem((currentItem()+1)%count());
if(!itemVisible(currentItem())) {
if(currentItem() == 0) {
setTopItem(0);
} else {
setTopItem(topItem()+1);
}
}
}
}
break;
- case Key_I:
+ case Qt::Key_I:
QTimer::singleShot( 1, this, SLOT ( oneDown() ) );
e->ignore();
break;
- case Key_Return:
- case Key_Enter:
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
{
if ( currentItem() >= 0 ) {
emit doubleClicked( item( currentItem() ) );
e->accept();
} else {
e->ignore();
}
}
break;
- case Key_Shift:
+ case Qt::Key_Shift:
emit shiftDown();
break;
default:
e->ignore();
break;
}
}
void KNoScrollListBox::oneDown()
{
if ( count () ) {
if ( ((uint)currentItem()+1) == count () ) {
emit nextCell();
} else {
resetOnFocusIn = false;
setCurrentItem((currentItem()+1)%count());
if(!itemVisible(currentItem())) {
if(currentItem() == 0) {
setTopItem(0);
} else {
setTopItem(topItem()+1);
}
}
}
}
}
void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
{
switch(e->key()) {
- case Key_Shift:
+ case Qt::Key_Shift:
emit shiftUp();
break;
default:
break;
}
}
void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
{
- QListBox::mousePressEvent(e);
+ Q3ListBox::mousePressEvent(e);
- if(e->button() == RightButton) {
+ if(e->button() == Qt::RightButton) {
emit rightClick();
}
}
MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s)
- : QListBoxItem()
+ : Q3ListBoxItem()
{
mblockRepaint = true;
isWeekItem = KOPrefs::instance()->mMonthViewWeek;
recycle( incidence, s );
}
void MonthViewItem::recycle( Incidence *incidence, const QString & s)
{
mDisplayHighlighted = false;
setText( s );
mMultiday = 0;
mIncidence = incidence;
mRecur = false;
mAlarm = false;
mReply = false;
mInfo = false;
mdayPos = 0;
}
bool MonthViewItem::setHighlightedFalse()
{
if ( !mDisplayHighlighted )
return false;
mDisplayHighlighted = false;
return true;
@@ -374,56 +386,56 @@ void MonthViewItem::paint(QPainter *p)
p->fillRect ( x, y,size,size, Qt::yellow );
x += size + 1;
}
}
if ( sel ) p->setPen( Qt::white );
else p->setPen( palette().color( QPalette::Normal,QColorGroup::Foreground ) );
#if 0
p->setPen( palette().color( QPalette::Normal, sel ? \
QColorGroup::HighlightedText : QColorGroup::Foreground ) );
#endif
QColor textColor = p->pen().color();
if ( mMultiday ) {
int yyy = y+(size/2);
int sizeM = size+2;
p->setBrush( QBrush( textColor ) );
p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ;
if ( mMultiday == 2 || mMultiday == 3 ) {
- QPointArray pa ( 3 );
+ Q3PointArray pa ( 3 );
pa.setPoint (0, x, yyy );
pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 );
pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 );
p->drawPolygon( pa );
}
if ( mMultiday == 2 || mMultiday == 1 ) {
- QPointArray pa ( 3 );
+ Q3PointArray pa ( 3 );
pa.setPoint (0, x+sizeM +sizeM/2, yyy );
pa.setPoint (1, x+sizeM, yyy+sizeM/2 );
pa.setPoint (2, x+sizeM, yyy-sizeM/2 );
p->drawPolygon( pa );
}
if ( mMultiday == 1 ) {
// p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 );
}
if ( mMultiday == 3 ) {
// p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 );
}
x += sizeM/2 + 1;
x += sizeM + 1;
}
if ( mIncidence->typeID() == todoID ){
Todo* td = ( Todo* ) mIncidence;
if ( td->isCompleted() ) {
int half = size/2;
p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ;
p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ;
@@ -441,132 +453,132 @@ void MonthViewItem::paint(QPainter *p)
int pmheight = size;
if( pmheight < fm.height() )
yPos = fm.ascent() + fm.leading()/2;
else
yPos = pmheight/2 - fm.height()/2 + fm.ascent();
if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) {
p->drawText( x, yPos, text() );
if ( mIncidence->cancelled() ) {
int wid = fm.width( text() );
p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
}
} else {
QString pText = text();
if( pText.mid(2,1) == ":" )
pText = pText.mid( 6 );
p->drawText( x, yPos, pText );
if ( mIncidence->cancelled() ) {
int wid = fm.width( pText );
p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
}
}
}
-int MonthViewItem::height(const QListBox *lb) const
+int MonthViewItem::height(const Q3ListBox *lb) const
{
int ret = 10;
if ( lb )
ret = lb->fontMetrics().lineSpacing()+1;
return ret;
}
-int MonthViewItem::width(const QListBox *lb) const
+int MonthViewItem::width(const Q3ListBox *lb) const
{
if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) {
int size = PIXMAP_SIZE;
if ( QApplication::desktop()->width() < 300 )
size = 3;
int x = 1;
if ( KOPrefs::instance()->mMonthShowIcons ) {
if ( mInfo ) {
x += size + 1;
}
if( mRecur ) {
x += size+1;
}
if( mAlarm ) {
x += size+1;
}
if( mReply ) {
x += size+1;
}
}
if( mMultiday ) {
x += size+1+2+size/2;
}
return( x + lb->fontMetrics().width( text() ) + 1 );
}
if ( ! lb )
return 10;
return lb->width();
}
MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
: KNoScrollListBox( par ),
mMonthView( parent )
{
//QVBoxLayout *topLayout = new QVBoxLayout( this );
currentPalette = 0;
// mLabel = new QLabel( this );QPushButton
mLabel = new QPushButton( this );
//mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain );
//mLabel->setLineWidth( 1 );
//mLabel->setAlignment( AlignCenter );
mLabel->setFlat( true );
- mLabel->setFocusPolicy(NoFocus);
+ mLabel->setFocusPolicy(Qt::NoFocus);
//mItemList = new KNoScrollListBox( this );
setMinimumSize( 10, 10 );
- setFrameStyle( QFrame::Panel | QFrame::Plain );
+ setFrameStyle( Q3Frame::Panel | Q3Frame::Plain );
setLineWidth( 1 );
//topLayout->addWidget( mItemList );
mLabel->raise();
// QColor( 0,0,255 ) QColor( 160,1600,255 )
mStandardPalette = palette();
mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) );
enableScrollBars( false );
updateConfig();
//connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() ));
connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() ));
- connect( this , SIGNAL( doubleClicked( QListBoxItem *) ),
- SLOT( defaultAction( QListBoxItem * ) ) );
- connect( this, SIGNAL( rightButtonPressed( QListBoxItem *,
+ connect( this , SIGNAL( doubleClicked( Q3ListBoxItem *) ),
+ SLOT( defaultAction( Q3ListBoxItem * ) ) );
+ connect( this, SIGNAL( rightButtonPressed( Q3ListBoxItem *,
const QPoint &) ),
- SLOT( contextMenu( QListBoxItem * ) ) );
- connect( this, SIGNAL( highlighted( QListBoxItem *) ),
- SLOT( selection( QListBoxItem * ) ) );
+ SLOT( contextMenu( Q3ListBoxItem * ) ) );
+ connect( this, SIGNAL( highlighted( Q3ListBoxItem *) ),
+ SLOT( selection( Q3ListBoxItem * ) ) );
/*
connect( this, SIGNAL( clicked( QListBoxItem * ) ),
SLOT( selection( QListBoxItem * ) ) );
*/
}
#ifdef DESKTOP_VERSION
QToolTipGroup *MonthViewCell::toolTipGroup()
{
- if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0);
+ /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */
return mToolTipGroup;
}
#endif
void MonthViewCell::setDate( const QDate &date )
{
// kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl;
mDate = date;
//resizeEvent( 0 );
}
QDate MonthViewCell::date() const
{
return mDate;
}
void MonthViewCell::setPrimary( bool primary )
{
mPrimary = primary;
//setMyPalette();
}
@@ -616,49 +628,49 @@ QPalette MonthViewCell::getPalette ()
bool MonthViewCell::isPrimary() const
{
return mPrimary;
}
void MonthViewCell::setHoliday( bool holiday )
{
mHoliday = holiday;
//setMyPalette();
}
void MonthViewCell::setHoliday( const QString &holiday )
{
mHolidayString = holiday;
if ( !holiday.isEmpty() ) {
setHoliday( true );
}
}
void MonthViewCell::startUpdateCell()
{
blockSignals( true );
mdayCount = 0;
- setFocusPolicy(NoFocus);
+ setFocusPolicy(Qt::NoFocus);
if ( !mMonthView->isUpdatePossible() )
return;
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
while ( mitem ) {
mitem->setBlockRepaint( true );
mitem = (MonthViewItem *)mitem->next();
}
if ( mAvailItemList.count() > 20 ) {
mAvailItemList.setAutoDelete( true );
mAvailItemList.clear();
mAvailItemList.setAutoDelete( false );
clear();
}
setPrimary( mDate.month()%2 );
setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays);
if ( mDate == QDate::currentDate() ) {
setLineWidth( 3 );
} else {
setLineWidth( 1 );
}
MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem ();
//clear();
while ( CurrentAvailItem ) {
@@ -671,49 +683,49 @@ void MonthViewCell::startUpdateCell()
}
#ifdef DESKTOP_VERSION
QToolTip::remove(this);
#endif
mToolTip.clear();
//qApp->processEvents();
#if 0
if ( !mHolidayString.isEmpty() ) {
MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
item->setPalette( mHolidayPalette );
insertItem( item );
mToolTip.append ( mHolidayString );
}
#endif
}
int MonthViewCell::insertEvent(Event *event)
{
bool useToolTips = true;
#ifndef DESKTOP_VERSION
useToolTips = false;
#endif
QString mToolTipText;
- setFocusPolicy(WheelFocus);
+ setFocusPolicy(Qt::WheelFocus);
if ( !(event->doesRecur() == Recurrence::rNone) ) {
if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
return mdayCount;
else
if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
return mdayCount;
}
if ( event->isHoliday()) {
setHoliday( true );
if ( mDate.dayOfWeek() == 7 )
setLineWidth( 3 );
}
QString text;
int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
if (event->isMultiDay()) {
QString prefix = "<->";multiday = 2;
QString time;
if ( event->doesRecur() ) {
if ( event->recursOn( mDate) ) {
prefix ="->" ;multiday = 1;
}
else {
int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
@@ -813,65 +825,65 @@ int MonthViewCell::insertEvent(Event *event)
KOPrefs::instance()->email());
if ( me != 0 ) {
if ( me->status() == Attendee::NeedsAction && me->RSVP())
item->setReply(true && multiday < 2);
else
item->setReply(false);
} else
item->setReply(false);
#endif
item->setMultiDay( multiday );
if ( multiday ) {
insertItem( item ,mdayCount);
++mdayCount;
} else {
uint i = mdayCount;
uint pos = mdayCount;
uint itcount = count();
if ( itcount > 1000 ) {
qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount);
itcount = 0;
}
for ( i = pos; i < itcount;++i ) {
// qDebug("i %d mday %u count %d ",i,itcount,mdayCount );
- QListBoxItem* it = this->item ( i );
+ Q3ListBoxItem* it = this->item ( i );
if ( it && text < it->text() ) {
pos = i;
break;
}
++pos;
}
insertItem( item ,pos);
}
if ( useToolTips ) {
mToolTip.append( mToolTipText );
}
return mdayCount;
}
void MonthViewCell::insertTodo(Todo *todo)
{
- setFocusPolicy(WheelFocus);
+ setFocusPolicy(Qt::WheelFocus);
QString text;
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
text += KGlobal::locale()->formatTime(todo->dtDue().time());
text += " ";
}
}
text += todo->summary();
MonthViewItem *item ;
if ( mAvailItemList.count() ) {
item = mAvailItemList.first();
mAvailItemList.remove( item );
item->recycle( todo, text );
} else {
item = new MonthViewItem( todo, text );
}
//MonthViewItem *item = new MonthViewItem( todo, mDate, text );
//item->setPalette( mStandardPalette );
QPalette pal;
if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
QStringList categories = todo->categories();
QString cat = categories.first();
if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
pal = getPalette();
@@ -901,140 +913,140 @@ void MonthViewCell::insertTodo(Todo *todo)
item->setMoreInfo( todo->description().length() > 0 );
insertItem( item , count());
#ifdef DESKTOP_VERSION
mToolTip.append( text );
#endif
}
void MonthViewCell::repaintfinishUpdateCell()
{
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
while ( mitem ) {
mitem->setBlockRepaint( false );
updateItem ( mitem );
mitem = (MonthViewItem *)mitem->next();
}
blockSignals( false );
}
void MonthViewCell::finishUpdateCell()
{
#ifdef DESKTOP_VERSION
if (mToolTip.count() > 0 ) {
mToolTip.sort();
- QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),"");
+ /* TODO: hacker: QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); */
}
#endif
//sort();
//setMyPalette();
setMyPalette();
resizeEvent( 0 );
}
void MonthViewCell::updateCell()
{
if ( !mMonthView->isUpdatePossible() )
return;
startUpdateCell();
//mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
- QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
+ Q3PtrList<Event> events = mMonthView->calendar()->events( mDate, true );
Event *event;
for( event = events.first(); event; event = events.next() ) { // for event
insertEvent(event);
}
// insert due todos
- QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
+ Q3PtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
Todo *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
insertTodo( todo );
}
finishUpdateCell();
// if ( isVisible())
//qApp->processEvents();
}
void MonthViewCell::updateConfig( bool bigFont ) // = false
{
if ( bigFont ) {
QFont fo = KOPrefs::instance()->mMonthViewFont;
int ps = fo.pointSize() + 2;
if ( ps < 18 )
ps += 2;
fo.setPointSize( ps );
setFont( fo );
} else
setFont( KOPrefs::instance()->mMonthViewFont );
QFontMetrics fm( font() );
mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
mHolidayPalette = mStandardPalette;
mPrimaryPalette = mStandardPalette;
mNonPrimaryPalette = mStandardPalette;
if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
}
//updateCell();
}
void MonthViewCell::enableScrollBars( bool enabled )
{
return;
if ( enabled ) {
- QListBoxItem *fi = firstItem ();
+ Q3ListBoxItem *fi = firstItem ();
if (fi ) {
int ihei = fi->height( this );
int hei = numRows () * ihei;
if ( hei < height() - horizontalScrollBar()->height () ) {
- setVScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
}
else
- setVScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
if ( ihei *3 > height() ) {
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
else {
- setHScrollBarMode(QScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
} else {
- setVScrollBarMode(QScrollView::Auto);
- setHScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
} else {
- setVScrollBarMode(QScrollView::AlwaysOff);
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
}
Incidence *MonthViewCell::selectedIncidence()
{
int index = currentItem();
if ( index < 0 ) return 0;
MonthViewItem *mitem =
static_cast<MonthViewItem *>( item( index ) );
if ( !mitem ) return 0;
return mitem->incidence();
}
QDate MonthViewCell::selectedIncidenceDate()
{
QDate qd;
int index = currentItem();
if ( index < 0 ) return qd;
return mDate;
}
@@ -1062,99 +1074,99 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e )
bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " " + QString::number( mDate.day() );
mLabel->resize( mLabelBigSize );
} else {
mLabel->resize( mLabelSize );
text = QString::number( mDate.day() );
}
mLabel->setText( text );
int size = height() - mLabel->height() - lineWidth()-1;
//qDebug("LW %d ", lineWidth());
if ( size > 0 )
verticalScrollBar()->setMaximumHeight( size );
size = width() - mLabel->width() -lineWidth()-1;
if ( size > 0 )
horizontalScrollBar()->setMaximumWidth( size );
mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() );
//mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
// mItemList->resize ( width(), height () );
if ( e )
KNoScrollListBox::resizeEvent ( e );
}
-void MonthViewCell::defaultAction( QListBoxItem *item )
+void MonthViewCell::defaultAction( Q3ListBoxItem *item )
{
if ( !item ) {
QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
emit newEventSignal( dt );
return;
}
MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
Incidence *incidence = eventItem->incidence();
if ( incidence ) mMonthView->defaultAction( incidence );
}
void MonthViewCell::showDay()
{
emit showDaySignal( date() );
}
void MonthViewCell::newEvent()
{
QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
emit newEventSignal( dt );
}
-void MonthViewCell::cellClicked( QListBoxItem *item )
+void MonthViewCell::cellClicked( Q3ListBoxItem *item )
{
mMonthView->setSelectedCell( this );
if ( item == 0 ) {
QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
emit newEventSignal( dt );
return;
}
}
-void MonthViewCell::contextMenu( QListBoxItem *item )
+void MonthViewCell::contextMenu( Q3ListBoxItem *item )
{
mMonthView->setPopupCell( this );
if ( !item ) {
mMonthView->showContextMenu( 0 );
return;
}
//selection( item );
//qApp->processEvents();
MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
Incidence *incidence = eventItem->incidence();
if ( incidence ) {
mBlockDeselect = true;
mMonthView->showContextMenu( incidence );
}
}
-void MonthViewCell::selection( QListBoxItem *item )
+void MonthViewCell::selection( Q3ListBoxItem *item )
{
if ( !item ) {
emit highlightIncidence( 0 , this, 0 );
return;
}
MonthViewItem * it = (static_cast<MonthViewItem *>( item ));
emit highlightIncidence( it->incidence(), this, it->multiDay() );
mMonthView->setSelectedCell( this );
}
void MonthViewCell::deHighLight()
{
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
while ( mitem ) {
if ( mitem->setHighlightedFalse() )
updateItem ( mitem );
mitem = (MonthViewItem *)mitem->next();
}
}
// returns true if no inc found
bool MonthViewCell::doHighLight( Incidence * inc )
{
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
@@ -1164,189 +1176,189 @@ bool MonthViewCell::doHighLight( Incidence * inc )
updateItem ( mitem );
return false;
}
mitem = (MonthViewItem *)mitem->next();
}
return true;
}
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
: KOEventView( calendar, parent, name ),
mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
{
mFlagKeyPressed = false;
mShortDayLabelsM = false;
mShortDayLabelsW = false;
skipResize = false;
clPending = true;
mPopupCell = 0;
mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" );
- mWidStack = new QWidgetStack( this );
- QVBoxLayout* hb = new QVBoxLayout( this );
+ mWidStack = new Q3WidgetStack( this );
+ Q3VBoxLayout* hb = new Q3VBoxLayout( this );
mMonthView = new QWidget( mWidStack );
mWeekView = new QWidget( mWidStack );
#if QT_VERSION >= 0x030000
mWidStack->addWidget(mMonthView );
mWidStack->addWidget(mWeekView );
#else
mWidStack->addWidget( mMonthView, 1 );
mWidStack->addWidget( mWeekView , 1 );
#endif
hb->addWidget( mNavigatorBar );
hb->addWidget( mWidStack );
mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
updatePossible = false;
//updatePossible = true;
mCells.setAutoDelete( true );
mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
mDayLabels.resize( mDaysPerWeek );
mDayLabelsW.resize( mDaysPerWeek );
QFont bfont = font();
if ( QApplication::desktop()->width() < 650 ) {
bfont.setPointSize( bfont.pointSize() - 2 );
}
bfont.setBold( true );
int i;
for( i = 0; i < mDaysPerWeek; i++ ) {
QLabel *label = new QLabel( mMonthView );
label->setFont(bfont);
- label->setFrameStyle(QFrame::Panel|QFrame::Raised);
+ label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
label->setLineWidth(1);
- label->setAlignment(AlignCenter);
+ label->setAlignment(Qt::AlignCenter);
mDayLabels.insert( i, label );
label = new QLabel( mWeekView );
label->setFont(bfont);
- label->setFrameStyle(QFrame::Panel|QFrame::Raised);
+ label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
label->setLineWidth(1);
- label->setAlignment(AlignCenter);
+ label->setAlignment(Qt::AlignCenter);
mDayLabelsW.insert( i, label );
}
bfont.setBold( false );
mWeekLabels.resize( mNumWeeks+1 );
mWeekLabelsW.resize( 2 );
for( i = 0; i < mNumWeeks+1; i++ ) {
KOWeekButton *label = new KOWeekButton( mMonthView );
- label->setFocusPolicy(NoFocus);
+ label->setFocusPolicy(Qt::NoFocus);
label->setFont(bfont);
connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
label->setFlat(true);
- QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
+ Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
//label->setFrameStyle(QFrame::Panel|QFrame::Raised);
//label->setLineWidth(1);
//label->setAlignment(AlignCenter);
mWeekLabels.insert( i, label );
}
mWeekLabels[mNumWeeks]->setText( i18n("W"));
- mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus);
- QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
+ mWeekLabels[mNumWeeks]->setFocusPolicy(Qt::WheelFocus);
+ Q3WhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
for( i = 0; i < 1+1; i++ ) {
KOWeekButton *label = new KOWeekButton( mWeekView );
- label->setFocusPolicy(NoFocus);
+ label->setFocusPolicy(Qt::NoFocus);
label->setFont(bfont);
connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
label->setFlat(true);
- QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
+ Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
//label->setFrameStyle(QFrame::Panel|QFrame::Raised);
//label->setLineWidth(1);
//label->setAlignment(AlignCenter);
mWeekLabelsW.insert( i, label );
}
mWeekLabelsW[1]->setText( i18n("W"));
- mWeekLabelsW[1]->setFocusPolicy(WheelFocus);
+ mWeekLabelsW[1]->setFocusPolicy(Qt::WheelFocus);
int row, col;
mCells.resize( mNumCells );
for( row = 0; row < mNumWeeks; ++row ) {
for( col = 0; col < mDaysPerWeek; ++col ) {
MonthViewCell *cell = new MonthViewCell( this, mMonthView );
mCells.insert( row * mDaysPerWeek + col, cell );
connect( cell, SIGNAL( defaultAction( Incidence * ) ),
SLOT( defaultAction( Incidence * ) ) );
connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
SIGNAL( newEventSignal( QDateTime ) ) );
connect( cell, SIGNAL( showDaySignal( QDate ) ),
SIGNAL( showDaySignal( QDate ) ) );
connect( cell, SIGNAL( nextCell() ),
SLOT( nextCell() ) );
connect( cell, SIGNAL( prevCell() ),
SLOT( prevCell() ) );
connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ),
SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) ));
}
}
mCellsW.resize( mDaysPerWeek );
for( col = 0; col < mDaysPerWeek; ++col ) {
MonthViewCell *cell = new MonthViewCell( this, mWeekView );
mCellsW.insert( col, cell );
connect( cell, SIGNAL( defaultAction( Incidence * ) ),
SLOT( defaultAction( Incidence * ) ) );
connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
SIGNAL( newEventSignal( QDateTime ) ) );
connect( cell, SIGNAL( showDaySignal( QDate ) ),
SIGNAL( showDaySignal( QDate ) ) );
connect( cell, SIGNAL( nextCell() ),
SLOT( nextCell() ) );
connect( cell, SIGNAL( prevCell() ),
SLOT( prevCell() ) );
connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ),
SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) ));
cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont );
}
//connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
mContextMenu = eventPopup();
- mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mContextMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("New Event..."),this,
SLOT(slotNewEvent()),false);
- mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mContextMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("New Todo..."),this,
SLOT(slotNewTodo()),false);
- mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mContextMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("Journal"),this,
SLOT(slotEditJournal()),false);
connect (mContextMenu ,SIGNAL(categoryChanged( Incidence * )),this,
SLOT( catChanged( Incidence * ) ));
QString pathString = "";
if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
if ( QApplication::desktop()->width() < 480 )
pathString += "icons16/";
} else
pathString += "iconsmini/";
- mNewItemMenu = new QPopupMenu( this );
+ mNewItemMenu = new Q3PopupMenu( this );
mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent()));
mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false);
mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false);
// updateConfig(); //useless here...
// ... but we need mWidthLongDayLabel computed
QFontMetrics fontmetric(mDayLabels[0]->font());
mWidthLongDayLabel = 0;
for (int i = 0; i < 7; i++) {
int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
}
//mWeekLabels[mNumWeeks]->setText( i18n("W"));
#if 0
if ( mShowWeekView )
mWidStack->raiseWidget( mWeekView );
else
mWidStack->raiseWidget( mMonthView );
#endif
emit incidenceSelected( 0 );
@@ -1376,49 +1388,49 @@ KOMonthView::~KOMonthView()
void KOMonthView::catChanged( Incidence * )
{
updateView();
}
void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int mday )
{
static Incidence * lastInc = 0;
static MonthViewCell * lastCell = 0;
if ( lastInc == inc && lastCell == mc )
return;
lastInc = inc;
lastCell = mc;
//qDebug("KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday );
bool weekview = false;
uint index = 0;
for (uint i = 0; i < mCellsW.count(); ++i) {
if ( mCellsW[i] == mc ) {
weekview = true;
index = i;
break;
}
}
- QPtrVector<MonthViewCell> *cells;
+ Q3PtrVector<MonthViewCell> *cells;
if ( weekview )
cells = &mCellsW;
else {
for (uint i = 0; i < mCells.count(); ++i) {
if ( mCells[i] == mc ) {
index = i;
break;
}
}
cells = &mCells;
}
for (uint i = 0; i < (*cells).count(); ++i) {
(*cells)[i]->deHighLight();
}
if ( ! inc )
return;
uint count = (*cells).count();
bool goLeft = (mday > 1 && index > 0);
bool goRight = (mday < 3 && mday > 0 && index < count -1);
for (uint iii = 1; iii < count; ++iii) {
if ( goLeft ) {
int left = index - iii;
if ( left >= 0 ) {
@@ -1474,51 +1486,51 @@ void KOMonthView::switchView()
selectedCell()->deselect();
mShowWeekView = !mShowWeekView;
KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
if ( clPending ) {
computeLayout();
updateConfig();
}
if ( mShowWeekView )
mWidStack->raiseWidget( mWeekView );
else
mWidStack->raiseWidget( mMonthView );
clPending = false;
}
int KOMonthView::maxDatesHint()
{
return mNumCells;
}
int KOMonthView::currentDateCount()
{
return mNumCells;
}
-QPtrList<Incidence> KOMonthView::selectedIncidences()
+Q3PtrList<Incidence> KOMonthView::selectedIncidences()
{
- QPtrList<Incidence> selected;
+ Q3PtrList<Incidence> selected;
if ( mSelectedCell ) {
Incidence *incidence = mSelectedCell->selectedIncidence();
if ( incidence ) selected.append( incidence );
}
return selected;
}
DateList KOMonthView::selectedDates()
{
DateList selected;
if ( mSelectedCell ) {
QDate qd = mSelectedCell->selectedIncidenceDate();
if ( qd.isValid() ) selected.append( qd );
}
return selected;
}
#if 0
void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
@@ -1540,100 +1552,100 @@ void KOMonthView::updateConfig()
for (int i = 0; i < 7; i++) {
int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
}
bool temp = mShowSatSunComp ;
mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
if ( ! mShowWeekView ) {
if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
computeLayout();
} else
doComputeLayoutWeek();
updateDayLabels();
//qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
//int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
//resizeEvent( 0 );
for (uint i = 0; i < mCells.count(); ++i) {
mCells[i]->updateConfig();
}
for (uint i = 0; i < mCellsW.count(); ++i) {
mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont);
}
#ifdef DESKTOP_VERSION
- MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
+ /* TODO:hacker: MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); */
#endif
updateView();
}
void KOMonthView::updateDayLabels()
{
- QPtrVector<QLabel> *mDayLabelsT;
+ Q3PtrVector<QLabel> *mDayLabelsT;
mDayLabelsT = &mDayLabelsW;
for (int i = 0; i < 7; i++) {
{
bool show = mShortDayLabelsW;
if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
show = true;
(*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
}
}
mDayLabelsT = &mDayLabels;
for (int i = 0; i < 7; i++) {
if (KGlobal::locale()->weekStartsMonday() || KOPrefs::instance()->mMonthViewSatSunTog ) {
bool show = mShortDayLabelsM;
if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
show = true;
(*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
} else {
if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsM));
else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsM));
}
}
}
void KOMonthView::clearList()
{
unsigned int i;
for( i = 0; i < mCells.size(); ++i ) {
mCells[i]->clear();
}
for( i = 0; i < mCellsW.size(); ++i ) {
mCellsW[i]->clear();
}
}
void KOMonthView::showDates(const QDate &start, const QDate &)
{
// kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
- QPtrVector<MonthViewCell> *cells;
- QPtrVector<QLabel> *dayLabels;
- QPtrVector<KOWeekButton> *weekLabels;
+ Q3PtrVector<MonthViewCell> *cells;
+ Q3PtrVector<QLabel> *dayLabels;
+ Q3PtrVector<KOWeekButton> *weekLabels;
uint weekNum = 6;
mStartDate = start;
if ( mShowWeekView ) {
weekNum = 1;
cells = &mCellsW;
dayLabels = &mDayLabelsW;
weekLabels = &mWeekLabelsW;
if ( !KGlobal::locale()->weekStartsMonday() ) {
mStartDate = mStartDate.addDays( 1 );
}
} else {
cells = &mCells;
dayLabels = &mDayLabels;
weekLabels = &mWeekLabels;
}
int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) {
mWeekStartsMonday = true;
}
int startWeekDay = mWeekStartsMonday ? 1 : 7;
while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) {
@@ -1647,86 +1659,86 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
#ifndef KORG_NOPLUGINS
// add holiday, if present
QString hstring(KOCore::self()->holiday(date));
(*cells)[i]->setHoliday( hstring );
#endif
}
QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 );
for( i = 0; i < weekNum; ++i ) {
int wno;
// remember, according to ISO 8601, the first week of the year is the
// first week that contains a thursday. Thus we must subtract off 4,
// not just 1.
int dayOfYear = date.dayOfYear();
if (dayOfYear % 7 != 0)
wno = dayOfYear / 7 + 1;
else
wno =dayOfYear / 7;
(*weekLabels)[i]->setWeekNum( wno );
date = date.addDays( 7 );
}
updateView();
}
-void KOMonthView::showEvents(QPtrList<Event>)
+void KOMonthView::showEvents(Q3PtrList<Event>)
{
qDebug("KOMonthView::selectEvents is not implemented yet. ");
}
void KOMonthView::changeEventDisplay(Event *, int)
{
// this should be re-written to be much more efficient, but this
// quick-and-dirty-hack gets the job done for right now.
//qDebug("KOMonthView::changeEventDisplay ");
updateView();
}
void KOMonthView::updateView()
{
if ( !updatePossible )
return;
//qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU ");
//QTime ti;
//ti.start();
clearSelection();
- QPtrVector<MonthViewCell> *cells;
+ Q3PtrVector<MonthViewCell> *cells;
if ( mShowWeekView ) {
cells = &mCellsW;
} else {
cells = &mCells;
}
#if 1
int i;
int timeSpan = (*cells).size()-1;
if ( KOPrefs::instance()->mMonthViewWeek )
timeSpan = 6;
for( i = 0; i < timeSpan + 1; ++i ) {
(*cells)[i]->startUpdateCell();
}
- QPtrList<Event> events = calendar()->events();
+ Q3PtrList<Event> events = calendar()->events();
Event *event;
QDateTime dt;
QDate endDate = mStartDate.addDays( timeSpan );
for( event = events.first(); event; event = events.next() ) { // for event
if ( event->doesRecur() ) {
bool last;
QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
QDateTime incidenceEnd;
int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
bool invalid = false;
while( true ) {
if ( incidenceStart.isValid() ) {
incidenceEnd = incidenceStart.addDays( eventlen );
int st = incidenceStart.date().daysTo( endDate );
if ( st >= 0 ) { // start before timeend
int end = mStartDate.daysTo( incidenceEnd.date() );
if ( end >= 0 ) { // end after timestart --- got one!
//normalize
st = timeSpan - st;
if ( st < 0 ) st = 0;
if ( end > timeSpan ) end = timeSpan;
int iii;
//qDebug("found %s %d %d ",event->summary().latin1(), st, end );
for ( iii = st;iii<= end;++iii)
@@ -1748,49 +1760,49 @@ void KOMonthView::updateView()
break;
if ( incidenceStart.date() > endDate )
break;
}
} else { // no recur
if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") )
if ( event->uid().left(15) == QString("last-syncEvent-") )
continue;
int st = event->dtStart().date().daysTo( endDate );
if ( st >= 0 ) { // start before timeend
int end = mStartDate.daysTo( event->dtEnd().date() );
if ( end >= 0 ) { // end after timestart --- got one!
//normalize
st = timeSpan - st;
if ( st < 0 ) st = 0;
if ( end > timeSpan ) end = timeSpan;
int iii;
for ( iii = st;iii<= end;++iii)
(*cells)[iii]->insertEvent( event );
}
}
}
}
// insert due todos
- QPtrList<Todo> todos = calendar()->todos( );
+ Q3PtrList<Todo> todos = calendar()->todos( );
Todo *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
//insertTodo( todo );
if ( todo->hasDueDate() ) {
int day = mStartDate.daysTo( todo->dtDue().date() );
if ( day >= 0 && day < timeSpan + 1) {
(*cells)[day]->insertTodo( todo );
}
}
}
for( i = 0; i < timeSpan+1; ++i ) {
(*cells)[i]->finishUpdateCell();
}
processSelectionChange();
//qApp->processEvents();
for( i = 0; i < timeSpan+1; ++i ) {
//(*cells)[i]->repaintfinishUpdateCell();
QTimer::singleShot( 0, (*cells)[i], SLOT ( repaintfinishUpdateCell() ) );
}
setKeyBFocus();
#else
// old code
//qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
@@ -2204,115 +2216,115 @@ void KOMonthView::showContextMenu( Incidence *incidence )
}
MonthViewCell * KOMonthView::selectedCell( )
{
return mSelectedCell;
}
void KOMonthView::setSelectedCell( MonthViewCell *cell )
{
//qDebug("KOMonthView::setSelectedCell %d", cell);
if ( mSelectedCell && mSelectedCell != cell ) {
MonthViewCell * mvc = mSelectedCell;
mSelectedCell = cell;
mvc->deselect();
} else
mSelectedCell = cell;
// if ( mSelectedCell )
// mSelectedCell->select();
if ( !mSelectedCell )
emit incidenceSelected( 0 );
else
emit incidenceSelected( mSelectedCell->selectedIncidence() );
}
void KOMonthView::processSelectionChange()
{
- QPtrList<Incidence> incidences = selectedIncidences();
+ Q3PtrList<Incidence> incidences = selectedIncidences();
if (incidences.count() > 0) {
emit incidenceSelected( incidences.first() );
} else {
emit incidenceSelected( 0 );
clearSelection();
}
}
void KOMonthView::clearSelection()
{
if ( mSelectedCell ) {
mSelectedCell->deselect();
mSelectedCell = 0;
}
}
void KOMonthView::keyReleaseEvent ( QKeyEvent * e)
{
if ( !e->isAutoRepeat() ) {
mFlagKeyPressed = false;
}
}
void KOMonthView::keyPressEvent ( QKeyEvent * e )
{
qApp->processEvents();
if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
//e->ignore();
e->accept();
return;
}
if (! e->isAutoRepeat() )
mFlagKeyPressed = true;
switch(e->key()) {
- case Key_Up:
+ case Qt::Key_Up:
{
if ( mShowWeekView ) {
emit selectWeekNum ( currentWeek() - 1 );
}
else {
emit prevMonth();
}
}
e->accept();
break;
- case Key_Down:
+ case Qt::Key_Down:
{
if ( mShowWeekView ) {
emit selectWeekNum ( currentWeek() +1);
}
else {
emit nextMonth();
}
}
e->accept();
break;
- case Key_Return:
- case Key_Enter:
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
{
selectInternalWeekNum ( currentWeek() );
}
e->accept();
break;
- case Key_D:
+ case Qt::Key_D:
if ( mSelectedCell ) {
mSelectedCell->showDay();
e->accept();
} else {
e->ignore();
}
break;
default:
e->ignore();
break;
}
}
void KOMonthView::nextCell()
{
focusNextPrevChild ( true );
}
void KOMonthView::prevCell()
{
focusNextPrevChild ( false );
}
void KOMonthView::slotNewTodo()
{
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 1a9d16d..bca76e5 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -1,154 +1,161 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _KOMONTHVIEW_H
#define _KOMONTHVIEW_H
#include <qlabel.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qdatetime.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qpoint.h>
-#include <qwidgetstack.h>
+#include <q3widgetstack.h>
#include <qlayout.h>
#include <qtimer.h>
-#include <qintdict.h>
+#include <q3intdict.h>
#include <qpushbutton.h>
-#include <qvaluelist.h>
-#include <qptrvector.h>
+#include <q3valuelist.h>
+#include <q3ptrvector.h>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QFocusEvent>
+#include <QMouseEvent>
+#include <Q3PtrList>
+#include <Q3PopupMenu>
+#include <QKeyEvent>
#include <libkcal/calendar.h>
#include <libkcal/event.h>
#include "koeventview.h"
#include "navigatorbar.h"
#ifdef DESKTOP_VERSION
class QToolTipGroup;
#endif
class KNOWhatsThis;
class MonthViewCell;
class KOWeekButton : public QPushButton
{
Q_OBJECT
public:
KOWeekButton( QWidget *parent=0, const char *name=0 ) :
QPushButton( parent, name)
{
connect( this, SIGNAL( clicked() ),
SLOT( bottonClicked() ));
mNumber = -1;
}
void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
int getWeekNum() { return mNumber;}
signals:
void selectWeekNum ( int );
private:
void focusInEvent ( QFocusEvent * ){;}
int mNumber;
void keyPressEvent ( QKeyEvent * e )
{
e->ignore();
}
private slots :
void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
};
-class KNoScrollListBox: public QListBox
+class KNoScrollListBox: public Q3ListBox
{
Q_OBJECT
public:
KNoScrollListBox(QWidget *parent=0, const char *name=0);
~KNoScrollListBox();
QString getWhatsThisText(QPoint p) ;
signals:
void shiftDown();
void shiftUp();
void rightClick();
void nextCell();
void prevCell();
void highlightIncidence( Incidence * , MonthViewCell*, int );
protected:
bool mBlockDeselect;
protected slots:
void oneDown();
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
void mousePressEvent(QMouseEvent *);
void focusInEvent ( QFocusEvent * );
void focusOutEvent ( QFocusEvent * );
private:
bool resetOnFocusIn;
KNOWhatsThis * mWT;
};
-class MonthViewItem: public QListBoxItem
+class MonthViewItem: public Q3ListBoxItem
{
public:
MonthViewItem( Incidence *,const QString & title );
void recycle( Incidence *incidence, const QString & s);
void setRecur(bool on) { mRecur = on; }
void setAlarm(bool on) { mAlarm = on; }
void setReply(bool on) { mReply = on; }
void setMoreInfo(bool on) { mInfo = on; }
void setMultiDay(int type) { mMultiday = type; }
int multiDay() { return mMultiday; }
void setMultiDayPos(int type) { mdayPos = type; }
int gettMultiDayPos() { return mdayPos; }
void setBlockRepaint(bool on) { mblockRepaint = on; }
bool setHighlighted( Incidence * );
void setPalette(const QPalette &p) { mPalette = p; }
QPalette palette() const { return mPalette; }
bool setHighlightedFalse();
Incidence *incidence() const { return mIncidence; }
protected:
virtual void paint(QPainter *);
- virtual int height(const QListBox *) const;
- virtual int width(const QListBox *) const;
+ virtual int height(const Q3ListBox *) const;
+ virtual int width(const Q3ListBox *) const;
private:
int mdayPos;
bool isWeekItem;
bool mblockRepaint;
int mMultiday;
bool mRecur;
bool mAlarm;
bool mReply;
bool mInfo;
bool mDisplayHighlighted;
QPalette mPalette;
QDate mDate;
Incidence *mIncidence;
};
class KOMonthView;
class MonthViewCell : public KNoScrollListBox
{
Q_OBJECT
@@ -177,175 +184,175 @@ class MonthViewCell : public KNoScrollListBox
Incidence *selectedIncidence();
QDate selectedIncidenceDate();
QPushButton * dateLabel() { return mLabel; }
bool doHighLight( Incidence *);
void deselect();
void select();
#ifdef DESKTOP_VERSION
static QToolTipGroup *toolTipGroup();
#endif
signals:
void defaultAction( Incidence * );
void newEventSignal( QDateTime );
void showDaySignal( QDate );
protected:
QStringList mToolTip;
void resizeEvent( QResizeEvent * );
public slots:
void showDay();
void deHighLight();
void repaintfinishUpdateCell();
protected slots:
- void defaultAction( QListBoxItem * );
- void contextMenu( QListBoxItem * );
- void selection( QListBoxItem * );
- void cellClicked( QListBoxItem * );
+ void defaultAction( Q3ListBoxItem * );
+ void contextMenu( Q3ListBoxItem * );
+ void selection( Q3ListBoxItem * );
+ void cellClicked( Q3ListBoxItem * );
void newEvent();
private:
int mdayCount;
- QPtrList <MonthViewItem> mAvailItemList;
+ Q3PtrList <MonthViewItem> mAvailItemList;
KOMonthView *mMonthView;
int currentPalette;
QDate mDate;
bool mPrimary;
bool mHoliday;
QString mHolidayString;
//QLabel *mLabel;
QPushButton *mLabel;
//QListBox *mItemList;
#ifdef DESKTOP_VERSION
static QToolTipGroup *mToolTipGroup;
#endif
QSize mLabelSize;
QSize mLabelBigSize;
QPalette mHolidayPalette;
QPalette mStandardPalette;
QPalette mPrimaryPalette;
QPalette mNonPrimaryPalette;
void setMyPalette();
QPalette getPalette ();
};
class KOMonthView: public KOEventView
{
Q_OBJECT
public:
KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
~KOMonthView();
/** Returns maximum number of days supported by the komonthview */
virtual int maxDatesHint();
/** Returns number of currently shown dates. */
virtual int currentDateCount();
/** returns the currently selected events */
- virtual QPtrList<Incidence> selectedIncidences();
+ virtual Q3PtrList<Incidence> selectedIncidences();
/** returns dates of the currently selected events */
virtual DateList selectedDates();
#if 0
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
#endif
bool isMonthView() { return !mShowWeekView; }
bool isUpdatePossible() { return updatePossible; }
MonthViewCell * selectedCell();
bool skipResize;
NavigatorBar* navigatorBar() { return mNavigatorBar ;}
void clearList();
public slots:
void incidenceHighlighted( Incidence *, MonthViewCell*, int );
void nextCell();
void prevCell();
virtual void updateView();
virtual void updateConfig();
virtual void showDates(const QDate &start, const QDate &end);
- virtual void showEvents(QPtrList<Event> eventList);
+ virtual void showEvents(Q3PtrList<Event> eventList);
void changeEventDisplay(Event *, int);
void clearSelection();
void showContextMenu( Incidence * );
void setSelectedCell( MonthViewCell * );
void setPopupCell( MonthViewCell * );
void switchView();
void setKeyBFocus();
protected slots:
void catChanged( Incidence * );
void setKeyBoardFocus();
void slotNewTodo();
void slotNewEvent();
void slotEditJournal();
void slotComputeLayout();
void selectInternalWeekNum ( int );
void processSelectionChange();
signals:
void nextMonth();
void prevMonth();
void selectWeekNum ( int );
void selectMonth ();
void showDaySignal( QDate );
void newTodoSignal( QDateTime, bool );
void showJournalSignal( int,QDate );
protected:
void resizeEvent(QResizeEvent *);
void viewChanged();
void updateDayLabels();
int mapWeekLayout( int, bool );
private:
int mKBFcounter;
QTimer* mComputeLayoutTimer;
NavigatorBar* mNavigatorBar;
int currentWeek();
bool clPending;
- QWidgetStack * mWidStack;
+ Q3WidgetStack * mWidStack;
QWidget* mMonthView;
QWidget* mWeekView;
bool mShowWeekView;
bool updatePossible;
int mDaysPerWeek;
int mNumWeeks;
int mNumCells;
//bool mWeekStartsMonday;
bool mShowSatSunComp;
void computeLayout();
void computeLayoutWeek();
void doComputeLayoutWeek();
- QPtrVector<MonthViewCell> mCells;
- QPtrVector<QLabel> mDayLabels;
- QPtrVector<KOWeekButton> mWeekLabels;
- QPtrVector<MonthViewCell> mCellsW;
- QPtrVector<QLabel> mDayLabelsW;
- QPtrVector<KOWeekButton> mWeekLabelsW;
+ Q3PtrVector<MonthViewCell> mCells;
+ Q3PtrVector<QLabel> mDayLabels;
+ Q3PtrVector<KOWeekButton> mWeekLabels;
+ Q3PtrVector<MonthViewCell> mCellsW;
+ Q3PtrVector<QLabel> mDayLabelsW;
+ Q3PtrVector<KOWeekButton> mWeekLabelsW;
bool mShortDayLabelsM;
bool mShortDayLabelsW;
int mWidthLongDayLabel;
QDate mStartDate;
MonthViewCell *mSelectedCell;
MonthViewCell *mPopupCell;
bool mFlagKeyPressed;
KOEventPopupMenu *mContextMenu;
- QPopupMenu *mNewItemMenu;
+ Q3PopupMenu *mNewItemMenu;
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
};
#endif
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 5078c57..0bd46ea 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -5,49 +5,49 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <time.h>
#ifndef _WIN32_
#include <unistd.h>
#endif
#include <qdir.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qtextcodec.h>
#include <qstring.h>
#include <qregexp.h>
#include <qfont.h>
#include <qcolor.h>
#include <qstringlist.h>
#include <stdlib.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kconfig.h>
#include <klocale.h>
#include <kdebug.h>
#include <kemailsettings.h>
#include <kstaticdeleter.h>
#include <libkdepim/kpimglobalprefs.h>
#include "koprefs.h"
#include "mainwindow.h"
KOPrefs *KOPrefs::mInstance = 0;
static KStaticDeleter<KOPrefs> insd;
KOPrefs::KOPrefs() :
@@ -284,55 +284,55 @@ KOPrefs::KOPrefs() :
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");
+ addItemStringList("SelectedPlugins",&mSelectedPlugins,QStringList("holidays"));
KPrefs::setCurrentGroup("Group Scheduling");
addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
- addItemStringList("AdditionalMails",&mAdditionalMails,"");
+ addItemStringList("AdditionalMails",&mAdditionalMails,QStringList());
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 );
}
@@ -545,49 +545,49 @@ int KOPrefs::getFuzzyCalendarID( const QString & name )
return kkf->mCalNumber;
kkf = mCalendars.next();
}
return 0;
}
QString KOPrefs::calName( int calNum) const
{
return (mDefCalColors[calNum-1])->mName;
}
QColor KOPrefs::defaultColor( int calNum ) const
{
if ( calNum == 1 ) return mEventColor;
return (mDefCalColors[calNum-1])->mDefaultColor;
}
void KOPrefs::usrWriteConfig()
{
config()->setGroup("General");
config()->writeEntry("Custom Categories",mCustomCategories);
config()->setGroup("Personal Settings");
config()->writeEntry("user_name",mName);
config()->writeEntry("user_email",mEmail);
config()->setGroup("Category Colors");
- QDictIterator<QColor> it(mCategoryColors);
+ Q3DictIterator<QColor> it(mCategoryColors);
while (it.current()) {
config()->writeEntry(it.currentKey(),*(it.current()));
++it;
}
KConfig fc (locateLocal("config","kopicalendarrc"));
fc.setGroup("CC");
fc.deleteGroup( "CC");
fc.setGroup("CC");
fc.writeEntry("NumberCalendars",mCalendars.count());
int numCal = 1;
int writeCal = 0;
while ( numCal < mNextAvailableCalendar ) {
KopiCalendarFile * kkf = mCalendars.first();
while ( kkf ) {
//qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
if ( kkf->mCalNumber == numCal ) {
++writeCal;
//qDebug("Write calendar %d %d ", numCal , writeCal);
QString prefix = "Cal_" + QString::number( writeCal );
fc.writeEntry( prefix+"_isStandard", kkf->isStandard );
fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled );
fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
fc.writeEntry( prefix+"_isRelative", kkf->isRelative );
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 94bdd33..35c6110 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -4,51 +4,54 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOPREFS_H
#define KOPREFS_H
#include <libkdepim/kpimprefs.h>
-#include <qdict.h>
+#include <q3dict.h>
#include <qdir.h>
#include <qobject.h>
+#include <QDateTime>
+//Added by qt3to4:
+#include <Q3PtrList>
class KConfig;
class QFont;
class QColor;
class QStringList;
#define VIEW_WN_VIEW 1
#define VIEW_NX_VIEW 2
#define VIEW_J_VIEW 3
#define VIEW_A_VIEW 4
#define VIEW_ML_VIEW 5
#define VIEW_M_VIEW 6
#define VIEW_L_VIEW 7
#define VIEW_T_VIEW 8
class KopiCalendarFile : public QObject
{
public:
KopiCalendarFile( ) : QObject( )
{
isStandard = false;
isEnabled = true;
isAlarmEnabled = true;
isReadOnly = false;
@@ -326,52 +329,52 @@ class KOPrefs : public KPimPrefs
QStringList mTodoSummaryUser;
QStringList mJournalSummaryUser;
bool mUseInternalAlarmNotification;
int mAlarmPlayBeeps;
int mAlarmSuspendTime;
int mAlarmSuspendCount;
int mAlarmBeepInterval;
int mOldLanguage;
int mOldLoadedLanguage;
QString mActiveSyncPort;
QString mActiveSyncIP;
// settings for eventviewer
bool mEVshowDetails;
bool mEVshowCreated;
bool mEVshowChanged;
bool mWTshowDetails;
bool mWTshowCreated;
bool mWTshowChanged;
int mCurrentDisplayedView;
- QPtrList<KopiCalendarFile> mCalendars;
+ Q3PtrList<KopiCalendarFile> mCalendars;
int mNextAvailableCalendar;
bool mGlobalUpdateDisabled;
bool mDetectConflicts;
bool mIncludeFree;
bool mCheckConflictsAllDayAllDay;
bool mCheckConflictsAllDayNonAD;
bool mCheckConflictsNonADAllDay;
bool mCheckConflictsNonADNonAD;
QString mFilterConflictEditItem;
QString mFilterConflictAllItem;
private:
- QDict<QColor> mCategoryColors;
- QArray<KopiCalendarFile*> mDefCalColors;
+ Q3Dict<QColor> mCategoryColors;
+ QVector<KopiCalendarFile*> mDefCalColors;
QColor mDefaultCategoryColor;
QFont mDefaultTimeBarFont;
QFont mDefaultViewFont;
QFont mDefaultMonthViewFont;
QString mName;
QString mEmail;
};
#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index f1a6c3d..43c488f 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -2,66 +2,72 @@
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlayout.h>
#include <qlabel.h>
-#include <qgroupbox.h>
-#include <qbuttongroup.h>
+#include <q3groupbox.h>
+#include <q3buttongroup.h>
#include <qlineedit.h>
#include <qfont.h>
#include <qslider.h>
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qcombobox.h>
-#include <qvbox.h>
-#include <qhbox.h>
+#include <q3vbox.h>
+#include <q3hbox.h>
#include <qregexp.h>
#include <qspinbox.h>
#include <qdatetime.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
-#include <qstrlist.h>
+#include <q3strlist.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3GridLayout>
+#include <QPixmap>
+#include <Q3Frame>
#include <kcolorbutton.h>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
#include <kfontdialog.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include <kcolordialog.h>
#include <kiconloader.h>
#include <kemailsettings.h>
#include <kstandarddirs.h>
#include <kglobalsettings.h>
#include <kurlrequester.h>
#include <klineedit.h>
#if defined(USE_SOLARIS)
#include <sys/param.h>
#define ZONEINFODIR "/usr/share/lib/zoneinfo"
#define INITFILE "/etc/default/init"
#endif
@@ -95,50 +101,50 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
setupFontsTab();
setupColorsTab();
setupViewsTab();
//setupSyncTab();
//setupSyncAlgTab();
//setupPrinterTab();
//setupGroupSchedulingTab();
//setupGroupAutomationTab();
}
KOPrefsDialog::~KOPrefsDialog()
{
}
void KOPrefsDialog::setupGlobalTab()
{
}
void KOPrefsDialog::setupLocaleDateTab()
{
#if 0
-QFrame *topFrame = addPage(i18n("Date Format"),0,0);
- QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
+Q3Frame *topFrame = addPage(i18n("Date Format"),0,0);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
int iii = 0;
KPrefsDialogWidRadios *syncPrefsGroup =
addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
QString format;
if ( QApplication::desktop()->width() < 480 )
format = "(%d.%m.%Y)";
else
format = "(%d.%m.%Y|%A %d %B %Y)";
syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%m.%d.%Y)";
else
format = "(%m.%d.%Y|%A %B %d %Y)";
syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%Y-%m-%d)";
else
format = "(%Y-%m-%d|%A %Y %B %d)";
syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
syncPrefsGroup->addRadio(i18n("User defined"));
@@ -151,190 +157,190 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0);
topLayout->addWidget(lab ,iii,0);
topLayout->addWidget(mUserDateFormatLong,iii,1);
++iii;
mUserDateFormatShort = new QLineEdit(topFrame);
lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
topLayout->addWidget(lab ,iii,0);
topLayout->addWidget(mUserDateFormatShort,iii,1);
++iii;
lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
#endif
}
void KOPrefsDialog::setupLocaleTab()
{
#if 0
- QFrame *topFrame = addPage(i18n("Locale"),0,0);
- QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
+ Q3Frame *topFrame = addPage(i18n("Locale"),0,0);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
int iii = 0;
KPrefsDialogWidRadios *syncPrefsGroup =
addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
syncPrefsGroup->addRadio(i18n("English"));
syncPrefsGroup->addRadio(i18n("German"));
syncPrefsGroup->addRadio(i18n("French"));
syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
if ( QApplication::desktop()->width() < 300 )
;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
++iii;
syncPrefsGroup =
addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
if ( QApplication::desktop()->width() > 300 )
syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
syncPrefsGroup->addRadio(i18n("24:00"));
syncPrefsGroup->addRadio(i18n("12:00am"));
syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
++iii;
KPrefsDialogWidBool *sb;
if ( QApplication::desktop()->width() < 300 ) {
sb =
addWidBool(i18n("Week starts on Sunday"),
&(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
++iii;
sb =
addWidBool(i18n("Use short date in (WN/E) view"),
&(KOPrefs::instance()->mShortDateInViewer),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
}
else {
QWidget * hb = new QWidget( topFrame );
- QHBoxLayout *hbLayout = new QHBoxLayout(hb);
+ Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb);
sb =
addWidBool(i18n("Week starts on Sunday"),
&(KOPrefs::instance()->mWeekStartsOnSunday),hb);
hbLayout->addWidget(sb->checkBox() );
sb =
addWidBool(i18n("Use short date in (WN/E) view"),
&(KOPrefs::instance()->mShortDateInViewer),hb);
hbLayout->addWidget(sb->checkBox() );
topLayout->addMultiCellWidget(hb, iii,iii,0,1);
}
// KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
#if 0
++iii;
sb =
addWidBool(i18n("Quick load/save (w/o Unicode)"),
&(KOPrefs::instance()->mUseQuicksave),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
#endif
#endif
}
void KOPrefsDialog::setupMainTab()
{
- QFrame *topFrame = addPage(i18n("General"),0,0);
+ Q3Frame *topFrame = addPage(i18n("General"),0,0);
// DesktopIcon("identity",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
// KPrefsDialogWidBool *emailControlCenter =
// addWidBool(i18n("&Use email settings from Control Center"),
// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
// connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
// SLOT(toggleEmailSettings(bool)));
mNameEdit = new QLineEdit(topFrame);
mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
topLayout->addWidget(mNameLabel,0,0);
topLayout->addWidget(mNameEdit,0,1);
mEmailEdit = new QLineEdit(topFrame);
mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
topLayout->addWidget(mEmailLabel,1,0);
topLayout->addWidget(mEmailEdit,1,1);
KPrefsDialogWidBool *wb;
KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
&(KOPrefs::instance()->mShowFullMenu),topFrame);
topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1);
widbool = addWidBool(i18n("Mini icons in toolbar(nr)"),
&(KOPrefs::instance()->mToolBarMiniIcons),topFrame);
topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1);
KPrefsDialogWidBool *verticalScreen =
addWidBool(i18n("Vertical screen layout(Needs restart)"),
&(KOPrefs::instance()->mVerticalScreen),topFrame);
//topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
int iii = 5;
widbool = addWidBool(i18n("Block popup until mouse button release"),
&(KOPrefs::instance()->mBlockPopupMenu),topFrame);
topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1);
++iii;
if ( QApplication::desktop()->height() <= 240 ) {
topFrame = addPage(i18n("General") +" 2",0,0);
- topLayout = new QGridLayout(topFrame,4,2);
+ topLayout = new Q3GridLayout(topFrame,4,2);
topLayout->setSpacing(2);
topLayout->setMargin(3);
iii = 0;
}
- QHBox *dummy = new QHBox(topFrame);
+ Q3HBox *dummy = new Q3HBox(topFrame);
new QLabel(i18n("Days in Next-X-Days:"),dummy);
mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
topLayout->addMultiCellWidget(dummy,iii,iii,0,1);
++iii;
// KPrefsDialogWidBool *bcc =
// addWidBool(i18n("Send copy to owner when mailing events"),
// &(KOPrefs::instance()->mBcc),topFrame);
// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
// QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
//topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
// addWidBool(i18n("Enable automatic saving of calendar"),
// &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
- QHBox *intervalBox = new QHBox(topFrame);
+ Q3HBox *intervalBox = new Q3HBox(topFrame);
// intervalBox->setSpacing(mSpacingHint);
topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1);
++iii;
QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
/*
QHBox * agendasize = new QHBox ( topFrame );
new QLabel (i18n("AllDayAgenda Height:"), agendasize );
mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
topLayout->addMultiCellWidget(agendasize,7,7,0,1);
*/
KPrefsDialogWidBool *ask =
addWidBool(i18n("Ask for quit when closing KO/Pi"),
&(KOPrefs::instance()->mAskForQuit),topFrame);
topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1);
++iii;
@@ -381,177 +387,177 @@ void KOPrefsDialog::setupMainTab()
topFrame);
mailClientGroup->addRadio(i18n("KMail"));
mailClientGroup->addRadio(i18n("Sendmail"));
topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
KPrefsDialogWidBool *htmlsave =
addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
topFrame);
topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
KPrefsDialogWidRadios *destinationGroup =
addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
topFrame);
destinationGroup->addRadio(i18n("be added to the standard resource"));
destinationGroup->addRadio(i18n("be asked which resource to use"));
topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
topLayout->setRowStretch(14,1);
*/
}
void KOPrefsDialog::setupTimeTab()
{
- QFrame *topFrame = addPage(i18n("Time"),0,0);
+ Q3Frame *topFrame = addPage(i18n("Time"),0,0);
// DesktopIcon("clock",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
- QHBox *dummy = new QHBox(topFrame);
+ Q3HBox *dummy = new Q3HBox(topFrame);
KPrefsDialogWidTime *dayBegins =
addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
dummy);
//topLayout->addWidget(dayBegins->label(),2,0);
//topLayout->addWidget(dayBegins->spinBox(),2,1);
topLayout->addMultiCellWidget(dummy,0,0,0,1);
topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
topFrame),1,0);
mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
mStartTimeSpin->setSuffix(":00");
topLayout->addWidget(mStartTimeSpin,1,1);
topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
topFrame),2,0);
mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
mDefaultDurationSpin->setSuffix(":00");
topLayout->addWidget(mDefaultDurationSpin,2,1);
QStringList alarmList;
alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
<< i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
3,0);
mAlarmTimeCombo = new QComboBox(topFrame);
mAlarmTimeCombo->insertStringList(alarmList);
topLayout->addWidget(mAlarmTimeCombo,3,1);
int iii = 4;
if ( QApplication::desktop()->height() <= 240 ) {
topFrame = addPage(i18n("Time") +" 2",0,0);
- topLayout = new QGridLayout(topFrame,1,2);
+ topLayout = new Q3GridLayout(topFrame,1,2);
topLayout->setSpacing(2);
topLayout->setMargin(3);
iii = 0;
}
- QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
+ Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal,
i18n("Working Hours"),
topFrame);
topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1);
workingHoursGroup->layout()->setSpacing( 0 );
workingHoursGroup->layout()->setMargin( 4 );
- QHBox *workStartBox = new QHBox(workingHoursGroup);
+ Q3HBox *workStartBox = new Q3HBox(workingHoursGroup);
// workStartBox->setMargin( 0 );
addWidTime(i18n("Daily starting hour:"),
&(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
- QHBox *workEndBox = new QHBox(workingHoursGroup);
+ Q3HBox *workEndBox = new Q3HBox(workingHoursGroup);
//workEndBox->setMargin( 0 );
addWidTime(i18n("Daily ending hour:"),
&(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
- QVBox *excludeBox = new QVBox(workingHoursGroup);
+ Q3VBox *excludeBox = new Q3VBox(workingHoursGroup);
//excludeBox->setMargin( 0 );
addWidBool(i18n("Exclude holidays"),
&(KOPrefs::instance()->mExcludeHolidays),excludeBox);
addWidBool(i18n("Exclude Saturdays"),
&(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
// &(KOPrefs::instance()->mMarcusBainsShowSeconds),
// topFrame);
// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
// topLayout->setRowStretch(6,1);
}
void KOPrefsDialog::setupViewsTab()
{
- QFrame *topFrame = addPage(i18n("Views"),0,0);
+ Q3Frame *topFrame = addPage(i18n("Views"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
// topLayout->addLayout(dayBeginsLayout,0,0);
// KPrefsDialogWidTime *dayBegins =
// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
// topFrame);
// dayBeginsLayout->addWidget(dayBegins->label());
// dayBeginsLayout->addStretch(1);
// dayBeginsLayout->addWidget(dayBegins->spinBox());
// QBoxLayout *nextDaysLayout = new QHBoxLayout;
// topLayout->addLayout(nextDaysLayout,1,0);
// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
// nextDaysLayout->addStretch(1);
// nextDaysLayout->addWidget(mNextXDaysSpin);
int ii = 0;
KPrefsDialogWidBool *dummy =
addWidBool(i18n("Edit item on doubleclick (if not, show)"),
&(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
// topLayout->addWidget(hourSizeGroup,ii++,0);
// topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
//topLayout->setRowStretch(11,1);
#if 0
topFrame = addPage(i18n("ViewChange"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,6,1);
+ topLayout = new Q3GridLayout(topFrame,6,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
#endif
dummy =
addWidBool(i18n("Hold fullscreen on view change"),
&(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Hold non-fullscreen on view change"),
&(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
KPrefsDialogWidBool *fullViewMonth =
addWidBool(i18n("Next days view uses full window"),
&(KOPrefs::instance()->mFullViewMonth),topFrame);
topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
@@ -573,49 +579,49 @@ void KOPrefsDialog::setupViewsTab()
&(KOPrefs::instance()->mDailyRecur),topFrame);
topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
KPrefsDialogWidBool *weeklyRecur =
addWidBool(i18n("Show ev. that recur weekly in date nav."),
&(KOPrefs::instance()->mWeeklyRecur),topFrame);
topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
weeklyRecur =
addWidBool(i18n("Show multiday allday ev. in date nav."),
&(KOPrefs::instance()->mLongAllday),topFrame);
topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
#ifdef DESKTOP_VERSION
KPrefsDialogWidBool *enableToolTips =
addWidBool(i18n("Enable tooltips displaying summary of ev."),
&(KOPrefs::instance()->mEnableToolTips),topFrame);
topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
#endif
// *********************************************************
topFrame = addPage(i18n("Agenda View"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,5,1);
+ topLayout = new Q3GridLayout(topFrame,5,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
dummy =
addWidBool(i18n("Show time in agenda items"),
&(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Highlight current day in agenda"),
&(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Use light color for highlight current day"),
&(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
KPrefsDialogWidBool *marcusBainsEnabled =
addWidBool(i18n("Show current time"),
&(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
@@ -631,74 +637,74 @@ void KOPrefsDialog::setupViewsTab()
addWidBool(i18n("Set agenda to current time on change"),
&(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Allday Agenda view shows todos"),
&(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Agenda view shows completed todos"),
&(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
topFrame = addPage(i18n("Month View"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,5,1);
+ topLayout = new Q3GridLayout(topFrame,5,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
QLabel *lab;
- QHBox *habo = new QHBox( topFrame );
+ Q3HBox *habo = new Q3HBox( topFrame );
if ( QApplication::desktop()->width() <= 480 ) {
lab = new QLabel ( i18n("Show events that recur "), topFrame );
topLayout->addMultiCellWidget(lab,ii, ii,0,1);
ii++;
} else {
new QLabel ( i18n("Show events that recur "), habo );
}
dailyRecur =
addWidBool(i18n("daily"),
&(KOPrefs::instance()->mMonthDailyRecur),habo);
// topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
weeklyRecur =
addWidBool(i18n("weekly"),
&(KOPrefs::instance()->mMonthWeeklyRecur),habo);
topLayout->addMultiCellWidget(habo,ii, ii,0,1);
ii++;
- habo = new QHBox( topFrame );
+ habo = new Q3HBox( topFrame );
if ( QApplication::desktop()->width() <= 480 ) {
lab = new QLabel (i18n("Show in every cell ") , topFrame );
topLayout->addMultiCellWidget(lab,ii, ii,0,1);
ii++;
} else {
new QLabel ( i18n("Show in every cell "), habo );
}
weeklyRecur =
addWidBool(i18n("short month"),
&(KOPrefs::instance()->mMonthShowShort),habo);
weeklyRecur =
addWidBool(i18n("icons"),
&(KOPrefs::instance()->mMonthShowIcons),habo);
weeklyRecur =
addWidBool(i18n("times"),
&(KOPrefs::instance()->mMonthShowTimes),habo);
topLayout->addMultiCellWidget(habo,ii, ii,0,1);
ii++;
#ifdef DESKTOP_VERSION
KPrefsDialogWidBool *enableMonthScroll =
addWidBool(i18n("Enable scrollbars in month view cells"),
&(KOPrefs::instance()->mEnableMonthScroll),topFrame);
topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
@@ -709,377 +715,377 @@ void KOPrefsDialog::setupViewsTab()
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Week view mode uses row layout"),
&(KOPrefs::instance()->mMonthViewWeekRowlayout),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Show Sat/Sun together"),
&(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
KPrefsDialogWidBool *coloredCategoriesInMonthView =
addWidBool(i18n("Month view uses category colors"),
&(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Category colors are applied to text"),
&(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
if ( QApplication::desktop()->height() <= 240 ) {
topFrame = addPage(i18n("Month View") +" 2",0,0);
- topLayout = new QGridLayout(topFrame,4,1);
+ topLayout = new Q3GridLayout(topFrame,4,1);
topLayout->setSpacing(2);
topLayout->setMargin(1);
ii = 0;
}
coloredCategoriesInMonthView =
addWidBool(i18n("Month view uses day colors"),
&(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
KPrefsDialogWidColor *holidayColor =
addWidColor(i18n("Day color odd months"),
&(KOPrefs::instance()->mMonthViewOddColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
holidayColor =
addWidColor(i18n("Day color even months"),
&(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
holidayColor =
addWidColor(i18n("Color for Sundays + category \"Holiday\""),
&(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
// *********************** What'sNext View
topFrame = addPage(i18n("What's Next View"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,4,1);
+ topLayout = new Q3GridLayout(topFrame,4,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
- QHBox* hdummy = new QHBox(topFrame);
+ Q3HBox* hdummy = new Q3HBox(topFrame);
new QLabel(i18n("Days in What's Next:"),hdummy);
mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
topLayout->addWidget(hdummy,ii++,0);
- QHBox *prioBox = new QHBox(topFrame);
+ Q3HBox *prioBox = new Q3HBox(topFrame);
// intervalBox->setSpacing(mSpacingHint);
topLayout->addWidget(prioBox,ii++,0);
QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox);
mPrioSpin = new QSpinBox(0,5,1,prioBox);
if ( QApplication::desktop()->width() < 300 )
mPrioSpin->setFixedWidth( 40 );
KPrefsDialogWidBool *passwdk =
addWidBool(i18n("Show times on two lines"),
&(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame);
topLayout->addWidget(passwdk->checkBox(), ii++,0);
passwdk =
addWidBool(i18n("Show events that are done"),
&(KOPrefs::instance()->mWNViewShowsPast),topFrame);
topLayout->addWidget(passwdk->checkBox(), ii++,0);
passwdk =
addWidBool(i18n("Show parent To-Do's"),
&(KOPrefs::instance()->mWNViewShowsParents),topFrame);
topLayout->addWidget(passwdk->checkBox(), ii++,0);
passwdk =
addWidBool(i18n("Show location"),
&(KOPrefs::instance()->mWNViewShowLocation),topFrame);
topLayout->addWidget(passwdk->checkBox(), ii++,0);
passwdk =
addWidBool(i18n("Use short date in WN+Event view"),
&(KOPrefs::instance()->mShortDateInViewer),topFrame);
topLayout->addWidget(passwdk->checkBox(), ii++,0);
// *********************** Todo View
topFrame = addPage(i18n("Todo View"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,4,1);
+ topLayout = new Q3GridLayout(topFrame,4,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
dummy =
addWidBool(i18n("Hide not running Todos in To-do view"),
&(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
KPrefsDialogWidBool *showCompletedTodo =
addWidBool(i18n("To-do view shows completed Todos"),
&(KOPrefs::instance()->mShowCompletedTodo),topFrame);
topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
dummy =
addWidBool(i18n("To-do view shows complete as 'xx %'"),
&(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Small To-do view uses smaller font"),
&(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Todo view uses category colors"),
&(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
QWidget* wid = new QWidget( topFrame );
// Todo run today color
KPrefsDialogWidColor *todoRunColor =
addWidColor(i18n("Color for running todos:"),
&(KOPrefs::instance()->mTodoRunColor),wid);
- QHBoxLayout *widLayout = new QHBoxLayout(wid);
+ Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid);
widLayout->addWidget( todoRunColor->label() );
widLayout->addWidget( todoRunColor->button() );
topLayout->addWidget(wid,ii++,0);
wid = new QWidget( topFrame );
// Todo due today color
KPrefsDialogWidColor *todoDueTodayColor =
addWidColor(i18n("Todo due today color:"),
&(KOPrefs::instance()->mTodoDueTodayColor),wid);
- widLayout = new QHBoxLayout(wid);
+ widLayout = new Q3HBoxLayout(wid);
widLayout->addWidget( todoDueTodayColor->label() );
widLayout->addWidget( todoDueTodayColor->button() );
topLayout->addWidget(wid,ii++,0);
//topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
// Todo overdue color
wid = new QWidget( topFrame );
- widLayout = new QHBoxLayout(wid);
+ widLayout = new Q3HBoxLayout(wid);
KPrefsDialogWidColor *todoOverdueColor =
addWidColor(i18n("Todo overdue color:"),
&(KOPrefs::instance()->mTodoOverdueColor),wid);
widLayout->addWidget(todoOverdueColor->label());
widLayout->addWidget(todoOverdueColor->button());
topLayout->addWidget(wid,ii++,0);
dummy =
addWidBool(i18n("Colors are applied to text"),
&(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
topFrame = addPage(i18n("View Options"),0,0);
- topLayout = new QGridLayout(topFrame,4,1);
+ topLayout = new Q3GridLayout(topFrame,4,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
dummy =
addWidBool(i18n("Show Sync Events"),
&(KOPrefs::instance()->mShowSyncEvents),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
topLayout->addWidget(lab ,ii++,0);
dummy = addWidBool(i18n("Details"),
&(KOPrefs::instance()->mEVshowDetails),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy = addWidBool(i18n("Created time"),
&(KOPrefs::instance()->mEVshowCreated),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy = addWidBool(i18n("Last modified time"),
&(KOPrefs::instance()->mEVshowChanged),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
topLayout->addWidget(lab ,ii++,0);
dummy = addWidBool(i18n("Details"),
&(KOPrefs::instance()->mWTshowDetails),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy = addWidBool(i18n("Created time"),
&(KOPrefs::instance()->mWTshowCreated),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy = addWidBool(i18n("Last modified time"),
&(KOPrefs::instance()->mWTshowChanged),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
topFrame = addPage(i18n("Conflict detection"),0,0);
- topLayout = new QGridLayout(topFrame,2,1);
+ topLayout = new Q3GridLayout(topFrame,2,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
dummy = addWidBool(i18n("Enable conflict detection"),
&(KOPrefs::instance()->mDetectConflicts),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
- topFrame = new QFrame( topFrame );
+ topFrame = new Q3Frame( topFrame );
topLayout->addWidget(topFrame ,ii++,0);
- topLayout = new QGridLayout(topFrame,4,1);
+ topLayout = new Q3GridLayout(topFrame,4,1);
connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) );
dummy = addWidBool(i18n("Include events which \"show as free\""),
&(KOPrefs::instance()->mIncludeFree),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping."), topFrame ) , ii++,0);
topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0);
mFilterEditItem = new QComboBox( topFrame );
topLayout->addWidget(mFilterEditItem,ii++,0);
topLayout->addWidget( new QLabel ( i18n("Filter for other events"), topFrame ) , ii++,0);
mFilterAllItem = new QComboBox( topFrame );
topLayout->addWidget(mFilterAllItem,ii++,0);
dummy = addWidBool(i18n("Check Allday with Allday"),
&(KOPrefs::instance()->mCheckConflictsAllDayAllDay),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
dummy = addWidBool(i18n("Check Allday with NonAllday"),
&(KOPrefs::instance()->mCheckConflictsAllDayNonAD),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
dummy = addWidBool(i18n("Check NonAllday with Allday"),
&(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
dummy = addWidBool(i18n("Check NonAllday with NonAllday"),
&(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
topFrame = addPage(i18n("Alarm"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,2,1);
+ topLayout = new Q3GridLayout(topFrame,2,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
int iii = 0;
dummy =
addWidBool(i18n("Use internal alarm notification"),
&(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
topLayout->addWidget(dummy->checkBox(),iii++,0);
if ( QApplication::desktop()->height() > 240 ) {
lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
topLayout->addWidget(lab ,iii++,0);
}
#ifndef DESKTOP_VERSION
lab->setAlignment( AlignLeft|WordBreak|AlignTop);
#else
- lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
+ lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop);
lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
#endif
- QHBox* dummyBox = new QHBox(topFrame);
+ Q3HBox* dummyBox = new Q3HBox(topFrame);
new QLabel(i18n("Play beeps count:"),dummyBox);
mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
- dummyBox = new QHBox(topFrame);
+ dummyBox = new Q3HBox(topFrame);
new QLabel(i18n("Beeps interval in sec:"),dummyBox);
mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
- dummyBox = new QHBox(topFrame);
+ dummyBox = new Q3HBox(topFrame);
new QLabel(i18n("Default suspend time in min:"),dummyBox);
mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
- dummyBox = new QHBox(topFrame);
+ dummyBox = new Q3HBox(topFrame);
new QLabel(i18n("Auto suspend count:"),dummyBox);
mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
- QHBox* hbo = new QHBox ( topFrame );
+ Q3HBox* hbo = new Q3HBox ( topFrame );
mDefaultAlarmFile = new QLineEdit(hbo);
QPushButton * loadTemplate = new QPushButton(hbo);
QPixmap icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileimport16");
else
icon = SmallIcon("fileimport");
loadTemplate->setIconSet (icon ) ;
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
int size = loadTemplate->sizeHint().height();
loadTemplate->setFixedSize( size, size );
//lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
// topLayout->addWidget(lab ,iii++,0);
lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
topLayout->addWidget(lab ,iii++,0);
topLayout->addWidget(hbo,iii++,0);
// lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
// topLayout->addWidget(lab ,iii++,0);
// #ifndef DESKTOP_VERSION
// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
// #else
// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
// #endif
}
void KOPrefsDialog::selectSoundFile()
{
QString fileName = mDefaultAlarmFile->text();
fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
if ( fileName.length() > 0 )
mDefaultAlarmFile->setText( fileName );
}
void KOPrefsDialog::setupFontsTab()
{
- QFrame *topFrame = addPage(i18n("Fonts"),0,0);
+ Q3Frame *topFrame = addPage(i18n("Fonts"),0,0);
// DesktopIcon("fonts",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3);
topLayout->setSpacing(1);
topLayout->setMargin(3);
KPrefsDialogWidFont * tVFont;
int i = 0;
KPrefsDialogWidFont *timeLabelsFont =
addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
&(KOPrefs::instance()->mDateNavigatorFont),topFrame);
topLayout->addWidget(timeLabelsFont->label(),i,0);
topLayout->addWidget(timeLabelsFont->preview(),i,1);
topLayout->addWidget(timeLabelsFont->button(),i,2);
++i;
timeLabelsFont =
addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
&(KOPrefs::instance()->mTimeLabelsFont),topFrame);
topLayout->addWidget(timeLabelsFont->label(),i,0);
topLayout->addWidget(timeLabelsFont->preview(),i,1);
topLayout->addWidget(timeLabelsFont->button(),i,2);
++i;
KPrefsDialogWidFont *timeBarFont =
addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
&(KOPrefs::instance()->mTimeBarFont),topFrame);
@@ -1104,49 +1110,49 @@ void KOPrefsDialog::setupFontsTab()
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
tVFont =
addWidFont(i18n("Details"),i18n("EditorBox:"),
&(KOPrefs::instance()->mEditBoxFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
topLayout->setColStretch(1,1);
topLayout->setRowStretch(4,1);
i = 0;
topFrame = addPage(i18n("View Fonts"),0,
DesktopIcon("fonts",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,7,3);
+ topLayout = new Q3GridLayout(topFrame,7,3);
topLayout->setSpacing(1);
topLayout->setMargin(3);
tVFont =
addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
&(KOPrefs::instance()->mWhatsNextFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
KPrefsDialogWidFont *agendaViewFont =
addWidFont(i18n("Event text"),i18n("Agenda view:"),
&(KOPrefs::instance()->mAgendaViewFont),topFrame);
topLayout->addWidget(agendaViewFont->label(),i,0);
topLayout->addWidget(agendaViewFont->preview(),i,1);
topLayout->addWidget(agendaViewFont->button(),i,2);
++i;
KPrefsDialogWidFont *monthViewFont =
addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
topLayout->addWidget(monthViewFont->label(),i,0);
topLayout->addWidget(monthViewFont->preview(),i,1);
@@ -1172,106 +1178,106 @@ void KOPrefsDialog::setupFontsTab()
++i;
tVFont =
addWidFont(i18n("Today"),i18n("JournalView:"),
&(KOPrefs::instance()->mJornalViewFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
topLayout->setColStretch(1,1);
topLayout->setRowStretch(4,1);
}
void KOPrefsDialog::setupColorsTab()
{
- QFrame *topFrame = addPage(i18n("Colors"),0,0);
+ Q3Frame *topFrame = addPage(i18n("Colors"),0,0);
// DesktopIcon("colorize",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2);
// topLayout->setSpacing(mSpacingHint);
// topLayout->setMargin(mMarginHint);
topLayout->setSpacing(2);
topLayout->setMargin(3);
int ii = 1;
- QGroupBox *categoryGroup ;
+ Q3GroupBox *categoryGroup ;
- categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
+ categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"),
topFrame);
topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
mCategoryCombo = new QComboBox(categoryGroup);
mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
mCategoryButton = new KColorButton(categoryGroup);
connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
updateCategoryColor();
// Holiday Color
KPrefsDialogWidColor *holidayColor =
addWidColor(i18n("Holiday color:"),
&(KOPrefs::instance()->mHolidayColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
// Highlight Color
KPrefsDialogWidColor *highlightColor =
addWidColor(i18n("Highlight color:"),
&(KOPrefs::instance()->mHighlightColor),topFrame);
topLayout->addWidget(highlightColor->label(),ii,0);
topLayout->addWidget(highlightColor->button(),ii++,1);
// Event color
KPrefsDialogWidColor *eventColor =
addWidColor(i18n("Default event color:"),
&(KOPrefs::instance()->mEventColor),topFrame);
topLayout->addWidget(eventColor->label(),ii,0);
topLayout->addWidget(eventColor->button(),ii++,1);
eventColor =
addWidColor(i18n("Default todo done color:"),
&(KOPrefs::instance()->mTodoDoneColor),topFrame);
topLayout->addWidget(eventColor->label(),ii,0);
topLayout->addWidget(eventColor->button(),ii++,1);
if ( QApplication::desktop()->height() <= 240 ) {
topFrame = addPage(i18n("Colors") +" 2",0,0);
// DesktopIcon("colorize",KIcon::SizeMedium));
- topLayout = new QGridLayout(topFrame,5,2);
+ topLayout = new Q3GridLayout(topFrame,5,2);
// topLayout->setSpacing(mSpacingHint);
// topLayout->setMargin(mMarginHint);
topLayout->setSpacing(2);
topLayout->setMargin(3);
}
// agenda view background color
KPrefsDialogWidColor *agendaBgColor =
addWidColor(i18n("Agenda view background color:"),
&(KOPrefs::instance()->mAgendaBgColor),topFrame);
topLayout->addWidget(agendaBgColor->label(),ii,0);
topLayout->addWidget(agendaBgColor->button(),ii++,1);
// working hours color
KPrefsDialogWidColor *workingHoursColor =
addWidColor(i18n("Working hours color:"),
&(KOPrefs::instance()->mWorkingHoursColor),topFrame);
topLayout->addWidget(workingHoursColor->label(),ii,0);
topLayout->addWidget(workingHoursColor->button(),ii++,1);
KPrefsDialogWidBool *sb =
addWidBool(i18n("Use colors for application:"),
@@ -1296,113 +1302,113 @@ void KOPrefsDialog::setupColorsTab()
}
void KOPrefsDialog::setCategoryColor()
{
mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
}
void KOPrefsDialog::updateCategoryColor()
{
QString cat = mCategoryCombo->currentText();
QColor *color = mCategoryDict.find(cat);
if (!color) {
color = KOPrefs::instance()->categoryColor(cat);
}
if (color) {
mCategoryButton->setColor(*color);
}
}
void KOPrefsDialog::setupPrinterTab()
{
mPrinterTab = addPage(i18n("Printing"),0,
DesktopIcon("fileprint",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
+ Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
topLayout->setRowStretch(4,1);
}
void KOPrefsDialog::setupGroupSchedulingTab()
{
#if 0
- QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
+ Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0,
DesktopIcon("personal",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
#if 0
KPrefsDialogWidRadios *schedulerGroup =
addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
topFrame);
schedulerGroup->addRadio("Dummy"); // Only for debugging
schedulerGroup->addRadio(i18n("Mail client"));
topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
#endif
KPrefsDialogWidRadios *sendGroup =
addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
topFrame);
sendGroup->addRadio(i18n("Send to outbox"));
sendGroup->addRadio(i18n("Send directly"));
topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
- mAMails = new QListView(topFrame);
+ mAMails = new Q3ListView(topFrame);
mAMails->addColumn(i18n("Email"),300);
topLayout->addMultiCellWidget(mAMails,3,3,0,1);
topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
aEmailsEdit = new QLineEdit(topFrame);
aEmailsEdit->setEnabled(false);
topLayout->addWidget(aEmailsEdit,4,1);
QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
topLayout->addWidget(add,5,0);
QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
topLayout->addWidget(del,5,1);
//topLayout->setRowStretch(2,1);
connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
- connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
+ connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput()));
#endif
}
void KOPrefsDialog::setupGroupAutomationTab()
{
return;
- QFrame *topFrame = addPage(i18n("Group Automation"),0,
+ Q3Frame *topFrame = addPage(i18n("Group Automation"),0,
DesktopIcon("personal",KIcon::SizeMedium));
- QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
+ Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
KPrefsDialogWidRadios *autoRefreshGroup =
addWidRadios(i18n("Auto Send Refresh"),
&(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
autoRefreshGroup->addRadio(i18n("Never"));
autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
//autoRefreshGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
KPrefsDialogWidRadios *autoInsertGroup =
addWidRadios(i18n("Auto Insert IMIP Replies"),
&(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
autoInsertGroup->addRadio(i18n("Never"));
autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
//autoInsertGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
KPrefsDialogWidRadios *autoRequestGroup =
addWidRadios(i18n("Auto Insert IMIP Requests"),
&(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
autoRequestGroup->addRadio(i18n("Never"));
autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
@@ -1494,49 +1500,49 @@ void KOPrefsDialog::usrReadConfig()
if ( index >= 0 )
mFilterAllItem->setCurrentItem( index );
}
void KOPrefsDialog::usrWriteConfig()
{
KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
KOPrefs::instance()->setFullName(mNameEdit->text());
KOPrefs::instance()->setEmail(mEmailEdit->text());
KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) {
QStringList cat = KOPrefs::instance()->mCustomCategories;
int iii = 0;
while ( iii < cat.count() ) {
if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor )
KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor );
++iii;
}
}
- QDictIterator<QColor> it(mCategoryDict);
+ Q3DictIterator<QColor> it(mCategoryDict);
while (it.current()) {
KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
++it;
}
KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
KOPrefs::instance()->mAdditionalMails.clear();
// QListViewItem *item;
// item = mAMails->firstChild();
// while (item)
// {
// KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
// item = item->nextSibling();
// }
KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
KOPrefs::instance()->mFilterConflictEditItem = mFilterEditItem->currentText();
KOPrefs::instance()->mFilterConflictAllItem = mFilterAllItem->currentText();
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index ee7a7aa..ccc1726 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -2,52 +2,54 @@
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KOPREFSDIALOG_H
#define _KOPREFSDIALOG_H
-#include <qframe.h>
-#include <qdict.h>
+#include <q3frame.h>
+#include <q3dict.h>
#include <qcolor.h>
-#include <qlistview.h>
+#include <q3listview.h>
+//Added by qt3to4:
+#include <QLabel>
#include <kdialogbase.h>
#include <libkdepim/kprefsdialog.h>
#include <libkdepim/kdateedit.h>
#include <kcmconfigs/kdepimconfigwidget.h>
class KColorButton;
class QSpinBox;
class QSlider;
class KURLRequester;
class QComboBox;
class QLineEdit;
class QStringList;
/** Dialog to change the korganizer configuration.
*/
class KOPrefsDialog : public KPrefsDialog
{
Q_OBJECT
public:
/** Initialize dialog and pages */
KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
~KOPrefsDialog();
@@ -73,76 +75,76 @@ class KOPrefsDialog : public KPrefsDialog
void usrReadConfig();
void usrWriteConfig();
void setupGlobalTab();
void setupMainTab();
void setupTimeTab();
void setupLocaleTab();
void setupLocaleDateTab();
void setupFontsTab();
void setupColorsTab();
void setupViewsTab();
void setupDisplayTab();
void setupPrinterTab();
void setupGroupSchedulingTab();
void setupGroupAutomationTab();
void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
private:
QColor mCatDefaultColor;
KPrefsDialogWidBool *mEnableGroupScheduling;
KPrefsDialogWidBool *mEnableProjectView;
- QFrame *mPrinterTab;
+ Q3Frame *mPrinterTab;
QLineEdit *nameEdit;
QLineEdit *emailEdit;
QComboBox *timeCombo;
QComboBox *tzCombo;
// widgets holding preferences data
QLineEdit *mNameEdit;
QLineEdit *mEmailEdit;
QLabel *mNameLabel;
QLabel *mEmailLabel;
QLineEdit *mAdditionalEdit;
QSpinBox *mAutoSaveIntervalSpin;
QSpinBox *mPrioSpin;
// QListView *mAMails;
QLineEdit *aEmailsEdit;
QComboBox *mTimeZoneCombo;
QStringList tzonenames;
QSpinBox *mStartTimeSpin;
QSpinBox *mDefaultDurationSpin;
QComboBox *mAlarmTimeCombo;
QComboBox *mCategoryCombo;
KColorButton *mCategoryButton;
- QDict<QColor> mCategoryDict;
+ Q3Dict<QColor> mCategoryDict;
QSlider *mHourSizeSlider;
QSpinBox *mNextXDaysSpin;
QSpinBox *mWhatsNextSpin;
QLineEdit * mRemoteIPEdit;
QLineEdit * mRemoteUser;
QLineEdit * mRemotePassWd;
QLineEdit * mRemoteFile;
QLineEdit * mLocalTempFile;
QWidget* mSetupSyncAlgTab;
QLineEdit * mUserDateFormatLong;
QLineEdit * mUserDateFormatShort;
QSpinBox *mTimezoneOffsetSpin;
QSpinBox *mDaylightsavingStart;
QSpinBox *mDaylightsavingEnd;
KDateEdit* mStartDateSavingEdit;
KDateEdit* mEndDateSavingEdit;
QSpinBox * mAlarmPlayBeeps;
QSpinBox * mAlarmSuspendTime;
QSpinBox * mAlarmSuspendCount;
QSpinBox * mAlarmBeepInterval;
diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro
index df8f8d7..0f3b328 100644
--- a/korganizer/korganizer.pro
+++ b/korganizer/korganizer.pro
@@ -1,112 +1,113 @@
TEMPLATE = app
-CONFIG = qt warn_on
+CONFIG += qt warn_on
TARGET = kopi
OBJECTS_DIR = _obj/
MOC_DIR = _moc
DESTDIR= ../bin
include( ../variables.pri )
INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim
#../qtcompat
DEFINES += KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL
DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
#KORG_NOPRINTER KORG_NOKABC KORG_NODND
DEFINES += KORG_NOLVALTERNATION
DEFINES += DESKTOP_VERSION
unix : {
staticlib: {
TARGET = kopi_linux
-LIBS += ../bin/libmicrokabc_qtopia.a
-LIBS += ../bin/libmicrokabc_file.a
-LIBS += ../bin/libmicrokabc_dir.a
-LIBS += ../bin/libmicrokdepim.a
-LIBS += ../bin/libmicrokcal.a
-LIBS += ../bin/libmicrokabc.a
-LIBS += ../bin/libmicrokde.a
-LIBS += ../bin/libmicrokabc_qtopia.a
-LIBS += ../bin/libmicrokabc_file.a
-LIBS += ../bin/libmicrokabc_dir.a
-LIBS += ../bin/libmicrokdepim.a
-LIBS += ../bin/libmicrokcal.a
-LIBS += ../bin/libmicrokabc.a
-LIBS += ../bin/libmicrokde.a
+LIBS += ../bin/libxmicrokabc_qtopia.a
+LIBS += ../bin/libxmicrokabc_file.a
+LIBS += ../bin/libxmicrokabc_dir.a
+LIBS += ../bin/libxmicrokdepim.a
+LIBS += ../bin/libxmicrokcal.a
+LIBS += ../bin/libxmicrokabc.a
+LIBS += ../bin/libxmicrokde.a
+LIBS += ../bin/libxmicrokabc_qtopia.a
+LIBS += ../bin/libxmicrokabc_file.a
+LIBS += ../bin/libxmicrokabc_dir.a
+LIBS += ../bin/libxmicrokdepim.a
+LIBS += ../bin/libxmicrokcal.a
+LIBS += ../bin/libxmicrokabc.a
+LIBS += ../bin/libxmicrokde.a
LIBS += ../libical/lib/libical.a
LIBS += ../libical/lib/libicalss.a
} else {
-LIBS += ../bin/libmicrokdepim.so
-LIBS += ../bin/libmicrokcal.so
-LIBS += ../bin/libmicrokde.so
-LIBS += ../bin/libmicrokabc.so
+LIBS += ../bin/libxmicrokdepim.so
+LIBS += ../bin/libxmicrokcal.so
+LIBS += ../bin/libxmicrokde.so
+LIBS += ../bin/libxmicrokabc.so
#LIBS += -lbluetooth
#LIBS += -lsdp
#LIBS += -lldap
}
OBJECTS_DIR = obj/unix
MOC_DIR = moc/unix
}
win32: {
RC_FILE = winicons.rc
DEFINES += _WIN32_
-LIBS += ../bin/microkdepim.lib
-LIBS += ../bin/microkcal.lib
-LIBS += ../bin/microkde.lib
-LIBS += ../bin/microkabc.lib
+LIBS += ../bin/xmicrokdepim.lib
+LIBS += ../bin/xmicrokcal.lib
+LIBS += ../bin/xmicrokde.lib
+LIBS += ../bin/xmicrokabc.lib
LIBS += ../libical/lib/ical.lib
LIBS += ../libical/lib/icalss.lib
#LIBS += atls.lib
QMAKE_LINK += /NODEFAULTLIB:LIBC
OBJECTS_DIR = obj/win
MOC_DIR = moc/win
#olimport section
importol: {
debug: {
LIBS += mfc71ud.lib
QMAKE_LINK += /NODEFAULTLIB:MSVCRT
QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
}
release: {
LIBS += mfc71u.lib
}
DEFINES += _OL_IMPORT_
HEADERS += ../outport/msoutl9.h \
koimportoldialog.h
SOURCES += ../outport/msoutl9.cpp \
koimportoldialog.cpp
#olimport section end
TARGET = kopi_xp
} else {
TARGET = kopi_me
}
}
-INTERFACES = kofilterview_base.ui
+#The following line was changed from INTERFACES to FORMS3 by qt3to4
+FORMS3 = kofilterview_base.ui
#filteredit_base.ui
# kdateedit.h \
HEADERS += datenavigatorcontainer.h \
filteredit_base.h \
alarmclient.h \
calendarview.h \
customlistviewitem.h \
datenavigator.h \
docprefs.h \
filtereditdialog.h \
incomingdialog.h \
incomingdialog_base.h \
interfaces/korganizer/baseview.h \
interfaces/korganizer/calendarviewbase.h \
journalentry.h \
kdatenavigator.h \
koagenda.h \
koagendaitem.h \
koagendaview.h \
kocounterdialog.h \
kodaymatrix.h \
kodialogmanager.h \
@@ -189,30 +190,36 @@ filteredit_base.cpp \
koprefsdialog.cpp \
kotimespanview.cpp \
kotodoeditor.cpp \
kotodoview.cpp \
kotodoviewitem.cpp \
koviewmanager.cpp \
kowhatsnextview.cpp \
ktimeedit.cpp \
lineview.cpp \
main.cpp \
mainwindow.cpp \
navigatorbar.cpp \
outgoingdialog.cpp \
outgoingdialog_base.cpp \
publishdialog.cpp \
publishdialog_base.cpp \
savetemplatedialog.cpp \
searchdialog.cpp \
statusdialog.cpp \
timeline.cpp \
timespanview.cpp \
../kalarmd/alarmdialog.cpp
HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h
-INTERFACES += calprintdayconfig_base.ui \
+#The following line was changed from INTERFACES to FORMS3 by qt3to4
+FORMS3 += calprintdayconfig_base.ui \
calprintmonthconfig_base.ui \
calprinttodoconfig_base.ui \
calprintweekconfig_base.ui
SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp
+#The following line was inserted by qt3to4
+QT += xml qt3support
+#The following line was inserted by qt3to4
+CONFIG += uic3
+
diff --git a/korganizer/korganizerE.pro b/korganizer/korganizerE.pro
index 553c265..2c1cd42 100644
--- a/korganizer/korganizerE.pro
+++ b/korganizer/korganizerE.pro
@@ -1,40 +1,40 @@
TEMPLATE = app
CONFIG += qt warn_on
TARGET = kopi
OBJECTS_DIR = obj/$(PLATFORM)
MOC_DIR = moc/$(PLATFORM)
DESTDIR=$(QPEDIR)/bin
INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/libkdepim interfaces $(KDEPIMDIR)/kabc $(QPEDIR)/include
DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL
DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
DEFINES += KORG_NOLVALTERNATION
#KORG_NOKABC
-LIBS += -lmicrokdepim
-LIBS += -lmicrokcal
-LIBS += -lmicrokde
+LIBS += -lxmicrokdepim
+LIBS += -lxmicrokcal
+LIBS += -lxmicrokde
LIBS += -lmicroqtcompat
LIBS += $(GCC3EXTRALIB1)
LIBS += $(GCC3EXTRALIB2)
LIBS += -lqpe
LIBS += -ljpeg
LIBS += $(QTOPIALIB)
LIBS += -L$(QPEDIR)/lib
INTERFACES = kofilterview_base.ui
#filteredit_base.ui
HEADERS = datenavigatorcontainer.h \
wordsgerman.h \
filteredit_base.h \
alarmclient.h \
calendarview.h \
customlistviewitem.h \
datenavigator.h \
docprefs.h \
filtereditdialog.h \
incomingdialog.h \
diff --git a/korganizer/kotimespanview.cpp b/korganizer/kotimespanview.cpp
index 3265a3a..a214720 100644
--- a/korganizer/kotimespanview.cpp
+++ b/korganizer/kotimespanview.cpp
@@ -1,109 +1,113 @@
#include <qlayout.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3ValueList>
+#include <Q3PtrList>
#include <kconfig.h>
#include "timespanview.h"
#include "koglobals.h"
#include "kotimespanview.h"
KOTimeSpanView::KOTimeSpanView(Calendar *calendar, QWidget *parent,
const char *name) :
KOEventView( calendar, parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
mTimeSpanView = new TimeSpanView( this );
topLayout->addWidget( mTimeSpanView );
connect( mTimeSpanView, SIGNAL( dateRangeChanged() ), SLOT( updateView() ) );
}
KOTimeSpanView::~KOTimeSpanView()
{
}
void KOTimeSpanView::readSettings()
{
readSettings(KOGlobals::config());
}
void KOTimeSpanView::readSettings(KConfig *config)
{
// kdDebug() << "KOTimeSpanView::readSettings()" << endl;
config->setGroup("Views");
- QValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView");
+ Q3ValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView");
if (sizes.count() == 2) {
mTimeSpanView->setSplitterSizes(sizes);
}
}
void KOTimeSpanView::writeSettings(KConfig *config)
{
// kdDebug() << "KOTimeSpanView::writeSettings()" << endl;
config->setGroup("Views");
- QValueList<int> list = mTimeSpanView->splitterSizes();
+ Q3ValueList<int> list = mTimeSpanView->splitterSizes();
config->writeEntry("Separator TimeSpanView",list);
}
int KOTimeSpanView::maxDatesHint()
{
return 0;
}
int KOTimeSpanView::currentDateCount()
{
return 0;
}
-QPtrList<Incidence> KOTimeSpanView::selectedIncidences()
+Q3PtrList<Incidence> KOTimeSpanView::selectedIncidences()
{
- QPtrList<Incidence> selected;
+ Q3PtrList<Incidence> selected;
return selected;
}
void KOTimeSpanView::updateView()
{
insertItems( mTimeSpanView->startDateTime().date(),
mTimeSpanView->endDateTime().date() );
}
void KOTimeSpanView::showDates(const QDate &start, const QDate &end)
{
QDate s = start.addDays( -2 );
QDate e = end.addDays( 2 );
insertItems( s, e );
}
void KOTimeSpanView::insertItems(const QDate &start, const QDate &end)
{
mTimeSpanView->clear();
- mTimeSpanView->setDateRange( start, end );
+ mTimeSpanView->setDateRange( (QDateTime)start, (QDateTime)end );
- QPtrList<Event> events = calendar()->events( start, end );
+ Q3PtrList<Event> events = calendar()->events( start, end );
Event *event = events.first();
while( event ) {
// kdDebug() << "KOTimeSpanView::showDates() add event: " << event->summary()
// << endl;
mTimeSpanView->addItem( event );
event = events.next();
}
mTimeSpanView->updateView();
}
-void KOTimeSpanView::showEvents(QPtrList<Event> eventList)
+void KOTimeSpanView::showEvents(Q3PtrList<Event> eventList)
{
}
void KOTimeSpanView::changeEventDisplay(Event *, int)
{
}
diff --git a/korganizer/kotimespanview.h b/korganizer/kotimespanview.h
index c682ed8..c3e4b41 100644
--- a/korganizer/kotimespanview.h
+++ b/korganizer/kotimespanview.h
@@ -1,41 +1,43 @@
#ifndef KOTIMESPANVIEW_H
#define KOTIMESPANVIEW_H
#include "koeventview.h"
+//Added by qt3to4:
+#include <Q3PtrList>
class KConfig;
class TimeSpanView;
class KOTimeSpanView : public KOEventView
{
Q_OBJECT
public:
KOTimeSpanView(Calendar *calendar, QWidget *parent = 0,
const char *name = 0);
~KOTimeSpanView();
virtual int maxDatesHint();
virtual int currentDateCount();
- virtual QPtrList<Incidence> selectedIncidences();
+ virtual Q3PtrList<Incidence> selectedIncidences();
DateList selectedDates()
{DateList q;
return q;}
void readSettings();
void readSettings( KConfig * );
void writeSettings( KConfig * );
public slots:
virtual void updateView();
virtual void showDates(const QDate &start, const QDate &end);
- virtual void showEvents(QPtrList<Event> eventList);
+ virtual void showEvents(Q3PtrList<Event> eventList);
void changeEventDisplay(Event *, int);
private:
void insertItems( const QDate &start, const QDate & end );
TimeSpanView *mTimeSpanView;
};
#endif
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 20a35d2..aeab92a 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -2,57 +2,62 @@
This file is part of KOrganizer.
Copyright (c) 1997, 1998 Preston Brown
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qpixmap.h>
#include <qlayout.h>
-#include <qhbox.h>
+#include <q3hbox.h>
#include <qtimer.h>
#include <qdir.h>
#include <qdatetime.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include <qtabwidget.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3PtrList>
+#include <Q3VBoxLayout>
#include <kiconloader.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <libkcal/icalformat.h>
#include <kresources/resourceselectdialog.h>
#include <libkdepim/kdateedit.h>
#include "koprefs.h"
#include "kolocationbox.h"
#include "kotodoeditor.h"
extern int globalFlagBlockAgenda;
KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) :
KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent )
{
@@ -60,164 +65,164 @@ KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) :
mRelatedTodo = 0;
findButton(User1)->hide();
init();
if ( QApplication::desktop()->height() <= 240 )
hideButtons();
}
KOTodoEditor::~KOTodoEditor()
{
emit dialogClose( mTodo );
}
void KOTodoEditor::init()
{
setupGeneral();
setupAttendeesTab();
setupRecurrence();
connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence()));
mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") );
connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime)));
}
void KOTodoEditor::setupRecurrence()
{
- QFrame *topFrame = addPage( i18n("Recurrence") );
- QBoxLayout *topLayout = new QVBoxLayout( topFrame );
+ Q3Frame *topFrame = addPage( i18n("Recurrence") );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
mRecurrence = new KOEditorRecurrence( topFrame );
topLayout->addWidget( mRecurrence );
}
void KOTodoEditor::setCategories( QString s )
{
mGeneral->setCategories(s);
}
void KOTodoEditor::setSecrecy( int sec )
{
mGeneral->setSecrecy( sec );
}
void KOTodoEditor::reload()
{
if ( mTodo ) readTodo( mTodo );
}
void KOTodoEditor::setupGeneral()
{
mGeneral = new KOEditorGeneralTodo(this);
connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
// connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
//connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)),
// mGeneral,SLOT(setCategories(const QString &)));
if (KOPrefs::instance()->mCompactDialogs) {
- QFrame *topFrame = addPage(i18n("General"));
+ Q3Frame *topFrame = addPage(i18n("General"));
- QBoxLayout *topLayout = new QVBoxLayout(topFrame);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
if ( QApplication::desktop()->width() < 480 ) {
topLayout->setMargin(marginHintSmall());
topLayout->setSpacing(spacingHintSmall());
} else {
topLayout->setMargin(marginHint());
topLayout->setSpacing(spacingHint());
}
topLayout->addStretch( 1 );
mGeneral->initHeader(topFrame,topLayout);
topLayout->addStretch( 1 );
mGeneral->initTime(topFrame,topLayout);
topLayout->addStretch( 1 );
mGeneral->initAlarm(topFrame,topLayout);
topLayout->addStretch( 1 );
mGeneral->enableAlarm( false );
- QBoxLayout *priorityLayout;
+ Q3BoxLayout *priorityLayout;
if ( QApplication::desktop()->width() < 500 )
- priorityLayout = new QVBoxLayout( topLayout );
+ priorityLayout = new Q3VBoxLayout( topLayout );
else
- priorityLayout = new QHBoxLayout( topLayout );
+ priorityLayout = new Q3HBoxLayout( topLayout );
QWidget* prioWidget = new QWidget (topFrame);
priorityLayout->addWidget( prioWidget );
- QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget);
+ Q3HBoxLayout* priorityLayout2 = new Q3HBoxLayout( prioWidget);
- QIconSet icon;
+ QIcon icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileimport16");
else
icon = SmallIcon("fileimport");
QPushButton * loadTemplate = new QPushButton( prioWidget);
loadTemplate->setIconSet (icon ) ;
int size = loadTemplate->sizeHint().height();
loadTemplate->setFixedSize( size, size );
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileexport16");
else
icon = SmallIcon("fileexport");
QPushButton * saveTemplate = new QPushButton( prioWidget);
saveTemplate->setIconSet (icon ) ;
saveTemplate->setFixedSize( size, size );
priorityLayout2->addWidget(loadTemplate);
priorityLayout2->addWidget(saveTemplate);
mGeneral->initPriority(prioWidget,priorityLayout2);
mGeneral->initCategories( topFrame, priorityLayout );
topLayout->addStretch(1);
- QFrame *topFrame2 = addPage(i18n("Details"));
+ Q3Frame *topFrame2 = addPage(i18n("Details"));
- QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
+ Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2);
topLayout2->setMargin(marginHint());
topLayout2->setSpacing(spacingHint());
- QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 );
+ Q3HBoxLayout *completionLayout = new Q3HBoxLayout( topLayout2 );
mGeneral->initCompletion(topFrame2,completionLayout);
mGeneral->initSecrecy( topFrame2, topLayout2 );
mGeneral->initDescription(topFrame2,topLayout2);
// QHBox * hb = new QHBox ( topFrame2 );
// topLayout2->addWidget(hb);
// hb->setSpacing( 3 );
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
} else {
- QFrame *topFrame = addPage(i18n("General"));
+ Q3Frame *topFrame = addPage(i18n("General"));
- QBoxLayout *topLayout = new QVBoxLayout(topFrame);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
topLayout->setSpacing(spacingHint());
mGeneral->initHeader(topFrame,topLayout);
mGeneral->initTime(topFrame,topLayout);
mGeneral->initStatus(topFrame,topLayout);
- QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout);
mGeneral->initAlarm(topFrame,alarmLineLayout);
mGeneral->initDescription(topFrame,topLayout);
- QBoxLayout *detailsLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout);
mGeneral->initCategories( topFrame, detailsLayout );
mGeneral->initSecrecy( topFrame, detailsLayout );
}
mGeneral->finishSetup();
}
void KOTodoEditor::editTodo(Todo *todo, bool editDescription)
{
//init();
mTodo = todo;
readTodo(mTodo);
if ( editDescription ) {
showPage( 1 );
mGeneral->setFocusOn( 1 );
} else {
showPage( 0 );
mGeneral->setFocusOn( 2 );
}
checkRecurrence();
}
void KOTodoEditor::newTodo(QDateTime due,Todo *relatedTodo,bool allDay)
@@ -406,49 +411,49 @@ void KOTodoEditor::modified (int modification)
KOGlobals::UNKNOWN_MODIFIED == modification )
// mCategoryDialog->setSelected (mTodo->categories ());
mGeneral->modified (mTodo, modification);
}
void KOTodoEditor::slotLoadTemplate()
{
QString fileName =locateLocal( "templates", "todos" );
QDir t_dir;
if ( !t_dir.exists(fileName) )
t_dir.mkdir ( fileName );
fileName += "/todo";
fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this );
if ( fileName.length() == 0 )
return;
CalendarLocal cal;
ICalFormat format;
if ( !format.load( &cal, fileName ) ) {
KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
.arg( fileName ) );
return ;
}
- QPtrList<Todo> todos = cal.todos();
+ Q3PtrList<Todo> todos = cal.todos();
Todo * todo = todos.first();
if ( !todo ) {
KMessageBox::error( this,
i18n("Template does not\ncontain a valid Todo."));
} else {
readTodo( todo );
}
}
void KOTodoEditor::slotSaveTemplate()
{
QString fileName =locateLocal( "templates", "todos" );
QDir t_dir;
if ( !t_dir.exists(fileName) )
t_dir.mkdir ( fileName );
fileName += "/todo";
fileName = KFileDialog::getSaveFileName( fileName , "Save as Todo template", this );
if ( fileName.length() > 0 )
saveTemplate( fileName );
}
void KOTodoEditor::saveTemplate( const QString &templateName )
{
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index ba94057..2b8fbd3 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -1,138 +1,154 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
+#include <QDesktopWidget>
+
#include <qlayout.h>
-#include <qheader.h>
+#include <q3header.h>
#include <qcursor.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
#include <qdialog.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qinputdialog.h>
-#include <qvbox.h>
+#include <q3vbox.h>
+//Added by qt3to4:
+#include <QWheelEvent>
+#include <QFocusEvent>
+#include <QDragLeaveEvent>
+#include <QMouseEvent>
+#include <QDragEnterEvent>
+#include <QKeyEvent>
+#include <Q3HBoxLayout>
+#include <Q3VBoxLayout>
+#include <QDropEvent>
+#include <QDragMoveEvent>
+#include <QPaintEvent>
+#include <Q3PopupMenu>
+#include <Q3PtrList>
#include <kdebug.h>
#include "koprefs.h"
#include <klocale.h>
#include <kglobal.h>
#include <kdateedit.h>
#include "ktimeedit.h"
#include <kiconloader.h>
#include <kmessagebox.h>
#include <libkcal/icaldrag.h>
#include <libkcal/vcaldrag.h>
#include <libkcal/calfilter.h>
#include <libkcal/dndfactory.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#include <libkcal/kincidenceformatter.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "docprefs.h"
#include "kotodoview.h"
using namespace KOrg;
KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) :
QDialog( parent, name, true )
{
mStopAll = true;
setCaption( i18n("Start todo") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this );
lay->addWidget( lab );
- lab->setAlignment( AlignCenter );
+ lab->setAlignment( Qt::AlignCenter );
QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this );
lay->addWidget( ok );
ok->setDefault( true );
QPushButton * start = new QPushButton( i18n("Start todo"), this );
lay->addWidget( start );
QPushButton * cancel = new QPushButton( i18n("Cancel - do not start"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect ( start,SIGNAL(clicked() ),this , SLOT ( doStop() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
resize( sizeHint() );
}
void KOStartTodoPrefs::doStop()
{
mStopAll = false;
accept();
}
KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) :
QDialog( parent, name, true )
{
mTodo = todo;
setCaption( i18n("Stop todo") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this );
lay->addWidget( lab );
- lab->setAlignment( AlignHCenter );
+ lab->setAlignment( Qt::AlignHCenter );
lab = new QLabel( i18n("Additional Comment:"), this );
lay->addWidget( lab );
mComment = new QLineEdit( this );
lay->addWidget( mComment );
- QHBox * start = new QHBox ( this );
+ Q3HBox * start = new Q3HBox ( this );
lay->addWidget( start );
lab = new QLabel( i18n("Start:"), start );
- QHBox * end = new QHBox ( this );
+ Q3HBox * end = new Q3HBox ( this );
lay->addWidget( end );
lab = new QLabel( i18n("End:"), end );
sde = new KDateEdit( start );
ste = new KOTimeEdit( start );
connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) );
ede = new KDateEdit( end );
ete = new KOTimeEdit(end );
connect ( ede,SIGNAL(setTimeTo( QTime ) ),ete , SLOT ( setTime(QTime ) ) );
sde->setDate( mTodo->runStart().date() );
ste->setTime( mTodo->runStart().time() );
mStop = QDateTime::currentDateTime();
ede->setDate( mStop.date());
ete->setTime( mStop.time() );
QPushButton * ok = new QPushButton( i18n("Stop and save"), this );
lay->addWidget( ok );
ok->setDefault( true );
QPushButton * cancel = new QPushButton( i18n("Continue running"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
ok = new QPushButton( i18n("Stop - do not save"), this );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) );
lay->addWidget( ok );
if (QApplication::desktop()->width() < 320 )
@@ -152,653 +168,653 @@ void KOStopTodoPrefs::accept()
i18n("Time mismatch!"));
return;
}
// restoring the seconds
if ( start == QDateTime( mTodo->runStart().date(),
QTime(mTodo->runStart().time().hour() , mTodo->runStart().time().minute() ) ) )
start = mTodo->runStart();
if ( stop == QDateTime( mStop.date(),
QTime( mStop.time().hour() , mStop.time().minute() ) ) )
stop = mStop;
mTodo->saveRunningInfo( mComment->text(), start, stop );
QDialog::accept();
}
void KOStopTodoPrefs::doNotSave()
{
int result = KMessageBox::warningContinueCancel(this,
i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") );
if (result != KMessageBox::Continue) return;
mTodo->stopRunning();
QDialog::accept();
}
-class KOTodoViewWhatsThis :public QWhatsThis
+class KOTodoViewWhatsThis :public Q3WhatsThis
{
public:
- KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
+ KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { };
protected:
virtual QString text( const QPoint& p)
{
return _view->getWhatsThisText(p) ;
}
private:
QWidget* _wid;
KOTodoView * _view;
};
KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent,
const char *name) :
KListView(parent,name)
{
mName = QString ( name );
mCalendar = calendar;
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
#endif
mOldCurrent = 0;
mMousePressed = false;
setAcceptDrops(true);
viewport()->setAcceptDrops(true);
int size = 16;
if (qApp->desktop()->width() < 300 )
size = 12;
setTreeStepSize( size + 6 );
}
void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e)
{
#ifndef KORG_NODND
// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl;
if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
- !QTextDrag::canDecode( e ) ) {
+ !Q3TextDrag::canDecode( e ) ) {
e->ignore();
return;
}
mOldCurrent = currentItem();
#endif
}
void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e)
{
#ifndef KORG_NODND
// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl;
if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
- !QTextDrag::canDecode( e ) ) {
+ !Q3TextDrag::canDecode( e ) ) {
e->ignore();
return;
}
e->accept();
#endif
}
void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *)
{
#ifndef KORG_NODND
// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl;
setCurrentItem(mOldCurrent);
setSelected(mOldCurrent,true);
#endif
}
void KOTodoListView::contentsDropEvent(QDropEvent *e)
{
#ifndef KORG_NODND
// kdDebug() << "KOTodoListView::contentsDropEvent" << endl;
if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
- !QTextDrag::canDecode( e ) ) {
+ !Q3TextDrag::canDecode( e ) ) {
e->ignore();
return;
}
DndFactory factory( mCalendar );
Todo *todo = factory.createDropTodo(e);
if (todo) {
e->acceptAction();
KOTodoViewItem *destination =
(KOTodoViewItem *)itemAt(contentsToViewport(e->pos()));
Todo *destinationEvent = 0;
if (destination) destinationEvent = destination->todo();
Todo *existingTodo = mCalendar->todo(todo->uid());
if(existingTodo) {
Incidence *to = destinationEvent;
while(to) {
if (to->uid() == todo->uid()) {
KMessageBox::sorry(this,
i18n("Cannot move Todo to itself\nor a child of itself"),
i18n("Drop Todo"));
delete todo;
return;
}
to = to->relatedTo();
}
internalDrop = true;
if ( destinationEvent )
reparentTodoSignal( destinationEvent, existingTodo );
else
unparentTodoSignal(existingTodo);
delete todo;
} else {
mCalendar->addTodo(todo);
emit todoDropped(todo, KOGlobals::EVENTADDED);
if ( destinationEvent )
reparentTodoSignal( destinationEvent, todo );
}
}
else {
QString text;
- if (QTextDrag::decode(e,text)) {
+ if (Q3TextDrag::decode(e,text)) {
//QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) );
KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) ));
qDebug("Dropped : " + text);
QStringList emails = QStringList::split(",",text);
for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
int pos = (*it).find("<");
QString name = (*it).left(pos);
QString email = (*it).mid(pos);
if (!email.isEmpty() && todoi) {
todoi->todo()->addAttendee(new Attendee(name,email));
}
}
}
else {
qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable ");
e->ignore();
}
}
#endif
}
void KOTodoListView::wheelEvent (QWheelEvent *e)
{
- QListView::wheelEvent (e);
+ Q3ListView::wheelEvent (e);
}
void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
{
QPoint p(contentsToViewport(e->pos()));
- QListViewItem *i = itemAt(p);
+ Q3ListViewItem *i = itemAt(p);
bool rootClicked = true;
if (i) {
// if the user clicked into the root decoration of the item, don't
// try to start a drag!
int X = p.x();
//qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
if (X > header()->sectionPos(0) +
treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
itemMargin() +i->height()||
X < header()->sectionPos(0)) {
rootClicked = false;
}
} else {
rootClicked = false;
}
#ifndef KORG_NODND
mMousePressed = false;
- if (! rootClicked && !( e->button() == RightButton) ) {
+ if (! rootClicked && !( e->button() == Qt::RightButton) ) {
mPressPos = e->pos();
mMousePressed = true;
} else {
mMousePressed = false;
}
#endif
//qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked);
#ifndef DESKTOP_VERSION
if (!( e->button() == RightButton && rootClicked) )
- QListView::contentsMousePressEvent(e);
+ Q3ListView::contentsMousePressEvent(e);
#else
- QListView::contentsMousePressEvent(e);
+ Q3ListView::contentsMousePressEvent(e);
#endif
}
void KOTodoListView::paintEvent(QPaintEvent* e)
{
emit paintNeeded();
- QListView::paintEvent( e);
+ Q3ListView::paintEvent( e);
}
void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
{
#ifndef KORG_NODND
//QListView::contentsMouseMoveEvent(e);
if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
QApplication::startDragDistance()*3) {
mMousePressed = false;
- QListViewItem *item = itemAt(contentsToViewport(mPressPos));
+ Q3ListViewItem *item = itemAt(contentsToViewport(mPressPos));
if (item) {
DndFactory factory( mCalendar );
ICalDrag *vd = factory.createDrag(
((KOTodoViewItem *)item)->todo(),viewport());
internalDrop = false;
// we cannot do any senseful here, because the DnD is still broken in Qt
if (vd->drag()) {
if ( !internalDrop ) {
//emit deleteTodo( ((KOTodoViewItem *)item)->todo() );
qDebug("Dnd: External move: Delete drag source ");
} else
qDebug("Dnd: Internal move ");
} else {
if ( !internalDrop ) {
qDebug("Dnd: External Copy");
} else
qDebug("DnD: Internal copy: Copy pending");
}
}
}
#endif
}
void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
{
if ( !e->isAutoRepeat() ) {
mFlagKeyPressed = false;
}
}
void KOTodoListView::keyPressEvent ( QKeyEvent * e )
{
qApp->processEvents();
if ( !isVisible() ) {
e->ignore();
return;
}
if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
e->ignore();
// qDebug(" ignore %d",e->isAutoRepeat() );
return;
}
if (! e->isAutoRepeat() )
mFlagKeyPressed = true;
- QListViewItem* cn;
+ Q3ListViewItem* cn;
if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") {
cn = currentItem();
if ( cn ) {
KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
if ( ci ){
- if ( e->state() == ShiftButton )
+ if ( e->state() == Qt::ShiftButton )
ci->setOn( false );
else
ci->setOn( true );
cn = cn->itemBelow();
if ( cn ) {
setCurrentItem ( cn );
ensureItemVisible ( cn );
}
}
}
e->accept();
return;
}
if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
switch ( e->key() ) {
case Qt::Key_Down:
case Qt::Key_Up:
- QListView::keyPressEvent ( e );
+ Q3ListView::keyPressEvent ( e );
e->accept();
break;
case Qt::Key_Left:
case Qt::Key_Right:
- QListView::keyPressEvent ( e );
+ Q3ListView::keyPressEvent ( e );
e->accept();
return;
break;
default:
e->ignore();
break;
}
return;
}
e->ignore();
}
void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
- QListView::contentsMouseReleaseEvent(e);
+ Q3ListView::contentsMouseReleaseEvent(e);
mMousePressed = false;
}
void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
if (!e) return;
QPoint vp = contentsToViewport(e->pos());
- QListViewItem *item = itemAt(vp);
+ Q3ListViewItem *item = itemAt(vp);
emit double_Clicked(item);
if (!item) return;
emit doubleClicked(item,vp,0);
}
/////////////////////////////////////////////////////////////////////////////
KOQuickTodo::KOQuickTodo(QWidget *parent) :
QLineEdit(parent)
{
setText(i18n("Click to add new Todo"));
- setFocusPolicy ( QWidget::ClickFocus );
+ setFocusPolicy ( Qt::ClickFocus );
}
void KOQuickTodo::focusInEvent(QFocusEvent *ev)
{
if ( text()==i18n("Click to add new Todo") )
setText("");
QLineEdit::focusInEvent(ev);
}
void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
{
setText(i18n("Click to add new Todo"));
QLineEdit::focusOutEvent(ev);
}
/////////////////////////////////////////////////////////////////////////////
KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
KOrg::BaseView(calendar,parent,name)
{
mIsActiveWindow = false;
mCurItem = 0;
mCurItemRootParent = 0;
mCurItemParent = 0;
mCurItemAbove = 0;
mActiveItem = 0;
mCategoryPopupMenu = 0;
mPendingUpdateBeforeRepaint = false;
isFlatDisplay = false;
mNavigator = 0;
- QBoxLayout *topLayout = new QVBoxLayout(this);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
mName = QString ( name );
mBlockUpdate = false;
mQuickBar = new QWidget( this );
topLayout->addWidget(mQuickBar);
mQuickAdd = new KOQuickTodo(mQuickBar);
- QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
+ Q3BoxLayout *quickLayout = new Q3HBoxLayout(mQuickBar);
quickLayout->addWidget( mQuickAdd );
mNewSubBut = new QPushButton( "sub",mQuickBar );
QPushButton * s_done = new QPushButton( "D",mQuickBar );
QPushButton * s_run = new QPushButton( "R",mQuickBar );
QPushButton * allopen = new QPushButton( "O",mQuickBar );
QPushButton * allclose = new QPushButton( "C",mQuickBar );
QPushButton * flat = new QPushButton( "F",mQuickBar );
int fixwid = mQuickAdd->sizeHint().height();
int fixhei = fixwid;
if ( QApplication::desktop()->width() > 800 )
fixwid = (fixwid*3)/2;
connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
s_done->setPixmap( SmallIcon("greenhook16"));
connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
s_run->setPixmap( SmallIcon("ko16old"));
connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() );
mNewSubBut->setEnabled( false );
flat->setFixedWidth( fixwid );
s_done->setFixedWidth( fixwid );
allopen->setFixedWidth( fixwid );
allclose->setFixedWidth( fixwid );
s_run->setFixedWidth( fixwid );
flat->setFixedHeight(fixhei );
s_done->setFixedHeight(fixhei );
allopen->setFixedHeight(fixhei );
allclose->setFixedHeight(fixhei );
s_run->setFixedHeight(fixhei );
mNewSubBut->setFixedHeight(fixhei );
- flat->setFocusPolicy( NoFocus );
- s_done->setFocusPolicy( NoFocus );
- allopen->setFocusPolicy( NoFocus );
- allclose->setFocusPolicy( NoFocus );
- s_run->setFocusPolicy( NoFocus );
- mNewSubBut->setFocusPolicy( NoFocus );
+ flat->setFocusPolicy( Qt::NoFocus );
+ s_done->setFocusPolicy( Qt::NoFocus );
+ allopen->setFocusPolicy( Qt::NoFocus );
+ allclose->setFocusPolicy( Qt::NoFocus );
+ s_run->setFocusPolicy( Qt::NoFocus );
+ mNewSubBut->setFocusPolicy( Qt::NoFocus );
- QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) );
- QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) );
- QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) );
- QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) );
- QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) );
- QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) );
+ Q3WhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) );
+ Q3WhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) );
+ Q3WhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) );
+ Q3WhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) );
+ Q3WhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) );
+ Q3WhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) );
quickLayout->addWidget( mNewSubBut );
quickLayout->addWidget( s_done );
quickLayout->addWidget( s_run );
quickLayout->addWidget( allopen );
quickLayout->addWidget( allclose );
quickLayout->addWidget( flat );
if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
mTodoListView = new KOTodoListView(calendar,this, name );
topLayout->addWidget(mTodoListView);
//mTodoListView->header()->setMaximumHeight(30);
mTodoListView->setRootIsDecorated(true);
mTodoListView->setAllColumnsShowFocus(true);
mTodoListView->setShowSortIndicator(true);
mTodoListView->addColumn(i18n("Todo"));
mTodoListView->addColumn(i18n("Prio"));
- mTodoListView->setColumnAlignment(1,AlignHCenter);
+ mTodoListView->setColumnAlignment(1,Qt::AlignHCenter);
mTodoListView->addColumn(i18n("Complete"));
- mTodoListView->setColumnAlignment(2,AlignCenter);
+ mTodoListView->setColumnAlignment(2,Qt::AlignCenter);
mTodoListView->addColumn(i18n("Due Date"));
- mTodoListView->setColumnAlignment(3,AlignLeft);
+ mTodoListView->setColumnAlignment(3,Qt::AlignLeft);
mTodoListView->addColumn(i18n("Due Time"));
- mTodoListView->setColumnAlignment(4,AlignHCenter);
+ mTodoListView->setColumnAlignment(4,Qt::AlignHCenter);
mTodoListView->addColumn(i18n("Start Date"));
- mTodoListView->setColumnAlignment(5,AlignLeft);
+ mTodoListView->setColumnAlignment(5,Qt::AlignLeft);
mTodoListView->addColumn(i18n("Start Time"));
- mTodoListView->setColumnAlignment(6,AlignHCenter);
+ mTodoListView->setColumnAlignment(6,Qt::AlignHCenter);
//mTodoListView->addColumn(i18n("Cancelled"));
mTodoListView->addColumn(i18n("Categories"));
mTodoListView->addColumn(i18n("Calendar"));
mTodoListView->addColumn(i18n("Last Modified"));
mTodoListView->addColumn(i18n("Created"));
mTodoListView->addColumn(i18n("Last Modified Sub"));
#if 0
mTodoListView->addColumn(i18n("Sort Id"));
- mTodoListView->setColumnAlignment(4,AlignHCenter);
+ mTodoListView->setColumnAlignment(4,Qt::AlignHCenter);
#endif
mTodoListView->setMinimumHeight( 60 );
mTodoListView->setItemsRenameable( true );
mTodoListView->setRenameable( 0 );
mTodoListView->setColumnWidth( 0, 120 );
int iii = 0;
for ( iii = 0; iii< 12 ; ++iii )
- mTodoListView->setColumnWidthMode( iii, QListView::Manual );
+ mTodoListView->setColumnWidthMode( iii, Q3ListView::Manual );
mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
- mPriorityPopupMenu = new QPopupMenu(this);
+ mPriorityPopupMenu = new Q3PopupMenu(this);
for (int i = 1; i <= 5; i++) {
QString label = QString ("%1").arg (i);
mPriority[mPriorityPopupMenu->insertItem (label)] = i;
}
connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
- mPercentageCompletedPopupMenu = new QPopupMenu(this);
+ mPercentageCompletedPopupMenu = new Q3PopupMenu(this);
for (int i = 0; i <= 100; i+=20) {
QString label = QString ("%1 %").arg (i);
mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
}
connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
- mCategoryPopupMenu = new QPopupMenu (this);
+ mCategoryPopupMenu = new Q3PopupMenu (this);
mCategoryPopupMenu->setCheckable (true);
connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
- mCalPopupMenu = new QPopupMenu (this);
+ mCalPopupMenu = new Q3PopupMenu (this);
mCalPopupMenu->setCheckable (true);
connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
- mItemPopupMenu = new QPopupMenu(this);
+ mItemPopupMenu = new Q3PopupMenu(this);
mItemPopupMenu->insertItem(i18n("Show"), this,
SLOT (showTodo()));
mItemPopupMenu->insertItem(i18n("Edit..."), this,
SLOT (editTodo()));
mItemPopupMenu->insertItem( i18n("Delete..."), this,
SLOT (deleteTodo()));
mItemPopupMenu->insertItem( i18n("Clone..."), this,
SLOT (cloneTodo()));
mItemPopupMenu->insertItem( i18n("Move..."), this,
SLOT (moveTodo()));
#ifndef DESKTOP_VERSION
mItemPopupMenu->insertItem( i18n("Beam..."), this,
SLOT (beamTodo()));
#endif
mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
SLOT (cancelTodo()));
mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu);
mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu);
mItemPopupMenu->insertSeparator();
mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
SLOT (toggleRunningItem()));
mItemPopupMenu->insertSeparator();
/*
mItemPopupMenu->insertItem( i18n("New Todo..."), this,
SLOT (newTodo()));
*/
mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
SLOT (newSubTodo()));
mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
SLOT (unparentTodo()),0,21);
mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
SLOT (reparentTodo()),0,22);
mItemPopupMenu->insertSeparator();
#if 0
mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
this, SLOT( purgeCompleted() ) );
mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
this, SLOT( toggleCompleted() ),0, 33 );
mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
this, SLOT( toggleQuickTodo() ),0, 34 );
mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
this, SLOT( toggleRunning() ),0, 35 );
#endif
- mPopupMenu = new QPopupMenu(this);
+ mPopupMenu = new Q3PopupMenu(this);
mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
SLOT (newTodo()),0,1);
mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."),
this, SLOT(purgeCompleted()),0,2);
mPopupMenu->insertItem(i18n("Show Completed"),
this, SLOT( toggleCompleted() ),0,3 );
mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
this, SLOT( toggleRunning() ),0,5 );
mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
this, SLOT( setAllOpen() ),0,6 );
mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
this, SLOT( setAllClose() ),0,7 );
mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
this, SLOT( setAllFlat() ),0,8 );
mPopupMenu->insertSeparator();
mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
this, SLOT( toggleQuickTodo() ),0,4 );
mDocPrefs = new DocPrefs( name );
mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu );
mPopupMenu->setCheckable( true );
mItemPopupMenu->setCheckable( true );
mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
// Double clicking conflicts with opening/closing the subtree
- connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
- SLOT( editItem( QListViewItem *) ) );
+ connect( mTodoListView, SIGNAL( doubleClicked( Q3ListViewItem *) ),
+ SLOT( editItem( Q3ListViewItem *) ) );
/*
connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
const QPoint &,int ) ),
SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
*/
- connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
+ connect( mTodoListView, SIGNAL( contextRequest ( Q3ListViewItem *,
const QPoint &,int ) ),
- SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
- connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
- SLOT( itemClicked( QListViewItem * ) ) );
- connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
- SLOT( itemDoubleClicked( QListViewItem * ) ) );
+ SLOT( popupMenu( Q3ListViewItem *, const QPoint & ,int) ) );
+ connect( mTodoListView, SIGNAL( clicked( Q3ListViewItem * ) ),
+ SLOT( itemClicked( Q3ListViewItem * ) ) );
+ connect( mTodoListView, SIGNAL( double_Clicked( Q3ListViewItem * ) ),
+ SLOT( itemDoubleClicked( Q3ListViewItem * ) ) );
connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
SLOT( updateView() ) );
connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
SLOT( todoModified(Todo *, int) ) );
- connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
- SLOT( itemStateChanged( QListViewItem * ) ) );
- connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
- SLOT( itemStateChanged( QListViewItem * ) ) );
+ connect( mTodoListView, SIGNAL( expanded( Q3ListViewItem * ) ),
+ SLOT( itemStateChanged( Q3ListViewItem * ) ) );
+ connect( mTodoListView, SIGNAL( collapsed( Q3ListViewItem * ) ),
+ SLOT( itemStateChanged( Q3ListViewItem * ) ) );
connect( mTodoListView, SIGNAL( paintNeeded() ),
SLOT( paintNeeded()) );
#if 0
- connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
- SLOT(selectionChanged(QListViewItem *)));
- connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
- SLOT(selectionChanged(QListViewItem *)));
- connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
- SLOT(selectionChanged(QListViewItem *)));
+ connect(mTodoListView,SIGNAL(selectionChanged(Q3ListViewItem *)),
+ SLOT(selectionChanged(Q3ListViewItem *)));
+ connect(mTodoListView,SIGNAL(clicked(Q3ListViewItem *)),
+ SLOT(selectionChanged(Q3ListViewItem *)));
+ connect(mTodoListView,SIGNAL(pressed(Q3ListViewItem *)),
+ SLOT(selectionChanged(Q3ListViewItem *)));
#endif
connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
connect( mTodoListView, SIGNAL(selectionChanged() ),
SLOT( processSelectionChange() ) );
connect( mQuickAdd, SIGNAL( returnPressed () ),
SLOT( addQuickTodo() ) );
}
KOTodoView::~KOTodoView()
{
#if QT_VERSION >= 0x030000
#else
delete mKOTodoViewWhatsThis;
#endif
delete mDocPrefs;
}
@@ -860,49 +876,49 @@ void KOTodoView::updateView()
}
//qDebug("KOTodoView::updateView() %x", this);
if ( isFlatDisplay ) {
displayAllFlat();
return;
}
//qDebug("update ");
// kdDebug() << "KOTodoView::updateView()" << endl;
QFont fo = KOPrefs::instance()->mTodoViewFont;
clearList ();
if ( mName == "todolistsmall" ) {
if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
int ps = fo.pointSize() -2;
if ( ps > 12 )
ps -= 2;
fo.setPointSize( ps );
}
}
mTodoListView->setFont( fo );
// QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
//mTodoListView->header()->setMaximumHeight(fm.height());
- QPtrList<Todo> todoList = calendar()->todos();
+ Q3PtrList<Todo> todoList = calendar()->todos();
/*
kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
Event *t;
for(t = todoList.first(); t; t = todoList.next()) {
kdDebug() << " " << t->getSummary() << endl;
if (t->getRelatedTo()) {
kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
}
QPtrList<Event> l = t->getRelations();
Event *c;
for(c=l.first();c;c=l.next()) {
kdDebug() << " - relation: " << c->getSummary() << endl;
}
}
*/
// Put for each Event a KOTodoViewItem in the list view. Don't rely on a
// specific order of events. That means that we have to generate parent items
// recursively for proper hierarchical display of Todos.
Todo *todo;
todo = todoList.first();// todo; todo = todoList.next()) {
@@ -1023,49 +1039,49 @@ void KOTodoView::resetFocusToList()
topLevelWidget()->setActiveWindow();
mTodoListView->setFocus();
}
//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
bool KOTodoView::checkTodo( Todo * todo )
{
if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
return false;
if ( !todo->isCompleted() ) {
if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() )
return true;
}
if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
if ( todo->hasStartDate() )
if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
return false;
if ( todo->hasDueDate() )
if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
return false;
}
return true;
}
-void KOTodoView::restoreItemState( QListViewItem *item )
+void KOTodoView::restoreItemState( Q3ListViewItem *item )
{
pendingSubtodo = 0;
while( item ) {
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
item = item->nextSibling();
}
}
QMap<Todo *,KOTodoViewItem *>::ConstIterator
KOTodoView::insertTodoItem(Todo *todo)
{
// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
// TODO: Check, if dynmaic cast is necessary
pendingSubtodo = 0;
Incidence *incidence = todo->relatedTo();
while ( incidence && !incidence->calEnabled() )
incidence = incidence->relatedTo();
if (incidence && incidence->typeID() == todoID ) {
Todo *relatedTodo = static_cast<Todo *>(incidence);
@@ -1075,105 +1091,105 @@ KOTodoView::insertTodoItem(Todo *todo)
itemIterator = mTodoMap.find(relatedTodo);
if (itemIterator == mTodoMap.end()) {
// kdDebug() << " related not yet in list" << endl;
itemIterator = insertTodoItem (relatedTodo);
}
// isn't this pretty stupid? We give one Todo to the KOTodoViewItem
// and one into the map. Sure finding is more easy but why? -zecke
KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
return mTodoMap.insert(todo,todoItem);
} else {
// kdDebug() << " no Related" << endl;
// see above -zecke
KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
return mTodoMap.insert(todo,todoItem);
}
}
void KOTodoView::updateConfig()
{
updateView();
mTodoListView->repaintContents();
}
-QPtrList<Incidence> KOTodoView::selectedIncidences()
+Q3PtrList<Incidence> KOTodoView::selectedIncidences()
{
- QPtrList<Incidence> selected;
+ Q3PtrList<Incidence> selected;
KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
// if (!item) item = mActiveItem;
if (item) selected.append(item->todo());
return selected;
}
-QPtrList<Todo> KOTodoView::selectedTodos()
+Q3PtrList<Todo> KOTodoView::selectedTodos()
{
- QPtrList<Todo> selected;
+ Q3PtrList<Todo> selected;
KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
// if (!item) item = mActiveItem;
if (item) selected.append(item->todo());
return selected;
}
void KOTodoView::changeEventDisplay(Event *, int)
{
updateView();
}
void KOTodoView::showDates(const QDate &, const QDate &)
{
}
-void KOTodoView::showEvents(QPtrList<Event>)
+void KOTodoView::showEvents(Q3PtrList<Event>)
{
kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
}
void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
calPrinter->preview(CalPrinter::Todolist, fd, td);
#endif
}
-void KOTodoView::editItem(QListViewItem *item )
+void KOTodoView::editItem(Q3ListViewItem *item )
{
if ( item )
emit editTodoSignal(((KOTodoViewItem *)item)->todo());
}
-void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
+void KOTodoView::showItem(Q3ListViewItem *item,const QPoint &,int)
{
if ( item )
emit showTodoSignal(((KOTodoViewItem *)item)->todo());
}
-void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
+void KOTodoView::popupMenu(Q3ListViewItem *item,const QPoint &p,int column)
{
pendingSubtodo = 0;
mActiveItem = (KOTodoViewItem *)item;
if (item) {
switch (column){
case 1:
mPriorityPopupMenu->popup(QCursor::pos ()); break;
case 2:
mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
case 3:
moveTodo();
break;
case 7:
mCategoryPopupMenu->popup(QCursor::pos ()); break;
case 8:
mCalPopupMenu->popup(QCursor::pos ()); break;
default:
mItemPopupMenu->popup(QCursor::pos());
}
} else mPopupMenu->popup(QCursor::pos());
}
void KOTodoView::newTodo()
{
emit newTodoSignal();
@@ -1340,49 +1356,49 @@ void KOTodoView::changedCategories(int index)
mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED);
}
}
void KOTodoView::toggleRunningItemQuick()
{
if ( !mActiveItem ) return;
Todo * t = mActiveItem->todo();
if ( t->isRunning() ) {
if ( t->runTime() < 15) {
t->stopRunning();
mActiveItem->construct();
topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!"));
return;
}
else
toggleRunningItem();
return;
} else {
t->setRunning( true );
mActiveItem->construct();
topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
}
}
-void KOTodoView::itemDoubleClicked(QListViewItem *item)
+void KOTodoView::itemDoubleClicked(Q3ListViewItem *item)
{
if ( pendingSubtodo != 0 ) {
topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
}
pendingSubtodo = 0;
//int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() );
int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() );
//qDebug("ROW %d ", row);
if (!item) {
newTodo();
return;
} else {
if ( row == 1 ) {
mActiveItem = (KOTodoViewItem *) item;
newSubTodo();
return;
}
if ( row == 5 || row == 6 || row == 2) {
mActiveItem = (KOTodoViewItem *) item;
toggleRunningItemQuick();
return;
}
}
if ( KOPrefs::instance()->mEditOnDoubleClick )
@@ -1407,90 +1423,90 @@ void KOTodoView::toggleRunningItem()
}
tp.exec();
updateTodo ( t, KOGlobals::EVENTEDITED );
} else {
KOStartTodoPrefs tp ( t->summary(), this );
if (QApplication::desktop()->width() <= 800 ){
int wid = tp.width();
int hei = tp.height();
int xx = (QApplication::desktop()->width()-wid)/2;
int yy = (QApplication::desktop()->height()-hei)/2;
tp.setGeometry( xx,yy,wid,hei );
}
if ( !tp.exec() ) return;
if ( tp.stopAll() ) {
mCalendar->stopAllTodos();
t->setRunning( true );
updateView();
} else {
t->setRunning( true );
updateTodo ( t, KOGlobals::EVENTEDITED );
}
}
}
-void KOTodoView::itemClicked(QListViewItem *item)
+void KOTodoView::itemClicked(Q3ListViewItem *item)
{
//qDebug("KOTodoView::itemClicked %d", item);
if (!item) {
if ( pendingSubtodo != 0 ) {
topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
}
pendingSubtodo = 0;
return;
}
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
if ( pendingSubtodo != 0 ) {
bool allowReparent = true;
- QListViewItem *par = item;
+ Q3ListViewItem *par = item;
while ( par ) {
if ( par == pendingSubtodo ) {
allowReparent = false;
break;
}
par = par->parent();
}
if ( !allowReparent ) {
topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
pendingSubtodo = 0;
} else {
Todo* newParent = todoItem->todo();
Todo* newSub = pendingSubtodo->todo();
pendingSubtodo = 0;
emit reparentTodoSignal( newParent,newSub );
return;
}
}
}
void KOTodoView::setDocumentId( const QString &id )
{
mDocPrefs->setDoc( id );
}
-void KOTodoView::itemStateChanged( QListViewItem *item )
+void KOTodoView::itemStateChanged( Q3ListViewItem *item )
{
if (!item) return;
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
}
void KOTodoView::saveLayout(KConfig *config, const QString &group) const
{
mTodoListView->saveLayout(config,group);
}
void KOTodoView::restoreLayout(KConfig *config, const QString &group)
{
mTodoListView->restoreLayout(config,group);
}
void KOTodoView::processSelectionChange()
{
// kdDebug() << "KOTodoView::processSelectionChange()" << endl;
@@ -1521,70 +1537,70 @@ void KOTodoView::clearSelection()
void KOTodoView::setAllOpen()
{
if ( isFlatDisplay ) {
isFlatDisplay = false;
mPopupMenu->setItemChecked( 8,false );
updateView();
} else {
storeCurrentItem();
}
setOpen(mTodoListView->firstChild(), true);
resetCurrentItem();
}
void KOTodoView::setAllClose()
{
if ( isFlatDisplay ) {
isFlatDisplay = false;
mPopupMenu->setItemChecked( 8,false );
updateView();
} else {
storeCurrentItem();
}
setOpen(mTodoListView->firstChild(), false);
resetCurrentItem();
}
-void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
+void KOTodoView::setOpen( Q3ListViewItem* item, bool setOpenI)
{
while ( item ) {
setOpen( item->firstChild(), setOpenI );
item->setOpen( setOpenI );
item = item->nextSibling();
}
}
void KOTodoView::displayAllFlat()
{
mActiveItem = 0;
pendingSubtodo = 0;
if ( mBlockUpdate ) {
return;
}
clearList ();
mPopupMenu->setItemChecked( 8,true );
isFlatDisplay = true;
- QPtrList<Todo> todoList = calendar()->todos();
+ Q3PtrList<Todo> todoList = calendar()->todos();
Todo *todo;
for(todo = todoList.first(); todo; todo = todoList.next()) {
if ( checkTodo( todo ) ) {
KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
mTodoMap.insert(todo,todoItem);
}
}
resetCurrentItem();
}
void KOTodoView::setAllFlat()
{
if ( isFlatDisplay ) {
isFlatDisplay = false;
mPopupMenu->setItemChecked( 8,false );
updateView();
return;
}
displayAllFlat();
}
void KOTodoView::purgeCompleted()
{
emit purgeCompletedSignal();
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 0cbc087..a9e7f30 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -5,57 +5,67 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOTODOVIEW_H
#define KOTODOVIEW_H
#include <qfont.h>
#include <qfontmetrics.h>
#include <qlineedit.h>
-#include <qptrlist.h>
-#include <qstrlist.h>
-#include <qlistbox.h>
-#include <qpopupmenu.h>
+#include <q3ptrlist.h>
+#include <q3strlist.h>
+#include <q3listbox.h>
+#include <q3popupmenu.h>
#include <qlabel.h>
#include <qmap.h>
#include <qdialog.h>
#include <qlabel.h>
-#include <qlistview.h>
+#include <q3listview.h>
+//Added by qt3to4:
+#include <QDragMoveEvent>
+#include <QDropEvent>
+#include <QDragLeaveEvent>
+#include <QWheelEvent>
+#include <QPaintEvent>
+#include <QFocusEvent>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <QDragEnterEvent>
#include <klistview.h>
#include <libkcal/calendar.h>
#include <libkcal/todo.h>
#include <korganizer/baseview.h>
#include "kotodoviewitem.h"
#include "koprefs.h"
#include "koglobals.h"
#include "datenavigator.h"
class QDragEnterEvent;
class QDragMoveEvent;
class QDragLeaveEvent;
class QDropEvent;
class KOTodoViewWhatsThis;
class KDateEdit;
class KOTimeEdit;
class DocPrefs;
class KOStopTodoPrefs : public QDialog
@@ -80,170 +90,170 @@ private:
class KOStartTodoPrefs : public QDialog
{
Q_OBJECT
public:
KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ;
bool stopAll() { return mStopAll; }
private slots:
void doStop();
private:
bool mStopAll;
};
class KOTodoListView : public KListView
{
Q_OBJECT
public:
KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0);
virtual ~KOTodoListView() {}
signals:
void paintNeeded();
void todoDropped(Todo *, int);
- void double_Clicked(QListViewItem *item);
+ void double_Clicked(Q3ListViewItem *item);
void reparentTodoSignal( Todo *,Todo * );
void unparentTodoSignal(Todo *);
void deleteTodo( Todo * );
protected:
void wheelEvent (QWheelEvent *e);
void contentsDragEnterEvent(QDragEnterEvent *);
void contentsDragMoveEvent(QDragMoveEvent *);
void contentsDragLeaveEvent(QDragLeaveEvent *);
void contentsDropEvent(QDropEvent *);
void contentsMousePressEvent(QMouseEvent *);
void contentsMouseMoveEvent(QMouseEvent *);
void contentsMouseReleaseEvent(QMouseEvent *);
void contentsMouseDoubleClickEvent(QMouseEvent *);
private:
void paintEvent(QPaintEvent * pevent);
bool internalDrop;
QString mName;
Calendar *mCalendar;
QPoint mPressPos;
bool mMousePressed;
- QListViewItem *mOldCurrent;
+ Q3ListViewItem *mOldCurrent;
bool mFlagKeyPressed;
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
};
/**
This is the line-edit on top of the todoview for fast addition of new todos
*/
class KOQuickTodo : public QLineEdit
{
public:
KOQuickTodo(QWidget *parent=0);
protected:
void focusInEvent(QFocusEvent *ev);
void focusOutEvent(QFocusEvent *ev);
};
/**
This class provides a multi-column list view of todo events.
@short multi-column list view of todo events.
@author Cornelius Schumacher <schumacher@kde.org>
*/
class KOTodoView : public KOrg::BaseView
{
Q_OBJECT
public:
KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
~KOTodoView();
- QPtrList<Incidence> selectedIncidences();
- QPtrList<Todo> selectedTodos();
+ Q3PtrList<Incidence> selectedIncidences();
+ Q3PtrList<Todo> selectedTodos();
DateList selectedDates()
{DateList q;
return q;}
/** Return number of shown dates. TodoView does not show dates, */
int currentDateCount() { return 0; }
void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
void setDocumentId( const QString & );
void saveLayout(KConfig *config, const QString &group) const;
void restoreLayout(KConfig *config, const QString &group);
void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
QString getWhatsThisText(QPoint p);
void clearList( bool saveCurrentItem = true );
public slots:
void updateView();
void updateConfig();
void changeEventDisplay(Event *, int);
void showDates(const QDate &start, const QDate &end);
- void showEvents(QPtrList<Event> eventList);
+ void showEvents(Q3PtrList<Event> eventList);
void clearSelection();
void jumpToDate ();
- void editItem(QListViewItem *item);
- void showItem(QListViewItem *item,const QPoint &,int);
- void popupMenu(QListViewItem *item,const QPoint &,int);
+ void editItem(Q3ListViewItem *item);
+ void showItem(Q3ListViewItem *item,const QPoint &,int);
+ void popupMenu(Q3ListViewItem *item,const QPoint &,int);
void newTodo();
void newSubTodo();
void unparentTodo();
void reparentTodo();
void showTodo();
void editTodo();
void cloneTodo();
void cancelTodo();
void moveTodo();
void beamTodo();
void deleteTodo();
void setNewPriority(int);
void setNewPercentage(int);
void changedCategories(int);
void setAllOpen();
void setAllClose();
void setAllFlat();
void displayAllFlat();
void purgeCompleted();
void toggleCompleted();
void toggleRunning();
void toggleQuickTodo();
void updateTodo( Todo *, int );
- void itemClicked(QListViewItem *);
- void itemStateChanged(QListViewItem *);
+ void itemClicked(Q3ListViewItem *);
+ void itemStateChanged(Q3ListViewItem *);
void modified(bool);
- void itemDoubleClicked(QListViewItem *item);
+ void itemDoubleClicked(Q3ListViewItem *item);
void resetFocusToList();
void fillCategories ();
void fillCal ();
void changedCal (int);
signals:
void newTodoSignal();
void newSubTodoSignal(Todo *);
void unparentTodoSignal(Todo *);
void reparentTodoSignal( Todo *,Todo * );
void showTodoSignal(Todo *);
void editTodoSignal(Todo *);
void deleteTodoSignal(Todo *);
void todoModifiedSignal (Todo *, int);
void isModified(bool);
void cloneTodoSignal( Incidence * );
void cancelTodoSignal( Incidence * );
void moveTodoSignal( Incidence * );
void beamTodoSignal( Incidence * );
void purgeCompletedSignal();
protected slots:
@@ -252,60 +262,60 @@ class KOTodoView : public KOrg::BaseView
void paintNeeded();
void processSelectionChange();
void addQuickTodo();
void setTodoModified( Todo* );
void todoModified(Todo *, int );
private:
bool mIsActiveWindow;
void addQuickTodoPar( Todo * parentTodo);
/*
* the TodoEditor approach is rather unscaling in the long
* run.
* Korganizer keeps it in memory and we need to update
* 1. make KOTodoViewItem a QObject again?
* 2. add a public method for setting one todo modified?
* 3. add a private method for setting a todo modified + friend here?
* -- zecke 2002-07-08
*/
KOTodoViewWhatsThis* mKOTodoViewWhatsThis;
friend class KOTodoListView;
void paintEvent(QPaintEvent * pevent);
bool mPendingUpdateBeforeRepaint;
friend class KOTodoViewItem;
QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
- void restoreItemState( QListViewItem * );
+ void restoreItemState( Q3ListViewItem * );
bool checkTodo( Todo * );
bool isFlatDisplay;
- void setOpen( QListViewItem*, bool setOpen);
+ void setOpen( Q3ListViewItem*, bool setOpen);
KOTodoListView *mTodoListView;
- QPopupMenu *mItemPopupMenu;
- QPopupMenu *mPopupMenu;
- QPopupMenu *mPriorityPopupMenu;
- QPopupMenu *mPercentageCompletedPopupMenu;
- QPopupMenu *mCategoryPopupMenu;
- QPopupMenu *mCalPopupMenu;
+ Q3PopupMenu *mItemPopupMenu;
+ Q3PopupMenu *mPopupMenu;
+ Q3PopupMenu *mPriorityPopupMenu;
+ Q3PopupMenu *mPercentageCompletedPopupMenu;
+ Q3PopupMenu *mCategoryPopupMenu;
+ Q3PopupMenu *mCalPopupMenu;
QMap<int, int> mPercentage;
QMap<int, int> mPriority;
QMap<int, QString> mCategory;
KOTodoViewItem *mActiveItem;
QMap<Todo *,KOTodoViewItem *> mTodoMap;
QString mName;
QWidget* mQuickBar;
DocPrefs *mDocPrefs;
QString mCurrentDoc;
KOQuickTodo *mQuickAdd;
bool mBlockUpdate;
void keyPressEvent ( QKeyEvent * ) ;
KOTodoViewItem * pendingSubtodo;
DateNavigator* mNavigator;
void storeCurrentItem();
void resetCurrentItem();
Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove;
QPushButton * mNewSubBut;
};
#endif
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 519bb16..c21816d 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -1,107 +1,111 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <klocale.h>
#include <kdebug.h>
-#include <qapp.h>
+#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3PointArray>
+#include <QPixmap>
#include <kglobal.h>
#include <kiconloader.h>
#include "kotodoviewitem.h"
#include "kotodoview.h"
#include "koprefs.h"
-KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo)
- : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
+KOTodoViewItem::KOTodoViewItem( Q3ListView *parent, Todo *todo, KOTodoView *kotodo)
+ : Q3CheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
{
construct();
}
KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo )
- : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
+ : Q3CheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
{
construct();
}
QString KOTodoViewItem::key(int column,bool) const
{
if ( column == 0 )
return text(0).lower();
if ( column == 1 ) {
if ( mTodo->isCompleted() ) {
return "6"+QString::number(mTodo->priority())+text(0).lower();
}
return QString::number(mTodo->priority())+text(0).lower();
}
QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
if (it == mKeyMap.end()) {
return text(column).lower();
} else {
if ( column == 2 ) {
return *it+text(0).lower();
}
return *it;
}
}
void KOTodoViewItem:: setup()
{
int h = 20;
if ( listView () ) {
QFontMetrics fm ( listView ()->font () );
h = fm.height();
}
setHeight( h );
}
void KOTodoViewItem::setSortKey(int column,const QString &key)
{
mKeyMap.insert(column,key);
}
#if QT_VERSION >= 0x030000
void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
int y,int h)
{
- QListViewItem::paintBranches(p,cg,w,y,h);
+ Q3ListViewItem::paintBranches(p,cg,w,y,h);
}
#else
#endif
void KOTodoViewItem::construct()
{
// qDebug("KOTodoViewItem::construct() ");
m_init = true;
QString keyd = "==";
QString keyt = "==";
QString skeyd = "==";
QString skeyt = "==";
setOn(mTodo->isCompleted());
setText(0,mTodo->summary());
setText(1,QString::number(mTodo->priority()));
setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
if (mTodo->percentComplete()<100) {
setSortKey(2,QString::number(mTodo->percentComplete()));
}
else {
setSortKey(2,"999");
}
if (mTodo->hasDueDate()) {
@@ -295,58 +299,58 @@ void KOTodoViewItem::stateChange(bool state)
setText(6,"");
}
else {
setText(6,mTodo->dtStartTimeStr());
QTime t = mTodo->dtStart().time();
skeyt.sprintf("%02d%02d",t.hour(),t.minute());
}
setSortKey(5,skeyd);
setSortKey(6,skeyt);
}
if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt);
else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
if (mTodo->percentComplete()<100) {
if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
else setSortKey(2,QString::number(mTodo->percentComplete()));
}
else {
if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
else setSortKey(2,QString::number(99));
}
if ( state ) {
- QListViewItem * myChild = firstChild();
+ Q3ListViewItem * myChild = firstChild();
KOTodoViewItem *item;
while( myChild ) {
//qDebug("stateCH ");
item = static_cast<KOTodoViewItem*>(myChild);
item->stateChange(state);
myChild = myChild->nextSibling();
}
} else {
- QListViewItem * myChild = parent();
+ Q3ListViewItem * myChild = parent();
if ( myChild )
(static_cast<KOTodoViewItem*>(myChild))->stateChange(state);
}
mTodoView->modified(true);
setMyPixmap();
mTodoView->setTodoModified( mTodo );
}
bool KOTodoViewItem::isAlternate()
{
#if 0
//if ( m_known ) return m_odd;
//qDebug("test ");
KOTodoViewItem *item = static_cast<KOTodoViewItem *>(itemAbove());
if ( item ) {
m_known = item->m_known;
if ( m_known ) {
m_odd = !item->m_odd ;
return m_odd;
}
} else {
item = static_cast<KOTodoViewItem *>(itemBelow());
if ( item ) {
m_known = item->m_known;
@@ -362,54 +366,54 @@ bool KOTodoViewItem::isAlternate()
qDebug("WHILE ");
while ( item ) {
item->m_odd = !previous;
item->m_known = true;
previous = !previous;
item = static_cast<KOTodoViewItem *>(item->itemBelow());
}
return m_odd;
#else
//KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
//if (lv && lv->alternateBackground().isValid())
{
KOTodoViewItem *above = static_cast<KOTodoViewItem *>(itemAbove());
m_known = above ? above->m_known : true;
if (m_known)
{
m_odd = above ? !above->m_odd : false;
}
else
{
KOTodoViewItem *item;
bool previous = true;
- if (QListViewItem::parent())
+ if (Q3ListViewItem::parent())
{
- item = static_cast<KOTodoViewItem *>(QListViewItem::parent());
+ item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent());
if (item)
previous = item->m_odd;
- item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild());
+ item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()->firstChild());
}
else
{
KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
item = static_cast<KOTodoViewItem *>(lv->firstChild());
}
while(item)
{
item->m_odd = previous = !previous;
item->m_known = true;
item = static_cast<KOTodoViewItem *>(item->nextSibling());
}
}
return m_odd;
}
return false;
#endif
}
void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
{
QColorGroup _cg = cg;
QColorGroup::ColorRole role;
@@ -455,125 +459,125 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i
}
if ( setColor ) {
_cg.setColor(role,colorToSet );
if ( role == QColorGroup::Base) {
int rgb = colorToSet.red();
rgb += colorToSet.blue()/2;
rgb += colorToSet.green();
if ( rgb < 200 )
_cg.setColor(QColorGroup::Text,Qt::white );
}
}
//#endif
if ( column > 0 ){
if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) {
p->save();
int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5);
p->fillRect( 0, 0, width, height(), _cg.base() ); // background
// p->setPen(Qt::black ); //border
// p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling
QColor fc = KOPrefs::instance()->mHighlightColor;
if ( mTodo->percentComplete() == 100 )
- fc = darkGreen;
+ fc = Qt::darkGreen;
p->drawRect( 2, 2, width-4, height()-4);
p->fillRect( 3, 3, progress, height()-6,
fc );
p->restore();
} else {
- QCheckListItem::paintCell(p, _cg, column, width, alignment);
+ Q3CheckListItem::paintCell(p, _cg, column, width, alignment);
}
return;
}
int align = alignment;
if ( !p )
return;
p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) );
- QListView *lv = listView();
+ Q3ListView *lv = listView();
if ( !lv )
return;
int marg = 2;//lv->itemMargin();
int r = 0;
- QCheckListItem::Type myType = QCheckListItem::CheckBox;
+ Q3CheckListItem::Type myType = Q3CheckListItem::CheckBox;
int BoxSize = 20;
int boxOffset = 2;
int xOffset = 2;
if (qApp->desktop()->width() < 300 ) {
BoxSize = 14;
boxOffset = -1;
xOffset = 1;
// marg = 0;
}
if ( height() < BoxSize ) {
boxOffset = boxOffset - ((BoxSize - height())/2) ;
// qDebug("boxOffset %d height %d", boxOffset, height() );
BoxSize = height();
}
//bool winStyle = lv->style() == WindowsStyle;
int lineStart = 5;
if ( myType == Controller ) {
if ( !pixmap( 0 ) )
r += BoxSize + 4;
} else {
- ASSERT( lv ); //###
+ Q_ASSERT( lv ); //###
// QFontMetrics fm( lv->font() );
// int d = fm.height();
int x = 0;
int y = (height() - BoxSize) / 2;
// p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) );
if ( myType == CheckBox ) {
if ( isEnabled() )
p->setPen( QPen( _cg.text(), 1 ) );
else
p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) );
p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 );
lineStart = x+marg;
/////////////////////
x++;
y++;
if ( isOn() ) {
- QPointArray a( 7*2 );
+ Q3PointArray a( 7*2 );
int i, xx, yy;
xx = x+xOffset+marg+(boxOffset/2);
yy = y+5+boxOffset;
for ( i=0; i<3; i++ ) {
a.setPoint( 2*i, xx, yy );
a.setPoint( 2*i+1, xx, yy+2 );
// qDebug(" ");
xx++; yy++;
}
yy -= 2;
for ( i=3; i<7; i++ ) {
a.setPoint( 2*i, xx, yy );
a.setPoint( 2*i+1, xx, yy+2 );
xx++; yy--;
}
- p->setPen( darkGreen );
+ p->setPen( Qt::darkGreen );
p->drawLineSegments( a );
}
////////////////////////
}
r += BoxSize + 4;
}
p->translate( r, 0 );
p->setPen( QPen( _cg.text() ) );
- QListViewItem::paintCell( p, _cg, column, width - r, align );
+ Q3ListViewItem::paintCell( p, _cg, column, width - r, align );
if ( mTodo->cancelled () ) {
- p->setPen( black );
+ p->setPen( Qt::black );
QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() );
int wid = br.width() +lineStart;
if ( wid > width-3 )
wid = width-3;
p->drawLine( lineStart, height()/2+1, wid, height()/2+1 );
}
}
diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h
index bd024c8..62a635c 100644
--- a/korganizer/kotodoviewitem.h
+++ b/korganizer/kotodoviewitem.h
@@ -1,81 +1,81 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KOTODOVIEWITEM_H
#define KOTODOVIEWITEM_H
#include <qfont.h>
#include <qfontmetrics.h>
#include <qlineedit.h>
-#include <qptrlist.h>
-#include <qstrlist.h>
-#include <qlistbox.h>
-#include <qpopupmenu.h>
+#include <q3ptrlist.h>
+#include <q3strlist.h>
+#include <q3listbox.h>
+#include <q3popupmenu.h>
#include <qlabel.h>
#include <qmap.h>
-#include <qlistview.h>
+#include <q3listview.h>
#include <qpainter.h>
#include <libkcal/calendar.h>
#include <libkcal/todo.h>
using namespace KCal;
class KOTodoView;
/**
This class provides a way of displaying a single Event of Todo-Type in a
KTodoView.
@author Cornelius Schumacher <schumacher@kde.org>
@see KOTodoView
*/
-class KOTodoViewItem : public QCheckListItem
+class KOTodoViewItem : public Q3CheckListItem
{
public:
/**
Constructor.
@param parent is the list view to which this item belongs.
@param ev is the event to have the item display information for.
*/
- KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo);
+ KOTodoViewItem(Q3ListView *parent, Todo *todo, KOTodoView *kotodo);
KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo);
//~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );}
void construct();
Todo *todo() { return mTodo; }
QString key(int, bool) const;
void setSortKey(int column,const QString &key);
bool isAlternate();
virtual void paintCell(QPainter *p, const QColorGroup &cg,
int column, int width, int alignment);
virtual void setup();
protected:
#if QT_VERSION >= 0x030000
void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h);
#else
#endif
virtual void stateChange(bool);
void setMyPixmap();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 4057ae0..07c4295 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -2,49 +2,51 @@
This file is part of KOrganizer.
Copyright (c) 2001
Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qwidgetstack.h>
+#include <q3widgetstack.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include <kconfig.h>
#include <kglobal.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#include <qdatetime.h>
#include "calendarview.h"
#include "datenavigator.h"
#include "kotodoview.h"
#include "koagendaview.h"
#include "kodialogmanager.h"
#include "komonthview.h"
#include "kolistview.h"
#include "kowhatsnextview.h"
#include "kojournalview.h"
#include "kotimespanview.h"
#include "koprefs.h"
#include "navigatorbar.h"
#include "kdatenavigator.h"
#include "koviewmanager.h"
@@ -436,50 +438,50 @@ void KOViewManager::showListView()
{
if (!mListView) {
mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
addView(mListView);
connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
mMainView, SLOT(showIncidence(Incidence *)));
connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
mMainView, SLOT(editIncidence(Incidence *)));
connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
mMainView, SLOT(deleteIncidence(Incidence *)));
connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
connect( mListView, SIGNAL( signalNewEvent() ),
mMainView, SLOT( newEvent() ) );
connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( moveIncidence( Incidence * ) ) );
connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
- connect( mListView, SIGNAL( beamIncidenceList( QPtrList<Incidence> ) ),
- mMainView, SLOT ( beamIncidenceList( QPtrList<Incidence> ) ) );
+ connect( mListView, SIGNAL( beamIncidenceList( Q3PtrList<Incidence> ) ),
+ mMainView, SLOT ( beamIncidenceList( Q3PtrList<Incidence> ) ) );
}
// bool temp = mFlagShowNextxDays;
//globalFlagBlockPainting = true;
globalFlagBlockAgenda = 1;
if ( KOPrefs::instance()->mListViewMonthTimespan ) {
mMainView->setBlockShowDates( true );
mMainView->dateNavigator()->selectMonth();
mMainView->setBlockShowDates( false );
}
KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
showView(mListView, KOPrefs::instance()->mFullViewTodo);
//mFlagShowNextxDays = temp;
KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
mMainView->setScrollBarStep( 7 );
}
void KOViewManager::showAgendaView( bool fullScreen )
{
mMainView->dialogManager()->hideSearchDialog();
// qDebug("KOViewManager::showAgendaView ");
bool full;
full = fullScreen;
if (!mAgendaView) {
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index f88403c..bfe930f 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -1,173 +1,179 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <qlayout.h>
-#include <qtextbrowser.h>
+#include <q3textbrowser.h>
#include <qtextcodec.h>
#include <qfileinfo.h>
#include <qlabel.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#ifdef DESKTOP_VERSION
-#include <qpaintdevicemetrics.h>
+#include <q3paintdevicemetrics.h>
+//Added by qt3to4:
+#include <Q3PtrList>
+#include <QHideEvent>
+#include <Q3VBoxLayout>
+#include <QShowEvent>
#endif
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <libkcal/calendar.h>
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koglobals.h"
#include "koprefs.h"
#include "koeventviewerdialog.h"
#include "koeventviewer.h"
-#include <qstylesheet.h>
+#include <q3stylesheet.h>
#include "kowhatsnextview.h"
using namespace KOrg;
void WhatsNextTextBrowser::setSource(const QString& n)
{
if (n.startsWith("event:")) {
emit showIncidence(n);
return;
} else if (n.startsWith("todo:")) {
emit showIncidence(n);
return;
} else {
- QTextBrowser::setSource(n);
+ Q3TextBrowser::setSource(n);
}
}
void WhatsNextTextBrowser::printMe()
{
#ifdef DESKTOP_VERSION
KOPrintPrefs pp ( this );
if (!pp.exec() )
return;
int scaleval = pp.printMode() ;
QPrinter printer;
if (!printer.setup() )
return;
QPainter p;
p.begin ( &printer );
- QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
+ Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
float dx, dy;
int wid = (m.width() * 9)/10;
dx = (float) wid/(float)contentsWidth ();
dy = (float)(m.height()) / (float)contentsHeight ();
float scale;
// scale to fit the width or height of the paper
if ( dx < dy )
scale = dx;
else
scale = dy;
p.translate( m.width()/10,0 );
if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
p.scale( scale, scale );
}
drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
p.end();
#endif
}
KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
const char *name)
: KOrg::BaseView(calendar, parent, name)
{
// mDateLabel =
// new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
// mDateLabel->setMargin(2);
// mDateLabel->setAlignment(AlignCenter);
setFont( KOPrefs::instance()->mWhatsNextFont );
mView = new WhatsNextTextBrowser(this);
connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
- QStyleSheet* stsh = mView->styleSheet();
- QStyleSheetItem * style ;
+ Q3StyleSheet* stsh = mView->styleSheet();
+ Q3StyleSheetItem * style ;
style = stsh->item ("h2" );
if ( style ) {
- style->setMargin(QStyleSheetItem::MarginAll,0);
+ style->setMargin(Q3StyleSheetItem::MarginAll,0);
}
style = stsh->item ("h3" );
if ( style ) {
- style->setMargin(QStyleSheetItem::MarginAll,0);
+ style->setMargin(Q3StyleSheetItem::MarginAll,0);
}
mEventViewer = 0;
- QBoxLayout *topLayout = new QVBoxLayout(this);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
// topLayout->addWidget(mDateLabel);
topLayout->addWidget(mView);
mTimer = new QTimer( this );
connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView()));
connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
}
KOWhatsNextView::~KOWhatsNextView()
{
}
int KOWhatsNextView::maxDatesHint()
{
return 0;
}
int KOWhatsNextView::currentDateCount()
{
return 0;
}
void KOWhatsNextView::clearList()
{
mTimer->stop();
mView->setText(" ");
}
-QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
+Q3PtrList<Incidence> KOWhatsNextView::selectedIncidences()
{
- QPtrList<Incidence> eventList;
+ Q3PtrList<Incidence> eventList;
return eventList;
}
void KOWhatsNextView::printMe()
{
#ifdef DESKTOP_VERSION
mView->printMe();
#endif
}
void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
calPrinter->preview(CalPrinter::Day, fd, td);
#endif
}
void KOWhatsNextView::updateConfig()
{
setFont( KOPrefs::instance()->mWhatsNextFont );
updateView();
}
void KOWhatsNextView::showEvent ( QShowEvent * e )
@@ -198,50 +204,50 @@ void KOWhatsNextView::updateView()
// mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate()));
KIconLoader kil("korganizer");
QString ipath;// = new QString();
// kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath);
//<big><big><strong>" + date + "</strong></big></big>\n";
mText = "<table width=\"100%\">\n";
//mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
#ifdef DESKTOP_VERSION
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
#else
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
#endif
// mText += "<img src=\"";
// mText += ipath;
// mText += "\">";
mEventDate = QDate::currentDate();
#ifdef DESKTOP_VERSION
mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>";
#else
mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>";
#endif
mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
int iii;
mTodos.clear();
- QPtrList<Event> events;
- QPtrList<Todo> todos = calendar()->todos();
+ Q3PtrList<Event> events;
+ Q3PtrList<Todo> todos = calendar()->todos();
Todo * todo;
//mText += "<h2>" + i18n("Events: ") + "</h2>\n";
int daysToShow = KOPrefs::instance()->mWhatsNextDays ;
bool itemAdded = false;
for ( iii = 0; iii < daysToShow; ++iii ) {
QString date;
itemAdded = false;
events = calendar()->events( mEventDate, true );
if ( iii == 0 ) { // today !!!
todo = todos.first();
while(todo) {
if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) {
if ( ! itemAdded ) {
appendDay ( iii, mEventDate );
//itemAdded = true;
} //bool reply=false, bool notRed = true, bool appendTable = false);
appendEvent(todo, false, false, !itemAdded );
itemAdded = true;
}
todo = todos.next();
}
}
@@ -433,49 +439,49 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate )
#ifdef DESKTOP_VERSION
else if ( i == 1 ) {
date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ;
}
else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>";
#else
else if ( i == 1 ) {
date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ;
}
else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>";
#endif
mText += "<h2>" + date + "</h2>\n";
//mText += "<big><big><strong>" + date + "</strong></big></big>\n";
mText += "<table>\n";
}
}
void KOWhatsNextView::showDates(const QDate &, const QDate &)
{
updateView();
}
-void KOWhatsNextView::showEvents(QPtrList<Event>)
+void KOWhatsNextView::showEvents(Q3PtrList<Event>)
{
}
void KOWhatsNextView::changeEventDisplay(Event *, int action)
{
switch(action) {
case KOGlobals::EVENTADDED:
updateView();
break;
case KOGlobals::EVENTEDITED:
updateView();
break;
case KOGlobals::EVENTDELETED:
updateView();
break;
default:
updateView();
kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl;
}
}
bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable )
{
if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") )
@@ -720,49 +726,49 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
mText += i18n("-no summary-");
mText += "</a>";
if ( ((Todo*)ev)->hasDueDate () ) {
QString year = "";
int ye = ((Todo*)ev)->dtDue().date().year();
if ( QDateTime::currentDateTime().date().year() != ye )
year = QString::number( ye );
QString dfs = KGlobal::locale()->dateFormatShort();
KGlobal::locale()->setDateFormatShort("%d.%b");
mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>";
KGlobal::locale()->setDateFormatShort(dfs);
}
if ( KOPrefs::instance()->mWNViewShowLocation )
if ( !ev->location().isEmpty() )
mText += " ("+ev->location() +")";
if ( !isSub ) {
if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
mText += " ["+ev->relatedTo()->summary() +"]";
mText += "</p>\n";
}
else {
ind += "-";
mText += "</li>\n";
}
- QPtrList<Incidence> Relations = ev->relations();
+ Q3PtrList<Incidence> Relations = ev->relations();
Incidence *to;
for (to=Relations.first();to;to=Relations.next()) {
if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio )
appendTodo( to, ind , true );
}
return true;
}
/*
void KOWhatsNextView::createEventViewer()
{
if (!mEventViewer) {
mEventViewer = new KOEventViewerDialog(this);
}
}
*/
void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v )
{
mEventViewer = v;
}
// TODO: Create this function in CalendarView and remove it from here
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h
index 93574ef..49fc448 100644
--- a/korganizer/kowhatsnextview.h
+++ b/korganizer/kowhatsnextview.h
@@ -1,102 +1,108 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KOWHATSNEXTVIEW_H
#define KOWHATSNEXTVIEW_H
-#include <qtextbrowser.h>
+#include <q3textbrowser.h>
#include <qtimer.h>
+//Added by qt3to4:
+#include <QShowEvent>
+#include <QHideEvent>
+#include <QLabel>
+#include <Q3ValueList>
+#include <Q3PtrList>
#include <korganizer/baseview.h>
-class QListView;
+class Q3ListView;
class QLabel;
class KOEventViewerDialog;
#include <qpainter.h>
#include <qwidget.h>
-class WhatsNextTextBrowser : public QTextBrowser {
+class WhatsNextTextBrowser : public Q3TextBrowser {
Q_OBJECT
public:
- WhatsNextTextBrowser(QWidget *parent) : QTextBrowser(parent) {};
+ WhatsNextTextBrowser(QWidget *parent) : Q3TextBrowser(parent) {};
void setSource(const QString &);
void printMe();
signals:
void showIncidence(const QString &uid);
};
/**
This class provides a view of the next events and todos
*/
class KOWhatsNextView : public KOrg::BaseView
{
Q_OBJECT
public:
KOWhatsNextView(Calendar *calendar, QWidget *parent = 0,
const char *name = 0);
~KOWhatsNextView();
virtual int maxDatesHint();
virtual int currentDateCount();
void setEventViewer(KOEventViewerDialog* v );
- virtual QPtrList<Incidence> selectedIncidences();
+ virtual Q3PtrList<Incidence> selectedIncidences();
void clearList();
DateList selectedDates()
{DateList q;
return q;}
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
public slots:
virtual void updateView();
void printMe();
virtual void showDates(const QDate &start, const QDate &end);
- virtual void showEvents(QPtrList<Event> eventList);
+ virtual void showEvents(Q3PtrList<Event> eventList);
void updateConfig();
void changeEventDisplay(Event *, int);
protected:
bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false);
bool appendTodo(Incidence *, QString ind = "", bool isSub = false );
void appendDay( int i, QDate date );
QDate mEventDate;
virtual void showEvent ( QShowEvent * );
virtual void hideEvent ( QHideEvent * );
private slots:
void showIncidence(const QString &);
void restartTimer();
private:
int mCurrentMaxPrio;
//void createEventViewer();
QTimer* mTimer;
WhatsNextTextBrowser *mView;
QString mText;
// QLabel *mDateLabel;
KOEventViewerDialog *mEventViewer;
- QValueList<Incidence *> mTodos;
+ Q3ValueList<Incidence *> mTodos;
};
#endif
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp
index df9b2fc..e2ae4a6 100644
--- a/korganizer/ktimeedit.cpp
+++ b/korganizer/ktimeedit.cpp
@@ -1,96 +1,99 @@
/*
This file is part of KOrganizer.
Copyright (c) 1999 Preston Brown, Ian Dawes
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qkeycode.h>
+#include <qnamespace.h>
#include <qcombobox.h>
#include <qdatetime.h>
#include <qlineedit.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QKeyEvent>
#include <kmessagebox.h>
#include <kglobal.h>
#include <kdebug.h>
#include <klocale.h>
#include <kpimglobalprefs.h>
#include "ktimeedit.h"
#include "koprefs.h"
#include <qvalidator.h>
// Validator for a time value with only hours and minutes (no seconds)
// Mostly locale aware. Author: David Faure <faure@kde.org>
// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox.
// Difficult to get all in one...
// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help.
KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name)
- : QComboBox(TRUE, parent, name)
+ : Q3ComboBox(TRUE, parent, name)
{
setInsertionPolicy(NoInsertion);
mFlagKeyPressed = false;
if ( QApplication::desktop()->height() <= 480 ) {
setSizeLimit ( 6 );
} else {
setSizeLimit ( 12 );
}
mTime = qt;
// mNoTimeString = i18n("No Time");
// insertItem( mNoTimeString );
// Fill combo box with selection of times in localized format.
QTime timeEntry(0,0,0);
do {
insertItem(KGlobal::locale()->formatTime(timeEntry));
timeEntry = timeEntry.addSecs(60*15);
- } while (!timeEntry.isNull());
+ } while ( !( timeEntry.hour() || timeEntry.minute() ) );
// Add end of day.
insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) );
updateText();
- setFocusPolicy(QWidget::StrongFocus);
+ setFocusPolicy(Qt::StrongFocus);
connect(this, SIGNAL(activated(int)), this, SLOT(activ(int)));
connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int)));
connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText()));
QFontMetrics fm ( font() );
QString timeString = "24:00";
if ( KPimGlobalPrefs::instance()->mPreferredTime == 1 )
timeString = "02:00pm";
int addSpace = 32;
if ( QApplication::desktop()->width() > 320 )
timeString += ":00";
setFixedWidth(fm.width( timeString ) + 32 );
// Highlight Background and Textcolor change from default
QPalette palette = QWidget::palette();
unsigned char red, green, blue;
red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10;
green = palette.color( QPalette::Normal , QColorGroup::Background ).green() - 10;
blue = palette.color( QPalette::Normal , QColorGroup::Background ).blue() - 10;
palette.setColor( QColorGroup::Highlight, QColor(red,green,blue) );
palette.setColor( QColorGroup::HighlightedText, palette.color( QPalette::Normal , QColorGroup::Foreground ) );
setPalette( palette );
}
@@ -187,272 +190,272 @@ void KOTimeEdit::keyReleaseEvent(QKeyEvent *e)
}
void KOTimeEdit::setSelect( int from, int to )
{
if ( KOPrefs::instance()->mHightlightDateTimeEdit)
lineEdit()->setSelection( from , to );
}
void KOTimeEdit::keyPressEvent(QKeyEvent *e)
{
qApp->processEvents();
bool hour12Format = ( KPimGlobalPrefs::instance()->mPreferredTime == 1 );
int maxpos = hour12Format?7:5;
if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
e->ignore();
// qDebug(" ignore %d",e->isAutoRepeat() );
return;
}
if (! e->isAutoRepeat() ) {
mFlagKeyPressed = true;
}
// Tap -> Focus Next Widget
- if ( e->key() == Key_Tab ) {
- QComboBox::keyPressEvent(e);
+ if ( e->key() == Qt::Key_Tab ) {
+ Q3ComboBox::keyPressEvent(e);
return;
}
// save Text from QLineEdit and CursorPosition
QString text = lineEdit()->text();
int cpos = lineEdit()->cursorPosition();
// qDebug("cpos %d ", cpos);
// Switch for arrows, backspace and escape
switch(e->key()) {
- case Key_Escape:
+ case Qt::Key_Escape:
lineEdit()->deselect();
- case Key_Tab:
- QComboBox::keyPressEvent(e);
+ case Qt::Key_Tab:
+ Q3ComboBox::keyPressEvent(e);
break;
- case Key_Up:
+ case Qt::Key_Up:
if ( e->state () == Qt::ControlButton ) {
addTime(QTime(0,15,0), false );
lineEdit()->setCursorPosition(3);
setSelect( 3 , 2 );
}
else
if ( e->state () == Qt::ShiftButton ) {
addTime(QTime(1,0,0), false );
lineEdit()->setCursorPosition(0);
setSelect( 0 , 2 );
}
else
// switch time up, cursor location depend
switch (cpos) {
case 7:
case 6:
case 5:
if(!hour12Format) {
lineEdit()->setCursorPosition(cpos = 4);
} else {
addTime(QTime(12,0,0), false );
setSelect ( 5 , 2 );
break;
}
case 4:
addTime(QTime(0,1,0), false );
setSelect ( cpos , 1 );
break;
case 3:
addTime(QTime(0,10,0), false );
setSelect ( cpos , 1 );
break;
case 2:
lineEdit()->setCursorPosition(--cpos);
case 1:
case 0:
addTime(QTime(1,0,0), false );
setSelect ( 0, 2 );
break;
}
break;
- case Key_Down:
+ case Qt::Key_Down:
if ( e->state () == Qt::ControlButton ) {
subTime(QTime(0,15,0), false );
lineEdit()->setCursorPosition(3);
setSelect( 3 , 2 );
}
else
if ( e->state () == Qt::ShiftButton ) {
subTime(QTime(1,0,0), false );
lineEdit()->setCursorPosition(0);
setSelect( 0 , 2 );
}
else
// switch time down, cursor location depend
switch (cpos) {
case 7:
case 6:
case 5:
if(!hour12Format) {
lineEdit()->setCursorPosition(cpos = 4);
} else {
subTime(QTime(12,0,0), false );
setSelect ( 5 , 2 );
break;
}
case 4:
subTime(QTime(0,1,0), false );
setSelect ( cpos , 1 );
break;
case 3:
subTime(QTime(0,10,0), false );
setSelect ( cpos , 1 );
break;
case 2:
lineEdit()->setCursorPosition(--cpos);
case 1:
case 0:
subTime(QTime(1,0,0), false );
setSelect ( 0 , 2 );
break;
}
break;
// set cursor to correct place
- case Key_Left:
+ case Qt::Key_Left:
if ( cpos == 3 )
--cpos;
if ( cpos > 0) {
lineEdit()->setCursorPosition(--cpos);
setSelect ( cpos , 1 );
}
else
setSelect ( 0 , 1 );
break;
// set cursor to correct place
- case Key_Right:
+ case Qt::Key_Right:
if ( cpos == 1 )
++cpos;
if ( cpos < maxpos ) {
lineEdit()->setCursorPosition(++cpos);
setSelect ( cpos , 1 );
}
break;
// rest
- case Key_Prior:
+ case Qt::Key_Prior:
subTime(QTime(1,0,0));
break;
- case Key_Next:
+ case Qt::Key_Next:
addTime(QTime(1,0,0));
break;
- case Key_Backspace:
+ case Qt::Key_Backspace:
if ( cpos > 0) {
if ( cpos == 3 )
--cpos;
if ( cpos > 5)
cpos = 5;
- text.at( cpos-1 ) = '0';
+ text[ cpos-1 ] = '0';
lineEdit()->setText( text );
lineEdit()->setCursorPosition(--cpos);
setSelect ( cpos , 1 );
changedText();
}
break;
} // switch arrows
// if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos
- if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) {
+ if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Qt::Key_Left ) {
lineEdit()->deselect();
cpos = 0;
lineEdit()->setCursorPosition(cpos);
setSelect(cpos , 1);
}
if ( cpos == 2 ) {
lineEdit()->setCursorPosition(++cpos);
}
// num keys when cursorPos preEnd
if ( cpos < 5 ) {
// switch another keys
switch(e->key()) {
- case Key_Delete:
- text.at( cpos ) = '0';
+ case Qt::Key_Delete:
+ text[ cpos ] = '0';
lineEdit()->setText( text );
lineEdit()->setCursorPosition(cpos);
setSelect ( cpos , 1 );
changedText();
break;
- case Key_9:
- case Key_8:
- case Key_7:
- case Key_6:
+ case Qt::Key_9:
+ case Qt::Key_8:
+ case Qt::Key_7:
+ case Qt::Key_6:
if ( !(cpos == 1 || cpos == 4) )
return;
if ( cpos == 1 && text.at( 0 ) > '1')
- text.at( 0 ) = '1';
- case Key_5:
- case Key_4:
- case Key_3:
+ text[ 0 ] = '1';
+ case Qt::Key_5:
+ case Qt::Key_4:
+ case Qt::Key_3:
if ( cpos < 1 )
return;
if ( hour12Format && cpos == 1 )
return;
- case Key_2:
+ case Qt::Key_2:
if ( hour12Format && cpos == 0 )
return;
if ( cpos == 0 && text.at( 1 ) > '3')
- text.at( 1 ) = '3';
- case Key_1:
- case Key_0:
+ text[ 1 ] = '3';
+ case Qt::Key_1:
+ case Qt::Key_0:
if ( hour12Format ) {
- if ( e->key() == Key_0 && cpos == 1 && text.at( 0 ) == '0' )
+ if ( e->key() == Qt::Key_0 && cpos == 1 && text.at( 0 ) == '0' )
return;
- if ( e->key() == Key_0 && cpos == 0 && text.at( 1 ) == '0' )
- text.at( 1 ) = '1';
+ if ( e->key() == Qt::Key_0 && cpos == 0 && text.at( 1 ) == '0' )
+ text[ 1 ] = '1';
}
- text.at( cpos ) = QChar ( e->key() );
+ text[ cpos ] = QChar ( e->key() );
lineEdit()->setText( text );
if ( cpos == 1 )
++cpos;
if ( cpos < 5)
lineEdit()->setCursorPosition(++cpos);
setSelect( cpos , 1 );
changedText();
break;
- case Key_Home:
+ case Qt::Key_Home:
lineEdit()->setCursorPosition(0);
setSelect( cpos , 1 );
break;
- case Key_End:
+ case Qt::Key_End:
lineEdit()->setCursorPosition(5);
lineEdit()->deselect();
break;
default:
// QComboBox::keyPressEvent(e);
break;
} // switch num keys
} else if ( cpos == 5 ) {// if cpos < 5
if ( hour12Format ) {
- if ( e->key() == Key_A ) {
- text.at( 5 ) = 'a';
+ if ( e->key() == Qt::Key_A ) {
+ text[ 5 ] = 'a';
lineEdit()->setText( text );
lineEdit()->setCursorPosition(5);
- } else if ( e->key() == Key_P ) {
- text.at( 5 ) = 'p';
+ } else if ( e->key() == Qt::Key_P ) {
+ text[ 5 ] = 'p';
lineEdit()->setText( text );
lineEdit()->setCursorPosition(5);
}
}
}
}
void KOTimeEdit::updateText()
{
listBox()->blockSignals( true );
blockSignals( true );
QString s = KGlobal::locale()->formatTime(mTime);
// Set the text but without emitting signals, nor losing the cursor position
QLineEdit *line = lineEdit();
line->blockSignals(true);
int pos = line->cursorPosition();
setCurrentItem((mTime.hour()*4)+(mTime.minute()/15));
line->setText(s);
line->setCursorPosition(pos);
line->blockSignals(false);
blockSignals( false );
diff --git a/korganizer/ktimeedit.h b/korganizer/ktimeedit.h
index b3d842d..1c7d18d 100644
--- a/korganizer/ktimeedit.h
+++ b/korganizer/ktimeedit.h
@@ -3,63 +3,66 @@
Copyright (c) 1999 Preston Brown, Ian Dawes
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef _KTIMEEDIT_H
#define _KTIMEEDIT_H
#include <qevent.h>
-#include <qkeycode.h>
+#include <qnamespace.h>
#include <qstring.h>
#include <qdatetime.h>
#include <qcombobox.h>
+#include <Q3ComboBox>
+//Added by qt3to4:
+#include <QKeyEvent>
#include <kapplication.h>
/**
This is a class that provides an easy, user friendly way to edit times.
up/down/ increase or decrease time, respectively.
@short Provides a way to edit times in a user-friendly manner.
@author Preston Brown, Ian Dawes
*/
-class KOTimeEdit : public QComboBox
+class KOTimeEdit : public Q3ComboBox
{
Q_OBJECT
public:
/** constructs a new time edit. */
KOTimeEdit(QWidget *parent=0, QTime qt=QTime(12,0), const char *name=0);
virtual ~KOTimeEdit();
/**
Returns, if a time is selected. Can not return false anymore....
*/
bool hasTime() const;
/** returns the time that is currently set in the timeLineEdit. */
QTime getTime() const;
/** returns the prefered size policy of the KOTimeEdit */
//QSizePolicy sizePolicy() const;
signals:
/**
Emitted every time the time displayed changes. "newt" is the new
time.
*/
diff --git a/korganizer/lineview.cpp b/korganizer/lineview.cpp
index e72e41c..012455e 100644
--- a/korganizer/lineview.cpp
+++ b/korganizer/lineview.cpp
@@ -1,34 +1,34 @@
#include <qpainter.h>
#include <kdebug.h>
#include "koprefs.h"
#include "lineview.h"
LineView::LineView( QWidget *parent, const char *name ) :
- QScrollView( parent, name )
+ Q3ScrollView( parent, name )
{
mPixelWidth = 1000;
mLines.setAutoDelete( true );
resizeContents( mPixelWidth, contentsHeight() );
viewport()->setBackgroundColor(KOPrefs::instance()->mAgendaBgColor);
}
LineView::~LineView()
{
}
int LineView::pixelWidth()
{
return mPixelWidth;
}
void LineView::addLine( int start, int end )
{
int count = mLines.count();
if( start < 0 ) start = 0;
diff --git a/korganizer/lineview.h b/korganizer/lineview.h
index aa34dbc..52ae9cf 100644
--- a/korganizer/lineview.h
+++ b/korganizer/lineview.h
@@ -1,36 +1,36 @@
#ifndef LINEVIEW_H
#define LINEVIEW_H
-#include <qscrollview.h>
-#include <qptrlist.h>
+#include <q3scrollview.h>
+#include <q3ptrlist.h>
-class LineView : public QScrollView
+class LineView : public Q3ScrollView
{
Q_OBJECT
public:
LineView( QWidget *parent = 0, const char *name = 0 );
virtual ~LineView();
int pixelWidth();
void addLine( int start, int end );
void clear();
protected:
void drawContents(QPainter* p, int cx, int cy, int cw, int ch);
private:
struct Line {
Line( int c, int s, int e ) : column( c ), start( s ), end( e ) {}
int column;
int start;
int end;
};
- QPtrList<Line> mLines;
+ Q3PtrList<Line> mLines;
int mPixelWidth;
};
#endif
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 4a0e24f..211fde6 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,58 +1,58 @@
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#include <qcopchannel_qws.h>
#include <qpe/global.h>
+//Added by qt3to4:
+#include <Q3CString>
#include <stdlib.h>
#else
#include <qapplication.h>
#include <qstring.h>
#include <qwindowsstyle.h>
-#include <qplatinumstyle.h>
-#include <qsgistyle.h>
#include <stdlib.h>
#endif
#include <qtextcodec.h>
#include <qdir.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <stdio.h>
#include "mainwindow.h"
#include <libkdepim/kpimglobalprefs.h>
void dumpMissing();
int main( int argc, char **argv )
{
+ if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi");
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
#else
QApplication a( argc, argv );
- QApplication::setStyle( new QPlatinumStyle ());
#ifdef _WIN32_
QString hdir ( getenv( "HOME") );
if ( hdir.isEmpty() ) {
QString hd ("C:/" );
//QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
if ( QDir::homeDirPath().lower() == hd.lower() ) {
_putenv( "HOME=C:");
//QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
}
} else {
QDir app_dir;
if ( !app_dir.exists(hdir) )
app_dir.mkdir (hdir);
}
#endif
#endif
bool exitHelp = false;
if ( argc > 1 ) {
QString command = argv[1];
if ( command == "-help" ){
printf("KO/Pi command line commands:\n");
printf(" no command: Start KO/Pi in usual way\n");
printf(" -help: This output\n");
printf("Next Option: Open or Show after start:\n");
@@ -68,50 +68,50 @@ int main( int argc, char **argv )
printf(" -showWNext: What's Next view\n");
printf(" -showNextXView: Next X View\n");
printf(" -new[Y] and -show[X] may be used togehther\n");
printf(" KO/Pi is exiting now. Bye!\n");
exitHelp = true;
}
}
if ( ! exitHelp ) {
KGlobal::setAppName( "korganizer" );
QString fileName ;
#ifndef DESKTOP_VERSION
fileName = getenv("QPEDIR");
KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
#else
fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
KPimGlobalPrefs::instance()->setGlobalConfig();
MainWindow m;
#ifndef DESKTOP_VERSION
- QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& )));
+ QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&m, SLOT(receiveStart( const Q3CString&, const QByteArray& )));
a.showMainWidget(&m );
#else
a.setMainWidget(&m );
m.show();
//m.resize( 800, 600 );
//QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
#endif
if ( argc > 1 ) {
- QCString command = argv[1];
+ Q3CString command = argv[1];
if ( argc > 2 )
command += argv[2];
m.recieve(command, QByteArray() );
}
#ifndef DESKTOP_VERSION
// QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
#endif
a.exec();
dumpMissing();
KPimGlobalPrefs::instance()->writeConfig();
}
qDebug("KO: Bye! ");
}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 69ccde1..2004939 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,56 +1,66 @@
#include <stdlib.h>
#include <qaction.h>
-#include <qpopupmenu.h>
+#include <Q3Action>
+#include <q3popupmenu.h>
#include <qpainter.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
#include <qpushbutton.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qtextcodec.h>
#include <qfile.h>
#include <qdir.h>
-#include <qapp.h>
+#include <qapplication.h>
#include <qfileinfo.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <qcheckbox.h>
#include <qmap.h>
-#include <qwmatrix.h>
-#include <qtextbrowser.h>
-#include <qtextstream.h>
+#include <qmatrix.h>
+#include <q3textbrowser.h>
+#include <q3textstream.h>
#ifndef DESKTOP_VERSION
#include <qpe/global.h>
#include <qpe/qpetoolbar.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qtopia/alarmserver.h>
#include <qtopia/qcopenvelope_qws.h>
//#include <unistd.h> // for sleep
#else
-#include <qtoolbar.h>
+#include <q3toolbar.h>
#include <qapplication.h>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QPixmap>
+#include <QCloseEvent>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
+#include <QHideEvent>
+#include <Q3CString>
+#include <Q3PtrList>
//#include <resource.h>
#endif
#include <libkcal/calendarlocal.h>
#include <libkcal/todo.h>
#include <libkcal/phoneformat.h>
#include <libkdepim/ksyncprofile.h>
#include <libkdepim/phoneaccess.h>
#include <libkcal/kincidenceformatter.h>
#include <libkdepim/kpimglobalprefs.h>
#include "calendarview.h"
#include "koviewmanager.h"
#include "datenavigator.h"
#include "koagendaview.h"
#include "kojournalview.h"
#include "koagenda.h"
#include "kodialogmanager.h"
#include "kdialogbase.h"
#include "kapplication.h"
#include "kofilterview.h"
#include "kstandarddirs.h"
#include "koprefs.h"
#include "kfiledialog.h"
@@ -59,103 +69,103 @@
#include "ktoolbar.h"
#include "klocale.h"
#include "kconfig.h"
#include "externalapphandler.h"
#include <kglobalsettings.h>
using namespace KCal;
#ifndef _WIN32_
#include <unistd.h>
#else
#ifdef _OL_IMPORT_
#include "koimportoldialog.h"
#endif
#endif
#include "mainwindow.h"
class KOex2phonePrefs : public QDialog
{
public:
KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("Export to phone options") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
QLabel *lab;
lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
- lab->setAlignment (AlignHCenter );
- QHBox* temphb;
- temphb = new QHBox( this );
+ lab->setAlignment (Qt::AlignHCenter );
+ Q3HBox* temphb;
+ temphb = new Q3HBox( this );
new QLabel( i18n("I/O device: "), temphb );
mPhoneDevice = new QLineEdit( temphb);
lay->addWidget( temphb );
- temphb = new QHBox( this );
+ temphb = new Q3HBox( this );
new QLabel( i18n("Connection: "), temphb );
mPhoneConnection = new QLineEdit( temphb);
lay->addWidget( temphb );
- temphb = new QHBox( this );
+ temphb = new Q3HBox( this );
new QLabel( i18n("Model(opt.): "), temphb );
mPhoneModel = new QLineEdit( temphb);
lay->addWidget( temphb );
mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
mWriteBackFuture->setChecked( true );
lay->addWidget( mWriteBackFuture );
- temphb = new QHBox( this );
+ temphb = new Q3HBox( this );
new QLabel( i18n("Max. weeks in future: ") , temphb );
mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
mWriteBackFutureWeeks->setValue( 8 );
lay->addWidget( temphb );
lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
- lab->setAlignment (AlignHCenter );
+ lab->setAlignment (Qt::AlignHCenter );
QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
lay->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
resize( 220, 240 );
qApp->processEvents();
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
move( (dw-width())/2, (dh - height() )/2 );
}
public:
QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
QCheckBox* mWriteBackFuture;
QSpinBox* mWriteBackFutureWeeks;
};
QPixmap* sgListViewCompletedPix[6];
QPixmap* sgListViewJournalPix;
int globalFlagBlockStartup;
MainWindow::MainWindow( QWidget *parent, const char *name ) :
- QMainWindow( parent, name )
+ Q3MainWindow( parent, name )
{
sgListViewCompletedPix[5] = &listviewPix;
sgListViewCompletedPix[0] = &listviewPix0;
sgListViewCompletedPix[1] = &listviewPix20;
sgListViewCompletedPix[2] = &listviewPix40;
sgListViewCompletedPix[3] = &listviewPix60;
sgListViewCompletedPix[4] = &listviewPix80;
//int size = 12;
{
sgListViewCompletedPix[5]->resize( 11, 11 );
sgListViewCompletedPix[5]->fill( Qt::white );
QPainter p ( sgListViewCompletedPix[5] );
p.drawRect( 0,0,11,11);
p.drawLine ( 2, 5, 4 , 7 ) ;
p.drawLine ( 4 , 7 , 8, 3) ;
int iii = 0;
for ( iii = 0; iii < 5; ++iii ) {
sgListViewCompletedPix[iii]->resize( 11, 11 );
sgListViewCompletedPix[iii]->fill( Qt::white );
QPainter p ( sgListViewCompletedPix[iii] );
p.drawRect( 0,0,11,11);
if ( iii )
p.fillRect( 1,1,iii*2,9,Qt::gray );
}
@@ -164,145 +174,145 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
sgListViewJournalPix->fill( Qt::white );
{
QPainter p ( sgListViewJournalPix );
p.drawRect( 0,0,11,11);
p.drawLine( 2,3,5,3);
p.drawLine( 2,5,8,5);
p.drawLine( 2,7,6,7);
}
}
mAutoSaveDisabled = false;
mClosed = false;
//QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
QString confFile = locateLocal("config","korganizerrc");
QFileInfo finf ( confFile );
bool showWarning = !finf.exists();
setIcon(SmallIcon( "ko24" ) );
mBlockAtStartup = true;
mFlagKeyPressed = false;
setCaption("KO/Pi");
KOPrefs *p = KOPrefs::instance();
//KPimGlobalPrefs::instance()->setGlobalConfig();
p->mCurrentDisplayedView = 0;
if ( p->mHourSize > 22 )
p->mHourSize = 22;
- QMainWindow::ToolBarDock tbd;
+ Qt::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
- tbd = Bottom;
+ tbd = Qt::Bottom;
else
- tbd = Top;
+ tbd = Qt::Top;
}
else {
if ( p->mToolBarUp )
- tbd = Right;
+ tbd = Qt::Right;
else
- tbd = Left;
+ tbd = Qt::Left;
}
if ( KOPrefs::instance()->mUseAppColors )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
globalFlagBlockStartup = 1;
iconToolBar = new QPEToolBar( this );
addToolBar (iconToolBar , tbd );
#ifdef DESKTOP_VERSION
if ( KOPrefs::instance()->mShowIconFilter )
#else
if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) )
#endif
{
if ( p->mToolBarHorF ) {
if ( p->mToolBarUpF )
- tbd = Bottom;
+ tbd = Qt::Bottom;
else
- tbd = Top;
+ tbd = Qt::Top;
}
else {
if ( p->mToolBarUpF )
- tbd = Right;
+ tbd = Qt::Right;
else
- tbd = Left;
+ tbd = Qt::Left;
}
filterToolBar = new QPEToolBar ( this );
filterMenubar = new KMenuBar( 0 );
QFontMetrics fm ( filterMenubar->font() );
#ifndef DESKTOP_VERSION
filterToolBar->setFocusPolicy( NoFocus );
filterMenubar->setFocusPolicy( NoFocus );
#endif
- filterPopupMenu = new QPopupMenu( this );
+ filterPopupMenu = new Q3PopupMenu( this );
filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
QString addTest = "A";
filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
#ifdef DESKTOP_VERSION
addTest = "AAAAAABBBCCCx";
#else
addTest = "AAAAAx";
#endif
filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
addToolBar (filterToolBar , tbd );
connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
filterToolBar->hide();
} else {
filterToolBar = 0;
filterMenubar = 0;
filterPopupMenu = 0;
}
if ( p->mShowIconOnetoolbar ) {
viewToolBar = iconToolBar ;
navigatorToolBar = iconToolBar ;
} else {
#ifndef DESKTOP_VERSION
setToolBarsMovable( false );
#endif
if ( p->mToolBarHorV ) {
if ( p->mToolBarUpV )
- tbd = Bottom;
+ tbd = Qt::Bottom;
else
- tbd = Top;
+ tbd = Qt::Top;
}
else {
if ( p->mToolBarUpV )
- tbd = Right;
+ tbd = Qt::Right;
else
- tbd = Left;
+ tbd = Qt::Left;
}
viewToolBar = new QPEToolBar( this );
addToolBar (viewToolBar , tbd );
if ( p->mToolBarHorN ) {
if ( p->mToolBarUpN )
- tbd = Bottom;
+ tbd = Qt::Bottom;
else
- tbd = Top;
+ tbd = Qt::Top;
}
else {
if ( p->mToolBarUpN )
- tbd = Right;
+ tbd = Qt::Right;
else
- tbd = Left;
+ tbd = Qt::Left;
}
navigatorToolBar = new QPEToolBar( this );
addToolBar (navigatorToolBar , tbd );
}
mCalendarModifiedFlag = false;
// QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
//splash->setAlignment ( AlignCenter );
//setCentralWidget( splash );
#ifndef DESKTOP_VERSION
//showMaximized();
#endif
//qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
setDefaultPreferences();
mCalendar = new CalendarLocal();
mView = new CalendarView( mCalendar, this,"mCalendar " );
setCentralWidget( mView );
//mView->hide();
//mView->resize(splash->size() );
initActions();
mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
@@ -419,51 +429,51 @@ MainWindow::~MainWindow()
delete infrared;
#endif
}
void MainWindow::loadDataAfterStart()
{
qDebug("KO: Start loading files..." );
QTime neededSaveTime = QDateTime::currentDateTime().time();
mView->loadCalendars();
int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
qDebug("KO: Calendar loading time: %d ms",msNeeded );
//QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
mView->setModified( false );
mBlockAtStartup = false;
mView->setModified( false );
connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
processIncidenceSelection( 0 );
connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
SLOT( processIncidenceSelection( Incidence * ) ) );
connect( mView, SIGNAL( modifiedChanged( bool ) ),
SLOT( slotModifiedChanged( bool ) ) );
#ifndef DESKTOP_VERSION
- connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
- connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& )));
- disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& )));
+ connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & )));
+ connect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(recieve( const Q3CString&, const QByteArray& )));
+ disconnect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(receiveStart( const Q3CString&, const QByteArray& )));
if ( !mCStringMess.isEmpty() )
recieve( mCStringMess, mByteData );
#endif
QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
}
void MainWindow::slotResetFocus()
{
//qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar);
mFocusLoop = 3;
QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
}
void MainWindow::slotResetFocusLoop()
{
--mFocusLoop;
QWidget* fw = mView->viewManager()->currentView();
if ( fw ) {
//qDebug("loop ");
fw->setFocus();
if ( qApp->focusWidget() != fw && mFocusLoop > 0 )
QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
}
}
@@ -488,49 +498,49 @@ void MainWindow::disableBR(bool b)
}
bool MainWindow::beamReceiveEnabled()
{
#ifndef DESKTOP_VERSION
return ( infrared != 0 );
#endif
return false;
}
void MainWindow::toggleBeamReceive()
{
if ( mBRdisabled )
return;
#ifndef DESKTOP_VERSION
if ( infrared ) {
qDebug("KO: Disable BeamReceive ");
delete infrared;
infrared = 0;
brAction->setOn(false);
return;
}
qDebug("KO: Enable BeamReceive ");
brAction->setOn(true);
infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
- QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
+ QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(recieve( const Q3CString&, const QByteArray& )));
#endif
}
void MainWindow::showMaximized ()
{
#ifndef DESKTOP_VERSION
if ( ! globalFlagBlockStartup )
if ( mClosed )
mView->goToday();
#endif
QWidget::showMaximized () ;
mClosed = false;
}
bool MainWindow::askForQuitOnSaveError()
{
bool retval = false;
switch( QMessageBox::information( this, "KO/Pi",
i18n("Error saving data") + "!\n" +
i18n("You can save all data\nto another file via\nFile->Export->Export All Data") + "!\n" +
i18n("Do you really want\nto close KO/Pi?"),
i18n(" Yes, close "), i18n("No"),
0, 1 ) ) {
case 0:
retval = true;
@@ -579,64 +589,64 @@ void MainWindow::closeEvent( QCloseEvent* ce )
i18n("Close"), i18n("No"),
0, 0 ) ) {
case 0:
if ( checkAutosave() ) {
saveOnClose();
if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
ce->ignore();
return;
}
}
mClosed = true;
ce->accept();
break;
case 1:
ce->ignore();
break;
case 2:
default:
break;
}
}
-void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data )
+void MainWindow::receiveStart( const Q3CString& cmsg, const QByteArray& data )
{
qDebug("KO: QCOP start message received: %s ", cmsg.data() );
mCStringMess = cmsg;
mByteData = data;
}
-void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
+void MainWindow::recieve( const Q3CString& cmsg, const QByteArray& data )
{
- QDataStream stream( data, IO_ReadOnly );
+ QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
// QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
//QString datamess;
//qDebug("message ");
qDebug("KO: QCOP message received: %s ", cmsg.data() );
if ( cmsg == "setDocument(QString)" ) {
- QDataStream stream( data, IO_ReadOnly );
+ QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
QString fileName;
stream >> fileName;
//qDebug("filename %s ", fileName.latin1());
showMaximized();
raise();
KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
mSyncManager->slotSyncMenu( 1002 );
return;
}
if ( cmsg == "-writeFile" ) {
// I made from the "-writeFile" an "-writeAlarm"
mView->viewManager()->showWhatsNextView();
mCalendar->checkAlarmForIncidence( 0, true);
showMaximized();
raise();
return;
}
if ( cmsg == "-writeFileSilent" ) {
// I made from the "-writeFile" an "-writeAlarm"
// mView->viewManager()->showWhatsNextView();
mCalendar->checkAlarmForIncidence( 0, true);
//showMaximized();
@@ -723,714 +733,714 @@ void MainWindow::startMultiSync()
}
mSyncManager->multiSync( false );
#ifndef DESKTOP_VERSION
QCopEnvelope e("QPE/Application/kapi", "doRingSync");
#endif
}
QPixmap MainWindow::loadPixmap( QString name )
{
return SmallIcon( name );
}
void MainWindow::setUsesBigPixmaps ( bool b )
{
qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
if ( b )
qDebug("KO: BigPixmaps are not supported ");
}
void MainWindow::initActions()
{
//KOPrefs::instance()->mShowFullMenu
iconToolBar->clear();
KOPrefs *p = KOPrefs::instance();
//QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
- QPopupMenu *viewMenu = new QPopupMenu( this );
- QPopupMenu *actionMenu = new QPopupMenu( this );
- mCurrentItemMenu = new QPopupMenu ( this );
- QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
- QPopupMenu *importMenu = new QPopupMenu( this );
- QPopupMenu *importMenu_X = new QPopupMenu( this );
- QPopupMenu *exportMenu_X = new QPopupMenu( this );
- QPopupMenu *beamMenu_X = new QPopupMenu( this );
- selectFilterMenu = new QPopupMenu( this );
+ Q3PopupMenu *viewMenu = new Q3PopupMenu( this );
+ Q3PopupMenu *actionMenu = new Q3PopupMenu( this );
+ mCurrentItemMenu = new Q3PopupMenu ( this );
+ Q3PopupMenu *nextConflictMenu = new Q3PopupMenu ( this );
+ Q3PopupMenu *importMenu = new Q3PopupMenu( this );
+ Q3PopupMenu *importMenu_X = new Q3PopupMenu( this );
+ Q3PopupMenu *exportMenu_X = new Q3PopupMenu( this );
+ Q3PopupMenu *beamMenu_X = new Q3PopupMenu( this );
+ selectFilterMenu = new Q3PopupMenu( this );
selectFilterMenu->setCheckable( true );
- syncMenu = new QPopupMenu( this );
- configureAgendaMenu = new QPopupMenu( this );
- configureToolBarMenu = new QPopupMenu( this );
- QPopupMenu *helpMenu = new QPopupMenu( this );
- QIconSet icon;
+ syncMenu = new Q3PopupMenu( this );
+ configureAgendaMenu = new Q3PopupMenu( this );
+ configureToolBarMenu = new Q3PopupMenu( this );
+ Q3PopupMenu *helpMenu = new Q3PopupMenu( this );
+ QIcon icon;
int pixWid = 22, pixHei = 22;
QString pathString = "";
if ( !p->mToolBarMiniIcons ) {
if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
pathString += "icons16/";
pixWid = 18; pixHei = 16;
}
} else {
pathString += "iconsmini/";
pixWid = 18; pixHei = 16;
}
if ( KOPrefs::instance()->mShowFullMenu ) {
menuBar1 = new KMenuBar( this );//menuBar();
//setMenuBar( menuBar1 );
menuBar1->show();
menuBar1->insertItem( i18n("File"), importMenu );
menuBar1->insertItem( i18n("View"), viewMenu );
menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
menuBar1->insertItem( i18n("Action"), actionMenu );
#ifdef DESKTOP_VERSION
menuBar1->insertItem( i18n("Synchronize"), syncMenu );
menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
#else
menuBar1->insertItem( i18n("Sync"), syncMenu );
menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
#endif
//menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
menuBar1->insertItem( i18n("Help"), helpMenu );
} else {
menuBar1 = new KMenuBar( iconToolBar );
- QPopupMenu *menuBar = new QPopupMenu( this );
+ Q3PopupMenu *menuBar = new Q3PopupMenu( this );
icon = loadPixmap( pathString + "z_menu" );
menuBar1->insertItem( icon.pixmap(), menuBar);
//menuBar1->insertItem( i18n("ME"), menuBar);
menuBar->insertItem( i18n("File"), importMenu );
menuBar->insertItem( i18n("View"), viewMenu );
menuBar->insertItem( i18n("Edit"), mCurrentItemMenu );
menuBar->insertItem( i18n("Action"), actionMenu );
menuBar->insertItem( i18n("Synchronize"), syncMenu );
menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
menuBar->insertItem( i18n("Filter"),selectFilterMenu );
menuBar->insertItem( i18n("Help"), helpMenu );
//menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
menuBar1->setMaximumSize( menuBar1->sizeHint( ));
connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) );
}
connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
//connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
mWeekBgColor = iconToolBar->backgroundColor();
mWeekPixmap.resize( pixWid , pixHei );
mWeekPixmap.fill( mWeekBgColor );
icon = mWeekPixmap;
- mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
+ mWeekAction = new Q3Action( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
if ( p-> mShowIconWeekNum )
mWeekAction->addTo( iconToolBar );
mWeekFont = font();
int fontPoint = mWeekFont.pointSize();
QFontMetrics f( mWeekFont );
int fontWid = f.width( "30" );
while ( fontWid > pixWid ) {
--fontPoint;
mWeekFont.setPointSize( fontPoint );
QFontMetrics f( mWeekFont );
fontWid = f.width( "30" );
//qDebug("dec-- ");
}
connect( mWeekAction, SIGNAL( activated() ),
this, SLOT( weekAction() ) );
connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
if ( p->mShowIconFilterview ) {
icon = loadPixmap( pathString + "filter" );
- actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
+ actionFilterMenuTB = new Q3Action( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
connect( actionFilterMenuTB, SIGNAL( activated() ),
this, SLOT( fillFilterMenuTB() ) );
actionFilterMenuTB->addTo( iconToolBar );
- selectFilterMenuTB = new QPopupMenu( this );
+ selectFilterMenuTB = new Q3PopupMenu( this );
selectFilterMenuTB->setCheckable( true );
connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
}
//#endif
// ******************
- QAction *action;
+ Q3Action *action;
// QPopupMenu *configureMenu= new QPopupMenu( menuBar );
configureToolBarMenu->setCheckable( true );
configureAgendaMenu->setCheckable( true );
int iii ;
for ( iii = 1;iii<= 10 ;++iii ){
configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
}
//configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
connect( configureAgendaMenu, SIGNAL( aboutToShow()),
this, SLOT( showConfigureAgenda( ) ) );
icon = loadPixmap( pathString + "today" );
- QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
+ Q3Action* today_action = new Q3Action( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
today_action->addTo( actionMenu );
connect( today_action, SIGNAL( activated() ),
mView, SLOT( goToday() ) );
icon = loadPixmap( pathString + "picker" );
- QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
+ Q3Action* dPickerAction = new Q3Action( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
dPickerAction->addTo( actionMenu );
connect( dPickerAction, SIGNAL( activated() ),
mView, SLOT( showDatePicker() ) );
icon = loadPixmap( pathString + "search" );
- QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
+ Q3Action* search_action = new Q3Action( i18n("Search"), icon, i18n("Search..."), 0, this );
search_action->addTo( actionMenu );
connect( search_action, SIGNAL( activated() ),
mView->dialogManager(), SLOT( showSearchDialog() ) );
actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
- action = new QAction( "Undo Delete", i18n("All events"), 0, this );
+ action = new Q3Action( "Undo Delete", i18n("All events"), 0, this );
action->addTo( nextConflictMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( conflictAll() ) );
- action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
+ action = new Q3Action( "Undo Delete", i18n("Allday events"), 0, this );
action->addTo( nextConflictMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( conflictAllday() ) );
- action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
+ action = new Q3Action( "Undo Delete", i18n("Events with time"), 0, this );
action->addTo( nextConflictMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( conflictNotAll() ) );
actionMenu->insertSeparator();
icon = loadPixmap( pathString + "newevent" );
- QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
+ Q3Action* ne_action = new Q3Action( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
ne_action->addTo( mCurrentItemMenu );
connect( ne_action, SIGNAL( activated() ),
mView, SLOT( newEvent() ) );
icon = loadPixmap( pathString + "newtodo" );
- QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
+ Q3Action* nt_action = new Q3Action( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
nt_action->addTo( mCurrentItemMenu );
connect( nt_action, SIGNAL( activated() ),
mView, SLOT( newTodo() ) );
- mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
+ mNewSubTodoAction = new Q3Action( "new_subtodo", i18n("New Sub-Todo..."), 0,
this );
mNewSubTodoAction->addTo( mCurrentItemMenu );
connect( mNewSubTodoAction, SIGNAL( activated() ),
mView, SLOT( newSubTodo() ) );
mCurrentItemMenu->insertSeparator();
icon = loadPixmap( pathString + "newevent" );
configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
configureToolBarMenu->insertSeparator();
configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
configureToolBarMenu->insertSeparator();
configureToolBarMenu->insertItem(i18n("Week Number"), 400);
configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
icon = loadPixmap( pathString + "newtodo" );
configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
//actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
- mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
+ mShowAction = new Q3Action( "show_incidence", i18n("Show"), 0, this );
mShowAction->addTo( mCurrentItemMenu );
connect( mShowAction, SIGNAL( activated() ),
mView, SLOT( showIncidence() ) );
- mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
+ mEditAction = new Q3Action( "edit_incidence", i18n("Edit..."), 0, this );
mEditAction->addTo( mCurrentItemMenu );
connect( mEditAction, SIGNAL( activated() ),
mView, SLOT( editIncidence() ) );
- mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
+ mDeleteAction = new Q3Action( "delete_incidence", i18n("Delete..."), 0, this );
mDeleteAction->addTo( mCurrentItemMenu );
connect( mDeleteAction, SIGNAL( activated() ),
mView, SLOT( deleteIncidence() ) );
- mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
+ mCloneAction = new Q3Action( "clone_incidence", i18n("Clone..."), 0, this );
mCloneAction->addTo( mCurrentItemMenu );
connect( mCloneAction, SIGNAL( activated() ),
mView, SLOT( cloneIncidence() ) );
- mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
+ mMoveAction = new Q3Action( "Move_incidence", i18n("Move..."), 0, this );
mMoveAction->addTo( mCurrentItemMenu );
connect( mMoveAction, SIGNAL( activated() ),
mView, SLOT( moveIncidence() ) );
#ifndef DESKTOP_VERSION
- mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
+ mBeamAction = new Q3Action( "Beam_incidence", i18n("Beam..."), 0, this );
mBeamAction->addTo(mCurrentItemMenu );
connect( mBeamAction, SIGNAL( activated() ),
mView, SLOT( beamIncidence() ) );
#endif
- mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
+ mCancelAction = new Q3Action( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
mCancelAction->addTo( mCurrentItemMenu );
connect( mCancelAction, SIGNAL( activated() ),
mView, SLOT( toggleCancelIncidence() ) );
mCurrentItemMenu->insertSeparator();
- action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
+ action = new Q3Action( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
action->addTo( mCurrentItemMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( undo_delete() ) );
// ***********************
if ( KOPrefs::instance()->mVerticalScreen ) {
icon = SmallIcon( "1updownarrow" );
} else {
icon = SmallIcon("1leftrightarrow" );
}
configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
- QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
+ Q3Action* FSaction = new Q3Action( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
FSaction->addTo( viewMenu );
connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
icon = loadPixmap( pathString + "filter" );
configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
icon = loadPixmap( pathString + "configure" );
- action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
+ action = new Q3Action( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( toggleFilter() ) );
mToggleFilter = action;
icon = loadPixmap( pathString + "navi" );
configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
- action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
+ action = new Q3Action( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( toggleDateNavigatorWidget() ) );
mToggleNav = action ;
icon = loadPixmap( pathString + "allday" );
configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
- action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
+ action = new Q3Action( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( toggleAllDaySize() ) );
mToggleAllday = action;
connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
mToggleNav, SLOT( setEnabled ( bool ) ) );
//connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
// mToggleFilter, SLOT( setEnabled ( bool ) ) );
connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
mToggleAllday, SLOT( setEnabled ( bool ) ) );
// connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
// configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
dPickerAction->addTo( iconToolBar );
viewMenu->insertSeparator();
if ( p-> mShowIconToggleFull )
FSaction->addTo( iconToolBar );
if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
//********************
if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
icon = loadPixmap( pathString + "whatsnext" );
configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
- QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
+ Q3Action* whatsnext_action = new Q3Action( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
whatsnext_action->addTo( viewMenu );
connect( whatsnext_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showWhatsNextView() ) );
icon = loadPixmap( pathString + "xdays" );
configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
- QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
+ Q3Action* xdays_action = new Q3Action( i18n("Next days"), icon, i18n("Next days"), 0, this );
xdays_action->addTo( viewMenu );
connect( xdays_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showNextXView() ) );
icon = loadPixmap( pathString + "journal" );
configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
- QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
+ Q3Action* viewjournal_action = new Q3Action( i18n("Journal"), icon, i18n("Journal"), 0, this );
viewjournal_action->addTo( viewMenu );
connect( viewjournal_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showJournalView() ) );
icon = loadPixmap( pathString + "day" );
configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
- QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
+ Q3Action* day1_action = new Q3Action( i18n("Day View"), icon, i18n("Day View"), 0, this );
day1_action->addTo( viewMenu );
// action->addTo( toolBar );
connect( day1_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showDayView() ) );
icon = loadPixmap( pathString + "workweek" );
configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
- QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
+ Q3Action* day5_action = new Q3Action( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
day5_action->addTo( viewMenu );
connect( day5_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showWorkWeekView() ) );
icon = loadPixmap( pathString + "week" );
configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
- QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
+ Q3Action* day7_action = new Q3Action( i18n("Week"), icon, i18n("Week"), 0, this );
day7_action->addTo( viewMenu );
connect( day7_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showWeekView() ) );
icon = loadPixmap( pathString + "workweek2" );
configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
- QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
+ Q3Action* day6_action = new Q3Action( i18n("List week"), icon, i18n("List week"), 0, this );
day6_action->addTo( viewMenu );
connect( day6_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showMonthViewWeek() ) );
icon = loadPixmap( pathString + "month" );
configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
- QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
+ Q3Action* month_action = new Q3Action( i18n("Month"), icon, i18n("Month"), 0, this );
month_action->addTo( viewMenu );
connect( month_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showMonthView() ) );
icon = loadPixmap( pathString + "list" );
configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
- QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
+ Q3Action* showlist_action = new Q3Action( i18n("List View"), icon, i18n("List View"), 0, this );
showlist_action->addTo( viewMenu );
connect( showlist_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showListView() ) );
icon = loadPixmap( pathString + "todo" );
configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
- QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
+ Q3Action* todoview_action = new Q3Action( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
todoview_action->addTo( viewMenu );
connect( todoview_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTodoView() ) );
#if 0
- action = new QAction( "view_timespan", "Time Span", 0, this );
+ action = new Q3Action( "view_timespan", "Time Span", 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTimeSpanView() ) );
#endif
- action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
+ action = new Q3Action( "purge_completed", i18n("Purge Completed..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
icon = loadPixmap( pathString + "search" );
configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
actionMenu->insertSeparator();
- action = new QAction( "manage cat", i18n("Edit category list..."), 0,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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 = new Q3Action( 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 = new Q3Action( 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 = new Q3Action( 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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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( "export ical", i18n("Export All Data"), 0,
+ action = new Q3Action( "export ical", i18n("Export All Data"), 0,
this );
action->addTo( exportMenu_X );
connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) );
- action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
+ action = new Q3Action( "import_qtopia", i18n("Export VCalendar"), 0,
this );
action->addTo( exportMenu_X );
connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
//LR
- QPopupMenu *ex2phone = new QPopupMenu( this );
+ Q3PopupMenu *ex2phone = new Q3PopupMenu( 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,
+ brAction = new Q3Action( "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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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 = new Q3Action( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ),
this, SLOT( printCal() ) );
icon = loadPixmap( pathString + "week" );
- action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
+ action = new Q3Action( 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 = new Q3Action( 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 + "list" );
- action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this );
+ action = new Q3Action( 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 = new Q3Action( 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,
+ action = new Q3Action( "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,
+ action = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "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 = new Q3Action( "licence", i18n("Licence..."), 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( licence() ) );
- action = new QAction( "about", i18n("About..."), 0, this );
+ action = new Q3Action( "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 );
+ Q3WhatsThis::whatsThisButton ( iconToolBar );
if (p-> mShowIconNext)
whatsnext_action->addTo( viewToolBar );
if (p-> mShowIconNextDays)
xdays_action->addTo( viewToolBar );
if (p-> mShowIconJournal)
viewjournal_action->addTo( viewToolBar );
if (p-> mShowIconDay1)
day1_action->addTo( viewToolBar );
if (p-> mShowIconDay5)
day5_action->addTo( viewToolBar );
if (p-> mShowIconDay7)
day7_action->addTo( viewToolBar );
if (p-> mShowIconDay6)
day6_action->addTo( viewToolBar );
if (p-> mShowIconMonth)
month_action->addTo( viewToolBar );
if (p-> mShowIconList)
showlist_action->addTo( viewToolBar );
if (p-> mShowIconTodoview)
todoview_action->addTo( viewToolBar );
icon = loadPixmap( pathString + "2leftarrowB" );
configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
if (p-> mShowIconBackFast) {
- action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
+ action = new Q3Action( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goPreviousMonth() ) );
action->addTo( navigatorToolBar );
}
icon = loadPixmap( pathString + "1leftarrowB" );
configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
if (p-> mShowIconBack) {
- action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
+ action = new Q3Action( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goPrevious() ) );
action->addTo( navigatorToolBar );
}
icon = loadPixmap( pathString + "today" );
configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
if (p-> mShowIconToday)
today_action->addTo( navigatorToolBar );
icon = loadPixmap( pathString + "1rightarrowB" );
configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
if (p-> mShowIconForward) {
- action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
+ action = new Q3Action( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goNext() ) );
action->addTo( navigatorToolBar );
}
icon = loadPixmap( pathString + "2rightarrowB" );
configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
if (p-> mShowIconForwardFast) {
- action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
+ action = new Q3Action( i18n("Next month"), icon, i18n("Next month"),0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goNextMonth() ) );
action->addTo( navigatorToolBar );
}
configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6);
if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true);
if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true);
if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true);
if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true);
if (p-> mShowIconNewEvent)
configureToolBarMenu->setItemChecked( 10, true );
if (p->mShowIconNewTodo )
configureToolBarMenu->setItemChecked( 20, true );
if (p-> mShowIconSearch)
configureToolBarMenu->setItemChecked( 120, true );
if (p-> mShowIconList)
configureToolBarMenu->setItemChecked( 30, true );
if (p-> mShowIconDay1)
configureToolBarMenu->setItemChecked( 40, true );
@@ -1503,49 +1513,49 @@ void MainWindow::exportToPhone( int mode )
{
//ex2phone->insertItem(i18n("Complete calendar..."), 1 );
//ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
KOex2phonePrefs ex2phone;
ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
if ( mode == 1 )
ex2phone.setCaption(i18n("Export complete calendar"));
if ( mode == 2 )
ex2phone.setCaption(i18n("Export filtered calendar"));
if ( !ex2phone.exec() ) {
return;
}
KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
int inFuture = 0;
if ( ex2phone.mWriteBackFuture->isChecked() )
inFuture = ex2phone.mWriteBackFutureWeeks->value();
- QPtrList<Incidence> delSel;
+ Q3PtrList<Incidence> delSel;
if ( mode == 1 )
delSel = mCalendar->rawIncidences();
if ( mode == 2 )
delSel = mCalendar->incidences();
CalendarLocal* cal = new CalendarLocal();
cal->setLocalTime();
Incidence *incidence = delSel.first();
QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
while ( incidence ) {
if ( incidence->typeID() != journalID ) {
bool add = true;
if ( inFuture ) {
QDateTime dt;
if ( incidence->typeID() == todoID ) {
Todo * t = (Todo*)incidence;
if ( t->hasDueDate() )
dt = t->dtDue();
else
dt = cur.addSecs( 62 );
}
else {
bool ok;
dt = incidence->getNextOccurence( cur, &ok );
@@ -1574,52 +1584,52 @@ void MainWindow::exportToPhone( int mode )
setCaption( i18n("Error exporting to phone!"));
delete cal;
}
void MainWindow::setDefaultPreferences()
{
KOPrefs *p = KOPrefs::instance();
p->mCompactDialogs = true;
p->mConfirm = true;
// p->mEnableQuickTodo = false;
}
QString MainWindow::resourcePath()
{
return KGlobal::iconLoader()->iconPath();
}
void MainWindow::displayText( QString text ,QString cap )
{
QDialog dia( this, "name", true ); ;
dia.setCaption( cap );
- QVBoxLayout* lay = new QVBoxLayout( &dia );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( &dia );
lay->setSpacing( 3 );
lay->setMargin( 3 );
- QTextBrowser tb ( &dia );
+ Q3TextBrowser tb ( &dia );
lay->addWidget( &tb );
tb.setText( text );
#ifdef DESKTOP_VERSION
dia.resize( 640, 480);
#else
dia.showMaximized();
#endif
dia.exec();
}
void MainWindow::features()
{
KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
}
void MainWindow::usertrans()
{
KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
}
void MainWindow::storagehowto()
{
@@ -1756,124 +1766,124 @@ void MainWindow::aboutKnownBugs()
delete msg;
}
QString MainWindow::defaultFileName()
{
return QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) );
}
QString MainWindow::syncFileName()
{
#ifdef DESKTOP_VERSION
return QDir::convertSeparators( 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.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),Qt::AlignCenter, QString::number( weekNum) );
p.end();
- QIconSet icon3 ( mWeekPixmap );
+ QIcon 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 );
+ QDateTime noc = incidence->getNextOccurence( (QDateTime)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 );
}
#ifdef DESKTOP_VERSION
static QPixmap jP = SmallIcon( "journal" );
static QPixmap eP = SmallIcon( "newevent" );
static QPixmap tP = SmallIcon( "newtodo" );
- QIconSet icon;
+ QIcon icon;
if ( incidence->typeID() == todoID )
- icon = QIconSet ( tP );
+ icon = QIcon ( tP );
else if ( incidence->typeID() == eventID )
- icon = QIconSet ( eP );
+ icon = QIcon ( eP );
else if ( incidence->typeID() == journalID )
- icon = QIconSet ( jP );
+ icon = QIcon ( 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 );
#else
mPrintSelAction->setEnabled( enabled );
#endif
mCancelAction->setEnabled( enabled );
}
void MainWindow::importOL()
{
#ifdef _OL_IMPORT_
mView->clearAllViews();
@@ -2024,49 +2034,49 @@ void MainWindow::autoSaveWarning()
void MainWindow::saveStopTimer()
{
mSaveTimer.stop();
mSaveDelay = 0;
}
void MainWindow::backupAllFiles()
{
QDate reference ( 2000,1,1);
int daysTo = reference.daysTo ( QDate::currentDate() );
setCaption(i18n("Creating backup ... please wait ..." ));
qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
// we need the file path, the backup dir and the number of bups as param
QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
bupDir = KGlobalSettings::backupDataDir();
int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
if ( retval == 0 ) {
setCaption(i18n("Backup cancelled" ));
qDebug("KO: Backup cancelled. Will try again tomorrow ");
// retval == 0 : backup skipped for today, try again tomorrow
KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
} else if ( retval == 1 ){
qDebug("KO: Backup created.");
// backup ok
- QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
+ Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
cal = calendars.next();
while ( cal ) {
if ( !cal->mErrorOnLoad ) {
KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
}
cal = calendars.next();
}
KOPrefs::instance()->mLastBackupDate = daysTo;
setCaption(i18n("Backup succesfully finished" ));
} else if ( retval == 2 ){
setCaption(i18n("Backup globally disabled" ));
qDebug("KO: Backup globally cancelled.");
// backup globally cancelled
KPimGlobalPrefs::instance()->mBackupEnabled = false;
}
// retval == 3: do nothing, try again later
}
void MainWindow::save()
{
if ( mSaveDelay ) {
int elapsed = mSaveTimerStart.secsTo( QDateTime::currentDateTime() );
if ( mSaveDelay < elapsed ) {
qDebug("KO: Pending save after wakeup from suspend detected.");
@@ -2320,115 +2330,115 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
if ( size >= 4 )
configureAgenda( size );
break;
default:
e->ignore();
}
if ( pro > 0 ) {
selectFilter( pro+1 );
}
if ( showSelectedDates ) {
;// setCaptionToDates();
}
}
void MainWindow::fillFilterMenuTB()
{
selectFilterMenuTB->clear();
selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
selectFilterMenuTB->insertSeparator();
selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
selectFilterMenuTB->insertSeparator();
- QPtrList<CalFilter> fili = mView->filters();
+ Q3PtrList<CalFilter> fili = mView->filters();
CalFilter *curfilter = mView->filterView()->selectedFilter();
CalFilter *filter = fili.first();
int iii = 2;
bool checkitem = mView->filterView()->filtersEnabled();
while(filter) {
selectFilterMenuTB->insertItem( filter->name(), iii );
if ( filter == curfilter)
selectFilterMenuTB->setItemChecked( iii, checkitem );
filter = fili.next();
++iii;
}
if ( !checkitem )
selectFilterMenuTB->setItemChecked( 1, true );
int x = 0;
int y = iconToolBar->height();
int dX = 0;
int dY = 0;
if ( iconToolBar->orientation () == Qt:: Horizontal ) {
if ( iconToolBar->y() > height()/2 ) {
dY = selectFilterMenuTB->sizeHint().height()+8;
y = 0;
}
} else {
if ( iconToolBar->x() > width()/2 ) { // right side
x=0;
dX= selectFilterMenuTB->sizeHint().width()+8;
y = 0;
} else {
x= iconToolBar->width();
y = 0;
}
}
//qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
}
void MainWindow::fillFilterMenu()
{
selectFilterMenu->clear();
selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
selectFilterMenu->insertSeparator();
selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
selectFilterMenu->insertSeparator();
- QPtrList<CalFilter> fili = mView->filters();
+ Q3PtrList<CalFilter> fili = mView->filters();
CalFilter *curfilter = mView->filterView()->selectedFilter();
CalFilter *filter = fili.first();
int iii = 2;
bool checkitem = mView->filterView()->filtersEnabled();
while(filter) {
selectFilterMenu->insertItem( filter->name(), iii );
if ( filter == curfilter)
selectFilterMenu->setItemChecked( iii, checkitem );
filter = fili.next();
++iii;
}
if ( !checkitem )
selectFilterMenu->setItemChecked( 1, true );
}
void MainWindow::fillFilterMenuPopup()
{
filterPopupMenu->clear();
filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
filterPopupMenu->insertSeparator();
- QPtrList<CalFilter> fili = mView->filters();
+ Q3PtrList<CalFilter> fili = mView->filters();
CalFilter *curfilter = mView->filterView()->selectedFilter();
CalFilter *filter = fili.first();
int iii = 1;
bool checkitem = mView->filterView()->filtersEnabled();
while(filter) {
filterPopupMenu->insertItem( filter->name(), iii );
if ( filter == curfilter)
filterPopupMenu->setItemChecked( iii, checkitem );
filter = fili.next();
++iii;
}
if ( !checkitem )
filterPopupMenu->setItemChecked( 0, true );
}
void MainWindow::selectFilter( int fil )
{
if ( fil == 0 ) {
mView->editFilters( );
} else if ( fil == 1 ){
if ( mView->filterView()->filtersEnabled() )
mView->toggleFilerEnabled( );
} else {
if ( !mView->filterView()->filtersEnabled() ) {
@@ -2798,26 +2808,26 @@ void MainWindow::weekAction()
void MainWindow::hideEvent ( QHideEvent * )
{
QString message;
QDateTime nextA = mCalendar->nextAlarmEventDateTime();
if ( nextA.isValid() ) {
QString sum = mCalendar->nextSummary();
message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
setCaption( message );
}
}
void MainWindow::resizeEvent( QResizeEvent* e)
{
#ifndef DESKTOP_VERSION
if ( filterToolBar ) {
if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
if (QApplication::desktop()->width() > QApplication::desktop()->height() )
filterToolBar->hide();
else
filterToolBar->show();
}
}
#endif
- QMainWindow::resizeEvent( e);
+ Q3MainWindow::resizeEvent( e);
}
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index a533d8b..6756216 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,77 +1,85 @@
#ifndef KORGE_MAINWINDOW_H
#define KORGE_MAINWINDOW_H
-#include <qmainwindow.h>
+#include <q3mainwindow.h>
#include <qtimer.h>
-#include <qdict.h>
+#include <q3dict.h>
#include <qfile.h>
#include <qmenubar.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qregexp.h>
+//Added by qt3to4:
+#include <Q3CString>
+#include <QCloseEvent>
+#include <QResizeEvent>
+#include <QPixmap>
+#include <Q3PopupMenu>
+#include <QHideEvent>
+#include <QKeyEvent>
#include <libkcal/incidence.h>
#include <ksyncmanager.h>
#include <kpopupmenu.h>
#ifndef DESKTOP_VERSION
#include <qcopchannel_qws.h>
#endif
-class QAction;
+class Q3Action;
class CalendarView;
class KSyncProfile;
#ifdef DESKTOP_VERSION
-#define QPEToolBar QToolBar
+#define QPEToolBar Q3ToolBar
#endif
class QPEToolBar;
namespace KCal {
class CalendarLocal;
}
using namespace KCal;
-class MainWindow : public QMainWindow
+class MainWindow : public Q3MainWindow
{
Q_OBJECT
public:
MainWindow( QWidget *parent = 0, const char *name = 0 );
~MainWindow();
bool beamReceiveEnabled();
static QString defaultFileName();
static QString syncFileName();
static QString resourcePath();
public slots:
void setUsesBigPixmaps ( bool );
void setCaption ( const QString & );
void updateWeekNum(const KCal::DateList &);
void updateWeek(QDate);
void updateFilterToolbar();
virtual void showMaximized ();
void configureAgenda( int );
- void recieve( const QCString& msg, const QByteArray& data );
- void receiveStart( const QCString& msg, const QByteArray& data );
+ void recieve( const Q3CString& msg, const QByteArray& data );
+ void receiveStart( const Q3CString& msg, const QByteArray& data );
protected slots:
void autoSaveWarning();
void loadDataAfterStart();
void calHint();
void startMultiSync();
void setCaptionToDates();
void weekAction();
void about();
void licence();
void faq();
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 * );
@@ -103,89 +111,89 @@ class MainWindow : public QMainWindow
void selectFilterPopup( int );
void exportToPhone( int );
void toggleBeamReceive();
void disableBR(bool);
signals:
void selectWeek ( int );
private slots:
void slotResetFocus();
void slotResetFocusLoop();
void showConfigureAgenda();
void getFile( bool ,const QString &);
void syncFileRequest(const QString &);
protected:
int mFocusLoop;
void hideEvent ( QHideEvent * );
QString sentSyncFile();
void displayText( QString, QString);
void enableIncidenceActions( bool );
bool askForQuitOnSaveError();
private:
bool mAutoSaveDisabled;
bool checkAutosave();
- QCString mCStringMess;
+ Q3CString mCStringMess;
QByteArray mByteData;
//void setMenuBar( QMenuBar * );
bool mBRdisabled;
#ifndef DESKTOP_VERSION
QCopChannel* infrared;
#endif
- QAction* brAction;
+ Q3Action* brAction;
KSyncManager* mSyncManager;
bool mClosed;
void saveOnClose();
bool mFlagKeyPressed;
bool mBlockAtStartup;
KMenuBar *menuBar1;
QPEToolBar *iconToolBar;
QPEToolBar *viewToolBar;
QPEToolBar *navigatorToolBar;
QPEToolBar *filterToolBar;
KMenuBar *filterMenubar;
- QPopupMenu * filterPopupMenu;
- QPopupMenu * mCurrentItemMenu;
+ Q3PopupMenu * filterPopupMenu;
+ Q3PopupMenu * mCurrentItemMenu;
void initActions();
void setDefaultPreferences();
void resizeEvent( QResizeEvent* e);
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
- QPopupMenu *configureToolBarMenu;
- QPopupMenu *selectFilterMenu;
- QPopupMenu *selectFilterMenuTB;
- QPopupMenu *configureAgendaMenu, *syncMenu;
+ Q3PopupMenu *configureToolBarMenu;
+ Q3PopupMenu *selectFilterMenu;
+ Q3PopupMenu *selectFilterMenuTB;
+ Q3PopupMenu *configureAgendaMenu, *syncMenu;
CalendarLocal *mCalendar;
CalendarView *mView;
- QAction *mNewSubTodoAction;
- QAction *mWeekAction;
+ Q3Action *mNewSubTodoAction;
+ Q3Action *mWeekAction;
QFont mWeekFont;
QPixmap mWeekPixmap;
QColor mWeekBgColor;
- QAction *mShowAction;
- QAction *mEditAction;
- QAction *mDeleteAction;
- QAction *mCloneAction;
- QAction *mMoveAction;
- QAction *mBeamAction;
- QAction *mCancelAction;
- QAction *mPrintSelAction;
+ Q3Action *mShowAction;
+ Q3Action *mEditAction;
+ Q3Action *mDeleteAction;
+ Q3Action *mCloneAction;
+ Q3Action *mMoveAction;
+ Q3Action *mBeamAction;
+ Q3Action *mCancelAction;
+ Q3Action *mPrintSelAction;
- QAction *mToggleNav;
- QAction *mToggleFilter;
- QAction *mToggleAllday;
- QAction *actionFilterMenuTB;
+ Q3Action *mToggleNav;
+ Q3Action *mToggleFilter;
+ Q3Action *mToggleAllday;
+ Q3Action *actionFilterMenuTB;
void closeEvent( QCloseEvent* ce );
QTimer mSaveTimer;
QDateTime mSaveTimerStart;
int mSaveDelay;
//bool mBlockSaveFlag;
bool mCalendarModifiedFlag;
QPixmap loadPixmap( QString );
QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix;
};
#endif
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index f6a1a6a..59c3e45 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -5,80 +5,83 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qstring.h>
#include <qtooltip.h>
#include <qpushbutton.h>
#include <qlayout.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
#include <kiconloader.h>
#include "libkdepim/kdatepicker.h"
#include <knotifyclient.h>
#include "kdatetbl.h"
#include "koglobals.h"
#include <kglobalsettings.h>
#include "koprefs.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include <kcalendarsystem.h>
#include "navigatorbar.h"
NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name )
: QWidget( parent, name )
{
- QBoxLayout *topLayout = new QHBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3HBoxLayout( this );
// Set up the control buttons and date label
- mCtrlFrame = new QFrame( this );
- mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised);
+ mCtrlFrame = new Q3Frame( this );
+ mCtrlFrame->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
mCtrlFrame->setLineWidth(1);
topLayout->addWidget( mCtrlFrame );
bool isRTL = KOGlobals::self()->reverseLayout();
#ifndef DESKTOP_VERSION
bool isDesktop = false;
#else
bool isDesktop = true;
#endif
if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 )
isDesktop = true;
// Create backward navigation buttons
mPrevYear = new QPushButton( mCtrlFrame );
mPrevYear->setPixmap( SmallIcon( isDesktop ? "3leftarrowB" : "3leftarrow" ) );
QToolTip::add( mPrevYear, i18n("Previous Year") );
mPrevMonth = new QPushButton( mCtrlFrame );
mPrevMonth->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow") );
QToolTip::add( mPrevMonth, i18n("Previous Month") );
// Create forward navigation buttons
@@ -108,76 +111,76 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
if ( QString ( name ) == QString("useBigPixmaps") ) {
mNextMonth->setFlat( true);
mNextWeek->setFlat( true);
mNextYear->setFlat( true);
mSelectMonth->setFlat( true);
mPrevYear->setFlat( true);
mPrevMonth->setFlat( true);
mPrevWeek->setFlat( true);
mPrevYear->setAutoRepeat( true );
mPrevMonth->setAutoRepeat( true );
mNextMonth->setAutoRepeat( true );
mPrevWeek->setAutoRepeat( true );
mNextWeek->setAutoRepeat( true );
mNextYear->setAutoRepeat( true );
} else {
mPrevWeek->hide();
mNextWeek->hide();
}
resetFont( font() );
// set up control frame layout
- QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 );
+ Q3BoxLayout *ctrlLayout = new Q3HBoxLayout( mCtrlFrame, 1 );
ctrlLayout->addWidget( mPrevYear, 3 );
ctrlLayout->addWidget( mPrevMonth, 3 );
ctrlLayout->addWidget( mPrevWeek, 3 );
//ctrlLayout->addStretch( 1 );
// ctrlLayout->addSpacing( 1 );
// ctrlLayout->addWidget( mDateLabel );
ctrlLayout->addWidget( mSelectMonth );
// ctrlLayout->addSpacing( 1 );
// ctrlLayout->addStretch( 1 );
ctrlLayout->addWidget( mNextWeek, 3 );
ctrlLayout->addWidget( mNextMonth, 3 );
ctrlLayout->addWidget( mNextYear, 3 );
connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) );
connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) );
connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) );
connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) );
connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) );
connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) );
connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) );
- mPrevYear->setFocusPolicy(NoFocus);
- mPrevMonth->setFocusPolicy(NoFocus);
- mNextMonth->setFocusPolicy(NoFocus);
- mPrevWeek->setFocusPolicy(NoFocus);
- mNextWeek->setFocusPolicy(NoFocus);
- mNextYear->setFocusPolicy(NoFocus);
- mSelectMonth->setFocusPolicy(NoFocus);
+ mPrevYear->setFocusPolicy(Qt::NoFocus);
+ mPrevMonth->setFocusPolicy(Qt::NoFocus);
+ mNextMonth->setFocusPolicy(Qt::NoFocus);
+ mPrevWeek->setFocusPolicy(Qt::NoFocus);
+ mNextWeek->setFocusPolicy(Qt::NoFocus);
+ mNextYear->setFocusPolicy(Qt::NoFocus);
+ mSelectMonth->setFocusPolicy(Qt::NoFocus);
setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );
}
NavigatorBar::~NavigatorBar()
{
}
QSize NavigatorBar::sizeHint() const
{
int wid = mCurrentMinWid ;
if ( mPrevYear->isVisible() )
wid += mCurrentButtonMinWid;
if ( mPrevMonth->isVisible() )
wid += mCurrentButtonMinWid;
if ( mPrevWeek->isVisible() )
wid += mCurrentButtonMinWid;
if ( mNextMonth->isVisible() )
wid += mCurrentButtonMinWid;
if ( mNextWeek->isVisible() )
wid += mCurrentButtonMinWid;
if ( mNextYear->isVisible() )
wid += mCurrentButtonMinWid;
//qDebug("ret %d %d ", wid, mCurrentHei);
return QSize ( wid, mCurrentHei );
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 9ccef14..a1880f5 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -6,71 +6,74 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef NAVIGATORBAR_H
#define NAVIGATORBAR_H
#include <libkcal/incidencebase.h>
#include <qwidget.h>
+//Added by qt3to4:
+#include <Q3Frame>
+#include <QLabel>
class QPushButton;
-class QFrame;
+class Q3Frame;
class QLabel;
class NavigatorBar: public QWidget
{
Q_OBJECT
public:
NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 );
~NavigatorBar();
void showButtons( bool left, bool right );
void resetFont ( QFont fo );
QSize sizeHint() const;
QSize sizeHintTwoButtons( int butNum = 2 ) const;
public slots:
void selectDates( const KCal::DateList & );
void selectMonth();
signals:
void goNextMonth();
void goPrevMonth();
void goNextWeek();
void goPrevWeek();
void goNextYear();
void goPrevYear();
void monthSelected( int );
private:
int mCurrentHei;
int mCurrentMinWid;
int mCurrentButtonMinWid;
- QFrame *mCtrlFrame;
+ Q3Frame *mCtrlFrame;
QPushButton *mPrevYear;
QPushButton *mPrevMonth;
QPushButton *mNextMonth;
QPushButton *mPrevWeek;
QPushButton *mNextWeek;
QPushButton *mNextYear;
QPushButton *mSelectMonth;
//QLabel *mDateLabel;
};
#endif
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp
index 7253c8e..ab31274 100644
--- a/korganizer/outgoingdialog.cpp
+++ b/korganizer/outgoingdialog.cpp
@@ -1,74 +1,74 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <kdebug.h>
#include <qfile.h>
#include <qdir.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <kglobal.h>
#include <klocale.h>
#include <ktempfile.h>
#include <kstandarddirs.h>
#include <libkcal/event.h>
#include <libkcal/freebusy.h>
//#include <libkcal/imipscheduler.h>
#include <libkcal/dummyscheduler.h>
#include <libkcal/icalformat.h>
#include <libkcal/calendar.h>
#ifndef KORG_NOMAIL
#include "mailscheduler.h"
#endif
#include "koprefs.h"
#include "outgoingdialog.h"
#include "koeventviewerdialog.h"
#include "docprefs.h"
-ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
+ScheduleItemOut::ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev,
Scheduler::Method method,
const QString &recipients)
- : QListViewItem(parent)
+ : Q3ListViewItem(parent)
{
mIncidence = ev;
mMethod = method;
mRecipients = recipients;
// kdDebug() << "ScheduleItemOut: setting the summary" << endl;
//Set the summary
if(ev->typeID() != freebusyID ) {
Incidence *incidence = static_cast<Incidence *>(ev);
setText(0,incidence->summary());
} else {
setText(0,i18n("Free Busy Object"));
}
// kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl;
//If the object is an event
if(ev->typeID()== eventID ) {
Event *event = static_cast<Event *>(ev);
setText(1,event->dtStartDateStr());
if (event->doesFloat()) { //If the event floats set the start and end times to no time
setText(2,i18n("no time"));
setText(4,i18n("no time"));
} else { //If it does not float
@@ -102,70 +102,70 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
setText(4,event->dtDueTimeStr());
}
}
}
// kdDebug() << "ScheduleItemOut: checking if the object is a FreeBusy object" << endl;
//If the object is a freebusy object
if(ev->typeID() == freebusyID ) {
FreeBusy *freebusy = static_cast<FreeBusy *>(ev);
setText(1,freebusy->dtStartDateStr());
setText(2,freebusy->dtStartTimeStr());
//Must try and get this to the users local settings
setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) );
setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) );
}
// kdDebug() << "ScheduleItemOut: Setting the method" << endl;
//Set the Method
setText(5,Scheduler::translatedMethodName(mMethod));
}
OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent,
const char* name,bool modal,
- WFlags fl)
+ Qt::WFlags fl)
: OutgoingDialog_base(parent,name,modal,fl)
{
mCalendar = calendar;
mFormat = new ICalFormat;
if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) {
mScheduler = new DummyScheduler(mCalendar);
} else {
#ifndef KORG_NOMAIL
mScheduler = new MailScheduler(mCalendar);
#else
mScheduler = new DummyScheduler(mCalendar);
#endif
}
- mMessageListView->setColumnAlignment(1,AlignHCenter);
- mMessageListView->setColumnAlignment(2,AlignHCenter);
- mMessageListView->setColumnAlignment(3,AlignHCenter);
- mMessageListView->setColumnAlignment(4,AlignHCenter);
- QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)),
- this,SLOT(showEvent(QListViewItem *)));
+ mMessageListView->setColumnAlignment(1,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(2,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(3,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(4,Qt::AlignHCenter);
+ QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)),
+ this,SLOT(showEvent(Q3ListViewItem *)));
mDocPrefs = new DocPrefs("groupschedule");
loadMessages();
}
OutgoingDialog::~OutgoingDialog()
{
delete mDocPrefs;
delete mFormat;
}
bool OutgoingDialog::addMessage(IncidenceBase *incidence,Scheduler::Method method)
{
kdDebug() << "Outgoing::addMessage" << "Method:" << method << endl;
if (method == Scheduler::Publish) return false;
if( mDocPrefs ) {
if (method != Scheduler::Cancel) {
mDocPrefs->writeEntry( incidence->uid()+"-scheduled", true );
} else {
if (!mDocPrefs->readBoolEntry(incidence->uid()+"-scheduled") )
return true;
}
}
if (KOPrefs::instance()->mIMIPSend == KOPrefs::IMIPOutbox) {
@@ -215,49 +215,49 @@ void OutgoingDialog::send()
}
ScheduleItemOut *oldItem = item;
item = (ScheduleItemOut *)(item->nextSibling());
if (success) {
deleteMessage(oldItem->event());
delete (oldItem->event());
delete oldItem;
}
}
emit numMessagesChanged(mMessageListView->childCount());
}
void OutgoingDialog::deleteItem()
{
ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem());
if(!item)
return;
deleteMessage(item->event());
delete(item->event());
mMessageListView->takeItem(item);
emit numMessagesChanged(mMessageListView->childCount());
}
-void OutgoingDialog::showEvent(QListViewItem *qitem)
+void OutgoingDialog::showEvent(Q3ListViewItem *qitem)
{
ScheduleItemOut *item = (ScheduleItemOut *)qitem;
Event *event = 0;
Todo *todo = 0;
if ( item->event()->typeID() == eventID ) {
event = static_cast<Event *>(item->event());
}
if ( item->event()->typeID() == todoID ) {
todo = static_cast<Todo *>(item->event());
}
QString sendText;
if (event || todo) {
KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
if (event) eventViewer->setEvent(event);
if (todo) eventViewer->setTodo(todo);
sendText = "<hr><h4>"+i18n("Event will be sent to:")+"</h4>";
switch (item->method()) {
case Scheduler::Publish: {
sendText += item->recipients();
break; }
case Scheduler::Request: {
sendText += i18n("All attendees");
break; }
case Scheduler::Refresh: {
@@ -273,89 +273,89 @@ void OutgoingDialog::showEvent(QListViewItem *qitem)
sendText += i18n("The organizer %1").arg(item->event()->organizer());
break; }
case Scheduler::Counter: {
sendText += i18n("The organizer %1").arg(item->event()->organizer());
break; }
case Scheduler::Declinecounter: {
sendText += i18n("All attendees");
break; }
case Scheduler::NoMethod: {
sendText += "";
break; }
default:
sendText = "";
}
eventViewer->addText(sendText);
eventViewer->show();
}
}
bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method,
const QString &recipients)
{
KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics");
QString messageText = mFormat->createScheduleMessage(incidence,method);
- QTextStream *qts = ktfile.textStream();
+ Q3TextStream *qts = ktfile.textStream();
*qts << messageText;
*qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl;
*qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl;
mMessageMap[incidence]=ktfile.name();
return true;
}
bool OutgoingDialog::deleteMessage(IncidenceBase *incidence)
{
QFile f( mMessageMap[incidence] );
mMessageMap.remove(incidence);
if ( !f.exists() ) return false;
else
return f.remove();
}
void OutgoingDialog::loadMessages()
{
Scheduler::Method method;
QString recipients;
QString outgoingDirName = locateLocal("data","korganizer/outgoing");
QDir outgoingDir(outgoingDirName);
QStringList outgoing = outgoingDir.entryList(QDir::Files);
QStringList::ConstIterator it;
for(it = outgoing.begin(); it != outgoing.end(); ++it) {
kdDebug() << "-- File: " << (*it) << endl;
QFile f(outgoingDirName + "/" + (*it));
bool inserted = false;
QMap<IncidenceBase*, QString>::Iterator iter;
for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) {
if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true;
}
if (!inserted) {
- if (!f.open(IO_ReadOnly)) {
+ if (!f.open(QIODevice::ReadOnly)) {
kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'"
<< (*it) << "'" << endl;
} else {
- QTextStream t(&f);
+ Q3TextStream t(&f);
QString messageString = t.read();
ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar,
messageString);
int begin_pos = messageString.find("METHOD-BEGIN:");
begin_pos = messageString.find('\n',begin_pos)+1;
QString meth = messageString.mid(begin_pos,1);
switch (meth.toInt()) {
case 0:method=Scheduler::Publish; break;
case 1:method=Scheduler::Request; break;
case 2:method=Scheduler::Refresh; break;
case 3:method=Scheduler::Cancel; break;
case 4:method=Scheduler::Add; break;
case 5:method=Scheduler::Reply; break;
case 6:method=Scheduler::Counter; break;
case 7:method=Scheduler::Declinecounter; break;
default :method=Scheduler::NoMethod; break;
}
begin_pos = messageString.find("RECIPIENTS-BEGIN:");
begin_pos = messageString.find('\n',begin_pos)+1;
int end_pos = messageString.find(":RECIPIENTS-END",begin_pos)-1;
recipients = messageString.mid(begin_pos, end_pos-begin_pos);
kdDebug() << "Outgoing::loadMessage(): Recipients: " << recipients << endl;
if (message) {
diff --git a/korganizer/outgoingdialog.h b/korganizer/outgoingdialog.h
index a3d561a..e727087 100644
--- a/korganizer/outgoingdialog.h
+++ b/korganizer/outgoingdialog.h
@@ -2,87 +2,87 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef OUTGOINGDIALOG_H
#define OUTGOINGDIALOG_H
-#include <qlistview.h>
+#include <q3listview.h>
#include <qmap.h>
#include <qstring.h>
#include <libkcal/scheduler.h>
#include "docprefs.h"
#include "outgoingdialog_base.h"
using namespace KCal;
-class ScheduleItemOut : public QListViewItem
+class ScheduleItemOut : public Q3ListViewItem
{
public:
- ScheduleItemOut(QListView *parent,IncidenceBase *ev,
+ ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev,
Scheduler::Method method, const QString &recipients=QString::null);
virtual ~ScheduleItemOut() {}
IncidenceBase *event() { return mIncidence; }
Scheduler::Method method() { return mMethod; }
QString recipients() { return mRecipients; }
private:
IncidenceBase *mIncidence;
Scheduler::Method mMethod;
QString mRecipients;
};
class OutgoingDialog : public OutgoingDialog_base
{
Q_OBJECT
public:
OutgoingDialog(Calendar *,QWidget* parent=0,const char* name=0,
- bool modal=false,WFlags fl=0);
+ bool modal=false,Qt::WFlags fl=0);
~OutgoingDialog();
bool addMessage(IncidenceBase *,Scheduler::Method);
bool addMessage(IncidenceBase *,Scheduler::Method,const QString &recipients);
void setDocumentId( const QString &id );
public slots:
void loadMessages();
signals:
void numMessagesChanged(int);
protected slots:
void send();
void deleteItem();
- void showEvent(QListViewItem *);
+ void showEvent(Q3ListViewItem *);
private:
bool saveMessage(IncidenceBase *,Scheduler::Method,const QString &recipients=0);
bool deleteMessage(IncidenceBase *);
Calendar *mCalendar;
ICalFormat *mFormat;
Scheduler *mScheduler;
QMap<IncidenceBase*, QString> mMessageMap;
DocPrefs *mDocPrefs;
};
#endif // OUTGOINGDIALOG_H
diff --git a/korganizer/outgoingdialog_base.cpp b/korganizer/outgoingdialog_base.cpp
index 1873b44..be8a870 100644
--- a/korganizer/outgoingdialog_base.cpp
+++ b/korganizer/outgoingdialog_base.cpp
@@ -1,68 +1,70 @@
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/outgoingdialog_base.ui'
**
** Created: Sat Mar 29 22:31:21 2003
** by: The User Interface Compiler ()
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "outgoingdialog_base.h"
#include <qvariant.h>
-#include <qheader.h>
-#include <qlistview.h>
+#include <q3header.h>
+#include <q3listview.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
/*
* Constructs a OutgoingDialog_base as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
-OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl )
+OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "OutgoingDialog_base" );
- OutgoingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout");
+ OutgoingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout");
- mMessageListView = new QListView( this, "mMessageListView" );
+ mMessageListView = new Q3ListView( this, "mMessageListView" );
mMessageListView->addColumn( tr2i18n( "Summary" ) );
mMessageListView->addColumn( tr2i18n( "Start Date" ) );
mMessageListView->addColumn( tr2i18n( "Start Time" ) );
mMessageListView->addColumn( tr2i18n( "End Date" ) );
mMessageListView->addColumn( tr2i18n( "End Time" ) );
mMessageListView->addColumn( tr2i18n( "Method" ) );
- mMessageListView->setFrameShape( QListView::StyledPanel );
- mMessageListView->setFrameShadow( QListView::Sunken );
+ mMessageListView->setFrameShape( Q3ListView::StyledPanel );
+ mMessageListView->setFrameShadow( Q3ListView::Sunken );
mMessageListView->setAllColumnsShowFocus( TRUE );
OutgoingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 3, 0, 0 );
PushButton5 = new QPushButton( this, "PushButton5" );
PushButton5->setDefault( FALSE );
OutgoingDialog_baseLayout->addWidget( PushButton5, 0, 1 );
PushButton7 = new QPushButton( this, "PushButton7" );
OutgoingDialog_baseLayout->addWidget( PushButton7, 1, 1 );
PushButton6 = new QPushButton( this, "PushButton6" );
PushButton6->setDefault( TRUE );
OutgoingDialog_baseLayout->addWidget( PushButton6, 3, 1 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
OutgoingDialog_baseLayout->addItem( spacer, 2, 1 );
languageChange();
resize( QSize(582, 274).expandedTo(minimumSizeHint()) );
// signals and slots connections
connect( PushButton6, SIGNAL( clicked() ), this, SLOT( accept() ) );
diff --git a/korganizer/outgoingdialog_base.h b/korganizer/outgoingdialog_base.h
index af71bb1..5e81725 100644
--- a/korganizer/outgoingdialog_base.h
+++ b/korganizer/outgoingdialog_base.h
@@ -1,47 +1,51 @@
/****************************************************************************
** Form interface generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/outgoingdialog_base.ui'
**
** Created: Sat Mar 29 22:24:26 2003
** by: The User Interface Compiler ()
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef OUTGOINGDIALOG_BASE_H
#define OUTGOINGDIALOG_BASE_H
#include <qvariant.h>
#include <qdialog.h>
-
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QListView;
-class QListViewItem;
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3HBoxLayout>
+#include <Q3VBoxLayout>
+
+class Q3VBoxLayout;
+class Q3HBoxLayout;
+class Q3GridLayout;
+class Q3ListView;
+class Q3ListViewItem;
class QPushButton;
class OutgoingDialog_base : public QDialog
{
Q_OBJECT
public:
- OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~OutgoingDialog_base();
- QListView* mMessageListView;
+ Q3ListView* mMessageListView;
QPushButton* PushButton5;
QPushButton* PushButton7;
QPushButton* PushButton6;
protected:
- QGridLayout* OutgoingDialog_baseLayout;
+ Q3GridLayout* OutgoingDialog_baseLayout;
protected slots:
virtual void languageChange();
virtual void send();
virtual void deleteItem();
};
#endif // OUTGOINGDIALOG_BASE_H
diff --git a/korganizer/publishdialog.cpp b/korganizer/publishdialog.cpp
index 2ae6720..ede9840 100644
--- a/korganizer/publishdialog.cpp
+++ b/korganizer/publishdialog.cpp
@@ -14,138 +14,138 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlineedit.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#ifndef KORG_NOKABC
#define KORG_NOKABC
//#include <kabc/addresseedialog.h>
#endif
#include "koprefs.h"
#include "publishdialog.h"
PublishDialog::PublishDialog(QWidget* parent, const char* name,
- bool modal, WFlags fl)
+ bool modal, Qt::WFlags fl)
: PublishDialog_base(parent,name,modal,fl)
{
setCaption(i18n("Select Addresses"));
mNameLineEdit->setEnabled(false);
mEmailLineEdit->setEnabled(false);
- connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)),
+ connect(mAddressListView,SIGNAL(selectionChanged(Q3ListViewItem *)),
SLOT(updateInput()));
}
PublishDialog::~PublishDialog()
{
}
void PublishDialog::addAttendee(Attendee *attendee)
{
mNameLineEdit->setEnabled(true);
mEmailLineEdit->setEnabled(true);
- QListViewItem *item = new QListViewItem(mAddressListView);
+ Q3ListViewItem *item = new Q3ListViewItem(mAddressListView);
item->setText(0,attendee->name());
item->setText(1,attendee->email());
mAddressListView->insertItem(item);
}
QString PublishDialog::addresses()
{
QString to = "";
- QListViewItem *item;
+ Q3ListViewItem *item;
int i, count;
count = mAddressListView->childCount();
for (i=0;i<count;i++) {
item = mAddressListView->firstChild();
mAddressListView->takeItem(item);
to += item->text(1);
if (i<count-1) {
to += ", ";
}
}
return to;
}
void PublishDialog::addItem()
{
mNameLineEdit->setEnabled(true);
mEmailLineEdit->setEnabled(true);
- QListViewItem *item = new QListViewItem(mAddressListView);
+ Q3ListViewItem *item = new Q3ListViewItem(mAddressListView);
mAddressListView->insertItem(item);
mAddressListView->setSelected(item,true);
mNameLineEdit->setText(i18n("(EmptyName)"));
mEmailLineEdit->setText(i18n("(EmptyEmail)"));
}
void PublishDialog::removeItem()
{
- QListViewItem *item;
+ Q3ListViewItem *item;
item = mAddressListView->selectedItem();
if (!item) return;
mAddressListView->takeItem(item);
item = mAddressListView->selectedItem();
if (!item) {
mNameLineEdit->setText("");
mEmailLineEdit->setText("");
mNameLineEdit->setEnabled(false);
mEmailLineEdit->setEnabled(false);
}
if (mAddressListView->childCount() == 0) {
mNameLineEdit->setEnabled(false);
mEmailLineEdit->setEnabled(false);
}
}
void PublishDialog::openAddressbook()
{
#ifndef KORG_NOKABC
KABC::Addressee::List addressList;
addressList = KABC::AddresseeDialog::getAddressees(this);
//KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this);
KABC::Addressee a = addressList.first();
if (!a.isEmpty()) {
uint i;
for (i=0;i<addressList.count();i++) {
a = addressList[i];
mNameLineEdit->setEnabled(true);
mEmailLineEdit->setEnabled(true);
- QListViewItem *item = new QListViewItem(mAddressListView);
+ Q3ListViewItem *item = new Q3ListViewItem(mAddressListView);
mAddressListView->setSelected(item,true);
mNameLineEdit->setText(a.realName());
mEmailLineEdit->setText(a.preferredEmail());
mAddressListView->insertItem(item);
}
}
#endif
}
void PublishDialog::updateItem()
{
- QListViewItem *item;
+ Q3ListViewItem *item;
item = mAddressListView->selectedItem();
if (!item) return;
item->setText(0,mNameLineEdit->text());
item->setText(1,mEmailLineEdit->text());
}
void PublishDialog::updateInput()
{
- QListViewItem *item;
+ Q3ListViewItem *item;
item = mAddressListView->selectedItem();
if (!item) return;
mNameLineEdit->setEnabled(true);
mEmailLineEdit->setEnabled(true);
QString mail = item->text(1);
mNameLineEdit->setText(item->text(0));
mEmailLineEdit->setText(mail);
}
diff --git a/korganizer/publishdialog.h b/korganizer/publishdialog.h
index 338603c..3ffeec4 100644
--- a/korganizer/publishdialog.h
+++ b/korganizer/publishdialog.h
@@ -2,54 +2,54 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef PUBLISHDIALOG_H
#define PUBLISHDIALOG_H
-#include <qlistview.h>
+#include <q3listview.h>
#include <libkcal/attendee.h>
#include "publishdialog_base.h"
using namespace KCal;
class PublishDialog : public PublishDialog_base
{
Q_OBJECT
public:
PublishDialog(QWidget* parent=0,const char* name=0,
- bool modal=true,WFlags fl=0);
+ bool modal=true,Qt::WFlags fl=0);
~PublishDialog();
void addAttendee(Attendee *attendee);
QString addresses();
signals:
void numMessagesChanged(int);
protected slots:
void addItem();
void removeItem();
void openAddressbook();
void updateItem();
void updateInput();
};
#endif // OUTGOINGDIALOG_H
diff --git a/korganizer/publishdialog_base.cpp b/korganizer/publishdialog_base.cpp
index 683f7e9..ce5c542 100644
--- a/korganizer/publishdialog_base.cpp
+++ b/korganizer/publishdialog_base.cpp
@@ -1,106 +1,109 @@
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/publishdialog_base.ui'
**
** Created: Sat Mar 29 22:31:35 2003
** by: The User Interface Compiler ()
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "publishdialog_base.h"
#include <qvariant.h>
-#include <qframe.h>
-#include <qheader.h>
+#include <q3frame.h>
+#include <q3header.h>
#include <qlabel.h>
#include <qlineedit.h>
-#include <qlistview.h>
+#include <q3listview.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3HBoxLayout>
/*
* Constructs a PublishDialog_base as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
-PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl )
+PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "PublishDialog_base" );
- PublishDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout");
+ PublishDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout");
- mAddressListView = new QListView( this, "mAddressListView" );
+ mAddressListView = new Q3ListView( this, "mAddressListView" );
mAddressListView->addColumn( tr2i18n( "Name" ) );
mAddressListView->addColumn( tr2i18n( "Email" ) );
PublishDialog_baseLayout->addMultiCellWidget( mAddressListView, 0, 3, 0, 1 );
TextLabel1 = new QLabel( this, "TextLabel1" );
PublishDialog_baseLayout->addWidget( TextLabel1, 4, 0 );
TextLabel2 = new QLabel( this, "TextLabel2" );
PublishDialog_baseLayout->addWidget( TextLabel2, 5, 0 );
mEmailLineEdit = new QLineEdit( this, "mEmailLineEdit" );
PublishDialog_baseLayout->addWidget( mEmailLineEdit, 5, 1 );
mNameLineEdit = new QLineEdit( this, "mNameLineEdit" );
PublishDialog_baseLayout->addWidget( mNameLineEdit, 4, 1 );
PushButton10 = new QPushButton( this, "PushButton10" );
PublishDialog_baseLayout->addWidget( PushButton10, 0, 2 );
PushButton12 = new QPushButton( this, "PushButton12" );
PublishDialog_baseLayout->addWidget( PushButton12, 2, 2 );
PushButton11 = new QPushButton( this, "PushButton11" );
PublishDialog_baseLayout->addWidget( PushButton11, 1, 2 );
QSpacerItem* spacer = new QSpacerItem( 20, 241, QSizePolicy::Minimum, QSizePolicy::Expanding );
PublishDialog_baseLayout->addMultiCell( spacer, 3, 5, 2, 2 );
- Line2 = new QFrame( this, "Line2" );
- Line2->setFrameShape( QFrame::HLine );
- Line2->setFrameShadow( QFrame::Sunken );
- Line2->setFrameShape( QFrame::HLine );
+ Line2 = new Q3Frame( this, "Line2" );
+ Line2->setFrameShape( Q3Frame::HLine );
+ Line2->setFrameShadow( Q3Frame::Sunken );
+ Line2->setFrameShape( Q3Frame::HLine );
PublishDialog_baseLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 );
- layout95 = new QHBoxLayout( 0, 0, 6, "layout95");
+ layout95 = new Q3HBoxLayout( 0, 0, 6, "layout95");
QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout95->addItem( spacer_2 );
PushButton9 = new QPushButton( this, "PushButton9" );
PushButton9->setDefault( TRUE );
layout95->addWidget( PushButton9 );
PushButton8 = new QPushButton( this, "PushButton8" );
layout95->addWidget( PushButton8 );
PublishDialog_baseLayout->addMultiCellLayout( layout95, 7, 7, 0, 2 );
languageChange();
resize( QSize(420, 379).expandedTo(minimumSizeHint()) );
// signals and slots connections
connect( PushButton10, SIGNAL( clicked() ), this, SLOT( addItem() ) );
connect( PushButton11, SIGNAL( clicked() ), this, SLOT( removeItem() ) );
connect( PushButton12, SIGNAL( clicked() ), this, SLOT( openAddressbook() ) );
connect( PushButton9, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( mNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( updateItem() ) );
connect( mEmailLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( updateItem() ) );
connect( PushButton8, SIGNAL( clicked() ), this, SLOT( reject() ) );
// tab order
diff --git a/korganizer/publishdialog_base.h b/korganizer/publishdialog_base.h
index 932474e..d1b40ae 100644
--- a/korganizer/publishdialog_base.h
+++ b/korganizer/publishdialog_base.h
@@ -1,60 +1,66 @@
/****************************************************************************
** Form interface generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/publishdialog_base.ui'
**
** Created: Sat Mar 29 22:24:27 2003
** by: The User Interface Compiler ()
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef PUBLISHDIALOG_BASE_H
#define PUBLISHDIALOG_BASE_H
#include <qvariant.h>
#include <qdialog.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3Frame>
+#include <Q3GridLayout>
+#include <Q3HBoxLayout>
+#include <QLabel>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QFrame;
+class Q3VBoxLayout;
+class Q3HBoxLayout;
+class Q3GridLayout;
+class Q3Frame;
class QLabel;
class QLineEdit;
-class QListView;
-class QListViewItem;
+class Q3ListView;
+class Q3ListViewItem;
class QPushButton;
class PublishDialog_base : public QDialog
{
Q_OBJECT
public:
- PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~PublishDialog_base();
- QListView* mAddressListView;
+ Q3ListView* mAddressListView;
QLabel* TextLabel1;
QLabel* TextLabel2;
QLineEdit* mEmailLineEdit;
QLineEdit* mNameLineEdit;
QPushButton* PushButton10;
QPushButton* PushButton12;
QPushButton* PushButton11;
- QFrame* Line2;
+ Q3Frame* Line2;
QPushButton* PushButton9;
QPushButton* PushButton8;
protected:
- QGridLayout* PublishDialog_baseLayout;
- QHBoxLayout* layout95;
+ Q3GridLayout* PublishDialog_baseLayout;
+ Q3HBoxLayout* layout95;
protected slots:
virtual void languageChange();
virtual void addItem();
virtual void removeItem();
virtual void openAddressbook();
virtual void updateItem();
};
#endif // PUBLISHDIALOG_BASE_H
diff --git a/korganizer/savetemplatedialog.cpp b/korganizer/savetemplatedialog.cpp
index 3544081..35bedba 100644
--- a/korganizer/savetemplatedialog.cpp
+++ b/korganizer/savetemplatedialog.cpp
@@ -1,63 +1,66 @@
/*
This file is part of KOrganizer.
Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlayout.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3Frame>
#include <keditlistbox.h>
#include <klocale.h>
#include "koprefs.h"
#include "savetemplatedialog.h"
SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent )
: KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0,
true, false ),
mType( type )
{
- QFrame *topFrame = plainPage();
- QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() );
+ Q3Frame *topFrame = plainPage();
+ Q3VBoxLayout *topLayout = new Q3VBoxLayout( topFrame, 0, spacingHint() );
mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame,
0, false, KEditListBox::Add |
KEditListBox::Remove );
topLayout->addWidget( mEditListBox );
connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) );
QStringList templates;
if ( mType == EventType ) {
templates = KOPrefs::instance()->mEventTemplates;
} else if( mType == TodoType ) {
templates = KOPrefs::instance()->mTodoTemplates;
}
mEditListBox->insertStringList( templates );
}
SaveTemplateDialog::~SaveTemplateDialog()
{
}
void SaveTemplateDialog::slotOk()
{
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 9cfdc35..105b844 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -3,160 +3,167 @@
Copyright (c) 1998 Preston Brown
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlayout.h>
#include <qcheckbox.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include <qlabel.h>
-#include <qlistview.h>
-#include <qwhatsthis.h>
+#include <q3listview.h>
+#include <q3whatsthis.h>
#include <qlineedit.h>
#include <qpushbutton.h>
-#include <qhbuttongroup.h>
+//#include <qhbuttongroup.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3Frame>
+#include <Q3PtrList>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
#include <klocale.h>
#include <kmessagebox.h>
#include <libkdepim/kdateedit.h>
#include "koglobals.h"
#include "koprefs.h"
#include "klineedit.h"
#include "calendarview.h"
#include "koviewmanager.h"
#include "searchdialog.h"
SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
- : QVBox( 0 )
+ : Q3VBox( 0 )
{
mCalendar = calendar;
- QFrame *topFrame = new QFrame( this ) ;//plainPage();
- QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
+ Q3Frame *topFrame = new Q3Frame( this ) ;//plainPage();
+ Q3VBoxLayout *layout = new Q3VBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
// Search expression
- QHBoxLayout *subLayout = new QHBoxLayout();
+ Q3HBoxLayout *subLayout = new Q3HBoxLayout();
layout->addLayout(subLayout);
/*
searchLabel = new QLabel(topFrame);
searchLabel->setText(i18n("Search for:"));
subLayout->addWidget(searchLabel);
*/
QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame );
//OkButton->setDefault( true );
connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
subLayout->addWidget(OkButton);
searchEdit = new KLineEdit(topFrame);
subLayout->addWidget(searchEdit);
mAddItems = new QRadioButton( "+ ", topFrame );
mSubItems = new QRadioButton( "- ", topFrame );
mRefineItems = new QRadioButton( "< ", topFrame );
subLayout->addWidget( mAddItems );
subLayout->addWidget( mSubItems );
subLayout->addWidget( mRefineItems );
QFont fo ( mAddItems->font() );
fo.setBold( true );
fo.setPointSize( fo.pointSize() + 2 );
mAddItems->setFont( fo );
mSubItems->setFont( fo );
mRefineItems->setFont( fo );
connect( mAddItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_add( bool )));
connect( mSubItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_sub( bool )));
connect( mRefineItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_refine( bool )));
QPushButton *togButton = new QPushButton( "", topFrame );
subLayout->addWidget(togButton);
connect(togButton,SIGNAL(clicked()),SLOT(toggleCheckboxes()));
togButton->setPixmap(SmallIcon("1updownarrow"));
togButton->setMinimumWidth( togButton->sizeHint().height() );
searchEdit->setText("*"); // Find all events by default
searchEdit->setFocus();
connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
// Subjects to search
// QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
// topFrame);
- incidenceGroup = new QHBox( topFrame );
+ incidenceGroup = new Q3HBox( topFrame );
layout->addWidget(incidenceGroup);
mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
//mSearchEvent->setChecked(true);
mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
- subjectGroup = new QHBox( topFrame );
+ subjectGroup = new Q3HBox( topFrame );
layout->addWidget(subjectGroup);
mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
mSummaryCheck->setChecked(true);
mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup);
mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup);
- attendeeGroup = new QHBox( topFrame );
+ attendeeGroup = new Q3HBox( topFrame );
layout->addWidget(attendeeGroup );
new QLabel( i18n("Attendee:"),attendeeGroup );
mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
// Date range
// QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
// topFrame);
// layout->addWidget(rangeGroup);
QWidget *rangeWidget = new QWidget(topFrame);
int space = KDialog::spacingHint();
if ( QApplication::desktop()->width() <= 240 ) space = 1;
- QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,space);
+ Q3HBoxLayout *rangeLayout = new Q3HBoxLayout(rangeWidget,0,space);
rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
mStartDate = new KDateEdit(rangeWidget);
rangeLayout->addWidget(mStartDate);
rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
mEndDate = new KDateEdit(rangeWidget);
mEndDate->setDate(QDate::currentDate().addDays(365));
rangeLayout->addWidget(mEndDate);
- QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
+ QToolButton *wt = Q3WhatsThis::whatsThisButton ( rangeWidget );
rangeLayout->addWidget( (QWidget*)wt );
layout->addWidget(rangeWidget);
// Results list view
listView = new KOListView(mCalendar,topFrame);
layout->addWidget(listView);
listView->showCompletedTodos();
//layout->setStretchFactor( listView, 333 );
//listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) );
//listView->setMaximumHeight( 50 );
listView->readSettings(KOGlobals::config(),"SearchListView Layout");
connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
setCaption( i18n("KO/Pi Find: "));
#ifdef DESKTOP_VERSION
OkButton = new QPushButton( i18n("Close"), this );
connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
#endif
}
SearchDialog::~SearchDialog()
{
}
void SearchDialog::slot_add( bool b )
@@ -320,49 +327,49 @@ void SearchDialog::updateConfig()
void SearchDialog::updateView()
{
//qDebug("SearchDialog::updateView() %d ", isVisible());
QRegExp re;
re.setWildcard(true); // most people understand these better.
re.setCaseSensitive(false);
QString st = searchEdit->text();
if ( st.right(1) != "*")
st += "*";
re.setPattern(st);
mMatchedEvents.clear();
mMatchedTodos.clear();
mMatchedJournals.clear();
if (re.isValid()) {
search(re);
}
listView->setStartDate( mStartDate->date() );
listView->showEvents(mMatchedEvents);
listView->addTodos(mMatchedTodos);
listView->addJournals(mMatchedJournals);
}
void SearchDialog::search(const QRegExp &re)
{
- QPtrList<Event> events;
+ Q3PtrList<Event> events;
if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
if ( mRefineItems->isChecked() ) events = mMatchedEvents;
mMatchedEvents.clear();
}
if ( mSearchEvent->isChecked() ) {
if ( !mRefineItems->isChecked() )
events = mCalendar->events( mStartDate->date(),
mEndDate->date(),
false /*mInclusiveCheck->isChecked()*/ );
Event *ev;
for(ev=events.first();ev;ev=events.next()) {
if (mSummaryCheck->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(ev->summary()) != -1)
#else
if (re.match(ev->summary()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedEvents.remove(ev);
else {
if ( !mMatchedEvents.contains( ev ) )
@@ -398,88 +405,88 @@ void SearchDialog::search(const QRegExp &re)
if ( !mMatchedEvents.contains( ev ) )
mMatchedEvents.append(ev);
}
continue;
}
}
if (mCategoryCheck->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(ev->categoriesStr()) != -1)
#else
if (re.match(ev->categoriesStr()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedEvents.remove(ev);
else{
if ( !mMatchedEvents.contains( ev ) )
mMatchedEvents.append(ev);
}
continue;
}
}
if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
- QPtrList<Attendee> tmpAList = ev->attendees();
+ Q3PtrList<Attendee> tmpAList = ev->attendees();
Attendee *a;
for (a = tmpAList.first(); a; a = tmpAList.next()) {
if (mSearchAName->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(a->name()) != -1)
#else
if (re.match(a->name()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedEvents.remove(ev);
else{
if ( !mMatchedEvents.contains( ev ) )
mMatchedEvents.append(ev);
}
break;
}
}
if (mSearchAEmail->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(a->email()) != -1)
#else
if (re.match(a->email()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedEvents.remove(ev);
else{
if ( !mMatchedEvents.contains( ev ) )
mMatchedEvents.append(ev);
}
break;
}
}
}
}
}
}
- QPtrList<Todo> todos;
+ Q3PtrList<Todo> todos;
if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
if ( mRefineItems->isChecked() ) todos = mMatchedTodos ;
mMatchedTodos.clear();
}
if ( mSearchTodo->isChecked() ) {
if ( !mRefineItems->isChecked() ) todos = mCalendar->todos( );
Todo *tod;
for(tod=todos.first();tod;tod=todos.next()) {
if (mSummaryCheck->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(tod->summary()) != -1)
#else
if (re.match(tod->summary()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedTodos.remove(tod);
else if (!mMatchedTodos.contains( tod ))
mMatchedTodos.append(tod);
continue;
}
}
@@ -491,85 +498,85 @@ void SearchDialog::search(const QRegExp &re)
#endif
{
if ( mSubItems->isChecked() )
mMatchedTodos.remove(tod);
else if (!mMatchedTodos.contains( tod ))
mMatchedTodos.append(tod);
continue;
}
}
if (mCategoryCheck->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(tod->categoriesStr()) != -1)
#else
if (re.match(tod->categoriesStr()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedTodos.remove(tod);
else if (!mMatchedTodos.contains( tod ))
mMatchedTodos.append(tod);
continue;
}
}
if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
- QPtrList<Attendee> tmpAList = tod->attendees();
+ Q3PtrList<Attendee> tmpAList = tod->attendees();
Attendee *a;
for (a = tmpAList.first(); a; a = tmpAList.next()) {
if (mSearchAName->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(a->name()) != -1)
#else
if (re.match(a->name()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedTodos.remove(tod);
else if (!mMatchedTodos.contains( tod ))
mMatchedTodos.append(tod);
break;
}
}
if (mSearchAEmail->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(a->email()) != -1)
#else
if (re.match(a->email()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedTodos.remove(tod);
else if (!mMatchedTodos.contains( tod ))
mMatchedTodos.append(tod);
break;
}
}
}
}
}
}
- QPtrList<Journal> journals;
+ Q3PtrList<Journal> journals;
if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
if ( mRefineItems->isChecked() ) journals = mMatchedJournals ;
mMatchedJournals.clear();
}
if (mSearchJournal->isChecked() ) {
if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals();
Journal* journ;
for(journ=journals.first();journ;journ=journals.next()) {
if ( journ->dtStart().date() <= mEndDate->date()
&&journ->dtStart().date() >= mStartDate->date()) {
if (mDescriptionCheck->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(journ->description()) != -1)
#else
if (re.match(journ->description()) != -1)
#endif
{
if ( mSubItems->isChecked() )
mMatchedJournals.remove(journ);
else if (!mMatchedJournals.contains( journ ))
mMatchedJournals.append(journ);
continue;
}
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index 945ff65..5df6116 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -5,98 +5,102 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef SEARCHDIALOG_H
#define SEARCHDIALOG_H
#include <qregexp.h>
#include <qradiobutton.h>
+//Added by qt3to4:
+#include <QLabel>
+#include <QKeyEvent>
+#include <Q3PtrList>
#include <kdialogbase.h>
-#include <qvbox.h>
+#include <q3vbox.h>
#include <libkcal/calendar.h>
#include "kolistview.h"
class KDateEdit;
class QCheckBox;
class QLineEdit;
class KLineEdit;
class QLabel;
class CalendarView;
using namespace KCal;
-class SearchDialog : public QVBox
+class SearchDialog : public Q3VBox
{
Q_OBJECT
public:
SearchDialog(Calendar *calendar,CalendarView *parent=0);
virtual ~SearchDialog();
KOListView *listview(){ return listView;}
void updateView();
void raiseAndSelect();
public slots:
void changeEventDisplay(Event *, int) { updateView(); }
void updateConfig();
void updateList();
protected slots:
void setFocusToList();
void accept();
void doSearch();
void searchTextChanged( const QString &_text );
void toggleCheckboxes();
void slot_add( bool );
void slot_sub( bool );
void slot_refine( bool );
signals:
void showEventSignal(Event *);
void editEventSignal(Event *);
void deleteEventSignal(Event *);
private:
- QHBox *incidenceGroup ,*subjectGroup ,*attendeeGroup;
+ Q3HBox *incidenceGroup ,*subjectGroup ,*attendeeGroup;
void search(const QRegExp &);
Calendar *mCalendar;
- QPtrList<Event> mMatchedEvents;
- QPtrList<Todo> mMatchedTodos;
- QPtrList<Journal> mMatchedJournals;
+ Q3PtrList<Event> mMatchedEvents;
+ Q3PtrList<Todo> mMatchedTodos;
+ Q3PtrList<Journal> mMatchedJournals;
QLabel *searchLabel;
KLineEdit *searchEdit;
KOListView *listView;
KDateEdit *mStartDate;
KDateEdit *mEndDate;
QCheckBox *mSummaryCheck;
QCheckBox *mDescriptionCheck;
QCheckBox *mCategoryCheck;
QCheckBox *mSearchEvent;
QCheckBox *mSearchTodo;
QCheckBox *mSearchJournal;
QCheckBox *mSearchAName;
QCheckBox *mSearchAEmail;
QRadioButton *mAddItems, *mSubItems, *mRefineItems;
void keyPressEvent ( QKeyEvent *e) ;
};
#endif
diff --git a/korganizer/statusdialog.cpp b/korganizer/statusdialog.cpp
index 7137c49..8186ebb 100644
--- a/korganizer/statusdialog.cpp
+++ b/korganizer/statusdialog.cpp
@@ -1,66 +1,69 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <qlabel.h>
#include <qpushbutton.h>
#include <qstringlist.h>
#include <qlayout.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3HBoxLayout>
#include <kdebug.h>
#include <klocale.h>
#include "statusdialog.h"
StatusDialog::StatusDialog(QWidget* parent, const char* name) :
KDialog(parent,name,true)
{
setCaption(i18n("Set Your Status"));
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
topLayout->setSpacing( spacingHint() );
topLayout->setMargin( marginHint() );
- QBoxLayout *statusLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *statusLayout = new Q3HBoxLayout( topLayout );
QLabel *text = new QLabel(i18n("Set your status"),this);
statusLayout->addWidget( text );
mStatus = new QComboBox(false,this);
mStatus->insertStringList(Attendee::statusList());
statusLayout->addWidget( mStatus );
- QBoxLayout *buttonLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *buttonLayout = new Q3HBoxLayout( topLayout );
QPushButton *ok = new QPushButton(i18n("&OK"), this);
connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) );
buttonLayout->addWidget( ok );
QPushButton *cancel = new QPushButton(i18n("&Cancel"), this);
connect ( cancel,SIGNAL(clicked()), this,SLOT(reject()) );
buttonLayout->addWidget( cancel );
}
StatusDialog::~StatusDialog()
{
}
Attendee::PartStat StatusDialog::status()
{
return Attendee::PartStat( mStatus->currentItem() ) ;
}
diff --git a/korganizer/timeline.cpp b/korganizer/timeline.cpp
index 11be432..a6c3cdc 100644
--- a/korganizer/timeline.cpp
+++ b/korganizer/timeline.cpp
@@ -1,62 +1,62 @@
#include <qpainter.h>
#include <kdebug.h>
#include "timeline.h"
TimeLine::TimeLine( QWidget *parent, const char *name ) :
- QScrollView( parent, name )
+ Q3ScrollView( parent, name )
{
mPixelWidth = 1000;
resizeContents( mPixelWidth, 20 );
- viewport()->setBackgroundMode( PaletteBackground );
+ viewport()->setBackgroundMode( Qt::PaletteBackground );
setHScrollBarMode(AlwaysOff);
setVScrollBarMode(AlwaysOff);
}
TimeLine::~TimeLine()
{
}
void TimeLine::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
{
int spacingX = mDaySpacing;
int offsetX = mDayOffset;
// Draw vertical lines of grid
// kdDebug() << "drawContents cx: " << cx << " cy: " << cy << " cw: " << cw << " ch: " << ch << endl;
int cell = int( (cx - ( spacingX - offsetX ) ) / spacingX );
int x = cell * spacingX + ( spacingX - offsetX );
// kdDebug() << " x: " << x << endl;
while (x < cx + cw) {
// kdDebug() << " x: " << x << endl;
p->drawLine(x,cy,x,cy+ch);
p->drawText( x + 5, 15, QString::number( mStartDate.addDays( cell + 1 ).date().day() ) );
x += spacingX;
cell++;
}
}
void TimeLine::setDateRange( const QDateTime &start, const QDateTime &end )
{
mStartDate = start;
mEndDate = end;
mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mPixelWidth;
mDaySpacing = 60 * 60 * 24 / mSecsPerPixel;
mDayOffset = QDateTime( mStartDate.date() ).secsTo( mStartDate ) / mSecsPerPixel;
kdDebug() << "TimeLines::setDateRange(): mDaySpacing: " << mDaySpacing << " mDayOffset: "
<< mDayOffset << " mSecsPerPixel: " << mSecsPerPixel << endl;
}
void TimeLine::setContentsPos( int pos )
{
- QScrollView::setContentsPos ( pos, 0 );
+ Q3ScrollView::setContentsPos ( pos, 0 );
}
diff --git a/korganizer/timeline.h b/korganizer/timeline.h
index ab3e5d3..bf301fa 100644
--- a/korganizer/timeline.h
+++ b/korganizer/timeline.h
@@ -1,31 +1,31 @@
#ifndef TIMELINE_H
#define TIMELINE_H
-#include <qscrollview.h>
+#include <q3scrollview.h>
#include <qdatetime.h>
-class TimeLine : public QScrollView
+class TimeLine : public Q3ScrollView
{
Q_OBJECT
public:
TimeLine( QWidget *parent = 0, const char *name = 0 );
virtual ~TimeLine();
void setDateRange( const QDateTime &start, const QDateTime &end );
public slots:
void setContentsPos( int pos );
protected:
void drawContents(QPainter* p, int cx, int cy, int cw, int ch);
private:
QDateTime mStartDate;
QDateTime mEndDate;
int mPixelWidth;
int mDaySpacing;
int mDayOffset;
int mSecsPerPixel;
};
diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp
index df8ff88..0908056 100644
--- a/korganizer/timespanview.cpp
+++ b/korganizer/timespanview.cpp
@@ -1,103 +1,107 @@
#ifndef DESKTOP_VERSION
#include <qksplitter.h>
#else
#include <qsplitter.h>
#endif
-#include <qlistview.h>
+#include <q3listview.h>
#include <qlayout.h>
-#include <qheader.h>
+#include <q3header.h>
#include <qpushbutton.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3VBoxLayout>
+#include <Q3ValueList>
#include <klocale.h>
#include <kdebug.h>
#include "lineview.h"
#include "timeline.h"
#include "timespanview.h"
TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) :
QWidget( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
#ifndef DESKTOP_VERSION
mSplitter = new QKSplitter( this );
#else
mSplitter = new QSplitter( this );
#endif
topLayout->addWidget( mSplitter );
- mList = new QListView( mSplitter );
+ mList = new Q3ListView( mSplitter );
mList->addColumn( i18n("Summary") );
QWidget *rightPane = new QWidget( mSplitter );
- QBoxLayout *rightPaneLayout = new QVBoxLayout( rightPane );
+ Q3BoxLayout *rightPaneLayout = new Q3VBoxLayout( rightPane );
mTimeLine = new TimeLine( rightPane );
mTimeLine->setFixedHeight( mList->header()->height() );
rightPaneLayout->addWidget( mTimeLine );
mLineView = new LineView( rightPane );
rightPaneLayout->addWidget( mLineView );
- QBoxLayout *buttonLayout = new QHBoxLayout( rightPaneLayout );
+ Q3BoxLayout *buttonLayout = new Q3HBoxLayout( rightPaneLayout );
QPushButton *zoomInButton = new QPushButton( i18n("Zoom In"), rightPane );
connect( zoomInButton, SIGNAL( clicked() ), SLOT( zoomIn() ) );
buttonLayout->addWidget( zoomInButton );
QPushButton *zoomOutButton = new QPushButton( i18n("Zoom Out"), rightPane );
connect( zoomOutButton, SIGNAL( clicked() ), SLOT( zoomOut() ) );
buttonLayout->addWidget( zoomOutButton );
QPushButton *centerButton = new QPushButton( i18n("Center View"), rightPane );
connect( centerButton, SIGNAL( clicked() ), SLOT( centerView() ) );
buttonLayout->addWidget( centerButton );
connect(mLineView->horizontalScrollBar(),SIGNAL(valueChanged(int)),
mTimeLine,SLOT(setContentsPos(int)));
}
TimeSpanView::~TimeSpanView()
{
}
-QValueList<int> TimeSpanView::splitterSizes()
+Q3ValueList<int> TimeSpanView::splitterSizes()
{
return mSplitter->sizes();
}
-void TimeSpanView::setSplitterSizes( QValueList<int> sizes )
+void TimeSpanView::setSplitterSizes( Q3ValueList<int> sizes )
{
mSplitter->setSizes( sizes );
}
void TimeSpanView::addItem( KCal::Event *event )
{
- new QListViewItem( mList, event->summary() );
+ new Q3ListViewItem( mList, event->summary() );
QDateTime startDt = event->dtStart();
QDateTime endDt = event->dtEnd();
// kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString()
// << " end: " << endDt.toString() << endl;
int startSecs = mStartDate.secsTo( startDt );
int durationSecs = startDt.secsTo( endDt );
// kdDebug() << "--- startSecs: " << startSecs << " dur: " << durationSecs << endl;
int startX = mStartDate.secsTo( startDt ) / mSecsPerPixel;
int endX = startX + startDt.secsTo( endDt ) / mSecsPerPixel;
// kdDebug() << "TimeSpanView::addItem(): s: " << startX << " e: " << endX << endl;
mLineView->addLine( startX, endX );
}
void TimeSpanView::clear()
{
mList->clear();
mLineView->clear();
diff --git a/korganizer/timespanview.h b/korganizer/timespanview.h
index 34cb1f7..f652374 100644
--- a/korganizer/timespanview.h
+++ b/korganizer/timespanview.h
@@ -1,60 +1,62 @@
#ifndef TIMESPANVIEW_H
#define TIMESPANVIEW_H
#include <qwidget.h>
+//Added by qt3to4:
+#include <Q3ValueList>
#include <libkcal/event.h>
//class QSplitter;
#ifndef DESKTOP_VERSION
class QKSplitter;
#else
class QSplitter;
#define QKSplitter QSplitter
#endif
-class QListView;
+class Q3ListView;
class LineView;
class TimeLine;
class TimeSpanView : public QWidget
{
Q_OBJECT
public:
TimeSpanView( QWidget *parent=0, const char *name=0 );
virtual ~TimeSpanView();
void addItem( KCal::Event * );
- QValueList<int> splitterSizes();
- void setSplitterSizes( QValueList<int> );
+ Q3ValueList<int> splitterSizes();
+ void setSplitterSizes( Q3ValueList<int> );
void clear();
void setDateRange( const QDateTime &start, const QDateTime &end );
QDateTime startDateTime();
QDateTime endDateTime();
public slots:
void updateView();
void zoomIn();
void zoomOut();
void centerView();
signals:
void dateRangeChanged();
private:
QKSplitter *mSplitter;
- QListView *mList;
+ Q3ListView *mList;
TimeLine *mTimeLine;
LineView *mLineView;
QDateTime mStartDate;
QDateTime mEndDate;
int mSecsPerPixel;
};
#endif