diff options
Diffstat (limited to 'kexi/migration')
-rw-r--r-- | kexi/migration/importwizard.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/kexi/migration/importwizard.cpp b/kexi/migration/importwizard.cpp index 757d1fc87..957efc0a6 100644 --- a/kexi/migration/importwizard.cpp +++ b/kexi/migration/importwizard.cpp @@ -132,8 +132,8 @@ void ImportWizard::parseArguments() m_predefinedMimeType = (*m_args)["mimeType"]; if (m_args->contains("connectionData")) { m_predefinedConnectionData = new KexiDB::ConnectionData(); - KexiDB::fromMap( - KexiUtils::deserializeMap((*m_args)["connectionData"]), *m_predefinedConnectionData + KexiDB::fromMap( + KexiUtils::deserializeMap((*m_args)["connectionData"]), *m_predefinedConnectionData ); } } @@ -146,7 +146,7 @@ void ImportWizard::setupIntro() { m_introPage = new TQWidget(this); TQVBoxLayout *vbox = new TQVBoxLayout(m_introPage, KDialog::marginHint()); - + TQLabel *lblIntro = new TQLabel(m_introPage); lblIntro->setAlignment( TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak ); TQString msg; @@ -179,7 +179,7 @@ void ImportWizard::setupSrcType() { m_srcTypePage = new TQWidget(this); -//! @todo Would be good if KexiDBDriverComboBox worked for migration drivers +//! @todo Would be good if KexiDBDriverComboBox worked for migration drivers TQVBoxLayout *vbox = new TQVBoxLayout(m_srcTypePage, KDialog::marginHint()); TQHBoxLayout *hbox = new TQHBoxLayout(vbox); @@ -206,7 +206,7 @@ void ImportWizard::setupSrcConn() m_srcConnPage = new TQWidget(this); TQVBoxLayout *vbox = new TQVBoxLayout(m_srcConnPage, KDialog::marginHint()); - m_srcConn = new KexiConnSelectorWidget(Kexi::connset(), + m_srcConn = new KexiConnSelectorWidget(Kexi::connset(), ":ProjectMigrationSourceDir", m_srcConnPage, "m_srcConnSelector"); m_srcConn->hideConnectonIcon(); @@ -256,7 +256,7 @@ void ImportWizard::setupDstType() m_dstPrjTypeSelector->option_server->setText(i18n("Database project stored on a server")); TQVBoxLayout *frame_server_vbox = new TQVBoxLayout(m_dstPrjTypeSelector->frame_server, KDialog::spacingHint()); - m_dstServerTypeCombo = new KexiDBDriverComboBox(m_dstPrjTypeSelector->frame_server, drvs, + m_dstServerTypeCombo = new KexiDBDriverComboBox(m_dstPrjTypeSelector->frame_server, drvs, KexiDBDriverComboBox::ShowServerDrivers); frame_server_vbox->addWidget(m_dstServerTypeCombo); hbox->addStretch(1); @@ -272,7 +272,7 @@ void ImportWizard::setupDstType() // void ImportWizard::setupDstTitle() { - m_dstTitlePage = new KexiDBTitlePage(i18n("Destination project's caption:"), + m_dstTitlePage = new KexiDBTitlePage(i18n("Destination project's caption:"), this, "KexiDBTitlePage"); m_dstTitlePage->layout()->setMargin( KDialog::marginHint() ); m_dstTitlePage->updateGeometry(); @@ -287,7 +287,7 @@ void ImportWizard::setupDst() m_dstPage = new TQWidget(this); TQVBoxLayout *vbox = new TQVBoxLayout(m_dstPage, KDialog::marginHint()); - m_dstConn = new KexiConnSelectorWidget(Kexi::connset(), + m_dstConn = new KexiConnSelectorWidget(Kexi::connset(), ":ProjectMigrationDestinationDir", m_dstPage, "m_dstConnSelector"); m_dstConn->hideHelpers(); //me: Can't connect m_dstConn->m_fileDlg here, it doesn't exist yet @@ -377,7 +377,7 @@ void ImportWizard::setupFinish() m_finishLbl->setAlignment( TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak ); vbox->addWidget( m_finishLbl ); - m_openImportedProjectCheckBox = new TQCheckBox(i18n("Open imported project"), + m_openImportedProjectCheckBox = new TQCheckBox(i18n("Open imported project"), m_finishPage, "openImportedProjectCheckBox"); m_openImportedProjectCheckBox->setChecked(true); vbox->addSpacing( KDialog::spacingHint() ); @@ -482,7 +482,7 @@ void ImportWizard::arriveDstTitlePage() if(fileBasedSrcSelected()) { TQString suggestedDBName( TQFileInfo(m_srcConn->selectedFileName()).fileName() ); const TQFileInfo fi( suggestedDBName ); - suggestedDBName = suggestedDBName.left(suggestedDBName.length() + suggestedDBName = suggestedDBName.left(suggestedDBName.length() - (fi.extension().length() ? (fi.extension().length()+1) : 0)); m_dstNewDBNameLineEdit->setText( suggestedDBName ); } else { @@ -547,14 +547,14 @@ void ImportWizard::arriveImportingPage() { //todo //temp. hack for MS Access driver only -//! @todo for other databases we will need KexiMigration::Conenction +//! @todo for other databases we will need KexiMigration::Conenction //! and KexiMigration::Driver classes bool showOptions = false; if (fileBasedSrcSelected()) { Kexi::ObjectStatus result; KexiMigrate* sourceDriver = prepareImport(result); if (sourceDriver) { - showOptions = !result.error() + showOptions = !result.error() && sourceDriver->propertyValue( "source_database_has_nonunicode_encoding" ).toBool(); KexiMigration::Data *data = sourceDriver->data(); sourceDriver->setData( 0 ); @@ -621,7 +621,7 @@ TQString ImportWizard::driverNameForSelectedSource() return m_predefinedConnectionData->driverName; } - return m_srcConn->selectedConnectionData() + return m_srcConn->selectedConnectionData() ? m_srcConn->selectedConnectionData()->driverName : TQString(); } @@ -653,7 +653,7 @@ void ImportWizard::accept() KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result) { KexiUtils::WaitCursor wait; - + // Start with a driver manager KexiDB::DriverManager manager; @@ -686,7 +686,7 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result) cdata = m_dstConn->selectedConnectionData(); dbname = m_dstNewDBNameLineEdit->text(); } - else // if (m_dstTypeCombo->currentText().lower() == KexiDB::Driver::defaultFileBasedDriverName()) + else // if (m_dstTypeCombo->currentText().lower() == KexiDB::Driver::defaultFileBasedDriverName()) { //file-based project kdDebug() << "File Destination..." << endl; @@ -701,7 +701,7 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result) /* else { //TODO This needs a better message - //KMessageBox::error(this, + //KMessageBox::error(this, result.setStatus(i18n("No connection data is available. You did not select a destination filename."),""); //return false; } */ @@ -713,7 +713,7 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result) { sourceDriverName = driverNameForSelectedSource(); if (sourceDriverName.isEmpty()) - result.setStatus(i18n("No appropriate migration driver found."), + result.setStatus(i18n("No appropriate migration driver found."), m_migrateManager.possibleProblemsInfoMsg()); } @@ -736,7 +736,7 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result) // Setup progress feedback for the GUI if(sourceDriver->progressSupported()) { m_progressBar->updateGeometry(); - disconnect(sourceDriver, TQ_SIGNAL(progressPercent(int)), + disconnect(sourceDriver, TQ_SIGNAL(progressPercent(int)), this, TQ_SLOT(progressUpdated(int))); connect(sourceDriver, TQ_SIGNAL(progressPercent(int)), this, TQ_SLOT(progressUpdated(int))); @@ -759,7 +759,7 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result) kdDebug() << "Neither radio button is selected (not possible?) presume keep data" << endl; keepData = true; } - + KexiMigration::Data* md = new KexiMigration::Data(); // delete md->destination; md->destination = new KexiProjectData(*cdata, dbname); @@ -769,7 +769,7 @@ KexiMigrate* ImportWizard::prepareImport(Kexi::ObjectStatus& result) md->source = conn_data; md->sourceName = ""; } - else + else { if (m_predefinedConnectionData) md->source = m_predefinedConnectionData; @@ -802,8 +802,8 @@ tristate ImportWizard::import() if (sourceDriver && !result.error()) { if (!m_sourceDBEncoding.isEmpty()) { - sourceDriver->setPropertyValue( "source_database_nonunicode_encoding", - TQVariant(m_sourceDBEncoding.upper().replace(' ',"")) // "CP1250", not "cp 1250" + sourceDriver->setPropertyValue( "source_database_nonunicode_encoding", + TQVariant(m_sourceDBEncoding.upper().replace(' ',"")) // "CP1250", not "cp 1250" ); } @@ -835,10 +835,10 @@ tristate ImportWizard::import() { if (m_args) { // if (fileBasedDstSelected()) { - m_args->insert("destinationDatabaseName", + m_args->insert("destinationDatabaseName", sourceDriver->data()->destination->databaseName()); // } - TQString destinationConnectionShortcut( + TQString destinationConnectionShortcut( Kexi::connset().fileNameForConnectionData( m_dstConn->selectedConnectionData() ) ); if (!destinationConnectionShortcut.isEmpty()) { m_args->insert("destinationConnectionShortcut", destinationConnectionShortcut); @@ -859,14 +859,14 @@ tristate ImportWizard::import() kdDebug() << msg << "\n" << details << endl; setTitle(m_finishPage, i18n("Failure")); - m_finishLbl->setText( + m_finishLbl->setText( i18n("<p>Import failed.</p>%1<p>%2</p><p>You can click \"Back\" button and try again.</p>") .arg(msg).arg(details)); return false; } // delete kexi_conn; return true; -} +} void ImportWizard::reject() { @@ -896,7 +896,7 @@ void ImportWizard::next() if (fileBasedSrcSelected()) dbname = m_srcConn->selectedFileName(); else - dbname = m_srcConn->selectedConnectionData() + dbname = m_srcConn->selectedConnectionData() ? m_srcConn->selectedConnectionData()->serverInfoString() : TQString(); if (!dbname.isEmpty()) dbname = TQString(" \"%1\"").arg(dbname); @@ -920,7 +920,7 @@ void ImportWizard::next() m_lblImportingTxt->setText(i18n("Importing in progress...")); tristate res = import(); if (true == res) { - m_finishLbl->setText( + m_finishLbl->setText( i18n("Database has been imported into Kexi database project \"%1\".") .arg(m_dstNewDBNameLineEdit->text()) ); cancelButton()->setEnabled(false); |