summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabprefs.cpp4
-rw-r--r--kalarmd/alarmdialog.cpp9
-rw-r--r--kmicromail/koprefs.cpp11
-rw-r--r--korganizer/koprefs.cpp12
-rw-r--r--microkde/kdatetbl.cpp2
5 files changed, 15 insertions, 23 deletions
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index a2095d4..01e84d0 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -1,112 +1,112 @@
/*
This file is part of KAddressBook.
Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
//US#ifdef KAB_EMBEDDED
//#include <qstring.h>
//#endif //KAB_EMBEDDED
#include <qtextstream.h>
#include <qfile.h>
#include <qregexp.h>
#include <stdlib.h>
#include <libkdepim/kpimglobalprefs.h>
#include <kconfig.h>
#include <klocale.h>
#include <kstaticdeleter.h>
+#include <kglobalsettings.h>
//US#include <kdebug.h> // defines kdDebug()
#include "kabprefs.h"
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#endif
KABPrefs *KABPrefs::sInstance = 0;
static KStaticDeleter<KABPrefs> staticDeleterAB;
KABPrefs::KABPrefs()
: KPimPrefs("kaddressbookrc")
{
- mDetailsFont = QFont("helvetica",12);
KPrefs::setCurrentGroup( "Views" );
addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
KPrefs::setCurrentGroup( "General" );
addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
#ifdef KAB_EMBEDDED
addItemBool("AskForQuit",&mAskForQuit,true);
addItemBool("ToolBarHor",&mToolBarHor, true );
addItemBool("ToolBarUp",&mToolBarUp, false );
addItemBool("SearchWithReturn",&mSearchWithReturn, false );
- addItemFont("DetailsFont",&mDetailsFont);
+ addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont());
#endif //KAB_EMBEDDED
KPrefs::setCurrentGroup( "MainWindow" );
bool m_visible = false;
#ifdef DESKTOP_VERSION
m_visible = true;
#endif
addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible );
addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
addItemIntList( "DetailsSplitter", &mDetailsSplitter );
addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
KPrefs::setCurrentGroup( "Extensions_General" );
QStringList defaultExtensions;
defaultExtensions << "merge";
defaultExtensions << "distribution_list_editor";
addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
KPrefs::setCurrentGroup( "Views" );
QString defaultView = i18n( "Default Table View" );
addItemString( "CurrentView", &mCurrentView, defaultView );
addItemStringList( "ViewNames", &mViewNames, defaultView );
KPrefs::setCurrentGroup( "Filters" );
addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
}
KABPrefs::~KABPrefs()
{
//qDebug("KABPrefs::~KABPrefs() ");
if (sInstance == this)
sInstance = staticDeleterAB.setObject(0);
}
KABPrefs *KABPrefs::instance()
{
if ( !sInstance ) {
#ifdef KAB_EMBEDDED
sInstance = staticDeleterAB.setObject( new KABPrefs() );
#else //KAB_EMBEDDED
//US the following line has changed ???. Why
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index 521781e..751ba57 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -25,99 +25,102 @@
#include <qhbox.h>
#include <qvbox.h>
#include <qapp.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qfile.h>
#include <qtimer.h>
#include <qsound.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <stdlib.h>
#ifndef _WIN32_
#include <unistd.h>
#include <sys/ioctl.h>
#endif
#include <stdio.h>
#include <fcntl.h>
#ifndef DESKTOP_VERSION
#include <qtopia/alarmserver.h>
#include <qpe/resource.h>
#include <qtopia/sound.h>
#endif
#include "alarmdialog.h"
AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
: QDialog (parent, name, true, Qt::WStyle_StaysOnTop )
{
setCaption( "KO/Pi Alarm!" );
QVBoxLayout* layout = new QVBoxLayout( this);
QLabel* l = new QLabel("The following event triggered alarm:",this);
layout->addWidget ( l );
l->setAlignment( AlignCenter);
mMessage = new QLabel ( " ", this );
int fs = 18;
int fs2 = 12;
if ( QApplication::desktop()->width() < 480 ) {
setMaximumSize(220, 260);
fs2 = 10;
}
else {
setMaximumSize(440, 440);
}
layout->setSpacing( 3 );
layout->setMargin( 3 );
-
- l->setFont( QFont("helvetica",fs2, QFont::Bold) );
- mMessage->setFont( QFont("helvetica",fs, QFont::Bold) );
+ QFont fo = QApplication::font();
+ fo.setBold( true );
+ fo.setPointSize( fs2 );
+ l->setFont( fo );
+ fo.setPointSize( fs );
+ mMessage->setFont(fo );
mMessage->setAlignment( AlignCenter);
l = new QLabel("Missed Alarms:",this);
l->setAlignment( AlignCenter);
layout->addWidget ( mMessage );
layout->addWidget ( l );
mMissedAlarms= new QLabel ( "", this );
mMissedAlarms->setAlignment( AlignCenter);
playSoundTimer = new QTimer( this );
connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) );
playSoundTimer->stop();
layout->addWidget ( mMissedAlarms );
QHBox *suspendBox = new QHBox( this );
suspendBox->setSpacing(3);
layout->addWidget ( suspendBox );
(void)new QLabel("Suspend duration (minutes):",suspendBox);
mSuspendSpin = new QSpinBox(1,1440,1,suspendBox);
mSuspendSpin->setValue(7); // default suspend duration
QHBox * bbox = new QHBox ( this );
layout->addWidget ( bbox );
bbox->layout()->setSpacing( 5 );
QPushButton* suspend = new QPushButton( "Suspend", bbox);
QPushButton* silen = new QPushButton( " Stop sound ", bbox);
QPushButton* okbut = new QPushButton( "Ok", bbox);
connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) );
connect (suspend , SIGNAL( clicked() ), this, SLOT (slotSuspend() ) );
connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) );
#ifndef _WIN32_
if ( QFile::exists ( "/dev/sharp_led" ) )
fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK );
else
#endif
fd_led = 0;
statusLED.which = SHARP_LED_SALARM;
mSilent = false;
mSuspendCounter = 0;
setServerNotification( true );
}
void AlarmDialog::reject ()
{
QTimer::singleShot ( 3000, this, SLOT (suspend()) );
slotSuspend();
}
AlarmDialog::~AlarmDialog()
{
}
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp
index 7b1e169..e4b61dc 100644
--- a/kmicromail/koprefs.cpp
+++ b/kmicromail/koprefs.cpp
@@ -1,123 +1,120 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <time.h>
#ifndef _WIN32_
#include <unistd.h>
#endif
#include <qdir.h>
#include <qtextstream.h>
#include <qtextcodec.h>
#include <qstring.h>
#include <qregexp.h>
#include <qfont.h>
#include <qcolor.h>
#include <qstringlist.h>
#include <stdlib.h>
#include <kglobal.h>
#include <kconfig.h>
#include <klocale.h>
#include <kdebug.h>
#include <kemailsettings.h>
#include <kstaticdeleter.h>
+#include <kglobalsettings.h>
#include "koprefs.h"
#include "mainwindow.h"
KOPrefs *KOPrefs::mInstance = 0;
static KStaticDeleter<KOPrefs> insd;
KOPrefs::KOPrefs() :
KPimPrefs("kopiemailrc")
{
- mAppFont = QFont("helvetica",12);
- mComposeFont = QFont("helvetica",12);
- mReadFont = QFont("helvetica",12);
-
KPrefs::setCurrentGroup("General");
addItemString("SendCodec",&mSendCodec,i18n ("userdefined") );
addItemString("SenderName",&mName,i18n ("Please set at") );
addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") );
addItemBool("ViewMailAsHtml",&mViewAsHtml,false);
addItemBool("SendMailLater",&mSendLater,true);
addItemBool("ShowToField",&mShowToField,false);
addItemBool("UseKapi",&mUseKapi,false);
addItemInt("CurrentCodec",&mCurrentCodec,0);
addItemBool("ShowInfoSub",&mShowInfoSub,true);
addItemBool("ShowInfoFrom",&mShowInfoFrom,true);
addItemBool("ShowInfoTo",&mShowInfoTo,true);
addItemBool("ShowInfoStart",&mShowInfoStart,true);
KPrefs::setCurrentGroup("Fonts");
- addItemFont("Application Font",&mAppFont);
- addItemFont("Compose Font",&mComposeFont);
- addItemFont("Read Font",&mReadFont);
+ addItemFont("Application Font",&mAppFont,KGlobalSettings::generalFont());
+ addItemFont("Compose Font",&mComposeFont,KGlobalSettings::generalFont());
+ addItemFont("Read Font",&mReadFont,KGlobalSettings::generalFont());
fillMailDefaults();
isDirty = false;
}
KOPrefs::~KOPrefs()
{
if ( isDirty )
writeConfig();
if (mInstance == this)
mInstance = insd.setObject(0);
}
KOPrefs *KOPrefs::instance()
{
if (!mInstance) {
mInstance = insd.setObject(new KOPrefs());
mInstance->readConfig();
}
return mInstance;
}
void KOPrefs::usrSetDefaults()
{
}
void KOPrefs::fillMailDefaults()
{
if (mName.isEmpty()) mName = i18n ("Please set at");
if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB");
}
void KOPrefs::usrReadConfig()
{
KPimPrefs::usrReadConfig();
}
void KOPrefs::usrWriteConfig()
{
KPimPrefs::usrWriteConfig();
}
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 5bfe2a1..7efb6a6 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -18,107 +18,97 @@
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <time.h>
#ifndef _WIN32_
#include <unistd.h>
#endif
#include <qdir.h>
#include <qtextstream.h>
#include <qtextcodec.h>
#include <qstring.h>
#include <qregexp.h>
#include <qfont.h>
#include <qcolor.h>
#include <qstringlist.h>
#include <stdlib.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kconfig.h>
#include <klocale.h>
#include <kdebug.h>
#include <kemailsettings.h>
#include <kstaticdeleter.h>
#include <libkdepim/kpimglobalprefs.h>
#include "koprefs.h"
#include "mainwindow.h"
KOPrefs *KOPrefs::mInstance = 0;
static KStaticDeleter<KOPrefs> insd;
KOPrefs::KOPrefs() :
KPimPrefs("korganizerrc")
{
mCategoryColors.setAutoDelete(true);
fillMailDefaults();
mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
QColor defaultHolidayColor = QColor(255,0,0);
QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
QColor defaultTodoDueTodayColor = QColor(255,220,100);
QColor defaultTodoOverdueColor = QColor(255,153,125);
- /*
- mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
- mDefaultViewFont = QFont("helvetica",10);
- mDefaultMonthViewFont = QFont("helvetica",8);
- mMarcusBainsFont= QFont("helvetica",10);
- mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
- mEditBoxFont = QFont("helvetica",12);
- mJornalViewFont = QFont("helvetica",12);
- */
-
-
+
KPrefs::setCurrentGroup("General");
addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
addItemBool("ShowIconSearch",&mShowIconSearch,true);
addItemBool("ShowIconList",&mShowIconList,true);
addItemBool("ShowIconDay1",&mShowIconDay1,true);
addItemBool("ShowIconDay5",&mShowIconDay5,true);
addItemBool("ShowIconDay7",&mShowIconDay7,true);
addItemBool("ShowIconMonth",&mShowIconMonth,true);
addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
addItemBool("ShowIconBack",&mShowIconBack,true);
addItemBool("ShowIconToday",&mShowIconToday,true);
addItemBool("ShowIconForward",&mShowIconForward,true);
addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
addItemBool("ShowIconNext",&mShowIconNext,true);
addItemBool("ShowIconJournal",&mShowIconJournal,true);
addItemBool("ShowIconStretch",&mShowIconStretch,true);
addItemInt("LastLoadedLanguage",&mOldLanguage,0);
addItemBool("AskForQuit",&mAskForQuit,false);
#ifndef DESKTOP_VERSION
addItemBool("ShowFullMenu",&mShowFullMenu,false);
#else
addItemBool("ShowFullMenu",&mShowFullMenu,true);
#endif
addItemBool("ToolBarHor",&mToolBarHor, true );
addItemBool("ToolBarUp",&mToolBarUp, false );
addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
addItemInt("Whats Next Days",&mWhatsNextDays,3);
addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
addItemInt("AllDay Size",&mAllDaySize,28);
QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
addItemStringList("LocationDefaults",&mLocationDefaults );
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index a9924ba..1024796 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -412,96 +412,98 @@ KDateTable::setDate(const QDate& date_)
return true;
}
const QDate&
KDateTable::getDate() const
{
return date;
}
void KDateTable::focusInEvent( QFocusEvent *e )
{
repaintContents(false);
QGridView::focusInEvent( e );
}
void KDateTable::focusOutEvent( QFocusEvent *e )
{
repaintContents(false);
QGridView::focusOutEvent( e );
}
QSize
KDateTable::sizeHint() const
{
if(maxCell.height()>0 && maxCell.width()>0)
{
return QSize((maxCell.width()+2)*numCols()+2*frameWidth(),
(maxCell.height()+4)*numRows()+2*frameWidth());
} else {
return QSize(-1, -1);
}
}
KDateInternalMonthPicker::KDateInternalMonthPicker
(QWidget* parent, const char* name)
: QGridView(parent, name),
result(0) // invalid
{
QRect rect;
QFont font;
// -----
activeCol = -1;
activeRow = -1;
font=KGlobalSettings::generalFont();
int fontsize = 10;
int add = 2;
if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
add += 8;
+ if ( QApplication::desktop()->width() > 640 )
+ add += 4;
font.setPointSize(fontsize+add);
setFont(font);
setHScrollBarMode(AlwaysOff);
setVScrollBarMode(AlwaysOff);
setFrameStyle(QFrame::NoFrame);
setNumRows(4);
setNumCols(3);
// enable to find drawing failures:
// setTableFlags(Tbl_clipCellPainting);
#if 0
viewport()->setEraseColor(lightGray); // for consistency with the datepicker
#endif
// ----- find the preferred size
// (this is slow, possibly, but unfortunatly it is needed here):
QFontMetrics metrics(font);
for(int i=1; i <= 12; ++i)
{
rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false));
if(max.width()<rect.width()) max.setWidth(rect.width());
if(max.height()<rect.height()) max.setHeight(rect.height());
}
}
QSize
KDateInternalMonthPicker::sizeHint() const
{
return QSize((max.width()+6)*numCols()+2*frameWidth(),
(max.height()+6)*numRows()+2*frameWidth());
}
int
KDateInternalMonthPicker::getResult() const
{
return result;
}
void
KDateInternalMonthPicker::setupPainter(QPainter *p)
{
p->setPen(black);
}
void
KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*)
{
setCellWidth(width()/3);
setCellHeight(height()/4);