author | zautrix <zautrix> | 2005-04-05 23:31:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-05 23:31:44 (UTC) |
commit | cf4848d972efe96640f2d5f5d52704306d0cbe4c (patch) (side-by-side diff) | |
tree | 123a2075927def5f7f59a20949d6b59174ae79b6 | |
parent | 6add774cf9841377f32613c7aa23161a823aa1da (diff) | |
download | kdepimpi-cf4848d972efe96640f2d5f5d52704306d0cbe4c.zip kdepimpi-cf4848d972efe96640f2d5f5d52704306d0cbe4c.tar.gz kdepimpi-cf4848d972efe96640f2d5f5d52704306d0cbe4c.tar.bz2 |
fixes
-rw-r--r-- | kaddressbook/details/look_details.cpp | 2 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 2 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 3 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 8 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 16 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.h | 1 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 4 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 16 | ||||
-rw-r--r-- | microkde/kglobalsettings.h | 1 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 2 |
11 files changed, 38 insertions, 20 deletions
diff --git a/kaddressbook/details/look_details.cpp b/kaddressbook/details/look_details.cpp index 51ec0c0..11d06e9 100644 --- a/kaddressbook/details/look_details.cpp +++ b/kaddressbook/details/look_details.cpp @@ -1,162 +1,162 @@ /* This file is part of KAddressBook. Copyright (c) 1996-2002 Mirko Boehm <mirko@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 <kconfig.h> #include <kdebug.h> #include <kglobalsettings.h> #include <kinstance.h> #include <klocale.h> #include <kstandarddirs.h> #include <qcursor.h> #include <qdir.h> #include <qpainter.h> #include <qpopupmenu.h> #include "global.h" #include "kabentrypainter.h" #include "look_details.h" #define GRID 5 const QString KABDetailedView::mBorderedBGDir = "kab3part/backgrounds/bordered/"; const QString KABDetailedView::mTiledBGDir = "kab3part/backgrounds/tiled/"; KABDetailedView::KABDetailedView( QWidget *parent, const char *name ) : KABBasicLook( parent, name ), mPainter( 0 ), mBackgroundStyle( None ), mDefaultBGColor( white ), mHeadLineBGColor( darkBlue ), mHeadLineTextColor( yellow ), mGrid( 3 ), mMenuBorderedBG( 0 ), mMenuTiledBG( 0 ) { KToggleAction** actions[] = { &mActionShowAddresses, &mActionShowEmails, &mActionShowPhones, &mActionShowURLs }; QString actionTexts[] = { i18n( "Show Postal Addresses" ), i18n( "Show Email Addresses" ), i18n( "Show Telephone Numbers" ), i18n( "Show Web Pages (URLs)" ) }; - QFont general = KGlobalSettings::generalFont(); + QFont general = KGlobalSettings::generalMaxFont(); QFont fixed = KGlobalSettings::fixedFont(); QString gfont = general.family(); QString ffont = fixed.family(); int gpointsize = general.pixelSize(); if ( gpointsize == -1 ) gpointsize = general.pointSize(); int fpointsize = fixed.pixelSize(); if ( fpointsize == -1 ) fpointsize = fixed.pointSize(); mPainter = new KABEntryPainter; mPainter->setForegroundColor( black ); mPainter->setHeaderColor( mHeadLineTextColor ); mPainter->setUseHeaderColor( mUseHeadLineBGColor ); mPainter->setBackgroundColor( mHeadLineBGColor ); mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) ); mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) ); mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); const int numActions = sizeof( actions ) / sizeof( actions[ 0 ] ); for ( int count = 0; count < numActions; ++count ) { *actions[ count ] = new KToggleAction( actionTexts[ count ] ); (*actions[ count ])->setChecked( true ); } setMouseTracking( true ); setBackgroundMode( NoBackground ); } KABDetailedView::~KABDetailedView() { delete mPainter; mPainter = 0; } bool KABDetailedView::getBackground( QString path, QPixmap& image ) { QMap<QString, QPixmap>::iterator pos; pos = mBackgroundMap.find( path ); if ( pos == mBackgroundMap.end() ) { // the image has not been loaded previously if ( image.load( path ) ) { mBackgroundMap[ path ] = image; return true; } else return false; } else { // image found in cache image = pos.data(); return true; } } void KABDetailedView::paintEvent( QPaintEvent* ) { const int BorderSpace = mGrid; QPixmap pm( width(), height() ); QPainter p; QRect entryArea = QRect( BorderSpace, mGrid, width() - mGrid - BorderSpace, height() - 2 * mGrid ); p.begin( &pm ); p.setPen( darkBlue ); p.setBrush( mDefaultBGColor ); p.drawRect( 0, 0, width(), height() ); switch ( mBackgroundStyle ) { case Tiled: p.drawTiledPixmap( 1, 1, width() - 2, height() - 2, mCurrentBackground ); break; case Bordered: p.drawTiledPixmap( 1, 1, QMIN( width() - 2, mCurrentBackground.width() ), height() - 2, mCurrentBackground ); break; case None: // no BG image defined for this entry: default: if ( mUseDefaultBGImage ) p.drawTiledPixmap( 1, 1, width() - 2, height() - 2, mDefaultBGImage ); break; }; p.setViewport( entryArea ); mPainter->setShowAddresses( mActionShowAddresses->isChecked() ); mPainter->setShowEmails( mActionShowEmails->isChecked() ); mPainter->setShowPhones( mActionShowPhones->isChecked() ); mPainter->setShowURLs( mActionShowURLs->isChecked() ); mPainter->printAddressee( addressee(), QRect( 0, 0, entryArea.width(), entryArea.height() ), &p ); diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 9cde5cf..7de7064 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp @@ -1,167 +1,167 @@ /* 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 <kdialog.h> #include <qlayout.h> #include <qlabel.h> #include <qgroupbox.h> #include <qbuttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qcombobox.h> #include <qvbox.h> #include <qhbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qstrlist.h> #include <qapplication.h> #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 <klineedit.h> #include "koprefs.h" #include "koprefsdialog.h" //#include <kprefswidget.h> KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : KPrefsDialog(KOPrefs::instance(),parent,name,true) { - setFont( KGlobalSettings::generalFont() ); + setFont( KGlobalSettings::generalMaxFont() ); setCaption( i18n("Settings - some need a restart (nr)")); setupGlobalTab(); setupMainTab(); setupMailTab();; setupFontsTab(); readConfig(); #ifndef DESKTOP_VERSION if ( QApplication::desktop()->height() == 480 ) hideButtons(); #endif #if 0 setupMainTab(); setupLocaleTab(); setupTimeZoneTab(); setupTimeTab(); setupLocaleDateTab(); setupFontsTab(); setupColorsTab(); setupViewsTab(); //setupSyncTab(); //setupSyncAlgTab(); //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); #endif } #include "kpimglobalprefs.h" KOPrefsDialog::~KOPrefsDialog() { } void KOPrefsDialog::setupGlobalTab() { QFrame *topFrame = addPage(i18n("Global"),0,0); kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); QVBoxLayout *topLayout = new QVBoxLayout(topFrame); topLayout->addWidget( kdelibcfg ); } void KOPrefsDialog::setupMainTab() { QFrame *topFrame = addPage(i18n("General"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); 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); QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); topLayout->addMultiCellWidget(lab,2,2,0,1); KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), &(KOPrefs::instance()->mUseKapi),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); } void KOPrefsDialog::setupMailTab() { QFrame *topFrame = addPage(i18n("Mail"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), &(KOPrefs::instance()->mViewAsHtml),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); ttt = addWidBool(i18n("Send mails later"), &(KOPrefs::instance()->mSendLater),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); ttt = addWidBool(i18n("Show \"To\" field in list view"), &(KOPrefs::instance()->mShowToField),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); int iii =3; ttt = addWidBool(i18n("Show info fields at startup"), &(KOPrefs::instance()->mShowInfoStart),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); ++iii; ttt = addWidBool(i18n("Show \"Subject\" info field"), &(KOPrefs::instance()->mShowInfoSub),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index e57daa4..f9c8b73 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp @@ -26,206 +26,205 @@ #include <kdebug.h> #include <klocale.h> //#include "koglobals.h" #include "navigatorbar.h" #include "kdatenavigator.h" #include <kcalendarsystem.h> #include "datenavigatorcontainer.h" #include "koprefs.h" 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; mUpdateTimer = new QTimer( this ); connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); mFirstSelectedDate = QDate::currentDate(); mSelectedDateCount = 1; } DateNavigatorContainer::~DateNavigatorContainer() { } void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) { connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), SIGNAL( datesSelected( const KCal::DateList & ) ) ); #if 0 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); #endif connect( v, SIGNAL( weekClicked( const QDate & ) ), SIGNAL( weekClicked( const QDate & ) ) ); connect( v, SIGNAL( showMonth( const QDate & ) ), SIGNAL( showMonth( const QDate & ) ) ); connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) ); connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) ); connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) ); connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) ); connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) ); connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) ); connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); } void DateNavigatorContainer::slotgoNextYear() { jumpMonth( 12 ); emit goNextYear(); } void DateNavigatorContainer::slotgoPrevYear() { jumpMonth( -12 ); emit goPrevYear(); } void DateNavigatorContainer::slotgoPrevMonth() { jumpMonth( -1 ); emit goPrevMonth(); } void DateNavigatorContainer::slotgoNextMonth() { jumpMonth( 1 ); emit goNextMonth(); } void DateNavigatorContainer::jumpMonth( int month ) { QDate baseDate = mNavigatorView->baseDate(); computeMonthSelected( baseDate.month() + month, false ); } void DateNavigatorContainer::slotMonthSelected( int month ) { computeMonthSelected( month, true ); } void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) { - //qDebug("slotMonthSelected %d ", month); + //qDebug("slotMonthSelected %d ", month); QDate baseDate = mNavigatorView->baseDate(); if ( baseDate.month() == month ) return; //qDebug("month %d %d ",baseDate.month(),month); QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); date = date.addDays( -(baseDate.month()-month ) *30 ); QDate newBase = QDate ( date.year(), date.month() ,1 ); //qDebug("NEW BASE %s", newBase.toString().latin1()); mNavigatorView->setBaseDate( newBase ); QDate last = lastAvailableDate(); QDate first = firstAvailableDate(); - QDate selFirst = mFirstSelectedDate; QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); if ( selFirst >= first && selLast <= last ) { setBaseDates(); if ( forceEmit ) updateDayMatrixDates(); } else { setBaseDates(); if ( forceEmit ) updateDayMatrixDates(); if ( forceEmit ) emit monthSelected( month ); } } void DateNavigatorContainer::setCalendar( Calendar *cal ) { mCalendar = cal; mNavigatorView->setCalendar( cal ); for( uint i = 0; i < mLastDisplayedDN; ++i ) { KDateNavigator *n = mExtraViews.at( i ); n->setCalendar( cal ); } } void DateNavigatorContainer::checkUpdateDayMatrixDates() { //qDebug("KODNC: wid %d hei %d ", width(), height()); mUpdateTimer->stop(); //return; if ( width() < 3 || height() < 3 ) return; static int lastWid = 0; static int lastHei = 0; if ( lastWid == width() && height() == lastHei ) { qDebug("KODNC: No layout computing needed. "); } else { lastWid = width(); lastHei = height(); QSize minSize = mNavigatorView->yourSizeHint(); int verticalCount = size().height() / minSize.height(); int horizontalCount = size().width() / minSize.width(); //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); bool fontchange = false; if ( horizontalCount == 1) horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); QFont fo; if ( horizontalCount != mHorizontalCount || verticalCount != mVerticalCount ) { uint count = horizontalCount * verticalCount; if ( count == 0 ) { bool ok; fo = mNavigatorView->yourFontHint( size() , &ok ); //mNavigatorView->resize( size() ); //if ( ! ok ) // return; int butt = 2; horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); if ( horizontalCount <= 1 ) minSize = mNavigatorView->sizeHintTwoButtons( 4 ); else minSize = mNavigatorView->sizeHintTwoButtons(); verticalCount = size().height() / minSize.height(); horizontalCount = size().width() / minSize.width(); if ( horizontalCount == 0 ) horizontalCount = 1; if ( verticalCount == 0 ) verticalCount = 1; fontchange = true; count = horizontalCount * verticalCount; } else { if ( mNavigatorView->fontChanged() ) { fontchange = true; fo = KOPrefs::instance()->mDateNavigatorFont; mNavigatorView->changeFont( fo ); mNavigatorView->unsetFontChanged(); } } mLastDisplayedDN = horizontalCount*verticalCount-1; while ( count > ( mExtraViews.count() + 1 ) ) { KDateNavigator *n = new KDateNavigator( this ); n->setMonthSignalOffset ( mExtraViews.count()+1 ); mExtraViews.append( n ); n->setCalendar( mCalendar ); connectNavigatorView( n ); // n->show(); } setBaseDates(); if ( fontchange ) { //mNavigatorView->changeFont( fo ); uint i; for( i = 0; i < mExtraViews.count(); ++i ) { KDateNavigator *view = mExtraViews.at( i ); diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 322131f..ecca374 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -247,196 +247,196 @@ KODayMatrix::~KODayMatrix() // delete mKODaymatrixWhatsThis; delete [] days; delete [] daylbls; //delete [] events; delete mToolTip; } /* void KODayMatrix::setStartDate(QDate start) { updateView(start); } */ void KODayMatrix::addSelectedDaysTo(DateList& selDays) { if (mSelStart == NOSELECTION) { return; } //cope with selection being out of matrix limits at top (< 0) int i0 = mSelStart; if (i0 < 0) { for (int i = i0; i < 0; i++) { selDays.append(days[0].addDays(i)); } i0 = 0; } //cope with selection being out of matrix limits at bottom (> NUMDAYS-1) if (mSelEnd > NUMDAYS-1) { for (int i = i0; i <= NUMDAYS-1; i++) { selDays.append(days[i]); } for (int i = NUMDAYS; i < mSelEnd; i++) { selDays.append(days[0].addDays(i)); } // apply normal routine to selection being entirely within matrix limits } else { for (int i = i0; i <= mSelEnd; i++) { selDays.append(days[i]); } } } bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) { mRedrawNeeded = true; bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION ); mSelStart = startdate.daysTo(start); if ( mSelStart < 0 ) mSelStart = 0; mSelEnd = startdate.daysTo(end); if ( mSelEnd > NUMDAYS-1 ) mSelEnd = NUMDAYS-1; if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) { clearSelection(); if ( noSel ) return false; } return true; } void KODayMatrix::clearSelection() { mSelEnd = mSelStart = NOSELECTION; } void KODayMatrix::recalculateToday() { today = -1; for (int i=0; i<NUMDAYS; i++) { //events[i] = 0; days[i] = startdate.addDays(i); daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); // if today is in the currently displayed month, hilight today if (days[i].year() == QDate::currentDate().year() && days[i].month() == QDate::currentDate().month() && days[i].day() == QDate::currentDate().day()) { today = i; } } // qDebug(QString("Today is visible at %1.").arg(today)); } void KODayMatrix::updateView() { updateView(startdate); } void KODayMatrix::repaintViewTimed() { mRedrawNeeded = true; - bDays.fill( false); - pDays.fill( false); - hDays.fill( false); - eDays.fill( false); + // bDays.fill( false); + //pDays.fill( false); + //hDays.fill( false); + //eDays.fill( false); mRepaintTimer->stop(); int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday int i; for(i = 0; i < NUMDAYS; i++) { if ( ( (i+startDay) % 7 == 0 ) ) { pDays.setBit(i); } } repaint(false); } void KODayMatrix::computeEvent(Event *event, int i ) { QString holiStr = mHolidays[i]; if ( event->isHoliday()) { pDays.setBit(i); hDays.setBit(i); if ( !holiStr.isEmpty() ) holiStr += "\n"; holiStr += event->summary(); if ( !event->location().isEmpty() ) holiStr += " (" + event->location() + ")"; mHolidays[i] =holiStr ; } if ( event->isBirthday()) { pDays.setBit(i); if ( !holiStr.isEmpty() ) holiStr += "\n"; holiStr += i18n("Birthday") + ": "+event->summary(); if ( !event->location().isEmpty() ) holiStr += " (" + event->location() + ")"; bDays.setBit(i); mHolidays[i] =holiStr ; } 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(); 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->recurrence()->doesRecur(); if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { 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() ); 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) { computeEvent( event, iii ); } } } } else { if ( invalid ) break; invalid = true; //qDebug("invalid %s", event->summary().latin1()); incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; } if ( last ) break; diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 35d084d..1dce841 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp @@ -1,308 +1,314 @@ /* 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> #include "koeventviewer.h" #include <kmessagebox.h> #include "koprefs.h" #include <libkcal/todo.h> #include "qapp.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())); mIncidence = 0; // TODO: Set a sensible size (based on the content?). //showMaximized(); //qDebug("++++++++++++KOEventViewerDialog() "); // if ( KOPrefs::instance()->mCompactDialogs ) { // setFixedSize( 240,284 ); // move( 0, 15 ); // } else { // setMinimumSize(300,200); // resize(320,300); // } mSyncMode = false; mSyncResult = 0; } KOEventViewerDialog::~KOEventViewerDialog() { //qDebug("-------~KOEventViewerDialog() "); } void KOEventViewerDialog::showMe() { #ifdef DESKTOP_VERSION int x,y,w,h; x = geometry().x(); y = geometry().y(); w = width(); h = height(); show(); setGeometry(x,y,w,h); + raise(); #else showMaximized(); #endif - raise(); - setActiveWindow(); - mEventViewer->setFocus(); - //raise(); + QTimer::singleShot( 1, this, SLOT ( setMyFocus() ) ); } +void KOEventViewerDialog::setMyFocus() +{ + + setActiveWindow(); + mEventViewer->setFocus(); + +} void KOEventViewerDialog::print() { mEventViewer->printMe(); } void KOEventViewerDialog::setSyncMode( bool b ) { mSyncMode = b; //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); if ( mSyncMode ) { findButton( Close )->setText( i18n("Cancel Sync")); findButton( Ok )->setText( i18n("Remote")); findButton( User1 )->setText( i18n("Local")); } else { findButton( Close )->setText( i18n("Close")); findButton( Ok )->setText( i18n("Edit")); findButton( User1 )->setText( i18n("Agenda")); } mEventViewer->setSyncMode( b ); } void KOEventViewerDialog::setColorMode( int m ) { mEventViewer->setColorMode( m ); } int KOEventViewerDialog::executeS( bool local ) { mSyncResult = 3; if ( local ) findButton( User1 )->setFocus(); else findButton( Ok )->setFocus(); exec(); return mSyncResult; } void KOEventViewerDialog::updateConfig() { mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); } void KOEventViewerDialog::setEvent(Event *event) { mEventViewer->setEvent(event); mIncidence = event; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Agenda")); } } void KOEventViewerDialog::setIncidence(Incidence *in ) { if ( in->type() == "Event" ) setEvent( (Event*) in ); else if ( in->type() =="Todo" ) setTodo( (Todo*) in ); else if ( in->type() =="Journal" ) setJournal( (Journal*) in ); } void KOEventViewerDialog::addIncidence(Incidence *in) { if ( in->type() == "Event" ) addEvent( (Event*) in ); else if ( in->type() =="Todo" ) mEventViewer->setTodo( (Todo*) in, false ); else if ( in->type() =="Journal" ) mEventViewer->setJournal( (Journal*) in, false ); if ( mSyncMode ) { findButton( User1 )->setFocus(); setCaption(i18n("Conflict! Please choose entry")); } } void KOEventViewerDialog::addEvent(Event *event) { mEventViewer->addEvent(event); mIncidence = event; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Agenda")); } } void KOEventViewerDialog::setTodo(Todo *event) { mEventViewer->setTodo(event); mIncidence = (Incidence*)event; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Set complete")); } } void KOEventViewerDialog::setJournal(Journal *j) { mEventViewer->setJournal(j); mIncidence = (Incidence*)j; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Agenda")); } } void KOEventViewerDialog::addText(QString text) { mEventViewer->addText(text); mEventViewer->setFocus(); //findButton( Close )->setFocus(); } void KOEventViewerDialog::editIncidence() { sendSignalViewerClosed = false; if ( mSyncMode ) { mSyncResult = 2; accept(); return; } if ( mIncidence ){ #ifndef DESKTOP_VERSION - hide(); + //hide(); + close(); #endif emit editIncidence( mIncidence ); } } void KOEventViewerDialog::showIncidence() { sendSignalViewerClosed = false; if ( mSyncMode ) { mSyncResult = 1; accept(); return; } if ( mIncidence ){ #ifndef DESKTOP_VERSION hide(); #endif QDate date; if ( mIncidence->type() == "Todo" ) { /* if ( ((Todo*)mIncidence)->hasDueDate() ) date = ((Todo*)mIncidence)->dtDue().date(); else { globalFlagBlockAgenda = 2; emit showAgendaView( false ); return; } */ ((Todo*)mIncidence)->setCompleted( true ); ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() ); hide(); emit todoCompleted(((Todo*)mIncidence)); return; } else date = mIncidence->dtStart().date(); globalFlagBlockAgenda = 1; emit showAgendaView( false ); globalFlagBlockAgenda = 2; emit jumpToTime( date ); } } void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) { switch ( e->key() ) { case Qt::Key_A : case Qt::Key_L : showIncidence(); break; case Qt::Key_E : case Qt::Key_R : editIncidence(); break; case Qt::Key_C: case Qt::Key_Escape: sendSignalViewerClosed = true; close(); break; case Qt::Key_I: #ifndef DESKTOP_VERSION sendSignalViewerClosed = true; close(); #else sendSignalViewerClosed = true; slotViewerClosed(); //accept(); #endif break; default: KDialogBase::keyPressEvent ( e ); break; } } void KOEventViewerDialog::hideEvent ( QHideEvent * e ) { KDialogBase::hideEvent ( e ); QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); } void KOEventViewerDialog::slotViewerClosed() { if ( mSyncMode ) return; if ( sendSignalViewerClosed ) { //qDebug("KOEventViewerDialog::hideEvent "); emit signalViewerClosed(); } sendSignalViewerClosed = true; } diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h index 8e1cd44..29fee49 100644 --- a/korganizer/koeventviewerdialog.h +++ b/korganizer/koeventviewerdialog.h @@ -1,76 +1,77 @@ /* 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 <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 ); void setColorMode( int m ); int executeS( bool ); public slots: void updateConfig(); void print(); + void setMyFocus(); signals: void editIncidence( Incidence* ); void jumpToTime( const QDate &); void showAgendaView( bool ); void todoCompleted(Todo*); void signalViewerClosed(); private slots: void slotViewerClosed(); void editIncidence(); void showIncidence(); protected: void hideEvent ( QHideEvent * e ); private: bool sendSignalViewerClosed; bool mSyncMode; int mSyncResult; KOEventViewer *mEventViewer; Incidence* mIncidence; void keyPressEvent ( QKeyEvent * e ); }; #endif diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index e72f94b..0bbb3bf 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -1,174 +1,174 @@ /* 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 <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qcombobox.h> #include <qvbox.h> #include <qhbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qstrlist.h> #include <qapplication.h> #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 #include "koprefs.h" #include "koprefsdialog.h" #include "kpimglobalprefs.h" KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : KPrefsDialog(KOPrefs::instance(),parent,name,true) { - setFont( KGlobalSettings::generalFont() ); + setFont( KGlobalSettings::generalMaxFont() ); setCaption( i18n("Preferences - some settings need a restart (nr)")); mCategoryDict.setAutoDelete(true); KGlobal::locale()->insertCatalogue("timezones"); mSpacingHint = spacingHintSmall(); mMarginHint = marginHintSmall(); #ifndef DESKTOP_VERSION if ( QApplication::desktop()->height() == 480 ) hideButtons(); #endif setupGlobalTab(); setupMainTab(); // setupLocaleTab(); //setupTimeZoneTab(); setupTimeTab(); //setupLocaleDateTab(); setupFontsTab(); setupColorsTab(); setupViewsTab(); //setupSyncTab(); //setupSyncAlgTab(); //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); } KOPrefsDialog::~KOPrefsDialog() { } void KOPrefsDialog::setupGlobalTab() { QFrame *topFrame = addPage(i18n("Global"),0,0); kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); QVBoxLayout *topLayout = new QVBoxLayout(topFrame); topLayout->addWidget( kdelibcfg ); } void KOPrefsDialog::setupLocaleDateTab() { #if 0 QFrame *topFrame = addPage(i18n("Date Format"),0,0); QGridLayout *topLayout = new QGridLayout(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")); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; ++iii; QLabel * lab; mUserDateFormatLong = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 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 @@ -626,193 +626,192 @@ void KOPrefsDialog::setupViewsTab() 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); KPrefsDialogWidBool *fullViewTodo = addWidBool(i18n("Event list view uses full window"), &(KOPrefs::instance()->mFullViewTodo),topFrame); topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); dummy = addWidBool(i18n("Listview uses monthly timespan"), &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Highlight selection in Time Edit"), &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); topLayout->addWidget( dummy->checkBox(), ii++,0); KPrefsDialogWidBool *dailyRecur = addWidBool(i18n("Show events that recur daily in date nav."), &(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); #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->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); topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); dummy = addWidBool(i18n("Set agenda to DayBeginsAt on change"), &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Set agenda to current time on change"), &(KOPrefs::instance()->mCenterOnCurrentTime),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->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); - qDebug("%d %d ",mSpacingHint, mMarginHint ); ii = 0; QLabel *lab; QHBox *habo = new QHBox( 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 ); 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); 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); #endif dummy = addWidBool(i18n("Week view mode uses bigger font"), &(KOPrefs::instance()->mMonthViewUsesBigFont),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("Categorie colors are applied to text"), &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); topLayout->addWidget(dummy->checkBox(),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->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9505d06..94f4677 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1681,196 +1681,192 @@ void MainWindow::importQtopia() #else QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; #endif mView->importQtopia( categories, datebook, todolist ); } #if 0 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), i18n("Not supported \non desktop!\n"), i18n("Ok"), i18n("Cancel"), 0, 0, 1 ); #endif } void MainWindow::saveOnClose() { KOPrefs *p = KOPrefs::instance(); p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); if ( filterToolBar ) { p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); } #ifdef DESKTOP_VERSION QPoint myP; myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); if ( p->mToolBarHor ) p->mToolBarUp = myP.y() > height()/2; else p->mToolBarUp = myP.x() > width()/2; myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); if ( p->mToolBarHorV ) p->mToolBarUpV = myP.y() > height()/2; else p->mToolBarUpV = myP.x() > width()/2 ; myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); if ( p->mToolBarHorN ) p->mToolBarUpN = myP.y() > height()/2; else p->mToolBarUpN = myP.x() > width()/2 ; if ( filterToolBar ) { myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); if ( p->mToolBarHorF ) p->mToolBarUpF = myP.y() > height()/2; else p->mToolBarUpF = myP.x() > width()/2 ; } #else if ( p->mToolBarHor ) p->mToolBarUp = iconToolBar->y() > height()/2; else p->mToolBarUp = iconToolBar->x() > width()/2; if ( p->mToolBarHorV ) p->mToolBarUpV = viewToolBar->y() > height()/2; else p->mToolBarUpV = viewToolBar->x() > width()/2 ; if ( p->mToolBarHorN ) p->mToolBarUpN = navigatorToolBar->y() > height()/2; else p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; if ( filterToolBar ) { if ( p->mToolBarHorF ) p->mToolBarUpF = filterToolBar->y() > height()/2; else p->mToolBarUpF = filterToolBar->x() > width()/2 ; } #endif mView->writeSettings(); if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) save(); } void MainWindow::slotModifiedChanged( bool changed ) { if ( mBlockAtStartup ) return; int msec; // we store the changes after 1 minute, // and for safety reasons after 10 minutes again if ( !mSyncManager->blockSave() ) msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; else msec = 1000 * 600; mSaveTimer.start( msec, true ); // 1 minute qDebug("KO: Saving File in %d secs!", msec/1000); mCalendarModifiedFlag = true; } void MainWindow::saveStopTimer() { mSaveTimer.stop(); - if (mSaveTimer.isActive() ) - qDebug("ti active "); - else - qDebug("KO: Save timer stopped"); } void MainWindow::save() { if ( !mCalendarModifiedFlag ) { qDebug("KO: Calendar not modified. Nothing saved."); return; } if ( mSyncManager->blockSave() ) return; mSyncManager->setBlockSave(true); if ( mView->checkFileVersion( defaultFileName()) ) { QTime neededSaveTime = QDateTime::currentDateTime().time(); setCaption(i18n("KO/Pi:Saving Data to File ..." )); qDebug("KO: Start saving data to file!"); mView->saveCalendar( defaultFileName() ); mCalendarModifiedFlag = false; int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); qDebug("KO: Needed %d ms for saving.",msNeeded ); QString savemes; savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); setCaption(savemes); } else setCaption(i18n("Saving cancelled!")); mSyncManager->setBlockSave( false ); } void MainWindow::keyReleaseEvent ( QKeyEvent * e) { if ( !e->isAutoRepeat() ) { mFlagKeyPressed = false; } } void MainWindow::keyPressEvent ( QKeyEvent * e ) { qApp->processEvents(); if ( e->isAutoRepeat() && !mFlagKeyPressed ) { e->ignore(); // qDebug(" ignore %d",e->isAutoRepeat() ); return; } if (! e->isAutoRepeat() ) mFlagKeyPressed = true; KOPrefs *p = KOPrefs::instance(); bool showSelectedDates = false; int size; int pro = 0; //qDebug("MainWindow::keyPressEvent "); switch ( e->key() ) { case Qt::Key_Right: if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) mView->goNextMonth(); else mView->goNext(); showSelectedDates = true; break; case Qt::Key_Left: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) mView->goPreviousMonth(); else mView->goPrevious(); showSelectedDates = true; break; case Qt::Key_Down: mView->viewManager()->agendaView()->scrollOneHourDown(); break; case Qt::Key_Up: mView->viewManager()->agendaView()->scrollOneHourUp(); break; case Qt::Key_K: mView->viewManager()->showMonthViewWeek(); break; case Qt::Key_I: mView->showIncidence(); break; case Qt::Key_Delete: case Qt::Key_Backspace: mView->deleteIncidence(); break; case Qt::Key_D: mView->viewManager()->showDayView(); showSelectedDates = true; break; case Qt::Key_O: mView->toggleFilerEnabled( ); break; case Qt::Key_0: case Qt::Key_1: case Qt::Key_2: case Qt::Key_3: case Qt::Key_4: case Qt::Key_5: case Qt::Key_6: case Qt::Key_7: case Qt::Key_8: case Qt::Key_9: pro = e->key()-48; diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index b6d2feb..b837b23 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp @@ -1,50 +1,66 @@ #include "kglobalsettings.h" #include "kconfig.h" #include "kglobal.h" #include "kconfigbase.h" #include <qapplication.h> QFont KGlobalSettings::generalFont() { int size = 12; if (QApplication::desktop()->width() < 480 ) { size = 10; } #ifndef DESKTOP_VERSION else if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) size = 18; #endif QFont f = QApplication::font(); //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); f.setPointSize( size ); return f; } +QFont KGlobalSettings::generalMaxFont() +{ + int size = 12; + if (QApplication::desktop()->width() < 480 ) { + size = 10; + } +#ifndef DESKTOP_VERSION + else + if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) + size = 18; +#endif + QFont f = QApplication::font(); + if ( f.pointSize() > size ) + f.setPointSize( size ); + return f; +} QFont KGlobalSettings::toolBarFont() { return QApplication::font(); } QColor KGlobalSettings::toolBarHighlightColor() { return QColor( "black" ); } QRect KGlobalSettings::desktopGeometry( QWidget * ) { return QApplication::desktop()->rect(); } /** * Returns whether KDE runs in single (default) or double click * mode. * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html * @return true if single click mode, or false if double click mode. **/ bool KGlobalSettings::singleClick() { KConfig *c = KGlobal::config(); KConfigGroupSaver cgs( c, "KDE" ); return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); } diff --git a/microkde/kglobalsettings.h b/microkde/kglobalsettings.h index 7df8012..075bb1c 100644 --- a/microkde/kglobalsettings.h +++ b/microkde/kglobalsettings.h @@ -1,30 +1,31 @@ #ifndef MICROKDE_KGLOBALSETTINGS_H #define MICROKDE_KGLOBALSETTINGS_H #include <qfont.h> #include <qrect.h> #define KDE_DEFAULT_SINGLECLICK true class KGlobalSettings { public: static QFont generalFont(); + static QFont generalMaxFont(); static QFont toolBarFont(); static QColor toolBarHighlightColor(); static QRect desktopGeometry( QWidget * ); /** * Returns whether KDE runs in single (default) or double click * mode. * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html * @return true if single click mode, or false if double click mode. **/ static bool singleClick(); }; #endif diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index bb41b18..9c87682 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp @@ -1,141 +1,141 @@ /* Copyright (c) 2000 Matthias Elter <elter@kde.org> Copyright (c) 2003 Daniel Molkentin <molkentin@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. */ #include <qhbox.h> #include <qvbox.h> #include <qcursor.h> #include <qlayout.h> #include <klocale.h> #include <kglobal.h> #include <kdebug.h> #include <kiconloader.h> #include <kmessagebox.h> //US #include <klibloader.h> #include <krun.h> #include <kprocess.h> #include <kglobalsettings.h> #include "kcmultidialog.h" //US #include "kcmultidialog.moc" //US #include "kcmoduleloader.h" KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, parent, name, modal, true), d(0L) { - setFont( KGlobalSettings::generalFont() ); + setFont( KGlobalSettings::generalMaxFont() ); enableButton(Apply, false); //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); _baseGroup = baseGroup; mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); setMainWidget(mMainWidget ); #ifdef DESKTOP_VERSION resize(640,480); #else //resize(640,480); //setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); resize(800,800); setMaximumSize( 800, 800 ); //showMaximized(); #endif } KCMultiDialog::~KCMultiDialog() { //US moduleDict.setAutoDelete(true); } void KCMultiDialog::slotDefault() { int curPageIndex = activePageIndex(); QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) { if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) { (*it)->defaults(); clientChanged(true); return; } } } void KCMultiDialog::accept() { slotOk(); } void KCMultiDialog::slotApply() { QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); clientChanged(false); emit applyClicked(); } void KCMultiDialog::slotOk() { qDebug("KCMultiDialog::slotOk clicked"); QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); QDialog::accept(); emit okClicked(); } void KCMultiDialog::slotHelp() { /*US KURL url( KURL("help:/"), _docPath ); if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { KProcess process; process << "khelpcenter" << url.url(); process.start(KProcess::DontCare); process.detach(); } else { new KRun(url); } */ } void KCMultiDialog::clientChanged(bool state) { enableButton(Apply, state); } /*US void KCMultiDialog::addModule(const QString& path, bool withfallback) { kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; |