summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-05-28 22:38:24 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-05-28 22:38:24 -0400
commit156e8386329eb032ae7e9fef4de49595e225248b (patch)
treea63e1ee8cf694b71f7a56b5f23d069b20ac48a56 /sigmodr/widgets
parent5f587c8985c8fe9d1ef60d1ca975f5c44ca46ebd (diff)
downloadsigen-156e8386329eb032ae7e9fef4de49595e225248b.tar.gz
sigen-156e8386329eb032ae7e9fef4de49595e225248b.tar.xz
sigen-156e8386329eb032ae7e9fef4de49595e225248b.zip
Remove the context menu from the widgets and use a button instead
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();
};
}
}