summaryrefslogtreecommitdiffstats
path: root/src/gui/ratingfieldwidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 19:17:32 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 19:17:32 +0000
commite38d2351b83fa65c66ccde443777647ef5cb6cff (patch)
tree1897fc20e9f73a81c520a5b9f76f8ed042124883 /src/gui/ratingfieldwidget.cpp
downloadtellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.tar.gz
tellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.zip
Added KDE3 version of Tellico
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1097620 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/ratingfieldwidget.cpp')
-rw-r--r--src/gui/ratingfieldwidget.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/gui/ratingfieldwidget.cpp b/src/gui/ratingfieldwidget.cpp
new file mode 100644
index 0000000..4b0de71
--- /dev/null
+++ b/src/gui/ratingfieldwidget.cpp
@@ -0,0 +1,59 @@
+/***************************************************************************
+ copyright : (C) 2005-2006 by Robby Stephenson
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of version 2 of the GNU General Public License as *
+ * published by the Free Software Foundation; *
+ * *
+ ***************************************************************************/
+
+#include "ratingfieldwidget.h"
+#include "ratingwidget.h"
+#include "../field.h"
+
+using Tellico::GUI::RatingFieldWidget;
+
+RatingFieldWidget::RatingFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
+ : FieldWidget(field_, parent_, name_) {
+ m_rating = new RatingWidget(field_, this);
+ connect(m_rating, SIGNAL(modified()), SIGNAL(modified()));
+
+ registerWidget();
+}
+
+QString RatingFieldWidget::text() const {
+ return m_rating->text();
+}
+
+void RatingFieldWidget::setText(const QString& text_) {
+ blockSignals(true);
+
+ m_rating->blockSignals(true);
+ m_rating->setText(text_);
+ m_rating->blockSignals(false);
+
+ blockSignals(false);
+
+ if(m_rating->text() != text_) {
+ emit modified();
+ }
+}
+
+void RatingFieldWidget::clear() {
+ m_rating->clear();
+ editMultiple(false);
+}
+
+void RatingFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_) {
+ m_rating->updateField(newField_);
+}
+
+QWidget* RatingFieldWidget::widget() {
+ return m_rating;
+}
+
+#include "ratingfieldwidget.moc"