Example #1
0
int xsltMap::exec()
{
  if (userHasPriv())
    return XDialog::exec();
  else
  {
    systemError(this,
		tr("You do not have sufficient privilege to view this window"),
		__FILE__, __LINE__);
    return XDialog::Rejected;
  }
}
void externalShippingList::setVisible(bool visible)
{
  if (! visible)
    XWidget::setVisible(false);
  else if (!userHasPriv())
  {
    ErrorReporter::error(QtCriticalMsg, this, tr("Privileges Error"),
                         tr("%1: Insufficient Privileges to View/Edit External "
                            "Shipping Records").arg(windowTitle()),__FILE__,__LINE__);
    close();
  }
  else
    XWidget::setVisible(true);
}
Example #3
0
void externalShippingList::setVisible(bool visible)
{
  if (! visible)
    XMainWindow::setVisible(false);
  else if (!userHasPriv())
  {
    systemError(this,
	        tr("You do not have sufficient privilege to view this window."),
		__FILE__, __LINE__);
    close();
  }
  else
    XMainWindow::setVisible(true);
}
Example #4
0
// TODO: this code really belongs in XDialog
void package::setVisible(bool visible)
{
  if (! visible)
    XDialog::setVisible(false);

  else if (! userHasPriv(_mode))
  {
    systemError(this,
		tr("You do not have sufficient privilege to view this window"),
		__FILE__, __LINE__);
    reject();
  }
  else
    XDialog::setVisible(true);
}
Example #5
0
// TODO: this code really belongs in XDialog
void package::setVisible(bool visible)
{
  if (! visible)
    XDialog::setVisible(false);

  else if (! userHasPriv(_mode))
  {
    ErrorReporter::error(QtCriticalMsg, this, tr("Error Occurred"),
                         tr("%1: Insufficient privileges to view this window ")
                         .arg(windowTitle()),__FILE__,__LINE__);
    reject();
  }
  else
    XDialog::setVisible(true);
}
Example #6
0
// TODO: this code really belongs in XDialog
void employee::setVisible(bool visible)
{
  if (DEBUG)
    qDebug("employee::setVisible(%d) called with mode() == %d",
           visible, _mode);
  if (! visible)
    XDialog::setVisible(false);

  else if (! userHasPriv(_mode))
  {
    systemError(this,
		tr("You do not have sufficient privilege to view this window"),
		__FILE__, __LINE__);
    reject();
  }
  else
    XDialog::setVisible(true);
}
Example #7
0
// TODO: this code really belongs in XDialog
void searchForEmp::setVisible(bool visible)
{
  if (DEBUG)
    qDebug("searchForEmp::setVisible(%d) called",
           visible);
  if (! visible)
    XWidget::setVisible(false);

  else if (! userHasPriv())
  {
    systemError(this,
		tr("You do not have sufficient privilege to view this window"),
		__FILE__, __LINE__);
    close();
  }
  else
    XWidget::setVisible(true);
}
Example #8
0
// TODO: this code really belongs in XDialog
void employee::setVisible(bool visible)
{
  if (DEBUG)
    qDebug("employee::setVisible(%d) called with mode() == %d",
           visible, _mode);
  if (! visible)
    XDialog::setVisible(false);

  else if (! userHasPriv(_mode))
  {
    ErrorReporter::error(QtCriticalMsg, this, tr("No Privileges"),
                          tr("You do not have sufficient privilege to view "
                             "this window"));
    reject();
  }
  else
    XDialog::setVisible(true);
}
Example #9
0
// TODO: this code really belongs in XDialog
void empGroup::setVisible(bool visible)
{
  if (DEBUG)
    qDebug("empGroup::setVisible(%d) called with mode() == %d",
           visible, _mode);
  if (! visible)
    XDialog::setVisible(false);

  else if (! userHasPriv(_mode))
  {
    ErrorReporter::error(QtCriticalMsg, this, tr("Privilege Error"),
                         tr("%1: Insufficient Privileges to View/Edit Employee Groups")
                         .arg(windowTitle()),__FILE__,__LINE__);
    reject();
  }
  else
    XDialog::setVisible(true);
}
Example #10
0
void importXML::setVisible(bool visible)
{
  if (! visible)
    XWidget::setVisible(false);

  else if (! userHasPriv())
  {
    systemError(this,
		tr("You do not have sufficient privilege to view this window"),
		__FILE__, __LINE__);
    close();
  }
  else if (_metrics->value("XMLSuccessTreatment").isEmpty() ||
	   _metrics->value("XSLTLibrary").isEmpty()) // not configured properly
  {
    if (! configureIE::userHasPriv())
    {
      systemError(this,
		  tr("The application is not set up to perform XML Import. "
		     "Have an administrator configure XML Import before "
		     "trying to import data."),
		  __FILE__, __LINE__);
      deleteLater();
    }
    else if (QMessageBox::question(this, tr("Setup required"),
			      tr("<p>You must set up the application to "
				 "import XML data before trying to import "
				 "data. Would you like to do this now?"),
			      QMessageBox::Yes | QMessageBox::Default,
			      QMessageBox::No) == QMessageBox::Yes &&
	     configureIE(this, "", true).exec() == XDialog::Accepted)
      XWidget::setVisible(true);
    else
      deleteLater();
  }
  else
    XWidget::setVisible(true);
}