summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-27 12:01:18 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-27 12:01:27 (GMT)
commit47c8adad58b9a9e7a5d1f39a4cce18be9d2d050d (patch)
tree0254d8228e7c45732a5ff34118d41dfcb3948bef
parent386a19954b64ca38578dcff8cd0ecb279f477130 (diff)
Update buttons
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
index c9ed341..6aa2ebc 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
@@ -18,6 +18,7 @@
*/
#include "viewerpluginexternalconfigurewidget.h"
+#include "viewerpluginexternaleditdialog.h"
#include <QVBoxLayout>
#include <QStandardPaths>
#include <KLocalizedString>
@@ -25,6 +26,7 @@
#include <QListWidget>
#include <QPushButton>
#include <KMessageBox>
+#include <QPointer>
ViewerPluginExternalConfigureWidget::ViewerPluginExternalConfigureWidget(QWidget *parent)
: QWidget(parent)
@@ -71,17 +73,26 @@ ViewerPluginExternalConfigureWidget::~ViewerPluginExternalConfigureWidget()
void ViewerPluginExternalConfigureWidget::slotRemoveScript()
{
+ QListWidgetItem *item = mListExternal->currentItem();
+ if (item) {
+ }
}
void ViewerPluginExternalConfigureWidget::slotModifyScript()
{
+ QListWidgetItem *item = mListExternal->currentItem();
+ if (item) {
+ }
}
void ViewerPluginExternalConfigureWidget::slotAddScript()
{
+ QListWidgetItem *item = mListExternal->currentItem();
+ if (item) {
+ }
}
void ViewerPluginExternalConfigureWidget::load()
@@ -113,10 +124,18 @@ void ViewerPluginExternalConfigureWidget::save()
void ViewerPluginExternalConfigureWidget::reset()
{
-
+ //No implemented.
}
void ViewerPluginExternalConfigureWidget::updateButtons()
{
-
+ QListWidgetItem *item = mListExternal->currentItem();
+ if (item) {
+ const bool isReadOnly = item->data(ReadOnly).toBool();
+ mRemoveScript->setEnabled(!isReadOnly);
+ mModifyScript->setEnabled(!isReadOnly);
+ } else {
+ mRemoveScript->setEnabled(false);
+ mModifyScript->setEnabled(false);
+ }
}