Source Code (Use browser search to find items of interest.)
Class Index
kspread'KSpreadTableName (./koffice/kspread/kspread_dlg_tabname.h:38)
class KSpreadTableName : public QDialog
{
Q_OBJECT
public:
KSpreadTableName( KSpreadView* parent, const char* name, QString &_tableName );
QString tableName() { return m_pTableName->text(); }
public slots:
void slotOk();
void slotClose();
protected:
KSpreadView* m_pView;
QLineEdit* m_pTableName;
QPushButton* m_pOk;
QPushButton* m_pClose;
QString m_TableName;
};
kspread'KSpreadTableName::KSpreadTableName() (./koffice/kspread/kspread_dlg_tabname.cc:34)
KSpreadTableName::KSpreadTableName( KSpreadView* _parent, const char* _name, QString& _tableName )
: QDialog( _parent, _name, true )
{
m_pView = _parent;
setCaption( i18n("Change Table Name") );
QLabel* tmpQLabel;
QGridLayout* grid = new QGridLayout( this, 2, 2, 10 );
tmpQLabel = new QLabel( this, "Label_1" );
tmpQLabel->setText( i18n("Table Name") );
grid->addWidget( tmpQLabel, 0, 0 );
m_pTableName = new QLineEdit( this );
m_pTableName->setText( _tableName );
m_pTableName->setFocus();
grid->addWidget( m_pTableName, 1, 0 );
m_pOk = new QPushButton( i18n("Ok"), this );
grid->addWidget( m_pOk, 0, 1 );
m_pClose = new QPushButton( i18n("Cancel"), this );
grid->addWidget( m_pClose, 1, 1 );
connect( m_pOk, SIGNAL( clicked() ), this, SLOT( slotOk() ) );
connect( m_pClose, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
connect( m_pTableName, SIGNAL( returnPressed() ), this, SLOT( slotOk() ) );
}
kspread'KSpreadTableName::slotOk() (./koffice/kspread/kspread_dlg_tabname.cc:64)
void KSpreadTableName::slotOk()
{
QString txt = (m_pTableName->text()).stripWhiteSpace();
if ( txt.isEmpty() )
{
QApplication::beep();
QMessageBox::information( this, i18n("Change table name"), i18n("Table name cannot be empty."), i18n("OK") );
return;
}
if ( KSpreadTable *tbl = m_pView->doc()->map()->findTable( txt ) )
{
if ( tbl != m_pView->activeTable() )
{
QApplication::beep();
QMessageBox::information( this, i18n("Change table name"), i18n("A table with this name already exists."), i18n("OK") );
return;
}
}
accept();
}
kspread'KSpreadTableName::slotClose() (./koffice/kspread/kspread_dlg_tabname.cc:86)
void KSpreadTableName::slotClose()
{
reject();
}