/**************************************************************************** ** Form implementation generated from reading ui file 'hk_kdecsvimportdialog.ui' ** ** Created: Do Sep 1 10:04:45 2005 ** by: The User Interface Compiler ($Id: hk_kdecsvimportdialogbase.cpp,v 1.12 2005/09/01 08:27:12 knorr Exp $) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "hk_kdecsvimportdialogbase.h" #include #include #include #include #include #include #include #include #include #include #include #include /* * Constructs a hk_kdecsvimportdialogbase as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ hk_kdecsvimportdialogbase::hk_kdecsvimportdialogbase( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "hk_kdecsvimportdialogbase" ); setMinimumSize( QSize( 600, 500 ) ); setMaximumSize( QSize( 32767, 32767 ) ); setBackgroundOrigin( QDialog::WidgetOrigin ); setSizeGripEnabled( TRUE ); hk_kdecsvimportdialogbaseLayout = new QGridLayout( this, 1, 1, 11, 6, "hk_kdecsvimportdialogbaseLayout"); layout6 = new QVBoxLayout( 0, 0, 6, "layout6"); buttonOk = new QPushButton( this, "buttonOk" ); buttonOk->setEnabled( FALSE ); buttonOk->setAutoDefault( TRUE ); buttonOk->setDefault( TRUE ); layout6->addWidget( buttonOk ); buttonCancel = new QPushButton( this, "buttonCancel" ); buttonCancel->setAutoDefault( TRUE ); layout6->addWidget( buttonCancel ); morebutton = new QPushButton( this, "morebutton" ); morebutton->setToggleButton( TRUE ); layout6->addWidget( morebutton ); buttonHelp = new QPushButton( this, "buttonHelp" ); buttonHelp->setEnabled( TRUE ); buttonHelp->setAutoDefault( TRUE ); layout6->addWidget( buttonHelp ); Spacer1 = new QSpacerItem( 20, 290, QSizePolicy::Minimum, QSizePolicy::Expanding ); layout6->addItem( Spacer1 ); hk_kdecsvimportdialogbaseLayout->addLayout( layout6, 0, 1 ); layout5 = new QGridLayout( 0, 1, 1, 0, 6, "layout5"); layout8 = new QVBoxLayout( 0, 0, 6, "layout8"); textLabel1 = new QLabel( this, "textLabel1" ); textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); layout8->addWidget( textLabel1 ); previewtable = new QTable( this, "previewtable" ); previewtable->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)3, 0, 0, previewtable->sizePolicy().hasHeightForWidth() ) ); previewtable->setMinimumSize( QSize( 0, 200 ) ); previewtable->setNumRows( 0 ); previewtable->setNumCols( 0 ); previewtable->setReadOnly( TRUE ); layout8->addWidget( previewtable ); layout5->addMultiCellLayout( layout8, 7, 7, 0, 2 ); moreframe = new QFrame( this, "moreframe" ); moreframe->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, moreframe->sizePolicy().hasHeightForWidth() ) ); moreframe->setFrameShape( QFrame::StyledPanel ); moreframe->setFrameShadow( QFrame::Raised ); moreframeLayout = new QGridLayout( moreframe, 1, 1, 11, 6, "moreframeLayout"); autoincfield = new QCheckBox( moreframe, "autoincfield" ); autoincfield->setChecked( TRUE ); moreframeLayout->addWidget( autoincfield, 3, 1 ); datetimeformatfield = new QLineEdit( moreframe, "datetimeformatfield" ); moreframeLayout->addMultiCellWidget( datetimeformatfield, 2, 2, 1, 2 ); dateformatfield = new QLineEdit( moreframe, "dateformatfield" ); moreframeLayout->addMultiCellWidget( dateformatfield, 0, 0, 1, 2 ); datetimeformatlabel = new QLabel( moreframe, "datetimeformatlabel" ); moreframeLayout->addWidget( datetimeformatlabel, 2, 0 ); localelabel = new QLabel( moreframe, "localelabel" ); moreframeLayout->addWidget( localelabel, 5, 0 ); charsetfield = new QComboBox( FALSE, moreframe, "charsetfield" ); charsetfield->setEditable( TRUE ); charsetfield->setAutoCompletion( TRUE ); moreframeLayout->addMultiCellWidget( charsetfield, 4, 4, 1, 2 ); localefield = new QComboBox( FALSE, moreframe, "localefield" ); localefield->setEditable( TRUE ); localefield->setAutoCompletion( TRUE ); moreframeLayout->addMultiCellWidget( localefield, 5, 5, 1, 2 ); timeformatfield = new QLineEdit( moreframe, "timeformatfield" ); moreframeLayout->addMultiCellWidget( timeformatfield, 1, 1, 1, 2 ); charsetlabel = new QLabel( moreframe, "charsetlabel" ); moreframeLayout->addWidget( charsetlabel, 4, 0 ); timeformatlabel = new QLabel( moreframe, "timeformatlabel" ); moreframeLayout->addWidget( timeformatlabel, 1, 0 ); Spacer1_3_3 = new QSpacerItem( 206, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); moreframeLayout->addItem( Spacer1_3_3, 3, 2 ); autoinclabel = new QLabel( moreframe, "autoinclabel" ); moreframeLayout->addWidget( autoinclabel, 3, 0 ); dateformatlabel = new QLabel( moreframe, "dateformatlabel" ); moreframeLayout->addWidget( dateformatlabel, 0, 0 ); layout5->addMultiCellWidget( moreframe, 6, 6, 0, 2 ); TextLabel1_3 = new QLabel( this, "TextLabel1_3" ); layout5->addWidget( TextLabel1_3, 5, 0 ); TextLabel3 = new QLabel( this, "TextLabel3" ); TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); layout5->addWidget( TextLabel3, 4, 0 ); tablename = new QComboBox( FALSE, this, "tablename" ); tablename->setEditable( TRUE ); tablename->setAutoCompletion( TRUE ); layout5->addMultiCellWidget( tablename, 1, 1, 1, 2 ); lblAppend = new QLabel( this, "lblAppend" ); layout5->addWidget( lblAppend, 2, 0 ); Spacer1_3 = new QSpacerItem( 475, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout5->addItem( Spacer1_3, 5, 2 ); TextLabel1_2 = new QLabel( this, "TextLabel1_2" ); layout5->addWidget( TextLabel1_2, 1, 0 ); textdelimiterfield = new QLineEdit( this, "textdelimiterfield" ); layout5->addMultiCellWidget( textdelimiterfield, 4, 4, 1, 2 ); firstrow = new QCheckBox( this, "firstrow" ); firstrow->setChecked( TRUE ); layout5->addWidget( firstrow, 5, 1 ); Spacer1_3_2 = new QSpacerItem( 475, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout5->addItem( Spacer1_3_2, 2, 2 ); appendrows = new QCheckBox( this, "appendrows" ); appendrows->setChecked( FALSE ); layout5->addWidget( appendrows, 2, 1 ); Layout10 = new QHBoxLayout( 0, 0, 1, "Layout10"); TextLabel1 = new QLabel( this, "TextLabel1" ); Layout10->addWidget( TextLabel1 ); filefield = new QLineEdit( this, "filefield" ); filefield->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, filefield->sizePolicy().hasHeightForWidth() ) ); Layout10->addWidget( filefield ); filebutton = new QToolButton( this, "filebutton" ); Layout10->addWidget( filebutton ); layout5->addMultiCellLayout( Layout10, 0, 0, 0, 2 ); TextLabel2 = new QLabel( this, "TextLabel2" ); layout5->addWidget( TextLabel2, 3, 0 ); columnseparatorfield = new QComboBox( FALSE, this, "columnseparatorfield" ); columnseparatorfield->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, columnseparatorfield->sizePolicy().hasHeightForWidth() ) ); layout5->addMultiCellWidget( columnseparatorfield, 3, 3, 1, 2 ); hk_kdecsvimportdialogbaseLayout->addLayout( layout5, 0, 0 ); languageChange(); resize( QSize(891, 729).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( filebutton, SIGNAL( clicked() ), this, SLOT( filebutton_clicked() ) ); connect( filefield, SIGNAL( textChanged(const QString&) ), this, SLOT( buttons_enabled() ) ); connect( columnseparatorfield, SIGNAL( textChanged(const QString&) ), this, SLOT( buttons_enabled() ) ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ok_clicked() ) ); connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( help_clicked() ) ); connect( firstrow, SIGNAL( clicked() ), this, SLOT( buttons_enabled() ) ); connect( tablename, SIGNAL( textChanged(const QString&) ), this, SLOT( buttons_enabled() ) ); connect( appendrows, SIGNAL( clicked() ), this, SLOT( buttons_enabled() ) ); connect( textdelimiterfield, SIGNAL( textChanged(const QString&) ), this, SLOT( buttons_enabled() ) ); connect( morebutton, SIGNAL( toggled(bool) ), this, SLOT( morebutton_clicked() ) ); // tab order setTabOrder( filefield, appendrows ); setTabOrder( appendrows, columnseparatorfield ); setTabOrder( columnseparatorfield, textdelimiterfield ); setTabOrder( textdelimiterfield, firstrow ); setTabOrder( firstrow, buttonOk ); setTabOrder( buttonOk, buttonCancel ); setTabOrder( buttonCancel, buttonHelp ); } /* * Destroys the object and frees any allocated resources */ hk_kdecsvimportdialogbase::~hk_kdecsvimportdialogbase() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void hk_kdecsvimportdialogbase::languageChange() { setCaption( tr( "Text File Import Dialog" ) ); buttonOk->setText( tr( "&OK" ) ); buttonOk->setAccel( QKeySequence( tr( "Alt+O" ) ) ); buttonCancel->setText( tr( "&Cancel" ) ); buttonCancel->setAccel( QKeySequence( tr( "Alt+C" ) ) ); morebutton->setText( tr( "O&ptions" ) ); morebutton->setAccel( QKeySequence( tr( "Alt+P" ) ) ); buttonHelp->setText( tr( "&Help" ) ); buttonHelp->setAccel( QKeySequence( tr( "Alt+H" ) ) ); textLabel1->setText( tr( "Preview:" ) ); autoincfield->setText( QString::null ); QToolTip::add( autoincfield, tr( "First row contains field names." ) ); QToolTip::add( datetimeformatfield, tr( "Name of new or existing table." ) ); QToolTip::add( dateformatfield, tr( "Name of new or existing table." ) ); datetimeformatlabel->setText( tr( "Datetime format" ) ); localelabel->setText( tr( "Locale" ) ); QToolTip::add( timeformatfield, tr( "Name of new or existing table." ) ); charsetlabel->setText( tr( "Charset" ) ); timeformatlabel->setText( tr( "Time format" ) ); autoinclabel->setText( tr( "Detect \"Autoincrement\" " ) ); dateformatlabel->setText( tr( "Date format" ) ); TextLabel1_3->setText( tr( "Field names in first row" ) ); TextLabel3->setText( tr( "Text delimiter" ) ); lblAppend->setText( tr( "Append data" ) ); TextLabel1_2->setText( tr( "Tablename" ) ); textdelimiterfield->setText( tr( "\"" ) ); QToolTip::add( textdelimiterfield, tr( "The character that surrounds text (can be blank)." ) ); firstrow->setText( QString::null ); QToolTip::add( firstrow, tr( "First row contains field names." ) ); appendrows->setText( QString::null ); QToolTip::add( appendrows, tr( "Don't overwrite data in table." ) ); TextLabel1->setText( tr( "Filename" ) ); QToolTip::add( filefield, tr( "The data to import." ) ); filebutton->setText( tr( "..." ) ); TextLabel2->setText( tr( "Column Separator" ) ); QToolTip::add( columnseparatorfield, tr( "Pick the character that separates columns in text file." ) ); } void hk_kdecsvimportdialogbase::buttons_enabled() { qWarning( "hk_kdecsvimportdialogbase::buttons_enabled(): Not implemented yet" ); } void hk_kdecsvimportdialogbase::filebutton_clicked() { qWarning( "hk_kdecsvimportdialogbase::filebutton_clicked(): Not implemented yet" ); } void hk_kdecsvimportdialogbase::ok_clicked() { qWarning( "hk_kdecsvimportdialogbase::ok_clicked(): Not implemented yet" ); } void hk_kdecsvimportdialogbase::help_clicked() { qWarning( "hk_kdecsvimportdialogbase::help_clicked(): Not implemented yet" ); } void hk_kdecsvimportdialogbase::morebutton_clicked() { qWarning( "hk_kdecsvimportdialogbase::morebutton_clicked(): Not implemented yet" ); }