Exemplo n.º 1
0
void voucherItem::sPopulateMenu(QMenu *pMenu,  XTreeWidgetItem *selected)
{
    QAction *menuItem;

    if ( (selected->rawValue("action") == "REC") && (selected->text(4) == "No") )
    {
        menuItem = pMenu->addAction(tr("Correct Receipt..."), this, SLOT(sCorrectReceiving()));
        menuItem->setEnabled(_privileges->check("EnterReceipts"));

        menuItem = pMenu->addAction(tr("Split Receipt..."), this, SLOT(sSplitReceipt()));
        menuItem->setEnabled(_privileges->check("EnterReceipts"));
    }
}
Exemplo n.º 2
0
void voucherItem::sPopulateMenu(QMenu *pMenu,  QTreeWidgetItem *selected)
{
  int menuItem;
  
  if (selected->text(3) == "No")
  {
    menuItem = pMenu->insertItem(tr("Correct Receipt..."), this, SLOT(sCorrectReceiving()), 0);
    if (!_privileges->check("EnterReceipts"))
      pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("Split Receipt..."), this, SLOT(sSplitReceipt()), 0);
    if (!_privileges->check("EnterReceipts"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
}