Exemplo n.º 1
0
contact::contact(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_close,		  SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_deleteCharacteristic,  SIGNAL(clicked()), this, SLOT(sDeleteCharass()));
  connect(_detachUse,		  SIGNAL(clicked()), this, SLOT(sDetachUse()));
  connect(_editCharacteristic,    SIGNAL(clicked()), this, SLOT(sEditCharass()));
  connect(_editUse,  		  SIGNAL(clicked()), this, SLOT(sEditUse()));
  connect(_newCharacteristic,     SIGNAL(clicked()), this, SLOT(sNewCharass()));
  connect(_save,	          SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_uses, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateUsesMenu(QMenu*)));
  connect(_uses, SIGNAL(valid(bool)), this, SLOT(sHandleValidUse(bool)));
  connect(_viewUse,	          SIGNAL(clicked()), this, SLOT(sViewUse()));
  connect(omfgThis,        SIGNAL(vendorsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,      SIGNAL(prospectsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,     SIGNAL(warehousesUpdated()), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(customersUpdated(int,bool)), this, SLOT(sFillList()));

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft );
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft );

  _uses->addColumn(tr("Used by"),         100, Qt::AlignLeft  );
  _uses->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft  );
  _uses->addColumn(tr("Name"),	           -1, Qt::AlignLeft  );
  _uses->addColumn(tr("Role"),	           -1, Qt::AlignLeft  );
  _uses->addColumn(tr("Active"),    _ynColumn, Qt::AlignCenter);

  _activeCache = false;
}
Exemplo n.º 2
0
vendors::vendors(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_edit,   SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_new,    SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_print,  SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_vendor, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_view,   SIGNAL(clicked()), this, SLOT(sView()));

  _vendor->addColumn(tr("Type"),   _itemColumn, Qt::AlignCenter, true, "vendtype_code");
  _vendor->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft,   true, "vend_number");
  _vendor->addColumn(tr("Name"),   -1,          Qt::AlignLeft,   true, "vend_name");

  connect(omfgThis, SIGNAL(vendorsUpdated()), SLOT(sFillList()));

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

  sFillList();
}
Exemplo n.º 3
0
contact::contact(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_close,		  SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_deleteCharacteristic,  SIGNAL(clicked()), this, SLOT(sDeleteCharass()));
  connect(_detachUse,		  SIGNAL(clicked()), this, SLOT(sDetachUse()));
  connect(_editCharacteristic,    SIGNAL(clicked()), this, SLOT(sEditCharass()));
  connect(_editUse,  		  SIGNAL(clicked()), this, SLOT(sEditUse()));
  connect(_newCharacteristic,     SIGNAL(clicked()), this, SLOT(sNewCharass()));
  connect(_save,	          SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_uses, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateUsesMenu(QMenu*)));
  connect(_uses, SIGNAL(valid(bool)), this, SLOT(sHandleValidUse(bool)));
  connect(_viewUse,	          SIGNAL(clicked()), this, SLOT(sViewUse()));
  connect(omfgThis,        SIGNAL(vendorsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,      SIGNAL(prospectsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,     SIGNAL(warehousesUpdated()), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(customersUpdated(int,bool)), this, SLOT(sFillList())); 
  connect(_crmAccount, SIGNAL(newId(int)), _contact, SLOT(setSearchAcct(int)));

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name");
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft, true, "charass_value");

  _uses->addColumn(tr("Used by"),         100, Qt::AlignLeft, true, "type");
  _uses->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, true, "number");
  _uses->addColumn(tr("Name"),	           -1, Qt::AlignLeft, true, "name");
  _uses->addColumn(tr("Role"),	           -1, Qt::AlignLeft, true, "role");
  _uses->addColumn(tr("Active"),    _ynColumn, Qt::AlignCenter,true, "active");

  _activeCache = false;

  _contact->setMinimalLayout(false);
  _contact->setAccountVisible(false);
  _contact->setInitialsVisible(false);
  _contact->setActiveVisible(false);
  _contact->setOwnerVisible(false);
  _contact->setListVisible(false);

  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);
}
Exemplo n.º 4
0
/*
 *  Constructs a vendors as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
vendors::vendors(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
  setupUi(this);

  (void)statusBar();

  // signals and slots connections
  connect(_vendor, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool)));
  connect(_vendor, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_vendor, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_view, SIGNAL(clicked()), this, SLOT(sView()));

  statusBar()->hide();
  
  _vendor->addColumn(tr("Type"),   _itemColumn, Qt::AlignCenter );
  _vendor->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft   );
  _vendor->addColumn(tr("Name"),   -1,          Qt::AlignLeft   );

  connect(omfgThis, SIGNAL(vendorsUpdated()), SLOT(sFillList()));

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

  sFillList();
}
Exemplo n.º 5
0
crmaccount::crmaccount(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  _todoList = new todoList(this, "todoList", Qt::Widget);
  _todoListTab->layout()->addWidget(_todoList);
  _todoList->setCloseVisible(false);
  _todoList->list()->hideColumn("crmacct_number");
  _todoList->list()->hideColumn("crmacct_name");
  _todoList->parameterWidget()->setDefault(tr("Assigned"), QVariant(), true);
  _todoList->setParameterWidgetVisible(false);
  _todoList->setQueryOnStartEnabled(false);
  
  _contacts = new contacts(this, "contacts", Qt::Widget);
  _allPage->layout()->addWidget(_contacts);
  _contacts->setCloseVisible(false);
  _contacts->list()->hideColumn("crmacct_number");
  _contacts->list()->hideColumn("crmacct_name");
  _contacts->setParameterWidgetVisible(false);
  _contacts->setQueryOnStartEnabled(false);
  
  _oplist = new opportunityList(this, "opportunityList", Qt::Widget);
  _oplistTab->layout()->addWidget(_oplist);
  _oplist->setCloseVisible(false);
  _oplist->list()->hideColumn("crmacct_number");
  _oplist->parameterWidget()->setDefault(tr("User"), QVariant(), true);
  _oplist->setParameterWidgetVisible(false);
  _oplist->setQueryOnStartEnabled(false);
    
  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);

  _owner->setUsername(omfgThis->username());
  _owner->setType(UsernameLineEdit::UsersActive);
    
  connect(_close,		SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_competitor,		SIGNAL(clicked()), this, SLOT(sCompetitor()));
  connect(_deleteCharacteristic,SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));
  connect(_deleteReg,		SIGNAL(clicked()), this, SLOT(sDeleteReg()));
  connect(_editCharacteristic,	SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
  connect(_editReg,		SIGNAL(clicked()), this, SLOT(sEditReg()));
  connect(_newCharacteristic,	SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
  connect(_newReg,		SIGNAL(clicked()), this, SLOT(sNewReg()));
  connect(_partner,		SIGNAL(clicked()), this, SLOT(sPartner()));
  connect(_prospectButton,	SIGNAL(clicked()), this, SLOT(sProspect()));
  connect(_save,		SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_taxauthButton,	SIGNAL(clicked()), this, SLOT(sTaxAuth()));
  connect(omfgThis, SIGNAL(customersUpdated(int, bool)), this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(prospectsUpdated()),  this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(taxAuthsUpdated(int)),this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(vendorsUpdated()),    this, SLOT(sUpdateRelationships()));
  connect(_customer, SIGNAL(toggled(bool)), this, SLOT(sCustomerToggled()));
  connect(_prospect, SIGNAL(toggled(bool)), this, SLOT(sProspectToggled()));
  connect(_number, SIGNAL(lostFocus()), this, SLOT(sCheckNumber()));
  connect(_primaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); 	 
  connect(_secondaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); 	 
  connect(_allButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons()));
  connect(_customerButton, SIGNAL(clicked()), this, SLOT(sCustomer()));
  connect(_vendorButton, SIGNAL(clicked()), this, SLOT(sEditVendor()));
  connect(_contacts, SIGNAL(cntctDetached(int)), this, SLOT(sHandleCntctDetach(int)));

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name");
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft, true, "charass_value");
  
  _reg->addColumn(tr("Lot/Serial")  ,  _itemColumn,  Qt::AlignLeft, true, "ls_number" );
  _reg->addColumn(tr("Item")        ,  _itemColumn,  Qt::AlignLeft, true, "item_number" );
  _reg->addColumn(tr("Description") ,  -1,  	     Qt::AlignLeft, true, "item_descrip1" );
  _reg->addColumn(tr("Qty"       )  ,  _qtyColumn,   Qt::AlignLeft, true, "lsreg_qty" );
  _reg->addColumn(tr("Sold"        ),  _dateColumn,  Qt::AlignLeft, true, "lsreg_solddate" );
  _reg->addColumn(tr("Registered"  ),  _dateColumn,  Qt::AlignLeft, true, "lsreg_regdate" );
  _reg->addColumn(tr("Expires"   )  ,  _dateColumn,  Qt::AlignLeft, true, "lsreg_expiredate" );

  if (_preferences->boolean("XCheckBox/forgetful"))
    _active->setChecked(true);

  _NumberGen    = -1;
  _mode		= cNew;
  _crmacctId    = -1;
  _competitorId	= -1;
  _custId       = -1;
  _partnerId    = -1;
  _prospectId   = -1;
  _taxauthId    = -1;
  _vendId       = -1;
  _comments->setId(-1);
  _documents->setId(-1);
  _modal        = false;
  
  if (!_metrics->boolean("LotSerialControl"))
    _tab->removeTab(_tab->indexOf(_registrationsTab));

}