Exemplo n.º 1
0
void MainWindow::open()
{
	if(m_VectorRatingWidget.isEmpty())
	{
		m_FileNameOpen = QFileDialog::getOpenFileName(this,tr("Otwórz..."), "/home/", tr("Pliki glinka (*.glinka)"));

		if (!m_FileNameOpen.isEmpty())
			createTabWidgetOpen(m_FileNameOpen);
	}
	else if(!m_VectorRatingWidget.isEmpty())
	{
		int ret = QMessageBox::warning(this, tr(""), tr("Zapisać plik?"),
									   QMessageBox::Ok | QMessageBox::Cancel,
									   QMessageBox::Ok);
		if (ret==QMessageBox::Ok)
		{
			save();
			m_FileNameOpen.clear();
		}

		m_FileNameOpen = QFileDialog::getOpenFileName(this,tr("Otwórz..."), "/home/", tr("Pliki glinka (*.glinka)"));

		if (!m_FileNameOpen.isEmpty())
		{
			clearWidget();
			createTabWidgetOpen(m_FileNameOpen);
		}
	}

	if (!m_FileNameOpen.isEmpty())
		setCentralWidget(m_TabWidget);
}
Exemplo n.º 2
0
/* --------------------------------------------------------------------
* FUNCTION NAME: Draw
* DESCRIPTION  : Draws Combobox on console, will check whether to draw
*				  One label or the entire combobox using _isOpen.
* RETURN       : None.
* NOTES        : Polymorphic function - inherited from Widget.
* -------------------------------------------------------------------- */
void ComboBox::Draw(COORD CursorPosition, const HANDLE& console)
{
	if (!_comboNames.size())
		return;
	if (!_isSorted) {
		SortArray();
	}
	strVecItr itr = _comboNames.begin();
	if (!_isOpen) {
		_isOpen = true;
		CursorPosition = GetCoord();
		clearWidget(CursorPosition, console, GetLongestString() + 6, _comboNames.size()*HEIGHT_OF_CELL);
		while (itr->index != _selected)
			itr++;
		DrawItem(CursorPosition, console, itr, true);
	}
	else {
		while (itr != _comboNames.end())
		{
			_isOpen = false;
			if (itr->index == _selected)
				DrawItem(CursorPosition, console, itr, true);
			else
				DrawItem(CursorPosition, console, itr, false);
			CursorPosition.Y += 2;
			++itr;
		}
	}
}
Exemplo n.º 3
0
void RenderWidget::setWidget(PassRefPtr<Widget> widget)
{
    if (widget == m_widget)
        return;

    if (m_widget) {
        moveWidgetToParentSoon(m_widget.get(), 0);
        clearWidget();
    }
    m_widget = widget;
    if (m_widget) {
        // If we've already received a layout, apply the calculated space to the
        // widget immediately, but we have to have really been fully constructed (with a non-null
        // style pointer).
        if (style()) {
            if (!needsLayout())
                updateWidgetGeometry();

            if (style()->visibility() != VISIBLE)
                m_widget->hide();
            else {
                m_widget->show();
                repaint();
            }
        }
        moveWidgetToParentSoon(m_widget.get(), m_frameView);
    }

    if (AXObjectCache* cache = document().existingAXObjectCache())
        cache->childrenChanged(this);
}
Exemplo n.º 4
0
void RenderWidget::setWidget(PassRefPtr<Widget> widget)
{
    if (widget != m_widget) {
        if (m_widget) {
            m_widget->removeFromParent();
            widgetRendererMap().remove(m_widget.get());
            clearWidget();
        }
        m_widget = widget;
        if (m_widget) {
            widgetRendererMap().add(m_widget.get(), this);
            // if we've already received a layout, apply the calculated space to the
            // widget immediately, but we have to have really been full constructed (with a non-null
            // style pointer).
            if (style()) {
                if (!needsLayout())
                    setWidgetGeometry(absoluteContentBox());
                if (style()->visibility() != VISIBLE)
                    m_widget->hide();
                else
                    m_widget->show();
            }
            m_frameView->addChild(m_widget.get());
        }
    }
}
Exemplo n.º 5
0
SettingsItem::~SettingsItem()
{
	Q_D(SettingsItem);
	Settings::removeItem(this);
	clearWidget();
	if (d->gen)
		delete d->gen;
}
Exemplo n.º 6
0
PlaybackWidget::PlaybackWidget(DataStore *dataStore, QWidget *parent):
  QWidget(parent), dataStore(dataStore), currentPlaybackState(PLAYING)
{
  audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
  mediaObject = new Phonon::MediaObject(this);
  createActions();
  setupUi();

  mediaObject->setTickInterval(1000);
  connect(mediaObject, SIGNAL(tick(qint64)), this, SLOT(tick(qint64)));
  connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
    this, SLOT(stateChanged(Phonon::State, Phonon::State)));
  connect(mediaObject, SIGNAL(currentSourceChanged(Phonon::MediaSource)),
    this, SLOT(sourceChanged(Phonon::MediaSource)));
  connect(mediaObject, SIGNAL(finished()), this, SLOT(playNextSong()));
  connect(
    mediaObject,
    SIGNAL(metaDataChanged()),
    this,
    SLOT(metaDataChanged()));
  connect(
    dataStore,
    SIGNAL(manualSongChange(Phonon::MediaSource)),
    this,
    SLOT(setNewSource(Phonon::MediaSource)));

  connect(
    dataStore,
    SIGNAL(eventEnded()),
    this,
    SLOT(clearWidget()));

  connect(
    dataStore,
    SIGNAL(eventCreated()),
    this,
    SLOT(enablePlayback()));

  connect(
    dataStore,
    SIGNAL(eventEnded()),
    this,
    SLOT(disablePlayback()));

  connect(
    dataStore,
    SIGNAL(activePlaylistModified()),
    this,
    SLOT(handlePlaylistChange()));

  Phonon::createPath(mediaObject, audioOutput);
  dataStore->isCurrentlyHosting() ? setEnabled(true) : setEnabled(false);
  playNextSong();
}
Exemplo n.º 7
0
void MainWindow::news()
{
	bool ok;

	int numberWindings;

	if(m_VectorRatingWidget.isEmpty())
	{
		numberWindings = QInputDialog::getInt(this, tr("QInputDialog::getInteger()"),
									 tr("Podaj ilość uzwojeń:"), 2, 0, 100, 1, &ok);
		if (ok)
			createTabWidgetNew(numberWindings);
	}
	else if (!m_VectorRatingWidget.isEmpty())
	{
		int ret = QMessageBox::warning(this, tr(""), tr("Zapisać plik?"),
									   QMessageBox::Ok | QMessageBox::Cancel,
									   QMessageBox::Ok);
		if (ret==QMessageBox::Ok)
		{
			save();
		}

		numberWindings = QInputDialog::getInt(this, tr("QInputDialog::getInteger()"),
									 tr("Podaj ilość uzwojeń:"), 2, 0, 100, 1, &ok);
		if (ok)
		{
			clearWidget();
			createTabWidgetNew(numberWindings);
			m_FileNameOpen.clear();
		}
	}

	if (ok)
		setCentralWidget(m_TabWidget);
}
Exemplo n.º 8
0
void CQArrayAnnotationsWidget::setArrayAnnotation(const CArrayAnnotation * pArray)
{
#ifdef DEBUG_UI
  qDebug() << "-- in setArrayAnnotation -- \n";
#endif

  mpArray = pArray;

  if (!mpArray)
    {
      mSelectedCell.clear();
      clearWidget();
      return;
    }

  QStringList Items;
  size_t i = 0, imax = mpArray->dimensionality();

  for (; i != imax; i++)
    {
      Items.append(FROM_UTF8(mpArray->getDimensionDescription(i)));
    }

  mpComboRows->blockSignals(true);
  mpComboRows->clear();
  mpComboRows->addItems(Items);
  mpComboRows->blockSignals(false);

  mpComboColumns->blockSignals(true);
  mpComboColumns->clear();
  mpComboColumns->addItems(Items);
  mpComboColumns->blockSignals(false);

  mSelectionIndex.resize(imax);
  CCopasiAbstractArray::index_type::iterator it = mSelectionIndex.begin();
  CCopasiAbstractArray::index_type::iterator end = mSelectionIndex.end();

  mSelectedCell.resize(imax);
  CCopasiAbstractArray::index_type::iterator itCell = mSelectedCell.begin();

  for (; it != end; ++it)
    {
      *it = 0;
      *itCell = 0;
    }

  switch (imax)
    {
      case 0:
        mpLblRows->hide();
        mpComboRows->hide();
        mpLblColumns->hide();
        mpComboColumns->hide();
        mpLblOther->hide();
        mpSelectionTable->hide();

        mRowIndex = C_INVALID_INDEX;
        mColIndex = C_INVALID_INDEX;

        fillTable0();
        break;

      case 1:
        mpLblRows->show();
        mpComboRows->show();
        mpLblColumns->hide();
        mpComboColumns->hide();
        mpLblOther->hide();
        mpSelectionTable->hide();

        slotRowSelectionChanged(0);
        break;

      case 2:
        mpLblRows->show();
        mpComboRows->show();
        mpLblColumns->show();
        mpComboColumns->show();
        mpLblOther->hide();
        mpSelectionTable->hide();

        slotRowSelectionChanged(0);
        break;

      default:
        mpLblRows->show();
        mpComboRows->show();
        mpLblColumns->show();
        mpComboColumns->show();
        mpLblOther->hide();
        mpSelectionTable->hide();

        // TODO CRITICAL We need to fill the selection table.
        slotRowSelectionChanged(0);
        break;
    }
}
Exemplo n.º 9
0
RenderPart::~RenderPart()
{
    clearWidget();
}
Exemplo n.º 10
0
RenderWidget::~RenderWidget()
{
    ASSERT(m_refCount <= 0);
    clearWidget();
}
Exemplo n.º 11
0
PasswordWidget::~PasswordWidget () 
{
    clearWidget();
}