summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer/ui
Side-by-side diff
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
@@ -17,8 +17,11 @@
** not clear to you.
**
-**********************************************************************/
+**********************************************************************/
#include "browsekeyentry.h"
#include "commonwidgets.h"
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
#include <qtoolbutton.h>
#include <qwidgetstack.h>
@@ -30,7 +33,4 @@
#include <qdatetime.h>
-#include <qheader.h>
-// For qWarning(const char *)
-
/*!
\class TVBrowseKeyEntry
@@ -43,5 +43,5 @@
/*!
- Constructs the widget
+ Constructs the widget
*/
TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
@@ -74,16 +74,16 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
ws->raiseWidget(TVVariant::String);
-
+
// TODO connect slots and signals....
- connect(changeKeyButton, SIGNAL(clicked()),
+ connect(changeKeyButton, SIGNAL(clicked()),
this, SLOT(changeKeyMenuSlot()));
- connect(resetButton, SIGNAL(clicked()),
+ connect(resetButton, SIGNAL(clicked()),
textKey, SLOT(clear()));
- connect(resetButton, SIGNAL(clicked()),
+ connect(resetButton, SIGNAL(clicked()),
intKey, SLOT(clear()));
- connect(resetButton, SIGNAL(clicked()),
+ connect(resetButton, SIGNAL(clicked()),
dateKey, SLOT(clear()));
- connect(resetButton, SIGNAL(clicked()),
+ connect(resetButton, SIGNAL(clicked()),
timeKey, SLOT(clear()));
@@ -92,16 +92,16 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
h_layout->addWidget(changeKeyButton);
- connect(textKey, SIGNAL(textChanged(const QString&)),
+ connect(textKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
- connect(intKey, SIGNAL(valueChanged(int)),
+ connect(intKey, SIGNAL(valueChanged(int)),
this, SLOT(searchOnText()));
- connect(dateKey, SIGNAL(valueChanged(const QDate&)),
+ connect(dateKey, SIGNAL(valueChanged(const QDate&)),
this, SLOT(searchOnText()));
- connect(timeKey, SIGNAL(valueChanged(const QTime&)),
+ connect(timeKey, SIGNAL(valueChanged(const QTime&)),
this, SLOT(searchOnText()));
}
/*!
- Destructs the widget
+ Destructs the widget
*/
TVBrowseKeyEntry::~TVBrowseKeyEntry()
@@ -127,5 +127,5 @@ void TVBrowseKeyEntry::changeKeySlot(int id_param)
void TVBrowseKeyEntry::changeKeyMenuSlot()
{
- if(ts)
+ if(ts)
keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0)));
}
@@ -147,5 +147,5 @@ void TVBrowseKeyEntry::rebuildKeys() {
for (i = 0; i < ts->kRep->getNumFields(); i++) {
- keyMenu->insertItem(it.current()->name(), this,
+ keyMenu->insertItem(it.current()->name(), this,
SLOT(changeKeySlot(int)), 0, i);
keyMenu->setItemParameter(i, it.currentKey());
@@ -164,6 +164,6 @@ void TVBrowseKeyEntry::reset()
}
/*!
- Searches on the current value of the key entry provided that the
- current key is of type text WARNING, TODO fix memory leaks
+ Searches on the current value of the key entry provided that the
+ current key is of type text WARNING, TODO fix memory leaks
*/
void TVBrowseKeyEntry::searchOnText()
@@ -190,9 +190,8 @@ void TVBrowseKeyEntry::searchOnText()
break;
}
- case TVVariant::Invalid:
- break;
+ case TVVariant::Invalid:
+ break;
default:
- qWarning("TVBrowseKeyEntry::searchOnText() "
- "cannot work out data type");
+ owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl;
return;
}
@@ -204,3 +203,3 @@ void TVBrowseKeyEntry::searchOnText()
This signal indicates that a search on key index currentKeyId should be
done searching for the value v.
-*/
+*/
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
@@ -17,8 +17,13 @@
** not clear to you.
**
-**********************************************************************/
+**********************************************************************/
#include "filterkeyentry.h"
#include "commonwidgets.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qwidgetstack.h>
#include <qcombobox.h>
@@ -99,11 +104,11 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
/* connect the signals down */
- connect(textKey, SIGNAL(textChanged(const QString&)),
+ connect(textKey, SIGNAL(textChanged(const QString&)),
this, SIGNAL(valueChanged()));
- connect(intKey, SIGNAL(valueChanged(int)),
+ connect(intKey, SIGNAL(valueChanged(int)),
this, SIGNAL(valueChanged()));
- connect(dateKey, SIGNAL(valueChanged(const QDate&)),
+ connect(dateKey, SIGNAL(valueChanged(const QDate&)),
this, SIGNAL(valueChanged()));
- connect(timeKey, SIGNAL(valueChanged(const QTime&)),
+ connect(timeKey, SIGNAL(valueChanged(const QTime&)),
this, SIGNAL(valueChanged()));
@@ -120,5 +125,5 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
/*!
- Destructs the widget
+ Destructs the widget
*/
TVFilterKeyEntry::~TVFilterKeyEntry()
@@ -126,5 +131,5 @@ TVFilterKeyEntry::~TVFilterKeyEntry()
}
-void TVFilterKeyEntry::setKey(int i)
+void TVFilterKeyEntry::setKey(int i)
{
@@ -184,23 +189,22 @@ TVVariant TVFilterKeyEntry::getCompareValue()
switch(current_type) {
- case TVVariant::String:
- sendkey = TVVariant(QString(textKey->text()));
- break;
- case TVVariant::Int: {
+ case TVVariant::String:
+ sendkey = TVVariant(QString(textKey->text()));
+ break;
+ case TVVariant::Int: {
sendkey = TVVariant(intKey->value());
- break;
- }
+ break;
+ }
case TVVariant::Time: {
- sendkey = TVVariant(QTime(timeKey->time()));
- break;
+ sendkey = TVVariant(QTime(timeKey->time()));
+ break;
}
case TVVariant::Date: {
- sendkey = TVVariant(QDate(dateKey->date()));
- break;
+ sendkey = TVVariant(QDate(dateKey->date()));
+ break;
}
default: {
sendkey = TVVariant(0);
- qWarning("TVFilterKeyEntry::getCompareValue() "
- "cannot work out data type");
+ owarn << "TVFilterKeyEntry::getCompareValue() cannot work out data type" << oendl;
}
}
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
@@ -19,4 +19,11 @@
**********************************************************************/
#include "tvfilterview.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qtoolbutton.h>
#include <qcombobox.h>
@@ -27,11 +34,10 @@
#include <qlabel.h>
-#include <qpe/qpeapplication.h>
TVFilterView::TVFilterView(TableState *t, QWidget* parent,
const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl)
{
- if ( !name )
- setName( "Filter View" );
+ if ( !name )
+ setName( "Filter View" );
QVBoxLayout *vlayout = new QVBoxLayout(this);
@@ -89,6 +95,6 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent,
connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() ));
- connect(display, SIGNAL(selectionChanged(QListViewItem*)), this,
- SLOT(setTerm(QListViewItem*)));
+ connect(display, SIGNAL(selectionChanged(QListViewItem*)), this,
+ SLOT(setTerm(QListViewItem*)));
ts = t;
@@ -103,5 +109,5 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent,
/*!
- Destroys the TVFilterView widget
+ Destroys the TVFilterView widget
*/
TVFilterView::~TVFilterView()
@@ -119,5 +125,5 @@ void TVFilterView::reset()
}
-void TVFilterView::rebuildKeys()
+void TVFilterView::rebuildKeys()
{
int i;
@@ -126,5 +132,5 @@ void TVFilterView::rebuildKeys()
if(!ts->kRep) return;
keyEntry->setTableState(ts);
-
+
/* set up the list of keys that can be compared on */
keyNameCombo->clear();
@@ -133,10 +139,10 @@ void TVFilterView::rebuildKeys()
i = 0;
while(it.current()) {
- if(ts->kRep->validIndex(it.currentKey())) {
- keyNameCombo->insertItem(it.current()->name());
- keyIds.insert(i, it.currentKey());
- ++i;
- }
- ++it;
+ if(ts->kRep->validIndex(it.currentKey())) {
+ keyNameCombo->insertItem(it.current()->name());
+ keyIds.insert(i, it.currentKey());
+ ++i;
+ }
+ ++it;
}
}
@@ -147,5 +153,5 @@ bool TVFilterView::passesFilter(DataElem *d) {
FilterTerm *t;
-
+
for (t = terms.first(); t != 0; t = terms.next() ) {
/* check against filter */
@@ -176,6 +182,5 @@ bool TVFilterView::passesFilter(DataElem *d) {
break;
default:
- qWarning("TVFilterView::passesFilter() "
- "unrecognized filter type");
+ owarn << "TVFilterView::passesFilter() unrecognized filter type" << oendl;
return false;
}
@@ -195,5 +200,5 @@ bool TVFilterView::filterActive() const
/* SLOTS */
-void TVFilterView::newTerm()
+void TVFilterView::newTerm()
{
if (!ts) return;
@@ -213,5 +218,5 @@ void TVFilterView::newTerm()
}
-void TVFilterView::updateTerm()
+void TVFilterView::updateTerm()
{
FilterTerm *term;
@@ -232,5 +237,5 @@ void TVFilterView::updateTerm()
term->ct = keyEntry->getCompareType(),
term->value = keyEntry->getCompareValue();
-
+
keyString = keyNameCombo->currentText();
@@ -261,5 +266,5 @@ void TVFilterView::updateTerm()
/* remove old view */
- if (term->view)
+ if (term->view)
delete(term->view);
term->view = new QListViewItem(display, 0, keyString, cmpString, vString);
@@ -268,5 +273,5 @@ void TVFilterView::updateTerm()
/* deletes current term */
-void TVFilterView::deleteTerm()
+void TVFilterView::deleteTerm()
{
if(!current) return;
@@ -285,5 +290,5 @@ void TVFilterView::deleteTerm()
/* clears all terminations */
-void TVFilterView::clearTerms()
+void TVFilterView::clearTerms()
{
while(current)
@@ -293,5 +298,5 @@ void TVFilterView::clearTerms()
void TVFilterView::setTerm(QListViewItem *target)
{
- /* Iterate through the list to find item with view=target..
+ /* Iterate through the list to find item with view=target..
* set as current, delete */
FilterTerm *term = current;
@@ -302,5 +307,5 @@ void TVFilterView::setTerm(QListViewItem *target)
if (!current) {
- current = term;
+ current = term;
}
}