Example #1
0
void quotes::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  menuItem = pMenu->insertItem(tr("Print..."), this, SLOT(sPrint()), 0);
  if (!_privileges->check("PrintQuotes"))
    pMenu->setItemEnabled(menuItem, FALSE);

  pMenu->insertSeparator();

  menuItem = pMenu->insertItem(tr("Convert..."), this, SLOT(sConvert()), 0);
  if (!_privileges->check("ConvertQuotes"))
    pMenu->setItemEnabled(menuItem, FALSE);

  pMenu->insertSeparator();

  menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
  if (!_privileges->check("MaintainQuotes"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);

  menuItem = pMenu->insertItem(tr("Delete..."), this, SLOT(sDelete()), 0);
  if (!_privileges->check("MaintainQuotes"))
    pMenu->setItemEnabled(menuItem, FALSE);
}
void dspQuotesByCustomer::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int)
{
  menuThis->addAction(tr("Edit..."), this, SLOT(sEditOrder()));
  menuThis->addAction(tr("View..."), this, SLOT(sViewOrder()));

  if (_privileges->check("ConvertQuotes"))
  {
    menuThis->addSeparator();
    menuThis->addAction(tr("Convert..."), this, SLOT(sConvert()));
  }
}
Example #3
0
void dspQuotesByCustomer::sPopulateMenu(QMenu *menuThis)
{
  menuThis->insertItem(tr("Edit..."), this, SLOT(sEditOrder()), 0);
  menuThis->insertItem(tr("View..."), this, SLOT(sViewOrder()), 0);
  
  if (_privileges->check("ConvertQuotes"))
  {
    menuThis->insertSeparator();
    menuThis->insertItem(tr("Convert..."), this, SLOT(sConvert()), 0);
  }

}
Example #4
0
quotes::quotes(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
  setupUi(this);

  connect(_quote, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_convert, SIGNAL(clicked()), this, SLOT(sConvert()));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_view, SIGNAL(clicked()), this, SLOT(sView()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_showProspects, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

  _quote->addColumn(tr("Quote #"),    _orderColumn, Qt::AlignRight  );
  _quote->addColumn(tr("Customer"),   -1,           Qt::AlignLeft   );
  _quote->addColumn(tr("P/O Number"), _itemColumn,  Qt::AlignLeft   );
  _quote->addColumn(tr("Quote Date"), _dateColumn,  Qt::AlignCenter );
  _quote->setSelectionMode(QAbstractItemView::ExtendedSelection);

  if (_privleges->check("PrintQuotes"))
    connect(_quote, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool)));

  if (_privleges->check("ConvertQuotes"))
    connect(_quote, SIGNAL(valid(bool)), _convert, SLOT(setEnabled(bool)));

  if (_privleges->check("MaintainQuotes"))
  {
    connect(_quote, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
    connect(_quote, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
    connect(_quote, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
  }
  else
  {
    _new->setEnabled(FALSE);
    connect(_quote, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));
  }

  connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillList()));

  Preferences _pref = Preferences(omfgThis->username());
  if (_pref.boolean("XCheckBox/forgetful"))
    _showProspects->setChecked(true);

  sFillList();
}