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

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

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

  menuItem = pMenu->insertItem("Reassign Customer Type", this, SLOT(sReassignCustomerType()), 0);
  if (!_privileges->check("MaintainCustomerMasters"))
    pMenu->setItemEnabled(menuItem, FALSE);
}
Example #2
0
void honorifics::sPopulateMenu( QMenu *pMenu)
{
  QAction *menuItem;

  menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
  if (!_privileges->check("MaintainTitles"))
    menuItem->setEnabled(false);

  pMenu->addAction(tr("View..."), this, SLOT(sView()));

  menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete()));
  if (!_privileges->check("MaintainTitles"))
    menuItem->setEnabled(false);
}
Example #3
0
void contacts::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*)
{
  int menuItem;

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

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

  menuItem = pMenu->insertItem(tr("Delete"), this, SLOT(sDelete()), 0);
  if (!_privleges->check("MaintainContacts"))
    pMenu->setItemEnabled(menuItem, FALSE);
}
Example #4
0
void departments::sPopulateMenu(QMenu *pMenu )
{
    int menuItem;

    menuItem = pMenu->insertItem(tr("Edit"), this, SLOT(sEdit()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainDepartments"));

    menuItem = pMenu->insertItem(tr("View"), this, SLOT(sView()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewDepartments") ||
				    _privileges->check("MaintainDepartments"));

    menuItem = pMenu->insertItem(tr("Delete"), this, SLOT(sDelete()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainDepartments"));
}
Example #5
0
void incidentPriorities::sPopulateMenu( QMenu *pMenu)
{
  int menuItem;

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

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

  menuItem = pMenu->insertItem(tr("Delete"), this, SLOT(sDelete()), 0);
  if (!_privileges->check("MaintainIncidentPriorities"))
    pMenu->setItemEnabled(menuItem, FALSE);
}
Example #6
0
void unpostedGlSeries::sPopulateMenu(QMenu *pMenu)
{
    int menuItem;

    menuItem = pMenu->insertItem(tr("Edit G/L Series..."),  this, SLOT(sEdit()));
    menuItem = pMenu->insertItem(tr("View G/L Series..."),  this, SLOT(sView()));
    menuItem = pMenu->insertItem(tr("Delete G/L Series..."),this, SLOT(sDelete()));

    pMenu->insertSeparator();

    menuItem = pMenu->insertItem(tr("Post G/L Series..."),  this, SLOT(sPost()));

    pMenu->insertSeparator();
}
Example #7
0
void departments::sPopulateMenu(QMenu *pMenu )
{
  QAction *menuItem;

  menuItem = pMenu->addAction(tr("Edit"), this, SLOT(sEdit()));
  menuItem->setEnabled(_privileges->check("MaintainDepartments"));

  menuItem = pMenu->addAction(tr("View"), this, SLOT(sView()));
  menuItem->setEnabled(_privileges->check("ViewDepartments") ||
                       _privileges->check("MaintainDepartments"));

  menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete()));
  menuItem->setEnabled(_privileges->check("MaintainDepartments"));
}
Example #8
0
void currencies::sPopulateMenu(Q3PopupMenu* pMenu)
{
    int menuItem;
    
    pMenu->insertItem("View...", this, SLOT(sView()), 0);
    
    menuItem = pMenu->insertItem("Edit...", this, SLOT(sEdit()), 0);
    if (!_privleges->check("MaintainCurrencies"))
	pMenu->setItemEnabled(menuItem, FALSE);
    
    menuItem = pMenu->insertItem("Delete...", this, SLOT(sDelete()), 0);
    if (!_privleges->check("MaintainCurrencies"))
	pMenu->setItemEnabled(menuItem, FALSE);
}
Example #9
0
void companies::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

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

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

  menuItem = pMenu->insertItem("Delete...", this, SLOT(sDelete()), 0);
  if (!_privileges->check("MaintainChartOfAccounts"))
    pMenu->setItemEnabled(menuItem, FALSE);
}
searchForEmp::searchForEmp(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_edit,         SIGNAL(clicked()),     this, SLOT(sEdit()));
  connect(_emp, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu *, QTreeWidgetItem *)));
  connect(_new,          SIGNAL(clicked()),     this, SLOT(sNew()));
  connect(_print,        SIGNAL(clicked()),     this, SLOT(sPrint()));
  connect(_searchCode,   SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_searchDept,   SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_searchMgr,    SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_searchNumber, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_searchName, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_searchShift,  SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_search,       SIGNAL(editingFinished()),   this, SLOT(sFillList()));
  connect(_showInactive, SIGNAL(clicked()),     this, SLOT(sFillList()));
  connect(_view,         SIGNAL(clicked()),     this, SLOT(sView()));
  connect(_warehouse,    SIGNAL(updated()),     this, SLOT(sFillList()));

  _emp->addColumn(tr("Site"),   _whsColumn,  Qt::AlignLeft, true, "warehous_code");
  _emp->addColumn(tr("Code"),   _itemColumn, Qt::AlignLeft, true, "emp_code");
  _emp->addColumn(tr("Number"),          -1, Qt::AlignLeft, true, "emp_number");
  _emp->addColumn(tr("First"),  _itemColumn, Qt::AlignLeft, true, "cntct_first_name");
  _emp->addColumn(tr("Last"),   _itemColumn, Qt::AlignLeft, true, "cntct_last_name");
  _emp->addColumn(tr("Manager"),_itemColumn, Qt::AlignLeft, true, "mgr_code");
  _emp->addColumn(tr("Dept."),  _itemColumn, Qt::AlignLeft, true, "dept_number");
  _emp->addColumn(tr("Shift"),  _itemColumn, Qt::AlignLeft, true, "shift_number");

  if (_privileges->check("MaintainEmployees"))
  {
    _new->setEnabled(true);
    connect(_emp, SIGNAL(valid(bool)),       _edit, SLOT(setEnabled(bool)));
    connect(_emp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
  }
  else
    connect(_emp, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));

  connect(omfgThis, SIGNAL(itemsUpdated(int, bool)), SLOT(sFillList()));

  if (_preferences->boolean("XCheckBox/forgetful"))
  {
    _searchCode->setChecked(true);
    _searchDept->setChecked(true);
    _searchMgr->setChecked(true);
    _searchNumber->setChecked(true);
    _searchShift->setChecked(true);
  }
}
Example #11
0
openVouchers::openVouchers(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

//  (void)statusBar();

  connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sFillList()));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_vohead, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_view, SIGNAL(clicked()), this, SLOT(sView()));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_newMisc, SIGNAL(clicked()), this, SLOT(sNewMisc()));
  connect(_post, SIGNAL(clicked()), this, SLOT(sPost()));

  _vohead->addColumn(tr("Vchr. #"),        _orderColumn, Qt::AlignRight,  true,  "vohead_number"  );
  _vohead->addColumn(tr("P/O #"),          _orderColumn, Qt::AlignRight,  true,  "ponumber"  );
  _vohead->addColumn(tr("Vendor"),         -1,           Qt::AlignLeft,   true,  "vendor"   );
  _vohead->addColumn(tr("Vend. Type"),     _itemColumn,  Qt::AlignLeft,   true,  "vendtype_code"   );
  _vohead->addColumn(tr("Vendor Invc. #"), _itemColumn,  Qt::AlignRight,  true,  "vohead_invcnumber"  );
  _vohead->addColumn(tr("Dist. Date"),     _dateColumn,  Qt::AlignCenter, true,  "vohead_distdate" );
  _vohead->addColumn(tr("G/L Post Date"),  _dateColumn,  Qt::AlignCenter, true,  "postdate" );
  _vohead->addColumn(tr("Amount"),         _moneyColumn, Qt::AlignRight,  true,  "vohead_amount" );

  if (! _privileges->check("ChangeVOPostDate"))
    _vohead->hideColumn(6);

  if (_privileges->check("MaintainVouchers"))
  {
    connect(_vohead, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
    connect(_vohead, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
    connect(_vohead, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
  }
  else
  {
    _new->setEnabled(FALSE);
    _newMisc->setEnabled(FALSE);
    connect(_vohead, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));
  }

  if (_privileges->check("PostVouchers"))
    connect(_vohead, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool)));

  connect(omfgThis, SIGNAL(vouchersUpdated()), this, SLOT(sFillList()));

  sFillList();
}
void currencies::sPopulateMenu(QMenu* pMenu)
{
  QAction *menuItem;
  
  menuItem = pMenu->addAction(tr("View..."));
  connect(menuItem, SIGNAL(triggered()), this, SLOT(sView()));
  
  menuItem = pMenu->addAction(tr("Edit..."));
  connect(menuItem, SIGNAL(triggered()), this, SLOT(sEdit()));
  menuItem->setEnabled(_privileges->check("MaintainCurrencies"));
  
  menuItem = pMenu->addAction(tr("Delete..."));
  connect(menuItem, SIGNAL(triggered()), this, SLOT(sDelete()));
  menuItem->setEnabled(_privileges->check("MaintainCurrencies"));
}
Example #13
0
void warehouses::sPopulateMenu( QMenu * pMenu )
{
  int menuItem;

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

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

  menuItem = pMenu->insertItem(tr("List Item Sites..."), this, SLOT(sListItemSites()), 0);
  if (!_privileges->check("ViewItemSites"))
    pMenu->setItemEnabled(menuItem, FALSE);
}
Example #14
0
searchForCRMAccount::searchForCRMAccount(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
  setupUi(this);

  connect(_edit,	 SIGNAL(clicked()),	this, SLOT(sEdit()));
  connect(_search,	 SIGNAL(lostFocus()),	this, SLOT(sFillList()));
  connect(_searchStreet, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_searchCity,   SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_searchState,  SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_searchPostalCode,SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_searchCountry,SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_searchContact,SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_searchName,	 SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_searchNumber, SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_searchPhone,	 SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_showInactive, SIGNAL(toggled(bool)),	this, SLOT(sFillList()));
  connect(_searchCombo,  SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_comboCombo,   SIGNAL(newID(int)),    this, SLOT(sFillList()));
  connect(_crmacct,	 SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *)), this, SLOT(sPopulateMenu(QMenu *)));
  connect(_view,	 SIGNAL(clicked()),	this, SLOT(sView()));

  _crmacct->addColumn(tr("Number"),      80, Qt::AlignCenter );
  _crmacct->addColumn(tr("Name"),        -1, Qt::AlignLeft   );
  _crmacct->addColumn(tr("First"),       50, Qt::AlignLeft   );
  _crmacct->addColumn(tr("Last"),        -1, Qt::AlignLeft   );
  _crmacct->addColumn(tr("Phone"),      100, Qt::AlignLeft   );
  _crmacct->addColumn(tr("Address"),     -1, Qt::AlignLeft   );
  _crmacct->addColumn(tr("City"),        75, Qt::AlignLeft   );
  _crmacct->addColumn(tr("State"),       50, Qt::AlignLeft   );
  _crmacct->addColumn(tr("Country"),    100, Qt::AlignLeft   );
  _crmacct->addColumn(tr("Postal Code"), 75, Qt::AlignLeft   );

  connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList()));
  _editpriv = _privleges->check("MaintainCRMAccounts");
  _viewpriv = _privleges->check("ViewCRMAccounts");
  if (_editpriv)
  {
    connect(_crmacct, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
    connect(_crmacct, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
  }
  else if (_viewpriv)
    connect(_crmacct, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));

  _subtype = CRMACCT;
  _searchCombo->setVisible(FALSE);
  _comboCombo->setVisible(FALSE);
}
Example #15
0
void dspAROpenItems::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pItem)
{
  int menuItem;

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

  pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);
    
  XTreeWidgetItem* item = (XTreeWidgetItem*)pItem;
  {
    if (item->text(0) == "Invoice")
      pMenu->insertItem(tr("View Invoice..."), this, SLOT(sViewInvoice()), 0);
  }
}
Example #16
0
/*
 *  Constructs a itemGroups as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
itemGroups::itemGroups(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
    setupUi(this);

//    (void)statusBar();

    // signals and slots connections
    connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
    connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
    connect(_close, SIGNAL(clicked()), this, SLOT(close()));
    connect(_view, SIGNAL(clicked()), this, SLOT(sView()));
    connect(_itemgrp, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool)));
    init();
}
Example #17
0
void itemSources::sPopulateMenu(Q3PopupMenu *menuThis)
{
  int intMenuItem;

  intMenuItem = menuThis->insertItem(tr("Edit Item Source..."), this, SLOT(sEdit()), 0);
  if (!_privleges->check("MaintainItemSource"))
    menuThis->setItemEnabled(intMenuItem, FALSE);

  intMenuItem = menuThis->insertItem(tr("View Item Source..."), this, SLOT(sView()), 0);
  if ((!_privleges->check("MaintainItemSource")) && (!_privleges->check("ViewItemSource")))
    menuThis->setItemEnabled(intMenuItem, FALSE);

  intMenuItem = menuThis->insertItem(tr("Delete Item Source..."), this, SLOT(sDelete()), 0);
  if (!_privleges->check("MaintainItemSource"))
    menuThis->setItemEnabled(intMenuItem, FALSE);
}
Example #18
0
void boo::sPopulateMenu(QMenu *pMenu)
{
  pMenu->insertItem(tr("View"), this, SLOT(sView()), 0);

  if ( ((_mode == cNew) || (_mode == cEdit)) &&
       (_privleges->check("MaintainBOOs")) )
  {
    pMenu->insertItem(tr("Edit"), this, SLOT(sEdit()), 0);
    pMenu->insertItem(tr("Expire"), this, SLOT(sExpire()), 0);

    pMenu->insertSeparator();

    pMenu->insertItem(tr("Move Up"),   this, SLOT(sMoveUp()), 0);
    pMenu->insertItem(tr("Move Down"), this, SLOT(sMoveDown()), 0);
  }
}
Example #19
0
void searchForEmp::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected)
{
  QAction *menuItem;

  menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView()));
  menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
  menuItem->setEnabled(_privileges->check("MaintainEmployees"));

  if (((XTreeWidgetItem *)pSelected)->altId() > 0)
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("View Manager..."), this, SLOT(sViewMgr()));
    menuItem = pMenu->addAction(tr("Edit Manager..."), this, SLOT(sEditMgr()));
    menuItem->setEnabled(_privileges->check("MaintainEmployees"));
  }
}
Example #20
0
void vendors::sPopulateMenu(QMenu *menuThis)
{
  int intMenuItem;

  intMenuItem = menuThis->insertItem(tr("Edit Vendor..."), this, SLOT(sEdit()), 0);
  if (!_privileges->check("MaintainVendors"))
    menuThis->setItemEnabled(intMenuItem, FALSE);

  intMenuItem = menuThis->insertItem(tr("View Vendor..."), this, SLOT(sView()), 0);
  if ((!_privileges->check("MaintainVendors")) && (!_privileges->check("ViewVendors")))
    menuThis->setItemEnabled(intMenuItem, FALSE);

  intMenuItem = menuThis->insertItem(tr("Delete Vendor..."), this, SLOT(sDelete()), 0);
  if (!_privileges->check("MaintainVendors"))
    menuThis->setItemEnabled(intMenuItem, FALSE);
}
Example #21
0
void BOM::sPopulateMenu(QMenu *menuThis)
{
  menuThis->insertItem(tr("View"), this, SLOT(sView()), 0);
  
  if ((_mode == cNew) || (_mode == cEdit))
  {
    menuThis->insertItem(tr("Edit"), this, SLOT(sEdit()), 0);
    menuThis->insertItem(tr("Expire"), this, SLOT(sExpire()), 0);
    menuThis->insertItem(tr("Replace"), this, SLOT(sReplace()), 0);
    
    menuThis->insertSeparator();
    
    menuThis->insertItem(tr("Move Up"),   this, SLOT(sMoveUp()), 0);
    menuThis->insertItem(tr("Move Down"), this, SLOT(sMoveDown()), 0);
  }
}
void salesReps::sPopulateMenu( QMenu * menu )
{
  QAction *menuItem;

  menuItem = menu->addAction(tr("Edit Sales Rep..."), this, SLOT(sEdit()));
  if (!_privileges->check("MaintainSalesReps"))
    menuItem->setEnabled(FALSE);

  menuItem = menu->addAction(tr("View Sales Rep..."), this, SLOT(sView()));
  if ((!_privileges->check("MaintainSalesReps")) && (!_privileges->check("ViewSalesReps")))
    menuItem->setEnabled(FALSE);

  menuItem = menu->addAction(tr("Delete Sales Rep..."), this, SLOT(sDelete()));
  if (!_privileges->check("MaintainSalesReps"))
    menuItem->setEnabled(FALSE);
}
Example #23
0
void packages::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  menuItem = pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);
  pMenu->setItemEnabled(menuItem, package::userHasPriv(cView));

  menuItem = pMenu->insertItem(tr("Delete"), this, SLOT(sDelete()), 0);
  pMenu->setItemEnabled(menuItem, package::userHasPriv(cNew));

  menuItem = pMenu->insertItem(tr("Enable"), this, SLOT(sEnable()), 0);
  pMenu->setItemEnabled(menuItem, package::userHasPriv(cNew));

  menuItem = pMenu->insertItem(tr("Disable"), this, SLOT(sDisable()), 0);
  pMenu->setItemEnabled(menuItem, package::userHasPriv(cNew));
}
Example #24
0
void siteTypes::sPopulateMenu(QMenu *menu)
{
  int menuItem;

  menuItem = menu->insertItem(tr("Edit Site Type..."), this, SLOT(sEdit()), 0);
  if (!_privileges->check("MaintainSiteTypes"))
    menu->setItemEnabled(menuItem, FALSE);

  menuItem = menu->insertItem(tr("View Site Type..."), this, SLOT(sView()), 0);
  if ((!_privileges->check("MaintainSiteTypes")) && (!_privileges->check("ViewSiteTypes")))
    menu->setItemEnabled(menuItem, FALSE);

  menuItem = menu->insertItem(tr("Delete Site Type..."), this, SLOT(sDelete()), 0);
  if (!_privileges->check("MaintainSiteTypes"))
    menu->setItemEnabled(menuItem, FALSE);
}
Example #25
0
/*
 *  Constructs a shippingForms as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
shippingForms::shippingForms(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    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(_close, SIGNAL(clicked()), this, SLOT(close()));
    connect(_bolformat, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool)));
    init();
}
Example #26
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();
}
Example #27
0
void listRecurringInvoices::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem* pItem, int)
{
  QAction *menuItem;
  XTreeWidgetItem *item = dynamic_cast<XTreeWidgetItem *>(pItem);
  if(0 == item)
    return;

  if(!item->rawValue("invchead_posted").toBool())
  {
    menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("MaintainMiscInvoices"));
  }

  menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView()));
  menuItem->setEnabled(_privileges->check("MaintainMiscInvoices") ||
                       _privileges->check("ViewMiscInvoices"));
}
void cashReceiptsEditList::sPopulateMenu(QMenu *pMenu)
{
    QAction *menuItem;

    menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("MaintainCashReceipts"));

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

    menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete()));
    menuItem->setEnabled(_privileges->check("MaintainCashReceipts"));

    pMenu->addSeparator();

    menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost()));
    menuItem->setEnabled(_privileges->check("PostCashReceipts"));
}
Example #29
0
/*
 *  Constructs a projects as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
projects::projects(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
    setupUi(this);

//    (void)statusBar();

    // signals and slots connections
    connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
    connect(_prj, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
    connect(_close, SIGNAL(clicked()), this, SLOT(close()));
    connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
    connect(_view, SIGNAL(clicked()), this, SLOT(sView()));
    connect(_prj, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool)));
    init();
}
Example #30
0
void incidentWorkbench::sOpen()
{
  bool editPriv =
      (omfgThis->username() == list()->currentItem()->rawValue("incdt_owner_username") && _privileges->check("MaintainPersonalIncidents")) ||
      (omfgThis->username() == list()->currentItem()->rawValue("incdt_assigned_username") && _privileges->check("MaintainPersonalIncidents")) ||
      (_privileges->check("MaintainAllIncidents"));

  bool viewPriv =
      (omfgThis->username() == list()->currentItem()->rawValue("incdt_owner_username") && _privileges->check("ViewPersonalIncidents")) ||
      (omfgThis->username() == list()->currentItem()->rawValue("incdt_username") && _privileges->check("ViewPersonalIncidents")) ||
      (_privileges->check("ViewAllIncidents"));

  if (editPriv)
    sEdit();
  else if (viewPriv)
    sView();
}