Import release 2.0.1
This commit is contained in:
+75
-26
@@ -111,6 +111,10 @@ InitialView::InitialView( QWidget *parent )
|
||||
this, SLOT ( slotClickedUrl(const QString&) ) );
|
||||
connect( statusLabel_, SIGNAL( linkActivated(const QString&) ),
|
||||
this, SLOT ( slotClickedUrl(const QString&) ) );
|
||||
connect( rememberPasswordCheckBox_, SIGNAL( stateChanged(int) ),
|
||||
this, SLOT (rememberPasswordStateChanged(int) ) );
|
||||
connect( rememberAutoLoginCheckBox_, SIGNAL( stateChanged(int) ),
|
||||
this, SLOT ( autoLoginStateChanged(int) ) );
|
||||
|
||||
// Enable tooltips for the two URL labels (they're disabled by default)
|
||||
newAccountLabel_->setUseTips( true );
|
||||
@@ -183,6 +187,17 @@ void InitialView::addAccount(Account *account)
|
||||
|
||||
|
||||
|
||||
//The "auto connect" checkbox changed its state
|
||||
void InitialView::autoLoginStateChanged( int state )
|
||||
{
|
||||
if( state == Qt::Checked )
|
||||
{
|
||||
rememberPasswordCheckBox_->setCheckState( Qt::Checked );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Modify an account in the list of displayed accounts from which the user can choose
|
||||
void InitialView::changedAccount( QString oldName, QString newName )
|
||||
{
|
||||
@@ -226,9 +241,10 @@ void InitialView::changedAccount( QString oldName, QString newName )
|
||||
* This method starts reconnecting to an account
|
||||
*
|
||||
* @param handle The email address of the account to reconnect
|
||||
* @param waitWhenUnknown Wait before (re)connecting when network status is Unknown
|
||||
* @param connectImmediately Whether to wait for a little time or not before (re)connecting.
|
||||
* Useful when reconnecting.
|
||||
*/
|
||||
void InitialView::reconnect( QString handle, bool waitWhenUnknown )
|
||||
void InitialView::reconnect( QString handle, bool connectImmediately )
|
||||
{
|
||||
#ifdef KMESSDEBUG_INITIALVIEW
|
||||
kDebug() << "Reconnecting account" << handle;
|
||||
@@ -269,9 +285,16 @@ void InitialView::reconnect( QString handle, bool waitWhenUnknown )
|
||||
// We're connected to the network, try connecting now
|
||||
case Solid::Networking::Connected:
|
||||
#ifdef KMESSDEBUG_INITIALVIEW
|
||||
kDebug() << "Network status: Connected. Waiting a little bit for reconnection.";
|
||||
kDebug() << "Network status: Connected. Scheduling reconnection.";
|
||||
#endif
|
||||
reconnectionRemainingSeconds_ = 5;
|
||||
if( connectImmediately )
|
||||
{
|
||||
reconnectionRemainingSeconds_ = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
reconnectionRemainingSeconds_ = 5;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -303,14 +326,15 @@ void InitialView::reconnect( QString handle, bool waitWhenUnknown )
|
||||
#ifdef KMESSDEBUG_INITIALVIEW
|
||||
kDebug() << "Network status: Unknown. Scheduling reconnection.";
|
||||
#endif
|
||||
reconnectionRemainingSeconds_ = 30;
|
||||
|
||||
// When the user starts kmess and the connection status is unknown, connect immediately.
|
||||
if( ! waitWhenUnknown )
|
||||
if( connectImmediately )
|
||||
{
|
||||
// FIXME? wait 5 seconds here, like when Connected?
|
||||
reconnectionRemainingSeconds_ = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
reconnectionRemainingSeconds_ = 30;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -478,6 +502,7 @@ void InitialView::updateView()
|
||||
Account *account = accounts_[ getSelectedHandle() ];
|
||||
if( account != 0 )
|
||||
{
|
||||
rememberAutoLoginCheckBox_->setChecked( false );
|
||||
// User typed the full account name without using autocompletion.
|
||||
if( ! account->getSavePassword() )
|
||||
{
|
||||
@@ -488,6 +513,12 @@ void InitialView::updateView()
|
||||
{
|
||||
rememberPasswordCheckBox_->setChecked( true );
|
||||
passwordEdit_->setText( account->getPassword() );
|
||||
|
||||
// Check the auto login checkbox
|
||||
if( account->getUseAutologin() )
|
||||
{
|
||||
rememberAutoLoginCheckBox_->setChecked( true );
|
||||
}
|
||||
}
|
||||
|
||||
// Set the current account picture
|
||||
@@ -547,10 +578,12 @@ void InitialView::updateView()
|
||||
}
|
||||
|
||||
// Set the default options
|
||||
rememberAccountCheckBox_ ->setDisabled( false );
|
||||
rememberPasswordCheckBox_->setDisabled( false );
|
||||
rememberAccountCheckBox_ ->setChecked ( true );
|
||||
rememberPasswordCheckBox_->setChecked ( false );
|
||||
rememberAccountCheckBox_ ->setDisabled( false );
|
||||
rememberPasswordCheckBox_ ->setDisabled( false );
|
||||
rememberAutoLoginCheckBox_->setDisabled( false );
|
||||
rememberAccountCheckBox_ ->setChecked ( true );
|
||||
rememberPasswordCheckBox_ ->setChecked ( false );
|
||||
rememberAutoLoginCheckBox_->setChecked ( false );
|
||||
|
||||
// Clear password again
|
||||
passwordEdit_->setText( QString::null );
|
||||
@@ -563,17 +596,31 @@ void InitialView::updateView()
|
||||
|
||||
|
||||
|
||||
// Called when "remember account" change its state
|
||||
// The "remember account" checkbox changed its state
|
||||
void InitialView::rememberAccountStateChanged( int state )
|
||||
{
|
||||
if( state == Qt::Unchecked )
|
||||
{
|
||||
rememberPasswordCheckBox_->setCheckState( Qt::Unchecked );
|
||||
rememberPasswordCheckBox_->setEnabled( false );
|
||||
rememberPasswordCheckBox_ ->setCheckState( Qt::Unchecked );
|
||||
rememberAutoLoginCheckBox_->setCheckState( Qt::Unchecked );
|
||||
rememberPasswordCheckBox_ ->setEnabled( false );
|
||||
rememberAutoLoginCheckBox_->setEnabled( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
rememberPasswordCheckBox_->setEnabled( true );
|
||||
rememberPasswordCheckBox_ ->setEnabled( true );
|
||||
rememberAutoLoginCheckBox_->setEnabled( true );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// The "remember password" checkbox changed its state
|
||||
void InitialView::rememberPasswordStateChanged( int state )
|
||||
{
|
||||
if( state == Qt::Unchecked )
|
||||
{
|
||||
rememberAutoLoginCheckBox_->setCheckState( Qt::Unchecked );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,12 +648,13 @@ void InitialView::setEnabled( bool isEnabled )
|
||||
{
|
||||
isConnectingUI_ = ( ! isEnabled );
|
||||
|
||||
initialStatusLabel_ ->setEnabled( isEnabled );
|
||||
initialStatus_ ->setEnabled( isEnabled );
|
||||
handleCombobox_ ->setEnabled( isEnabled );
|
||||
passwordEdit_ ->setEnabled( isEnabled );
|
||||
rememberAccountCheckBox_ ->setEnabled( isEnabled );
|
||||
rememberPasswordCheckBox_->setEnabled( isEnabled );
|
||||
initialStatusLabel_ ->setEnabled( isEnabled );
|
||||
initialStatus_ ->setEnabled( isEnabled );
|
||||
handleCombobox_ ->setEnabled( isEnabled );
|
||||
passwordEdit_ ->setEnabled( isEnabled );
|
||||
rememberAccountCheckBox_ ->setEnabled( isEnabled );
|
||||
rememberPasswordCheckBox_ ->setEnabled( isEnabled );
|
||||
rememberAutoLoginCheckBox_->setEnabled( isEnabled );
|
||||
|
||||
// Switch the button's look
|
||||
if( isEnabled )
|
||||
@@ -659,8 +707,6 @@ void InitialView::slotConnectClicked()
|
||||
*/
|
||||
bool InitialView::startConnecting( const QString handle, bool emitConnectionSignal )
|
||||
{
|
||||
const QString password( passwordEdit_->text() );
|
||||
|
||||
// If the reconnection timer is active, stop it.
|
||||
if( reconnectionTimer_.isActive() )
|
||||
{
|
||||
@@ -672,6 +718,8 @@ bool InitialView::startConnecting( const QString handle, bool emitConnectionSign
|
||||
// password to appear
|
||||
handleCombobox_->setEditText( handle );
|
||||
|
||||
const QString password( passwordEdit_->text() );
|
||||
|
||||
// Avoid connecting with empty fields
|
||||
if( handle.isEmpty() || password.isEmpty() )
|
||||
{
|
||||
@@ -742,8 +790,9 @@ bool InitialView::startConnecting( const QString handle, bool emitConnectionSign
|
||||
// Inform parent with the account information
|
||||
emit connectWithAccount( handle,
|
||||
password,
|
||||
rememberAccountCheckBox_ ->isChecked(),
|
||||
rememberPasswordCheckBox_->isChecked(),
|
||||
rememberAccountCheckBox_ ->isChecked(),
|
||||
rememberPasswordCheckBox_ ->isChecked(),
|
||||
rememberAutoLoginCheckBox_->isChecked(),
|
||||
initialStatus );
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user