2
/* BEGIN_COMMON_COPYRIGHT_HEADER
4
* TOra - An Oracle Toolkit for DBA's and developers
6
* Shared/mixed copyright is held throughout files in this product
8
* Portions Copyright (C) 2000-2001 Underscore AB
9
* Portions Copyright (C) 2003-2005 Quest Software, Inc.
10
* Portions Copyright (C) 2004-2008 Numerous Other Contributors
12
* This program is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; only version 2 of
15
* the License is valid for this program.
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
* As a special exception, you have permission to link this program
27
* with the Oracle Client libraries and distribute executables, as long
28
* as you follow the requirements of the GNU GPL in regard to all of the
29
* software in the executable aside from Oracle client libraries.
31
* Specifically you are not permitted to link this program with the
32
* Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
33
* And you are not permitted to distribute binaries compiled against
36
* You may link this product with any GPL'd Qt library.
38
* All trademarks belong to their respective owners.
40
* END_COMMON_COPYRIGHT_HEADER */
42
#include <QMessageBox>
44
#include "migratetool/sqldeveloper.h"
45
#include "migratetool/squirrelsql.h"
46
#include "migratetool/tora3.h"
47
#include "toconnectionimport.h"
48
#include "toconnectionmodel.h"
52
toConnectionImport::toConnectionImport(QWidget * parent)
56
m_tool = toConnectionImport::None;
57
toolComboBox->addItem("None", toConnectionImport::None);
58
toolComboBox->addItem("TOra (1.3.x)",
59
toConnectionImport::Tora3);
60
toolComboBox->addItem("Oracle SQL Developer (1.5)",
61
toConnectionImport::OracleSQLDeveloper);
62
toolComboBox->addItem("SquirrelSQL (2.6.x)",
63
toConnectionImport::SquirrelSQL);
65
toolComboBox_changed(0);
67
availableModel = new toConnectionModel();
69
tableView->setModel(availableModel);
71
connect(toolComboBox, SIGNAL(currentIndexChanged(int)),
72
this, SLOT(toolComboBox_changed(int)));
73
connect(runButton, SIGNAL(clicked()),
74
this, SLOT(refreshAvailable()));
77
void toConnectionImport::toolComboBox_changed(int ix)
79
m_tool = (ToolUsed)toolComboBox->itemData(ix).toInt();
80
if (m_tool == toConnectionImport::OracleSQLDeveloper)
81
notificationLabel->setText(tr("Import connections from an XML file.\n"
82
"No passwords or options are imported."));
83
else if (m_tool == toConnectionImport::SquirrelSQL)
84
notificationLabel->setText(tr("Import connections from tool config directory."));
85
else if (m_tool == toConnectionImport::Tora3)
86
notificationLabel->setText(tr("Import connections from ~/.torarc"));
88
notificationLabel->setText(tr("Select one of tools available.\n"
89
"Connections could require manual changes after importing."));
92
void toConnectionImport::refreshAvailable()
94
if (m_tool == toConnectionImport::None)
96
QMessageBox::information(this, "TOra",
97
"Please select an import tool first.");
100
if (m_tool == toConnectionImport::OracleSQLDeveloper)
101
availableModel->setupData(MigrateTool::sqlDeveloper(this));
102
else if (m_tool == toConnectionImport::SquirrelSQL)
103
availableModel->setupData(MigrateTool::squirrelSql(this));
104
else if (m_tool == toConnectionImport::Tora3)
105
availableModel->setupData(MigrateTool::tora3(this));
107
tableView->resizeColumnsToContents();