summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer/browsekeyentry.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tableviewer/browsekeyentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/browsekeyentry.cpp53
1 files changed, 27 insertions, 26 deletions
diff --git a/noncore/apps/tableviewer/browsekeyentry.cpp b/noncore/apps/tableviewer/browsekeyentry.cpp
index 04e7902..bab9af6 100644
--- a/noncore/apps/tableviewer/browsekeyentry.cpp
+++ b/noncore/apps/tableviewer/browsekeyentry.cpp
@@ -13,39 +13,41 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
-**********************************************************************/
+**********************************************************************/
#include "browsekeyentry.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qtoolbutton.h>
#include <qwidgetstack.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qpopupmenu.h>
#include <qhbox.h>
#include <qdatetime.h>
-//#include <iostream.h>
-#include <qheader.h>
-// For qWarning(const char *)
/*!
\class TVBrowseKeyEntry
\brief a Widget used enter keys into the TVBrowseViewWidget
The TVBrowseKeyEntry Widget provides the facility to enter
various key types to be search on in the table. The key can be changed
and the entry field will update to the correct sort of widget appropriately
*/
/*!
- Constructs the widget
+ Constructs the widget
*/
TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
: QWidget(parent, name, f)
{
int stack_elem = 0;
QHBoxLayout *h_layout = new QHBoxLayout(this);
@@ -77,43 +79,43 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
ws = new QWidgetStack(this, 0);
ws->addWidget(textKey, stack_elem++);
ws->addWidget(timeKey, stack_elem++);
ws->addWidget(dateKey, stack_elem++);
ws->raiseWidget(0);
-
+
// TODO connect slots and signals....
- connect(changeKeyButton, SIGNAL(clicked()),
+ connect(changeKeyButton, SIGNAL(clicked()),
this, SLOT(changeKeyMenuSlot()));
- connect(resetButton, SIGNAL(clicked()),
+ connect(resetButton, SIGNAL(clicked()),
this, SLOT(resetKeySlot()));
- connect(textKey, SIGNAL(textChanged(const QString&)),
+ connect(textKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
- connect(dayKey, SIGNAL(textChanged(const QString&)),
+ connect(dayKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
- connect(monthKey, SIGNAL(textChanged(const QString&)),
+ connect(monthKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
- connect(yearKey, SIGNAL(textChanged(const QString&)),
+ connect(yearKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
- connect(secondKey, SIGNAL(textChanged(const QString&)),
+ connect(secondKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
- connect(minuteKey, SIGNAL(textChanged(const QString&)),
+ connect(minuteKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
- connect(hourKey, SIGNAL(textChanged(const QString&)),
+ connect(hourKey, SIGNAL(textChanged(const QString&)),
this, SLOT(searchOnText()));
-
+
h_layout->addWidget(ws);
h_layout->addWidget(resetButton);
h_layout->addWidget(changeKeyButton);
}
/*!
- Destructs the widget
+ Destructs the widget
*/
TVBrowseKeyEntry::~TVBrowseKeyEntry()
{
}
/*!
@@ -133,23 +135,23 @@ void TVBrowseKeyEntry::changeKeySlot(int id_param)
case kt_time:
ws->raiseWidget(1);
break;
case kt_date:
ws->raiseWidget(2);
break;
- default:
- return;
+ default:
+ return;
}
}
/*!
Opens the change key menu
*/
void TVBrowseKeyEntry::changeKeyMenuSlot()
{
- if(ts)
+ if(ts)
keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0)));
}
/*!
Blanks the key entry widget
\TODO the actual implmentation
*/
@@ -162,21 +164,21 @@ void TVBrowseKeyEntry::setTableState(TableState *t) {
ts = t;
/* clear the old */
keyMenu->clear();
for (i = 0; i < t->kRep->getNumFields(); i++) {
- keyMenu->insertItem(ts->kRep->getKeyName(i), this,
+ keyMenu->insertItem(ts->kRep->getKeyName(i), this,
SLOT(changeKeySlot(int)), 0, i);
keyMenu->setItemParameter(i, i);
}
}
/*!
- 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()
{
void *sendkey;
int tmp;
@@ -225,18 +227,17 @@ void TVBrowseKeyEntry::searchOnText()
if(!QDate::isValid(y, m, d))
return;
sendkey = (void *) new QDate(y, m, d);
break;
}
default:
- qWarning("TVBrowseKeyEntry::searchOnText() "
- "cannot work out data type");
+ owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl;
return;
}
emit searchOnKey(ts->current_column, sendkey);
}
/*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, void *v)
This signal indicates that a search on key index currentKeyId should be
done searching for the value v.
-*/
+*/