summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer/ui
Unidiff
Diffstat (limited to 'noncore/apps/tableviewer/ui') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/ui/browsekeyentry.cpp49
-rw-r--r--noncore/apps/tableviewer/ui/filterkeyentry.cpp42
-rw-r--r--noncore/apps/tableviewer/ui/tvfilterview.cpp55
3 files changed, 77 insertions, 69 deletions
diff --git a/noncore/apps/tableviewer/ui/browsekeyentry.cpp b/noncore/apps/tableviewer/ui/browsekeyentry.cpp
index 42e24dd..6b78437 100644
--- a/noncore/apps/tableviewer/ui/browsekeyentry.cpp
+++ b/noncore/apps/tableviewer/ui/browsekeyentry.cpp
@@ -18,3 +18,3 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "browsekeyentry.h" 20#include "browsekeyentry.h"
@@ -22,2 +22,5 @@
22 22
23#include <opie2/odebug.h>
24using namespace Opie::Core;
25
23#include <qtoolbutton.h> 26#include <qtoolbutton.h>
@@ -31,5 +34,2 @@
31 34
32#include <qheader.h>
33// For qWarning(const char *)
34
35/*! 35/*!
@@ -44,3 +44,3 @@
44/*! 44/*!
45 Constructs the widget 45 Constructs the widget
46*/ 46*/
@@ -75,14 +75,14 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
75 ws->raiseWidget(TVVariant::String); 75 ws->raiseWidget(TVVariant::String);
76 76
77 // TODO connect slots and signals.... 77 // TODO connect slots and signals....
78 connect(changeKeyButton, SIGNAL(clicked()), 78 connect(changeKeyButton, SIGNAL(clicked()),
79 this, SLOT(changeKeyMenuSlot())); 79 this, SLOT(changeKeyMenuSlot()));
80 80
81 connect(resetButton, SIGNAL(clicked()), 81 connect(resetButton, SIGNAL(clicked()),
82 textKey, SLOT(clear())); 82 textKey, SLOT(clear()));
83 connect(resetButton, SIGNAL(clicked()), 83 connect(resetButton, SIGNAL(clicked()),
84 intKey, SLOT(clear())); 84 intKey, SLOT(clear()));
85 connect(resetButton, SIGNAL(clicked()), 85 connect(resetButton, SIGNAL(clicked()),
86 dateKey, SLOT(clear())); 86 dateKey, SLOT(clear()));
87 connect(resetButton, SIGNAL(clicked()), 87 connect(resetButton, SIGNAL(clicked()),
88 timeKey, SLOT(clear())); 88 timeKey, SLOT(clear()));
@@ -93,9 +93,9 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
93 93
94 connect(textKey, SIGNAL(textChanged(const QString&)), 94 connect(textKey, SIGNAL(textChanged(const QString&)),
95 this, SLOT(searchOnText())); 95 this, SLOT(searchOnText()));
96 connect(intKey, SIGNAL(valueChanged(int)), 96 connect(intKey, SIGNAL(valueChanged(int)),
97 this, SLOT(searchOnText())); 97 this, SLOT(searchOnText()));
98 connect(dateKey, SIGNAL(valueChanged(const QDate&)), 98 connect(dateKey, SIGNAL(valueChanged(const QDate&)),
99 this, SLOT(searchOnText())); 99 this, SLOT(searchOnText()));
100 connect(timeKey, SIGNAL(valueChanged(const QTime&)), 100 connect(timeKey, SIGNAL(valueChanged(const QTime&)),
101 this, SLOT(searchOnText())); 101 this, SLOT(searchOnText()));
@@ -104,3 +104,3 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
104/*! 104/*!
105 Destructs the widget 105 Destructs the widget
106*/ 106*/
@@ -128,3 +128,3 @@ void TVBrowseKeyEntry::changeKeyMenuSlot()
128{ 128{
129 if(ts) 129 if(ts)
130 keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0))); 130 keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0)));
@@ -148,3 +148,3 @@ void TVBrowseKeyEntry::rebuildKeys() {
148 for (i = 0; i < ts->kRep->getNumFields(); i++) { 148 for (i = 0; i < ts->kRep->getNumFields(); i++) {
149 keyMenu->insertItem(it.current()->name(), this, 149 keyMenu->insertItem(it.current()->name(), this,
150 SLOT(changeKeySlot(int)), 0, i); 150 SLOT(changeKeySlot(int)), 0, i);
@@ -165,4 +165,4 @@ void TVBrowseKeyEntry::reset()
165/*! 165/*!
166 Searches on the current value of the key entry provided that the 166 Searches on the current value of the key entry provided that the
167 current key is of type text WARNING, TODO fix memory leaks 167 current key is of type text WARNING, TODO fix memory leaks
168*/ 168*/
@@ -191,7 +191,6 @@ void TVBrowseKeyEntry::searchOnText()
191 } 191 }
192 case TVVariant::Invalid: 192 case TVVariant::Invalid:
193 break; 193 break;
194 default: 194 default:
195 qWarning("TVBrowseKeyEntry::searchOnText() " 195 owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl;
196 "cannot work out data type");
197 return; 196 return;
@@ -205,2 +204,2 @@ void TVBrowseKeyEntry::searchOnText()
205 done searching for the value v. 204 done searching for the value v.
206*/ 205*/
diff --git a/noncore/apps/tableviewer/ui/filterkeyentry.cpp b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
index d108fbd..4d74d6b 100644
--- a/noncore/apps/tableviewer/ui/filterkeyentry.cpp
+++ b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
@@ -18,3 +18,3 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "filterkeyentry.h" 20#include "filterkeyentry.h"
@@ -22,2 +22,7 @@
22 22
23/* OPIE */
24#include <opie2/odebug.h>
25using namespace Opie::Core;
26
27/* QT */
23#include <qwidgetstack.h> 28#include <qwidgetstack.h>
@@ -100,9 +105,9 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
100 /* connect the signals down */ 105 /* connect the signals down */
101 connect(textKey, SIGNAL(textChanged(const QString&)), 106 connect(textKey, SIGNAL(textChanged(const QString&)),
102 this, SIGNAL(valueChanged())); 107 this, SIGNAL(valueChanged()));
103 connect(intKey, SIGNAL(valueChanged(int)), 108 connect(intKey, SIGNAL(valueChanged(int)),
104 this, SIGNAL(valueChanged())); 109 this, SIGNAL(valueChanged()));
105 connect(dateKey, SIGNAL(valueChanged(const QDate&)), 110 connect(dateKey, SIGNAL(valueChanged(const QDate&)),
106 this, SIGNAL(valueChanged())); 111 this, SIGNAL(valueChanged()));
107 connect(timeKey, SIGNAL(valueChanged(const QTime&)), 112 connect(timeKey, SIGNAL(valueChanged(const QTime&)),
108 this, SIGNAL(valueChanged())); 113 this, SIGNAL(valueChanged()));
@@ -121,3 +126,3 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
121/*! 126/*!
122 Destructs the widget 127 Destructs the widget
123*/ 128*/
@@ -127,3 +132,3 @@ TVFilterKeyEntry::~TVFilterKeyEntry()
127 132
128void TVFilterKeyEntry::setKey(int i) 133void TVFilterKeyEntry::setKey(int i)
129{ 134{
@@ -185,16 +190,16 @@ TVVariant TVFilterKeyEntry::getCompareValue()
185 switch(current_type) { 190 switch(current_type) {
186 case TVVariant::String: 191 case TVVariant::String:
187 sendkey = TVVariant(QString(textKey->text())); 192 sendkey = TVVariant(QString(textKey->text()));
188 break; 193 break;
189 case TVVariant::Int: { 194 case TVVariant::Int: {
190 sendkey = TVVariant(intKey->value()); 195 sendkey = TVVariant(intKey->value());
191 break; 196 break;
192 } 197 }
193 case TVVariant::Time: { 198 case TVVariant::Time: {
194 sendkey = TVVariant(QTime(timeKey->time())); 199 sendkey = TVVariant(QTime(timeKey->time()));
195 break; 200 break;
196 } 201 }
197 case TVVariant::Date: { 202 case TVVariant::Date: {
198 sendkey = TVVariant(QDate(dateKey->date())); 203 sendkey = TVVariant(QDate(dateKey->date()));
199 break; 204 break;
200 } 205 }
@@ -202,4 +207,3 @@ TVVariant TVFilterKeyEntry::getCompareValue()
202 sendkey = TVVariant(0); 207 sendkey = TVVariant(0);
203 qWarning("TVFilterKeyEntry::getCompareValue() " 208 owarn << "TVFilterKeyEntry::getCompareValue() cannot work out data type" << oendl;
204 "cannot work out data type");
205 } 209 }
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp
index 22f1fb7..198c8b5 100644
--- a/noncore/apps/tableviewer/ui/tvfilterview.cpp
+++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp
@@ -20,2 +20,9 @@
20#include "tvfilterview.h" 20#include "tvfilterview.h"
21
22/* OPIE */
23#include <opie2/odebug.h>
24#include <qpe/qpeapplication.h>
25using namespace Opie::Core;
26
27/* QT */
21#include <qtoolbutton.h> 28#include <qtoolbutton.h>
@@ -28,3 +35,2 @@
28 35
29#include <qpe/qpeapplication.h>
30 36
@@ -33,4 +39,4 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent,
33{ 39{
34 if ( !name ) 40 if ( !name )
35 setName( "Filter View" ); 41 setName( "Filter View" );
36 42
@@ -90,4 +96,4 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent,
90 96
91 connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, 97 connect(display, SIGNAL(selectionChanged(QListViewItem*)), this,
92 SLOT(setTerm(QListViewItem*))); 98 SLOT(setTerm(QListViewItem*)));
93 99
@@ -104,3 +110,3 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent,
104/*! 110/*!
105 Destroys the TVFilterView widget 111 Destroys the TVFilterView widget
106*/ 112*/
@@ -120,3 +126,3 @@ void TVFilterView::reset()
120 126
121void TVFilterView::rebuildKeys() 127void TVFilterView::rebuildKeys()
122{ 128{
@@ -127,3 +133,3 @@ void TVFilterView::rebuildKeys()
127 keyEntry->setTableState(ts); 133 keyEntry->setTableState(ts);
128 134
129 /* set up the list of keys that can be compared on */ 135 /* set up the list of keys that can be compared on */
@@ -134,8 +140,8 @@ void TVFilterView::rebuildKeys()
134 while(it.current()) { 140 while(it.current()) {
135 if(ts->kRep->validIndex(it.currentKey())) { 141 if(ts->kRep->validIndex(it.currentKey())) {
136 keyNameCombo->insertItem(it.current()->name()); 142 keyNameCombo->insertItem(it.current()->name());
137 keyIds.insert(i, it.currentKey()); 143 keyIds.insert(i, it.currentKey());
138 ++i; 144 ++i;
139 } 145 }
140 ++it; 146 ++it;
141 } 147 }
@@ -148,3 +154,3 @@ bool TVFilterView::passesFilter(DataElem *d) {
148 FilterTerm *t; 154 FilterTerm *t;
149 155
150 for (t = terms.first(); t != 0; t = terms.next() ) { 156 for (t = terms.first(); t != 0; t = terms.next() ) {
@@ -177,4 +183,3 @@ bool TVFilterView::passesFilter(DataElem *d) {
177 default: 183 default:
178 qWarning("TVFilterView::passesFilter() " 184 owarn << "TVFilterView::passesFilter() unrecognized filter type" << oendl;
179 "unrecognized filter type");
180 return false; 185 return false;
@@ -196,3 +201,3 @@ bool TVFilterView::filterActive() const
196/* SLOTS */ 201/* SLOTS */
197void TVFilterView::newTerm() 202void TVFilterView::newTerm()
198{ 203{
@@ -214,3 +219,3 @@ void TVFilterView::newTerm()
214 219
215void TVFilterView::updateTerm() 220void TVFilterView::updateTerm()
216{ 221{
@@ -233,3 +238,3 @@ void TVFilterView::updateTerm()
233 term->value = keyEntry->getCompareValue(); 238 term->value = keyEntry->getCompareValue();
234 239
235 keyString = keyNameCombo->currentText(); 240 keyString = keyNameCombo->currentText();
@@ -262,3 +267,3 @@ void TVFilterView::updateTerm()
262 /* remove old view */ 267 /* remove old view */
263 if (term->view) 268 if (term->view)
264 delete(term->view); 269 delete(term->view);
@@ -269,3 +274,3 @@ void TVFilterView::updateTerm()
269/* deletes current term */ 274/* deletes current term */
270void TVFilterView::deleteTerm() 275void TVFilterView::deleteTerm()
271{ 276{
@@ -286,3 +291,3 @@ void TVFilterView::deleteTerm()
286/* clears all terminations */ 291/* clears all terminations */
287void TVFilterView::clearTerms() 292void TVFilterView::clearTerms()
288{ 293{
@@ -294,3 +299,3 @@ void TVFilterView::setTerm(QListViewItem *target)
294{ 299{
295 /* Iterate through the list to find item with view=target.. 300 /* Iterate through the list to find item with view=target..
296 * set as current, delete */ 301 * set as current, delete */
@@ -303,3 +308,3 @@ void TVFilterView::setTerm(QListViewItem *target)
303 if (!current) { 308 if (!current) {
304 current = term; 309 current = term;
305 } 310 }