7 messages in com.mysql.lists.gui-toolsbk commit - MyCC
FromSent OnAttachments
jor...@mysql.com16 Oct 2002 00:33 
jor...@mysql.com18 Oct 2002 03:40 
jor...@mysql.com20 Oct 2002 20:44 
jor...@mysql.com22 Oct 2002 08:18 
jor...@mysql.com23 Oct 2002 07:00 
jor...@mysql.com26 Oct 2002 08:39 
jor...@mysql.com29 Oct 2002 17:32 
Subject:bk commit - MyCC
From:jor...@mysql.com (jor@mysql.com)
Date:10/23/2002 07:00:07 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.106 02/10/23 09:00:27 jor@linux.jorge.mysql.com +9 -0 CSqlTable.cpp: Added support for notifying it's query_status via signals CQueryWindowOptionsDialog.cpp: Fixed the description of the "Silent" option CTableGroupItem.cpp: If there are no tables and the user clicks refresh, open the item. CMySQLServer.cpp: Added support for enabling or disabling messages to the sql debug panel CQueryWindow.cpp: Added several visual enhancements Don't append to the Sql Debug panel if the silent option is checked

dist/Changelog.txt 1.45 02/10/23 08:58:46 jor@linux.jorge.mysql.com +9 -0

include/CSqlTable.h 1.4 02/10/23 08:58:35 jor@linux.jorge.mysql.com +8 -5

include/CMySQLServer.h 1.17 02/10/23 08:58:34 jor@linux.jorge.mysql.com +2 -0

include/CQueryWindow.h 1.15 02/10/23 08:58:33 jor@linux.jorge.mysql.com +22 -1

src/CSqlTable.cpp 1.5 02/10/23 08:57:41 jor@linux.jorge.mysql.com +2 -1 Added support for notifying it's query_status via signals

src/CQueryWindowOptionsDialog.cpp 1.2 02/10/23 08:57:25 jor@linux.jorge.mysql.com +1 -1 Fixed the description of the "Silent" option

src/CTableGroupItem.cpp 1.18 02/10/23 08:56:26 jor@linux.jorge.mysql.com +10 -1 If there are no tables and the user clicks refresh, open the item.

src/CMySQLServer.cpp 1.23 02/10/23 08:56:04 jor@linux.jorge.mysql.com +21 -1 Added support for enabling or disabling messages to the sql debug panel

src/CQueryWindow.cpp 1.38 02/10/23 08:55:33 jor@linux.jorge.mysql.com +50 -2 Added several visual enhancements Don't append to the Sql Debug panel if the silent option is checked

# 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.3/include/CSqlTable.h Tue Oct 22 10:16:46 2002 +++ 1.4/include/CSqlTable.h Wed Oct 23 08:58:35 2002 @@ -22,6 +22,9 @@ void addToHistoryPanel(bool b) { add_to_history = b; } void displayMessages(bool b) { display_messages = b; }

+signals: + void progress(); + public slots: void refresh(); void reset(); @@ -31,11 +34,6 @@ bool exec(const char *, ulong); void copy(int row, int col);

-private slots: - void saveCellToFile(CSqlTableItem *table_item); - void loadFromFile(CSqlTableItem *current_item); - void textEditorContentsChanged(const QString &/*value*/, ulong /*length*/,
CSqlTableItem * /*table_item*/); - protected: void endEdit(int row, int col, bool accept, bool replace); QWidget * beginEdit(int row, int col, bool replace); @@ -46,6 +44,11 @@ void openTextEditor(CSqlTableItem *table_item); void openImageViewer(CSqlTableItem *table_item); void DoubleClicked(int, int, int, const QPoint &); + +private slots: + void saveCellToFile(CSqlTableItem *table_item); + void loadFromFile(CSqlTableItem *current_item); + void textEditorContentsChanged(const QString &/*value*/, ulong /*length*/,
CSqlTableItem * /*table_item*/);

private: enum update_Type { PRIMARY, UNIQUE, ALL_FIELDS };

--- 1.1/src/CQueryWindowOptionsDialog.cpp Wed Oct 16 02:23:44 2002 +++ 1.2/src/CQueryWindowOptionsDialog.cpp Wed Oct 23 08:57:25 2002 @@ -220,7 +220,7 @@ silent = new QCheckBox(this, "silent"); silent->setText(trUtf8("Silent")); silent->setChecked(false); - QWhatsThis::add(silent, trUtf8("When checked, no messages will be printed in
the Messages Panel with the exception of errors.")); + QWhatsThis::add(silent, trUtf8("When checked, no messages will be printed in
the Messages Panel with the exception of errors. The progress bar will not be
used either and in general you should expect better performance from the Query
Window since screen-updating function calls will be reduced to a
minimum.\n\nNote: It's wise to check this option on when executing large sql
files.")); Layout2->addWidget(silent); QSpacerItem* spacer_4 = new QSpacerItem(31, 0, QSizePolicy::Expanding,
QSizePolicy::Minimum); Layout2->addItem(spacer_4);

--- 1.4/src/CSqlTable.cpp Tue Oct 22 10:14:32 2002 +++ 1.5/src/CSqlTable.cpp Wed Oct 23 08:57:41 2002 @@ -458,7 +458,8 @@ if (m_cancel) break; for (uint i = 0; i < num_fields; i++) - setItem(z, i, new CSqlTableItem(this, query(), z, i)); + setItem(z, i, new CSqlTableItem(this, query(), z, i)); + emit progress(); z++; } setBlocked(false);

--- 1.44/dist/Changelog.txt Tue Oct 22 10:17:17 2002 +++ 1.45/dist/Changelog.txt Wed Oct 23 08:58:46 2002 @@ -5,6 +5,8 @@ Fixed a couple of bugs which prevented MyCC from being compiled under certain
Linux distributions (Patch supplied by Fritz Ganter)

+ Fixed a bug in the "configure" script (Patch supplied by Fritz Ganter) + Alter / Create Table doesn't reset the field length when changing the field
type anymore unless the types are in different sets.

@@ -26,6 +28,13 @@

Fixed a bug in the Explain Panel that displayed the panel's context menu and
the default QDockWindow context after the main menu was closed. + + Enhanced the way copy works in the Query Window + + Added several visual enhancements to the Query Window + + When the "Silent" option is now selected in the Query Window Options, no
queries will + be appended to the Sql Debug Panel.

Important Notes for 0.8.5-alpha

--- 1.16/include/CMySQLServer.h Wed Oct 16 02:24:56 2002 +++ 1.17/include/CMySQLServer.h Wed Oct 23 08:58:34 2002 @@ -83,6 +83,7 @@ void remove(); void showMessage(ushort, const QString &); void showError(uint, const QString &); + void enableSqlDebugMessages(bool);

signals: void refreshed(); @@ -114,6 +115,7 @@ bool p_completion; bool p_retrieve_show_table_status; bool printconnectionname; + bool debug_connected; int p_port; int p_timeout; CMessagePanel *messagepanel;

--- 1.14/include/CQueryWindow.h Tue Oct 22 10:16:46 2002 +++ 1.15/include/CQueryWindow.h Wed Oct 23 08:58:33 2002 @@ -6,6 +6,8 @@ #include "CQueryTable.h" #include "config.h"

+#include <qprogressbar.h> + class CConfig; class CAction; class QGridLayout; @@ -20,6 +22,7 @@ class QSplitter; class CHistoryPanel; class CTableFieldChooser; +class QLabel;

class CQueryWindow : public CMyWindow { @@ -39,6 +42,7 @@ void setDatabase(const QString &s);

CMySQLServer * mysql() const { return m_mysql; } + QProgressBar * progressBar() { return progress_bar; }

signals: void about_to_close(); @@ -57,6 +61,7 @@ void setBusy(bool); void cancel(); void copy(); + void query_progress();

private slots: void viewMenuAboutToShow(); @@ -87,6 +92,18 @@ CTableFieldChooser *columnsWindow; };

+ class CProgressBar : public QProgressBar + { + public: + CProgressBar (QWidget * parent = 0, const char * name = 0, WFlags f = 0) + : QProgressBar(parent, name, f) {} + + QSize sizeHint() const + { + return QSize(QProgressBar::sizeHint().width(), (int)
(QProgressBar::sizeHint().height() / 1.5)); + } + }; + void init(CMySQLServer *m, int querytype, ushort display); void closeEvent(QCloseEvent * e); CTableFieldChooser *columns_window; @@ -124,6 +141,10 @@ QString default_database; QToolButton *queryTypeButton; QToolButton *saveTypeButton; + QLabel *busy_label; + QLabel *read_only_label; + QLabel *executing_query_label; + CProgressBar * progress_bar; int query_type_item_id; QPopupMenu * queryMenu; bool is_busy; @@ -131,7 +152,7 @@ bool do_cancel; bool use_history_file; bool force; - bool close_on_cancel; + bool close_on_cancel; };

#endif

--- 1.22/src/CMySQLServer.cpp Wed Oct 16 02:23:28 2002 +++ 1.23/src/CMySQLServer.cpp Wed Oct 23 08:56:04 2002 @@ -35,11 +35,31 @@ p_mysql = new CMySQL(); p_mysql->setConnectionName(connection); CSqlDebugPanel * sqlDebugPanel = myApp()->consoleWindow()->sqlDebugPanel(); - if (myApp()->enableSqlPanel()) + debug_connected = myApp()->enableSqlPanel(); + if (debug_connected) QObject::connect(p_mysql, SIGNAL(sqldebug(const QString &)), sqlDebugPanel,
SLOT(SqlDebug(const QString &))); QObject::connect(p_mysql, SIGNAL(error(uint, const QString &)), this,
SLOT(showError(uint, const QString &))); QObject::connect(p_mysql, SIGNAL(message(ushort, const QString &)), this,
SLOT(showMessage(ushort, const QString &))); setMessagePanel(msgpanel); +} + +void CMySQLServer::enableSqlDebugMessages(bool b) +{ + if (myApp()->enableSqlPanel()) + { + CSqlDebugPanel * sqlDebugPanel = myApp()->consoleWindow()->sqlDebugPanel(); + if (b) + { + if (!debug_connected) + QObject::connect(p_mysql, SIGNAL(sqldebug(const QString &)),
sqlDebugPanel, SLOT(SqlDebug(const QString &))); + debug_connected = true; + } + else + { + p_mysql->QObject::disconnect(SIGNAL(sqldebug(const QString &))); + debug_connected = false; + } + } }

void CMySQLServer::showMessage(ushort type, const QString &m)

--- 1.37/src/CQueryWindow.cpp Tue Oct 22 10:11:11 2002 +++ 1.38/src/CQueryWindow.cpp Wed Oct 23 08:55:33 2002 @@ -21,9 +21,13 @@ #include <qsplitter.h> #include <qlayout.h> #include <qclipboard.h> +#include <qstatusbar.h> +#include <qlabel.h> +#include <qframe.h>

#define PROCESS_EVENT 35

+static ulong progress = 0;

CQueryWindow::CExplainPanel::CExplainPanel(QWidget * parent, CMySQLQuery *q,
CMySQLServer *m) : CQueryTable(parent, q, m, "CExplainPanel") @@ -100,6 +104,29 @@ #endif

(void)statusBar(); + busy_label = new QLabel(statusBar()); + busy_label->setText(tr("Busy")); + busy_label->setEnabled(false); + busy_label->setAlignment(Qt::AlignHCenter); + + read_only_label = new QLabel(statusBar()); + read_only_label->setText(tr("Read Only")); + read_only_label->setEnabled(true); + read_only_label->setAlignment(Qt::AlignHCenter); + + executing_query_label = new QLabel(statusBar()); + executing_query_label->setText(tr("Executing Query")); + executing_query_label->setEnabled(false); + executing_query_label->setAlignment(Qt::AlignHCenter); + + progress_bar = new CProgressBar(statusBar()); + progress_bar->setPercentageVisible(false); + progress_bar->setFrameShape(QFrame::NoFrame); + + statusBar()->addWidget(executing_query_label, 0, true); + statusBar()->addWidget(progress_bar, 0, true); + statusBar()->addWidget(read_only_label, 0, true); + statusBar()->addWidget(busy_label, 0, true);

is_busy = false; do_cancel = false; @@ -361,7 +388,7 @@ editUndoAction->setEnabled(false); editRedoAction->setEnabled(false); connect(query_editor, SIGNAL(selectionChanged()), this,
SLOT(selectionChanged())); - connect(results_table, SIGNAL(selectionChanged()), this,
SLOT(selectionChanged())); + connect(results_table, SIGNAL(selectionChanged()), this,
SLOT(selectionChanged()));

connect(query_editor, SIGNAL(undoAvailable(bool)), editUndoAction,
SLOT(setEnabled(bool))); connect(query_editor, SIGNAL(redoAvailable(bool)), editRedoAction,
SLOT(setEnabled(bool))); @@ -425,6 +452,11 @@ delete explain_query; }

+void CQueryWindow::query_progress() +{ + progress_bar->setProgress(++progress); +} + void CQueryWindow::generalOptions() { CQueryWindowOptionsDialog *w = new
CQueryWindowOptionsDialog(myApp()->workSpace(), mysql()); @@ -440,6 +472,11 @@ results_table->addToHistoryPanel(use_history_file); query->setEmitMessages(opt.silent); results_table->displayMessages(opt.silent); + mysql()->enableSqlDebugMessages(opt.silent); + if (!opt.silent) + results_table->disconnect(SIGNAL(progress())); + else + connect(results_table, SIGNAL(progress()), this, SLOT(query_progress())); force = opt.force;

CMySQLQuery *qry = new CMySQLQuery(mysql()->mysql()); @@ -661,6 +698,7 @@ filePrintAction->setEnabled(ena); #endif

+ busy_label->setEnabled(b); fileSaveResultsAction->setEnabled(ena); saveTypesMenu->setEnabled(ena); fileOpenAction->setEnabled(ena); @@ -752,6 +790,9 @@ explain_panel->setNumRows(0); showResultsPanel(true); setBusy(true); + executing_query_label->setEnabled(true); + read_only_label->setEnabled(true); + progress = 0; for (ulong i = 0; i < qry.length(); i++) { if (do_cancel) @@ -774,6 +815,8 @@ q = CMySQLQuery::strip_comments(last_query); if (!q.isEmpty()) { + query_ok = true; + if (use_history_file) historyPanel->History(last_query);

@@ -807,6 +850,7 @@ check_pending_event = 0; } } + executing_query_label->setEnabled(false);

if (db_changed) { @@ -826,8 +870,8 @@ if (query_ok && !do_cancel) { results_table->setQuery(query); + progress_bar->setTotalSteps(query->numRows()); results_table->refresh(); - bool exp_ok = false; if (queryType == "select") { @@ -844,6 +888,7 @@ results_table->setDatabaseName(default_database); last_query = last_query.simplifyWhiteSpace().lower(); results_table->setReadOnly(default_database.isEmpty() ||
!last_query.startsWith("select * from")); + read_only_label->setEnabled(results_table->isReadOnly()); query_type = SQL_ALL_ROWS; } else @@ -857,9 +902,12 @@

setWindowCaption(); setBusy(false); + progress_bar->setProgress(0); + progress = 0; if (do_cancel) { cancel(); + mysql()->mysql()->emitMessage(CRITICAL, tr("Query canceled by user")); do_cancel = false; if (close_on_cancel) close();

--- 1.17/src/CTableGroupItem.cpp Tue Oct 22 10:13:29 2002 +++ 1.18/src/CTableGroupItem.cpp Wed Oct 23 08:56:26 2002 @@ -273,7 +273,16 @@ case MENU_IMPORT: CTableSpecific::importTable(mysql()); break;

- case MENU_REFRESH: refreshWidget(true); + case MENU_REFRESH: + { + if (childCount() == 0) + { + refreshWidget(true); + setOpen(true); + } + else + refreshWidget(true); + } break;

case MENU_NEW_WINDOW_FROM_HERE:
databaseListView()->openInNewWindow(this);