Exemplo n.º 1
0
void initClock( )
{
  int bTimerActif = (timerId != -1);
  int r,c;
  int o = 0;
#ifdef STARTSTOP
  button_t *pBut;
#else
  o = 16;
#endif

  //pClockStyleUpdate = Style70sUpdate;
  //pClockStyleDraw = Style70sDraw;

  pClockStyleUpdate = StyleIkeaUpdate;
  pClockStyleDraw = StyleIkeaDraw;

  destroyAllButtons( );

  buttonCreate( 0,0,SCREEN_HEIGHT,SCREEN_HEIGHT, TRANSPARENT_KEY, "", actionGoMatrix );

  r = 0;c = 4;
  durationButton = getButton( buttonCreate( 5+c*80, 5+r*80+o, 75+(c+1)*80, 75+r*80+o, 
    BLACK, 
    durationInSecToText( bTimerActif ? ( 1 + getTimerRemainingTime( timerId ) / 1000 ) : timerDuration / 1000 ),
    actionAcknowledgeTimer ));
  durationButton->lit = 0;

  if( reminders >= 0 && durationButton->timer == -1 )
  {
    durationButton->timer = syncTimerSetTimer( 750, blinkButtonTimer, durationButton, 0 );
  }

  r = 1;c = 4;
  decreaseButton = getButton( buttonCreate( 5+c*80, 5+r*80+o, 75+c*80, 75+r*80+o, BLUE, "-", actionDecreaseTimer ));
  decreaseButton->lit = !bTimerActif;
  
  r = 1;c = 5;
  increaseButton = getButton( buttonCreate( 5+c*80, 5+r*80+o, 75+c*80, 75+r*80+o, RED, "+", actionIncreaseTimer ));
  increaseButton->lit = !bTimerActif;

#ifdef STARTSTOP
  r = 2;c = 4;
  pBut = getButton( buttonCreate( 5+c*80, 5+r*80+o, 75+(c+1)*80, 75+r*80+o, 
     bTimerActif ? YELLOW : GREEN, 
     bTimerActif ? "STOP" : "START", 
     actionStartTimer ));
  pBut->lit = 1;
#endif
}
Exemplo n.º 2
0
/* Add a button to the widget screen */
bool widgAddButton(W_SCREEN *psScreen, const W_BUTINIT* psInit)
{
	W_BUTTON	*psButton;
	W_FORM		*psForm;

	ASSERT( psScreen != NULL,
		"widgAddButton: Invalid screen pointer" );

	if (widgCheckIDForm((W_FORM *)psScreen->psForm,psInit->id))
	{
		ASSERT( false, "widgAddButton: ID number has already been used(%d)", psInit->id );
		return false;
	}

	/* Find the form to put the button on */
	if (psInit->formID == 0)
	{
		psForm = (W_FORM *)psScreen->psForm;
	}
	else
	{
		psForm = (W_FORM *)widgGetFromID(psScreen, psInit->formID);
		if (psForm == NULL || psForm->type != WIDG_FORM)
		{
			ASSERT( false,
				"widgAddButton: Could not find parent form from formID" );
			return false;
		}
	}

	/* Create the button structure */
	psButton = buttonCreate(psInit);
	if (psButton == NULL
	/* Add it to the form */
	 || !formAddWidget(psForm, (WIDGET *)psButton, (W_INIT *)psInit))
	{
		return false;
	}

	return true;
}
    ui.pushButton_create->setText(tr("Create"));
    ui.pushButton_remove->setText(tr("Remove"));
    ui.toolButton_options->setText(tr("Options"));
    ui.buttonBox->button(QDialogButtonBox::Close)->setText(tr("Close"));

    QMenu *optionsMenu = new QMenu(this);
    optionsMenu->addAction(QIcon(":/images/breeze/legalmoves.svg"), tr("Join"), this, SLOT(join()));
    optionsMenu->addAction(QIcon(":/images/settings.svg"), tr("Settings"), this, SLOT(settings()));

    ui.toolButton_options->setMenu(optionsMenu);
}

void ChannelHomesGui::createSignals()
{
    connect(ui.listWidget_channels, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(itemClicked(QListWidgetItem*)));
    connect(ui.pushButton_create, SIGNAL(clicked()), this, SLOT(buttonCreate()));
    connect(ui.pushButton_remove, SIGNAL(clicked()), this, SLOT(buttonRemove()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
}

void ChannelHomesGui::refresh()
{
    // ready
    if (ChannelHomes::instance()->getStatus() != StatusCompleted)
    {
        QTimer::singleShot(200, this, SLOT(refresh())); // 0.2 sec
        return;
    }

    ui.listWidget_channels->clear();