From: <su...@us...> - 2008-02-14 14:54:32
|
Revision: 2579 http://tora.svn.sourceforge.net/tora/?rev=2579&view=rev Author: subik Date: 2008-02-14 06:54:33 -0800 (Thu, 14 Feb 2008) Log Message: ----------- DB links are included now (only when there is Oracle found) and ported to Qt4 Modified Paths: -------------- trunk/tora/CMakeLists.txt trunk/tora/src/tobrowser.cpp trunk/tora/src/tobrowser.h Modified: trunk/tora/CMakeLists.txt =================================================================== --- trunk/tora/CMakeLists.txt 2008-02-14 06:06:08 UTC (rev 2578) +++ trunk/tora/CMakeLists.txt 2008-02-14 14:54:33 UTC (rev 2579) @@ -178,6 +178,8 @@ FIND_PACKAGE(Oracle) IF(ORACLE_FOUND) MESSAGE("Oracle OCI Library Found OK") + # what else is hidden in the ifdef hell?! + ADD_DEFINITIONS("-DDBLINK") ELSE(ORACLE_FOUND) MESSAGE(STATUS "No Oracle OCI found. TOra will be build without Oracle support") ADD_DEFINITIONS("-DTO_NO_ORACLE") Modified: trunk/tora/src/tobrowser.cpp =================================================================== --- trunk/tora/src/tobrowser.cpp 2008-02-14 06:06:08 UTC (rev 2578) +++ trunk/tora/src/tobrowser.cpp 2008-02-14 14:54:33 UTC (rev 2579) @@ -1781,24 +1781,24 @@ #ifdef DBLINK - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_DBLINK); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_DBLINK); TopTab->addTab(splitter, tr("DBLinks")); box = new QWidget(splitter); - QVBoxLayout *vbox = new QVBoxLayout; + + vbox = new QVBoxLayout; vbox->setSpacing(0); vbox->setContentsMargins(0, 0, 0, 0); box->setLayout(vbox); toolbar = toAllocBar(box, tr("Database browser")); - vbox->addWidget(box); + vbox->addWidget(toolbar); - toolbar->addWidget( - new toBrowseButton(QPixmap(const_cast<const char**>(modconstraint_xpm)), - tr("Test DBLink"), - tr("Test DBLink"), - this, SLOT(testDBLink()), - toolbar)); + testDBLinkAct = new QAction(QPixmap(const_cast<const char**>(modconstraint_xpm)), + tr("Test DBLink"), this); + connect(testDBLinkAct, SIGNAL(triggered()), this, SLOT(testDBLink())); + toolbar->addAction(testDBLinkAct); toolbar->addSeparator(); tableView = new toResultTableView(true, false, box); @@ -1809,7 +1809,7 @@ tableView->setTabWidget(TopTab); tableView->setSQL(SQLListDBLink); tableView->resize(FIRST_WIDTH, tableView->height()); - tableView->setResizeMode(toTreeWidget::AllColumns); + connect(tableView, SIGNAL(selectionChanged()), this, @@ -1818,11 +1818,13 @@ SIGNAL(displayMenu(QMenu *)), this, SLOT(displayIndexMenu(QMenu *))); - box->resize(FIRST_WIDTH, tableView->height()); - splitter->setResizeMode(box, QSplitter::KeepSize); + curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + box->resize(FIRST_WIDTH, tableView->height()); + splitter->setStretchFactor(splitter->indexOf(tableView), 0); + splitter->setStretchFactor(splitter->indexOf(curr), 1); + toResultItem *resultDBLink = new toResultItem( 2, true, @@ -3221,6 +3223,7 @@ { if (SecondText.isEmpty()) return ; + toQList resultset; try { resultset = toQuery::readQueryNull(toCurrentConnection(this), @@ -3230,6 +3233,6 @@ // } catch (...) { // TOMessageBox::information(this, "Database link", SecondText); // } - if (!resultset.empty()) - TOMessageBox::information(this, "Database link", SecondText); + QString status(resultset.empty() ? tr("status: FAILED") : tr("status: OK")); + TOMessageBox::information(this, "Database link", SecondText + " " + status); } Modified: trunk/tora/src/tobrowser.h =================================================================== --- trunk/tora/src/tobrowser.h 2008-02-14 06:06:08 UTC (rev 2578) +++ trunk/tora/src/tobrowser.h 2008-02-14 14:54:33 UTC (rev 2579) @@ -100,6 +100,7 @@ QAction *dropTableAct; QAction *enableConstraintAct; QAction *disableConstraintAct; + QAction *testDBLinkAct; #ifdef TOEXTENDED_MYSQL toMySQLUser *UserPanel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |