From: <mrj...@us...> - 2007-12-16 04:23:36
|
Revision: 2344 http://tora.svn.sourceforge.net/tora/?rev=2344&view=rev Author: mrjohnson0 Date: 2007-12-15 20:23:39 -0800 (Sat, 15 Dec 2007) Log Message: ----------- don't show results half of splitter until there's something to show. Modified Paths: -------------- branches/tora-1.4/tora/src/toworksheet.cpp branches/tora-1.4/tora/src/toworksheet.h Modified: branches/tora-1.4/tora/src/toworksheet.cpp =================================================================== --- branches/tora-1.4/tora/src/toworksheet.cpp 2007-12-15 22:19:14 UTC (rev 2343) +++ branches/tora-1.4/tora/src/toworksheet.cpp 2007-12-16 04:23:39 UTC (rev 2344) @@ -88,8 +88,8 @@ #include <qtoolbutton.h> #include <qtooltip.h> #include <qworkspace.h> -//Added by qt3to4: -#include <Q3ValueList> + +#include <QList> #include <QKeyEvent> #include <Q3CString> @@ -416,15 +416,11 @@ LastLine = LastOffset = -1; LastID = 0; - QSplitter *splitter = new QSplitter(Qt::Vertical, this); + EditSplitter = new QSplitter(Qt::Vertical, this); - Editor = new toWorksheetText(this, splitter); + Editor = new toWorksheetText(this, EditSplitter); - Q3ValueList<int> list; - list.append(75); - splitter->setSizes(list); - - ResultTab = new toTabWidget(splitter); + ResultTab = new toTabWidget(EditSplitter); Q3VBox *box = new Q3VBox(ResultTab); ResultTab->addTab(box, tr("&Result")); @@ -467,7 +463,7 @@ stattool->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum)); - splitter = new QSplitter(Qt::Horizontal, StatTab); + QSplitter *splitter = new QSplitter(Qt::Horizontal, StatTab); Statistics = new toResultStats(true, splitter); Statistics->setTabWidget(ResultTab); WaitChart = new toResultBar(splitter); @@ -550,6 +546,13 @@ connect(&Poll, SIGNAL(timeout()), this, SLOT(poll())); setFocusProxy(Editor); + + // don't show results yet + + QList<int> list; + list.append(1); + list.append(0); + EditSplitter->setSizes(list); } toWorksheet::toWorksheet(QWidget *main, toConnection &connection, bool autoLoad) @@ -563,7 +566,7 @@ // private for toworksheetwidget toWorksheet::toWorksheet(QWidget *main, const char *name, toConnection &connection) : toToolWidget(WorksheetTool, "worksheetlight.html", main, connection, name) { -// setup(false); + createActions(); } @@ -684,6 +687,7 @@ Result->stop(); return Q3VBox::close(true); } + return false; } @@ -1126,8 +1130,18 @@ Editor->setSelection(line, pos, endLine, endCol); t = t.mid(i); } - if (t.trimmed().length()) + + if (t.trimmed().length()) { + // move splitter if currently hidden + QList<int> list = EditSplitter->sizes(); + if(list[1] == 0) { + list[0] = 1; + list[1] = 1; + } + EditSplitter->setSizes(list); + query(t, type); + } } void toWorksheet::execute() { Modified: branches/tora-1.4/tora/src/toworksheet.h =================================================================== --- branches/tora-1.4/tora/src/toworksheet.h 2007-12-15 22:19:14 UTC (rev 2343) +++ branches/tora-1.4/tora/src/toworksheet.h 2007-12-16 04:23:39 UTC (rev 2344) @@ -81,26 +81,27 @@ friend class toWorksheetWidget; toHighlightedText *Editor; - toTabWidget *ResultTab; - toResultLong *Result; - toResultPlan *Plan; - QWidget *CurrentTab; - QString QueryString; - toResultItem *Resources; - toResultStats *Statistics; - toResultBar *WaitChart; - toResultBar *IOChart; - toListView *Logging; - QSplitter *ResourceSplitter; - toResultLong *LongOps; - toVisualize *Visualize; - Q3ListViewItem *LastLogItem; - QWidget *StatTab; - bool TryStrip; - toResultCols *Columns; - QComboBox *Refresh; - QLabel *Started; - toResultCombo *Schema; + toTabWidget *ResultTab; + toResultLong *Result; + toResultPlan *Plan; + QWidget *CurrentTab; + QString QueryString; + toResultItem *Resources; + toResultStats *Statistics; + toResultBar *WaitChart; + toResultBar *IOChart; + toListView *Logging; + QSplitter *EditSplitter; + QSplitter *ResourceSplitter; + toResultLong *LongOps; + toVisualize *Visualize; + Q3ListViewItem *LastLogItem; + QWidget *StatTab; + bool TryStrip; + toResultCols *Columns; + QComboBox *Refresh; + QLabel *Started; + toResultCombo *Schema; int RefreshSeconds; QTimer RefreshTimer; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |