summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-11 15:48:26 (UTC)
committer zautrix <zautrix>2005-01-11 15:48:26 (UTC)
commitff808c2b4cd2751e7f99dd7cb5c1e44886ac151f (patch) (side-by-side diff)
tree7cd2fdcfea35ca54b94aff1b113c92482a904fae /korganizer
parent7738615474fd5186928e3f4dcdc58b483f7ad1a9 (diff)
downloadkdepimpi-ff808c2b4cd2751e7f99dd7cb5c1e44886ac151f.zip
kdepimpi-ff808c2b4cd2751e7f99dd7cb5c1e44886ac151f.tar.gz
kdepimpi-ff808c2b4cd2751e7f99dd7cb5c1e44886ac151f.tar.bz2
tooltips added
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp38
-rw-r--r--korganizer/komonthview.h11
2 files changed, 44 insertions, 5 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 08232e2..9344567 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -56,3 +56,5 @@
#define PIXMAP_SIZE 5
-
+#ifdef DESKTOP_VERSION
+ QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
+#endif
class KNOWhatsThis :public QWhatsThis
@@ -86,3 +88,3 @@ QString KNoScrollListBox::getWhatsThisText(QPoint p)
if ( ! item ) {
- return i18n("Click in the cell or\non the date label\nto add an event!");
+ return i18n("Click in the cell\nto add an event!");
}
@@ -297,2 +299,9 @@ MonthViewCell::MonthViewCell( KOMonthView *parent)
}
+#ifdef DESKTOP_VERSION
+QToolTipGroup *MonthViewCell::toolTipGroup()
+{
+ if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0);
+ return mToolTipGroup;
+}
+#endif
@@ -394,2 +403,6 @@ void MonthViewCell::updateCell()
mItemList->clear();
+#ifdef DESKTOP_VERSION
+ QToolTip::remove(this);
+#endif
+ QString tipText("");
//qApp->processEvents();
@@ -399,2 +412,3 @@ void MonthViewCell::updateCell()
mItemList->insertItem( item );
+ tipText += mHolidayString+"\n";
}
@@ -430,5 +444,8 @@ void MonthViewCell::updateCell()
text = prefix + event->summary();
+ tipText += text;
} else {
- if (event->doesFloat())
+ if (event->doesFloat()) {
text = event->summary();
+ tipText += text;
+ }
else {
@@ -436,2 +453,3 @@ void MonthViewCell::updateCell()
text += " " + event->summary();
+ tipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
}
@@ -485,4 +503,7 @@ void MonthViewCell::updateCell()
}
- if ( insert )
+ if ( insert ) {
mItemList->insertItem( item );
+ tipText += "\n";
+ } else
+ tipText = "";
}
@@ -529,3 +550,9 @@ void MonthViewCell::updateCell()
mItemList->insertItem( item );
+ tipText += text+"\n";
}
+#ifdef DESKTOP_VERSION
+ if (tipText != "")
+ QToolTip::add(this,tipText,toolTipGroup(),"");
+#endif
+
//setMyPalette();
@@ -816,2 +843,5 @@ void KOMonthView::updateConfig()
}
+#ifdef DESKTOP_VERSION
+ MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
+#endif
}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 5124057..4c1567c 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -38,2 +38,6 @@
+#ifdef DESKTOP_VERSION
+class QToolTipGroup;
+#endif
+
class KOWeekButton : public QPushButton
@@ -142,2 +146,5 @@ class MonthViewCell : public QWidget
+#ifdef DESKTOP_VERSION
+ static QToolTipGroup *toolTipGroup();
+#endif
signals:
@@ -169,3 +176,5 @@ class MonthViewCell : public QWidget
QListBox *mItemList;
-
+#ifdef DESKTOP_VERSION
+ static QToolTipGroup *mToolTipGroup;
+#endif
QSize mLabelSize;