summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/details/look_details.cpp2
-rw-r--r--kmicromail/koprefsdialog.cpp2
-rw-r--r--korganizer/datenavigatorcontainer.cpp3
-rw-r--r--korganizer/kodaymatrix.cpp8
-rw-r--r--korganizer/koeventviewerdialog.cpp16
-rw-r--r--korganizer/koeventviewerdialog.h1
-rw-r--r--korganizer/koprefsdialog.cpp3
-rw-r--r--korganizer/mainwindow.cpp4
-rw-r--r--microkde/kglobalsettings.cpp16
-rw-r--r--microkde/kglobalsettings.h1
-rw-r--r--microkde/kutils/kcmultidialog.cpp2
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
@@ -18,97 +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 <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 );
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp
index 9cde5cf..7de7064 100644
--- a/kmicromail/koprefsdialog.cpp
+++ b/kmicromail/koprefsdialog.cpp
@@ -23,97 +23,97 @@
#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);
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index e57daa4..f9c8b73 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -74,110 +74,109 @@ void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
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();
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 322131f..ecca374 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -295,100 +295,100 @@ 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;
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 35d084d..1dce841 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -37,105 +37,110 @@ KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *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"));
@@ -167,97 +172,98 @@ void KOEventViewerDialog::addIncidence(Incidence *in)
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 :
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h
index 8e1cd44..29fee49 100644
--- a/korganizer/koeventviewerdialog.h
+++ b/korganizer/koeventviewerdialog.h
@@ -7,70 +7,71 @@
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
@@ -30,97 +30,97 @@
#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);
@@ -674,97 +674,96 @@ void KOPrefsDialog::setupViewsTab()
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"),
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9505d06..94f4677 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1729,100 +1729,96 @@ void MainWindow::saveOnClose()
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() ) {
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,93 +1,93 @@
/*
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()
{