Revert "Implemented SANKORE-765."

This reverts commit 90c03c866c.
preferencesAboutTextFull
Guillaume Burel 12 years ago
parent 90c03c866c
commit 076e0edf36
  1. 83
      src/adaptors/publishing/UBDocumentPublisher.cpp
  2. 29
      src/adaptors/publishing/UBDocumentPublisher.h

@ -77,19 +77,15 @@ void UBDocumentPublisher::publish()
//check that the username and password are stored on preferences //check that the username and password are stored on preferences
UBSettings* settings = UBSettings::settings(); UBSettings* settings = UBSettings::settings();
mUsername = settings->communityUsername(); if(settings->communityUsername().isEmpty() || settings->communityPassword().isEmpty()){
mPassword = settings->communityPassword(); UBApplication::showMessage(tr("Credentials has to not been filled out yet."));
qDebug() << "trying to connect to community without the required credentials";
if (mUsername.isEmpty() || mPassword.isEmpty()){
UBLoginDlg dlg;
if (dlg.exec() == QDialog::Accepted) {
mUsername = dlg.username();
mPassword = dlg.password();
}
else
return; return;
} }
mUsername = settings->communityUsername();
mPassword = settings->communityPassword();
UBPublicationDlg dlg; UBPublicationDlg dlg;
if(QDialog::Accepted == dlg.exec()) if(QDialog::Accepted == dlg.exec())
{ {
@ -655,73 +651,6 @@ QString UBDocumentPublisher::getBase64Of(QString stringToEncode)
return stringToEncode.toAscii().toBase64(); return stringToEncode.toAscii().toBase64();
} }
UBLoginDlg::UBLoginDlg(QWidget *parent, const char *name)
: QDialog(parent)
, mUsernameLabel(tr("Username:"), this)
, mUsernameLineEdit(this)
, mPasswordLabel(tr("Password:"), this)
, mPasswordLineEdit(this)
, mRememberLabel(tr("Remember credentials"), this)
, mButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this)
{
setObjectName(name);
setFixedSize(400, 150);
setWindowTitle(tr("Login"));
setLayout(&mLayout);
mLayout.addLayout(&mUsernameLayout);
mLayout.addLayout(&mPasswordLayout);
mLayout.addLayout(&mRememberLayout);
mUsernameLayout.addWidget(&mUsernameLabel, 0);
mUsernameLayout.addWidget(&mUsernameLineEdit, 1);
mPasswordLayout.addWidget(&mPasswordLabel, 0);
mPasswordLineEdit.setEchoMode(QLineEdit::Password);
mPasswordLayout.addWidget(&mPasswordLineEdit, 1);
mRememberLayout.addWidget(&mRememberCheckBox, 0);
mRememberLayout.addWidget(&mRememberLabel, 1);
mLayout.addWidget(&mButtons);
connect(&mButtons, SIGNAL(accepted()), this, SLOT(onButtonsAccepted()));
connect(&mButtons, SIGNAL(rejected()), this, SLOT(reject()));
}
UBLoginDlg::~UBLoginDlg()
{
/* NOOP */
}
QString UBLoginDlg::username()
{
return mUsernameLineEdit.text();
}
QString UBLoginDlg::password()
{
return mPasswordLineEdit.text();
}
bool UBLoginDlg::hasToRemember()
{
return mRememberCheckBox.checkState() == Qt::Checked;
}
void UBLoginDlg::onButtonsAccepted()
{
if (username().isEmpty() || password().isEmpty())
return;
if (hasToRemember()) {
UBSettings* settings = UBSettings::settings();
settings->setCommunityUsername(username());
settings->setCommunityPassword(password());
}
accept();
}
// --------------------------------------------------------- // ---------------------------------------------------------
UBProxyLoginDlg::UBProxyLoginDlg(QWidget *parent, const char *name):QDialog(parent) UBProxyLoginDlg::UBProxyLoginDlg(QWidget *parent, const char *name):QDialog(parent)
, mpLayout(NULL) , mpLayout(NULL)

@ -33,35 +33,6 @@ class UBServerXMLHttpRequest;
class UBGraphicsW3CWidgetItem; class UBGraphicsW3CWidgetItem;
class QWebView; class QWebView;
class UBLoginDlg : public QDialog
{
Q_OBJECT
public:
UBLoginDlg(QWidget* parent = 0, const char* name = "LoginDlg");
~UBLoginDlg();
QString username();
QString password();
private slots:
void onButtonsAccepted();
private:
bool hasToRemember();
QVBoxLayout mLayout;
QHBoxLayout mUsernameLayout;
QHBoxLayout mPasswordLayout;
QHBoxLayout mRememberLayout;
QLabel mUsernameLabel;
QLineEdit mUsernameLineEdit;
QLabel mPasswordLabel;
QLineEdit mPasswordLineEdit;
QCheckBox mRememberCheckBox;
QLabel mRememberLabel;
QDialogButtonBox mButtons;
};
class UBProxyLoginDlg : public QDialog class UBProxyLoginDlg : public QDialog
{ {
Q_OBJECT Q_OBJECT

Loading…
Cancel
Save