[Kst] branches/work/kst/kst1kde4/kst/src/libkstapp
Andrew Walker
arwalker at sumusltd.com
Tue Apr 6 23:29:50 CEST 2010
SVN commit 1111879 by arwalker:
continue kst1kde4
M +4 -5 kstdatanotifier.cpp
M +8 -8 kstdebugnotifier.cpp
M +2 -2 kstdebugnotifier.h
M +16 -14 ktimezonecombo.cpp
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstdatanotifier.cpp #1111878:1111879
@@ -15,14 +15,13 @@
* *
***************************************************************************/
-#include "kstdatanotifier.h"
-
-#include "kst.h"
-
#include <QColor>
#include <QTimer>
#include <QToolTip>
+#include "kst.h"
+#include "kstdatanotifier.h"
+
static const int delays[] = { 900, 675, 425, 300, 200, 100, 80, 40, 20 };
static const int dark[] = { 100, 150, 200, 250, 300, 375, 450, 525, 600 };
static const unsigned int numIterations = sizeof(delays) / sizeof(int);
@@ -34,7 +33,7 @@
setShape(Rectangular);
setLook(Sunken);
_animationStage = 0;
- QToolTip::add(this, tr("Indicates that new data has arrived."));
+// xxx QToolTip::add(this, tr("Indicates that new data has arrived."));
show();
_colors = new QColor[numIterations];
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstdebugnotifier.cpp #1111878:1111879
@@ -15,14 +15,13 @@
* *
***************************************************************************/
-#include "kstdebugnotifier.h"
+#include <QTimer>
+#include <QToolTip>
-#include "kst.h"
-
#include <kstandarddirs.h>
-#include <qtimer.h>
-#include <qtooltip.h>
+#include "kst.h"
+#include "kstdebugnotifier.h"
#define TIMER_TICK 250
#define TIMER_ITERATIONS 10
@@ -32,13 +31,14 @@
: QLabel(parent) {
_animationStage = 0;
_gotPress = false;
- QToolTip::add(this, QObject::tr("An error has occurred. Click on this icon for more details."));
+// xxx QToolTip::add(this, QObject::tr("An error has occurred. Click on this icon for more details."));
_pm.resize(IMAGE_STAGES);
- _pm[0] = QPixmap(locate("data", "kst/pics/kst_error_1.png"));
- _pm[1] = QPixmap(locate("data", "kst/pics/kst_error_2.png"));
+// xxx _pm[0] = QPixmap(locate("data", "kst/pics/kst_error_1.png"));
+// xxx _pm[1] = QPixmap(locate("data", "kst/pics/kst_error_2.png"));
setPixmap(_pm[0]);
show();
+
QTimer::singleShot(TIMER_TICK, this, SLOT(animate()));
}
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstdebugnotifier.h #1111878:1111879
@@ -20,7 +20,7 @@
#include <QLabel>
#include <QPixmap>
-#include <QValueVector>
+#include <QVector>
class KstDebugNotifier : public QLabel {
Q_OBJECT
@@ -43,7 +43,7 @@
private:
int _animationStage;
bool _gotPress;
- QValueVector<QPixmap> _pm;
+ QVector<QPixmap> _pm;
};
#endif
--- branches/work/kst/kst1kde4/kst/src/libkstapp/ktimezonecombo.cpp #1111878:1111879
@@ -1,5 +1,7 @@
/*
Copyright (c) 2005 The University of Toronto
+ Copyright (c) 2010 The University of British Columbia
+
Based on code Copyright (C) 2005, S.R.Haque <srhaque at iee.org>.
This file is part of the KDE project
@@ -18,16 +20,16 @@
Boston, MA 02110-1301, USA.
*/
-#include <QListBox>
-#include <QMemArray>
#include <QComboBox>
+#include <QListWidget>
+#include <QVector>
#include "ktimezonecombo.h"
#include "ksttimezones.h"
class KTimezoneCombo::Private {
public:
- QMemArray<int> _offsets;
+ QVector<int> _offsets;
QStringList _names;
};
@@ -38,14 +40,14 @@
if (!userDb) {
db = new KstTimezones;
}
-
+/* xxx
if (listBox()) {
listBox()->setVScrollBarMode(QScrollView::AlwaysOn);
listBox()->setColumnMode(QListBox::FixedNumber);
listBox()->setRowMode(QListBox::Variable);
}
-
- insertItem("UTC");
+*/
+ insertItem(0, "UTC");
const KstTimezones::ZoneMap zones = db->allZones();
d->_offsets.resize(zones.count()+1);
d->_offsets[0] = 0;
@@ -75,7 +77,7 @@
}
offnum += QString::number(minutes);
if ((*it)->name() != "UTC") {
- insertItem(QObject::tr("%3 (UTC%1%2)").arg(negative ? '-' : '+').arg(offnum).arg((*it)->name()));
+ insertItem(0, tr("%3 (UTC%1%2)").arg(negative ? '-' : '+').arg(offnum).arg((*it)->name()));
d->_names += (*it)->name();
}
}
@@ -93,27 +95,27 @@
int KTimezoneCombo::offset() const {
- return d->_offsets[currentItem()];
+ return d->_offsets[currentIndex()];
}
QString KTimezoneCombo::tzName() const {
- if (currentItem() == 0) {
+ if (currentIndex() == 0) {
return currentText();
} else {
- return d->_names[currentItem()];
+ return d->_names[currentIndex()];
}
}
void KTimezoneCombo::setTimezone(const QString& tz) {
- int idx = d->_names.findIndex(tz);
+ int idx = d->_names.indexOf(tz);
if (idx != -1) {
- setCurrentItem(idx);
+ setCurrentIndex(idx);
} else {
- setCurrentItem(0);
- setCurrentText(tz);
+ setCurrentIndex(0);
+ setItemText(currentIndex(), tz);
}
}
More information about the Kst
mailing list