diff options
Diffstat (limited to 'kexi/plugins/importexport/csv/kexicsvimportdialog.cpp')
-rw-r--r-- | kexi/plugins/importexport/csv/kexicsvimportdialog.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp b/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp index 54890c0b..18398d39 100644 --- a/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp +++ b/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp @@ -27,17 +27,17 @@ #include <tqbuttongroup.h> #include <tqcheckbox.h> -#include <clipboard.h> +#include <tqclipboard.h> #include <tqlabel.h> #include <tqlineedit.h> #include <tqmime.h> #include <tqpushbutton.h> #include <tqradiobutton.h> #include <tqtable.h> -#include <layout.h> +#include <tqlayout.h> #include <tqfiledialog.h> #include <tqpainter.h> -#include <textcodec.h> +#include <tqtextcodec.h> #include <tqtimer.h> #include <tqfontmetrics.h> #include <tqtooltip.h> @@ -192,7 +192,7 @@ KexiCSVImportDialog::KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, setIcon(DesktopIcon(_IMPORT_ICON)); setSizeGripEnabled( TRUE ); -// m_encoding = TQString::fromLatin1(KGlobal::locale()->encoding()); +// m_encoding = TQString::tqfromLatin1(KGlobal::locale()->encoding()); // m_stripWhiteSpaceInTextValuesChecked = true; m_file = 0; m_inputStream = 0; @@ -216,7 +216,7 @@ KexiCSVImportDialog::KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, glyr->addMultiCellWidget( m_delimiterWidget, 1, 2, 0, 0 ); TQLabel *delimiterLabel = new TQLabel(m_delimiterWidget, i18n("Delimiter:"), page); - delimiterLabel->setAlignment(TQt::AlignAuto | TQt::AlignBottom); + delimiterLabel->tqsetAlignment(TQt::AlignAuto | TQt::AlignBottom); glyr->addMultiCellWidget( delimiterLabel, 0, 0, 0, 0 ); // Format: number, text, currency, @@ -230,7 +230,7 @@ KexiCSVImportDialog::KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, glyr->addMultiCellWidget( m_formatCombo, 1, 1, 1, 1 ); m_formatLabel = new TQLabel(m_formatCombo, "", page); - m_formatLabel->setAlignment(TQt::AlignAuto | TQt::AlignBottom); + m_formatLabel->tqsetAlignment(TQt::AlignAuto | TQt::AlignBottom); glyr->addWidget( m_formatLabel, 0, 1 ); m_primaryKeyField = new TQCheckBox( i18n( "Primary key" ), page, "m_primaryKeyField" ); @@ -241,20 +241,20 @@ KexiCSVImportDialog::KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, glyr->addWidget( m_comboQuote, 1, 2 ); TextLabel2 = new TQLabel( m_comboQuote, i18n( "Text quote:" ), page, "TextLabel2" ); - TextLabel2->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Preferred ); - TextLabel2->setAlignment(TQt::AlignAuto | TQt::AlignBottom); + TextLabel2->tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Preferred ); + TextLabel2->tqsetAlignment(TQt::AlignAuto | TQt::AlignBottom); glyr->addWidget( TextLabel2, 0, 2 ); m_startAtLineSpinBox = new KIntSpinBox( page, "m_startAtLineSpinBox" ); m_startAtLineSpinBox->setMinValue(1); - m_startAtLineSpinBox->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); + m_startAtLineSpinBox->tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); m_startAtLineSpinBox->setMinimumWidth(TQFontMetrics(m_startAtLineSpinBox->font()).width("8888888")); glyr->addWidget( m_startAtLineSpinBox, 1, 3 ); m_startAtLineLabel = new TQLabel( m_startAtLineSpinBox, "", page, "TextLabel3" ); - m_startAtLineLabel->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Preferred ); - m_startAtLineLabel->setAlignment(TQt::AlignAuto | TQt::AlignBottom); + m_startAtLineLabel->tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Preferred ); + m_startAtLineLabel->tqsetAlignment(TQt::AlignAuto | TQt::AlignBottom); glyr->addWidget( m_startAtLineLabel, 0, 3 ); TQSpacerItem* spacer_2 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Preferred ); @@ -271,7 +271,7 @@ KexiCSVImportDialog::KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, m_table = new KexiCSVImportDialogTable( plainPage(), "m_table" ); lyr->addWidget( m_table ); - m_table->setSizePolicy( TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding, 1, 1) ); + m_table->tqsetSizePolicy( TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding, 1, 1) ); m_table->setNumRows( 0 ); m_table->setNumCols( 0 ); @@ -280,7 +280,7 @@ KexiCSVImportDialog::KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, if ( m_mode == Clipboard ) { setCaption( i18n( "Inserting From Clipboard" ) ); - TQMimeSource * mime = TQApplication::clipboard()->data(); + TQMimeSource * mime = TQApplication::tqclipboard()->data(); if ( !mime ) { KMessageBox::information( this, i18n("There is no data in the clipboard.") ); @@ -294,7 +294,7 @@ if ( m_mode == Clipboard ) m_cancelled = true; return; } - m_fileArray = TQByteArray(mime->encodedData( "text/plain" ) ); + m_fileArray = TQByteArray(mime->tqencodedData( "text/plain" ) ); } else if ( mode == File ) {*/ @@ -336,11 +336,11 @@ if ( m_mode == Clipboard ) } else if (m_mode == Clipboard) { TQCString subtype("plain"); - m_clipboardData = TQApplication::clipboard()->text(subtype, TQClipboard::Clipboard); + m_clipboardData = TQApplication::tqclipboard()->text(subtype, TQClipboard::Clipboard); /* debug - for (int i=0;TQApplication::clipboard()->data(TQClipboard::Clipboard)->format(i);i++) + for (int i=0;TQApplication::tqclipboard()->data(TQClipboard::Clipboard)->format(i);i++) kdDebug() << i << ": " - << TQApplication::clipboard()->data(TQClipboard::Clipboard)->format(i) << endl; + << TQApplication::tqclipboard()->data(TQClipboard::Clipboard)->format(i) << endl; */ } else { @@ -352,7 +352,7 @@ if ( m_mode == Clipboard ) if (m_mode == File) { m_loadingProgressDlg = new KProgressDialog( this, "m_loadingProgressDlg", i18n("Loading CSV Data"), i18n("Loading CSV Data from \"%1\"...") - .arg(TQDir::convertSeparators(m_fname)), true); + .tqarg(TQDir::convertSeparators(m_fname)), true); m_loadingProgressDlg->progressBar()->setTotalSteps( m_maximumRowsForPreview+1 ); m_loadingProgressDlg->show(); } @@ -440,7 +440,7 @@ bool KexiCSVImportDialog::openData() delete m_file; m_file = 0; KMessageBox::sorry( this, i18n("Cannot open input file <nobr>\"%1\"</nobr>.") - .arg(TQDir::convertSeparators(m_fname)) ); + .tqarg(TQDir::convertSeparators(m_fname)) ); actionButton( Ok )->setEnabled( false ); m_cancelled = true; if (parentWidget()) @@ -458,7 +458,7 @@ bool KexiCSVImportDialog::cancelled() const void KexiCSVImportDialog::fillTable() { KexiUtils::WaitCursor wc(true); - repaint(); + tqrepaint(); m_blockUserEvents = true; TQPushButton *pb = actionButton(KDialogBase::Cancel); if (pb) @@ -530,16 +530,16 @@ void KexiCSVImportDialog::fillTable() m_startAtLineSpinBox->setMaxValue(count); m_startAtLineSpinBox->setValue(m_startline+1); } - m_startAtLineLabel->setText(i18n( "Start at line%1:").arg( - m_allRowsLoadedInPreview ? TQString(" (1-%1)").arg(count) + m_startAtLineLabel->setText(i18n( "Start at line%1:").tqarg( + m_allRowsLoadedInPreview ? TQString(" (1-%1)").tqarg(count) : TQString() //we do not know what's real count )); updateRowCountInfo(); m_blockUserEvents = false; - repaint(); - m_table->verticalScrollBar()->repaint();//avoid missing repaint - m_table->horizontalScrollBar()->repaint();//avoid missing repaint + tqrepaint(); + m_table->verticalScrollBar()->tqrepaint();//avoid missing tqrepaint + m_table->horizontalScrollBar()->tqrepaint();//avoid missing tqrepaint } TQString KexiCSVImportDialog::detectDelimiterByLookingAtFirstBytesOfFile(TQTextStream& inputStream) @@ -548,7 +548,7 @@ TQString KexiCSVImportDialog::detectDelimiterByLookingAtFirstBytesOfFile(TQTextS // try to detect delimiter // \t has priority, then ; then , - const TQIODevice::Offset origOffset = inputStream.device()->at(); + const TQIODevice::Offset origOffset = inputStream.tqdevice()->at(); TQChar c, prevChar=0; int detectedDelimiter = 0; bool insideQuote = false; @@ -601,7 +601,7 @@ TQString KexiCSVImportDialog::detectDelimiterByLookingAtFirstBytesOfFile(TQTextS prevChar = c; } - inputStream.device()->at(origOffset); //restore orig. offset + inputStream.tqdevice()->at(origOffset); //restore orig. offset //now, try to find a delimiter character that exists the same number of times in all the checked lines //this detection method has priority over others @@ -705,9 +705,9 @@ tristate KexiCSVImportDialog::loadRows(TQString &field, int &row, int &column, i if (x == '\r') { continue; // eat '\r', to handle RFC-compliant files } - if (offset==0 && x.unicode()==0xfeff) { + if (offset==0 && x.tqunicode()==0xfeff) { // Ignore BOM, the "Byte Order Mark" - // (http://en.wikipedia.org/wiki/Byte_Order_Mark, // http://www.unicode.org/charts/PDF/UFFF0.pdf) + // (http://en.wikipedia.org/wiki/Byte_Order_Mark, // http://www.tqunicode.org/charts/PDF/UFFF0.pdf) // Probably fixed in TQt4. continue; } @@ -882,7 +882,7 @@ tristate KexiCSVImportDialog::loadRows(TQString &field, int &row, int &column, i m_1stRowForFieldNames->setChecked(true); //this will reload table //slot1stRowForFieldNamesChanged(1); m_blockUserEvents = false; - repaint(); + tqrepaint(); return false; } @@ -926,7 +926,7 @@ void KexiCSVImportDialog::updateColumnText(int col) if (col<(int)m_columnNames.count() && (m_1stRowForFieldNames->isChecked() || m_changedColumnNames[col])) colName = m_columnNames[ col ]; if (colName.isEmpty()) { - colName = i18n("Column %1").arg(col+1); //will be changed to a valid identifier on import + colName = i18n("Column %1").tqarg(col+1); //will be changed to a valid identifier on import m_changedColumnNames[ col ] = false; } int detectedType = m_detectedTypes[col]; @@ -937,7 +937,7 @@ void KexiCSVImportDialog::updateColumnText(int col) detectedType=_TEXT_TYPE; } m_table->horizontalHeader()->setLabel(col, - i18n("Column %1").arg(col+1) + " \n(" + m_typeNames[ detectedType ] + ") "); + i18n("Column %1").tqarg(col+1) + " \n(" + m_typeNames[ detectedType ] + ") "); m_table->setText(0, col, colName); m_table->horizontalHeader()->adjustHeaderSize(); @@ -1108,8 +1108,8 @@ void KexiCSVImportDialog::setText(int row, int col, const TQString& text, bool i TQCString t(text.latin1()); const int textLen = t.length(); for (int i=0; i<textLen; i++) { - if (t.at(i)==',') { - t.at(i) = '.'; + if (t.tqat(i)==',') { + t.tqat(i) = '.'; break; } } @@ -1295,7 +1295,7 @@ void KexiCSVImportDialog::currentCellChanged(int, int col) type=_NUMBER_TYPE; //we're simplifying that for now m_formatCombo->setCurrentItem( type ); - m_formatLabel->setText( m_formatComboText.arg(col+1) ); + m_formatLabel->setText( m_formatComboText.tqarg(col+1) ); m_primaryKeyField->setEnabled( _NUMBER_TYPE == m_detectedTypes[col]); m_primaryKeyField->blockSignals(true); //block to disable executing slotPrimaryKeyFieldToggled() m_primaryKeyField->setChecked( m_primaryKeyColumn == col ); @@ -1522,7 +1522,7 @@ void KexiCSVImportDialog::accept() } m_importingProgressDlg->setLabel( i18n("Importing CSV Data from <nobr>\"%1\"</nobr> into \"%2\" table...") - .arg(TQDir::convertSeparators(m_fname)).arg(m_destinationTableSchema->name()) ); + .tqarg(TQDir::convertSeparators(m_fname)).tqarg(m_destinationTableSchema->name()) ); m_importingProgressDlg->progressBar()->setTotalSteps( TQFileInfo(*m_file).size() ); m_importingProgressDlg->show(); } @@ -1569,7 +1569,7 @@ void KexiCSVImportDialog::accept() TQDialog::accept(); KMessageBox::information(this, i18n("Data has been successfully imported to table \"%1\".") - .arg(m_destinationTableSchema->name())); + .tqarg(m_destinationTableSchema->name())); parentWidget()->raise(); m_conn = 0; } @@ -1651,12 +1651,12 @@ void KexiCSVImportDialog::updateRowCountInfo() m_infoLbl->setFileName( m_fname ); if (m_allRowsLoadedInPreview) { m_infoLbl->setCommentText( - i18n("row count", "(rows: %1)").arg( m_table->numRows()-1+m_startline ) ); + i18n("row count", "(rows: %1)").tqarg( m_table->numRows()-1+m_startline ) ); TQToolTip::remove( m_infoLbl ); } else { m_infoLbl->setCommentText( - i18n("row count", "(rows: more than %1)").arg( m_table->numRows()-1+m_startline ) ); + i18n("row count", "(rows: more than %1)").tqarg( m_table->numRows()-1+m_startline ) ); TQToolTip::add( m_infoLbl->commentLabel(), i18n("Not all rows are visible on this preview") ); } } |