summaryrefslogtreecommitdiff
path: root/core
authorzecke <zecke>2002-06-23 18:18:27 (UTC)
committer zecke <zecke>2002-06-23 18:18:27 (UTC)
commitf0e656b51a2dcee1dec594636cbc1ba8d4b11eef (patch) (side-by-side diff)
tree1eb83b120f8ce404324575799d75c32d4056d1f6 /core
parent6fd46f6d23538ec6e0f48209f6c0f0d939a2effe (diff)
downloadopie-f0e656b51a2dcee1dec594636cbc1ba8d4b11eef.zip
opie-f0e656b51a2dcee1dec594636cbc1ba8d4b11eef.tar.gz
opie-f0e656b51a2dcee1dec594636cbc1ba8d4b11eef.tar.bz2
Patch by <tboc@gmx.de> to configure the size
of the row of the dayview Adds an option to jump to the current time in the dayview and some small fixes ( zecke )
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp14
-rw-r--r--core/pim/datebook/datebook.h2
-rw-r--r--core/pim/datebook/datebook.pro3
-rw-r--r--core/pim/datebook/datebookday.cpp65
-rw-r--r--core/pim/datebook/datebookday.h6
-rw-r--r--core/pim/datebook/datebooksettings.cpp20
-rw-r--r--core/pim/datebook/datebooksettings.h7
-rw-r--r--core/pim/datebook/datebooksettingsbase.ui371
-rw-r--r--core/pim/datebook/datebookweeklst.cpp64
9 files changed, 406 insertions, 146 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index c0d45c9..7dd93a6 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -77,12 +77,14 @@
DateBook::DateBook( QWidget *parent, const char *, WFlags f )
: QMainWindow( parent, "datebook", f ),
aPreset( FALSE ),
presetTime( -1 ),
startTime( 8 ), // an acceptable default
+ rowStyle( 0 ),
+ bJumpToCurTime(FALSE),
syncing(FALSE),
inSearch(FALSE),
alarmCounter(0)
{
QTime t;
t.start();
@@ -246,22 +248,28 @@ DateBook::~DateBook()
void DateBook::slotSettings()
{
DateBookSettings frmSettings( ampm, this );
frmSettings.setStartTime( startTime );
frmSettings.setAlarmPreset( aPreset, presetTime );
+ frmSettings.setJumpToCurTime( bJumpToCurTime );
+ frmSettings.setRowStyle( rowStyle );
#if defined (Q_WS_QWS) || defined(_WS_QWS_)
frmSettings.showMaximized();
#endif
if ( frmSettings.exec() ) {
aPreset = frmSettings.alarmPreset();
presetTime = frmSettings.presetTime();
startTime = frmSettings.startTime();
+ bJumpToCurTime = frmSettings.jumpToCurTime();
+ rowStyle = frmSettings.rowStyle();
if ( dayView )
dayView->setStartViewTime( startTime );
+ dayView->setJumpToCurTime( bJumpToCurTime );
+ dayView->setRowStyle( rowStyle );
if ( weekView )
weekView->setStartViewTime( startTime );
saveSettings();
// make the change obvious
if ( views->visibleWidget() ) {
@@ -450,12 +458,14 @@ void DateBook::showDay( int year, int month, int day )
void DateBook::initDay()
{
if ( !dayView ) {
dayView = new DateBookDay( ampm, onMonday, db, views, "day view" );
views->addWidget( dayView, DAY );
dayView->setStartViewTime( startTime );
+ dayView->setJumpToCurTime( bJumpToCurTime );
+ dayView->setRowStyle( rowStyle );
connect( this, SIGNAL( newEvent() ),
dayView, SLOT( redraw() ) );
connect( dayView, SIGNAL( newEvent() ),
this, SLOT( fileNew() ) );
connect( dayView, SIGNAL( removeEvent( const Event & ) ),
this, SLOT( removeEvent( const Event & ) ) );
@@ -544,23 +554,27 @@ void DateBook::loadSettings()
{
Config config("DateBook");
config.setGroup("Main");
startTime = config.readNumEntry("startviewtime", 8);
aPreset = config.readBoolEntry("alarmpreset");
presetTime = config.readNumEntry("presettime");
+ bJumpToCurTime = config.readBoolEntry("jumptocurtime");
+ rowStyle = config.readNumEntry("rowstyle");
}
}
void DateBook::saveSettings()
{
Config config( "qpe" );
Config configDB( "DateBook" );
configDB.setGroup( "Main" );
configDB.writeEntry("startviewtime",startTime);
configDB.writeEntry("alarmpreset",aPreset);
configDB.writeEntry("presettime",presetTime);
+ configDB.writeEntry("jumptocurtime", bJumpToCurTime);
+ configDB.writeEntry("rowstyle", rowStyle);
}
void DateBook::newDefaultView(QAction *a) {
int val=DAY;
if (a->text() == "Day") val=DAY;
if (a->text() == "Week") val=WEEK;
diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h
index e7be0dd..ba8f97e 100644
--- a/core/pim/datebook/datebook.h
+++ b/core/pim/datebook/datebook.h
@@ -111,12 +111,14 @@ private:
DateBookMonth *monthView;
DateBookWeekLst *weekLstView;
QAction *dayAction, *weekAction, *weekLstAction, *monthAction;
bool aPreset; // have everything set to alarm?
int presetTime; // the standard time for the alarm
int startTime;
+ int rowStyle;
+ bool bJumpToCurTime; //should jump to current time in dayview?
bool ampm;
bool onMonday;
bool syncing;
bool inSearch;
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro
index 609b7dc..1db3e3a 100644
--- a/core/pim/datebook/datebook.pro
+++ b/core/pim/datebook/datebook.pro
@@ -4,12 +4,13 @@ DESTDIR = $(OPIEDIR)/bin
HEADERS = datebookday.h \
datebook.h \
dateentryimpl.h \
datebookdayheaderimpl.h \
datebooksettings.h \
+ datebooksettingsbase.h \
datebookweek.h \
datebookweeklst.h \
datebookweekheaderimpl.h \
repeatentry.h \
timepicker.h \
noteentryimpl.h \
@@ -17,24 +18,24 @@ HEADERS = datebookday.h \
SOURCES = main.cpp \
datebookday.cpp \
datebook.cpp \
dateentryimpl.cpp \
datebookdayheaderimpl.cpp \
+ datebooksettingsbase.cpp \
datebooksettings.cpp \
datebookweek.cpp \
datebookweeklst.cpp \
datebookweekheaderimpl.cpp \
repeatentry.cpp \
timepicker.cpp \
noteentryimpl.cpp \
onoteedit.cpp
INTERFACES = dateentry.ui \
datebookdayheader.ui \
- datebooksettingsbase.ui \
datebookweekheader.ui \
datebookweeklstheader.ui \
datebookweeklstdayhdr.ui \
repeatentrybase.ui \
noteentry.ui
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp
index c15ccef..9cc5fcd 100644
--- a/core/pim/datebook/datebookday.cpp
+++ b/core/pim/datebook/datebookday.cpp
@@ -57,13 +57,13 @@ DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent,
// get rid of being able to edit things...
QTableItem *tmp;
int row;
for ( row = 0; row < numRows(); row++ ) {
tmp = new QTableItem( this, QTableItem::Never, QString::null);
setItem( row, 0, tmp );
- setRowHeight( row, 40);
+ //setRowHeight( row, 40);
}
initHeader();
QObject::connect( qApp, SIGNAL(clockChanged(bool)),
this, SLOT(slotChangeClock(bool)) );
}
@@ -156,12 +156,19 @@ void DateBookDayView::keyPressEvent( QKeyEvent *e )
} else {
// I don't know what this key is, do you?
e->ignore();
}
}
+void DateBookDayView::setRowStyle( int style )
+{
+ if (style<0) style = 0;
+
+ for (int i=0; i<numRows(); i++)
+ setRowHeight(i, style*10+20);
+}
//===========================================================================
DateBookDay::DateBookDay( bool ampm, bool startOnMonday,
DateBookDB *newDb, QWidget *parent,
const char *name )
@@ -171,12 +178,13 @@ DateBookDay::DateBookDay( bool ampm, bool startOnMonday,
startTime( 0 )
{
widgetList.setAutoDelete( true );
header = new DateBookDayHeader( startOnMonday, this, "day header" );
header->setDate( currDate.year(), currDate.month(), currDate.day() );
view = new DateBookDayView( ampm, this, "day view" );
+
connect( header, SIGNAL( dateChanged( int, int, int ) ),
this, SLOT( dateChanged( int, int, int ) ) );
connect( view, SIGNAL( sigColWidthChanged() ),
this, SLOT( slotColWidthChanged() ) );
connect( qApp, SIGNAL(weekChanged(bool)),
this, SLOT(slotWeekChanged(bool)) );
@@ -190,12 +198,24 @@ DateBookDay::DateBookDay( bool ampm, bool startOnMonday,
timer->start( 1000*60*5, FALSE ); //update every 5min
selectedWidget = 0;
timeMarker = new DateBookDayTimeMarker( this );
timeMarker->setTime( QTime::currentTime() );
+ rowStyle = -1; // initialize with bogus values
+}
+
+void DateBookDay::setJumpToCurTime( bool bJump )
+{
+ jumpToCurTime = bJump;
+}
+
+void DateBookDay::setRowStyle( int style )
+{
+ if (rowStyle != style) view->setRowStyle( style );
+ rowStyle = style;
}
void DateBookDay::updateView( void )
{
timeMarker->setTime( QTime::currentTime() );
//need to find a way to update all DateBookDayWidgets
@@ -254,21 +274,27 @@ void DateBookDay::dateChanged( int y, int m, int d )
if ( currDate == date )
return;
currDate.setYMD( y, m, d );
relayoutPage();
dayView()->clearSelection();
QTableSelection ts;
- ts.init( startTime, 0 );
- ts.expandTo( startTime, 0 );
+
+ if (jumpToCurTime && this->date() == QDate::currentDate())
+ {
+ ts.init( QTime::currentTime().hour(), 0);
+ ts.expandTo( QTime::currentTime().hour(), 0);
+ } else
+ {
+ ts.init( startTime, 0 );
+ ts.expandTo( startTime, 0 );
+ }
+
dayView()->addSelection( ts );
selectedWidget = 0;
- if (this->date() == QDate::currentDate())
- timeMarker->show(); else timeMarker->hide();
-
}
void DateBookDay::redraw()
{
if ( isUpdatesEnabled() )
relayoutPage();
@@ -396,13 +422,16 @@ void DateBookDay::relayoutPage( bool fromResize )
while ( intersects( w, geom ) ) {
geom.moveBy( wd + 2 + 1, 0 );
}
w->setGeometry( geom );
}
- view->setContentsPos( 0, startTime * view->rowHeight(0) );
+ if (jumpToCurTime && this->date() == QDate::currentDate())
+ view->setContentsPos( 0, QTime::currentTime().hour() * view->rowHeight(0) ); //set listview to current hour
+ else
+ view->setContentsPos( 0, startTime * view->rowHeight(0) );
} else {
int hours[24];
@@ -441,17 +470,24 @@ void DateBookDay::relayoutPage( bool fromResize )
QRect geom = w->geometry();
geom.setX( xp*(wid+2) );
geom.setWidth( wid );
w->setGeometry( geom );
}
}
- view->setContentsPos( 0, startTime * view->rowHeight(0) );
+
+ if (jumpToCurTime && this->date() == QDate::currentDate())
+ view->setContentsPos( 0, QTime::currentTime().hour() * view->rowHeight(0) ); //set listview to current hour
+ else
+ view->setContentsPos( 0, startTime * view->rowHeight(0) );
}
timeMarker->setTime( QTime::currentTime() ); //display timeMarker
timeMarker->raise(); //on top of all widgets
+ if (this->date() == QDate::currentDate()) //only show timeMarker on current day
+ timeMarker->show(); else timeMarker->hide();
+
setUpdatesEnabled( TRUE );
return;
}
DateBookDayWidget *DateBookDay::intersects( const DateBookDayWidget *item, const QRect &geom )
{
@@ -476,14 +512,23 @@ QDate DateBookDay::date() const
void DateBookDay::setStartViewTime( int startHere )
{
startTime = startHere;
dayView()->clearSelection();
QTableSelection ts;
- ts.init( startTime, 0 );
- ts.expandTo( startTime, 0 );
+
+ if (jumpToCurTime && this->date() == QDate::currentDate()) //this should probably be in datebook.cpp where it's called?
+ {
+ ts.init( QTime::currentTime().hour(), 0);
+ ts.expandTo( QTime::currentTime().hour(), 0);
+ } else
+ {
+ ts.init( startTime, 0 );
+ ts.expandTo( startTime, 0 );
+ }
+
dayView()->addSelection( ts );
}
int DateBookDay::startViewTime() const
{
return startTime;
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h
index db0f3b6..be7cc45 100644
--- a/core/pim/datebook/datebookday.h
+++ b/core/pim/datebook/datebookday.h
@@ -37,12 +37,14 @@ class QResizeEvent;
class DateBookDayView : public QTable
{
Q_OBJECT
public:
DateBookDayView( bool hourClock, QWidget *parent, const char *name );
bool whichClock() const;
+
+ void setRowStyle( int style );
public slots:
void moveUp();
void moveDown();
signals:
@@ -146,12 +148,14 @@ public:
QDate date() const;
DateBookDayView *dayView() const { return view; }
void setStartViewTime( int startHere );
int startViewTime() const;
void setSelectedWidget( DateBookDayWidget * );
DateBookDayWidget * getSelectedWidget( void );
+ void setJumpToCurTime( bool bJump );
+ void setRowStyle( int style );
public slots:
void setDate( int y, int m, int d );
void setDate( QDate );
void redraw();
void slotWeekChanged( bool bStartOnMonday );
@@ -178,11 +182,13 @@ private:
QDate currDate;
DateBookDayView *view;
DateBookDayHeader *header;
DateBookDB *db;
WidgetListClass widgetList; //reimplemented QList for sorting widgets by height
int startTime;
+ bool jumpToCurTime; //should we jump to current time in dayview?
+ int rowStyle;
DateBookDayWidget *selectedWidget; //actual selected widget (obviously)
DateBookDayTimeMarker *timeMarker; //marker for current time
};
#endif
diff --git a/core/pim/datebook/datebooksettings.cpp b/core/pim/datebook/datebooksettings.cpp
index c5d8ac1..49fcd17 100644
--- a/core/pim/datebook/datebooksettings.cpp
+++ b/core/pim/datebook/datebooksettings.cpp
@@ -130,6 +130,26 @@ void DateBookSettings::slotChangeClock( bool whichClock )
saveMe += 12;
}
ampm = whichClock;
init();
setStartTime( saveMe );
}
+
+void DateBookSettings::setJumpToCurTime( bool bJump )
+{
+ chkJumpToCurTime->setChecked( bJump );
+}
+
+bool DateBookSettings::jumpToCurTime() const
+{
+ return chkJumpToCurTime->isChecked();
+}
+
+void DateBookSettings::setRowStyle( int style )
+{
+ comboRowStyle->setCurrentItem( style );
+}
+
+int DateBookSettings::rowStyle() const
+{
+ return comboRowStyle->currentItem();
+}
diff --git a/core/pim/datebook/datebooksettings.h b/core/pim/datebook/datebooksettings.h
index ee9f39c..90a07f9 100644
--- a/core/pim/datebook/datebooksettings.h
+++ b/core/pim/datebook/datebooksettings.h
@@ -32,13 +32,18 @@ public:
int startTime() const;
void setAlarmPreset( bool bAlarm, int presetTime );
bool alarmPreset() const;
int presetTime() const;
void setAlarmType( int alarmType );
int alarmType() const;
-
+
+ void setJumpToCurTime( bool bJump );
+ bool jumpToCurTime() const;
+ void setRowStyle( int style );
+ int rowStyle() const;
+
private slots:
void slot12Hour( int );
void slotChangeClock( bool );
private:
void init();
diff --git a/core/pim/datebook/datebooksettingsbase.ui b/core/pim/datebook/datebooksettingsbase.ui
index 0f40773..816a441 100644
--- a/core/pim/datebook/datebooksettingsbase.ui
+++ b/core/pim/datebook/datebooksettingsbase.ui
@@ -29,13 +29,13 @@
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>232</width>
+ <width>220</width>
<height>290</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Preferences</string>
@@ -43,22 +43,22 @@
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
- <vbox>
+ <grid>
<property stdset="1">
<name>margin</name>
- <number>5</number>
+ <number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
- <number>1</number>
+ <number>6</number>
</property>
- <widget>
+ <widget row="0" column="0" >
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>fraStart</cstring>
</property>
<property stdset="1">
@@ -70,151 +70,318 @@
<enum>Sunken</enum>
</property>
<property stdset="1">
<name>title</name>
<string>Start viewing events</string>
</property>
- <vbox>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
- <name>margin</name>
- <number>11</number>
+ <name>name</name>
+ <cstring>Layout6</cstring>
</property>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>geometry</name>
+ <rect>
+ <x>3</x>
+ <y>21</y>
+ <width>210</width>
+ <height>53</height>
+ </rect>
</property>
- <widget>
- <class>QLayoutWidget</class>
+ <grid>
<property stdset="1">
- <name>name</name>
- <cstring>Layout1</cstring>
+ <name>margin</name>
+ <number>0</number>
</property>
- <hbox>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer row="1" column="0" >
+ <property>
+ <name>name</name>
+ <cstring>Spacer1</cstring>
+ </property>
<property stdset="1">
- <name>margin</name>
- <number>0</number>
+ <name>orientation</name>
+ <enum>Vertical</enum>
</property>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>sizeType</name>
+ <enum>Expanding</enum>
</property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>lblStartTime</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Start Time:</string>
- </property>
- </widget>
- <widget>
- <class>QSpinBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>spinStart</cstring>
- </property>
- <property stdset="1">
- <name>suffix</name>
- <string>:00</string>
- </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget row="0" column="0" >
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
<property stdset="1">
- <name>wrapping</name>
- <bool>true</bool>
+ <name>margin</name>
+ <number>0</number>
</property>
<property stdset="1">
- <name>maxValue</name>
- <number>23</number>
+ <name>spacing</name>
+ <number>6</number>
</property>
- </widget>
- </hbox>
- </widget>
- </vbox>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>lblStartTime</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Start Time:</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>spinStart</cstring>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string>:00</string>
+ </property>
+ <property stdset="1">
+ <name>wrapping</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>23</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
</widget>
- <widget>
+ <widget row="1" column="0" >
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>fraAlarm</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>Alarm Settings</string>
</property>
- <vbox>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
- <name>margin</name>
- <number>11</number>
+ <name>name</name>
+ <cstring>Layout4</cstring>
</property>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>geometry</name>
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>200</width>
+ <height>53</height>
+ </rect>
</property>
- <widget>
- <class>QLayoutWidget</class>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
<property stdset="1">
- <name>name</name>
- <cstring>Layout6</cstring>
+ <name>spacing</name>
+ <number>6</number>
</property>
- <hbox>
+ <spacer row="1" column="0" >
+ <property>
+ <name>name</name>
+ <cstring>Spacer2</cstring>
+ </property>
<property stdset="1">
- <name>margin</name>
- <number>0</number>
+ <name>orientation</name>
+ <enum>Vertical</enum>
</property>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>sizeType</name>
+ <enum>Expanding</enum>
</property>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>chkAlarmPreset</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Alarm Preset</string>
- </property>
- </widget>
- <widget>
- <class>QSpinBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>spinPreset</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>false</bool>
- </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget row="0" column="0" >
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
<property stdset="1">
- <name>suffix</name>
- <string> minutes</string>
+ <name>margin</name>
+ <number>0</number>
</property>
<property stdset="1">
- <name>maxValue</name>
- <number>180</number>
+ <name>spacing</name>
+ <number>6</number>
</property>
- <property stdset="1">
- <name>minValue</name>
- <number>0</number>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>chkAlarmPreset</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Alarm Preset</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>spinPreset</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string> minutes</string>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>180</number>
+ </property>
+ <property stdset="1">
+ <name>minValue</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>lineStep</name>
+ <number>5</number>
+ </property>
+ <property stdset="1">
+ <name>value</name>
+ <number>5</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget row="2" column="0" >
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>fraMisc</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Misc</string>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout5</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>170</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Row style:</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>Default</string>
</property>
- <property stdset="1">
- <name>lineStep</name>
- <number>5</number>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>Medium</string>
</property>
- <property stdset="1">
- <name>value</name>
- <number>5</number>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>Large</string>
</property>
- </widget>
- </hbox>
- </widget>
- </vbox>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>comboRowStyle</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>chkJumpToCurTime</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>200</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Jump to current time (dayview)</string>
+ </property>
+ </widget>
</widget>
- </vbox>
+ </grid>
</widget>
<connections>
<connection>
<sender>chkAlarmPreset</sender>
<signal>toggled(bool)</signal>
<receiver>spinPreset</receiver>
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 8e88377..58a9c53 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -17,20 +17,20 @@
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qtimer.h>
#include <qstyle.h>
#include <qtoolbutton.h>
#include <qvbox.h>
-#include <qsizepolicy.h>
-#include <qabstractlayout.h>
+#include <qsizepolicy.h>
+#include <qabstractlayout.h>
#include <qtl.h>
bool calcWeek(const QDate &d, int &week, int &year,
bool startOnMonday = false);
-DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent,
+DateBookWeekLstHeader::DateBookWeekLstHeader(bool /*onM*/, QWidget* parent,
const char* name, WFlags fl)
: DateBookWeekLstHeaderBase(parent, name, fl)
{
setBackgroundMode( PaletteButton );
labelDate->setBackgroundMode( PaletteButton );
labelWeek->setBackgroundMode( PaletteButton );
@@ -51,18 +51,18 @@ DateBookWeekLstHeader::~DateBookWeekLstHeader(){}
void DateBookWeekLstHeader::setDate(const QDate &d) {
date=d;
int year,week;
calcWeek(d,week,year,onMonday);
labelWeek->setText("W: " + QString::number(week));
-
+
QDate start=date;
QDate stop=start.addDays(6);
- labelDate->setText( QString::number(start.day()) + " " +
+ labelDate->setText( QString::number(start.day()) + " " +
start.monthName(start.month()) + " - " +
- QString::number(stop.day()) + " " +
+ QString::number(stop.day()) + " " +
start.monthName(stop.month()) );
emit dateChanged(year,week);
}
void DateBookWeekLstHeader::pickDate() {
static QPopupMenu *m1 = 0;
static DateBookMonth *picker = 0;
@@ -89,31 +89,31 @@ void DateBookWeekLstHeader::nextWeek() {
}
void DateBookWeekLstHeader::prevWeek() {
setDate(date.addDays(-7));
}
DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM,
- QWidget* parent,
- const char* name,
- WFlags fl )
+ QWidget* parent,
+ const char* name,
+ WFlags fl )
: DateBookWeekLstDayHdrBase(parent, name, fl) {
date=d;
static const char *wdays="MTWTFSS";
char day=wdays[d.dayOfWeek()-1];
- label->setText( QString(QChar(day)) + " " +
+ label->setText( QString(QChar(day)) + " " +
QString::number(d.day()) );
add->setText("+");
if (d == QDate::currentDate()) {
QPalette pal=label->palette();
pal.setColor(QColorGroup::Foreground, QColor(0,0,255));
label->setPalette(pal);
-
+
/*
QFont f=label->font();
f.setItalic(true);
label->setFont(f);
label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor()));
*/
@@ -136,15 +136,15 @@ void DateBookWeekLstDayHdr::newEvent() {
start=stop=date;
start.setTime(QTime(10,0));
stop.setTime(QTime(12,0));
emit addEvent(start,stop,"");
}
-DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
- QWidget* parent,
- const char* name,
+DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
+ QWidget* parent,
+ const char* name,
WFlags fl) :
OClickableLabel(parent,name,fl),
event(ev)
{
char s[10];
if ( ev.startDate() != ev.date() ) { // multiday event (not first day)
@@ -162,69 +162,69 @@ DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
}
void DateBookWeekLstEvent::editMe() {
emit editEvent(event.event());
}
-DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
+DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
const QDate &d, bool onM,
- QWidget* parent,
+ QWidget* parent,
const char* name, WFlags fl)
: QWidget( parent, name, fl )
{
onMonday=onM;
setPalette(white);
setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
QVBoxLayout *layout = new QVBoxLayout( this );
-
+
qBubbleSort(ev);
QValueListIterator<EffectiveEvent> it;
it=ev.begin();
int dayOrder[7];
- if (onMonday)
+ if (onMonday)
for (int d=0; d<7; d++) dayOrder[d]=d+1;
else {
for (int d=0; d<7; d++) dayOrder[d]=d;
dayOrder[0]=7;
}
for (int i=0; i<7; i++) {
// Header
DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i),
onMonday,this);
- connect(hdr, SIGNAL(showDate(int,int,int)),
+ connect(hdr, SIGNAL(showDate(int,int,int)),
this, SIGNAL(showDate(int,int,int)));
- connect(hdr, SIGNAL(addEvent(const QDateTime &,
+ connect(hdr, SIGNAL(addEvent(const QDateTime &,
const QDateTime &,
- const QString &)),
- this, SIGNAL(addEvent(const QDateTime &,
+ const QString &)),
+ this, SIGNAL(addEvent(const QDateTime &,
const QDateTime &,
const QString &)));
layout->addWidget(hdr);
-
+
// Events
while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) {
DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this);
layout->addWidget(l);
connect (l, SIGNAL(editEvent(const Event &)),
this, SIGNAL(editEvent(const Event &)));
it++;
}
-
+
layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
}
DateBookWeekLstView::~DateBookWeekLstView(){}
void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();}
-DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
- QValueList<EffectiveEvent> &ev2,
+DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
+ QValueList<EffectiveEvent> &ev2,
QDate &d, bool onM,
- QWidget* parent,
+ QWidget* parent,
const char* name, WFlags fl)
: QWidget( parent, name, fl )
{
QHBoxLayout *layout = new QHBoxLayout( this );
DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this);
@@ -248,14 +248,14 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
const QString &)),
this, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
const QString &)));
}
-DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB,
- QWidget *parent,
+DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB,
+ QWidget *parent,
const char *name )
: QWidget( parent, name ),
db( newDB ),
startTime( 0 ),
ampm( ap ),
onMonday(onM)
@@ -263,16 +263,16 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB,
setFocusPolicy(StrongFocus);
layout = new QVBoxLayout( this );
layout->setMargin(0);
header=new DateBookWeekLstHeader(onM, this);
layout->addWidget( header );
- connect(header, SIGNAL(dateChanged(int,int)),
+ connect(header, SIGNAL(dateChanged(int,int)),
this, SLOT(dateChanged(int,int)));
connect(header, SIGNAL(setDbl(bool)),
- this, SLOT(setDbl(bool)));
+ this, SLOT(setDbl(bool)));
scroll=new QScrollView(this);
//scroll->setVScrollBarMode(QScrollView::AlwaysOn);
//scroll->setHScrollBarMode(QScrollView::AlwaysOff);
scroll->setResizePolicy(QScrollView::AutoOneFit);
layout->addWidget(scroll);
@@ -307,13 +307,13 @@ QDate DateBookWeekLst::date() const {
d.setYMD(year,1,1);
int dow= d.dayOfWeek();
if (!onMonday)
if (dow==7) dow=1;
else dow++;
-
+
d=d.addDays( (_week-1)*7 - dow + 1 );
return d;
}
void DateBookWeekLst::getEvents() {
QDate start = date();