dspCountTagEditList::dspCountTagEditList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _highlightGroupInt = new QButtonGroup(this); _highlightGroupInt->addButton(_noHighlight); _highlightGroupInt->addButton(_highlightValue); _highlightGroupInt->addButton(_highlightPercent); _codeGroup = new QButtonGroup(this); _codeGroup->addButton(_plancode); _codeGroup->addButton(_classcode); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_showSlips, SIGNAL(clicked()), this, SLOT(sToggleList())); connect(_enterSlip, SIGNAL(clicked()), this, SLOT(sEnterCountSlip())); connect(_cnttag, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool))); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_codeGroup, SIGNAL(buttonClicked(int)), this, SLOT(sParameterTypeChanged())); _parameter->setType(ParameterGroup::ClassCode); _variancePercent->setValidator(omfgThis->percentVal()); _cnttag->setRootIsDecorated(TRUE); _cnttag->addColumn(tr("Pri."), (_whsColumn + 10), Qt::AlignCenter,true, "invcnt_priority"); _cnttag->addColumn(tr("Tag/Slip #"),_orderColumn, Qt::AlignRight, true, "tagnumber"); _cnttag->addColumn(tr("Tag Date"), _dateColumn, Qt::AlignCenter,true, "tagdate"); _cnttag->addColumn(tr("Item Number"), -1, Qt::AlignLeft, true, "item_number"); _cnttag->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _cnttag->addColumn(tr("Location"), _ynColumn, Qt::AlignCenter,true, "loc_specific"); _cnttag->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh"); _cnttag->addColumn(tr("Count Qty."), _qtyColumn, Qt::AlignRight, true, "qohafter"); _cnttag->addColumn(tr("Variance"), _qtyColumn, Qt::AlignRight, true, "variance"); _cnttag->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "varianceprcnt"); _cnttag->addColumn(tr("Amount"), _costColumn, Qt::AlignRight, true, "variancecost"); _cnttag->setIndentation(10); if (_privileges->check("EnterCountTags")) { connect(_cnttag, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_cnttag, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); } if (_privileges->check("DeleteCountTags")) connect(_cnttag, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); if (_privileges->check("PostCountTags")) connect(_cnttag, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); if (_privileges->check("EnterCountSlips")) connect(_cnttag, SIGNAL(valid(bool)), _enterSlip, SLOT(setEnabled(bool))); _searchFor->setFocus(); }
void dspCountTagEditList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { int menuItem; if (((XTreeWidgetItem *)pSelected)->altId() == -1) { menuItem = pMenu->insertItem("Enter Count Slip...", this, SLOT(sEnterCountSlip()), 0); if (!_privileges->check("EnterCountSlips")) pMenu->setItemEnabled(menuItem, FALSE); menuItem = pMenu->insertItem("Count Slip Edit List...", this, SLOT(sCountSlipEditList()), 0); pMenu->insertSeparator(); menuItem = pMenu->insertItem("View Pending Inventory History...", this, SLOT(sViewInventoryHistory()), 0); if (!_privileges->check("ViewInventoryHistory")) pMenu->setItemEnabled(menuItem, FALSE); pMenu->insertSeparator(); menuItem = pMenu->insertItem("Edit Count Tag...", this, SLOT(sEdit()), 0); if (!_privileges->check("EnterCountTags")) pMenu->setItemEnabled(menuItem, FALSE); if (pSelected->text(5) != "") { menuItem = pMenu->insertItem("Post Count Tag...", this, SLOT(sPost()), 0); if (!_privileges->check("PostCountTags")) pMenu->setItemEnabled(menuItem, FALSE); } menuItem = pMenu->insertItem("Delete Count Tag", this, SLOT(sDelete()), 0); if (!_privileges->check("DeleteCountTags")) pMenu->setItemEnabled(menuItem, FALSE); } else { menuItem = pMenu->insertItem("Edit Count Slip...", this, SLOT(sEdit()), 0); if (!_privileges->check("EnterCountSlips")) pMenu->setItemEnabled(menuItem, FALSE); } }