summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-08 14:12:31 (UTC)
committer zautrix <zautrix>2005-02-08 14:12:31 (UTC)
commit41111b332c2a5f1b2ec152df309b9199f5e9c921 (patch) (unidiff)
tree3a2e5c5a25cdb52f542b2fe84a03f94599be2fe3
parent9927a063f34bb826a4b5f7f7029308c9c66acbce (diff)
downloadkdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.zip
kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.gz
kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp33
-rw-r--r--korganizer/calendarview.h3
-rw-r--r--korganizer/komonthview.cpp5
-rw-r--r--korganizer/koprefs.cpp28
-rw-r--r--korganizer/ktimeedit.cpp8
-rw-r--r--korganizer/mainwindow.cpp27
-rw-r--r--korganizer/navigatorbar.cpp3
-rw-r--r--libkdepim/kdatepicker.cpp10
-rw-r--r--microkde/kdatetbl.cpp26
-rw-r--r--microkde/kglobalsettings.cpp10
10 files changed, 98 insertions, 55 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 0fbaa9a..a9de65a 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2455,56 +2455,59 @@ void CalendarView::beamDone( Ir *ir )
2455#endif 2455#endif
2456 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2456 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2457 topLevelWidget()->raise(); 2457 topLevelWidget()->raise();
2458} 2458}
2459 2459
2460void CalendarView::moveIncidence(Incidence * inc ) 2460void CalendarView::moveIncidence(Incidence * inc )
2461{ 2461{
2462 if ( !inc ) return; 2462 if ( !inc ) return;
2463 // qDebug("showDatePickerForIncidence( ) "); 2463 showDatePickerPopup();
2464 if ( mDateFrame->isVisible() )
2465 mDateFrame->hide();
2466 else {
2467 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
2468 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
2469 int dw = QApplication::desktop()->width();
2470 int dh = QApplication::desktop()->height();
2471 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2472 mDateFrame->show();
2473 }
2474 mDatePickerMode = 2; 2464 mDatePickerMode = 2;
2475 mMoveIncidence = inc ; 2465 mMoveIncidence = inc ;
2476 QDate da; 2466 QDate da;
2477 if ( mMoveIncidence->type() == "Todo" ) { 2467 if ( mMoveIncidence->type() == "Todo" ) {
2478 Todo * to = (Todo *) mMoveIncidence; 2468 Todo * to = (Todo *) mMoveIncidence;
2479 if ( to->hasDueDate() ) 2469 if ( to->hasDueDate() )
2480 da = to->dtDue().date(); 2470 da = to->dtDue().date();
2481 else 2471 else
2482 da = QDate::currentDate(); 2472 da = QDate::currentDate();
2483 } else { 2473 } else {
2484 da = mMoveIncidence->dtStart().date(); 2474 da = mMoveIncidence->dtStart().date();
2485 } 2475 }
2486 //PENDING set date for recurring incidence to date of recurrence 2476 //PENDING set date for recurring incidence to date of recurrence
2487 //mMoveIncidenceOldDate; 2477 //mMoveIncidenceOldDate;
2488 mDatePicker->setDate( da ); 2478 mDatePicker->setDate( da );
2489} 2479}
2490void CalendarView::showDatePicker( ) 2480void CalendarView::showDatePickerPopup()
2491{ 2481{
2492 //qDebug("CalendarView::showDatePicker( ) "); 2482 if ( mDateFrame->isVisible() )
2493 if ( mDateFrame->isVisible() )
2494 mDateFrame->hide(); 2483 mDateFrame->hide();
2495 else { 2484 else {
2485 int offX = 0, offY = 0;
2486#ifdef DESKTOP_VERSION
2487 int w =mDatePicker->sizeHint().width() ;
2488 int h = mDatePicker->sizeHint().height() ;
2489 int dw = topLevelWidget()->width();
2490 int dh = topLevelWidget()->height();
2491 offX = topLevelWidget()->x();
2492 offY = topLevelWidget()->y();
2493#else
2496 int w =mDatePicker->sizeHint().width() ; 2494 int w =mDatePicker->sizeHint().width() ;
2497 int h = mDatePicker->sizeHint().height() ; 2495 int h = mDatePicker->sizeHint().height() ;
2498 int dw = QApplication::desktop()->width(); 2496 int dw = QApplication::desktop()->width();
2499 int dh = QApplication::desktop()->height(); 2497 int dh = QApplication::desktop()->height();
2500 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2498#endif
2499 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
2501 mDateFrame->show(); 2500 mDateFrame->show();
2502 } 2501 }
2502}
2503void CalendarView::showDatePicker( )
2504{
2505 showDatePickerPopup();
2503 mDatePickerMode = 1; 2506 mDatePickerMode = 1;
2504 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2507 mDatePicker->setDate( mNavigator->selectedDates().first() );
2505} 2508}
2506 2509
2507void CalendarView::showEventEditor() 2510void CalendarView::showEventEditor()
2508{ 2511{
2509#ifdef DESKTOP_VERSION 2512#ifdef DESKTOP_VERSION
2510 mEventEditor->show(); 2513 mEventEditor->show();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 731298d..e626ea3 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -436,17 +436,18 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
436 void slotCalendarChanged(); 436 void slotCalendarChanged();
437 bool importBday(); 437 bool importBday();
438 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 438 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
439 bool importQtopia( const QString &categoriesFile, 439 bool importQtopia( const QString &categoriesFile,
440 const QString &datebookFile, 440 const QString &datebookFile,
441 const QString &tasklistFile ); 441 const QString &tasklistFile );
442 void syncExternal( int mode ); 442 void syncExternal( int mode );
443 void slotSelectPickerDate( QDate ) ; 443 void slotSelectPickerDate( QDate ) ;
444 void showDatePicker( ) ; 444 void showDatePicker() ;
445 void showDatePickerPopup() ;
445 void moveIncidence(Incidence *) ; 446 void moveIncidence(Incidence *) ;
446 void beamIncidence(Incidence *) ; 447 void beamIncidence(Incidence *) ;
447 void beamCalendar() ; 448 void beamCalendar() ;
448 void beamFilteredCalendar() ; 449 void beamFilteredCalendar() ;
449 void beamIncidenceList(QPtrList<Incidence>) ; 450 void beamIncidenceList(QPtrList<Incidence>) ;
450 void manageCategories(); 451 void manageCategories();
451 int addCategories(); 452 int addCategories();
452 void removeCategories(); 453 void removeCategories();
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 6ae4c6f..02d2585 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -920,18 +920,21 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
920 if ( mShowWeekView ) 920 if ( mShowWeekView )
921 mWidStack->raiseWidget( mWeekView ); 921 mWidStack->raiseWidget( mWeekView );
922 else 922 else
923 mWidStack->raiseWidget( mMonthView ); 923 mWidStack->raiseWidget( mMonthView );
924 924
925 emit incidenceSelected( 0 ); 925 emit incidenceSelected( 0 );
926#ifndef DESKTOP_VERSION 926#ifndef DESKTOP_VERSION
927 resize( QApplication::desktop()->size() ); 927 resize( QApplication::desktop()->size() );
928 computeLayout(); 928#else
929 resize(640, 480 );
929#endif 930#endif
931 computeLayout();
932
930} 933}
931 934
932KOMonthView::~KOMonthView() 935KOMonthView::~KOMonthView()
933{ 936{
934 delete mContextMenu; 937 delete mContextMenu;
935} 938}
936 939
937void KOMonthView::selectInternalWeekNum ( int n ) 940void KOMonthView::selectInternalWeekNum ( int n )
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 576c265..5bfe2a1 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -31,16 +31,17 @@
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kglobalsettings.h>
39#include <kconfig.h> 40#include <kconfig.h>
40#include <klocale.h> 41#include <klocale.h>
41#include <kdebug.h> 42#include <kdebug.h>
42#include <kemailsettings.h> 43#include <kemailsettings.h>
43#include <kstaticdeleter.h> 44#include <kstaticdeleter.h>
44#include <libkdepim/kpimglobalprefs.h> 45#include <libkdepim/kpimglobalprefs.h>
45 46
46#include "koprefs.h" 47#include "koprefs.h"
@@ -57,23 +58,26 @@ KOPrefs::KOPrefs() :
57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 58 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
58 QColor defaultHolidayColor = QColor(255,0,0); 59 QColor defaultHolidayColor = QColor(255,0,0);
59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 60 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 61 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 62 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
62 QColor defaultTodoDueTodayColor = QColor(255,220,100); 63 QColor defaultTodoDueTodayColor = QColor(255,220,100);
63 QColor defaultTodoOverdueColor = QColor(255,153,125); 64 QColor defaultTodoOverdueColor = QColor(255,153,125);
64 65
66 /*
65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 67 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
66 mDefaultViewFont = QFont("helvetica",10); 68 mDefaultViewFont = QFont("helvetica",10);
67 mDefaultMonthViewFont = QFont("helvetica",8); 69 mDefaultMonthViewFont = QFont("helvetica",8);
68 mMarcusBainsFont= QFont("helvetica",10); 70 mMarcusBainsFont= QFont("helvetica",10);
69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 71 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
70 mEditBoxFont = QFont("helvetica",12); 72 mEditBoxFont = QFont("helvetica",12);
71 mJornalViewFont = QFont("helvetica",12); 73 mJornalViewFont = QFont("helvetica",12);
74 */
75
72 76
73 KPrefs::setCurrentGroup("General"); 77 KPrefs::setCurrentGroup("General");
74 78
75 79
76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 80 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
77 81
78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 82 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 83 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
@@ -151,28 +155,28 @@ KOPrefs::KOPrefs() :
151 155
152 156
153 KPrefs::setCurrentGroup("Calendar"); 157 KPrefs::setCurrentGroup("Calendar");
154 158
155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 159 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
156 160
157 KPrefs::setCurrentGroup("Fonts"); 161 KPrefs::setCurrentGroup("Fonts");
158 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 162 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
159 addItemFont("TimeBar Font",&mTimeBarFont); 163 addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() );
160 addItemFont("MonthView Font",&mMonthViewFont); 164 addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont());
161 addItemFont("AgendaView Font",&mAgendaViewFont); 165 addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont());
162 addItemFont("MarcusBains Font",&mMarcusBainsFont); 166 addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont());
163 addItemFont("TimeLabels Font",&mTimeLabelsFont); 167 addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont());
164 addItemFont("TodoView Font",&mTodoViewFont); 168 addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont());
165 addItemFont("ListView Font",&mListViewFont); 169 addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont());
166 addItemFont("DateNavigator Font",&mDateNavigatorFont); 170 addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont());
167 addItemFont("EditBox Font",&mEditBoxFont); 171 addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont());
168 addItemFont("JournalView Font",&mJornalViewFont); 172 addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont());
169 addItemFont("WhatsNextView Font",&mWhatsNextFont); 173 addItemFont("WhatsNextView Font",&mWhatsNextFont,KGlobalSettings::generalFont());
170 addItemFont("EventView Font",&mEventViewFont); 174 addItemFont("EventView Font",&mEventViewFont,KGlobalSettings::generalFont());
171 175
172 KPrefs::setCurrentGroup("RemoteSyncing"); 176 KPrefs::setCurrentGroup("RemoteSyncing");
173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 177 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 178 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 179 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
176 addItemInt("LastSyncTime",&mLastSyncTime,0); 180 addItemInt("LastSyncTime",&mLastSyncTime,0);
177 181
178#ifdef _WIN32_ 182#ifdef _WIN32_
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp
index 5222ac9..61a0931 100644
--- a/korganizer/ktimeedit.cpp
+++ b/korganizer/ktimeedit.cpp
@@ -44,20 +44,22 @@
44// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox. 44// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox.
45// Difficult to get all in one... 45// Difficult to get all in one...
46// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. 46// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help.
47KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) 47KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name)
48 : QComboBox(TRUE, parent, name) 48 : QComboBox(TRUE, parent, name)
49{ 49{
50 setInsertionPolicy(NoInsertion); 50 setInsertionPolicy(NoInsertion);
51 mFlagKeyPressed = false; 51 mFlagKeyPressed = false;
52 52 if ( QApplication::desktop()->height() <= 480 ) {
53 if ( QApplication::desktop()->width() < 650 )
54 setSizeLimit ( 6 ); 53 setSizeLimit ( 6 );
55 mTime = qt; 54 } else {
55 setSizeLimit ( 12 );
56 }
57 mTime = qt;
56 58
57// mNoTimeString = i18n("No Time"); 59// mNoTimeString = i18n("No Time");
58// insertItem( mNoTimeString ); 60// insertItem( mNoTimeString );
59 61
60 // Fill combo box with selection of times in localized format. 62 // Fill combo box with selection of times in localized format.
61 QTime timeEntry(0,0,0); 63 QTime timeEntry(0,0,0);
62 do { 64 do {
63 insertItem(KGlobal::locale()->formatTime(timeEntry)); 65 insertItem(KGlobal::locale()->formatTime(timeEntry));
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 7810bf9..61c39f5 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -2025,25 +2025,42 @@ void MainWindow::printCal()
2025 2025
2026 2026
2027#include "libkdepim/kdatepicker.h" 2027#include "libkdepim/kdatepicker.h"
2028#include <kdatetbl.h> 2028#include <kdatetbl.h>
2029void MainWindow::weekAction() 2029void MainWindow::weekAction()
2030{ 2030{
2031 int month; 2031 int month;
2032 KPopupFrame* popup = new KPopupFrame(this); 2032 KPopupFrame* popup = new KPopupFrame(this);
2033 int size = 12; 2033 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(10, popup);
2034 if ( QApplication::desktop()->width() >= 480 )
2035 size = 18;
2036 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(size, popup);
2037 // ----- 2034 // -----
2038 picker->resize(picker->sizeHint()); 2035 picker->resize(picker->sizeHint());
2039 popup->setMainWidget(picker); 2036 popup->setMainWidget(picker);
2040 picker->setFocus(); 2037 picker->setFocus();
2041 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2038 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2042 if(popup->exec(iconToolBar->mapToGlobal(QPoint(0, iconToolBar->height())))) 2039 int x = 0;
2040 int y = iconToolBar->height();
2041 int dX = 0;
2042 int dY = 0;
2043 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2044 if ( iconToolBar->y() > height()/2 ) {
2045 dY = iconToolBar->height()+picker->sizeHint().height();
2046 y = 0;
2047 }
2048 } else {
2049 if ( iconToolBar->x() > width()/2 ) { // right side
2050 x=0;
2051 dX= iconToolBar->width()+picker->sizeHint().width();
2052 y = 0;
2053 } else {
2054 x= iconToolBar->width();
2055 y = 0;
2056 }
2057 }
2058 qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2059 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2043 { 2060 {
2044 month = picker->getResult(); 2061 month = picker->getResult();
2045 emit selectWeek ( month ); 2062 emit selectWeek ( month );
2046 //qDebug("weekSelected %d ", month); 2063 //qDebug("weekSelected %d ", month);
2047 } 2064 }
2048 delete popup; 2065 delete popup;
2049} 2066}
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index f05e6f6..4a31c77 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -35,16 +35,17 @@
35#include <klocale.h> 35#include <klocale.h>
36#include <kglobal.h> 36#include <kglobal.h>
37#include <kiconloader.h> 37#include <kiconloader.h>
38#include "libkdepim/kdatepicker.h" 38#include "libkdepim/kdatepicker.h"
39#include <knotifyclient.h> 39#include <knotifyclient.h>
40#include "kdatetbl.h" 40#include "kdatetbl.h"
41 41
42#include "koglobals.h" 42#include "koglobals.h"
43#include <kglobalsettings.h>
43#include "koprefs.h" 44#include "koprefs.h"
44#ifndef KORG_NOPLUGINS 45#ifndef KORG_NOPLUGINS
45#include "kocore.h" 46#include "kocore.h"
46#endif 47#endif
47 48
48#include <kcalendarsystem.h> 49#include <kcalendarsystem.h>
49 50
50#include "navigatorbar.h" 51#include "navigatorbar.h"
@@ -56,17 +57,17 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
56 57
57 // Set up the control buttons and date label 58 // Set up the control buttons and date label
58 mCtrlFrame = new QFrame( this ); 59 mCtrlFrame = new QFrame( this );
59 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); 60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised);
60 mCtrlFrame->setLineWidth(1); 61 mCtrlFrame->setLineWidth(1);
61 62
62 topLayout->addWidget( mCtrlFrame ); 63 topLayout->addWidget( mCtrlFrame );
63 64
64 QFont tfont = font(); 65 QFont tfont = KGlobalSettings::generalFont();//font();
65 if ( QApplication::desktop()->width() >= 480 ) 66 if ( QApplication::desktop()->width() >= 480 )
66 tfont.setPointSize(tfont.pointSize()+2); 67 tfont.setPointSize(tfont.pointSize()+2);
67 tfont.setBold(true); 68 tfont.setBold(true);
68 69
69 bool isRTL = KOGlobals::self()->reverseLayout(); 70 bool isRTL = KOGlobals::self()->reverseLayout();
70#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
71 bool isDesktop = false; 72 bool isDesktop = false;
72#else 73#else
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index d8bc9f5..2be9c9e 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -28,16 +28,17 @@
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qtoolbutton.h> 29#include <qtoolbutton.h>
30#include <qfont.h> 30#include <qfont.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qvalidator.h> 33#include <qvalidator.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <knotifyclient.h> 35#include <knotifyclient.h>
36#include <kglobalsettings.h>
36#include "kdatetbl.h" 37#include "kdatetbl.h"
37#include "kdateedit.h" 38#include "kdateedit.h"
38//#include "kdatepicker.moc" 39//#include "kdatepicker.moc"
39 40
40 41
41KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) 42KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
42 : QFrame(parent,name), 43 : QFrame(parent,name),
43 yearForward(new QToolButton(this)), 44 yearForward(new QToolButton(this)),
@@ -46,24 +47,19 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
46 monthBackward(new QToolButton(this)), 47 monthBackward(new QToolButton(this)),
47 selectMonth(new QToolButton(this)), 48 selectMonth(new QToolButton(this)),
48 selectYear(new QToolButton(this)), 49 selectYear(new QToolButton(this)),
49 //line(new QLineEdit(this)), 50 //line(new QLineEdit(this)),
50 val(new KDateValidator(this)) 51 val(new KDateValidator(this))
51 //table(new KDateTable(this)), 52 //table(new KDateTable(this)),
52 //fontsize(1) 53 //fontsize(1)
53{ 54{
54 // ----- 55 setFont ( KGlobalSettings::generalFont() );
55 int size = 12;
56 if ( QApplication::desktop()->width() >= 480 )
57 size = 18;
58 fontsize = size;
59 setFont ( QFont("helvetica",size) );
60 table = new KDateTable(this); 56 table = new KDateTable(this);
61 setFontSize(size); 57 setFontSize(font().pointSize()+2);
62 //line->setValidator(val); 58 //line->setValidator(val);
63 lineDate = new KDateEdit( this, "dateediipicker", true ); 59 lineDate = new KDateEdit( this, "dateediipicker", true );
64 yearForward->setPixmap(SmallIcon("2rightarrowB")); 60 yearForward->setPixmap(SmallIcon("2rightarrowB"));
65 yearBackward->setPixmap(SmallIcon("2leftarrowB")); 61 yearBackward->setPixmap(SmallIcon("2leftarrowB"));
66 monthForward->setPixmap(SmallIcon("1rightarrowB")); 62 monthForward->setPixmap(SmallIcon("1rightarrowB"));
67 monthBackward->setPixmap(SmallIcon("1leftarrowB")); 63 monthBackward->setPixmap(SmallIcon("1leftarrowB"));
68 setDate(dt); // set button texts 64 setDate(dt); // set button texts
69 connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); 65 connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate)));
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index fce0e5a..e827412 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -193,18 +193,22 @@ KDateTable::paintCell(QPainter *painter, int row, int col)
193 painter->setBrush(QColor(220,245,255)); 193 painter->setBrush(QColor(220,245,255));
194 painter->setPen(QColor(220,245,255)); 194 painter->setPen(QColor(220,245,255));
195 } 195 }
196 } 196 }
197 painter->drawRect(0, 0, w, h); 197 painter->drawRect(0, 0, w, h);
198 painter->setPen(pen); 198 painter->setPen(pen);
199 painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); 199 painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect);
200 } 200 }
201 if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); 201 /*
202 if(rect.height()>maxCell.height()) maxCell.setHeight(rect.height()); 202 if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width());
203 if(rect.height()>maxCell.height()) {
204 maxCell.setHeight(rect.height());
205 }
206 */
203} 207}
204 208
205void 209void
206KDateTable::keyPressEvent( QKeyEvent *e ) 210KDateTable::keyPressEvent( QKeyEvent *e )
207{ 211{
208 /* 212 /*
209 // not working properly 213 // not working properly
210 if ( e->key() == Qt::Key_Prior ) { 214 if ( e->key() == Qt::Key_Prior ) {
@@ -308,19 +312,25 @@ KDateTable::setFontSize(int size)
308 { 312 {
309 rect=metrics.boundingRect(KGlobal::locale()->weekDayName(count+1, true)); 313 rect=metrics.boundingRect(KGlobal::locale()->weekDayName(count+1, true));
310 maxCell.setWidth(QMAX(maxCell.width(), rect.width())); 314 maxCell.setWidth(QMAX(maxCell.width(), rect.width()));
311 maxCell.setHeight(QMAX(maxCell.height(), rect.height())); 315 maxCell.setHeight(QMAX(maxCell.height(), rect.height()));
312 } 316 }
313 // ----- compare with a real wide number and add some space: 317 // ----- compare with a real wide number and add some space:
314 rect=metrics.boundingRect(QString::fromLatin1("88")); 318 rect=metrics.boundingRect(QString::fromLatin1("88"));
315 maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); 319 maxCell.setWidth(QMAX(maxCell.width()+2, rect.width()));
320#ifdef DESKTOP_VERSION
321 maxCell.setHeight(QMAX(maxCell.height()+8, rect.height()));
322#else
316 maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); 323 maxCell.setHeight(QMAX(maxCell.height()+4, rect.height()));
317 if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) 324#endif
325 if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) {
318 maxCell.setHeight(maxCell.width() * 1000 / 1900 ); 326 maxCell.setHeight(maxCell.width() * 1000 / 1900 );
327 qDebug("setmax ");
328 }
319} 329}
320 330
321void 331void
322KDateTable::contentsMousePressEvent(QMouseEvent *e) 332KDateTable::contentsMousePressEvent(QMouseEvent *e)
323{ 333{
324 if(e->type()!=QEvent::MouseButtonPress) 334 if(e->type()!=QEvent::MouseButtonPress)
325 { // the KDatePicker only reacts on mouse press events: 335 { // the KDatePicker only reacts on mouse press events:
326 return; 336 return;
@@ -438,17 +448,17 @@ KDateInternalMonthPicker::KDateInternalMonthPicker
438 result(0) // invalid 448 result(0) // invalid
439{ 449{
440 QRect rect; 450 QRect rect;
441 QFont font; 451 QFont font;
442 // ----- 452 // -----
443 activeCol = -1; 453 activeCol = -1;
444 activeRow = -1; 454 activeRow = -1;
445 font=KGlobalSettings::generalFont(); 455 font=KGlobalSettings::generalFont();
446 font.setPointSize(fontsize); 456 //font.setPointSize(fontsize);
447 setFont(font); 457 setFont(font);
448 setHScrollBarMode(AlwaysOff); 458 setHScrollBarMode(AlwaysOff);
449 setVScrollBarMode(AlwaysOff); 459 setVScrollBarMode(AlwaysOff);
450 setFrameStyle(QFrame::NoFrame); 460 setFrameStyle(QFrame::NoFrame);
451 setNumRows(4); 461 setNumRows(4);
452 setNumCols(3); 462 setNumCols(3);
453 // enable to find drawing failures: 463 // enable to find drawing failures:
454 // setTableFlags(Tbl_clipCellPainting); 464 // setTableFlags(Tbl_clipCellPainting);
@@ -756,17 +766,17 @@ KDateInternalWeekPicker::KDateInternalWeekPicker
756 result(0) // invalid 766 result(0) // invalid
757{ 767{
758 QRect rect; 768 QRect rect;
759 QFont font; 769 QFont font;
760 // ----- 770 // -----
761 activeCol = -1; 771 activeCol = -1;
762 activeRow = -1; 772 activeRow = -1;
763 font=KGlobalSettings::generalFont(); 773 font=KGlobalSettings::generalFont();
764 font.setPointSize(fontsize); 774 //font.setPointSize(fontsize);
765 setFont(font); 775 setFont(font);
766 setHScrollBarMode(AlwaysOff); 776 setHScrollBarMode(AlwaysOff);
767 setVScrollBarMode(AlwaysOff); 777 setVScrollBarMode(AlwaysOff);
768 setFrameStyle(QFrame::NoFrame); 778 setFrameStyle(QFrame::NoFrame);
769 setNumRows(13); 779 setNumRows(13);
770 setNumCols(4); 780 setNumCols(4);
771 // enable to find drawing failures: 781 // enable to find drawing failures:
772 // setTableFlags(Tbl_clipCellPainting); 782 // setTableFlags(Tbl_clipCellPainting);
@@ -777,17 +787,21 @@ KDateInternalWeekPicker::KDateInternalWeekPicker
777 // (this is slow, possibly, but unfortunatly it is needed here): 787 // (this is slow, possibly, but unfortunatly it is needed here):
778 QFontMetrics metrics(font); 788 QFontMetrics metrics(font);
779 for(int i=1; i <= 52; ++i) 789 for(int i=1; i <= 52; ++i)
780 { 790 {
781 rect=metrics.boundingRect(QString::number( i )); 791 rect=metrics.boundingRect(QString::number( i ));
782 if(max.width()<rect.width()) max.setWidth(rect.width()); 792 if(max.width()<rect.width()) max.setWidth(rect.width());
783 if(max.height()<rect.height()) max.setHeight(rect.height()); 793 if(max.height()<rect.height()) max.setHeight(rect.height());
784 } 794 }
785 795 if ( QApplication::desktop()->width() > 640 ) {
796
797 max.setWidth(max.width()+6);
798 max.setHeight(max.height()+8);
799 }
786} 800}
787 801
788QSize 802QSize
789KDateInternalWeekPicker::sizeHint() const 803KDateInternalWeekPicker::sizeHint() const
790{ 804{
791 return QSize((max.width()+6)*numCols()+2*frameWidth(), 805 return QSize((max.width()+6)*numCols()+2*frameWidth(),
792 (max.height()+6)*numRows()+2*frameWidth()); 806 (max.height()+6)*numRows()+2*frameWidth());
793} 807}
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index 2fff8fc..30e793f 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -5,37 +5,39 @@
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7 7
8QFont KGlobalSettings::generalFont() 8QFont KGlobalSettings::generalFont()
9{ 9{
10 int size = 12; 10 int size = 12;
11 if (QApplication::desktop()->width() < 480 ) 11 if (QApplication::desktop()->width() < 480 )
12 size = 10; 12 size = 10;
13 return QFont("helvetica",size); 13 QFont f = QApplication::font();
14 f.setPointSize( size );
15 return f;
14} 16}
15QFont KGlobalSettings::toolBarFont() 17QFont KGlobalSettings::toolBarFont()
16{ 18{
17 return QFont("helevetica",12); 19 return QApplication::font();
18} 20}
19 21
20QColor KGlobalSettings::toolBarHighlightColor() 22QColor KGlobalSettings::toolBarHighlightColor()
21{ 23{
22 return QColor("black"); 24 return QColor( "black" );
23} 25}
24 26
25QRect KGlobalSettings::desktopGeometry( QWidget * ) 27QRect KGlobalSettings::desktopGeometry( QWidget * )
26{ 28{
27 return QApplication::desktop()->rect(); 29 return QApplication::desktop()->rect();
28} 30}
29 31
30 /** 32 /**
31 * Returns whether KDE runs in single (default) or double click 33 * Returns whether KDE runs in single (default) or double click
32 * mode. 34 * mode.
33 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html 35 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
34 * @return true if single click mode, or false if double click mode. 36 * @return true if single click mode, or false if double click mode.
35 **/ 37 **/
36bool KGlobalSettings::singleClick() 38bool KGlobalSettings::singleClick()
37{ 39{
38 KConfig *c = KGlobal::config(); 40 KConfig *c = KGlobal::config();
39 KConfigGroupSaver cgs( c, "KDE" ); 41 KConfigGroupSaver cgs( c, "KDE" );
40 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); 42 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK);
41} 43}