Brief description of class still missing. More...
#include <GroupProperties.h>
Public Types | |
enum | Properties { Name, Comments, Folder } |
Public Slots | |
void | on_folderTree_clicked (const QModelIndex &index) |
void | on_multiGroupBox_toggled (bool on) |
void | on_multiGroupKey_currentIndexChanged (int index) |
Public Member Functions | |
AbstractSignalGroup * | folder () |
GroupProperties (QWidget *parent=0) | |
bool | isMultiGroup () |
void | removeMultiGroup () |
void | setNameFromHistory () |
void | setProperties (AbstractSignalGroup *g) |
void | setValues (QList< AbstractSignalGroup * > gList) |
MetaDataIndex | splitKey () |
Brief description of class still missing.
Full description of class still missing
GroupProperties::GroupProperties | ( | QWidget * | parent = 0 | ) |
Description of constructor still missing
References QGpGuiTools::PropertyWidget::addProperty(), GeopsyCore::GeopsyCoreEngine::currentDB(), Folder, GeopsyCore::geopsyCore, Name, GeopsyGui::SignalGroupItem::setDatabase(), and TRACE.
: PropertyWidget(parent) { TRACE; setupUi(this); SignalGroupItem * gi=new SignalGroupItem(this); gi->setDatabase(geopsyCore->currentDB()); folderTree->setModel(gi); folderTree->header()->hide(); folderTree->setSelectionBehavior(QAbstractItemView::SelectRows); folderTree->setSelectionMode(QAbstractItemView::SingleSelection); folderTree->setEditTriggers(QAbstractItemView::NoEditTriggers); folderTree->expandAll(); // Populate key list multiGroupKey->addItems(MetaDataFactory::instance()->registeredNames()); nameEdit->completer()->setCaseSensitivity(Qt::CaseSensitive); nameEdit->addItems(Settings::getHistory("GroupNames")); // Create properties addProperty(Name, nameEdit->lineEdit(), nameLabel); addProperty(Comments, commentsEdit, commentsLabel); addProperty(Folder, 0, folderLabel); }
References GeopsyCore::GeopsyCoreEngine::currentDB(), GeopsyCore::geopsyCore, group(), GeopsyCore::SignalDB::masterGroup(), and TRACE.
Referenced by GeopsyMainWindow::createNewGroup(), and GroupView::properties().
{ TRACE; QModelIndex i=folderTree->currentIndex(); if(i.isValid()) return SignalGroupItem::group(i); else return geopsyCore->currentDB()->masterGroup(); }
bool GroupProperties::isMultiGroup | ( | ) |
References TRACE.
Referenced by GeopsyMainWindow::createNewGroup().
{ TRACE; return multiGroupBox && multiGroupBox->isChecked(); }
void GroupProperties::on_folderTree_clicked | ( | const QModelIndex & | index | ) | [slot] |
References Folder, QGpGuiTools::PropertyWidget::propertyValue(), QGpGuiTools::PropertyValue::setTouched(), and TRACE.
{ TRACE; propertyValue(Folder)->setTouched(); // Make sure it is the current index folderTree->setCurrentIndex(index); }
void GroupProperties::on_multiGroupBox_toggled | ( | bool | on | ) | [slot] |
References QGpCoreTools::tr(), and TRACE.
void GroupProperties::on_multiGroupKey_currentIndexChanged | ( | int | index | ) | [slot] |
References GeopsyCore::MetaDataIndex::index(), and TRACE.
{ TRACE; MetaDataIndex index=MetaDataFactory::instance()->index(multiGroupKey->currentText()); multiGroupIndex->setEnabled(MetaDataFactory::instance()->count(index)); }
void GroupProperties::removeMultiGroup | ( | ) |
References TRACE.
Referenced by GroupView::properties().
{ TRACE; delete multiGroupBox; multiGroupBox=0; }
void GroupProperties::setNameFromHistory | ( | ) |
Set current name from history if history contains items and if current name is empty.
References TRACE.
Referenced by GeopsyMainWindow::createNewGroup().
{ TRACE; if(nameEdit->currentText().isEmpty() && nameEdit->count()>0) { nameEdit->setEditText(nameEdit->itemText(0)); } }
void GroupProperties::setProperties | ( | AbstractSignalGroup * | g | ) |
References QGpGuiTools::PropertyValue::isTouched(), Name, QGpGuiTools::PropertyWidget::propertyValue(), GeopsyCore::AbstractSignalGroup::setComments(), GeopsyCore::AbstractSignalGroup::setName(), and TRACE.
Referenced by GeopsyMainWindow::createNewGroup(), and GroupView::properties().
{ TRACE; if(propertyValue(Name)->isTouched()) { g->setName(nameEdit->currentText()); } if(propertyValue(Comments)->isTouched()) { g->setComments(commentsEdit->toPlainText()); } }
void GroupProperties::setValues | ( | QList< AbstractSignalGroup * > | gList | ) |
References QGpCoreTools::TreeContainer::childrenCount(), GeopsyGui::SignalGroupItem::index(), GeopsyCore::AbstractSignalGroup::parent(), QGpGuiTools::PropertyWidget::setWidgets(), GeopsyCore::AbstractSignalGroup::signalCount(), QGpCoreTools::tr(), and TRACE.
Referenced by GeopsyMainWindow::createNewGroup(), and GroupView::properties().
{ TRACE; QList< AbstractSignalGroup*>::iterator it; for(it=gList.begin(); it!=gList.end(); it++) { checkValues(*it); } setWidgets(); if(gList.count()==1) { AbstractSignalGroup * g=gList.first(); infoLabel->setText(tr("Group containing %1 signals and %2 child(ren)").arg(g->signalCount()).arg(g->childrenCount())); } else { infoLabel->setText(tr("Several groups selected")); } if(gList.count()>0) { AbstractSignalGroup * g=gList.first(); if(g->parent()) { SignalGroupItem * gi=static_cast<SignalGroupItem *>(folderTree->model()); folderTree->setCurrentIndex(gi->index(g->parent())); } } }
References GeopsyCore::MetaDataIndex::index(), and GeopsyCore::MetaDataIndex::setIndex().
Referenced by GeopsyMainWindow::createNewGroup().
{ MetaDataIndex index=MetaDataFactory::instance()->index(multiGroupKey->currentText()); index.setIndex(multiGroupIndex->text()); return index; }