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@stripped, 2002-05-23 03:35:00-05:00, jorge@stripped
CTableWindow.ui, CTableWindow.h, CTableWindow.cpp:
new file - CREATE / ALTER Table screen
CShowTableProperties.cpp:
Enabled ALTER Table context options
CTableItem.cpp, CTableSpecific.cpp:
Enabled CREATE & ALTER Table context options
ui/CTableWindow.ui
1.1 02/05/23 03:33:48 jorge@stripped +449 -0
ui/CTableWindow.ui
1.0 02/05/23 03:33:48 jorge@stripped +0 -0
BitKeeper file /my/mycc/ui/CTableWindow.ui
include/CConfigDialog.h
1.5 02/05/23 03:33:40 jorge@stripped +2 -1
include/CMySQLConnection.h
1.13 02/05/23 03:33:40 jorge@stripped +2 -2
include/CMySQLQuery.h
1.13 02/05/23 03:33:39 jorge@stripped +17 -0
include/CSharedMenus.h
1.4 02/05/23 03:33:39 jorge@stripped +3 -3
include/CTableSpecific.h
1.4 02/05/23 03:33:39 jorge@stripped +7 -5
include/CTableWindow.h
1.1 02/05/23 03:33:37 jorge@stripped +90 -0
include/CTableWindow.h
1.0 02/05/23 03:33:37 jorge@stripped +0 -0
BitKeeper file /my/mycc/include/CTableWindow.h
src/CConfigDialog.cpp
1.6 02/05/23 03:33:26 jorge@stripped +6 -0
src/CSharedMenus.cpp
1.9 02/05/23 03:33:25 jorge@stripped +22 -20
src/CMySQLConnection.cpp
1.17 02/05/23 03:33:24 jorge@stripped +13 -16
src/CTableGroupItem.cpp
1.15 02/05/23 03:33:23 jorge@stripped +1 -3
src/CSqlTable.cpp
1.40 02/05/23 03:33:22 jorge@stripped +17 -16
src/CMySQLQuery.cpp
1.22 02/05/23 03:33:19 jorge@stripped +37 -3
src/CGeneralConfig.cpp
1.13 02/05/23 03:33:14 jorge@stripped +1 -1
src/CShowTableProperties.cpp
1.9 02/05/23 03:33:04 jorge@stripped +3 -6
Added ALTER Table
src/CTableItem.cpp
1.9 02/05/23 03:33:02 jorge@stripped +1 -3
Added CREATE & ALTER Table
src/CTableSpecific.cpp
1.13 02/05/23 03:32:42 jorge@stripped +27 -9
Added CREATE & ALTER Table
src/CTableWindow.cpp
1.1 02/05/23 03:32:38 jorge@stripped +231 -0
src/CTableWindow.cpp
1.0 02/05/23 03:32:38 jorge@stripped +0 -0
BitKeeper file /my/mycc/src/CTableWindow.cpp
# 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
--- New file ---
+++ include/CTableWindow.h 02/05/23 03:33:37
/* Copyright (C) 2002 MySQL AB & Jorge del Conde
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
*/
#ifndef CTABLEWINDOW_H
#define CTABLEWINDOW_H
#include <qvariant.h>
#include "CMyWindow.h"
#include "CMySQLConnection.h"
#include "CMySQLQuery.h"
#include "CMessageWindow.h"
#include "Config.h"
#include "CDatabaseTreeItem.h"
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QAction;
class QActionGroup;
class QToolBar;
class QPopupMenu;
class QTabWidget;
class QTable;
class QWidget;
class CTableWindow : public CMyWindow
{
Q_OBJECT
public:
CTableWindow(QWidget* parent, CMySQLConnection *m, CDatabaseTreeItem *item, const QString &tablename);
CTableWindow(QWidget* parent, CMySQLConnection *m, const QString &tablename, QObject *o, const char *slot);
~CTableWindow();
signals:
void doRefresh();
private slots:
void refreshCaller();
private:
QGridLayout* CTableWindowLayout;
QTable* Fields;
QTabWidget* Tab;
QWidget* fieldPropertiesTab;
QWidget* indexesTab;
QWidget* tablePropertiesTab;
QMenuBar *menubar;
QPopupMenu *fileMenu;
QPopupMenu *editMenu;
QToolBar *toolBar;
QAction* fileNewAction;
QAction* fileOpenAction;
QAction* fileSaveAction;
QAction* fileSaveAsAction;
QAction* filePrintAction;
QAction* fileExitAction;
QAction* editUndoAction;
QAction* editRedoAction;
QAction* editCutAction;
QAction* editCopyAction;
QAction* editPasteAction;
QAction* editFindAction;
CMySQLConnection *mysql;
CDatabaseTreeItem *tableItem;
CMessagePanel *messages;
bool isAlterTable;
QString tableName;
void init();
void createForm(CMySQLConnection *m, const QString &tablename);
};
#endif // CTABLEWINDOW_H
--- New file ---
+++ src/CTableWindow.cpp 02/05/23 03:32:38
/* Copyright (C) 2002 MySQL AB & Jorge del Conde
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
*/
#include "CTableWindow.h"
#include "CTableItem.h"
#include "CTableGroupItem.h"
#include <qvariant.h>
#include <qtable.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qaction.h>
#include <qmenubar.h>
#include <qpopupmenu.h>
#include <qtoolbar.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qmessagebox.h>
CTableWindow::CTableWindow(QWidget* parent, CMySQLConnection *m, CDatabaseTreeItem *item, const QString &tablename)
: CMyWindow( parent, "CTableWindow", WDestructiveClose, !g_isMDI, false)
{
tableItem = item;
createForm(m, tablename);
}
CTableWindow::CTableWindow(QWidget* parent, CMySQLConnection *m, const QString &tablename, QObject *o, const char *slot)
: CMyWindow( parent, "CTableWindow", WDestructiveClose, !g_isMDI, false)
{
tableItem = 0;
connect (this, SIGNAL(doRefresh()), o, slot);
createForm(m, tablename);
}
void CTableWindow::refreshCaller()
{
if (tableItem != 0)
{
if (isAlterTable)
tableItem->listView()->setCurrentItem(tableItem);
tableItem->refresh();
}
else
emit doRefresh();
}
void CTableWindow::createForm(CMySQLConnection *m, const QString &tablename)
{
mysql = m;
isAlterTable = !tablename.isNull();
tableName = tablename;
messages = mysql->messagePanel;
(void)statusBar();
/*
QPixmap image0( ( const char** ) image0_data );
QPixmap image1( ( const char** ) image1_data );
QPixmap image2( ( const char** ) image2_data );
QPixmap image3( ( const char** ) image3_data );
QPixmap image4( ( const char** ) image4_data );
QPixmap image5( ( const char** ) image5_data );
QPixmap image6( ( const char** ) image6_data );
QPixmap image7( ( const char** ) image7_data );
QPixmap image8( ( const char** ) image8_data );
QPixmap image9( ( const char** ) image9_data );
*/
setIcon(getPixmapIcon("applicationIcon"));
QString c;
if (isAlterTable)
c = tr("Editing Table") + " '" + tableName + "' ";
else
c = tr("Creating Table") + " ";
c += tr("in database") + " '" + mysql->getDatabaseName() + "' [" + m->getConnectionName() + "]";
setCaption(c);
setCentralWidget( new QWidget( this, "qt_central_widget" ) );
CTableWindowLayout = new QGridLayout( centralWidget(), 1, 1, 4, 2, "CTableWindowLayout");
Fields = new QTable( centralWidget(), "Fields" );
Fields->setNumRows( 3 );
Fields->setNumCols( 3 );
CTableWindowLayout->addWidget( Fields, 0, 0 );
Tab = new QTabWidget( centralWidget(), "Tab" );
Tab->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, Tab->sizePolicy().hasHeightForWidth() ) );
Tab->setMinimumSize( QSize( 0, 200 ) );
fieldPropertiesTab = new QWidget( Tab, "fieldPropertiesTab" );
Tab->insertTab( fieldPropertiesTab, trUtf8( "Field Properties" ) );
indexesTab = new QWidget( Tab, "indexesTab" );
Tab->insertTab( indexesTab, trUtf8( "Indexes" ) );
tablePropertiesTab = new QWidget( Tab, "tablePropertiesTab" );
Tab->insertTab( tablePropertiesTab, trUtf8( "Table Properties" ) );
CTableWindowLayout->addWidget( Tab, 1, 0 );
// actions
fileNewAction = new QAction( this, "fileNewAction" );
// fileNewAction->setIconSet( QIconSet( image0 ) );
fileNewAction->setText( trUtf8( "New" ) );
fileNewAction->setMenuText( trUtf8( "&New" ) );
fileNewAction->setAccel( 4194382 );
fileOpenAction = new QAction( this, "fileOpenAction" );
connect(fileNewAction, SIGNAL(activated()), this, SLOT(refreshCaller()));
//fileOpenAction->setIconSet( QIconSet( image1 ) );
fileOpenAction->setText( trUtf8( "Open" ) );
fileOpenAction->setMenuText( trUtf8( "&Open..." ) );
fileOpenAction->setAccel( 4194383 );
fileSaveAction = new QAction( this, "fileSaveAction" );
//fileSaveAction->setIconSet( QIconSet( image2 ) );
fileSaveAction->setText( trUtf8( "Save" ) );
fileSaveAction->setMenuText( trUtf8( "&Save" ) );
fileSaveAction->setAccel( 4194387 );
fileSaveAsAction = new QAction( this, "fileSaveAsAction" );
fileSaveAsAction->setText( trUtf8( "Save As" ) );
fileSaveAsAction->setMenuText( trUtf8( "Save &As..." ) );
fileSaveAsAction->setAccel( 0 );
filePrintAction = new QAction( this, "filePrintAction" );
//filePrintAction->setIconSet( QIconSet( image3 ) );
filePrintAction->setText( trUtf8( "Print" ) );
filePrintAction->setMenuText( trUtf8( "&Print..." ) );
filePrintAction->setAccel( 4194384 );
fileExitAction = new QAction( this, "fileExitAction" );
fileExitAction->setText( trUtf8( "Exit" ) );
fileExitAction->setMenuText( trUtf8( "E&xit" ) );
fileExitAction->setAccel( 0 );
editUndoAction = new QAction( this, "editUndoAction" );
//editUndoAction->setIconSet( QIconSet( image4 ) );
editUndoAction->setText( trUtf8( "Undo" ) );
editUndoAction->setMenuText( trUtf8( "&Undo" ) );
editUndoAction->setAccel( 4194394 );
editRedoAction = new QAction( this, "editRedoAction" );
//editRedoAction->setIconSet( QIconSet( image5 ) );
editRedoAction->setText( trUtf8( "Redo" ) );
editRedoAction->setMenuText( trUtf8( "&Redo" ) );
editRedoAction->setAccel( 4194393 );
editCutAction = new QAction( this, "editCutAction" );
//editCutAction->setIconSet( QIconSet( image6 ) );
editCutAction->setText( trUtf8( "Cut" ) );
editCutAction->setMenuText( trUtf8( "&Cut" ) );
editCutAction->setAccel( 4194392 );
editCopyAction = new QAction( this, "editCopyAction" );
//editCopyAction->setIconSet( QIconSet( image7 ) );
editCopyAction->setText( trUtf8( "Copy" ) );
editCopyAction->setMenuText( trUtf8( "C&opy" ) );
editCopyAction->setAccel( 4194371 );
editPasteAction = new QAction( this, "editPasteAction" );
//editPasteAction->setIconSet( QIconSet( image8 ) );
editPasteAction->setText( trUtf8( "Paste" ) );
editPasteAction->setMenuText( trUtf8( "&Paste" ) );
editPasteAction->setAccel( 4194390 );
editFindAction = new QAction( this, "editFindAction" );
//editFindAction->setIconSet( QIconSet( image9 ) );
editFindAction->setText( trUtf8( "Find" ) );
editFindAction->setMenuText( trUtf8( "&Find..." ) );
editFindAction->setAccel( 4194374 );
// toolbars
toolBar = new QToolBar( "", this, DockTop );
toolBar->setLabel( trUtf8( "Tools" ) );
fileNewAction->addTo( toolBar );
fileOpenAction->addTo( toolBar );
fileSaveAction->addTo( toolBar );
editUndoAction->addTo( toolBar );
editRedoAction->addTo( toolBar );
editCutAction->addTo( toolBar );
editCopyAction->addTo( toolBar );
editPasteAction->addTo( toolBar );
editFindAction->addTo( toolBar );
// menubar
menubar = new QMenuBar( this, "menubar" );
fileMenu = new QPopupMenu( this );
fileNewAction->addTo( fileMenu );
fileOpenAction->addTo( fileMenu );
fileSaveAction->addTo( fileMenu );
fileSaveAsAction->addTo( fileMenu );
fileMenu->insertSeparator();
filePrintAction->addTo( fileMenu );
fileMenu->insertSeparator();
fileExitAction->addTo( fileMenu );
menubar->insertItem( trUtf8( "&File" ), fileMenu );
editMenu = new QPopupMenu( this );
editUndoAction->addTo( editMenu );
editRedoAction->addTo( editMenu );
editMenu->insertSeparator();
editCutAction->addTo( editMenu );
editCopyAction->addTo( editMenu );
editPasteAction->addTo( editMenu );
editMenu->insertSeparator();
editFindAction->addTo( editMenu );
menubar->insertItem( trUtf8( "&Edit" ), editMenu );
init();
myResize(400, 450);
autoPlace();
}
CTableWindow::~CTableWindow()
{
}
void CTableWindow::init()
{
}
--- New file ---
+++ ui/CTableWindow.ui 02/05/23 03:33:48
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>CTableWindow</class>
<widget class="QMainWindow">
<property name="name">
<cstring>CTableWindow</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>765</width>
<height>778</height>
</rect>
</property>
<property name="caption">
<string>Create Table in database 'database' [connection]</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>4</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<widget class="QTable" row="0" column="0">
<property name="name">
<cstring>Fields</cstring>
</property>
<property name="numRows">
<number>3</number>
</property>
<property name="numCols">
<number>3</number>
</property>
</widget>
<widget class="QTabWidget" row="1" column="0">
<property name="name">
<cstring>Tab</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<widget class="QWidget">
<property name="name">
<cstring>fieldPropertiesTab</cstring>
</property>
<attribute name="title">
<string>Field Properties</string>
</attribute>
</widget>
<widget class="QWidget">
<property name="name">
<cstring>indexesTab</cstring>
</property>
<attribute name="title">
<string>Indexes</string>
</attribute>
</widget>
<widget class="QWidget">
<property name="name">
<cstring>tablePropertiesTab</cstring>
</property>
<attribute name="title">
<string>Table Properties</string>
</attribute>
</widget>
</widget>
</grid>
</widget>
<menubar>
<property name="name">
<cstring>menubar</cstring>
</property>
<item text="&File" name="fileMenu">
<action name="fileNewAction"/>
<action name="fileOpenAction"/>
<action name="fileSaveAction"/>
<action name="fileSaveAsAction"/>
<separator/>
<action name="filePrintAction"/>
<separator/>
<action name="fileExitAction"/>
</item>
<item text="&Edit" name="editMenu">
<action name="editUndoAction"/>
<action name="editRedoAction"/>
<separator/>
<action name="editCutAction"/>
<action name="editCopyAction"/>
<action name="editPasteAction"/>
<separator/>
<action name="editFindAction"/>
</item>
</menubar>
<toolbars>
<toolbar dock="2">
<property name="name">
<cstring>toolBar</cstring>
</property>
<property name="label">
<string>Tools</string>
</property>
<action name="fileNewAction"/>
<action name="fileOpenAction"/>
<action name="fileSaveAction"/>
<action name="editUndoAction"/>
<action name="editRedoAction"/>
<action name="editCutAction"/>
<action name="editCopyAction"/>
<action name="editPasteAction"/>
<action name="editFindAction"/>
</toolbar>
</toolbars>
<actions>
<action>
<property name="name">
<cstring>fileNewAction</cstring>
</property>
<property name="iconSet">
<iconset>image0</iconset>
</property>
<property name="text">
<string>New</string>
</property>
<property name="menuText">
<string>&New</string>
</property>
<property name="accel">
<number>4194382</number>
</property>
</action>
<action>
<property name="name">
<cstring>fileOpenAction</cstring>
</property>
<property name="iconSet">
<iconset>image1</iconset>
</property>
<property name="text">
<string>Open</string>
</property>
<property name="menuText">
<string>&Open...</string>
</property>
<property name="accel">
<number>4194383</number>
</property>
</action>
<action>
<property name="name">
<cstring>fileSaveAction</cstring>
</property>
<property name="iconSet">
<iconset>image2</iconset>
</property>
<property name="text">
<string>Save</string>
</property>
<property name="menuText">
<string>&Save</string>
</property>
<property name="accel">
<number>4194387</number>
</property>
</action>
<action>
<property name="name">
<cstring>fileSaveAsAction</cstring>
</property>
<property name="text">
<string>Save As</string>
</property>
<property name="menuText">
<string>Save &As...</string>
</property>
<property name="accel">
<number>0</number>
</property>
</action>
<action>
<property name="name">
<cstring>filePrintAction</cstring>
</property>
<property name="iconSet">
<iconset>image3</iconset>
</property>
<property name="text">
<string>Print</string>
</property>
<property name="menuText">
<string>&Print...</string>
</property>
<property name="accel">
<number>4194384</number>
</property>
</action>
<action>
<property name="name">
<cstring>fileExitAction</cstring>
</property>
<property name="text">
<string>Exit</string>
</property>
<property name="menuText">
<string>E&xit</string>
</property>
<property name="accel">
<number>0</number>
</property>
</action>
<action>
<property name="name">
<cstring>editUndoAction</cstring>
</property>
<property name="iconSet">
<iconset>image4</iconset>
</property>
<property name="text">
<string>Undo</string>
</property>
<property name="menuText">
<string>&Undo</string>
</property>
<property name="accel">
<number>4194394</number>
</property>
</action>
<action>
<property name="name">
<cstring>editRedoAction</cstring>
</property>
<property name="iconSet">
<iconset>image5</iconset>
</property>
<property name="text">
<string>Redo</string>
</property>
<property name="menuText">
<string>&Redo</string>
</property>
<property name="accel">
<number>4194393</number>
</property>
</action>
<action>
<property name="name">
<cstring>editCutAction</cstring>
</property>
<property name="iconSet">
<iconset>image6</iconset>
</property>
<property name="text">
<string>Cut</string>
</property>
<property name="menuText">
<string>&Cut</string>
</property>
<property name="accel">
<number>4194392</number>
</property>
</action>
<action>
<property name="name">
<cstring>editCopyAction</cstring>
</property>
<property name="iconSet">
<iconset>image7</iconset>
</property>
<property name="text">
<string>Copy</string>
</property>
<property name="menuText">
<string>C&opy</string>
</property>
<property name="accel">
<number>4194371</number>
</property>
</action>
<action>
<property name="name">
<cstring>editPasteAction</cstring>
</property>
<property name="iconSet">
<iconset>image8</iconset>
</property>
<property name="text">
<string>Paste</string>
</property>
<property name="menuText">
<string>&Paste</string>
</property>
<property name="accel">
<number>4194390</number>
</property>
</action>
<action>
<property name="name">
<cstring>editFindAction</cstring>
</property>
<property name="iconSet">
<iconset>image9</iconset>
</property>
<property name="text">
<string>Find</string>
</property>
<property name="menuText">
<string>&Find...</string>
</property>
<property name="accel">
<number>4194374</number>
</property>
</action>
</actions>
<images>
<image name="image0">
<data format="XPM.GZ" length="721">789cedd2b10ac2301405d03d5ff148b62056035241fc04c5511087f425a2432b681d44fc777ba329d6b47fe07d19dee50cc9904cd376b3229d896b6deb13131fed85b4bb95e57db75f3e8434869a93d3548e841c13d3fa5c79ecaad9d52404b540351e83caa833c6a03ad4798e41f5a86c30a816f510126ee94d14d52611fb8e2ad49070a4445ca4447ca4446ca444da07fecac7ffd2956ebe64f81ff4c873215e0583a9b0</data>
</image>
<image name="image1">
<data format="XPM.GZ" length="691">789cad914d0ac2301085f739c5d0d915b11a140ae211149782b898448b2e5a41eb42c4bb9b9fa6a67644045f0299978f37134896c27ab5803413979aeaa3067da033a4bb6b59de36dbf95d245282d953182703910c41c3f254ed6d8da6c69193b5dada7c924b6fc9dac2c85b156c51b83eacfe41d0c89defc4dfa2dd7c37fc44b025a179043c4152a4b055f4365414ad0e8901fd94c1ae5e19441da9211c68e7f44098d3074d86019e70a0210c089958df7ffb31134fa13797a8</data>
</image>
<image name="image2">
<data format="XPM.GZ" length="691">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022530543251d2e253d856405bffcbc54105b19c856360003103711c4b530b13082709340dc644310047193c1dcc424d314883958015846190b80ca24262a2721012087349964a030ba69c9c9303d403e9132087b68279388ecff4414193440948c32aa71d86470bb80863258a21b9a0eb0a7905a6b2e006d59a436</data>
</image>
<image name="image3">
<data format="XPM.GZ" length="2509">789c7d944973db461085effa152cf54d956a932089a55239c896572d96bcc4b253390033186ea2488aa416a7f2dfd3db0cbd44e6d340f8f8def43406209e1c742ecf4f3b074ff6d69b7a33711d37ae6f3a077e3b9f3ffcf5f71fffeced675987fecab293edffb6b77fb1e9b8ced9e2ba65c08c00baf2117e2f5c86d02d99e196b9d7ed963df53f2ab3c47789258fa7c26564688d4bf30f23673de113e6ac1719ae9459e27f4d5c893f17ae126f8d2be3ebc87d9dff4e3904f317ccfd5ef23f28b3c45f26963c7e510ec1fc9570157dd81857967f883c90cd8635f3208b8c0b6596f863e17a500fd597fe8744c35afc1be33aef8bff5ad9b5e637cc7993f7f346fca571637c1fb9d0f99f9543b07ab2df453ff9723d0551a1f3d791cb8170573904f3a5bf725034e66f133be96fa44c1246799e4a573495e461a29cfcbbc8e64f8d9df96564f5519e876a1019668975fda05c593d5c25d67a6f945d6ef3bdb08b3ed491eba1e467c6561fcf229bff4ad9b5c6c7ccf530fa8089bdf8136596703fb1f800c23ee5ff548e3e7a636f3c8ddc68bd8ab91926066596b05c5fe359c285b2cf8de5f7ed7296f050b825d6f74763dc1a0f227bcdbf60f679e29789353f5666093f4facfe857208e63f156e93df8bdc16c223e358ff28b!
2f939735b240eca2ce1678983f0a57208e6bf150ec96f8d83f127e650b084cf85e5a32fdf9d10b0c6c6e44835c9631dfd9ff235b618925ad1e89779278af5750df7681ea40316d8111eef876a79ad977ae773d8257ec8efead629fdeb3ca4ba9ae6e11fcdbbef6aa72b7934ef695702eddf4e631a13d2f4c73cd599e115f533a639bbc173e6788d0b5cf23a314fe915dee01a37df698bb77887f7f8805ff190e64c342fb59fe2333ca2e373d30b7c89aff035bec1634a9e904ef1417faf78866ff1fc275de03b7c4fa3a1553e50fd8f78a2ef0bfcf43fe973bcc4cff805bb74d6a3de0e31b37c9f561fe090c6583a19612e9d1dd179417db1575237191eeafb172b9cd22a7d409a7bcc8f0c4e68f01900ef44090db8547f4ee9a966456732445083078f779a8756dfdf52f19b1cd59c699254e31c46d0703f30b6fa5239a5d27faabc22b78409de838316bdd51fd1377730a531a12bd363c949aa3d936f1a6821e8fda566aef8fe011d612eba860569495a9196721ebe7d7ed0c30dac491b58d2bd21c116b634bf25ddd2fd9dd9f3f6efef7bff0111915e41</data>
</image>
<image name="image4">
<data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c8563600020b13103711c4b530b1308270f5b082019251068344848c32b23808206494a1e23015890819653db8b81e44255c0659025d460fa70c6e3d78ec814b21b90d052422fb070540f50ebaf84196a9b5e6020011bc73cc</data>
</image>
<image name="image5">
<data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54103b11c8563600020b13105719c4b530b1308270f5b0027acb28278201a64c221c4084136132ca7011885c225c06c91890542256193d98a198327a386570ea49449581bb4d2f114d0624a08c230c50fd4f5cb80da04cad351700f7fd8672</data>
</image>
<image name="image6">
<data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c856360003103711c6b53002abc40a90649491482ac92863955146d6822ca387474619c9301419a03842825819245bd064129513b1cb242602512216994430d44bc4904984c8c1a5e032897a3019a8144c26518f800c92715864d0ec81ab4dc4701b924fb0850e8a4cad351700fbd07ccb</data>
</image>
<image name="image7">
<data format="XPM.GZ" length="706">789c9d92cb0ac2301045f7f98aa1d915b1da8214c44f505c0ae26226b1e8a20a5a1722febb9924a5af58c19b40e77238a1842431ecb66b881371afb03a2b5027bc41ac1f65f9dc1f562f11a52998bd80793411d114146cae9723cfd2cc7266c395ea9aa75c15d74c65aad05c35d79c727215b91636f6d860c689f40910b4e92147d840b3be39d8416d877c860eb9af478d23919c4b8a7a0ed68eb628e4a04521c7fd46c07138e47448dbf1f32fc767e8d43735741af287d3ced83b782fc5075b18a5a5</data>
</image>
<image name="image8">
<data format="XPM.GZ" length="736">789c7d92d10a82301486eff714c3dd49649984103d42d165105dcce3465d58507611d1bbb773d674aed93f85fd7efb183ab394ef771b9e66ecdecaf60c1c4ef2c6d3fad134cfc371fd62499e7373957c9e4c5832e5c0b7d78bc2b9307331a36055ae960556c05a16656e69e5aaa5355658c202965825566d62176b57b5a64da3f188c084841e0a29a5e831910ef8885e4854501922e8a6b923586a176a8e40051ec1e63b7d0267387c6738424775091d653f98565a858e26c110447107d1886350d4a1c41c3dea7864e87c37f3ce47fc3aee7cd5207ffe90f78a7d0007c6c175</data>
</image>
<image name="image9">
<data format="XPM.GZ" length="2798">789cb5d5594f1b491007f0773e8545bda1d53ff81a7bb4da07830103b603b92059edc34cf78c0ff0812f3051befb5677554f56c24428d2aa78e0a7aeaeea6be0dd41e9f6aa573a78b7b75c25ab91299961b2281dd8f564b2fdfb9fbfbeefed572a25fe291f46a5cafe1f7bfbd7ab9229f567d3cc81fa0caa945d785f78c72ebc2f9dabb10bef9e73ade2c21913e77ae2c28f2fc48d6a947ab7c4b169d6bc8f9ca3aa0b3fbfaf4e35ff4c5cccdf8813db34de1def34e4c3881b3cc38fb7d5a918f78525ff46dcaca9576a23a627715cd3f53e8a131b7b63edecba69fd8d3af41b1496fa6d7153f78f86b8a86f0bcbfe9ec5493d16cfc5695dfad34c6d651ca9f7cffdbd173743fd441cd64f0f85a5fe489c6a3fd4d5613c0d4eeade43b189747c1b2ce3683abbeebadf5a702ae343716c743d53313f1febc7bfa843bf1371581f9d06ebf8581df257e2b01eba57675a5fea19177e7c109cfa712271aceba58938b13a6ec4a13fba62ee27f53fa9b51fe5c1ba7f7f1f71cd85f7545cdcf73ad8f8ef137762de9fd4ef898b7e51b0d63f52877e65b10de3c785657eacced4fe7b77b763236fab36fa3e1ec5a9d5f341b0e4d3526c42bd4ab0eee7505cf4fb28ce1aea6fc146fa7f76e6d3e115fafa5d7112cebf254eeb328e6a7!
0967b9f8b437fba13db4ceb2fc5453f7f5ffcfac2795f046bbd0fe2a2df486c42bd2bb18dd46375e89f89b99fccf7ef2dadbbf0eea8add6bf16db4cbd1067b9de8fafc7b7a1ef13cf6213e50defadd846b9acff569c3574fe833ad7fa5fc57943cfdb9f9f894cd8cf93982748fdb9386f64dee4df97c978ff52ef4c9d69ff9938cff53cfdf7ec5627f5ae576f8fdfcf0721410ac391c222fb753e720c30c408638e3bdcf31c7a3d9fb3279862c631c70316586285f5ae1e727fd8e091f3e678c216cf68e108c768e3e4957ccb2b39e5fc337470ce71814b74d143ffe59ae4ff01ae7825d7f8c0753fe213d7ff8c2ffcfb0deccefc016ef115df380e51460555d4504784069aafe48f798f87885126a04a4409a564c8be92bfc115655cb94c395a34409d8634a231afe7c58ee5ef35d7bae3dc2eddd384a634a339c7032d90efcce7bba225ad38525aa3461b7ae478da75037a5f2758d196525ec93359aedde23882a563ae95edc8cf90529b4ee894c6bcf2844f66e2ce1239cf9afc7755c5fbc9b8479fdabcc71b3aa38ee4d039d7b9a04b1ecb5ebe677ea1964712ead2f9cf8aac1ecfd10a6f79ffdc7b4d7dee92bcfd7be1bd5ff29ccedbbf2f90dbfbfffefdfef873ef5fce01d04a</data>
</image>
</images>
<connections>
<connection>
<sender>fileNewAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>fileNew()</slot>
</connection>
<connection>
<sender>fileOpenAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>fileOpen()</slot>
</connection>
<connection>
<sender>fileSaveAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>fileSave()</slot>
</connection>
<connection>
<sender>fileSaveAsAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>fileSaveAs()</slot>
</connection>
<connection>
<sender>filePrintAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>filePrint()</slot>
</connection>
<connection>
<sender>fileExitAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>fileExit()</slot>
</connection>
<connection>
<sender>editUndoAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>editUndo()</slot>
</connection>
<connection>
<sender>editRedoAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>editRedo()</slot>
</connection>
<connection>
<sender>editCutAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>editCut()</slot>
</connection>
<connection>
<sender>editCopyAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>editCopy()</slot>
</connection>
<connection>
<sender>editPasteAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>editPaste()</slot>
</connection>
<connection>
<sender>editFindAction</sender>
<signal>activated()</signal>
<receiver>CTableWindow</receiver>
<slot>editFind()</slot>
</connection>
</connections>
<slots>
<slot>fileNew()</slot>
<slot>fileOpen()</slot>
<slot>fileSave()</slot>
<slot>fileSaveAs()</slot>
<slot>filePrint()</slot>
<slot>fileExit()</slot>
<slot>editUndo()</slot>
<slot>editRedo()</slot>
<slot>editCut()</slot>
<slot>editCopy()</slot>
<slot>editPaste()</slot>
<slot>editFind()</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
</UI>
--- 1.4/include/CConfigDialog.h Thu Jan 24 20:03:43 2002
+++ 1.5/include/CConfigDialog.h Thu May 23 03:33:40 2002
@@ -60,7 +60,8 @@
CConfigDialog(QWidget* parent, const char* name);
~CConfigDialog();
void insertTab (QWidget * child, int index = -1);
- void insertTab (QWidget * child, const QIconSet & iconset, int index = -1);
+ void insertTab (QWidget * child, const QIconSet & iconset, int index = -1);
+ void setCurrentPage(int t = -1);
protected slots:
virtual void okButtonClicked() {};
--- 1.12/include/CMySQLConnection.h Tue May 14 01:00:51 2002
+++ 1.13/include/CMySQLConnection.h Thu May 23 03:33:40 2002
@@ -65,8 +65,8 @@
void disconnect();
ServerVersion getMySQLServerVersion() { return m_ServerVersion; }
- QString Quote(const QString &f);
- QString escape(const char *s) const;
+ QString Quote(const QString &f);
+ QString escape(const QString &s) const;
unsigned long real_escape(const char *from, char *to, uint from_length);
bool hasCompletion() { return m_Completion; }
--- 1.12/include/CMySQLQuery.h Sat May 11 23:27:05 2002
+++ 1.13/include/CMySQLQuery.h Thu May 23 03:33:39 2002
@@ -19,6 +19,8 @@
#ifndef CMYSQLQUERY_H
#define CMYSQLQUERY_H
+#include <qthread.h>
+#include <qmutex.h>
#include <qvariant.h>
#include "CMySQLConnection.h"
@@ -59,6 +61,21 @@
bool result_in_use;
private:
+ QMutex mutex;
+ class QueryThread : public QThread
+ {
+ public:
+ QueryThread (MYSQL *m, const char *q);
+ QueryThread (MYSQL *m, const char *q, unsigned long l);
+ void run();
+ bool getResult() { return res; }
+ private:
+ MYSQL *mysql;
+ char *qry;
+ unsigned long len;
+ bool res;
+ bool realQuery;
+ };
CMySQLConnection *m_pMySQLConnection;
QString m_Query;
MYSQL_RES *res;
--- 1.3/include/CSharedMenus.h Fri Feb 22 00:48:03 2002
+++ 1.4/include/CSharedMenus.h Thu May 23 03:33:39 2002
@@ -91,15 +91,15 @@
void themesMenuAboutToShow();
void FontsAction();
void PrinterFontAction();
+ void QueryEditorFontAction();
void styleSelected(int id);
+ void openConfigScreen(int tab=-1);
protected:
QAction* m_pOptionsMDIAction;
QPopupMenu* m_pThemesMenu;
- QAction* m_pOptionsFontsAction;
- QAction* m_pOptionsPrinterFontAction;
+ QPopupMenu* m_pFontsMenu;
QAction* m_pOptionsGeneralAction;
-
};
#endif
--- 1.3/include/CTableSpecific.h Thu Jan 3 15:59:19 2002
+++ 1.4/include/CTableSpecific.h Thu May 23 03:33:39 2002
@@ -27,6 +27,7 @@
#include "CMySQLConnection.h"
#include "CMySQLQuery.h"
#include "CQueryWindow.h"
+#include "CDatabaseTreeItem.h"
class CTableSpecific
{
@@ -35,16 +36,17 @@
static QPopupMenu *openTableMenu();
static void processMenu(CMySQLConnection *m, int res, const QString & tableName, int serverid = -1);
static bool inRange(int res);
-
- static bool newTable(CMySQLConnection *m);
+ static void openTableWindow(CMySQLConnection *m, CDatabaseTreeItem *item, const QString &tableName);
+ static void newTable(CMySQLConnection *m, CDatabaseTreeItem *item);
+ static void editTable(CMySQLConnection *m, CDatabaseTreeItem *item, const QString &tableName);
+ static void editTable(CMySQLConnection *m, const QString &tableName, QObject *o, const char *slot);
static bool importTable(CMySQLConnection *m);
static bool exportTable(CMySQLConnection *m, const QString & tableName);
static void tableProperties(CMySQLConnection *m, const QString & tableName);
- static bool deleteTable(CMySQLConnection *m, const QString & tableName);
- static bool editTable(CMySQLConnection *m, const QString & tableName);
+ static bool deleteTable(CMySQLConnection *m, const QString & tableName);
static bool emptyTable(CMySQLConnection *m, const QString & tableName);
static bool renameTable(CMySQLConnection *m, const QString & from, const QString & to);
- static void QueryWindow(CMySQLConnection *m, const QString & tableName, int q, int serverid = -1);
+ static void QueryWindow(CMySQLConnection *m, const QString & tableName, int q, int serverid = -1);
};
#endif
--- 1.5/src/CConfigDialog.cpp Wed Feb 27 19:00:56 2002
+++ 1.6/src/CConfigDialog.cpp Thu May 23 03:33:26 2002
@@ -70,6 +70,12 @@
init();
}
+void CConfigDialog::setCurrentPage(int t)
+{
+ if (t != -1)
+ Tab->setCurrentPage(t);
+}
+
void CConfigDialog::insertTab (QWidget * child, int index)
{
Q_CHECK_PTR(child);
--- 1.12/src/CGeneralConfig.cpp Thu May 2 18:58:41 2002
+++ 1.13/src/CGeneralConfig.cpp Thu May 23 03:33:14 2002
@@ -181,7 +181,7 @@
Sections = new QListBox(this, "Sections");
Sections->setSelectionMode(QListBox::Extended);
- QWhatsThis::add(Sections, tr("Available Sections for the SQL Editor"));
+ QWhatsThis::add(Sections, tr("Available Sections for the SQL Editor.\n If you want to modify multiple entries at once, select all the sections you want to modify by using the CRTL key and either the mouse or the up, down and space-bar keys."));
p_SyntaxHighlightLayout->addWidget(Sections);
Layout12 = new QGridLayout(0, 1, 1, 0, 6, "Layout12");
--- 1.16/src/CMySQLConnection.cpp Tue May 14 01:00:39 2002
+++ 1.17/src/CMySQLConnection.cpp Thu May 23 03:33:24 2002
@@ -20,6 +20,7 @@
#include <qinputdialog.h>
#include <qmessagebox.h>
#include <qregexp.h>
+#include <qtextcodec.h>
#include "CMySQLQuery.h"
CMySQLConnection::CMySQLConnection(const QString & connectionName, CMessagePanel * msgpanel, const QString &path)
@@ -71,19 +72,19 @@
return mysql_real_escape_string(mysql, to, from, from_length);
}
-QString CMySQLConnection::escape(const char *s) const
+QString CMySQLConnection::escape(const QString &s) const
{
- char *tmp;
- uint len = strlen(s);
- if ((tmp=(char*)malloc(len*2+1)))
+ if (char *tmp = new char[s.length()*2+1])
{
- mysql_real_escape_string(mysql, tmp, s, len);
- QString ret(tmp);
- free(tmp);
+ mysql_real_escape_string(mysql, tmp, (const char *)s.local8Bit(), s.length());
+ qDebug("FROM(*%s*) TO(*%s*)\n", (const char *)s.local8Bit(), tmp);
+ QTextCodec *codec = QTextCodec::codecForLocale();
+ QString ret(codec->toUnicode(tmp));
+ delete tmp;
return ret;
}
else
- return QString::null;
+ return s;
}
QString CMySQLConnection::Quote(const QString &f)
@@ -404,15 +405,11 @@
m_isConnected = false;
}
else
- {
- qDebug("CMySQLConnection::connect() 8");
+ {
m_isConnected = true;
- initServerVersion();
- qDebug("CMySQLConnection::connect() 9");
- emit statuschanged();
- qDebug("CMySQLConnection::connect() 10");
- emit connected();
- qDebug("CMySQLConnection::connect() 11");
+ initServerVersion();
+ emit statuschanged();
+ emit connected();
}
return m_isConnected;
}
--- 1.21/src/CMySQLQuery.cpp Sat May 11 23:26:35 2002
+++ 1.22/src/CMySQLQuery.cpp Thu May 23 03:33:19 2002
@@ -23,6 +23,28 @@
#define PENDING_SLICE 20
+CMySQLQuery::QueryThread::QueryThread (MYSQL *m, const char *q)
+: QThread(), mysql(m), qry((char *) q)
+{
+ res = false;
+ realQuery = false;
+}
+
+CMySQLQuery::QueryThread::QueryThread(MYSQL *m, const char *q, unsigned long l)
+: QThread(), mysql(m), qry((char *) q), len(l)
+{
+ res = false;
+ realQuery = true;
+}
+
+void CMySQLQuery::QueryThread::run()
+{
+ if (realQuery)
+ res = (mysql_real_query(mysql, qry, len) == 0);
+ else
+ res = (mysql_query(mysql, qry) == 0);
+}
+
CMySQLQuery::CMySQLQuery(CMySQLConnection *conn):
field_mask(0), num_fields(0), m_pMySQLConnection(conn), res(0), m_cancel(true)
{
@@ -288,7 +310,11 @@
return false;
}
- if((mysql_query(m_pMySQLConnection->mysql, qry.latin1())) != 0)
+ QueryThread queryThread(m_pMySQLConnection->mysql, qry);
+ queryThread.start();
+ queryThread.wait();
+ if (!queryThread.getResult())
+ //if((mysql_query(m_pMySQLConnection->mysql, qry)) != 0)
{
if (showError)
m_pMySQLConnection->PrintError(CRITICAL, m_pMySQLConnection->getError());
@@ -320,7 +346,11 @@
return false;
}
- if((mysql_real_query(m_pMySQLConnection->mysql, qry, len)) != 0)
+ QueryThread queryThread(m_pMySQLConnection->mysql, qry, len);
+ queryThread.start();
+ queryThread.wait();
+ if (!queryThread.getResult())
+ //if((mysql_real_query(m_pMySQLConnection->mysql, qry, len)) != 0)
{
if (showError)
m_pMySQLConnection->PrintError(CRITICAL, m_pMySQLConnection->getError());
@@ -352,7 +382,11 @@
m_Query = qry.stripWhiteSpace();
QTime tm;
tm.start();
- if((mysql_query(m_pMySQLConnection->mysql, m_Query.latin1())) != 0)
+ QueryThread queryThread(m_pMySQLConnection->mysql, m_Query);
+ queryThread.start();
+ queryThread.wait();
+ //if((mysql_query(m_pMySQLConnection->mysql, m_Query)) != 0)
+ if (!queryThread.getResult())
{
if (showError)
m_pMySQLConnection->PrintError(CRITICAL, m_pMySQLConnection->getError());
--- 1.8/src/CSharedMenus.cpp Fri Feb 22 01:04:20 2002
+++ 1.9/src/CSharedMenus.cpp Thu May 23 03:33:25 2002
@@ -108,18 +108,6 @@
m_pOptionsMDIAction->setAccel(0);
m_pOptionsMDIAction->setOn(g_isMDI);
- m_pOptionsFontsAction = new QAction(parent, "OptionsFontsAction");
- Q_CHECK_PTR(m_pOptionsFontsAction);
- m_pOptionsFontsAction->setMenuText(tr("&Font", ""));
- m_pOptionsFontsAction->setIconSet(QIconSet(getPixmapIcon("fontsIcon")));
- m_pOptionsFontsAction->setAccel(0);
-
- m_pOptionsPrinterFontAction = new QAction(parent, "OptionsPrinterFontAction");
- Q_CHECK_PTR(m_pOptionsPrinterFontAction);
- m_pOptionsPrinterFontAction->setMenuText(tr("&Printer Font", ""));
- m_pOptionsPrinterFontAction->setIconSet(QIconSet(getPixmapIcon("printerFontIcon")));
- m_pOptionsPrinterFontAction->setAccel(0);
-
m_pOptionsGeneralAction = new QAction(parent, "OptionsGeneralAction");
Q_CHECK_PTR(m_pOptionsGeneralAction);
m_pOptionsGeneralAction->setMenuText(tr("&General", ""));
@@ -132,21 +120,24 @@
m_pThemesMenu = new QPopupMenu(this);
Q_CHECK_PTR(m_pThemesMenu);
m_pThemesMenu->setCheckable(true);
- insertItem(getPixmapIcon("stylesIcon"), tr("&Themes"), m_pThemesMenu);
+ insertItem(getPixmapIcon("stylesIcon"), tr("&Themes"), m_pThemesMenu);
connect(m_pThemesMenu, SIGNAL(aboutToShow()), this, SLOT(themesMenuAboutToShow()));
#endif
- m_pOptionsFontsAction->addTo( this );
- m_pOptionsPrinterFontAction->addTo( this );
+ m_pFontsMenu = new QPopupMenu(this);
+ Q_CHECK_PTR(m_pFontsMenu);
+ m_pFontsMenu->insertItem(getPixmapIcon("fontsIcon"), tr("&Application Font"), this, SLOT(FontsAction()));
+ m_pFontsMenu->insertItem(getPixmapIcon("printerFontIcon"), tr("&Printer Font"), this, SLOT(PrinterFontAction()));
+ m_pFontsMenu->insertSeparator();
+ m_pFontsMenu->insertItem(tr("&Query Editor Font"), this, SLOT(QueryEditorFontAction()));
+ insertItem(getPixmapIcon("fontsIcon"), tr("&Fonts"), m_pFontsMenu);
insertSeparator();
m_pOptionsGeneralAction->addTo( this );
menuBar->insertItem(tr("&Options"), this);
- connect(m_pOptionsMDIAction, SIGNAL(activated()), this, SLOT(MDIAction()));
- connect(m_pOptionsFontsAction, SIGNAL(activated()), this, SLOT(FontsAction()));
- connect(m_pOptionsPrinterFontAction, SIGNAL(activated()), this, SLOT(PrinterFontAction()));
+ connect(m_pOptionsMDIAction, SIGNAL(activated()), this, SLOT(MDIAction()));
connect(m_pOptionsGeneralAction, SIGNAL(activated()), this, SLOT(GeneralAction()));
}
@@ -228,10 +219,21 @@
}
}
-void COptionsMenu::GeneralAction()
+void COptionsMenu::openConfigScreen(int tab)
{
CGeneralConfig *config = new CGeneralConfig((QWidget*)g_WorkSpace);
- Q_CHECK_PTR(config);
+ Q_CHECK_PTR(config);
+ config->setCurrentPage(tab);
myShowWindow(config);
+}
+
+void COptionsMenu::QueryEditorFontAction()
+{
+ openConfigScreen(3);
+}
+
+void COptionsMenu::GeneralAction()
+{
+ openConfigScreen();
}
--- 1.8/src/CShowTableProperties.cpp Wed Feb 27 19:00:51 2002
+++ 1.9/src/CShowTableProperties.cpp Thu May 23 03:33:04 2002
@@ -100,7 +100,7 @@
else
switch (res)
{
- case MENU_EDIT: CTableSpecific::editTable(m_pDatabaseConnection, m_TableName);
+ case MENU_EDIT: CTableSpecific::editTable(m_pDatabaseConnection, m_TableName, this, SLOT(exec()));
break;
case MENU_REFRESH: exec();
break;
@@ -117,10 +117,7 @@
QPopupMenu *p_toolsMenu = CTableTools::tableToolsMenu();
p_itemMenu->insertItem(getPixmapIcon("toolsIcon"), "Tools", p_toolsMenu, MENU_TOOLS);
p_itemMenu->insertSeparator();
- p_itemMenu->insertItem(getPixmapIcon("refreshTablesIcon"), "Refresh", MENU_REFRESH);
-
- //Disable features that aren't currently working
- p_itemMenu->setItemEnabled(MENU_EDIT, false); //Disable 'Edit Table'
+ p_itemMenu->insertItem(getPixmapIcon("refreshTablesIcon"), "Refresh", MENU_REFRESH);
bool notnew = ((getDatabaseConnection()->getMySQLServerVersion().major <= 3) && (getDatabaseConnection()->getMySQLServerVersion().minor <= 22));
if (notnew) //Disable unsupported features for mysql <= 3.22
@@ -135,6 +132,6 @@
void CShowTableProperties::DoubleClicked (int row, int, int button, const QPoint &)
{
if ((row > -1) && (button == 1))
- CTableSpecific::editTable(m_pDatabaseConnection, m_TableName);
+ processMenu(MENU_EDIT, 0, 0);
}
--- 1.39/src/CSqlTable.cpp Tue May 14 18:09:39 2002
+++ 1.40/src/CSqlTable.cpp Thu May 23 03:33:22 2002
@@ -25,6 +25,8 @@
#include <qmessagebox.h>
#include <mysql.h>
+static QTextCodec *codec = QTextCodec::codecForLocale();
+
privateEllipseBox::privateEllipseBox( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl ), TableItem(0)
{
@@ -878,7 +880,6 @@
{
for (unsigned int i = 0; i < nFields; i++)
{
- QTextCodec *codec = QTextCodec::codecForLocale();
QString tmp = prepareCellText(codec->toUnicode(Query->row[i]));
if (hasAutoFieldEditors)
@@ -903,8 +904,8 @@
}
default:
{
- CDefaultTableItem *ti = new CDefaultTableItem(this, j, tmp, (Query->Fields[i].flags & NUM_FLAG), CDefaultTableItem::OnTyping);
- ti->setRealValue(Query->row[i]);
+ CDefaultTableItem *ti = new CDefaultTableItem(this, j, tmp, (Query->Fields[i].flags & NUM_FLAG), CDefaultTableItem::OnTyping);
+ ti->setRealValue(codec->toUnicode(Query->row[i]));
setItem(j, i, ti);
}
break;
@@ -912,8 +913,8 @@
}
else
{
- CDefaultTableItem *ti2 = new CDefaultTableItem(this, j, tmp, (Query->Fields[i].flags & NUM_FLAG), CDefaultTableItem::OnTyping);
- ti2->setRealValue(Query->row[i]);
+ CDefaultTableItem *ti2 = new CDefaultTableItem(this, j, tmp, (Query->Fields[i].flags & NUM_FLAG), CDefaultTableItem::OnTyping);
+ ti2->setRealValue(codec->toUnicode(Query->row[i]));
setItem(j, i, ti2);
}
}
@@ -943,8 +944,8 @@
else
{
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->setCaption(tr("Text Editor - Column ") + "'" + ((CEllipseTableItem *)x)->getFieldName() + "' Row " + QString::number(currentRow() + 1));
+ TextEditor->setText(codec->toUnicode(Query->getFieldValue(((CEllipseTableItem *)x)->getRowOffset(), ((CEllipseTableItem *)x)->getFieldIndex())));
TextEditor->setTableItem((CDefaultTableItem *) x);
connect(TextEditor, SIGNAL(textChanged(const QString &)), this, SLOT(changeValue(const QString &)));
connect(TextEditor, SIGNAL(changeTableItem(CDefaultTableItem *)), this, SLOT(blockCell(CDefaultTableItem *)));
@@ -964,7 +965,7 @@
CImageFieldEditor *ImageEditor = new CImageFieldEditor(g_WorkSpace, EditorList, "CImageFieldEditor", m_pDatabaseConnection, myReadOnly);
ImageEditor->setCaption(tr("Image Editor - Column ") + "'" + ((CEllipseTableItem *)x)->getFieldName() + "' Row " + QString::number(currentRow() + 1));
ImageEditor->loadImage(((CEllipseTableItem *)x)->getFieldName(),
- Query->getFieldValue(((CEllipseTableItem *)x)->getRowOffset(), ((CEllipseTableItem *)x)->getFieldIndex()),
+ Query->getFieldValue(((CEllipseTableItem *)x)->getRowOffset(), ((CEllipseTableItem *)x)->getFieldIndex()),
((CEllipseTableItem *)x)->getFieldLength());
ImageEditor->show();
}
@@ -1132,9 +1133,9 @@
key += " IS NULL";
else
if (Query->Fields[i].flags & NUM_FLAG)
- key += " = " + value.local8Bit();
- else
- key += " = '" + m_pDatabaseConnection->escape(value) + "'";
+ key += " = " + value;
+ else
+ key += " = '" + m_pDatabaseConnection->escape(value).local8Bit() + "'";
if (IS_PRI_KEY(Query->Fields[i].flags))
{
@@ -1163,8 +1164,8 @@
if (primKey.length())
{
-#ifdef DEBUG
- qDebug("PRIM KEY: *%s*", (const char *)primKey.local8Bit());
+#ifdef DEBUG
+ qDebug("PRIM KEY: *%s*", (const char *)primKey);
#endif
return primKey;
}
@@ -1172,14 +1173,14 @@
if (uniqueKey.length())
{
#ifdef DEBUG
- qDebug("UNIQUE KEY: *%s*", (const char *)uniqueKey.local8Bit());
+ qDebug("UNIQUE KEY: *%s*", (const char *)uniqueKey);
#endif
return uniqueKey;
}
allFields.append(" LIMIT 1");
#ifdef DEBUG
- qDebug("KEY BY ALL FIELDS: *%s*", (const char *)allFields.local8Bit());
+ qDebug("KEY BY ALL FIELDS: *%s*", (const char *)allFields);
#endif
return allFields;
}
@@ -1195,7 +1196,7 @@
ext = "txt";
ext_desc = tr("Text Files (*.txt)") + ";;" + ext_desc;
}
- saveToFile(tmp, ext, ext_desc, Query->getFieldValue(item->getRowOffset(), item->getFieldIndex()), getDatabaseConnection()->messagePanel, writeBinary, item->getFieldLength());
+ saveToFile(tmp, ext, ext_desc, codec->toUnicode(Query->getFieldValue(item->getRowOffset(), item->getFieldIndex())), getDatabaseConnection()->messagePanel, writeBinary, item->getFieldLength());
}
void CSqlTable::P_loadFromFile(QTableItem *x)
--- 1.14/src/CTableGroupItem.cpp Fri Apr 26 12:46:50 2002
+++ 1.15/src/CTableGroupItem.cpp Thu May 23 03:33:23 2002
@@ -145,7 +145,7 @@
else
switch (res)
{
- case MENU_NEW: CTableSpecific::newTable(m_pMySQLDatabase);
+ case MENU_NEW: CTableSpecific::newTable(m_pMySQLDatabase, this);
break;
case MENU_QUERY: CTableSpecific::QueryWindow(m_pMySQLDatabase, "", SQL_QUERY, serverID);
break;
@@ -176,7 +176,6 @@
NEW_WINDOW_FROM_HERE);
//Disable features that aren't currently working
- p_itemMenu->setItemEnabled(MENU_NEW, false);
p_itemMenu->setItemEnabled(MENU_IMPORT, false);
bool notnew = ((m_pMySQLDatabase->getMySQLServerVersion().major <= 3) && (m_pMySQLDatabase->getMySQLServerVersion().minor <= 22));
@@ -209,7 +208,6 @@
void CTableGroupToolbar::disableButtons(const int &maj, const int &min)
{
//Disable features that aren't currently working
- Button(0)->setEnabled(false); //Disable 'New Table'
Button(3)->setEnabled(false); //Disable 'Import Table'
//Disable features not supported by mysql <= 3.22
--- 1.8/src/CTableItem.cpp Wed Feb 27 19:00:51 2002
+++ 1.9/src/CTableItem.cpp Thu May 23 03:33:02 2002
@@ -88,7 +88,7 @@
else
switch (res)
{
- case MENU_EDIT: CTableSpecific::editTable(m, txt);
+ case MENU_EDIT: CTableSpecific::editTable(m, p, txt);
break;
case MENU_PROPERTIES: CTableSpecific::tableProperties(m, txt);
break;
@@ -151,7 +151,6 @@
p_itemMenu->insertItem(getPixmapIcon("refreshTablesIcon"), qApp->translate("CTableItem","Refresh Tables"), MENU_REFRESH);
//Disable features that aren't currently working
- p_itemMenu->setItemEnabled(MENU_EDIT, false);
p_itemMenu->setItemEnabled(MENU_EXPORT, false);
if (disable)
@@ -206,7 +205,6 @@
void CTableItemToolbar::disableButtons(const int &maj, const int &min)
{
//Disable features that aren't currently working
- Button(1)->setEnabled(false); //Disable 'Edit Table'
Button(3)->setEnabled(false); //Disable 'Export Table'
//Disable features not supported by mysql <= 3.22
--- 1.12/src/CTableSpecific.cpp Thu Apr 25 19:09:00 2002
+++ 1.13/src/CTableSpecific.cpp Thu May 23 03:32:42 2002
@@ -18,6 +18,7 @@
#include "CTableSpecific.h"
#include "CTableProperties.h"
+#include "CTableWindow.h"
#include <qmessagebox.h>
bool CTableSpecific::inRange(int res)
@@ -49,12 +50,35 @@
return ret;
}
-bool CTableSpecific::newTable(CMySQLConnection *)
+void CTableSpecific::openTableWindow(CMySQLConnection *m, CDatabaseTreeItem *item, const QString &tableName)
{
- // QMessageBox::warning(0,"New Table", "New Table");
- return false;
+ CTableWindow *w = new CTableWindow(g_WorkSpace, m, item, tableName);
+ Q_CHECK_PTR(w);
+ w->setFocus();
+ w->raise();
+ myShowWindow(w);
+}
+
+void CTableSpecific::newTable(CMySQLConnection *m, CDatabaseTreeItem *item)
+{
+ openTableWindow(m, item, QString::null);
}
+void CTableSpecific::editTable(CMySQLConnection *m, CDatabaseTreeItem *item, const QString &tableName)
+{
+ openTableWindow(m, item, tableName);
+}
+
+void CTableSpecific::editTable(CMySQLConnection *m, const QString &tableName, QObject *o, const char *slot)
+{
+ CTableWindow *w = new CTableWindow(g_WorkSpace, m, tableName, o, slot);
+ Q_CHECK_PTR(w);
+ w->setFocus();
+ w->raise();
+ myShowWindow(w);
+}
+
+
bool CTableSpecific::importTable(CMySQLConnection *)
{
// QMessageBox::warning(0,"Import Table", "Import Table");
@@ -90,12 +114,6 @@
else
if (!printedMessage)
m->PrintError(CRITICAL);
- return false;
-}
-
-bool CTableSpecific::editTable(CMySQLConnection *, const QString & /*tableName*/)
-{
-// QMessageBox::warning(0,"Edit Table", "Edit Table: " + tableName);
return false;
}
| Thread |
|---|
| • bk commit - MyCC | jorge | 23 May |