void KeepassGroupView::OnCurrentGroupChanged(QTreeWidgetItem* cur){
	if(cur){
		if(cur==SearchResultItem)
			emit searchResultsSelected();
		else
			emit groupChanged(((GroupViewItem*)cur)->GroupHandle);
	}
	else
		emit groupChanged(NULL);
}
Exemplo n.º 2
0
/// Add an instance. Triggers notifications, returns the new index
int InstanceList::add(InstancePtr t)
{
	beginInsertRows(QModelIndex(), m_instances.size(), m_instances.size());
	m_instances.append(t);
	t->setParent(this);
	connect(t.data(), SIGNAL(propertiesChanged(BaseInstance*)),this, SLOT(propertiesChanged(BaseInstance*)));
	connect(t.data(), SIGNAL(groupChanged()),this, SLOT(groupChanged()));
	connect(t.data(), SIGNAL(nuked(BaseInstance*)), this, SLOT(instanceNuked(BaseInstance*)));
	endInsertRows();
	return count() - 1;
}
Exemplo n.º 3
0
void Sudo::setGroup(const QString group)
{
    if (m_group != group) {
        m_group = group;
        emit groupChanged(group);
    }
}
Exemplo n.º 4
0
void TestItem::setGroup(const QString &groupName){
    if ( groupName != m_group ) {
        m_group = groupName;
        emit groupChanged();
        emit dataChanged();
    }
}
Exemplo n.º 5
0
void KQuickConfig::setGroup(QString group)
{
    if (m_group != group) {
        m_group = group;
        emit groupChanged();
    }
}
Exemplo n.º 6
0
void SubgroupsForm::addSubgroup()
{
	if(yearsListWidget->currentRow()<0){
		QMessageBox::information(this, tr("FET information"), tr("Invalid selected year"));
		return;
	}
	QString yearName=yearsListWidget->currentItem()->text();
	int yearIndex=gt.rules.searchYear(yearName);
	assert(yearIndex>=0);

	if(groupsListWidget->currentRow()<0){
		QMessageBox::information(this, tr("FET information"), tr("Invalid selected group"));
		return;
	}
	QString groupName=groupsListWidget->currentItem()->text();
	int groupIndex=gt.rules.searchGroup(yearName, groupName);
	assert(groupIndex>=0);

	AddStudentsSubgroupForm form(this, yearName, groupName);
	setParentAndOtherThings(&form, this);
	form.exec();

	groupChanged(groupsListWidget->currentItem()->text());
	
	int i=subgroupsListWidget->count()-1;
	if(i>=0)
		subgroupsListWidget->setCurrentRow(i);
}
Exemplo n.º 7
0
const char *LH_MonitoringBar::userInit()
{
    if( const char *err = LH_Bar::userInit() ) return err;

    ui_ = new LH_MonitoringUI(this, mdmNumbers, true, false);

    setup_max_ = new LH_Qt_int(this, "Maximum", 100, 0, 99999);
    setup_max_->setHelp( "<p>The bar's maximum value.</p>");
    setup_max_->setOrder(-3);
    connect( setup_max_, SIGNAL(changed()), this, SLOT(updateBounds()) );

    setup_min_ = new LH_Qt_int(this, "Minimum", 0, 0, 99999);
    setup_min_->setHelp( "<p>The bar's minimum value.</p>");
    setup_min_->setOrder(-3);
    connect( setup_min_, SIGNAL(changed()), this, SLOT(updateBounds()) );

    (new LH_Qt_QString(this,("image-hr2"), QString("<hr>"), LH_FLAG_NOSAVE | LH_FLAG_NOSOURCE | LH_FLAG_NOSINK | LH_FLAG_HIDETITLE,lh_type_string_html ))->setOrder(-3);

    updateBounds();

    connect(ui_, SIGNAL(appChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(typeChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(groupChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(itemChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(initialized()), this, SLOT(configChanged()) );

    return 0;
}
Exemplo n.º 8
0
void HitBox::setGroup(const QString &group) {
    if (m_group == group) {
        return;
    }

    m_group = group;
    emit groupChanged(group);
}
Exemplo n.º 9
0
void QgsStyleManagerDialog::populateList()
{
  if ( currentItemType() > 3 )
  {
    Q_ASSERT( 0 && "not implemented" );
    return;
  }
  groupChanged( groupTree->selectionModel()->currentIndex() );
}
Exemplo n.º 10
0
tristate KexiReportView::afterSwitchFrom(Kexi::ViewMode mode)
{
    Q_UNUSED(mode);

    qDebug();
    if (tempData()->reportSchemaChangedInPreviousView) {
        qDebug() << "Schema changed";
        delete m_preRenderer;

        qDebug() << tempData()->reportDefinition.tagName();

        m_preRenderer = new KoReportPreRenderer(tempData()->reportDefinition);
        if (m_preRenderer->isValid()) {
            KoReportData *reportData = 0;
            if (!tempData()->connectionDefinition.isNull())  {
                reportData = sourceData(tempData()->connectionDefinition);
            }
            m_preRenderer->setSourceData(reportData);

            m_preRenderer->setName(window()->partItem()->name());

            //Add a kexi object to provide kexidb and extra functionality
//! @todo KEXI3 if we want this            if(!m_kexi) {
//                m_kexi = new KexiScriptAdaptor();
//            }
//            m_preRenderer->registerScriptObject(m_kexi, "Kexi");
            //If using a kexidb source, add a functions scripting object
            if (tempData()->connectionDefinition.attribute("type") == "internal") {
                m_functions = new KRScriptFunctions(reportData, KexiMainWindowIface::global()->project()->dbConnection());
                m_preRenderer->registerScriptObject(m_functions, "field");
                connect(m_preRenderer, SIGNAL(groupChanged(QMap<QString, QVariant>)),
                        m_functions, SLOT(setGroupData(QMap<QString, QVariant>)));
            }

            if (m_reportDocument) {
                qDebug() << "=======================================Deleting old document";
                delete m_reportDocument;
            }

            m_reportDocument = m_preRenderer->generate();
            if (m_reportDocument) {
                m_reportView->setDocument(m_reportDocument);
#ifndef KEXI_MOBILE
                m_pageSelector->setRecordCount(m_reportView->pageCount());
                m_pageSelector->setCurrentRecordNumber(1);
#endif
            }
        } else {
            KMessageBox::error(this, xi18n("Report schema appears to be invalid or corrupt"), xi18n("Opening failed"));
        }


        tempData()->reportSchemaChangedInPreviousView = false;
    }
    return true;
}
Exemplo n.º 11
0
void ImageTimeModel::setGroup(ImageTimeModel::TimeGroup group)
{
    beginResetModel();
    m_group = group;

    auto tg = static_cast<ImageStorage::TimeGroup>(m_group);
    m_times = ImageStorage::instance()->timeGroups(tg);
    endResetModel();

    emit groupChanged();
}
Exemplo n.º 12
0
void SubgroupsForm::modifySubgroup()
{
	if(yearsListWidget->currentRow()<0){
		QMessageBox::information(this, tr("FET information"), tr("Invalid selected year"));
		return;
	}
	QString yearName=yearsListWidget->currentItem()->text();
	int yearIndex=gt.rules.searchYear(yearName);
	assert(yearIndex>=0);

	if(groupsListWidget->currentRow()<0){
		QMessageBox::information(this, tr("FET information"), tr("Invalid selected group"));
		return;
	}
	QString groupName=groupsListWidget->currentItem()->text();
	int groupIndex=gt.rules.searchGroup(yearName, groupName);
	assert(groupIndex>=0);

	int q=subgroupsListWidget->currentRow();
	int valv=subgroupsListWidget->verticalScrollBar()->value();
	int valh=subgroupsListWidget->horizontalScrollBar()->value();

	if(subgroupsListWidget->currentRow()<0){
		QMessageBox::information(this, tr("FET information"), tr("Invalid selected subgroup"));
		return;
	}
	QString subgroupName=subgroupsListWidget->currentItem()->text();
	int subgroupIndex=gt.rules.searchSubgroup(yearName, groupName, subgroupName);
	assert(subgroupIndex>=0);
	
	StudentsSet* sset=gt.rules.searchStudentsSet(subgroupName);
	assert(sset!=NULL);
	int numberOfStudents=sset->numberOfStudents;
	
	ModifyStudentsSubgroupForm form(this, yearName, groupName, subgroupName, numberOfStudents);
	setParentAndOtherThings(&form, this);
	form.exec();

	groupChanged(groupName);
	
	subgroupsListWidget->verticalScrollBar()->setValue(valv);
	subgroupsListWidget->horizontalScrollBar()->setValue(valh);

	if(q>=subgroupsListWidget->count())
		q=subgroupsListWidget->count()-1;
	if(q>=0)
		subgroupsListWidget->setCurrentRow(q);
	else
		subgroupTextEdit->setPlainText(QString(""));
}
Exemplo n.º 13
0
ListRoomWidget* LeftHandMenu::initRoomsWidget(const cor::Group& group, const QString& key) {
    auto widget = new ListRoomWidget(group,
                                     mComm,
                                     mGroups,
                                     key,
                                     EOnOffSwitchState::hidden,
                                     cor::EListType::linear,
                                     cor::EWidgetType::condensed,
                                     mWidget);

    QScroller::grabGesture(widget, QScroller::LeftMouseButtonGesture);
    connect(widget, SIGNAL(deviceClicked(QString,QString)), this, SLOT(lightClicked(QString,QString)));
    connect(widget, SIGNAL(allButtonPressed(QString,bool)), this, SLOT(groupSelected(QString,bool)));
    connect(widget, SIGNAL(buttonsShown(QString,bool)), this, SLOT(shouldShowButtons(QString,bool)));
    connect(widget, SIGNAL(groupChanged(QString)), this, SLOT(changedGroup(QString)));

    mRoomWidgets.push_back(widget);
    resizeRoomsWidgets();
    return widget;
}
Exemplo n.º 14
0
const char *LH_MonitoringText::userInit()
{
    if( const char *err = LH_Text::userInit() ) return err;

    ui_ = new LH_MonitoringUI(this, mdmAll, false, true);

    setup_value_round_ = new LH_Qt_bool(this,"Round",false, LH_FLAG_AUTORENDER);
    setup_value_round_->setHelp( "<p>Round non integer values.</p>");
    setup_value_round_->setOrder(-3);
    connect( setup_value_round_, SIGNAL(changed()), this, SLOT(updateText()) );

    setup_append_units_ = new LH_Qt_bool(this, "Append Units", true, 0);
    setup_append_units_->setHelp( "<p>Append the units to the text.</p>");
    setup_append_units_->setOrder(-3);
    connect( setup_append_units_, SIGNAL(changed()), this, SLOT(updateText()) );

    setup_pre_text_ = new LH_Qt_QString( this, "Pre-Text", "", LH_FLAG_AUTORENDER);
    setup_pre_text_->setHelp( "<p>Text to be displayed before the sensor value.</p>");
    setup_pre_text_->setOrder(-3);
    connect( setup_pre_text_, SIGNAL(changed()), this, SLOT(updateText()) );

    setup_post_text_ = new LH_Qt_QString(this, "Post-Text", "", LH_FLAG_AUTORENDER);
    setup_post_text_->setHelp( "<p>Text to be displayed after the sensor value.</p>");
    setup_post_text_->setOrder(-3);
    connect( setup_post_text_, SIGNAL(changed()), this, SLOT(updateText()) );

    (new LH_Qt_QString(this,("image-hr2"), QString("<hr>"), LH_FLAG_NOSAVE | LH_FLAG_NOSOURCE | LH_FLAG_NOSINK | LH_FLAG_HIDETITLE,lh_type_string_html ))->setOrder(-3);

    setup_text_->setFlag( LH_FLAG_HIDDEN, true );
    setup_text_->setFlag( LH_FLAG_NOSAVE, true );
    setText(" ");

    connect(ui_, SIGNAL(appChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(typeChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(groupChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(itemChanged()), this, SLOT(configChanged()) );
    connect(ui_, SIGNAL(initialized()), this, SLOT(configChanged()) );


    return 0;
}
Exemplo n.º 15
0
void SubgroupsForm::sortSubgroups()
{
	if(yearsListWidget->currentRow()<0){
		QMessageBox::information(this, tr("FET information"), tr("Invalid selected year"));
		return;
	}
	QString yearName=yearsListWidget->currentItem()->text();
	int yearIndex=gt.rules.searchYear(yearName);
	assert(yearIndex>=0);

	if(groupsListWidget->currentRow()<0){
		QMessageBox::information(this, tr("FET information"), tr("Invalid selected group"));
		return;
	}
	QString groupName=groupsListWidget->currentItem()->text();
	int groupIndex=gt.rules.searchGroup(yearName, groupName);
	assert(groupIndex>=0);
	
	gt.rules.sortSubgroupsAlphabetically(yearName, groupName);
	
	groupChanged(groupName);
}
Exemplo n.º 16
0
void ThreadListWidget::groupSelected(ForumGroup *fg) {
    if(!fg) {
        if(currentGroup) {
            disconnect(currentGroup, 0, this, 0);
            currentGroup = 0;
        }
        emit messageSelected(0);
        clearList();
    }
    if(currentGroup != fg) {
        setDisabled(true);
        if(currentGroup) {
            disconnect(currentGroup, 0, this, 0);
        }
        currentGroup = fg;
        clearSelection();
        updateList();
        connect(currentGroup, SIGNAL(changed()), this, SLOT(groupChanged()));
        connect(currentGroup, SIGNAL(destroyed(QObject*)), this, SLOT(groupDeleted(QObject*)));
        connect(currentGroup, SIGNAL(threadAdded(ForumThread*)), this, SLOT(addThread(ForumThread*)));
        //        setCurrentItem(topLevelItem(0));
    }
Exemplo n.º 17
0
void FileInfo::readFile()
{
    m_errorMessage = "";

    m_fileInfo = QFileInfo(m_file);
    if (!m_fileInfo.exists())
        m_errorMessage = tr("File does not exist");

    emit fileChanged();
    emit isDirChanged();
    emit kindChanged();
    emit iconChanged();
    emit permissionsChanged();
    emit ownerChanged();
    emit groupChanged();
    emit sizeChanged();
    emit modifiedChanged();
    emit createdChanged();
    emit absolutePathChanged();
    emit nameChanged();
    emit suffixChanged();
    emit symLinkTargetChanged();
    emit errorMessageChanged();
}
Exemplo n.º 18
0
void BaseInstance::setGroupPost(QString val)
{
	setGroupInitial(val);
	emit groupChanged();
}
Exemplo n.º 19
0
void GroupView::emitGroupChanged()
{
    Q_EMIT groupChanged(currentGroup());
}
Exemplo n.º 20
0
void GroupView::emitGroupChanged(const QModelIndex& index)
{
    Q_EMIT groupChanged(m_model->groupFromIndex(index));
}
Exemplo n.º 21
0
void LightsFilterModel::setGroupId(int groupId)
{
    qDebug() << Q_FUNC_INFO;
    if (m_groupId != groupId) {
        m_groupId = groupId;


        if (!m_groups) {
            m_groups = new Groups(this);
            connect(m_groups, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)), this, SLOT(groupChanged(QModelIndex,QModelIndex,QVector<int>)));
            connect(m_groups, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(groupsAdded(QModelIndex,int,int)));
            connect(m_groups, SIGNAL(modelReset()), this, SLOT(groupsReset()));
        } else {
Exemplo n.º 22
0
void ContactListItem::changeGroup(bool indeed)
{
	qDebug() << Q_FUNC_INFO << indeed;
	Q_EMIT groupChanged(indeed);
}
void PhysicsBodyInfo::setGroup(int group){
    if(group >0 && m_group!=group){
        m_group=group;
        emit groupChanged(m_group);
    }
}
Exemplo n.º 24
0
InstanceList::InstListError InstanceList::loadList()
{
	// load the instance groups
	QMap<QString, QString> groupMap;
	loadGroupList(groupMap);
	
	beginResetModel();
	
	m_instances.clear();
	QDir dir(m_instDir);
	QDirIterator iter(dir);
	while (iter.hasNext())
	{
		QString subDir = iter.next();
		if (!QFileInfo(PathCombine(subDir, "instance.cfg")).exists())
			continue;
		
		BaseInstance *instPtr = NULL;
		auto &loader = InstanceFactory::get();
		auto error = loader.loadInstance(instPtr, subDir);
		
		switch(error)
		{
			case InstanceFactory::NoLoadError:
				break;
			case InstanceFactory::NotAnInstance:
				break;
		}
		
		if (error != InstanceFactory::NoLoadError &&
			error != InstanceFactory::NotAnInstance)
		{
			QString errorMsg = QString("Failed to load instance %1: ").
					arg(QFileInfo(subDir).baseName()).toUtf8();
			
			switch (error)
			{
			default:
				errorMsg += QString("Unknown instance loader error %1").
						arg(error);
				break;
			}
			qDebug(errorMsg.toUtf8());
		}
		else if (!instPtr)
		{
			qDebug(QString("Error loading instance %1. Instance loader returned null.").
					arg(QFileInfo(subDir).baseName()).toUtf8());
		}
		else
		{
			QSharedPointer<BaseInstance> inst(instPtr);
			auto iter = groupMap.find(inst->id());
			if(iter != groupMap.end())
			{
				inst->setGroupInitial((*iter));
			}
			qDebug(QString("Loaded instance %1").arg(inst->name()).toUtf8());
			inst->setParent(this);
			m_instances.append(inst);
			connect(instPtr, SIGNAL(propertiesChanged(BaseInstance*)),this, SLOT(propertiesChanged(BaseInstance*)));
			connect(instPtr, SIGNAL(groupChanged()),this, SLOT(groupChanged()));
			connect(instPtr, SIGNAL(nuked(BaseInstance*)), this, SLOT(instanceNuked(BaseInstance*)));
		}
	}
	endResetModel();
	emit dataIsInvalid();
	return NoError;
}