示例#1
0
dspCountSlipEditList::dspCountSlipEditList(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
    setupUi(this);

    connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
    connect(_post, SIGNAL(clicked()), this, SLOT(sPost()));
    connect(_cntslip, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*)));
    connect(_countTagList, SIGNAL(clicked()), this, SLOT(sCountTagList()));
    connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
    connect(_postAll, SIGNAL(clicked()), this, SLOT(sPostAll()));
    connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));

#ifndef Q_WS_MAC
    _countTagList->setMaximumWidth(25);
#endif

    _item->setReadOnly(TRUE);

    _cntslip->addColumn(tr("User"),    _dateColumn, Qt::AlignCenter,true, "user");
    _cntslip->addColumn(tr("#"),       _itemColumn, Qt::AlignLeft,  true, "cntslip_number");
    _cntslip->addColumn(tr("Location"),_itemColumn, Qt::AlignLeft,  true, "locname");
    _cntslip->addColumn(tr("Lot/Serial #"),     -1, Qt::AlignLeft,  true, "cntslip_lotserial");
    _cntslip->addColumn(tr("Posted"),    _ynColumn, Qt::AlignCenter,true, "cntslip_posted");
    _cntslip->addColumn(tr("Entered"), _itemColumn, Qt::AlignCenter,true, "cntslip_entered");
    _cntslip->addColumn(tr("Slip Qty."),_qtyColumn, Qt::AlignRight, true, "cntslip_qty");

    if (_privileges->check("EnterCountSlips"))
    {
        connect(_cntslip, SIGNAL(valid(bool)), this, SLOT(sHandleButtons(bool)));
        connect(_item, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool)));
    }
示例#2
0
/*
 *  Constructs a dspCountSlipEditList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
dspCountSlipEditList::dspCountSlipEditList(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
  setupUi(this);

  (void)statusBar();

  // signals and slots connections
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_post, SIGNAL(clicked()), this, SLOT(sPost()));
  connect(_cntslip, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*)));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_countTagList, SIGNAL(clicked()), this, SLOT(sCountTagList()));
  connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int)));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_postAll, SIGNAL(clicked()), this, SLOT(sPostAll()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));

#ifndef Q_WS_MAC
  _countTagList->setMaximumWidth(25);
#endif

  _item->setReadOnly(TRUE);

  _cntslip->addColumn(tr("User"),         _dateColumn, Qt::AlignCenter );
  _cntslip->addColumn(tr("#"),            _itemColumn, Qt::AlignLeft   );
  _cntslip->addColumn(tr("Location"),     _itemColumn, Qt::AlignLeft   );
  _cntslip->addColumn(tr("Lot/Serial #"), -1,          Qt::AlignLeft   );
  _cntslip->addColumn(tr("Posted"),       _ynColumn,   Qt::AlignCenter );
  _cntslip->addColumn(tr("Entered"),      _itemColumn, Qt::AlignCenter );
  _cntslip->addColumn(tr("Slip Qty."),    _qtyColumn,  Qt::AlignRight  );

  if (_privleges->check("EnterCountSlips"))
  {
    connect(_cntslip, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
    connect(_item, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool)));
    connect(_cntslip, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
  }

  if (_privleges->check("DeleteCountSlips"))
    connect(_cntslip, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));

  if (_privleges->check("PostCountSlips"))
  {
    connect(_cntslip, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool)));
    _postAll->setEnabled(TRUE);
  }
    
  //If not multi-warehouse hide whs control
  if (!_metrics->boolean("MultiWhs"))
  {
    _warehouseLit->hide();
    _warehouse->hide();
  }
}