summaryrefslogtreecommitdiffstats
path: root/korn/hvitem.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /korn/hvitem.cpp
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korn/hvitem.cpp')
-rw-r--r--korn/hvitem.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/korn/hvitem.cpp b/korn/hvitem.cpp
new file mode 100644
index 000000000..e8cc2483d
--- /dev/null
+++ b/korn/hvitem.cpp
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2004, Mart Kelder (mart.kde@hccnet.nl)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "hvitem.h"
+
+#include "label.h"
+
+#include <kactioncollection.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kpassivepopup.h>
+#include <kpopupmenu.h>
+#include <kstdaction.h>
+
+#include <qcursor.h>
+#include <qtooltip.h>
+
+HVItem::HVItem( QWidget *parent, const char *name )
+ : BoxContainerItem( 0, name ),
+ _label( new Label( parent, "label" ) ),
+ _popup( new KPopupMenu( _label, "popupmenu" ) ),
+ _actions( new KActionCollection( _popup, "actions" ) )
+{
+ _popup->insertTitle( kapp->miniIcon(), kapp->caption() );
+ this->fillKPopupMenu( _popup, _actions );
+ _popup->insertSeparator();
+ KStdAction::quit( kapp, SLOT( quit() ), _actions )->plug( _popup );
+
+ connect( _label, SIGNAL( mouseButtonPressed( Qt::ButtonState ) ), this, SLOT( mouseButtonPressed( Qt::ButtonState ) ) );
+}
+
+HVItem::~HVItem()
+{
+ //Let everything be deleted by his parents.
+}
+
+void HVItem::showBox()
+{
+ _label->show();
+}
+
+void HVItem::setCount( const int count, const bool newMessages )
+{
+ drawLabel( _label, count, newMessages );
+}
+
+void HVItem::setTooltip( const QString& string )
+{
+ QToolTip::add( _label, string );
+}
+
+void HVItem::slotShowPassivePopup( QPtrList< KornMailSubject >* list, int total, bool date, const QString& name )
+{
+ showPassivePopup( _label, list, total, name, date );
+}
+
+void HVItem::slotShowPassivePopup( const QString& errorMessage, const QString& name )
+{
+ KPassivePopup::message( QString( "korn-%1-%2" ).arg( objId() ).arg( name ), errorMessage, _label, "Passive error message" );
+}
+
+void HVItem::doPopup()
+{
+ _popup->popup( QCursor::pos() );
+}
+
+#include "hvitem.moc"