summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Riddell <jr@jriddell.org>2016-09-23 12:47:48 (GMT)
committerJonathan Riddell <jr@jriddell.org>2016-09-23 12:50:13 (GMT)
commitf263eae81511855f4a108cda27bacb6f65d2622f (patch)
tree2b48fbee85a2be09baa51bea56cfc547f5979047
parent50e0fb5448f70cd14001543dfeb26e238254adc9 (diff)
detect if the install has failed and show message if so
-rw-r--r--samba/filepropertiesplugin/sambausershareplugin.cpp18
-rw-r--r--samba/filepropertiesplugin/sambausershareplugin.h1
2 files changed, 17 insertions, 2 deletions
diff --git a/samba/filepropertiesplugin/sambausershareplugin.cpp b/samba/filepropertiesplugin/sambausershareplugin.cpp
index 1833df3..1fb4dc1 100644
--- a/samba/filepropertiesplugin/sambausershareplugin.cpp
+++ b/samba/filepropertiesplugin/sambausershareplugin.cpp
@@ -74,6 +74,15 @@ SambaUserSharePlugin::SambaUserSharePlugin(QObject *parent, const QList<QVariant
properties->setFileSharingPage(vbox);
QVBoxLayout *vLayoutMaster = new QVBoxLayout(vbox);
+ m_failedSambaWidgets = new QWidget(vbox);
+ vLayoutMaster->addWidget(m_failedSambaWidgets);
+ QVBoxLayout *vFailedLayout = new QVBoxLayout(m_failedSambaWidgets);
+ vFailedLayout->setAlignment(Qt::AlignJustify);
+ vFailedLayout->setMargin(0);
+ vFailedLayout->addWidget(new QLabel(i18n("The Samba package failed to install."), m_failedSambaWidgets));
+ vFailedLayout->addStretch();
+ m_failedSambaWidgets->hide();
+
m_installSambaWidgets = new QWidget(vbox);
vLayoutMaster->addWidget(m_installSambaWidgets);
QVBoxLayout *vLayout = new QVBoxLayout(m_installSambaWidgets);
@@ -160,8 +169,13 @@ void SambaUserSharePlugin::packageInstall(PackageKit::Transaction::Info info,
void SambaUserSharePlugin::packageFinished(PackageKit::Transaction::Exit status, uint runtime)
{
- m_installSambaWidgets->hide();
- m_shareWidgets->show();
+ if (status == PackageKit::Transaction::ExitSuccess) {
+ m_installSambaWidgets->hide();
+ m_shareWidgets->show();
+ } else {
+ m_installSambaWidgets->hide();
+ m_failedSambaWidgets->show();
+ }
}
#endif // SAMBA_INSTALL
diff --git a/samba/filepropertiesplugin/sambausershareplugin.h b/samba/filepropertiesplugin/sambausershareplugin.h
index d66aa5a..2d356fd 100644
--- a/samba/filepropertiesplugin/sambausershareplugin.h
+++ b/samba/filepropertiesplugin/sambausershareplugin.h
@@ -63,6 +63,7 @@ private:
KSambaShareData shareData;
UserPermissionModel *model;
Ui::PropertiesPageGUI propertiesUi;
+ QWidget *m_failedSambaWidgets;
QWidget *m_installSambaWidgets;
QWidget *m_shareWidgets;
QProgressBar *m_installProgress;