~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to src/changepwdlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *
19
19
 */
20
20
 
21
 
#include"changepwdlg.h"
 
21
#include "changepwdlg.h"
22
22
 
23
 
#include<qlayout.h>
24
 
#include<qlabel.h>
25
 
#include<qpushbutton.h>
26
 
#include<qlineedit.h>
27
 
#include<qmessagebox.h>
28
 
#include"profiles.h"
29
 
#include"psiaccount.h"
30
 
#include"busywidget.h"
31
 
#include"im.h"
32
 
#include"xmpp_tasks.h"
33
 
#include"accountdlg.h"
34
 
#include"iconwidget.h"
 
23
#include <qlayout.h>
 
24
#include <qlabel.h>
 
25
#include <qpushbutton.h>
 
26
#include <qlineedit.h>
 
27
#include <qmessagebox.h>
 
28
#include "profiles.h"
 
29
#include "psiaccount.h"
 
30
#include "busywidget.h"
 
31
#include "xmpp_tasks.h"
 
32
#include "accountmodifydlg.h"
 
33
#include "iconwidget.h"
35
34
 
36
35
using namespace XMPP;
37
36
 
38
 
ChangePasswordDlg::ChangePasswordDlg(PsiAccount *_pa, QWidget *parent, const char *name)
39
 
:ChangePasswordUI(parent, name, FALSE, WDestructiveClose)
 
37
ChangePasswordDlg::ChangePasswordDlg(PsiAccount *_pa, QWidget *parent)
 
38
:QDialog(parent)
40
39
{
41
 
        pa = _pa;
 
40
        setupUi(this);
 
41
        setModal(false);
 
42
        pa = _pa;
42
43
        pa->dialogRegister(this);
43
44
 
44
45
        connect(pa, SIGNAL(disconnected()), SLOT(disc()));
45
46
 
46
 
        setCaption(CAP(caption()));
 
47
        setWindowTitle(CAP(caption()));
47
48
 
48
49
        connect(pb_close, SIGNAL(clicked()), SLOT(close()));
49
50
        connect(pb_apply, SIGNAL(clicked()), SLOT(apply()));
112
113
                UserAccount acc = pa->userAccount();
113
114
                acc.pass = le_pwnew->text();
114
115
                pa->setUserAccount(acc);
115
 
                AccountModifyDlg *amd = (AccountModifyDlg *)pa->dialogFind("AccountModifyDlg");
 
116
                AccountModifyDlg *amd = pa->findDialog<AccountModifyDlg*>();
116
117
                if(amd)
117
118
                        amd->setPassword(acc.pass);
118
119
 
124
125
                if(code == Task::ErrDisc)
125
126
                        return;
126
127
 
127
 
                QMessageBox::critical(this, tr("Error"), QString(tr("There was an error when trying to set the password.\nReason: %1")).arg(err) );
 
128
                QMessageBox::critical(this, tr("Error"), QString(tr("There was an error when trying to set the password.\nReason: %1")).arg(QString(err).replace('\n', "<br>")));
128
129
                restoreWidgets();
129
130
        }
130
131
}