/*! Generate a new list of tracker URLs.
*/
void QwmMonitorWindow::handleTrackersChanged()
{
    QStringList trackerUrls;
    for (int i = 0; i < configurationTrackersList->count(); i++) {
        QListWidgetItem *item = configurationTrackersList->item(i);
        if (!item) { continue; }
        trackerUrls << item->text();
    }
    emit updatedTrackerList(trackerUrls);
}
void HWChatWidget::onFriend()
{
    QListWidgetItem * curritem = chatNicks->currentItem();
    if(!curritem)
        return;

    if(friendsList.contains(curritem->text(), Qt::CaseInsensitive)) // already on list - remove him
    {
        friendsList.removeAll(curritem->text().toLower());
        onChatString(HWChatWidget::tr("%1 *** %2 has been removed from your friends list").arg('\x03').arg(curritem->text()));
    }
    else // not on list - add
    {
        friendsList << curritem->text().toLower();
        onChatString(HWChatWidget::tr("%1 *** %2 has been added to your friends list").arg('\x03').arg(curritem->text()));
    }
    updateIcon(curritem); // update icon
    chatNickSelected(0); // update context menu
}
Example #3
0
void DirectoryFilter::editDirectory()
{
    if (m_ui.directoryList->selectedItems().count() < 1)
        return;
    QListWidgetItem *currentItem = m_ui.directoryList->selectedItems().at(0);
    QString dir = QFileDialog::getExistingDirectory(m_dialog, tr("Select Directory"),
                                                    currentItem->text());
    if (!dir.isEmpty())
        currentItem->setText(dir);
}
Example #4
0
void MainWindow::listOut(int inode, const QString& str)
{
    QListWidgetItem* item;

    for(int i = 0; i < ui->listFiles->count(); ++i) {
        item = ui->listFiles->item(i);
        if(item->text() == str)
            delete item;
    }
}
double GuiInterface::receiveFloat()
{
    double res = 0;

    if (this->listWidgetInput->count())
    {
        if (!this->regExpFloat)
        {
            this->regExpFloat = new QRegExp("[-+]?([0-9]*\\.?[0-9]*)");
        }

        QListWidgetItem *item = this->listWidgetInput->takeItem(0);
        if (this->regExpFloat->exactMatch(item->text()))
        {
            res = item->text().toDouble();
            delete item;
        }
        else
        {
            delete item;
            this->sendSignal(CommunicationInterface::HLT, "input error: invalid double value");
        }
    }
    else
    {
        DialogInputFloat dialog("Eingabe", QString::fromUtf8("Doublewert:"), this->MainWindow);

        this->MainWindow->setEnabled(false);

        if (dialog.exec())
        {
            res = dialog.lineEditInput->text().toDouble();
        }
        else
        {
            this->sendSignal(CommunicationInterface::HLT, "input error: no input");
        }

        this->MainWindow->setEnabled(true);
    }

    return res;
}
int GuiInterface::receiveInteger()
{
    int res = 0;

    if (this->listWidgetInput->count())
    {
        if (!this->regExpInteger)
        {
            this->regExpInteger = new QRegExp("[-+]?[0-9]+");
        }

        QListWidgetItem *item = this->listWidgetInput->takeItem(0);
        if (this->regExpInteger->exactMatch(item->text()))
        {
            res = item->text().toInt();
            delete item;
        }
        else
        {
            delete item;
            this->sendSignal(CommunicationInterface::HLT, "input error: invalid integer value");
        }
    }
    else
    {
        DialogInputInteger dialog("Eingabe", QString::fromUtf8("Integerwert:"), this->MainWindow);

        this->MainWindow->setEnabled(false);

        if (dialog.exec())
        {
            res = dialog.lineEditInput->text().toInt();
        }
        else
        {
            this->sendSignal(CommunicationInterface::HLT, "input error: no input");
        }

        this->MainWindow->setEnabled(true);
    }

    return res;
}
QString GuiInterface::receiveBinary()
{
    QString res;

    if (this->listWidgetInput->count())
    {
        if (!this->regExpBinary)
        {
            this->regExpBinary = new QRegExp("[01]+");
        }

        QListWidgetItem *item = this->listWidgetInput->takeItem(0);
        if (this->regExpBinary->exactMatch(item->text()))
        {
            res = item->text();
            delete item;
        }
        else
        {
            delete item;
            this->sendSignal(CommunicationInterface::HLT, "input error: invalid binary value");
        }
    }
    else
    {
        DialogInputBinary dialog("Eingabe", QString::fromUtf8("Binärwert:"), this->MainWindow);

        this->MainWindow->setEnabled(false);

        if (dialog.exec())
        {
            res = dialog.lineEditInput->text();
        }
        else
        {
            this->sendSignal(CommunicationInterface::HLT, "input error: no input");
        }

        this->MainWindow->setEnabled(true);
    }

    return res;
}
void CurveColorPick::on_colorChanged(QColor color)
{
    QListWidgetItem *item = ui->listWidget->currentItem();
    if( color != item->foreground().color())
    {
        _any_modified = true;
        item->setForeground( color );
        emit changeColor( item->text(), color );
    }
}
Example #9
0
void QtDeleteAssetDialog::on_deletePushButton_clicked()
{
    for(int row = 0; row < ui->assetsListWidget->count(); row++)
    {
        QListWidgetItem* item = ui->assetsListWidget->item(row);
        emit deleteAsset(item->text());
    }

    close();
}
void LairSpawnEditor::removeLairType() {
    QListWidgetItem* item = ui->listWidget_lairs->currentItem();

    if (item == NULL)
        return;

    group->removeSpawnEntry(item->text());

    delete ui->listWidget_lairs->takeItem(ui->listWidget_lairs->currentRow());
}
Example #11
0
// Compute list of ignored mime type from widget lists
void AdvSearch::guiListsToIgnTypes()
{
    yesFiltypsLB->sortItems();
    noFiltypsLB->sortItems();
    m_ignTypes.clear();
    for (int i = 0; i < noFiltypsLB->count();i++) {
	QListWidgetItem *item = noFiltypsLB->item(i);
	m_ignTypes.append(item->text());
    }
}
Example #12
0
void BaseForm::listerRemove(const QString& caption)
{
    qint32 i = m_cnlist->count();
    while (i--)
    {
        QListWidgetItem* itm = m_cnlist->item(i);
        if (itm && itm->text()==caption)
            delete m_cnlist->takeItem(i);
    }
}
Example #13
0
//--------------------------------------------------------------------------------------------
QListWidgetItem* MReadiness::GetListWidgetItem(QListWidget* pListWidget, QString nameItem)
{
  QListWidgetItem* pItem;
  int count = pListWidget->count();
  for(int i = 0; i < count; i++) {
    pItem = pListWidget->item(i);
    if(pItem->text() == nameItem) return pItem;
   }
  return NULL;
}
void OpenFileWidget::onOpen()
{
    QListWidgetItem * item = m_fileList->currentItem();
    if(item && item->type() == 0)
    {
        QString fileName = item->text();
        emit selected(fileName);
        close();
    }
}
Example #15
0
QListWidgetItem* NewGameTab::createItem(const QString& image, const QSettings& details)
{
	const qreal pixelratio = devicePixelRatioF();
	QListWidgetItem* item = ThumbnailLoader::createItem(Path::image(image), details.value(image + "/Name", tr("Untitled")).toString(), m_images, pixelratio);
	item->setData(ImageRole, image);
	item->setData(NameRole, item->text());
	item->setData(TagsRole, m_image_tags->tags(image));
	updateToolTip(item);
	return item;
}
    void OutputController::onClickRemoveOutput() {
        QListWidgetItem* selected = view().getUi().lvw_outputs->selectedItems().at(0);
        std::string item = selected->text().toStdString();
        fl::OutputLVar* output = model().removeOutputLVar(item);
        model().ruleBlock(0)->reset();
        delete output;

        view().getUi().lvw_outputs->removeItemWidget(selected);
        delete selected;
    }
Example #17
0
void BaseForm::listerSelected(QStringList& output)
{
    qint32 i = m_cnlist->count();
    while (i--)
    {
        QListWidgetItem* itm = m_cnlist->item(i);
        if (itm && itm->isSelected())
            output << itm->text();
    }
}
Example #18
0
void Gui_Admin::filterUsers(QString s){
    for(int i = 0; i<usersList->count(); ++i){
        QListWidgetItem* item = usersList->item(i);
        QString usLabel = item->text();
        if(!(usLabel.contains(s, Qt::CaseInsensitive)))
            item->setHidden(true);
        else
            item->setHidden(false);
    }
}
Example #19
0
void QgsFieldCalculator::getFieldValues( int limit )
{
    mValueListWidget->clear();

    if ( !mVectorLayer )
    {
        return;
    }

    QListWidgetItem* currentItem = mFieldsListWidget->currentItem();
    if ( !currentItem )
    {
        return;
    }

    QMap<QString, int>::const_iterator attIt = mFieldMap.find( currentItem->text() );
    if ( attIt == mFieldMap.constEnd() )
    {
        return;
    }

    int attributeIndex = attIt.value();
    QgsField field = mVectorLayer->pendingFields()[attributeIndex];
    bool numeric = ( field.type() == QVariant::Int || field.type() == QVariant::Double );

    QgsAttributeList attList;
    attList << attributeIndex;

    mVectorLayer->select( attList, QgsRectangle(), false );
    QgsFeature f;
    int resultCounter = 0;

    mValueListWidget->setUpdatesEnabled( false );
    mValueListWidget->blockSignals( true );
    QSet<QString> insertedValues;

    while ( mVectorLayer->nextFeature( f ) && ( limit == 0 || resultCounter != limit ) )
    {
        QString value = f.attributeMap()[attributeIndex].toString();
        if ( !numeric )
        {
            value = ( "'" + value + "'" );
        }
        //QList<QListWidgetItem *> existingItems = mValueListWidget->findItems(value, Qt::MatchExactly);
        //if(existingItems.isEmpty())
        if ( !insertedValues.contains( value ) )
        {
            mValueListWidget->addItem( value );
            insertedValues.insert( value );
            ++resultCounter;
        }
    }
    mValueListWidget->setUpdatesEnabled( true );
    mValueListWidget->blockSignals( false );
}
Example #20
0
void SettingsDialog::storeSettings() {
    QSettings settings;
    QString url = QString(ui->serverUrlEdit->text());

    // remove trailing "/" of the server url
    if (url.endsWith("/")) {
        url.chop(1);
        ui->serverUrlEdit->setText(url);
    }

    settings.setValue("ownCloud/serverUrl", url);
    settings.setValue("ownCloud/userName", ui->userNameEdit->text());
    settings.setValue("ownCloud/password",
                      crypto->encryptToString(ui->passwordEdit->text()));
    settings.setValue("ownCloud/localOwnCloudPath",
                      ui->localOwnCloudPathEdit->text());
    settings.setValue("notifyAllExternalModifications",
                      ui->notifyAllExternalModificationsCheckBox->isChecked());
    settings.setValue("noteSaveIntervalTime",
                      ui->noteSaveIntervalTime->value());
    settings.setValue("MainWindow/noteTextEdit.font",
                      noteTextEditFont.toString());
    settings.setValue("MainWindow/noteTextView.font",
                      noteTextViewFont.toString());
    settings.setValue("MainWindow/mainToolBar.iconSize",
                      QString::number(ui->toolbarIconSizeSpinBox->value()));
    settings.setValue("MainWindow/showRecentNoteFolderInMainArea",
                      ui->showRecentNoteFolderCheckBox->isChecked());

    QStringList todoCalendarUrlList;
    QStringList todoCalendarEnabledList;
    QStringList todoCalendarEnabledUrlList;
    for (int i = 0; i < ui->todoCalendarListWidget->count(); i++) {
        QListWidgetItem *item = ui->todoCalendarListWidget->item(i);

        todoCalendarUrlList.append(item->toolTip());

        if (item->checkState() == Qt::Checked) {
            todoCalendarEnabledList.append(item->text());
            todoCalendarEnabledUrlList.append(item->toolTip());
        }
    }

    // store the todo calendar data to the settings
    settings.setValue("ownCloud/todoCalendarUrlList", todoCalendarUrlList);
    settings.setValue("ownCloud/todoCalendarEnabledList",
                      todoCalendarEnabledList);
    settings.setValue("ownCloud/todoCalendarEnabledUrlList",
                      todoCalendarEnabledUrlList);
    settings.setValue("ownCloud/todoCalendarBackend",
                      ui->calendarPlusRadioButton->isChecked()
                      ? OwnCloudService::CalendarPlus
                      : OwnCloudService::DefaultOwnCloudCalendar);
}
Example #21
0
void RenameDlg::OnSelChangeList(int item)
{
	QListWidgetItem *pItem =  m_pctrlNameList->currentItem();

	if(pItem)
	{
		QString str = pItem->text();
		m_pctrlName->setText(str);
		m_pctrlName->selectAll();
	}
}
void FactionDialog::RemoveFaction()
{
  QListWidgetItem* item = ui->factionList->currentItem();

  if (item)
  {
    Data(data_engine)["Factions"][item->text().toStdString()].Remove();
    ui->factionList->removeItemWidget(item);
    delete item;
  }
}
Example #23
0
void Main::buscarEnter()
{
	if (ui.llistat->isVisible()) {
		QListWidgetItem *item;
		item = ui.llistat->currentItem();
		if (item!=NULL) {
			ui.paraula->setText(item->text());
		}
	}
	buscar();
}
Example #24
0
bool CheckboxListItem::operator< ( const QListWidgetItem & other ) const {
	if (this->checkState() != other.checkState()) {
		if (this->checkState() == Qt::Checked) {
			return true;
		} else {
			return false;
		}
	} else {
		return this->text() < other.text();
	}
}
Example #25
0
void QtLanguagesSettings::saveConfig() {
    QListWidgetItem * item = _ui->listWidget->currentItem();

    std::string language;
    if (item) {
        language = item->text().toUtf8().constData();
    }

    Config & config = ConfigManager::getInstance().getCurrentConfig();
    config.set(Config::LANGUAGE_KEY, LanguageList::getISO639Code(language));
}
Example #26
0
void DBFileSelector::onOpen()
{
	QListWidgetItem *lwi = m_list->currentItem();

	if (lwi == NULL) {
		reject();
		return;
	}
	*m_filePath = lwi->text();
	accept();
}
Example #27
0
void GomokuWindow::addServer(QString address, quint16 port)
{
    QString text = address+":"+QString::number(port);
    for(int i=0;i<ui->serverListList->count();i++){
        QListWidgetItem *item = ui->serverListList->item(i);
        if(item->text() == text){
            return;
        }
    }
    ui->serverListList->addItem(text);
}
void MotionPlanningFrame::setAsGoalStateButtonClicked()
{
  QListWidgetItem *item = ui_->list_states->currentItem();

  if (item)
  {
    robot_state::RobotState robot_state(*planning_display_->getQueryGoalState());
    robot_state::robotStateMsgToRobotState(robot_states_[item->text().toStdString()], robot_state);
    planning_display_->setQueryGoalState(robot_state);
  }
}
Example #29
0
void DataWizardPageVectors::filterVectors(const QString& filter) {
  _vectors->clearSelection();

  if (filter=="*") { // optimization
    _vectors->selectAll();
    return;
  }

  QRegExp re(filter, Qt::CaseSensitive, QRegExp::Wildcard);
  QStringList selected;

  for (int i = 0; i < _vectors->count(); i++) {
    QListWidgetItem *item = _vectors->item(i);
    if (re.exactMatch(item->text())) {
      item = _vectors->takeItem(i);
      selected.append(item->text());
      i--;
    }
  }

  _vectors->insertItems(0, selected);

  // special case optimization:
  // selecting and unselecting individual items is expensive,
  // but selecting all of them is fast,
  // so either select or select all, then unselect, which ever is fewer.
  if (selected.count() > _vectors->count()/2) {
    _vectors->selectAll();
    for (int i=selected.count(); i<_vectors->count(); i++) {
      _vectors->item(i)->setSelected(false);
    }
  } else {
    for (int i=0; i<selected.count(); i++) {
      _vectors->item(i)->setSelected(true);
    }
  }

  if (selected.count()>0) {
    _vectors->scrollToTop();
  }
}
Example #30
0
void ManageProjectsDialog::editProject()
{
    Settings settingsObj(this);
    QListWidgetItem *theItem = this->listOfProjects->currentItem();
    int row = this->listOfProjects->currentRow();
    QString name = theItem->text();
    QStringList theList = settingsObj.getProjectString(name).split("%FL_PROJECT_INFO_SEPARATOR%");
    ProjectDialog dialog(theList,this);
    dialog.exec();
    this->updateList();
    this->listOfProjects->setCurrentRow(row);
}