1
/***************************************************************************
2
* Copyright (C) 2005 by Adam Treat *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
***************************************************************************/
12
#include "fieldeditordialogimpl.h"
14
#include "datafield.h"
15
#include "datatable.h"
17
#include <qcheckbox.h>
18
#include <qlineedit.h>
21
#include <qgroupbox.h>
24
#include <kiconloader.h>
26
FieldEditorDialog::FieldEditorDialog( DataField *dataField,
27
DataTable *parentTable,
31
: FieldEditorDialogBase( parent, name ),
32
m_dataField( dataField ),
33
m_parentTable( parentTable ),
34
m_configure( configure )
36
setMinimumSize( 800, 600 );
37
setCaption( i18n("Field Editor Dialog") );
39
wizard1->setPixmap( UserIcon( "wizard_table_4" ) );
44
FieldEditorDialog::~FieldEditorDialog()
47
void FieldEditorDialog::calculatedToggled( bool toggled )
49
m_dataField->setCalculated( toggled );
53
editEquation->setEnabled( true );
54
editEquation->setText( m_dataField->equation() );
58
editEquation->setEnabled( false );
59
editEquation->setText( QString::null );
63
void FieldEditorDialog::fieldNameChanged( const QString &name )
65
m_dataField->setName( name );
68
void FieldEditorDialog::fieldLabelChanged( const QString &label )
70
m_dataField->setLabel( label );
73
void FieldEditorDialog::fieldEquationChanged( const QString &equation )
75
m_dataField->setEquation( equation );
78
void FieldEditorDialog::setup()
80
editName->setEnabled( m_dataField->isVirtual() );
81
editName->setText( m_dataField->name() );
83
editLabel->setEnabled( true );
84
editLabel->setText( m_dataField->label() );
86
checkBoxCalculated->setEnabled( !m_dataField->isVirtual() );
87
checkBoxCalculated->setChecked( m_dataField->calculated() );
90
void FieldEditorDialog::accept()
92
if ( !m_dataField->isVirtual() )
93
m_parentTable->initializeFields();
94
m_parentTable->initializeEditorFields();
96
FieldEditorDialogBase::accept();
99
#include "fieldeditordialogimpl.moc"