summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'sigmodr/widgets')
-rw-r--r--sigmodr/widgets/ObjectUI.cpp34
-rw-r--r--sigmodr/widgets/ObjectUI.h4
2 files changed, 11 insertions, 27 deletions
diff --git a/sigmodr/widgets/ObjectUI.cpp b/sigmodr/widgets/ObjectUI.cpp
index 3c40c8be..aed2a052 100644
--- a/sigmodr/widgets/ObjectUI.cpp
+++ b/sigmodr/widgets/ObjectUI.cpp
@@ -42,7 +42,6 @@ ObjectUI::ObjectUI(Object* object, QWidget* parent) :
{
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(changed(bool)), SLOT(setChanged(bool)));
- connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(contextMenu(QPoint)));
emit(changed(false));
}
@@ -71,6 +70,16 @@ void ObjectUI::discard()
emit(changed(false));
}
+void ObjectUI::validate()
+{
+ if (m_changed)
+ apply();
+ if (m_validator)
+ delete m_validator;
+ m_validator = new ValidationDialog(m_object, this);
+ m_validator->show();
+}
+
void ObjectUI::setPrivate(ObjectUIPrivate* priv)
{
QVBoxLayout* layout = new QVBoxLayout;
@@ -83,26 +92,3 @@ void ObjectUI::setChanged(const bool changed)
{
m_changed = changed;
}
-
-void ObjectUI::contextMenu(const QPoint& pos)
-{
- KMenu* menu = new KMenu;
- menu->addAction("&Apply", this, SLOT(apply()));
- menu->addAction("&Discard", this, SLOT(discard()));
- menu->addSeparator();
- KAction* validate = new KAction("&Validate", this);
- connect(validate, SIGNAL(triggered()), this, SLOT(validate()));
- validate->setEnabled(!m_changed);
- menu->addAction(validate);
- menu->popup(mapToGlobal(pos));
-}
-
-void ObjectUI::validate()
-{
- if (m_changed)
- apply();
- if (m_validator)
- delete m_validator;
- m_validator = new ValidationDialog(m_object, this);
- m_validator->show();
-}
diff --git a/sigmodr/widgets/ObjectUI.h b/sigmodr/widgets/ObjectUI.h
index 248a16b8..b909fa0e 100644
--- a/sigmodr/widgets/ObjectUI.h
+++ b/sigmodr/widgets/ObjectUI.h
@@ -51,6 +51,7 @@ class SIGMODRWIDGETS_EXPORT ObjectUI : public QWidget
public slots:
virtual void apply();
virtual void discard();
+ void validate();
signals:
void saved();
void changed(const bool changed = true);
@@ -64,9 +65,6 @@ class SIGMODRWIDGETS_EXPORT ObjectUI : public QWidget
ValidationDialog* m_validator;
private slots:
void setChanged(const bool changed = true);
-
- void contextMenu(const QPoint& pos);
- void validate();
};
}
}