Ejemplo n.º 1
0
ProfileView::ProfileView(QWidget *parent, const Utente *model_) :
    QWidget(parent), model(model_)
{
    firstname=new QLabel("Nome:",this);
    lastname=new QLabel("Cognome:",this);
    date=new QLabel("Data di Nascita:",this);
    sex=new QLabel("Sesso:",this);
    res_address=new QLabel("Indirizzo civico: ",this);
    res_town=new QLabel("Città: ",this);
    res_region=new QLabel("Regione: ",this);
    country=new QLabel("Nazione:",this);
    profession=new QLabel("Professione:", this);
    language=new QLabel("Lingue:",this);
    number=new QLabel("Telefono:",this);
    email=new QLabel("Email:",this);

    box_firstname=new QLineEdit(this);
    box_lastname=new QLineEdit(this);
    box_date=new QLineEdit(this);
    box_date->setReadOnly(true);
    box_sex=new QComboBox(this);
    QStringList sex_;
    sex_<<"Maschio"<<"Femmina";
    box_sex->addItems(sex_);
    box_res_town=new QLineEdit(this);
    box_res_region=new QLineEdit(this);
    box_res_address=new QLineEdit(this);
    box_country=new QLineEdit(this);
    box_profession=new QLineEdit(this);
    box_language=new QLineEdit(this);
    box_number=new QLineEdit(this);
    box_email=new QLineEdit(this);

    titles_table=new TableRemIns(this, "Titoli di Studio");
    experiences_table=new TableRemIns(this, "Esperienze");

    box_date_calendar=new QCalendarWidget(this);
    box_date_calendar->setDisabled(true);
    box_date_calendar->setToolTip("Seleziona il mese, l'anno e il giorno \nper aggiornare la tua data");
    box_date_calendar->setToolTipDuration(3000);
    connect(box_date_calendar,SIGNAL(clicked(QDate)),this,SLOT(updateDate()));
    connect(box_date_calendar,SIGNAL(selectionChanged()),this,SLOT(updateDate()));

    showProfileUser();
    disableModify();

    //Layout
    layout=new QGridLayout(this);
    createLayout();

    setLayout(layout);
    setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    //centerWidget();
}
Ejemplo n.º 2
0
void OrderBook::update(OrderBookUpdate orderBookUpdate)
{
    QMutableListIterator<LimitOrder> it(asks_);
    if(orderBookUpdate.getLimitOrder().getType() == Order::ASK) {
        // it = QMutableListIterator<LimitOrder>(asks); // already initialized
    }
    else {
        it = QMutableListIterator<LimitOrder>(bids_);
    }
    while(it.hasNext()) {
        if(it.next().getLimitPrice() == orderBookUpdate.getLimitOrder().getLimitPrice()) {
            it.remove();
            break;
        }
    }

    if(orderBookUpdate.getTotalVolume() > 0.0) {
        if(orderBookUpdate.getLimitOrder().getType() == Order::ASK) {
            asks_.append(orderBookUpdate.getLimitOrder());
            qSort(asks_);
        }
        else {
            bids_.append(orderBookUpdate.getLimitOrder());
            qSort(bids_);
        }
    }
    updateDate(orderBookUpdate.getLimitOrder().getTimestamp());
}
Ejemplo n.º 3
0
void availableRoomsWindow::on_book_pushButton_clicked()
{
    updateDate();
    int result = bookingDlg->exec();
    qDebug() << "result: " << result;
    performAvailableRoomsSearch();
}
Ejemplo n.º 4
0
void RecipeExtrasWidget::saveAll()
{
   //recObs->disableNotification();

   updateBrewer();
   updateBrewerAsst();
   updateTasteRating();
   updatePrimaryAge();
   updatePrimaryTemp();
   updateSecondaryAge();
   updateSecondaryTemp();
   updateTertiaryAge();
   updateTertiaryTemp();
   updateAge();
   updateAgeTemp();
   updateDate();
   updateCarbonation();
   updateTasteNotes();
   updateNotes();

   //recObs->reenableNotification();
   //recObs->forceNotify();

   hide();
}
void execute_timestep ()
{
  static Uint32 oldTime = SDL_GetTicks();
  Uint32 now=SDL_GetTicks();
  Uint32 mStepTime=( lincitySpeed *1000/NUMOF_DAYS_IN_YEAR); 

  if( lincitySpeed == 0 || blockingDialogIsOpen
        || ( (now - oldTime < (mStepTime-10)) && (lincitySpeed != FAST_TIME_FOR_YEAR)) ) {
      SDL_Delay(10); //don't burn cpu in active loop
      return;
  }
  if ( (now - oldTime < mStepTime) && lincitySpeed != FAST_TIME_FOR_YEAR  )
    return; // skip frame
  oldTime = now;

  //  TRACE;
  do_time_step();

  //draw the updated city
  //in FAST-Mode, update at the last day in Month, so print_stats will work.
  if( ( lincitySpeed != FAST_TIME_FOR_YEAR ) || 
          ( total_time % ( NUMOF_DAYS_IN_MONTH * getConfig()->skipMonthsFast ) == (NUMOF_DAYS_IN_MONTH - 1) ) ){
    //update_main_screen (0); //does nothing in NG
    print_stats ();
    updateDate();
    print_total_money();
    getGameView()->requestRedraw();
  }
}
Ejemplo n.º 6
0
void OrderBook::update(const LimitOrder &limitOrder)
{
    if(limitOrder.getType() == Order::ASK) {
        QMutableListIterator<LimitOrder> it(asks_);
        while(it.hasNext()) {
            if(it.next().getLimitPrice() == limitOrder.getLimitPrice())  {
                 it.remove();
                 break;
            }
        }
        asks_.append(limitOrder);
        qSort(asks_);
    }
    else {
        QMutableListIterator<LimitOrder> it(bids_);
        while(it.hasNext()) {
            if(it.next().getLimitPrice() == limitOrder.getLimitPrice()) {
                it.remove();
                break;
            }
        }
        bids_.append(limitOrder);
        qSort(bids_);
    }
    updateDate(limitOrder.getTimestamp());
}
Ejemplo n.º 7
0
DateLineEdit::DateLineEdit(QWidget *parent) :
    TextLineEdit(parent)
{
    this->setValidator(new QRegularExpressionValidator(regEx));
    this->setInputMethodHints(Qt::ImhDialableCharactersOnly);

    connect(this, SIGNAL(editingFinished()), this, SLOT(updateDate()));
}
Ejemplo n.º 8
0
void lemon::updateClock()
{
  QTime time = QTime::currentTime();
  QString text = time.toString("hh:mm");
  if ((time.second() % 2) == 0)
    text[2] = '.';
  labelTime->setText(text);
  if ((time.hour()==0) && (time.minute()==0) && (time.second()==0) ) updateDate();
}
Ejemplo n.º 9
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimFileWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
    RimWellPath::defineUiOrdering(uiConfigName, uiOrdering);
    
    caf::PdmUiGroup* fileInfoGroup =    uiOrdering.createGroupBeforeGroup("Simulation Well", "File");
    fileInfoGroup->add(&m_filepath);
    fileInfoGroup->add(&m_wellPathIndexInFile);

    if ( !id().isEmpty() )           uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &id);
    if ( !sourceSystem().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &sourceSystem);
    if ( !utmZone().isEmpty() )      uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &utmZone);
    if ( !updateDate().isEmpty() )   uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &updateDate);
    if ( !updateUser().isEmpty() )   uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &updateUser);
    if ( !m_surveyType().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &m_surveyType);
}
Ejemplo n.º 10
0
// Start point
int main(void) {
	struct date d;
	
	printf("Initialize date (DD/MM/YYYY) > ");
	scanf("%i/%i/%i", &d.day, &d.month, &d.year);

	while(true)
	{
		displayDate(d);
		d = updateDate(d);
		getchar();
	}
	
	return 0;
}
Ejemplo n.º 11
0
void lemon::updateClock()
{
  QTime time = QTime::currentTime();
  QString text = time.toString("hh:mm");
  if ((time.second() % 2) == 0)
    text[2] = '.';
  labelTime->setText(text);
  if ((time.hour()==0) && (time.minute()==0) && (time.second()==0) ) updateDate();

  ///On kde 4.3 some bug resizes the window and the taskbar over mainview. I dont want taskbar, it means full screen is deactivated. How can we set fullScreen MODE?
  if (geometry() != QApplication::desktop()->screenGeometry(this)) {
    //qDebug()<<"FIXING WINDOW SIZE from:"<<geometry();
    //setGeometry(QApplication::desktop()->screenGeometry(this));
    //Doing this the size is fixed but the taskbar is show over mainview
  }
}
Ejemplo n.º 12
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    clock = new QTimer;
    clock->setInterval(1000);
    connect(clock,SIGNAL(timeout()),
            this,SLOT(updateTime()));
    connect(clock,SIGNAL(timeout()),
            this,SLOT(updateDate()));
    clock->start();



}
Ejemplo n.º 13
0
void ProfileView::showProfileUser() {
    box_firstname->setText(model->getNome());
    box_lastname->setText(model->getCognome());
    box_date_calendar->setSelectedDate(model->getData());
    updateDate();
    if(model->getSesso()) //maschio
        box_sex->setCurrentIndex(1);
    else //femmina
        box_sex->setCurrentIndex(0);
    box_res_address->setText(model->getResidenza().getIndirizzo());
    box_res_town->setText(model->getResidenza().getComune());
    box_res_region->setText(model->getResidenza().getRegione());
    box_country->setText(model->getPaese());
    box_profession->setText(model->getProfessione());
    box_language->setText(model->getLingue());
    box_number->setText(model->getNumero());
    box_email->setText(model->getMail());
    titles_table->setElements(model->getTitoli());
    experiences_table->setElements(model->getEsperienze());
}
Ejemplo n.º 14
0
void ImageDescEditTab::setInfos(const ImageInfoList& infos)
{
    if (infos.isEmpty())
    {
        d->hub = DisjointMetadata();
        d->captionsEdit->blockSignals(true);
        d->captionsEdit->reset();
        d->captionsEdit->blockSignals(false);
        d->titleEdit->blockSignals(true);
        d->titleEdit->reset();
        d->titleEdit->blockSignals(false);
        d->currInfos.clear();
        resetMetadataChangeInfo();
        setEnabled(false);
        return;
    }

    setEnabled(true);
    d->currInfos = infos;
    d->modified  = false;
    resetMetadataChangeInfo();
    d->hub       = DisjointMetadata();
    d->applyBtn->setEnabled(false);
    d->revertBtn->setEnabled(false);

    foreach(const ImageInfo& info, d->currInfos)
    {
        d->hub.load(info);
    }

    updateComments();
    updatePickLabel();
    updateColorLabel();
    updateRating();
    updateDate();
    updateTemplate();
    updateTagsView();
    updateRecentTags();
    setFocusToLastSelectedWidget();
}
Ejemplo n.º 15
0
MyCalendar::MyCalendar(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MyCalendar)
{
    ui->setupUi(this);
    codec = QTextCodec::codecForName("Big5");
    clock = new QTimer;
    clock->setInterval(10000);
    file  = new QFile("userEvent.txt");
    ui->scheduleTable->setRowCount(25);
    ui->scheduleTable->setColumnCount(8);
    ui->searchName->setText(codec->toUnicode("請輸入標題"));
    date = date.currentDateTime();
    updateDate();
    addTimeInterval();
    readHistory();
    updateCalendar();
    updateTime();
    connect(clock, SIGNAL(timeout()),this, SLOT(updateTime()));
    connect(clock, SIGNAL(timeout()), this, SLOT(checkScheduleTime()));
    clock->start();
    ui->currentTime->setText(currentTime.toString("yyyy/MM/dd hh:mm"));

}
Ejemplo n.º 16
0
//For a frameless window: KMainWindow(0, Qt::FramelessWindowHint)
lemon::lemon()
  : KXmlGuiWindow(0,Qt::FramelessWindowHint),
      m_view(new lemonView(this))
{
    setObjectName(QLatin1String("lemon"));
    setAcceptDrops(false);
    // tell the KMainWindow that this is indeed the main widget
    setCentralWidget(m_view);
    // then, setup our actions
    setupActions();
    // Add typical actions and save size/toolbars/statusbar
    statusBar()->show();
    //add some info labels to status bar
    labelUserInfo = new QLabel("::user::");
    labelDate = new QLabel(" ::Date:: ");
    labelTime = new QLabel(" ::Time:: ");
    labelTransaction = new QLabel("");
    QLabel *imageUser = new QLabel("user");
    QLabel *imageDate = new QLabel("date");
    QLabel *imageTime = new QLabel("time");
    QLabel *imageTransaction = new QLabel("trans");
    imageUser->setPixmap(DesktopIcon("user-identity", 16));
    imageDate->setPixmap(DesktopIcon("view-pim-calendar", 16));
    imageTime->setPixmap(DesktopIcon("chronometer", 16));
    imageTransaction->setPixmap(DesktopIcon("wallet-open", 16));
    updateDate();
    statusBar()->addWidget(imageUser);
    statusBar()->addWidget(labelUserInfo);
    statusBar()->addWidget(imageDate);
    statusBar()->addWidget(labelDate);
    statusBar()->addWidget(imageTime);
    statusBar()->addWidget(labelTime);
    statusBar()->addWidget(imageTransaction);
    statusBar()->addWidget(labelTransaction);
    connect(m_view, SIGNAL(signalLoggedUser()), SLOT(updateUserName()) );
    connect(m_view, SIGNAL(signalNoLoggedUser()), SLOT(updateUserName())  );
    connect(m_view, SIGNAL(signalUpdateClock() ), SLOT(updateClock()) );
    QTimer::singleShot(500, this,  SLOT(hideMenuBar()));

    // apply the saved mainwindow settings, if any, and ask the mainwindow
    // to automatically save settings if changed: window size, toolbar
    // position, icon size, etc.
    setAutoSaveSettings();

    connect(m_view,SIGNAL(signalChangeStatusbar(const QString&)),this,SLOT(changeStatusbar(const QString&)));
    connect(m_view,SIGNAL(signalChangeCaption(const QString&)),this, SLOT(changeCaption(const QString&)));
    connect(m_view, SIGNAL(signalAdminLoggedOn()), this, SLOT(enableConfig()));
    connect(m_view, SIGNAL(signalAdminLoggedOff()), this, SLOT(disableConfig()));
    connect(m_view, SIGNAL(signalSupervisorLoggedOn()), this, SLOT(enableConfig())); //new
    connect(m_view, SIGNAL(signalSupervisorLoggedOff()), this, SLOT(disableConfig())); //new
    connect(m_view, SIGNAL(signalNoLoggedUser()), this, SLOT(disableUi()));
    connect(m_view, SIGNAL(signalLoggedUser()), this, SLOT(reactOnLogOn()));
    connect(m_view, SIGNAL(signalStartedOperation()), this, SLOT(reactOnStartedOp()) );
    connect(m_view, SIGNAL(signalUpdateTransactionInfo()), this, SLOT(updateTransaction()));
    connect(m_view, SIGNAL(signalShowProdGrid()), this, SLOT(triggerGridAction()));
    connect(m_view, SIGNAL(signalShowDbConfig()), this, SLOT(showDBConfigDialog()));

    connect(m_view, SIGNAL(signalEnableUI()), this, SLOT(enableUi()) );
    connect(m_view, SIGNAL(signalDisableUI()), this, SLOT(disableUi()) );

    connect(m_view, SIGNAL(signalEnableStartOperationAction()), this, SLOT(enableStartOp()) );

    loadStyle();
    disableConfig();
    disableUi();

}
Ejemplo n.º 17
0
// create UI and use screen size to determine text sizes
void Widget::LoadUInow()
{

    LoadUI->stop();

    frameHeight = ui->tabWidget->height();
    frameWidth = ui->tabWidget->width();
    int bigtext = 72*frameHeight/470;
    int midtext = 18*frameHeight/470;
    qDebug() << ui->tabWidget->height();
    qDebug() << ui->tabWidget->width();

    //apply sprite to scrollwheel and startpoint
    ui->scrollWheel->setSkin("Beryl");
    ui->scrollWheel->setValue(75);

    //web zoom
    zoomfac=1.0;

    //Timers
    timerTick = 0;
    dateTimer = new QTimer(this);
    connect(dateTimer, SIGNAL(timeout()), this, SLOT(updateDate()));
    dateTimer->start(1000);

    slideshowTick=1;
    slideshowTimer = new QTimer(this);
    connect(slideshowTimer, SIGNAL(timeout()), this, SLOT(updateSlideshow()));
    slideshowTimer->start(5000);

    serverTick=0;
    serverTimer = new QTimer(this);
    connect(serverTimer, SIGNAL(timeout()),this,SLOT(updateServer()));
    serverTimer->start(200);

    addfdegree=trUtf8("\u00b0") + "F";

    //Update Text Size
    QFont fontbig;
    fontbig.setPointSize(bigtext);
    fontbig.setBold(true);

    QFont fontmid;
    fontmid.setPointSize(midtext);
    fontmid.setBold(true);

    QFont tabsize;
    tabsize.setPointSize(26*frameHeight/470);
    tabsize.setBold(true);
    ui->tabWidget->setFont(tabsize);


    ui->tempLabel->setFont(fontbig);
    ui->tempLabel->setText("75.0"+trUtf8("\u00b0") + "F");

    ui->timeLabel->setFont(fontmid);
    ui->dateLabel->setFont(fontmid);
    ui->centerinfolabel->setFont(fontmid);


    //connect the scrollwheel to LCD
    connect(ui->scrollWheel, SIGNAL(valueChanged(int)), ui->setpointlcdNumber, SLOT(display(int)));

    //Settings page
    ui->wdaylabel->setFont(fontmid);
    ui->wlowlabel->setFont(fontmid);
    ui->whighlabel->setFont(fontmid);
    ui->wsetlabel->setFont(fontmid);
    ui->day1label->setFont(fontmid);
    ui->day2label->setFont(fontmid);
    ui->day3label->setFont(fontmid);

    fontmid.setBold(false);

    ui->high1label->setFont(fontmid);
    ui->high2label->setFont(fontmid);
    ui->high3label->setFont(fontmid);
    ui->low1label->setFont(fontmid);
    ui->low2label->setFont(fontmid);
    ui->low3label->setFont(fontmid);




    // Get images from filesystem
    // store filenames in a file called filenames
    system("ls -1 /usr/share/matrix-gui-2.0/apps/qt_tstat/tstatimages > filenames");
    FILE *file;
    file = fopen("filenames", "r");
    int  i=0;
    char line[100];
    while(fgets(line, sizeof line, file)!=NULL) {
        filenames[i]=line;
        i++;
    }
    totalNums = i;
    fclose(file);


    // Connect FanSettingHangler
    // Multiple Signals to one Slot
    connect ( ui->autoButton, SIGNAL( clicked() ), this, SLOT( FanSettingHandler() ) );
    connect ( ui->highButton, SIGNAL( clicked() ), this, SLOT( FanSettingHandler() ) );
    connect ( ui->lowButton, SIGNAL( clicked() ), this, SLOT( FanSettingHandler() ) );
    connect ( ui->offButton, SIGNAL( clicked() ), this, SLOT( FanSettingHandler() ) );
    // name is needed to communicate with webserver
    ui->autoButton->setProperty("name","auto");
    ui->highButton->setProperty("name","high");
    ui->lowButton->setProperty("name","low");
    ui->offButton->setProperty("name","off");
    fanstate = "auto";


    // Update Logo Size
    qDebug() << ui->logoBox->geometry() << "  " << ui->logoBox->height();
    QString logofilepath;
    QPixmap piclogo;
    logofilepath = "/usr/share/matrix-gui-2.0/apps/qt_tstat/appimages/logo.png";
    piclogo.load( logofilepath);
    piclogo = piclogo.scaledToHeight( ui->logoBox->height()/2, Qt::SmoothTransformation ); //
    ui->logoLabel->setPixmap(piclogo);
    //ui->logoLabel->setMask(piclogo.mask());

}
Ejemplo n.º 18
0
void updateChopperDrop(ChopperDrop* game)
{
	int ipc_status;
	message msg;

	resetTickedFlag(game->timer);

	if (driver_receive(ANY, &msg, &ipc_status) != 0)
		return;

	if (is_ipc_notify(ipc_status))
	{
		switch (_ENDPOINT_P(msg.m_source))
		{
		case HARDWARE:
			// Keyboard
			if (msg.NOTIFY_ARG & game->IRQ_SET_KB)
				game->scancode = readFromKBC(0);

			// Timer
			if (msg.NOTIFY_ARG & game->IRQ_SET_TIMER)
				timerHandler(game->timer);

			// Mouse
			if (msg.NOTIFY_ARG & game->IRQ_SET_MOUSE)
				updateMouse();

			// RTC
			if (msg.NOTIFY_ARG & game->IRQ_SET_RTC)
				updateDate(game->date);
			break;
		default:
			break;
		}
	}

	if (game->timer->ticked)
	{
		// Update game states and mouse at 60 FPS

		getMouse()->draw = 1;

		switch(game->currentState)
		{
		case MAIN_MENU_STATE:
			updateMainMenuState(game->state, game->scancode);
			break;
		case GAME_STATE:
			updateGameState(game->state, game->scancode, game->timer->counter);
			break;
		case GAME_OVER_STATE:
			updateGameOverState(game->state, game->scancode);
			break;
		case GAME_WON_STATE:
			updateGameWonState(game->state, game->scancode);
			break;
		default:
			break;
		}

		game->scancode = 0;
		game->draw = 1;
	}

	checkIfStateIsDone(game);
}