summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp14
-rw-r--r--korganizer/koprefsdialog.cpp4
2 files changed, 9 insertions, 9 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index df606d0..c32a2a4 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -42,95 +42,93 @@
#include <kcalendarsystem.h>
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include "koprefs.h"
#include "koglobals.h"
#include "kodaymatrix.h"
// ============================================================================
// D Y N A M I C T I P
// ============================================================================
DynamicTip::DynamicTip( QWidget * parent )
: QToolTip( parent )
{
matrix = (KODayMatrix*)parent;
}
class KODaymatrixWhatsThis :public QWhatsThis
{
public:
KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;};
- ~KODaymatrixWhatsThis() { ; };
+ ~KODaymatrixWhatsThis() { qDebug("DELETE KODaymatrixWhatsThis "); };
protected:
virtual QString text( const QPoint& p )
{
return _view->getWhatsThisText( p ) ;
}
private:
KODayMatrix * _view;
};
void DynamicTip::maybeTip( const QPoint &pos )
{
//calculate which cell of the matrix the mouse is in
QRect sz = matrix->frameRect();
int dheight = sz.height()*7 / 42;
int dwidth = sz.width() / 7;
int row = pos.y()/dheight;
int col = pos.x()/dwidth;
QRect rct(col*dwidth, row*dheight, dwidth, dheight);
// kdDebug() << "DynamicTip::maybeTip matrix cell index [" <<
// col << "][" << row << "] => " <<(col+row*7) << endl;
//show holiday names only
QString str = matrix->getHolidayLabel(col+row*7);
if (str.isEmpty()) return;
tip(rct, str);
}
// ============================================================================
// K O D A Y M A T R I X
// ============================================================================
const int KODayMatrix::NOSELECTION = -1000;
const int KODayMatrix::NUMDAYS = 42;
KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
: QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 )
-#if 0
-KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) :
- QFrame(parent, name)
-#endif
+
{
+ mLastView = -1;
oldW = 0;
oldH = 0;
myPix.resize( 150, 120 );
mRedrawNeeded = true;
mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
mPendingUpdateBeforeRepaint = false;
mouseDown = false;
// initialize dynamic arrays
bDays.resize ( NUMDAYS );
pDays.resize ( NUMDAYS );
hDays.resize ( NUMDAYS );
eDays.resize ( NUMDAYS );
days = new QDate[NUMDAYS];
daylbls = new QString[NUMDAYS];
//events = new int[NUMDAYS];
mToolTip = new DynamicTip(this);
// set default values used for drawing the matrix
mDefaultBackColor = palette().active().base();
mDefaultTextColor = palette().active().foreground();
mDefaultTextColorShaded = getShadedColor(mDefaultTextColor);
mHolidayColorShaded = getShadedColor(KOPrefs::instance()->mHolidayColor);
mSelectedDaysColor = QColor("white");
mTodayMarginWidth = 2;
@@ -223,48 +221,54 @@ void KODayMatrix::setCalendar( Calendar *cal )
{
mCalendar = cal;
setAcceptDrops( mCalendar );
updateEvents();
}
QColor KODayMatrix::getShadedColor(QColor color)
{
QColor shaded;
int h=0;
int s=0;
int v=0;
color.hsv(&h,&s,&v);
s = s/4;
v = 192+v/4;
shaded.setHsv(h,s,v);
return shaded;
}
KODayMatrix::~KODayMatrix()
{
+#if QT_VERSION >= 0x030000
+
+#else
+ delete mKODaymatrixWhatsThis;
+#endif
+
// 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) {
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index d9d7924..e4bee63 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1007,52 +1007,48 @@ dummy =
#endif
QHBox* dummyBox = new QHBox(topFrame);
new QLabel(i18n("Play beeps count:"),dummyBox);
mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
dummyBox = new QHBox(topFrame);
new QLabel(i18n("Beeps interval in sec:"),dummyBox);
mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
dummyBox = new QHBox(topFrame);
new QLabel(i18n("Default suspend time in min:"),dummyBox);
mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
dummyBox = new QHBox(topFrame);
new QLabel(i18n("Auto suspend count:"),dummyBox);
mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
-
-
-
-
QHBox* hbo = new QHBox ( topFrame );
mDefaultAlarmFile = new QLineEdit(hbo);
QPushButton * loadTemplate = new QPushButton(hbo);
QPixmap icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileimport16");
else
icon = SmallIcon("fileimport");
loadTemplate->setIconSet (icon ) ;
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
int size = loadTemplate->sizeHint().height();
loadTemplate->setFixedSize( size, size );
//lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
// topLayout->addWidget(lab ,iii++,0);
lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
topLayout->addWidget(lab ,iii++,0);
topLayout->addWidget(hbo,iii++,0);
// lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
// topLayout->addWidget(lab ,iii++,0);
// #ifndef DESKTOP_VERSION
// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
// #else
// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);