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 <michele.calgaro@yahoo.it>
pull/35/head
Michele Calgaro 5 years ago
parent 1a089178fa
commit f4cc9ec2fa
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -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("<b>%1</b>").arg(errorMsg));
unlockDialog->errorBox->show();
}
void Dialog::slotPasswordChanged(const TQString &text)
{
enableButton( User1, !text.isEmpty() );

@ -50,7 +50,6 @@ public:
TQString getPassword();
public slots:
void slotDialogError(TQString errorMsg);
void slotPasswordChanged(const TQString &text);
private:

@ -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();
}
}

@ -1,5 +1,5 @@
/* This file is part of the KDE project
Copyright (c) 2004 Kévin Ottens <ervin ipsquad net>
Copyright (c) 2004 Kévin Ottens <ervin ipsquad net>
Parts of this file are
Copyright 2003 Waldo Bastian <bastian@kde.org>
@ -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

@ -155,46 +155,6 @@
</widget>
</hbox>
</widget>
<widget class="TQGroupBox" row="2" column="0">
<property name="name">
<cstring>errorBox</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Error</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>errorLabel</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string></string>
</property>
<property name="alignment">
<set>WordBreak|AlignTop</set>
</property>
</widget>
</grid>
</widget>
</grid>
</widget>
<layoutdefaults spacing="6" margin="11"/>

Loading…
Cancel
Save