freightClasses::freightClasses(QWidget* parent, const char* name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); 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(_deleteUnused, SIGNAL(clicked()), this, SLOT(sDeleteUnused())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainFreightClasses")) { connect(_freightClass, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_freightClass, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_freightClass, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_freightClass, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(false); _deleteUnused->setEnabled(false); } _freightClass->addColumn(tr("Code"), 70, Qt::AlignLeft, true, "freightclass_code"); _freightClass->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "freightclass_descrip"); sFillList(-1); }
/* * Constructs a productCategories as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ productCategories::productCategories(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(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_prodcat, SIGNAL(populateMenu(Q3PopupMenu*,Q3ListViewItem*,int)), this, SLOT(sPopulateMenu(Q3PopupMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deleteUnused, SIGNAL(clicked()), this, SLOT(sDeleteUnused())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_prodcat, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); init(); }
poTypes::poTypes(QWidget *parent, const char *name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deleteunused, SIGNAL(clicked()), this, SLOT(sDeleteUnused())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_potype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); _potype->addColumn(tr("Code"), -1, Qt::AlignLeft, true, "potype_code" ); _potype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "potype_descr" ); _potype->addColumn(tr("Active"), -1, Qt::AlignLeft, true, "potype_active" ); _potype->addColumn(tr("Default"), -1, Qt::AlignLeft, true, "potype_default" ); if (_privileges->check("MaintainPurchaseTypes")) { connect(_potype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_potype, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_potype, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(false); _deleteunused->setEnabled(false); } _edit->setEnabled(false); _delete->setEnabled(false); sFillList(); QSqlDatabase db = QSqlDatabase::database(); if (! db.driver()->subscribedToNotifications().contains("potype")) db.driver()->subscribeToNotification("potype"); connect(db.driver(), SIGNAL(notification(const QString&)), this, SLOT(sNotified(const QString&))); }
/* * Constructs a classCodes as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ classCodes::classCodes(QWidget* parent, const char* name, Qt::WFlags fl) : XMainWindow(parent, name, fl) { setupUi(this); (void)statusBar(); // signals and slots connections 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(_deleteUnused, SIGNAL(clicked()), this, SLOT(sDeleteUnused())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_classcode, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); statusBar()->hide(); if (_privileges->check("MaintainClassCodes")) { connect(_classcode, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_classcode, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_classcode, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_classcode, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); _deleteUnused->setEnabled(FALSE); } _classcode->addColumn(tr("Class Code"), 70, Qt::AlignLeft ); _classcode->addColumn(tr("Description"), -1, Qt::AlignLeft ); sFillList(-1); }