*/
QString getKeyOption();
- /*! Password or passphrase (UNSECURE!)
- */
- virtual QString getPassword() const = 0;
-
private:
/*! Receiver for debugMsg(QString&) signals */
QObject* debugMonitor_;
password_ = QString();
}
-QString UrpoConnectionSettings::getPassword() const
-{
- return password_;
-}
-
-void UrpoConnectionSettings::setPassword(QString &password)
-{
- password_ = password;
-}
void UrpoConnectionSettings::store() const
{
QString getIdentity() const;
QString getUserid() const;
- QString getPassword() const;
- void setPassword(QString &password);
-
void setHost(const QString &host);
void setIdentity(const QString &password);
void setUserid(const QString &userid);
#include "settingsdialog.h"
-#define VERSION "0.9" /*! Program version */
+#define VERSION "0.92" /*! Program version */
UrpoMainWindow::UrpoMainWindow(QWidget *parent)
: QMainWindow(parent)
QString helpfilename = QString(":/help/index_") + language.left(2).toLower() + QString(".html");
- monitor_->debugMessage(helpfilename);
-
QFile helpfile( helpfilename );
if( helpfile.exists() )
helpBrowser_->setSource(QUrl( QString("qrc") + helpfilename ));
{
// If process is still running, it means timeout!
if( status_ == Running)
- {
- // Read output
- QByteArray bytes = qprocess_.readAllStandardOutput();
- QString string(bytes);
- sendDebugMessage(string);
-
- if(string.contains("'s password:") || string.contains("passphrase:"))
- {
- // Try to ask password
- if( storedPassword_.isEmpty())
- {
- if( string.contains("'s password:") )
- storedPassword_ = QInputDialog::getText( 0, tr("Server ask password"), tr("Password:"), QLineEdit::PasswordEchoOnEdit );
- else
- storedPassword_ = QInputDialog::getText( 0, tr("Server ask passphrase"), tr("Passphrase:"), QLineEdit::PasswordEchoOnEdit );
- }
- qprocess_.write(storedPassword_.toAscii());
- qprocess_.write("\n");
-
- QTimer::singleShot( getTimeout(), this, SLOT(timeout()) );
- status_ = PasswdRunning;
- }
- else
- fail( Timeout );
- }
- else if( status_ == PasswdRunning )
fail(Timeout); // FAILS !!!
}
Ready /*! Ready for connecting */ = 0,
Running /*! Command running */ = 1,
Successed /*! Command successed */ = 2,
- Failed /*! Command failed */ = 3,
- PasswdRunning /*! Running after password sent */ = 11
+ Failed /*! Command failed */ = 3
};
enum UrpoError {
private:
- static int const DEFAULTTIMEOUT = 15000;
+ static int const DEFAULTTIMEOUT = 20000;
void fail(UrpoError error);
UrpoStatus status_;
UrpoError error_;
int timeout_; /*! Timeout in msecs */
- QString storedPassword_; /* Password to store */
};
#endif // URPOPROCESS_H