Ejemplo n.º 1
0
/*
 *  Constructs a itemUOM as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
itemUOM::itemUOM(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  _itemid = _itemuomconvid = -1;
  _uomidFrom = -1;
  _ignoreSignals = false;

  // signals and slots connections
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_uomFrom, SIGNAL(currentIndexChanged(int)), this, SLOT(sCheck()));
  connect(_uomTo, SIGNAL(currentIndexChanged(int)), this, SLOT(sCheck()));
  connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove()));

  _fromValue->setValidator(omfgThis->qtyVal());
  _toValue->setValidator(omfgThis->qtyVal());

  _fromValue->setDouble(1);
  _toValue->setDouble(1);

  _uomFrom->setType(XComboBox::UOMs);
  _uomTo->setType(XComboBox::UOMs);
}
Ejemplo n.º 2
0
updatePrices::updatePrices(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
    : XDialog(parent, name, modal, fl)
{
  XSqlQuery updateupdatePrices;
  setupUi(this);


  // signals and slots connections
  connect(_byItem,             SIGNAL(toggled(bool)), this, SLOT(sHandleBy(bool)));
  connect(_byItemGroup,        SIGNAL(toggled(bool)), this, SLOT(sHandleBy(bool)));
  connect(_byProductCategory,  SIGNAL(toggled(bool)), this, SLOT(sHandleBy(bool)));
  connect(_close,              SIGNAL(clicked()),     this, SLOT(close()));
  connect(_add,                SIGNAL(clicked()),     this, SLOT(sAdd()));
  connect(_addAll,             SIGNAL(clicked()),     this, SLOT(sAddAll()));
  connect(_remove,             SIGNAL(clicked()),     this, SLOT(sRemove()));
  connect(_removeAll,          SIGNAL(clicked()),     this, SLOT(sRemoveAll()));
  connect(_update,             SIGNAL(clicked()),     this, SLOT(sUpdate()));
  connect(_showEffective,      SIGNAL(clicked()),     this, SLOT(populate()));
  connect(_showExpired,        SIGNAL(clicked()),     this, SLOT(populate()));
  connect(_showCurrent,        SIGNAL(clicked()),     this, SLOT(populate()));
  connect(_value,              SIGNAL(clicked()),     this, SLOT(sHandleCharPrice()));
  connect(_percent,            SIGNAL(clicked()),     this, SLOT(sHandleCharPrice()));
  connect(_avail,              SIGNAL(itemSelected(int)), _add,    SLOT(animateClick()));
  connect(_sel,                SIGNAL(itemSelected(int)), _remove, SLOT(animateClick()));

  _updateBy->setValidator(new XDoubleValidator(-100, 9999, decimalPlaces("curr"), _updateBy));

  MetaSQLQuery mql = mqlLoad("updateprices", "createselsched");
  ParameterList params;
  updateupdatePrices = mql.toQuery(params);
  if (updateupdatePrices.lastError().type() != QSqlError::NoError)
    systemError(this, updateupdatePrices.lastError().databaseText(), __FILE__, __LINE__);

  _avail->addColumn(tr("Schedule"),      -1,          Qt::AlignLeft,  true,  "ipshead_name");
  _avail->addColumn(tr("Description"),   -1,          Qt::AlignLeft,  true,  "ipshead_descrip");
  _avail->addColumn(tr("Effective"),     -1,          Qt::AlignLeft,  true,  "ipshead_effective");
  _avail->addColumn(tr("Expires"),       -1,          Qt::AlignLeft,  true,  "ipshead_expires");
  _avail->setSelectionMode(QAbstractItemView::ExtendedSelection);

  _sel->addColumn(tr("Schedule"),        -1,          Qt::AlignLeft,  true,  "ipshead_name");
  _sel->addColumn(tr("Description"),     -1,          Qt::AlignLeft,  true,  "ipshead_descrip");

  _group->hide();
  //	_value->setChecked(true);

  populate();
}
Ejemplo n.º 3
0
/*
 *  Constructs a ReportParameter as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
ReportParameter::ReportParameter(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
    setupUi(this);

    QButtonGroup * buttonGroup = new QButtonGroup(this);
    buttonGroup->addButton(_staticList, 0);
    buttonGroup->addButton(_dynamicList, 1);

    // signals and slots connections
    connect(_btnOk, SIGNAL(clicked()), this, SLOT(accept()));
    connect(_btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
    connect(buttonGroup, SIGNAL(buttonClicked(int)), _stack, SLOT(setCurrentIndex(int)));
    connect(_listValues, SIGNAL(selectionChanged()), this, SLOT(sSelectionChanged()));
    connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
    connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove()));
}
Ejemplo n.º 4
0
ImportWindow::ImportWindow(QWidget* parent, Qt::WindowFlags fl)
    : QMainWindow(parent, fl)
{
  setupUi(this);

  (void)statusBar();

  // signals and slots connections
  connect(helpIndexAction, SIGNAL(activated()), this, SLOT(helpIndex()));
  connect(helpContentsAction, SIGNAL(activated()), this, SLOT(helpContents()));
  connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
  connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
  connect(fileOpenAction, SIGNAL(activated()), this, SLOT(sAdd()));
  connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
  connect(_import, SIGNAL(clicked()), this, SLOT(sImport()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove()));
  connect(_reports, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(reportsDoubleClicked(QListWidgetItem*)));

  _reports->clear();
  _dbTimerId = startTimer(60000);
}
Ejemplo n.º 5
0
ImportWindow::ImportWindow(QWidget* parent, Qt::WindowFlags fl)
    : QMainWindow(parent, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    connect(helpIndexAction, SIGNAL(activated()), this, SLOT(helpIndex()));
    connect(helpContentsAction, SIGNAL(activated()), this, SLOT(helpContents()));
    connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
    connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
    connect(fileOpenAction, SIGNAL(activated()), this, SLOT(sAdd()));
    connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
    connect(_import, SIGNAL(clicked()), this, SLOT(sImport()));
    connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove()));

    _reports->clear();

    QSqlQuery qpop;
    QSqlError err;
    if(!qpop.exec(getSqlFromTag("fmt19", QSqlDatabase::database().driverName())))
    {
        err = qpop.lastError();
        _log->append(tr("<font color=red>The following error was encountered "
                        "retrieving available schemas:\n"
                        "\t%1\n\t%2\n</font>")
                     .arg(err.driverText())
                     .arg(err.databaseText()));
        return;
    } else
        while (qpop.next())
            _schema->addItem(qpop.value(0).toString(), qpop.value(0));

    _dbTimerId = startTimer(60000);
}