Kexi API Documentation (2.0 alpha)

KFormDesigner::ConnectionDialog Class Reference

#include <connectiondialog.h>

Inheritance diagram for KFormDesigner::ConnectionDialog:

KDialogBase List of all members.

Detailed Description

This dialog is used to edit the connections of a form. It uses KexiTableView for this. There is also a details widget (icon + text)) that shows correctness of current connection.

Definition at line 46 of file connectiondialog.h.

Public Member Functions

 ConnectionDialog (QWidget *parent)
 ~ConnectionDialog ()
void exec (Form *form)

Protected Types

enum  { BAdd = 10, BRemove }

Protected Slots

void slotCellChanged (KexiTableItem *, int, QVariant &, KexiDB::ResultInfo *)
void checkConnection (KexiTableItem *item)
void newItemByDragnDrop ()
void newItem ()
void removeItem ()
void slotConnectionCreated (KFormDesigner::Form *form, KFormDesigner::Connection &connection)
void slotConnectionAborted (KFormDesigner::Form *form)
void slotCellSelected (int col, int row)
void slotRowInserted (KexiTableItem *, bool)
virtual void slotOk ()

Protected Member Functions

void setStatusOk (KexiTableItem *item=0)
void setStatusError (const QString &msg, KexiTableItem *item=0)
void initTable ()
 Inits table data, columns, etc.
void updateTableData ()
void updateSlotList (KexiTableItem *item)
void updateSignalList (KexiTableItem *item)
 Updates the signal list, according to the sender name.

Protected Attributes

Formm_form
ConnectionBufferm_buffer
KexiTableViewm_table
KexiTableViewDatam_data
KexiTableViewDatam_widgetsColumnData
KexiTableViewDatam_slotsColumnData
KexiTableViewDatam_signalsColumnData
QLabelm_pixmapLabel
QLabelm_textLabel
QIntDict< QButton > m_buttons


Member Enumeration Documentation

anonymous enum [protected]
 

Enumeration values:
BAdd 
BRemove 

Definition at line 102 of file connectiondialog.h.


Constructor & Destructor Documentation

KFormDesigner::ConnectionDialog::ConnectionDialog QWidget parent  ) 
 

Definition at line 48 of file connectiondialog.cpp.

References KexiTableView::adjustColumnWidthToContents(), BAdd, BRemove, initTable(), m_buttons, m_data, m_pixmapLabel, m_table, m_textLabel, newItem(), removeItem(), KexiTableView::setData(), KexiDataAwareObjectInterface::setInsertingEnabled(), KexiTableView::setSpreadSheetMode(), slotCellSelected(), and slotRowInserted().

KFormDesigner::ConnectionDialog::~ConnectionDialog  )  [inline]
 

Definition at line 52 of file connectiondialog.h.


Member Function Documentation

void KFormDesigner::ConnectionDialog::checkConnection KexiTableItem item  )  [protected, slot]
 

This function checks if the connection represented by KexiTableItem item is valid. It checks if all args (sender, receiver, signal and slot) are given, and then if signal/slot args are compatible (should be always true, as we don't show non-compatible slots). It calls setStatusOk() or setStatusError() following the result of checks.

Definition at line 330 of file connectiondialog.cpp.

References KexiTableViewData::column(), m_data, setStatusError(), and setStatusOk().

Referenced by initTable(), and slotRowInserted().

void KFormDesigner::ConnectionDialog::exec Form form  ) 
 

Displays as modal dialog, to edit connections in Form::connectionBuffer().

Definition at line 141 of file connectiondialog.cpp.

References m_form, and updateTableData().

Referenced by KFormDesigner::FormManager::editConnections().

void KFormDesigner::ConnectionDialog::initTable  )  [protected]
 

Inits table data, columns, etc.

Definition at line 102 of file connectiondialog.cpp.

References KexiTableViewData::addColumn(), checkConnection(), KexiDB::Field::Enum, KexiTableViewColumn::field(), m_data, m_signalsColumnData, m_slotsColumnData, m_table, m_widgetsColumnData, KexiTableView::maximizeColumnsWidth(), KexiTableView::setColumnStretchEnabled(), KexiTableViewColumn::setReadOnly(), KexiTableViewColumn::setRelatedData(), slotCellChanged(), and KexiDB::Field::Text.

Referenced by ConnectionDialog().

void KFormDesigner::ConnectionDialog::newItem  )  [protected, slot]
 

Creates a new item. It just moves the cursor to the last empty row.

Definition at line 359 of file connectiondialog.cpp.

References KexiTableView::acceptRowEdit(), m_table, KexiDataAwareObjectInterface::rows(), and KexiDataAwareObjectInterface::setCursorPosition().

Referenced by ConnectionDialog(), and slotConnectionAborted().

void KFormDesigner::ConnectionDialog::newItemByDragnDrop  )  [protected, slot]
 

Hides the dialog and allow the user to create the Connection by drag-and-drop in the Form itself. Currently disabled in the GUI.

See also:
FormManager::startCreatingConnection()

Definition at line 366 of file connectiondialog.cpp.

References KFormDesigner::FormManager::self(), slotConnectionAborted(), and slotConnectionCreated().

void KFormDesigner::ConnectionDialog::removeItem  )  [protected, slot]
 

Definition at line 403 of file connectiondialog.cpp.

References KexiDataAwareObjectInterface::currentRow(), KexiDataAwareObjectInterface::deleteItem(), m_buffer, m_table, KexiDataAwareObjectInterface::rows(), and KexiDataAwareObjectInterface::selectedItem().

Referenced by ConnectionDialog().

void KFormDesigner::ConnectionDialog::setStatusError const QString msg,
KexiTableItem item = 0
[protected]
 

Used when connection is wrong. Displays a message in details widget and changes icon in 'OK?' column. msg is the message explaining what's wrong.

Definition at line 238 of file connectiondialog.cpp.

References KexiDataAwareObjectInterface::currentRow(), m_pixmapLabel, m_table, m_textLabel, KexiDataAwareObjectInterface::rows(), and KexiDataAwareObjectInterface::selectedItem().

Referenced by checkConnection().

void KFormDesigner::ConnectionDialog::setStatusOk KexiTableItem item = 0  )  [protected]
 

Used when connection is ok. Displays a message in details widget and changes icon in 'OK?' column.

Definition at line 219 of file connectiondialog.cpp.

References KexiDataAwareObjectInterface::currentRow(), m_pixmapLabel, m_table, m_textLabel, KexiDataAwareObjectInterface::rows(), and KexiDataAwareObjectInterface::selectedItem().

Referenced by checkConnection().

void KFormDesigner::ConnectionDialog::slotCellChanged KexiTableItem ,
int  ,
QVariant &  ,
KexiDB::ResultInfo
[protected, slot]
 

Slot called when the user modifies a cell. Signal and/or slot cells are cleared if necessary (not valid anymore).

Definition at line 257 of file connectiondialog.cpp.

Referenced by initTable().

void KFormDesigner::ConnectionDialog::slotCellSelected int  col,
int  row
[protected, slot]
 

Definition at line 149 of file connectiondialog.cpp.

References BRemove, KexiDataAwareObjectInterface::itemAt(), m_buttons, m_table, updateSignalList(), and updateSlotList().

Referenced by ConnectionDialog().

void KFormDesigner::ConnectionDialog::slotConnectionAborted KFormDesigner::Form form  )  [protected, slot]
 

This slot is called when the user aborts connection creation (when in drag-and-drop mode). The dialog is restored, and an empty connection is created.

Definition at line 393 of file connectiondialog.cpp.

References m_form, and newItem().

Referenced by newItemByDragnDrop().

void KFormDesigner::ConnectionDialog::slotConnectionCreated KFormDesigner::Form form,
KFormDesigner::Connection connection
[protected, slot]
 

This slot is called when the user ends connection creation (when in drag-and-drop mode). The dialog is restored, and the created connection is added to the list.

Definition at line 376 of file connectiondialog.cpp.

References KexiDataAwareObjectInterface::data(), KexiDataAwareObjectInterface::insertItem(), m_buffer, m_form, m_table, KFormDesigner::Connection::receiver(), KexiDataAwareObjectInterface::rows(), KFormDesigner::Connection::sender(), KFormDesigner::Connection::signal(), and KFormDesigner::Connection::slot().

Referenced by newItemByDragnDrop().

void KFormDesigner::ConnectionDialog::slotOk  )  [protected, virtual, slot]
 

Slot called when the user presses 'Ok' button. The Form::connectionBuffer() is deleted, created again and filled with Connection. If the user presses 'Cancel', nothing happens.

Definition at line 168 of file connectiondialog.cpp.

References KFormDesigner::Form::connectionBuffer(), KexiDataAwareObjectInterface::itemAt(), m_buffer, m_form, m_table, KexiDataAwareObjectInterface::rows(), KFormDesigner::Form::setConnectionBuffer(), KFormDesigner::Connection::setReceiver(), KFormDesigner::Connection::setSender(), KFormDesigner::Connection::setSignal(), and KFormDesigner::Connection::setSlot().

void KFormDesigner::ConnectionDialog::slotRowInserted KexiTableItem ,
bool 
[protected, slot]
 

Definition at line 161 of file connectiondialog.cpp.

References checkConnection(), and m_buffer.

Referenced by ConnectionDialog().

void KFormDesigner::ConnectionDialog::updateSignalList KexiTableItem item  )  [protected]
 

Updates the signal list, according to the sender name.

Definition at line 311 of file connectiondialog.cpp.

References KexiTableViewData::append(), KexiTableViewData::createItem(), KexiTableViewData::deleteAllRows(), m_form, m_signalsColumnData, KFormDesigner::Form::objectTree(), and KFormDesigner::ObjectTreeItem::widget().

Referenced by slotCellSelected().

void KFormDesigner::ConnectionDialog::updateSlotList KexiTableItem item  )  [protected]
 

Updates the slot list, according to the receiver name, and only shows those who are compatible with signal args.

Definition at line 277 of file connectiondialog.cpp.

References KexiTableViewData::append(), KexiTableViewData::createItem(), KexiTableViewData::deleteAllRows(), m_form, m_slotsColumnData, KFormDesigner::Form::objectTree(), and KFormDesigner::ObjectTreeItem::widget().

Referenced by slotCellSelected().

void KFormDesigner::ConnectionDialog::updateTableData  )  [protected]
 

Updates the widget list (shown in receiver and sender columns). Then fill in the table with the connections in m_buffer.

Definition at line 190 of file connectiondialog.cpp.

References KexiTableViewData::append(), KFormDesigner::Form::connectionBuffer(), KexiTableViewData::createItem(), KexiDataAwareObjectInterface::data(), KexiDataAwareObjectInterface::insertItem(), m_buffer, m_form, m_table, m_widgetsColumnData, KFormDesigner::Form::objectTree(), KFormDesigner::Connection::receiver(), KexiDataAwareObjectInterface::rows(), KFormDesigner::Connection::sender(), KFormDesigner::Connection::signal(), and KFormDesigner::Connection::slot().

Referenced by exec().


Member Data Documentation

ConnectionBuffer* KFormDesigner::ConnectionDialog::m_buffer [protected]
 

Definition at line 104 of file connectiondialog.h.

Referenced by removeItem(), slotConnectionCreated(), slotOk(), slotRowInserted(), and updateTableData().

QIntDict<QButton> KFormDesigner::ConnectionDialog::m_buttons [protected]
 

Definition at line 109 of file connectiondialog.h.

Referenced by ConnectionDialog(), and slotCellSelected().

KexiTableViewData* KFormDesigner::ConnectionDialog::m_data [protected]
 

Definition at line 106 of file connectiondialog.h.

Referenced by checkConnection(), ConnectionDialog(), and initTable().

Form* KFormDesigner::ConnectionDialog::m_form [protected]
 

Definition at line 103 of file connectiondialog.h.

Referenced by exec(), slotConnectionAborted(), slotConnectionCreated(), slotOk(), updateSignalList(), updateSlotList(), and updateTableData().

QLabel* KFormDesigner::ConnectionDialog::m_pixmapLabel [protected]
 

Definition at line 108 of file connectiondialog.h.

Referenced by ConnectionDialog(), setStatusError(), and setStatusOk().

KexiTableViewData * KFormDesigner::ConnectionDialog::m_signalsColumnData [protected]
 

Definition at line 107 of file connectiondialog.h.

Referenced by initTable(), and updateSignalList().

KexiTableViewData * KFormDesigner::ConnectionDialog::m_slotsColumnData [protected]
 

Definition at line 107 of file connectiondialog.h.

Referenced by initTable(), and updateSlotList().

KexiTableView* KFormDesigner::ConnectionDialog::m_table [protected]
 

Definition at line 105 of file connectiondialog.h.

Referenced by ConnectionDialog(), initTable(), newItem(), removeItem(), setStatusError(), setStatusOk(), slotCellSelected(), slotConnectionCreated(), slotOk(), and updateTableData().

QLabel * KFormDesigner::ConnectionDialog::m_textLabel [protected]
 

Definition at line 108 of file connectiondialog.h.

Referenced by ConnectionDialog(), setStatusError(), and setStatusOk().

KexiTableViewData* KFormDesigner::ConnectionDialog::m_widgetsColumnData [protected]
 

Definition at line 107 of file connectiondialog.h.

Referenced by initTable(), and updateTableData().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:58 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003