Exemplo n.º 1
0
/** Init _keducaFile pointer and EditMode */
void KControlAddEdit::init(FileRead *keducaFile, bool edit)
{
    setCurrentAnswerItem(0);
    _keducaFile = keducaFile;
    _editMode = edit;

    _listAnswers->setSorting(-1);
    
    if( _editMode )
    {
        setCaption(i18n("Modify Question"));
        fillPage();
    }else{
        setCaption(i18n("Add Questions"));
        slotQuestionTypeChanged( 0 );
    }

    // settings for Question page
    setHelpEnabled ( _pageQuestion, false );
    setNextEnabled( _pageQuestion, false );

    // settings for Answer page
    setHelpEnabled ( _pageAnswer, false );
    setFinishEnabled( _pageAnswer, true );
}
Exemplo n.º 2
0
HelpWindow::HelpWindow(Context *context) : context(context)
{
    setWindowTitle(tr("Help Overview"));
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint | Qt::Tool);

    // prepare the text
    fillPage();

    // layout the widget
    layout = new QVBoxLayout();
    layout->addWidget(textPage);
    setLayout(layout);

}
// -------------------------------------------------------------------------
// QueryGenl Class :: getMatchList() - get a list of ids that match
// -------------------------------------------------------------------------
QueryGenl& QueryGenl :: getMatchList(GeneralPage &genlPage)
{
  // for each id get employeeData and see if a match
  IString
    matchId,
    key,
    value;

  Boolean
    match = false;
  LEmployeeData
   *ed = NULL;

  //  no verification of valid input
  genlPage.setEmployeeData();
  //  get the stuff from general page
  fillPage(genlPage);
  emptyBagMatchIds();


  idList.setFirstId();
  while (idList.getId(matchId)) {
    ed = new LEmployeeData(matchId);

    // see if a match by looping thru searchList

    // must match up on all items
    // while ( done && getSearchItem(key, value)) {

    if (setFirstSearchItem())
       match = true;

    while (match && getSearchItem(key, value)) {
      match = aMatch(ed, key, value);
      getNextSearchItem();
    }

    // put this ID in the MatchList
    if  (match)
       addMatchId(matchId);

    idList.getNextId();
    delete ed;
  } /* endwhile */
  return *this;

};
// -------------------------------------------------------------------------
// QueryAcct :: getMatchList() get the search list
// -------------------------------------------------------------------------
QueryAcct& QueryAcct :: getMatchList(AccountPage &acctPage)
{

  IString
    matchId,
    key,
    value;

  Boolean
    lp = false;
  LAcctData
   *ed = NULL;

  //  no verification of valid input
  acctPage.setAcctData();
  //  get the stuff from general page
  fillPage(acctPage);
  if (numberOfMatchElements() == 0) return *this;

  emptyBagMatchIds();

  // for each id get employeeData and see if a match

  idList.setFirstId();
  while (idList.getId(matchId)) {
    ed = new LAcctData(matchId);
    // see if a match by looping thru searchList
    if (setFirstSearchItem())
       lp = true;
    while ( lp && getSearchItem(key, value)) {
      lp = !aMatch(ed, key, value);
      getNextSearchItem();
    }
    if (!lp)
       // put this ID in the MatchList
       addMatchId(matchId);
    idList.getNextId();
    delete ed;
  }
  return *this;
};
// -------------------------------------------------------------------------
// QueryStatus :: getMatchList()
// -------------------------------------------------------------------------
QueryStatus& QueryStatus :: getMatchList(StatusPage &statusPage)
{
  //  no verification of valid input

  fillPage(statusPage);

  emptyBagMatchIds();

  // for each id get employeeData and see if a match
  IString
    matchId,
    key,
    range,
    value;

  Boolean
    match = false;

  LStatusData
   *bd = NULL;

  idList.setFirstId();
  while (idList.getId(matchId)) {
    bd = new LStatusData(matchId);
    // see if a match by looping thru searchList
    if (setFirstSearchItem())
       match = true;
    while ( match && getSearchItem(key, value, range)) {
      match = aMatch(bd, key, value, range);
      getNextSearchItem();
    }
    if (match)
       // put this ID in the MatchList
       addMatchId(matchId);

    idList.getNextId();
    delete bd;
  } /* endwhile */
  return *this;

};
Exemplo n.º 6
0
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
	QStringList arguments = qApp->arguments();
	Q_ASSERT_X(arguments.size() > 1, "AdiumWebView", "Application must be provide by single argument - path to theme");
	m_style.setStylePath(arguments.at(1));
	ui->comboBox->blockSignals(true);
	ui->comboBox->addItems(m_style.variants());
	ui->comboBox->setCurrentIndex(ui->comboBox->findText(m_style.activeVariant()));
	ui->comboBox->blockSignals(false);
	
	m_preview = WebKitPreviewLoader().loadPreview(SHARE_PATH + QLatin1String("Preview.plist"));
	
	{
		// QWebView
		fillPage(ui->webView->page());
//		QTimer::singleShot(1000, this, SLOT(onTimer()));
	}
	{
		// QDeclarativeView
//		QWebPage *page = new QWebPage(this);
//		qmlRegisterType<WebKitDeclarativeView>("org.adium", 0, 1, "WebChatView");
		QString baseHtml = m_style.baseTemplateForChat(m_preview->chat);
		ui->declarativeView->setResizeMode(QDeclarativeView::SizeRootObjectToView);
		QDeclarativeEngine *engine = ui->declarativeView->engine();
		QDeclarativeContext *context = engine->rootContext();
		QVariantMap data;
		data.insert("baseHtml", baseHtml);
		data.insert("scripts", contentScripts());
		context->setContextProperty("adiumData", data);
//		context->setContextProperty("adiumData", qVariantFromValue<QObject*>(page));
//		ui->declarativeView->setSource(SHARE_PATH + QLatin1String("qml/ChatView.qml"));
//		fillPage(page);
	}
//	fillPage(ui->webView->page());
}
Exemplo n.º 7
0
int main(void)
{
  int i = 0;
  float vx;
  float vy;
  DoubleInt dTemp;
  int count = 0;
  char temp[100];
  char tempStr[24];
  ssize_t ret = 0;
  Coords* c = NULL;
  ret = allocate(PAGE_SIZE, 0, (void**)(&c));
  if (ret != 0)
  {
    return (-1);
  }

  do
  {
    printfstr(STDOUT, "Initial Velocity X: ");
    ret = readLine(STDIN, temp, 100);
    if (ret < 0)
    {
      return (-1);
    }

    dTemp.d = strToDouble(temp);
  } while (dTemp.u == NAN.u);

  vx = (float)dTemp.d;

  do
  {
    printfstr(STDOUT, "Initial Velocity Y: ");
    ret = readLine(STDIN, temp, 100);
    if (ret < 0)
    {
      return (-1);
    }
   
    dTemp.d = strToDouble(temp);
  } while (dTemp.u == NAN.u);

  vy = (float)dTemp.d;

  printfstr(STDOUT, "Initial Count: ");
  ret = readLine(STDIN, temp, 100);
  if (ret < 0)
  {
    return (-1);
  }
  count = strToUint32(temp);

  do
  {
    fillPage(vx, vy, c, &count, 10);
    ret = readLine(STDIN, temp, 100);
    if (ret < 0)
    {
      return (-1);
    }
    if (temp[0] == 'p')
    {
      for (i = 0; i < 510; i++)
      {
        tempStr[0] = 'x';
        tempStr[1] = '=';
        tempStr[2] = '\0';
        snprintfloat(tempStr+2, 24, c[i].x);
        printfstr(STDOUT, tempStr);
        printfstr(STDOUT, ", ");
        tempStr[0] = 'y';
        tempStr[1] = '=';
        tempStr[2] = '\0';
        snprintfloat(tempStr+2, 24, c[i].y);
        printfstr(STDOUT, tempStr);
        printfstr(STDOUT, "\n");
      }
    }
  } while ( (temp[0] == 'c') || (temp[0] == 'p') );
}