Exemplo n.º 1
0
void NumberInputPad::slot_Close()
{
  m_timerButton->stop();
  m_timerDigit->stop();

  // Nothing should be changed, return initial number.
  emit numberEdited( m_setNumber );

  // Make a delay of 200 ms before the widget is closed to prevent undesired
  // selections in an underlaying list. Problem occurred on Galaxy S3.
  QTimer::singleShot(200, this, SLOT(slot_closeWidget()));
}
Exemplo n.º 2
0
UUpdateWidget::UUpdateWidget(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::UUpdateWidget)
{
    ui->setupUi(this);
	this->setAttribute(Qt::WA_DeleteOnClose,true);

    setFixedSize(size());

    ui->menubar->setHidden(true);
    ui->statusbar->setHidden(true);
    ui->toolBar->addAction(QPixmap(), "Install updates", this, SLOT(slot_downloadFileFinished()));
    ui->toolBar->addAction(QPixmap(), "Quit", this, SLOT(slot_closeWidget()));
    ui->toolBar->addSeparator();
    ui->toolBar->addAction(QPixmap(), "Check updates", this, SLOT(slot_checkUpdates()));

    m_toolBarActions = ui->toolBar->actions();
    m_toolBarActions.at(eINSTALL_UPDATES_ACTION)->setEnabled(false);

    m_stackedWidget = new QStackedWidget(this);
    m_checkUpdatesWidget = new UCheckUpdatesWidget(m_stackedWidget);
    m_updatesTableView = new UUpdatesTableView(m_stackedWidget);

    m_stackedWidget->addWidget(new QWidget(m_stackedWidget));
    m_stackedWidget->addWidget(m_checkUpdatesWidget);
    m_stackedWidget->addWidget(m_updatesTableView);

    m_stackedWidget->setCurrentIndex(0);

    setCentralWidget(m_stackedWidget);

    connect(m_checkUpdatesWidget,   SIGNAL(signal_processUpdatesFinished(UUpdatesModel *)),
            this,                   SLOT(slot_showUpdatesTable(UUpdatesModel *)));
    connect(m_checkUpdatesWidget,   SIGNAL(signal_downloadFailed(QString)),
            this,                   SLOT(slot_checkUpdatesFailed(QString)));

    m_downloader = new UFileDownloader;

    connect(m_downloader,   SIGNAL(signal_downloadFileFinished()),
            this,           SLOT(slot_downloadFileFinished()));
    connect(m_downloader,   SIGNAL(signal_error(QString)),
            this,           SLOT(slot_error(QString)));

    m_currentDownloadFile = -1;

    connect(this,   SIGNAL(signal_downloadUpdatesFinished()),
            this,   SLOT(slot_installUpdates()));
}
Exemplo n.º 3
0
void NumberInputPad::slot_Ok()
{
  m_timerButton->stop();
  m_timerDigit->stop();

  const QValidator* validator = m_editor->validator();

  QString value = m_editor->text().trimmed();

  if( value.isEmpty() )
    {
      // Empty value is not allowed as ok.
      return;
    }

  int pos = 0;

  if( validator != 0 )
    {
      if( validator->validate( value, pos ) == QValidator::Acceptable )
        {
          emit numberEdited( value );
        }
      else
        {
          // Validator said nok, do not return.
          return;
        }
    }
  else
    {
      // Return edited number.
      emit numberEdited( value );
    }

  // Make a delay of 200 ms before the widget is closed to prevent undesired
  // selections in an underlaying list. Problem occurred on Galaxy S3.
  QTimer::singleShot(200, this, SLOT(slot_closeWidget()));
}