DlgPresence::DlgPresence(QWidget *parent) : QWidget(parent),m_Changed(false) { setupUi(this); m_pView->setModel(PresenceStatusModel::instance()); m_pUp->setIcon ( KIcon( "go-up" ) ); m_pDown->setIcon ( KIcon( "go-down" ) ); m_pAdd->setIcon ( KIcon( "list-add" ) ); m_pRemove->setIcon ( KIcon( "list-remove" ) ); connect(m_pAdd , SIGNAL(clicked()),PresenceStatusModel::instance() ,SLOT(addRow()) ); connect(m_pUp , SIGNAL(clicked()),this ,SLOT(slotMoveUp()) ); connect(m_pDown , SIGNAL(clicked()),this ,SLOT(slotMoveDown()) ); connect(m_pRemove, SIGNAL(clicked()),this ,SLOT(slotRemoveRow())); connect(this , SIGNAL(updateButtons()) , parent ,SLOT(updateButtons())); connect(PresenceStatusModel::instance(),SIGNAL(dataChanged(QModelIndex,QModelIndex)),this,SLOT(slotChanged())); m_pView->horizontalHeader()->setResizeMode(0,QHeaderView::ResizeToContents); m_pView->horizontalHeader()->setResizeMode(1,QHeaderView::Stretch); for (int i=2;i<PresenceStatusModel::instance()->columnCount();i++) { m_pView->horizontalHeader()->setResizeMode(i,QHeaderView::ResizeToContents); } //Add an info tip in the account list m_pTipManager = new TipManager(m_pView); m_pTip = new Tip(i18n("In this table, it is possible to manage different presence states. " "The \"Message\" and \"Present\" values will be exported to the server for every accounts that support it. " "The other fields are designed to make presence status management easier. Please note that some SIP registrar " "have incomplete presence status (publishing) support."),this); m_pTip->setMaximumWidth(510); m_pTipManager->setCurrentTip(m_pTip); }
void TableEditor::slotAddRemoveRow( int num ) { m_row = -1; int numRows = m_dataTable->numRows(); if (num > numRows) { for (int i = numRows; i < num; i++) { slotInsertRow(); } } else { for (int i = num; i < numRows; i++) { slotRemoveRow(); } } //TODO: change the main tag's rowspan if necessary }
TableEditor::TableEditor(QWidget* parent, const char* name) : TableEditorS(parent, name) { m_popup = new KPopupMenu(); m_cellEditId = m_popup->insertItem(i18n("&Edit Cell Properties"), this ,SLOT(slotEditCell())); m_rowEditId = m_popup->insertItem(i18n("Edit &Row Properties"), this ,SLOT(slotEditRow())); // m_colEditId = m_popup->insertItem(i18n("Edit &Column Properties"), this ,SLOT(slotEditCol())); m_mergeSeparatorId = m_popup->insertSeparator(); m_mergeCellsId = m_popup->insertItem(i18n("Merge Cells"), this, SLOT(slotMergeCells())); m_unmergeCellsId = m_popup->insertItem(i18n("Break Merging"), this, SLOT(slotUnmergeCells())); m_popup->insertSeparator(); m_popup->insertItem(i18n("&Insert Row"), this, SLOT(slotInsertRow())); m_popup->insertItem(i18n("Insert Co&lumn"), this, SLOT(slotInsertCol())); m_popup->insertItem(i18n("Remove Row"), this, SLOT(slotRemoveRow())); m_popup->insertItem(i18n("Remove Column"), this, SLOT(slotRemoveCol())); m_popup->insertSeparator(); m_popup->insertItem(i18n("Edit &Table Properties"), this, SLOT(slotEditTable())); m_editChildId = m_popup->insertItem(i18n("Edit Child Table"), this, SLOT(slotEditChildTable())); buttonOk->setIconSet(SmallIconSet("button_ok")); buttonCancel->setIconSet(SmallIconSet("button_cancel")); buttonHelp->setIconSet(SmallIconSet("help")); m_row = m_col = -1; m_tbody = 0L; m_thead = 0L; m_tfoot = 0L; m_table = 0L; m_dtd = 0L; m_write = 0L; m_tableDataTags = new QValueList<QValueList<TableNode> >; m_tableHeaderTags = new QValueList<QValueList<TableNode> >; m_tableFooterTags = new QValueList<QValueList<TableNode> >; m_tableTags = 0L; m_tableDataRows = new QValueList<TableNode>; m_tableHeaderRows = new QValueList<TableNode>; m_tableFooterRows = new QValueList<TableNode>; m_tableRows = 0L; m_createNodes = true; newNum += 7; connect(headerColSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int))); connect(headerRowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int))); connect(rowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int))); connect(colSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int))); connect(footerRowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int))); connect(footerColSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int))); connect(tableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)), SLOT(slotContextMenuRequested(int,int,const QPoint&))); connect(pushButton7, SIGNAL(clicked()), SLOT(slotEditTable())); connect(pushButton7_2, SIGNAL(clicked()), SLOT(slotEditTableBody())); connect(pushButton7_3, SIGNAL(clicked()), SLOT(slotEditTableHeader())); connect(pushButton7_4, SIGNAL(clicked()), SLOT(slotEditTableFooter())); connect(headerTableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)), SLOT(slotContextMenuRequested(int,int,const QPoint&))); connect(footerTableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)), SLOT(slotContextMenuRequested(int,int,const QPoint&))); connect(tabWidget, SIGNAL(currentChanged(QWidget*)), SLOT(slotTabChanged(QWidget*))); connect(buttonHelp, SIGNAL(clicked()), SLOT(slotHelpInvoked())); connect(tableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int))); connect(headerTableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int))); connect(footerTableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int))); }