7 messages in com.mysql.lists.gui-toolsbk commit - MyCC| From | Sent On | Attachments |
|---|---|---|
| jor...@mysql.com | 16 Apr 2002 11:12 | |
| jor...@mysql.com | 17 Apr 2002 10:11 | |
| Adam Hooper | 17 Apr 2002 12:34 | |
| Jorge del Conde | 18 Apr 2002 06:45 | |
| jor...@mysql.com | 18 Apr 2002 06:57 | |
| Adam Hooper | 18 Apr 2002 07:16 | |
| jor...@mysql.com | 18 Apr 2002 21:50 |
| Subject: | bk commit - MyCC![]() |
|---|---|
| From: | jor...@mysql.com (jor...@mysql.com) |
| Date: | 04/18/2002 06:57:24 AM |
| List: | com.mysql.lists.gui-tools |
Below is the list of changes that have just been commited into a local MyCC repository of 'jorge'. When 'jorge' does a push, they will be propogaged to the main repository and within 24 hours after the push into the public repository.
ChangeSet@1.75, 2002-04-18 07:57:44-06:00, jor...@linux.jorge.mysql.com
include/CSqlTable.h 1.11 02/04/18 07:57:27 jor...@linux.jorge.mysql.com +1 -1
src/CFieldEditorWindow.cpp 1.9 02/04/18 07:56:56 jor...@linux.jorge.mysql.com +0 -1
src/CSqlTable.cpp 1.29 02/04/18 07:56:55 jor...@linux.jorge.mysql.com +57 -53
# This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jorge # Host: linux.jorge.mysql.com # Root: /my/mycc
--- 1.10/include/CSqlTable.h Wed Apr 17 11:11:16 2002
+++ 1.11/include/CSqlTable.h Thu Apr 18 07:57:27 2002
@@ -100,7 +100,7 @@
class CDefaultTableItem : public QTableItem
{
public:
- CDefaultTableItem(QTable *table, const QString &txt, bool numericfield =
false);
+ CDefaultTableItem(QTable *table, const QString &txt, bool numericfield =
false, EditType et=WhenCurrent);
int CDefaultTableItem::alignment() const;
void setNumericField(const bool &b) { numericField = b; }
bool isNumericField() { return numericField; }
--- 1.8/src/CFieldEditorWindow.cpp Wed Apr 17 11:11:07 2002 +++ 1.9/src/CFieldEditorWindow.cpp Thu Apr 18 07:56:56 2002 @@ -76,7 +76,6 @@
void CFieldEditorWindow::applyButtonClicked() { - //This function needs to update the data in the DB Table. emit changesApplied(); close(); }
--- 1.28/src/CSqlTable.cpp Wed Apr 17 11:11:02 2002 +++ 1.29/src/CSqlTable.cpp Thu Apr 18 07:56:55 2002 @@ -20,8 +20,8 @@ #include "CSqlTable.h" #include "CTextFieldEditor.h" #include "CImageFieldEditor.h" -#include <qmessagebox.h> #include <qtextcodec.h> +#include <qmessagebox.h>
privateEllipseBox::privateEllipseBox( QWidget* parent, const char* name,
WFlags fl )
: QWidget( parent, name, fl ), TableItem(0)
@@ -53,7 +53,7 @@
}
void privateEllipseBox::DoubleClicked(int button) -{ +{ qDebug("privateEllipseBox::DoubleClicked()"); emit doubleClicked(button, TableItem); } @@ -75,8 +75,8 @@ return LineEdit->text(); }
-CDefaultTableItem::CDefaultTableItem( QTable *table, const QString &txt, bool
numericfield)
-: QTableItem (table, WhenCurrent, txt), numericField(numericfield)
+CDefaultTableItem::CDefaultTableItem( QTable *table, const QString &txt, bool
numericfield, EditType et)
+: QTableItem (table, et, txt), numericField(numericfield)
{
}
@@ -96,11 +96,18 @@
void CEllipseTableItem::setContentFromEditor( QWidget *w ) { - qDebug("CEllipseTableItem::setContentFromEditor()"); + qDebug("CEllipseTableItem::setContentFromEditor()"); if ( w->inherits( "privateEllipseBox" ) ) - setText(((privateEllipseBox*)w)->text()); + setText(((privateEllipseBox*)w)->text()); else - QTableItem::setContentFromEditor( w ); + QTableItem::setContentFromEditor( w ); +} + +void CEllipseTableItem::setText( const QString &str ) +{ + if (eb) + eb->setText(str); + QTableItem::setText(str); }
void CEllipseTableItem::signalConnectButton(const QString & sig, QObject *rec,
const QString & s)
@@ -119,13 +126,6 @@
isConnected2 = true;
}
-void CEllipseTableItem::setText( const QString &str )
-{
- if (eb)
- eb->setText(str);
- QTableItem::setText(str);
-}
-
QWidget *CEllipseTableItem::createEditor() const
{
((CEllipseTableItem*)this )->eb = new privateEllipseBox( table()->viewport(),
"privateEllipseBox");
@@ -136,9 +136,7 @@
if (isConnected)
QObject::connect(eb, signal.latin1(), receiver, slot.latin1());
if (isConnected2)
- QObject::connect(eb, signal2.latin1(), receiver2, slot2.latin1());
-
- //QObject::connect( eb, SIGNAL( toggled( bool ) ), table(), SLOT(
doValueChanged() ) );
+ QObject::connect(eb, signal2.latin1(), receiver2, slot2.latin1());
return eb;
}
@@ -333,7 +331,9 @@ init(); }
-CSqlTable::CSqlTable(QWidget * parent, CMySQLConnection *conn, const QString &
tablename) : QTable(parent)
+CSqlTable::CSqlTable(QWidget * parent, CMySQLConnection *conn, const QString &
tablename)
+: QTable(parent)
+
{
Query = NULL;
setName("CSqlTable");
@@ -845,6 +845,7 @@
}
QTextCodec *codec = QTextCodec::codecForLocale();
QString tmp = codec->toUnicode(text);
+
if (hasAutoFieldEditors)
{
switch (Query->Fields[i].type)
@@ -853,8 +854,8 @@
case FIELD_TYPE_MEDIUM_BLOB:
case FIELD_TYPE_LONG_BLOB:
case FIELD_TYPE_BLOB:
- {
- CEllipseTableItem *x = new CEllipseTableItem(this, tmp);
+ {
+ CEllipseTableItem *x = new CEllipseTableItem(this, tmp);
setItem (j, i, x);
x->setFieldProperties(Query->Fields[i].name, i, j);
x->setBinaryField(IS_BINARY_FIELD(Query->Fields[i].flags));
@@ -865,14 +866,12 @@
SLOT(EllipseItemDoubleClicked(int, QTableItem *)));
break;
}
- default: setItem(j, i, new QTableItem(this, QTableItem::OnTyping,
tmp));
- //setItem(j, i, new CDefaultTableItem(this, text,
(Query->Fields[i].flags & NUM_FLAG)));
+ default: setItem(j, i, new CDefaultTableItem(this, tmp,
(Query->Fields[i].flags & NUM_FLAG), QTableItem::OnTyping));
break;
}
}
- else
- setItem(j, i, new QTableItem(this, QTableItem::OnTyping, text));
- //setItem(j, i, new CDefaultTableItem(this, text,
(Query->Fields[i].flags & NUM_FLAG)));
+ else
+ setItem(j, i, new CDefaultTableItem(this, text,
(Query->Fields[i].flags & NUM_FLAG), QTableItem::OnTyping));
}
j++;
}
@@ -887,9 +886,8 @@
void CSqlTable::OpenTextEditor(QTableItem *x)
{
CTextFieldEditor *TextEditor = new CTextFieldEditor(g_WorkSpace, EditorList,
"CTextFieldEditor", m_pDatabaseConnection, myReadOnly);
- TextEditor->setCaption(tr("Text Editor - Column ") + "'" +
((CEllipseTableItem *)x)->getFieldName() + "' Row " +
QString::number(currentRow() + 1));
- //TextEditor->setText(Query->getFieldValue(((CEllipseTableItem
*)x)->getRowOffset(), ((CEllipseTableItem *)x)->getFieldIndex()));
- TextEditor->setText(x->text());
+ TextEditor->setCaption(tr("Text Editor - Column ") + "'" +
((CEllipseTableItem *)x)->getFieldName() + "' Row " +
QString::number(currentRow() + 1));
+ TextEditor->setText(Query->getFieldValue(((CEllipseTableItem
*)x)->getRowOffset(), ((CEllipseTableItem *)x)->getFieldIndex()));
connect(TextEditor, SIGNAL(textChanged(const QString &)), this,
SLOT(changeValue(const QString &)));
myShowWindow(TextEditor);
}
@@ -947,7 +945,8 @@
#endif
CMySQLQuery *query = new CMySQLQuery(m_pDatabaseConnection); - if (query->exec_static(qry, true)) { + if (query->exec_static(qry, true)) + { setText(row, col, value); updateCell(row, col); } @@ -960,44 +959,49 @@ QString uniqueKey = ""; QString allFields = "";
- unsigned long nFields = Query->numFields(); + unsigned long nFields = Query->numFields();
- for (unsigned int i = 0; i < nFields; i++) { - QString fieldName = Query->Fields[i].name; -// -// QString value = Query->getFieldValue(row, i); -// - QString value = text(row, i); + for (unsigned int i = 0; i < nFields; i++) + { + QString fieldName = Query->Fields[i].name; + QString value = Query->getFieldValue(row, i); QString key = fieldName + "='" + (const char *)value.local8Bit() + "'";
- if (IS_PRI_KEY(Query->Fields[i].flags)) { + if (IS_PRI_KEY(Query->Fields[i].flags)) + { // if exists primary key use one - if (primKey.length()) - primKey += " AND "; - primKey += key; + if (primKey.length()) + primKey += " AND "; + primKey += key; } - else if (!primKey.length() && IS_UNI_KEY(Query->Fields[i].flags)) { - // if exists some unique key use one - if (uniqueKey.length()) + else + if (!primKey.length() && IS_UNI_KEY(Query->Fields[i].flags)) + { + // if exists some unique key use one + if (uniqueKey.length()) uniqueKey += " AND "; uniqueKey += key; - } - else if (!primKey.length() && !uniqueKey.length()) { - // else use all fields - if (allFields.length()) - allFields += " AND "; - allFields += key; - } - } + } + else + if (!primKey.length() && !uniqueKey.length()) + { + // else use all fields + if (allFields.length()) + allFields += " AND "; + allFields += key; + } + }
- if (primKey.length()) { + if (primKey.length()) + { #ifdef DEBUG qDebug("PRIM KEY: *%s*", (const char *)primKey.local8Bit()); #endif return primKey; }
- if (uniqueKey.length()) { + if (uniqueKey.length()) + { #ifdef DEBUG qDebug("UNIQUE KEY: *%s*", (const char *)uniqueKey.local8Bit()); #endif




