forked from qt-creator/qt-creator
Remove some unused code in the pro parsing / pro editing.
This commit is contained in:
@@ -45,8 +45,6 @@ class Qt4Project;
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ProFileEditorFactory;
|
class ProFileEditorFactory;
|
||||||
class ProItemInfoManager;
|
|
||||||
class ProEditorModel;
|
|
||||||
class ProFileHighlighter;
|
class ProFileHighlighter;
|
||||||
|
|
||||||
class ProFileEditor;
|
class ProFileEditor;
|
||||||
|
|||||||
@@ -1,379 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "proeditor.h"
|
|
||||||
#include "proitems.h"
|
|
||||||
#include "proeditormodel.h"
|
|
||||||
#include "procommandmanager.h"
|
|
||||||
#include "proxml.h"
|
|
||||||
|
|
||||||
#include <QtGui/QMenu>
|
|
||||||
#include <QtGui/QKeyEvent>
|
|
||||||
#include <QtGui/QClipboard>
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager::Internal;
|
|
||||||
|
|
||||||
ProEditor::ProEditor(QWidget *parent, bool shortcuts)
|
|
||||||
: QWidget(parent)
|
|
||||||
{
|
|
||||||
m_shortcuts = shortcuts;
|
|
||||||
m_advanced = false;
|
|
||||||
setupUi(this);
|
|
||||||
|
|
||||||
m_setFocusToListView = true;
|
|
||||||
m_blockSelectionSignal = false;
|
|
||||||
m_cutAction = new QAction(tr("Cut"), this);
|
|
||||||
m_copyAction = new QAction(tr("Copy"), this);
|
|
||||||
m_pasteAction = new QAction(tr("Paste"), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProEditor::~ProEditor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::initialize(ProEditorModel *model, ProItemInfoManager *infomanager)
|
|
||||||
{
|
|
||||||
m_model = model;
|
|
||||||
m_infomanager = infomanager;
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
ProScopeFilter *ProEditor::filterModel() const
|
|
||||||
{
|
|
||||||
return m_filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::selectScope(const QModelIndex &scope)
|
|
||||||
{
|
|
||||||
m_setFocusToListView = false;
|
|
||||||
QModelIndex parent = m_filter->mapToSource(scope);
|
|
||||||
m_editListView->setRootIndex(parent);
|
|
||||||
m_editListView->setCurrentIndex(m_model->index(0,0,parent));
|
|
||||||
m_setFocusToListView = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::initialize()
|
|
||||||
{
|
|
||||||
m_model->setInfoManager(m_infomanager);
|
|
||||||
m_filter = new ProScopeFilter(this);
|
|
||||||
m_filter->setSourceModel(m_model);
|
|
||||||
|
|
||||||
m_contextMenu = new QMenu(this);
|
|
||||||
|
|
||||||
if (m_shortcuts) {
|
|
||||||
m_cutAction->setShortcut(QKeySequence(tr("Ctrl+X")));
|
|
||||||
m_copyAction->setShortcut(QKeySequence(tr("Ctrl+C")));
|
|
||||||
m_pasteAction->setShortcut(QKeySequence(tr("Ctrl+V")));
|
|
||||||
m_editListView->installEventFilter(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_contextMenu->addAction(m_cutAction);
|
|
||||||
m_contextMenu->addAction(m_copyAction);
|
|
||||||
m_contextMenu->addAction(m_pasteAction);
|
|
||||||
|
|
||||||
QMenu *addMenu = new QMenu(m_addToolButton);
|
|
||||||
m_addVariable = addMenu->addAction(tr("Add Variable"), this, SLOT(addVariable()));
|
|
||||||
m_addScope = addMenu->addAction(tr("Add Scope"), this, SLOT(addScope()));
|
|
||||||
m_addBlock = addMenu->addAction(tr("Add Block"), this, SLOT(addBlock()));
|
|
||||||
m_addToolButton->setMenu(addMenu);
|
|
||||||
m_addToolButton->setPopupMode(QToolButton::InstantPopup);
|
|
||||||
|
|
||||||
m_editListView->setModel(m_model);
|
|
||||||
m_editListView->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
||||||
|
|
||||||
connect(m_editListView, SIGNAL(customContextMenuRequested(const QPoint &)),
|
|
||||||
this, SLOT(showContextMenu(const QPoint &)));
|
|
||||||
|
|
||||||
connect(m_editListView->selectionModel(),
|
|
||||||
SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
|
|
||||||
this, SLOT(updateState()));
|
|
||||||
|
|
||||||
connect(m_moveUpToolButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(moveUp()));
|
|
||||||
connect(m_moveDownToolButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(moveDown()));
|
|
||||||
connect(m_removeToolButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(remove()));
|
|
||||||
connect(m_cutAction, SIGNAL(triggered()),
|
|
||||||
this, SLOT(cut()));
|
|
||||||
connect(m_copyAction, SIGNAL(triggered()),
|
|
||||||
this, SLOT(copy()));
|
|
||||||
connect(m_pasteAction, SIGNAL(triggered()),
|
|
||||||
this, SLOT(paste()));
|
|
||||||
|
|
||||||
updatePasteAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProEditor::eventFilter(QObject *, QEvent *event)
|
|
||||||
{
|
|
||||||
if (event->type() == QEvent::ShortcutOverride) {
|
|
||||||
QKeyEvent *k = static_cast<QKeyEvent*>(event);
|
|
||||||
if (k->modifiers() == Qt::ControlModifier) {
|
|
||||||
switch (k->key()) {
|
|
||||||
case Qt::Key_X:
|
|
||||||
cut(); return true;
|
|
||||||
case Qt::Key_C:
|
|
||||||
copy(); return true;
|
|
||||||
case Qt::Key_V:
|
|
||||||
paste(); return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (event->type() == QEvent::FocusIn) {
|
|
||||||
updateActions(true);
|
|
||||||
} else if (event->type() == QEvent::FocusOut) {
|
|
||||||
updateActions(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::showContextMenu(const QPoint &pos)
|
|
||||||
{
|
|
||||||
updatePasteAction();
|
|
||||||
m_contextMenu->popup(m_editListView->viewport()->mapToGlobal(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::updatePasteAction()
|
|
||||||
{
|
|
||||||
bool pasteEnabled = false;
|
|
||||||
|
|
||||||
const QMimeData *data = QApplication::clipboard()->mimeData();
|
|
||||||
if (data && data->hasFormat(QLatin1String("application/x-problock")))
|
|
||||||
pasteEnabled = true;
|
|
||||||
|
|
||||||
m_pasteAction->setEnabled(pasteEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::updateActions(bool focus)
|
|
||||||
{
|
|
||||||
bool copyEnabled = false;
|
|
||||||
|
|
||||||
if (focus)
|
|
||||||
copyEnabled = m_editListView->currentIndex().isValid();
|
|
||||||
|
|
||||||
m_cutAction->setEnabled(copyEnabled);
|
|
||||||
m_copyAction->setEnabled(copyEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::updateState()
|
|
||||||
{
|
|
||||||
bool addEnabled = false;
|
|
||||||
bool removeEnabled = false;
|
|
||||||
bool upEnabled = false;
|
|
||||||
bool downEnabled = false;
|
|
||||||
|
|
||||||
QModelIndex parent = m_editListView->rootIndex();
|
|
||||||
ProBlock *scope = m_model->proBlock(parent);
|
|
||||||
|
|
||||||
if (scope) {
|
|
||||||
addEnabled = true;
|
|
||||||
QModelIndex index = m_editListView->currentIndex();
|
|
||||||
if (index.isValid()) {
|
|
||||||
removeEnabled = true;
|
|
||||||
int count = m_model->rowCount(parent);
|
|
||||||
int row = index.row();
|
|
||||||
if (row > 0)
|
|
||||||
upEnabled = true;
|
|
||||||
if (row < (count - 1))
|
|
||||||
downEnabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_blockSelectionSignal) {
|
|
||||||
emit itemSelected(m_editListView->currentIndex());
|
|
||||||
if (m_setFocusToListView)
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateActions(m_editListView->hasFocus());
|
|
||||||
|
|
||||||
m_addToolButton->setEnabled(addEnabled);
|
|
||||||
m_removeToolButton->setEnabled(removeEnabled);
|
|
||||||
m_moveUpToolButton->setEnabled(upEnabled);
|
|
||||||
m_moveDownToolButton->setEnabled(downEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::moveUp()
|
|
||||||
{
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
QModelIndex index = m_editListView->currentIndex();
|
|
||||||
QModelIndex parent = index.parent();
|
|
||||||
int row = index.row() - 1;
|
|
||||||
|
|
||||||
m_blockSelectionSignal = true;
|
|
||||||
m_model->moveItem(index, row);
|
|
||||||
m_blockSelectionSignal = false;
|
|
||||||
|
|
||||||
index = m_model->index(row, 0, parent);
|
|
||||||
m_editListView->setCurrentIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::moveDown()
|
|
||||||
{
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
QModelIndex index = m_editListView->currentIndex();
|
|
||||||
QModelIndex parent = index.parent();
|
|
||||||
int row = index.row() + 1;
|
|
||||||
|
|
||||||
m_blockSelectionSignal = true;
|
|
||||||
m_model->moveItem(index, row);
|
|
||||||
m_blockSelectionSignal = false;
|
|
||||||
|
|
||||||
index = m_model->index(row, 0, parent);
|
|
||||||
m_editListView->setCurrentIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::remove()
|
|
||||||
{
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
m_model->removeItem(m_editListView->currentIndex());
|
|
||||||
updateState();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::cut()
|
|
||||||
{
|
|
||||||
QModelIndex index = m_editListView->currentIndex();
|
|
||||||
if (!index.isValid())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (ProItem *item = m_model->proItem(index)) {
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
m_model->removeItem(index);
|
|
||||||
|
|
||||||
QMimeData *data = new QMimeData();
|
|
||||||
QString xml = ProXmlParser::itemToString(item);
|
|
||||||
if (item->kind() == ProItem::ValueKind)
|
|
||||||
data->setData(QLatin1String("application/x-provalue"), xml.toUtf8());
|
|
||||||
else
|
|
||||||
data->setData(QLatin1String("application/x-problock"), xml.toUtf8());
|
|
||||||
QApplication::clipboard()->setMimeData(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::copy()
|
|
||||||
{
|
|
||||||
QModelIndex index = m_editListView->currentIndex();
|
|
||||||
if (!index.isValid())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (ProItem *item = m_model->proItem(index)) {
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
QMimeData *data = new QMimeData();
|
|
||||||
QString xml = ProXmlParser::itemToString(item);
|
|
||||||
if (item->kind() == ProItem::ValueKind)
|
|
||||||
data->setData(QLatin1String("application/x-provalue"), xml.toUtf8());
|
|
||||||
else
|
|
||||||
data->setData(QLatin1String("application/x-problock"), xml.toUtf8());
|
|
||||||
QApplication::clipboard()->setMimeData(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::paste()
|
|
||||||
{
|
|
||||||
if (const QMimeData *data = QApplication::clipboard()->mimeData()) {
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
QModelIndex parent = m_editListView->rootIndex();
|
|
||||||
ProBlock *block = m_model->proBlock(parent);
|
|
||||||
if (!block)
|
|
||||||
return;
|
|
||||||
|
|
||||||
QString xml;
|
|
||||||
if (data->hasFormat(QLatin1String("application/x-provalue"))) {
|
|
||||||
xml = QString::fromUtf8(data->data(QLatin1String("application/x-provalue")));
|
|
||||||
} else if (data->hasFormat(QLatin1String("application/x-problock"))) {
|
|
||||||
xml = QString::fromUtf8(data->data(QLatin1String("application/x-problock")));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ProItem *item = ProXmlParser::stringToItem(xml)) {
|
|
||||||
QModelIndex parent = m_editListView->rootIndex();
|
|
||||||
int row = m_model->rowCount(parent);
|
|
||||||
m_model->insertItem(item, row, parent);
|
|
||||||
m_editListView->setCurrentIndex(m_model->index(row,0,parent));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::addVariable()
|
|
||||||
{
|
|
||||||
QModelIndex parent = m_editListView->rootIndex();
|
|
||||||
if (ProBlock *pblock = m_model->proBlock(parent)) {
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
int row = m_model->rowCount(parent);
|
|
||||||
|
|
||||||
QString defid("...");
|
|
||||||
ProVariable::VariableOperator op = ProVariable::SetOperator;
|
|
||||||
QList<ProVariableInfo *> vars = m_infomanager->variables();
|
|
||||||
if (!vars.isEmpty()) {
|
|
||||||
defid = vars.first()->id();
|
|
||||||
op = vars.first()->defaultOperator();
|
|
||||||
}
|
|
||||||
|
|
||||||
ProVariable *var = new ProVariable(defid, pblock);
|
|
||||||
var->setVariableOperator(op);
|
|
||||||
|
|
||||||
m_model->insertItem(var, row, parent);
|
|
||||||
m_editListView->setCurrentIndex(m_model->index(row,0,parent));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::addScope()
|
|
||||||
{
|
|
||||||
QModelIndex parent = m_editListView->rootIndex();
|
|
||||||
if (ProBlock *pblock = m_model->proBlock(parent)) {
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
int row = m_model->rowCount(parent);
|
|
||||||
ProBlock *scope = new ProBlock(pblock);
|
|
||||||
scope->setBlockKind(ProBlock::ScopeKind);
|
|
||||||
ProBlock *scopecontents = new ProBlock(scope);
|
|
||||||
scopecontents->setBlockKind(ProBlock::ScopeContentsKind);
|
|
||||||
|
|
||||||
QString defid("...");
|
|
||||||
QList<ProScopeInfo *> vars = m_infomanager->scopes();
|
|
||||||
if (!vars.isEmpty())
|
|
||||||
defid = vars.first()->id();
|
|
||||||
|
|
||||||
scope->setItems(QList<ProItem *>() << new ProCondition(defid) << scopecontents);
|
|
||||||
m_model->insertItem(scope, row, parent);
|
|
||||||
m_editListView->setCurrentIndex(m_model->index(row,0,parent));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProEditor::addBlock()
|
|
||||||
{
|
|
||||||
QModelIndex parent = m_editListView->rootIndex();
|
|
||||||
if (ProBlock *pblock = m_model->proBlock(parent)) {
|
|
||||||
m_editListView->setFocus(Qt::OtherFocusReason);
|
|
||||||
int row = m_model->rowCount(parent);
|
|
||||||
ProBlock *block = new ProBlock(pblock);
|
|
||||||
block->setBlockKind(ProBlock::NormalKind);
|
|
||||||
block->setItems(QList<ProItem *>() << new ProFunction("..."));
|
|
||||||
m_model->insertItem(block, row, parent);
|
|
||||||
m_editListView->setCurrentIndex(m_model->index(row,0,parent));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef PROEDITOR_H
|
|
||||||
#define PROEDITOR_H
|
|
||||||
|
|
||||||
#include "namespace_global.h"
|
|
||||||
|
|
||||||
#include "ui_proeditor.h"
|
|
||||||
|
|
||||||
#include "proiteminfo.h"
|
|
||||||
|
|
||||||
#include <QtCore/QList>
|
|
||||||
#include <QtGui/QWidget>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QMenu;
|
|
||||||
class QAction;
|
|
||||||
class ProBlock;
|
|
||||||
class ProVariable;
|
|
||||||
class ProFile;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class ProEditorModel;
|
|
||||||
class ProScopeFilter;
|
|
||||||
|
|
||||||
class ProEditor : public QWidget, protected Ui::ProEditor
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
ProEditor(QWidget *parent, bool shortcuts = true);
|
|
||||||
~ProEditor();
|
|
||||||
|
|
||||||
virtual void initialize(ProEditorModel *model, ProItemInfoManager *infomanager);
|
|
||||||
|
|
||||||
ProScopeFilter *filterModel() const;
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void selectScope(const QModelIndex &scope);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void itemSelected(const QModelIndex &index);
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void showContextMenu(const QPoint &pos);
|
|
||||||
void updatePasteAction();
|
|
||||||
void updateState();
|
|
||||||
|
|
||||||
void moveUp();
|
|
||||||
void moveDown();
|
|
||||||
void remove();
|
|
||||||
void cut();
|
|
||||||
void copy();
|
|
||||||
void paste();
|
|
||||||
|
|
||||||
void addVariable();
|
|
||||||
void addScope();
|
|
||||||
void addBlock();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void updateActions(bool focus);
|
|
||||||
bool eventFilter(QObject *obj, QEvent *event);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initialize();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
ProEditorModel *m_model;
|
|
||||||
QAction *m_cutAction;
|
|
||||||
QAction *m_copyAction;
|
|
||||||
QAction *m_pasteAction;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QMenu *m_contextMenu;
|
|
||||||
|
|
||||||
QAction *m_addVariable;
|
|
||||||
QAction *m_addScope;
|
|
||||||
QAction *m_addBlock;
|
|
||||||
|
|
||||||
ProScopeFilter *m_filter;
|
|
||||||
ProItemInfoManager *m_infomanager;
|
|
||||||
|
|
||||||
bool m_blockSelectionSignal;
|
|
||||||
|
|
||||||
// used because of some strange behavior when integrated into eclipse
|
|
||||||
bool m_setFocusToListView;
|
|
||||||
bool m_shortcuts;
|
|
||||||
bool m_advanced;
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace Internal
|
|
||||||
} //namespace Qt4ProjectManager
|
|
||||||
|
|
||||||
#endif // PROEDITOR_H
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>Qt4ProjectManager::Internal::ProEditor</class>
|
|
||||||
<widget class="QWidget" name="Qt4ProjectManager::Internal::ProEditor" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>621</width>
|
|
||||||
<height>557</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QListView" name="m_editListView" >
|
|
||||||
<property name="editTriggers" >
|
|
||||||
<set>QAbstractItemView::NoEditTriggers</set>
|
|
||||||
</property>
|
|
||||||
<property name="dragEnabled" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="uniformItemSizes" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="m_addToolButton" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>1</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>New</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="m_removeToolButton" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>1</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Remove</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="m_moveUpToolButton" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>1</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Up</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="m_moveDownToolButton" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>1</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Down</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
#include "proitems.h"
|
#include "proitems.h"
|
||||||
#include "proeditormodel.h"
|
#include "proeditormodel.h"
|
||||||
#include "procommandmanager.h"
|
#include "procommandmanager.h"
|
||||||
#include "proiteminfo.h"
|
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QMimeData>
|
#include <QtCore/QMimeData>
|
||||||
@@ -236,7 +235,6 @@ private:
|
|||||||
ProEditorModel::ProEditorModel(QObject *parent)
|
ProEditorModel::ProEditorModel(QObject *parent)
|
||||||
: QAbstractItemModel(parent)
|
: QAbstractItemModel(parent)
|
||||||
{
|
{
|
||||||
m_infomanager = 0;
|
|
||||||
m_cmdmanager = new ProCommandManager(this);
|
m_cmdmanager = new ProCommandManager(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,17 +242,6 @@ ProEditorModel::~ProEditorModel()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProEditorModel::setInfoManager(ProItemInfoManager *infomanager)
|
|
||||||
{
|
|
||||||
m_infomanager = infomanager;
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
ProItemInfoManager *ProEditorModel::infoManager() const
|
|
||||||
{
|
|
||||||
return m_infomanager;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProCommandManager *ProEditorModel::cmdManager() const
|
ProCommandManager *ProEditorModel::cmdManager() const
|
||||||
{
|
{
|
||||||
return m_cmdmanager;
|
return m_cmdmanager;
|
||||||
@@ -312,10 +299,6 @@ QString ProEditorModel::blockName(ProBlock *block) const
|
|||||||
// variables has a name
|
// variables has a name
|
||||||
if (block->blockKind() & ProBlock::VariableKind) {
|
if (block->blockKind() & ProBlock::VariableKind) {
|
||||||
ProVariable *v = static_cast<ProVariable*>(block);
|
ProVariable *v = static_cast<ProVariable*>(block);
|
||||||
if (m_infomanager) {
|
|
||||||
if (ProVariableInfo *info = m_infomanager->variable(v->variable()))
|
|
||||||
return info->name();
|
|
||||||
}
|
|
||||||
return v->variable();
|
return v->variable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,13 +462,6 @@ QVariant ProEditorModel::data(const QModelIndex &index, int role) const
|
|||||||
} else if (item->kind() == ProItem::ValueKind) {
|
} else if (item->kind() == ProItem::ValueKind) {
|
||||||
ProValue *value = static_cast<ProValue*>(item);
|
ProValue *value = static_cast<ProValue*>(item);
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
ProVariable *var = proVariable(index.parent());
|
|
||||||
if (var && m_infomanager) {
|
|
||||||
if (ProVariableInfo *varinfo = m_infomanager->variable(var->variable())) {
|
|
||||||
if (ProValueInfo *valinfo = varinfo->value(value->value()))
|
|
||||||
return QVariant(valinfo->name());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return QVariant(value->value());
|
return QVariant(value->value());
|
||||||
} else if (role == Qt::DecorationRole) {
|
} else if (role == Qt::DecorationRole) {
|
||||||
return QIcon(":/proparser/images/value.png");
|
return QIcon(":/proparser/images/value.png");
|
||||||
@@ -497,96 +473,6 @@ QVariant ProEditorModel::data(const QModelIndex &index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProEditorModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
|
||||||
{
|
|
||||||
static bool block = false;
|
|
||||||
|
|
||||||
if (block)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (role != Qt::EditRole)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
ProItem *item = proItem(index);
|
|
||||||
if (!item)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (item->kind() == ProItem::ValueKind) {
|
|
||||||
ProValue *val = static_cast<ProValue *>(item);
|
|
||||||
if (val->value() == value.toString())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
block = true;
|
|
||||||
m_cmdmanager->beginGroup(tr("Change Item"));
|
|
||||||
bool result = m_cmdmanager->command(new ProRemoveCommand(this, index));
|
|
||||||
if (result) {
|
|
||||||
ProValue *item = new ProValue(value.toString(), proVariable(index.parent()));
|
|
||||||
result = m_cmdmanager->command(new ProAddCommand(this, item, index.row(), index.parent()));
|
|
||||||
}
|
|
||||||
block = false;
|
|
||||||
|
|
||||||
m_cmdmanager->endGroup();
|
|
||||||
markProFileModified(index);
|
|
||||||
emit dataChanged(index,index);
|
|
||||||
return result;
|
|
||||||
} else if (item->kind() == ProItem::BlockKind) {
|
|
||||||
ProBlock *block = proBlock(index);
|
|
||||||
if (block->blockKind() & ProBlock::VariableKind) {
|
|
||||||
ProVariable *var = static_cast<ProVariable *>(block);
|
|
||||||
if (value.type() == QVariant::Int) {
|
|
||||||
if ((int)var->variableOperator() == value.toInt())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
m_cmdmanager->beginGroup(tr("Change Variable Assignment"));
|
|
||||||
m_cmdmanager->command(new ChangeProVariableOpCommand(this, var,
|
|
||||||
(ProVariable::VariableOperator)value.toInt()));
|
|
||||||
m_cmdmanager->endGroup();
|
|
||||||
markProFileModified(index);
|
|
||||||
emit dataChanged(index,index);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (var->variable() == value.toString())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
m_cmdmanager->beginGroup(tr("Change Variable Type"));
|
|
||||||
m_cmdmanager->command(new ChangeProVariableIdCommand(this, var,
|
|
||||||
value.toString()));
|
|
||||||
m_cmdmanager->endGroup();
|
|
||||||
markProFileModified(index);
|
|
||||||
emit dataChanged(index,index);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else if (block->blockKind() & ProBlock::ScopeContentsKind) {
|
|
||||||
ProBlock *scope = block->parent();
|
|
||||||
QString oldExp = expressionToString(scope);
|
|
||||||
if (oldExp == value.toString())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
m_cmdmanager->beginGroup(tr("Change Scope Condition"));
|
|
||||||
m_cmdmanager->command(new ChangeProScopeCommand(this, scope, value.toString()));
|
|
||||||
m_cmdmanager->endGroup();
|
|
||||||
markProFileModified(index);
|
|
||||||
emit dataChanged(index,index);
|
|
||||||
return true;
|
|
||||||
} else if (block->blockKind() & ProBlock::ProFileKind) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
QString oldExp = expressionToString(block);
|
|
||||||
if (oldExp == value.toString())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
m_cmdmanager->beginGroup(tr("Change Expression"));
|
|
||||||
m_cmdmanager->command(new ChangeProAdvancedCommand(this, block, value.toString()));
|
|
||||||
m_cmdmanager->endGroup();
|
|
||||||
markProFileModified(index);
|
|
||||||
emit dataChanged(index,index);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Qt::ItemFlags ProEditorModel::flags(const QModelIndex &index) const
|
Qt::ItemFlags ProEditorModel::flags(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
@@ -613,29 +499,6 @@ QMimeData *ProEditorModel::mimeData(const QModelIndexList &indexes) const
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProEditorModel::moveItem(const QModelIndex &index, int row)
|
|
||||||
{
|
|
||||||
if (!index.isValid())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
int oldrow = index.row();
|
|
||||||
QModelIndex parentIndex = index.parent();
|
|
||||||
|
|
||||||
if (oldrow == row)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
ProItem *item = proItem(index);
|
|
||||||
|
|
||||||
m_cmdmanager->beginGroup(tr("Move Item"));
|
|
||||||
bool result = m_cmdmanager->command(new ProRemoveCommand(this, index, false));
|
|
||||||
if (result)
|
|
||||||
result = m_cmdmanager->command(new ProAddCommand(this, item, row, parentIndex, false));
|
|
||||||
m_cmdmanager->endGroup();
|
|
||||||
markProFileModified(index);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProEditorModel::removeModelItem(const QModelIndex &index)
|
bool ProEditorModel::removeModelItem(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
@@ -793,14 +656,7 @@ QString ProEditorModel::expressionToString(ProBlock *block, bool display) const
|
|||||||
break; }
|
break; }
|
||||||
case ProItem::ConditionKind: {
|
case ProItem::ConditionKind: {
|
||||||
ProCondition *v = static_cast<ProCondition*>(item);
|
ProCondition *v = static_cast<ProCondition*>(item);
|
||||||
if (m_infomanager && display) {
|
|
||||||
if (ProScopeInfo *info = m_infomanager->scope(v->text()))
|
|
||||||
result += info->name();
|
|
||||||
else
|
|
||||||
result += v->text();
|
result += v->text();
|
||||||
} else {
|
|
||||||
result += v->text();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProItem::OperatorKind: {
|
case ProItem::OperatorKind: {
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ namespace Qt4ProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ProCommandManager;
|
class ProCommandManager;
|
||||||
class ProItemInfoManager;
|
|
||||||
|
|
||||||
class ProEditorModel : public QAbstractItemModel
|
class ProEditorModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
@@ -59,8 +58,6 @@ public:
|
|||||||
ProEditorModel(QObject *parent = 0);
|
ProEditorModel(QObject *parent = 0);
|
||||||
~ProEditorModel();
|
~ProEditorModel();
|
||||||
|
|
||||||
void setInfoManager(ProItemInfoManager *infomanager);
|
|
||||||
ProItemInfoManager *infoManager() const;
|
|
||||||
ProCommandManager *cmdManager() const;
|
ProCommandManager *cmdManager() const;
|
||||||
|
|
||||||
void setProFiles(QList<ProFile*> proFiles);
|
void setProFiles(QList<ProFile*> proFiles);
|
||||||
@@ -69,7 +66,6 @@ public:
|
|||||||
QList<QModelIndex> findVariables(const QStringList &varname, const QModelIndex &parent = QModelIndex()) const;
|
QList<QModelIndex> findVariables(const QStringList &varname, const QModelIndex &parent = QModelIndex()) const;
|
||||||
QList<QModelIndex> findBlocks(const QModelIndex &parent = QModelIndex()) const;
|
QList<QModelIndex> findBlocks(const QModelIndex &parent = QModelIndex()) const;
|
||||||
|
|
||||||
bool moveItem(const QModelIndex &index, int row);
|
|
||||||
bool insertItem(ProItem *item, int row, const QModelIndex &parent);
|
bool insertItem(ProItem *item, int row, const QModelIndex &parent);
|
||||||
bool removeItem(const QModelIndex &index);
|
bool removeItem(const QModelIndex &index);
|
||||||
|
|
||||||
@@ -82,7 +78,6 @@ public:
|
|||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
|
||||||
|
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
||||||
@@ -105,7 +100,6 @@ private:
|
|||||||
ProCommandManager *m_cmdmanager;
|
ProCommandManager *m_cmdmanager;
|
||||||
QList<ProFile*> m_proFiles;
|
QList<ProFile*> m_proFiles;
|
||||||
QSet<ProFile*> m_changed;
|
QSet<ProFile*> m_changed;
|
||||||
ProItemInfoManager *m_infomanager;
|
|
||||||
|
|
||||||
friend class ProAddCommand;
|
friend class ProAddCommand;
|
||||||
friend class ProRemoveCommand;
|
friend class ProRemoveCommand;
|
||||||
|
|||||||
@@ -1,237 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "proiteminfo.h"
|
|
||||||
|
|
||||||
#include <QtCore/QFile>
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager::Internal;
|
|
||||||
|
|
||||||
ProItemInfo::ProItemInfo(ProItemInfoKind kind)
|
|
||||||
: m_kind(kind)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
ProItemInfo::ProItemInfoKind ProItemInfo::kind() const
|
|
||||||
{
|
|
||||||
return m_kind;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfo::setId(const QString &id)
|
|
||||||
{
|
|
||||||
m_id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfo::setName(const QString &name)
|
|
||||||
{
|
|
||||||
m_name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfo::setDescription(const QString &desc)
|
|
||||||
{
|
|
||||||
m_description = desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ProItemInfo::id() const
|
|
||||||
{
|
|
||||||
return m_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ProItemInfo::name() const
|
|
||||||
{
|
|
||||||
return m_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ProItemInfo::description() const
|
|
||||||
{
|
|
||||||
return m_description;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProScopeInfo::ProScopeInfo()
|
|
||||||
: ProItemInfo(ProItemInfo::Scope)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
ProValueInfo::ProValueInfo()
|
|
||||||
: ProItemInfo(ProItemInfo::Value)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
ProVariableInfo::ProVariableInfo()
|
|
||||||
: ProItemInfo(ProItemInfo::Variable)
|
|
||||||
{
|
|
||||||
m_operator = ProVariable::SetOperator;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProVariableInfo::~ProVariableInfo()
|
|
||||||
{
|
|
||||||
qDeleteAll(m_values.values());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProVariableInfo::addValue(ProValueInfo *value)
|
|
||||||
{
|
|
||||||
m_values.insert(value->id(), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProVariableInfo::setMultiple(bool multiple)
|
|
||||||
{
|
|
||||||
m_multiple = multiple;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProVariableInfo::setDefaultOperator(ProVariable::VariableOperator op)
|
|
||||||
{
|
|
||||||
m_operator = op;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProValueInfo *ProVariableInfo::value(const QString &id) const
|
|
||||||
{
|
|
||||||
return m_values.value(id, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<ProValueInfo *> ProVariableInfo::values() const
|
|
||||||
{
|
|
||||||
return m_values.values();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProVariableInfo::multiple() const
|
|
||||||
{
|
|
||||||
return m_multiple;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProVariable::VariableOperator ProVariableInfo::defaultOperator() const
|
|
||||||
{
|
|
||||||
return m_operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProItemInfoManager::ProItemInfoManager(QObject *parent)
|
|
||||||
: QObject(parent)
|
|
||||||
{
|
|
||||||
load(QLatin1String(":/proparser/proiteminfo.xml"));
|
|
||||||
}
|
|
||||||
|
|
||||||
ProItemInfoManager::~ProItemInfoManager()
|
|
||||||
{
|
|
||||||
qDeleteAll(m_variables.values());
|
|
||||||
qDeleteAll(m_scopes.values());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfoManager::addVariable(ProVariableInfo *variable)
|
|
||||||
{
|
|
||||||
m_variables.insert(variable->id(), variable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfoManager::addScope(ProScopeInfo *scope)
|
|
||||||
{
|
|
||||||
m_scopes.insert(scope->id(), scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProVariableInfo *ProItemInfoManager::variable(const QString &id) const
|
|
||||||
{
|
|
||||||
return m_variables.value(id, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProScopeInfo *ProItemInfoManager::scope(const QString &id) const
|
|
||||||
{
|
|
||||||
return m_scopes.value(id, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<ProScopeInfo *> ProItemInfoManager::scopes() const
|
|
||||||
{
|
|
||||||
return m_scopes.values();
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<ProVariableInfo *> ProItemInfoManager::variables() const
|
|
||||||
{
|
|
||||||
return m_variables.values();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProItemInfoManager::load(const QString &filename)
|
|
||||||
{
|
|
||||||
QFile file(filename);
|
|
||||||
if (!file.open(QIODevice::ReadOnly))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
QDomDocument doc;
|
|
||||||
if (!doc.setContent(&file))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
QDomElement root = doc.documentElement();
|
|
||||||
if (root.nodeName() != QLatin1String("proiteminfo"))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
QDomElement child = root.firstChildElement();
|
|
||||||
for (; !child.isNull(); child = child.nextSiblingElement()) {
|
|
||||||
if (child.nodeName() == QLatin1String("scope"))
|
|
||||||
readScope(child);
|
|
||||||
else if (child.nodeName() == QLatin1String("variable"))
|
|
||||||
readVariable(child);
|
|
||||||
}
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfoManager::readItem(ProItemInfo *item, const QDomElement &data)
|
|
||||||
{
|
|
||||||
QDomElement child = data.firstChildElement();
|
|
||||||
for (; !child.isNull(); child = child.nextSiblingElement()) {
|
|
||||||
if (child.nodeName() == QLatin1String("id"))
|
|
||||||
item->setId(child.text());
|
|
||||||
else if (child.nodeName() == QLatin1String("name"))
|
|
||||||
item->setName(child.text());
|
|
||||||
else if (child.nodeName() == QLatin1String("description"))
|
|
||||||
item->setDescription(child.text());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfoManager::readScope(const QDomElement &data)
|
|
||||||
{
|
|
||||||
ProScopeInfo *scope = new ProScopeInfo();
|
|
||||||
readItem(scope, data);
|
|
||||||
addScope(scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProItemInfoManager::readVariable(const QDomElement &data)
|
|
||||||
{
|
|
||||||
ProVariableInfo *var = new ProVariableInfo();
|
|
||||||
readItem(var, data);
|
|
||||||
|
|
||||||
var->setMultiple(data.attribute(QLatin1String("multiple"), QLatin1String("false")) == QLatin1String("true"));
|
|
||||||
var->setDefaultOperator((ProVariable::VariableOperator)data.attribute(QLatin1String("operator"),
|
|
||||||
QLatin1String("3")).toInt());
|
|
||||||
|
|
||||||
QDomElement child = data.firstChildElement();
|
|
||||||
for (; !child.isNull(); child = child.nextSiblingElement()) {
|
|
||||||
if (child.nodeName() == QLatin1String("value")) {
|
|
||||||
ProValueInfo *val = new ProValueInfo();
|
|
||||||
readItem(val, child);
|
|
||||||
var->addValue(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addVariable(var);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef PROITEMINFO_H
|
|
||||||
#define PROITEMINFO_H
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QtCore/QString>
|
|
||||||
#include <QtCore/QStringList>
|
|
||||||
#include <QtCore/QMap>
|
|
||||||
#include <QtXml/QDomElement>
|
|
||||||
|
|
||||||
#include "proitems.h"
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class ProItemInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum ProItemInfoKind {
|
|
||||||
Scope,
|
|
||||||
Value,
|
|
||||||
Variable
|
|
||||||
};
|
|
||||||
|
|
||||||
ProItemInfo(ProItemInfoKind kind);
|
|
||||||
|
|
||||||
ProItemInfoKind kind() const;
|
|
||||||
void setId(const QString &id);
|
|
||||||
void setName(const QString &name);
|
|
||||||
void setDescription(const QString &desc);
|
|
||||||
|
|
||||||
QString id() const;
|
|
||||||
QString name() const;
|
|
||||||
QString description() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_id;
|
|
||||||
QString m_name;
|
|
||||||
QString m_description;
|
|
||||||
ProItemInfoKind m_kind;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProScopeInfo : public ProItemInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ProScopeInfo();
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProValueInfo : public ProItemInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ProValueInfo();
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProVariableInfo : public ProItemInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ProVariableInfo();
|
|
||||||
~ProVariableInfo();
|
|
||||||
|
|
||||||
void addValue(ProValueInfo *value);
|
|
||||||
void setMultiple(bool multiple);
|
|
||||||
void setDefaultOperator(ProVariable::VariableOperator op);
|
|
||||||
|
|
||||||
ProValueInfo *value(const QString &id) const;
|
|
||||||
|
|
||||||
QList<ProValueInfo *> values() const;
|
|
||||||
bool multiple() const;
|
|
||||||
ProVariable::VariableOperator defaultOperator() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
ProVariable::VariableOperator m_operator;
|
|
||||||
bool m_multiple;
|
|
||||||
QMap<QString, ProValueInfo *> m_values;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProItemInfoManager : public QObject {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
ProItemInfoManager(QObject *parent);
|
|
||||||
~ProItemInfoManager();
|
|
||||||
|
|
||||||
ProVariableInfo *variable(const QString &id) const;
|
|
||||||
ProScopeInfo *scope(const QString &id) const;
|
|
||||||
|
|
||||||
QList<ProScopeInfo *> scopes() const;
|
|
||||||
QList<ProVariableInfo *> variables() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool load(const QString &filename);
|
|
||||||
void addVariable(ProVariableInfo *variable);
|
|
||||||
void addScope(ProScopeInfo *scope);
|
|
||||||
void readItem(ProItemInfo *item, const QDomElement &data);
|
|
||||||
void readScope(const QDomElement &data);
|
|
||||||
void readVariable(const QDomElement &data);
|
|
||||||
|
|
||||||
QMap<QString, ProScopeInfo *> m_scopes;
|
|
||||||
QMap<QString, ProVariableInfo *> m_variables;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qt4ProjectManager
|
|
||||||
|
|
||||||
#endif // PROITEMINFO_H
|
|
||||||
@@ -8,28 +8,19 @@ DEPENDPATH *= $$PWD $$PWD/..
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
abstractproitemvisitor.h \
|
abstractproitemvisitor.h \
|
||||||
procommandmanager.h \
|
procommandmanager.h \
|
||||||
proeditor.h \
|
|
||||||
proeditormodel.h \
|
proeditormodel.h \
|
||||||
profileevaluator.h \
|
profileevaluator.h \
|
||||||
proiteminfo.h \
|
|
||||||
proitems.h \
|
proitems.h \
|
||||||
prowriter.h \
|
prowriter.h \
|
||||||
proxml.h \
|
proxml.h \
|
||||||
valueeditor.h \
|
|
||||||
$$PWD/../namespace_global.h
|
$$PWD/../namespace_global.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
procommandmanager.cpp \
|
procommandmanager.cpp \
|
||||||
proeditor.cpp \
|
|
||||||
proeditormodel.cpp \
|
proeditormodel.cpp \
|
||||||
profileevaluator.cpp \
|
profileevaluator.cpp \
|
||||||
proiteminfo.cpp \
|
|
||||||
proitems.cpp \
|
proitems.cpp \
|
||||||
prowriter.cpp \
|
prowriter.cpp \
|
||||||
proxml.cpp \
|
proxml.cpp
|
||||||
valueeditor.cpp
|
|
||||||
|
|
||||||
FORMS += proeditor.ui \
|
|
||||||
valueeditor.ui
|
|
||||||
|
|
||||||
RESOURCES += proparser.qrc
|
RESOURCES += proparser.qrc
|
||||||
|
|||||||
@@ -1,496 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "valueeditor.h"
|
|
||||||
#include "proitems.h"
|
|
||||||
#include "proeditormodel.h"
|
|
||||||
#include "proiteminfo.h"
|
|
||||||
|
|
||||||
#include <QtGui/QMenu>
|
|
||||||
#include <QtGui/QKeyEvent>
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager::Internal;
|
|
||||||
|
|
||||||
ValueEditor::ValueEditor(QWidget *parent)
|
|
||||||
: QWidget(parent),
|
|
||||||
m_model(0),
|
|
||||||
m_handleModelChanges(true),
|
|
||||||
m_infomanager(0)
|
|
||||||
{
|
|
||||||
setupUi(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
ValueEditor::~ValueEditor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::initialize(ProEditorModel *model, ProItemInfoManager *infomanager)
|
|
||||||
{
|
|
||||||
m_model = model;
|
|
||||||
m_infomanager = infomanager;
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::hideVariable()
|
|
||||||
{
|
|
||||||
m_varGroupBox->setVisible(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::showVariable(bool advanced)
|
|
||||||
{
|
|
||||||
m_varComboBoxLabel->setVisible(!advanced);
|
|
||||||
m_varComboBox->setVisible(!advanced);
|
|
||||||
|
|
||||||
m_varLineEditLabel->setVisible(advanced);
|
|
||||||
m_varLineEdit->setVisible(advanced);
|
|
||||||
|
|
||||||
m_assignComboBoxLabel->setVisible(advanced);
|
|
||||||
m_assignComboBox->setVisible(advanced);
|
|
||||||
|
|
||||||
m_varGroupBox->setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::setItemEditType(ItemEditType type)
|
|
||||||
{
|
|
||||||
m_editStackWidget->setCurrentIndex(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::setDescription(ItemEditType type, const QString &header, const QString &description)
|
|
||||||
{
|
|
||||||
switch (type) {
|
|
||||||
case MultiUndefined:
|
|
||||||
m_multiUndefinedGroupBox->setTitle(header);
|
|
||||||
m_multiUndefinedDescriptionLabel->setVisible(!description.isEmpty());
|
|
||||||
m_multiUndefinedDescriptionLabel->setText(description);
|
|
||||||
break;
|
|
||||||
case MultiDefined:
|
|
||||||
m_multiDefinedGroupBox->setTitle(header);
|
|
||||||
m_multiDefinedDescriptionLabel->setVisible(!description.isEmpty());
|
|
||||||
m_multiDefinedDescriptionLabel->setText(description);
|
|
||||||
break;
|
|
||||||
case SingleUndefined:
|
|
||||||
m_singleUndefinedGroupBox->setTitle(header);
|
|
||||||
m_singleUndefinedDescriptionLabel->setVisible(!description.isEmpty());
|
|
||||||
m_singleUndefinedDescriptionLabel->setText(description);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
m_singleDefinedGroupBox->setTitle(header);
|
|
||||||
m_singleDefinedDescriptionLabel->setVisible(!description.isEmpty());
|
|
||||||
m_singleDefinedDescriptionLabel->setText(description);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::initialize()
|
|
||||||
{
|
|
||||||
hideVariable();
|
|
||||||
setItemEditType(MultiUndefined);
|
|
||||||
|
|
||||||
m_itemListView->setModel(m_model);
|
|
||||||
m_itemListView->setRootIndex(QModelIndex());
|
|
||||||
|
|
||||||
connect(m_itemAddButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(addItem()));
|
|
||||||
connect(m_itemRemoveButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(removeItem()));
|
|
||||||
|
|
||||||
connect(m_itemListView->selectionModel(),
|
|
||||||
SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
|
|
||||||
this, SLOT(updateItemList(const QModelIndex &)));
|
|
||||||
|
|
||||||
connect(m_itemListWidget, SIGNAL(itemChanged(QListWidgetItem *)),
|
|
||||||
this, SLOT(updateItemChanges(QListWidgetItem *)));
|
|
||||||
|
|
||||||
foreach (ProVariableInfo *varinfo, m_infomanager->variables()) {
|
|
||||||
m_varComboBox->addItem(varinfo->name(), varinfo->id());
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(m_varLineEdit, SIGNAL(editingFinished()), this, SLOT(updateVariableId()));
|
|
||||||
connect(m_varComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateVariableId(int)));
|
|
||||||
connect(m_assignComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateVariableOp(int)));
|
|
||||||
|
|
||||||
connect(m_itemLineEdit, SIGNAL(editingFinished()), this, SLOT(updateItemId()));
|
|
||||||
connect(m_itemComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateItemId(int)));
|
|
||||||
|
|
||||||
connect(m_model, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
|
|
||||||
this, SLOT(modelChanged(const QModelIndex &)));
|
|
||||||
|
|
||||||
connect(m_model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
|
|
||||||
this, SLOT(modelChanged(const QModelIndex &)));
|
|
||||||
|
|
||||||
connect(m_model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
|
|
||||||
this, SLOT(modelChanged(const QModelIndex &)));
|
|
||||||
|
|
||||||
updateItemList(QModelIndex());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::modelChanged(const QModelIndex &index)
|
|
||||||
{
|
|
||||||
if (m_handleModelChanges) {
|
|
||||||
if (m_currentIndex == index || m_currentIndex == index.parent())
|
|
||||||
editIndex(m_currentIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::editIndex(const QModelIndex &index)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
m_currentIndex = index;
|
|
||||||
ProBlock *block = m_model->proBlock(index);
|
|
||||||
|
|
||||||
m_varGroupBox->setEnabled(block != 0);
|
|
||||||
m_editStackWidget->setEnabled(block != 0);
|
|
||||||
|
|
||||||
if (!block)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (block->blockKind() & ProBlock::ScopeContentsKind) {
|
|
||||||
showScope(block);
|
|
||||||
} else if (block->blockKind() & ProBlock::VariableKind) {
|
|
||||||
showVariable(static_cast<ProVariable*>(block));
|
|
||||||
} else {
|
|
||||||
showOther(block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ValueEditor::ItemEditType ValueEditor::itemType(bool defined, bool multiple) const
|
|
||||||
{
|
|
||||||
if (defined) {
|
|
||||||
if (multiple)
|
|
||||||
return MultiDefined;
|
|
||||||
else
|
|
||||||
return SingleDefined;
|
|
||||||
} else {
|
|
||||||
if (multiple)
|
|
||||||
return MultiUndefined;
|
|
||||||
else
|
|
||||||
return SingleUndefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::showVariable(ProVariable *variable)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
ProVariableInfo *info = m_infomanager->variable(variable->variable());
|
|
||||||
|
|
||||||
const bool advanced = (!m_model->infoManager() || (info == 0));
|
|
||||||
bool defined = false;
|
|
||||||
bool multiple = true;
|
|
||||||
|
|
||||||
QSet<QString> values;
|
|
||||||
foreach(ProItem *proitem, variable->items()) {
|
|
||||||
if (proitem->kind() == ProItem::ValueKind) {
|
|
||||||
ProValue *val = static_cast<ProValue *>(proitem);
|
|
||||||
values.insert(val->value());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!advanced && info) {
|
|
||||||
defined = !info->values().isEmpty();
|
|
||||||
|
|
||||||
// check if all values are known
|
|
||||||
foreach(QString val, values) {
|
|
||||||
if (!info->value(val)) {
|
|
||||||
defined = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
multiple = info->multiple();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.count() > 1)
|
|
||||||
multiple = true;
|
|
||||||
|
|
||||||
bool wasblocked;
|
|
||||||
|
|
||||||
if (!advanced) {
|
|
||||||
const int index = m_varComboBox->findData(variable->variable(), Qt::UserRole, Qt::MatchExactly);
|
|
||||||
wasblocked = m_varComboBox->blockSignals(true);
|
|
||||||
m_varComboBox->setCurrentIndex(index);
|
|
||||||
m_varComboBox->blockSignals(wasblocked);
|
|
||||||
} else {
|
|
||||||
wasblocked = m_varLineEdit->blockSignals(true);
|
|
||||||
m_varLineEdit->setText(variable->variable());
|
|
||||||
m_varLineEdit->blockSignals(wasblocked);
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemEditType type = itemType(defined, multiple);
|
|
||||||
|
|
||||||
wasblocked = m_assignComboBox->blockSignals(true);
|
|
||||||
m_assignComboBox->setCurrentIndex(variable->variableOperator());
|
|
||||||
m_assignComboBox->blockSignals(wasblocked);
|
|
||||||
|
|
||||||
QString header = tr("Edit Values");
|
|
||||||
QString desc;
|
|
||||||
if (info) {
|
|
||||||
header = tr("Edit %1").arg(info->name());
|
|
||||||
desc = info->description();
|
|
||||||
}
|
|
||||||
setDescription(type, header, desc);
|
|
||||||
|
|
||||||
m_itemListWidget->clear();
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case MultiUndefined: {
|
|
||||||
const QModelIndex parent = m_currentIndex;
|
|
||||||
m_itemListView->setRootIndex(parent);
|
|
||||||
m_itemListView->setCurrentIndex(m_model->index(0,0,parent));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MultiDefined:
|
|
||||||
wasblocked = m_itemListWidget->blockSignals(true);
|
|
||||||
|
|
||||||
foreach(ProValueInfo *valinfo, info->values()) {
|
|
||||||
QListWidgetItem *item = new QListWidgetItem(m_itemListWidget);
|
|
||||||
item->setText(valinfo->name());
|
|
||||||
item->setData(Qt::UserRole, valinfo->id());
|
|
||||||
|
|
||||||
if (values.contains(valinfo->id()))
|
|
||||||
item->setCheckState(Qt::Checked);
|
|
||||||
else
|
|
||||||
item->setCheckState(Qt::Unchecked);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_itemListWidget->blockSignals(wasblocked);
|
|
||||||
break;
|
|
||||||
case SingleUndefined:
|
|
||||||
wasblocked = m_itemLineEdit->blockSignals(true);
|
|
||||||
if (values.isEmpty())
|
|
||||||
m_itemLineEdit->setText(QString());
|
|
||||||
else
|
|
||||||
m_itemLineEdit->setText(values.toList().first());
|
|
||||||
m_itemLineEdit->blockSignals(wasblocked);
|
|
||||||
break;
|
|
||||||
case SingleDefined:
|
|
||||||
wasblocked = m_itemComboBox->blockSignals(true);
|
|
||||||
m_itemComboBox->clear();
|
|
||||||
|
|
||||||
foreach(ProValueInfo *valinfo, info->values()) {
|
|
||||||
m_itemComboBox->addItem(valinfo->name(), valinfo->id());
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = -1;
|
|
||||||
if (!values.isEmpty()) {
|
|
||||||
const QString id = values.toList().first();
|
|
||||||
index = m_itemComboBox->findData(id, Qt::UserRole, Qt::MatchExactly);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_itemComboBox->setCurrentIndex(index);
|
|
||||||
m_itemComboBox->blockSignals(wasblocked);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
showVariable(advanced);
|
|
||||||
setItemEditType(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::showScope(ProBlock *)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
const bool wasblocked = m_itemLineEdit->blockSignals(true);
|
|
||||||
m_itemLineEdit->setText(m_model->data(m_currentIndex, Qt::EditRole).toString());
|
|
||||||
m_itemLineEdit->blockSignals(wasblocked);
|
|
||||||
|
|
||||||
setDescription(SingleUndefined, tr("Edit Scope"));
|
|
||||||
|
|
||||||
hideVariable();
|
|
||||||
setItemEditType(SingleUndefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::showOther(ProBlock *)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
const bool wasblocked = m_itemLineEdit->blockSignals(true);
|
|
||||||
m_itemLineEdit->setText(m_model->data(m_currentIndex, Qt::EditRole).toString());
|
|
||||||
m_itemLineEdit->blockSignals(wasblocked);
|
|
||||||
|
|
||||||
setDescription(SingleUndefined, tr("Edit Advanced Expression"));
|
|
||||||
|
|
||||||
hideVariable();
|
|
||||||
setItemEditType(SingleUndefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::addItem(QString value)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
QModelIndex parent = m_currentIndex;
|
|
||||||
ProVariable *var = static_cast<ProVariable *>(m_model->proBlock(parent));
|
|
||||||
|
|
||||||
if (value.isEmpty()) {
|
|
||||||
value = QLatin1String("...");
|
|
||||||
|
|
||||||
if (ProVariableInfo *varinfo = m_infomanager->variable(var->variable())) {
|
|
||||||
const QList<ProValueInfo *> vals = varinfo->values();
|
|
||||||
if (!vals.isEmpty())
|
|
||||||
value = vals.first()->id();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_handleModelChanges = false;
|
|
||||||
m_model->insertItem(new ProValue(value, var),
|
|
||||||
m_model->rowCount(parent), parent);
|
|
||||||
|
|
||||||
const QModelIndex idx = m_model->index(m_model->rowCount(parent)-1, 0, parent);
|
|
||||||
m_itemListView->setCurrentIndex(idx);
|
|
||||||
m_itemListView->edit(idx);
|
|
||||||
m_itemListView->scrollToBottom();
|
|
||||||
m_handleModelChanges = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::removeItem()
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
m_handleModelChanges = false;
|
|
||||||
const QModelIndex idx = m_itemListView->currentIndex();
|
|
||||||
m_itemListView->closePersistentEditor(idx);
|
|
||||||
m_model->removeItem(idx);
|
|
||||||
m_handleModelChanges = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::updateItemList(const QModelIndex &)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
m_itemRemoveButton->setEnabled(m_model->rowCount(m_currentIndex));
|
|
||||||
}
|
|
||||||
|
|
||||||
QModelIndex ValueEditor::findValueIndex(const QString &id) const
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return QModelIndex();
|
|
||||||
const QModelIndex parent = m_currentIndex;
|
|
||||||
const int rows = m_model->rowCount(parent);
|
|
||||||
|
|
||||||
for (int row=0; row<rows; ++row) {
|
|
||||||
const QModelIndex index = m_model->index(row, 0, parent);
|
|
||||||
ProItem *item = m_model->proItem(index);
|
|
||||||
if (!item || item->kind() != ProItem::ValueKind)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (static_cast<ProValue*>(item)->value() == id)
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
return QModelIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::updateItemChanges(QListWidgetItem *item)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
const QModelIndex parent = m_currentIndex;
|
|
||||||
ProBlock *block = m_model->proBlock(parent);
|
|
||||||
|
|
||||||
if (!block || !(block->blockKind() & ProBlock::VariableKind))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ProVariable *var = static_cast<ProVariable *>(block);
|
|
||||||
const QString id = item->data(Qt::UserRole).toString();
|
|
||||||
|
|
||||||
m_handleModelChanges = false;
|
|
||||||
const QModelIndex index = findValueIndex(id);
|
|
||||||
if (item->checkState() == Qt::Checked && !index.isValid()) {
|
|
||||||
m_model->insertItem(new ProValue(id, var),
|
|
||||||
m_model->rowCount(parent), m_currentIndex);
|
|
||||||
} else if (item->checkState() != Qt::Checked && index.isValid()) {
|
|
||||||
m_model->removeItem(index);
|
|
||||||
}
|
|
||||||
m_handleModelChanges = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::updateVariableId()
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
m_handleModelChanges = false;
|
|
||||||
m_model->setData(m_currentIndex, QVariant(m_varLineEdit->text()));
|
|
||||||
m_handleModelChanges = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::updateVariableId(int index)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
ProVariableInfo *info = m_infomanager->variable(m_varComboBox->itemData(index).toString());
|
|
||||||
|
|
||||||
m_model->setData(m_currentIndex, info->id());
|
|
||||||
m_model->setData(m_currentIndex, info->defaultOperator());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::updateVariableOp(int index)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
m_handleModelChanges = false;
|
|
||||||
m_model->setData(m_currentIndex, QVariant(index));
|
|
||||||
m_handleModelChanges = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::updateItemId()
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
QModelIndex index = m_currentIndex;
|
|
||||||
if (m_varGroupBox->isVisible()) {
|
|
||||||
index = m_model->index(0,0,index);
|
|
||||||
if (!index.isValid()) {
|
|
||||||
addItem(m_itemLineEdit->text());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_handleModelChanges = false;
|
|
||||||
m_model->setData(index, QVariant(m_itemLineEdit->text()));
|
|
||||||
m_handleModelChanges = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueEditor::updateItemId(int index)
|
|
||||||
{
|
|
||||||
if (!m_model)
|
|
||||||
return;
|
|
||||||
QModelIndex idx = m_currentIndex;
|
|
||||||
if (m_varGroupBox->isVisible()) {
|
|
||||||
idx = m_model->index(0,0,idx);
|
|
||||||
if (!idx.isValid()) {
|
|
||||||
addItem(m_itemComboBox->itemData(index).toString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_handleModelChanges = false;
|
|
||||||
m_model->setData(idx, m_itemComboBox->itemData(index));
|
|
||||||
m_handleModelChanges = true;
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef VALUEEDITOR_H
|
|
||||||
#define VALUEEDITOR_H
|
|
||||||
|
|
||||||
#include "namespace_global.h"
|
|
||||||
#include "ui_valueeditor.h"
|
|
||||||
|
|
||||||
#include <QtCore/QList>
|
|
||||||
#include <QtGui/QWidget>
|
|
||||||
#include <QtCore/QPointer>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class ProBlock;
|
|
||||||
class ProVariable;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class ProEditorModel;
|
|
||||||
class ProItemInfoManager;
|
|
||||||
|
|
||||||
class ValueEditor : public QWidget, protected Ui::ValueEditor
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
ValueEditor(QWidget *parent = 0);
|
|
||||||
~ValueEditor();
|
|
||||||
|
|
||||||
void initialize(ProEditorModel *model, ProItemInfoManager *infomanager);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void editIndex(const QModelIndex &index);
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void modelChanged(const QModelIndex &index);
|
|
||||||
|
|
||||||
void addItem(QString value = QString());
|
|
||||||
void removeItem();
|
|
||||||
|
|
||||||
void updateItemList(const QModelIndex &item);
|
|
||||||
void updateItemChanges(QListWidgetItem *item);
|
|
||||||
|
|
||||||
void updateVariableId();
|
|
||||||
void updateVariableId(int index);
|
|
||||||
void updateVariableOp(int index);
|
|
||||||
|
|
||||||
void updateItemId();
|
|
||||||
void updateItemId(int index);
|
|
||||||
|
|
||||||
private:
|
|
||||||
enum ItemEditType {
|
|
||||||
SingleDefined = 0,
|
|
||||||
SingleUndefined = 1,
|
|
||||||
MultiDefined = 2,
|
|
||||||
MultiUndefined = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
void hideVariable();
|
|
||||||
void showVariable(bool advanced);
|
|
||||||
void setItemEditType(ItemEditType type);
|
|
||||||
void setDescription(ItemEditType type, const QString &header, const QString &desc = QString());
|
|
||||||
|
|
||||||
void initialize();
|
|
||||||
|
|
||||||
void showVariable(ProVariable *variable);
|
|
||||||
void showScope(ProBlock *scope);
|
|
||||||
void showOther(ProBlock *block);
|
|
||||||
|
|
||||||
ItemEditType itemType(bool defined, bool multiple) const;
|
|
||||||
QModelIndex findValueIndex(const QString &id) const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QPointer<ProEditorModel> m_model;
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_handleModelChanges;
|
|
||||||
|
|
||||||
QModelIndex m_currentIndex;
|
|
||||||
ProItemInfoManager *m_infomanager;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qt4ProjectManager
|
|
||||||
|
|
||||||
#endif // VALUEEDITOR_H
|
|
||||||
@@ -1,384 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>Qt4ProjectManager::Internal::ValueEditor</class>
|
|
||||||
<widget class="QWidget" name="Qt4ProjectManager::Internal::ValueEditor" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>621</width>
|
|
||||||
<height>557</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="m_varGroupBox" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>5</hsizetype>
|
|
||||||
<vsizetype>4</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="title" >
|
|
||||||
<string>Edit Variable</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<widget class="QComboBox" name="m_varComboBox" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>7</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" >
|
|
||||||
<widget class="QLabel" name="m_varLineEditLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Variable Name:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<widget class="QLabel" name="m_assignComboBoxLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Assignment Operator:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" >
|
|
||||||
<widget class="QLineEdit" name="m_varLineEdit" />
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QLabel" name="m_varComboBoxLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Variable:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" >
|
|
||||||
<widget class="QComboBox" name="m_assignComboBox" >
|
|
||||||
<item>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Append (+=)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Remove (-=)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Replace (~=)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Set (=)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Unique (*=)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QStackedWidget" name="m_editStackWidget" >
|
|
||||||
<property name="currentIndex" >
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="m_singleDefinedPage" >
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="m_singleDefinedGroupBox" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>Select Item</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="m_singleDefinedDescriptionLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="m_itemComboBox" />
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="m_singleUndefinedPage" >
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="m_singleUndefinedGroupBox" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>Edit Item</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="m_singleUndefinedDescriptionLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="m_itemLineEdit" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>5</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="m_multiDefinedPage" >
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="m_multiDefinedGroupBox" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>Select Items</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="m_multiDefinedDescriptionLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QListWidget" name="m_itemListWidget" />
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="m_multiUndefinedPage" >
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="m_multiUndefinedGroupBox" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>Edit Items</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="m_multiUndefinedDescriptionLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QListView" name="m_itemListView" >
|
|
||||||
<property name="uniformItemSizes" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="m_itemAddButton" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>1</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>New</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="m_itemRemoveButton" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>1</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Remove</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>44</width>
|
|
||||||
<height>128</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
Reference in New Issue
Block a user