From f4cc9ec2fad111cdb101f062a8ee63db71e57323 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 27 Aug 2019 22:37:26 +0900 Subject: tdeioslave media: remove duplication of feedback for tdeio_media_helper unlocking failures and leave password input dialog open in case of wrong password supplied. This allows to quickly type in a new password instead of having to repeat the complete procedure. Signed-off-by: Michele Calgaro --- tdeioslave/media/mounthelper/dialog.cpp | 9 ----- tdeioslave/media/mounthelper/dialog.h | 1 - .../media/mounthelper/tdeio_media_mounthelper.cpp | 11 +++--- .../media/mounthelper/tdeio_media_mounthelper.h | 6 ++-- tdeioslave/media/mounthelper/unlockdialog.ui | 40 ---------------------- 5 files changed, 9 insertions(+), 58 deletions(-) diff --git a/tdeioslave/media/mounthelper/dialog.cpp b/tdeioslave/media/mounthelper/dialog.cpp index ab1bb818d..d16c6d974 100644 --- a/tdeioslave/media/mounthelper/dialog.cpp +++ b/tdeioslave/media/mounthelper/dialog.cpp @@ -27,7 +27,6 @@ Dialog::Dialog(TQString url, TQString iconName) : { unlockDialog = new UnlockDialog(this); - unlockDialog->errorBox->hide(); unlockDialog->descLabel->setText(unlockDialog->descLabel->text().arg(url)); unlockDialog->descLabel->adjustSize(); unlockDialog->adjustSize(); @@ -52,14 +51,6 @@ TQString Dialog::getPassword() return unlockDialog->passwordEdit->text(); } -void Dialog::slotDialogError(TQString errorMsg) -{ - kdDebug() << __func__ << "(" << errorMsg << " )" << endl; - - unlockDialog->errorLabel->setText(TQString("%1").arg(errorMsg)); - unlockDialog->errorBox->show(); -} - void Dialog::slotPasswordChanged(const TQString &text) { enableButton( User1, !text.isEmpty() ); diff --git a/tdeioslave/media/mounthelper/dialog.h b/tdeioslave/media/mounthelper/dialog.h index 8444ec7dd..e704e5777 100644 --- a/tdeioslave/media/mounthelper/dialog.h +++ b/tdeioslave/media/mounthelper/dialog.h @@ -50,7 +50,6 @@ public: TQString getPassword(); public slots: - void slotDialogError(TQString errorMsg); void slotPasswordChanged(const TQString &text); private: diff --git a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp index dd12901cc..e4bf41820 100644 --- a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp +++ b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp @@ -163,7 +163,6 @@ MountHelper::MountHelper() : TDEApplication() dialog = new Dialog(url.prettyURL(), iconName); connect(dialog, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(slotSendPassword())); connect(dialog, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotCancel())); - connect(this, TQT_SIGNAL(signalPasswordError(TQString)), dialog, TQT_SLOT(slotDialogError(TQString))); dialog->show(); } else if (args->isSet("l")) @@ -293,7 +292,7 @@ void MountHelper::ejectFinished(TDEProcess *proc) } } -void MountHelper::errorAndExit() +void MountHelper::error() { TQString prettyErrorString = m_errorStr; if (m_errorStr.contains("<") && m_errorStr.contains(">")) { @@ -302,6 +301,11 @@ void MountHelper::errorAndExit() } } KMessageBox::error(0, prettyErrorString); +} + +void MountHelper::errorAndExit() +{ + error(); ::exit(1); } @@ -320,8 +324,7 @@ void MountHelper::slotSendPassword() else { m_errorStr = unlockResult.contains("errStr") ? unlockResult["errStr"].toString() : i18n("Unknown unlock error."); kdDebug() << "medium unlock " << m_errorStr << endl; - emit signalPasswordError(m_errorStr); - errorAndExit(); + error(); } } diff --git a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h index 60cdb064d..60b6c3379 100644 --- a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h +++ b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h @@ -1,5 +1,5 @@ /* This file is part of the KDE project - Copyright (c) 2004 Kévin Ottens + Copyright (c) 2004 Kévin Ottens Parts of this file are Copyright 2003 Waldo Bastian @@ -42,15 +42,13 @@ private: TQString m_errorStr; TQString m_mediumId; Dialog *dialog; + void error(); private slots: void slotSendPassword(); void slotCancel(); void ejectFinished(TDEProcess* proc); void errorAndExit(); - -signals: - void signalPasswordError(TQString errorMsg); }; #endif diff --git a/tdeioslave/media/mounthelper/unlockdialog.ui b/tdeioslave/media/mounthelper/unlockdialog.ui index 3a5ccb620..7b78cdb42 100644 --- a/tdeioslave/media/mounthelper/unlockdialog.ui +++ b/tdeioslave/media/mounthelper/unlockdialog.ui @@ -155,46 +155,6 @@ - - - errorBox - - - - 3 - 3 - 0 - 0 - - - - Error - - - - unnamed - - - - errorLabel - - - - 3 - 3 - 0 - 0 - - - - - - - WordBreak|AlignTop - - - - -- cgit v1.2.1