[atlantik-cvs] CVS: kdegames/atlantik/libatlantikui estateview.cpp, 1.73.2.1, 1.73.2.2 estateview.h, 1.32, 1.32.2.1
[email protected] Tue, 9 Dec 2003 01:34:09 +0100 (CET)
| Newsgroups | gmane.comp.kde.devel.atlantik |
|---|---|
| Message-ID | <[email protected]> |
Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv4591/libatlantikui
Modified Files:
Tag: atlantik_3_3_branch
estateview.cpp estateview.h
Log Message:
put useful info in the tooltips
Index: estateview.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/estateview.cpp,v
retrieving revision 1.73.2.1
retrieving revision 1.73.2.2
diff -u -d -r1.73.2.1 -r1.73.2.2
--- estateview.cpp 2 Dec 2003 20:59:19 -0000 1.73.2.1
+++ estateview.cpp 9 Dec 2003 00:34:06 -0000 1.73.2.2
@@ -69,7 +69,25 @@
icon = new QPixmap(locate("data", "atlantik/pics/" + _icon));
icon = rotatePixmap(icon);
- QToolTip::add(this, m_estate->name());
+ updateToolTip();
+}
+
+void EstateView::updateToolTip()
+{
+ QToolTip::remove(this);
+
+ if ( m_estate )
+ {
+ QString toolTip = m_estate->name();
+ if ( m_estate->isOwned() )
+ toolTip.append( "\n" + i18n("Owner: %1").arg( m_estate->owner()->name() ) );
+ else if ( m_estate->canBeOwned() )
+ toolTip.append( "\n" + i18n("Price: %1").arg( m_estate->price() ) );
+ else if ( m_estate->money() )
+ toolTip.append( "\n" + i18n("Money: %1").arg( m_estate->money() ) );
+
+ QToolTip::add( this, toolTip );
+ }
}
void EstateView::setViewProperties(bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects)
@@ -180,13 +198,13 @@
void EstateView::estateChanged()
{
lname->setText(m_estate->name());
- QToolTip::remove(this);
- QToolTip::add(this, m_estate->name());
+ updateToolTip();
b_recreate = true;
m_recreateQuartz = true;
- update();
- updatePE();
+
+ update();
+ updatePE();
}
void EstateView::repositionPortfolioEstate()
Index: estateview.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/estateview.h,v
retrieving revision 1.32
retrieving revision 1.32.2.1
diff -u -d -r1.32 -r1.32.2.1
--- estateview.h 23 Jun 2003 03:05:25 -0000 1.32
+++ estateview.h 9 Dec 2003 00:34:06 -0000 1.32.2.1
@@ -58,7 +58,9 @@
void resizeEvent(QResizeEvent *);
void mousePressEvent(QMouseEvent *);
- private:
+private:
+ void updateToolTip();
+
QPixmap *rotatePixmap(QPixmap *);
KPixmap *rotatePixmap(KPixmap *);
void drawQuartzBlocks(KPixmap *pi, KPixmap &p, const QColor &c1, const QColor &c2);