~ubuntu-branches/ubuntu/wily/psi/wily-proposed

« back to all changes in this revision

Viewing changes to src/mucjoindlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "psiaccount.h"
29
29
#include "mucjoindlg.h"
30
30
#include "psicontactlist.h"
 
31
#include "groupchatdlg.h"
31
32
 
32
33
MUCJoinDlg::MUCJoinDlg(PsiCon* psi, PsiAccount* pa)
33
34
        : QDialog(0)
88
89
                //int n = QMessageBox::information(0, tr("Warning"), tr("Are you sure you want to cancel joining groupchat?"), tr("&Yes"), tr("&No"));
89
90
                //if(n != 0)
90
91
                //      return;
91
 
                account_->groupChatLeave(jid_.host(), jid_.user());
 
92
                account_->groupChatLeave(jid_.domain(), jid_.node());
92
93
        }
93
94
        QDialog::done(r);
94
95
}
129
130
        if (jid.full().isEmpty())
130
131
                return;
131
132
 
132
 
        ui_.le_host->setText(jid.host());
133
 
        ui_.le_room->setText(jid.user());
 
133
        ui_.le_host->setText(jid.domain());
 
134
        ui_.le_room->setText(jid.node());
134
135
        ui_.le_nick->setText(jid.resource());
135
136
}
136
137
 
155
156
                return;
156
157
        }
157
158
 
 
159
        GCMainDlg *gc = account_->findDialog<GCMainDlg*>(j.bare());
 
160
        if (gc) {
 
161
                gc->bringToFront();
 
162
                if (gc->isInactive()) {
 
163
                        gc->reactivate();
 
164
                }
 
165
                joined();
 
166
                return;
 
167
        }
 
168
 
 
169
 
158
170
        if (!account_->groupChatJoin(host, room, nick, pass, !ui_.ck_history->isChecked())) {
159
171
                QMessageBox::information(this, tr("Error"), tr("You are in or joining this room already!"));
160
172
                return;
193
205
        account_->dialogUnregister(this);
194
206
        controller_->dialogRegister(this);
195
207
 
196
 
        QMessageBox::information(this, tr("Error"), tr("Unable to join groupchat.\nReason: %1").arg(str));
 
208
        QMessageBox* msg = new QMessageBox(QMessageBox::Information, tr("Error"), tr("Unable to join groupchat.\nReason: %1").arg(str), QMessageBox::Ok, this, Qt::WDestructiveClose);
 
209
        msg->setModal(false);
 
210
        msg->show();
197
211
}
198
212
 
199
213
void MUCJoinDlg::setJid(const Jid& mucJid)
200
214
{
201
 
        ui_.le_host->setText(mucJid.host());
202
 
        ui_.le_room->setText(mucJid.user());
 
215
        ui_.le_host->setText(mucJid.domain());
 
216
        ui_.le_room->setText(mucJid.node());
203
217
}
204
218
 
205
219
void MUCJoinDlg::setNick(const QString nick)