Changeset 6367
- Timestamp:
- 07/01/08 04:12:56 (2 months ago)
- Location:
- trunk/qt-gui/src
- Files:
-
- 14 modified
-
authuserdlg.cpp (modified) (1 diff)
-
authuserdlg.h (modified) (2 diffs)
-
awaymsgdlg.cpp (modified) (1 diff)
-
awaymsgdlg.h (modified) (1 diff)
-
ewidgets.cpp (modified) (1 diff)
-
ewidgets.h (modified) (2 diffs)
-
filedlg.cpp (modified) (1 diff)
-
filedlg.h (modified) (3 diffs)
-
mainwin.cpp (modified) (1 diff)
-
optionsdlg.cpp (modified) (1 diff)
-
refusedlg.cpp (modified) (1 diff)
-
refusedlg.h (modified) (1 diff)
-
showawaymsgdlg.cpp (modified) (1 diff)
-
showawaymsgdlg.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt-gui/src/authuserdlg.cpp
r4699 r6367 115 115 } 116 116 117 AuthUserDlg::AuthUserDlg(CICQDaemon *s, unsigned long nUin, bool bGrant,118 QWidget *parent)119 : LicqDialog(parent, "AuthUserDialog", false, WDestructiveClose)120 {121 server = s;122 m_nUin = nUin;123 m_bGrant = bGrant;124 m_nPPID = LICQ_PPID;125 char szUin[14];126 sprintf(szUin, "%lu", nUin);127 m_szId = strdup(szUin);128 129 130 if(bGrant)131 setCaption(tr("Licq - Grant Authorisation"));132 else133 setCaption(tr("Licq - Refuse Authorisation"));134 135 QBoxLayout* toplay = new QVBoxLayout(this, 8, 8);136 137 lblUin = new QLabel(this);138 lblUin->setAlignment(AlignCenter);139 if (m_nUin == 0)140 {141 lblUin->setText(tr("Authorize which user (UIN):"));142 edtUin = new QLineEdit(this);143 edtUin->setMinimumWidth(90);144 edtUin->setValidator(new QIntValidator(10000, 2147483647, edtUin));145 connect (edtUin, SIGNAL(returnPressed()), SLOT(ok()) );146 QBoxLayout* lay = new QHBoxLayout(toplay);147 lay->addWidget(lblUin);148 lay->addWidget(edtUin);149 }150 else151 {152 edtUin = NULL;153 toplay->addWidget(lblUin);154 QString userName;155 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);156 if (u != NULL) {157 //QTextCodec *codec = UserCodec::codecForICQUser(u);158 userName = QString("%1 (%2)").arg(QString::fromUtf8(u->GetAlias())).arg(m_nUin);159 gUserManager.DropUser(u);160 } else {161 userName = QString::number(m_nUin);162 }163 164 if (bGrant)165 lblUin->setText(tr("Grant authorization to %1").arg(userName));166 else167 lblUin->setText(tr("Refuse authorization to %1").arg(userName));168 }169 170 toplay->addSpacing(6);171 172 grpResponse = new QVGroupBox(tr("Response"), this);173 toplay->addWidget(grpResponse);174 toplay->setStretchFactor(grpResponse, 2);175 176 mleResponse = new MLEditWrap(true, grpResponse);177 178 QBoxLayout* lay = new QHBoxLayout(toplay);179 lay->addStretch(1);180 btnOk = new QPushButton(tr("&Ok"), this);181 btnOk->setMinimumWidth(75);182 lay->addWidget(btnOk);183 btnCancel = new QPushButton(tr("&Cancel"), this);184 btnCancel->setMinimumWidth(75);185 lay->addWidget(btnCancel);186 connect (mleResponse, SIGNAL(signal_CtrlEnterPressed()), this, SLOT(ok()));187 connect (btnOk, SIGNAL(clicked()), SLOT(ok()) );188 connect (btnCancel, SIGNAL(clicked()), SLOT(close()) );189 190 if (m_nUin)191 mleResponse->setFocus();192 else193 edtUin->setFocus();194 195 show();196 }197 198 117 void AuthUserDlg::ok() 199 118 { 200 119 if (edtUin != NULL) 201 {202 120 if (edtUin->text().isEmpty()) return; 203 m_nUin = edtUin->text().toULong();204 }205 121 206 122 if (m_szId == 0) m_szId = strdup(edtUin->text().latin1()); -
trunk/qt-gui/src/authuserdlg.h
r4699 r6367 35 35 Q_OBJECT 36 36 public: 37 AuthUserDlg (CICQDaemon *s, unsigned long nUin, bool bGrant,38 QWidget *parent = 0);39 37 AuthUserDlg (CICQDaemon *s, const char *szId, unsigned long nPPID, 40 38 bool bGrant, QWidget *parent = 0); … … 48 46 MLEditWrap* mleResponse; 49 47 50 unsigned long m_nUin;51 48 char *m_szId; 52 49 unsigned long m_nPPID; -
trunk/qt-gui/src/awaymsgdlg.cpp
r5514 r6367 338 338 } 339 339 340 CustomAwayMsgDlg::CustomAwayMsgDlg(unsigned long nUin, QWidget *parent)341 : LicqDialog(parent, "CustomAwayMessageDialog", false, WDestructiveClose)342 {343 m_nUin = nUin;344 345 QBoxLayout* top_lay = new QVBoxLayout(this, 10);346 347 mleAwayMsg = new MLEditWrap(true, this);348 connect(mleAwayMsg, SIGNAL(signal_CtrlEnterPressed()), this, SLOT(slot_ok()));349 top_lay->addWidget(mleAwayMsg);350 351 QBoxLayout* l = new QHBoxLayout(top_lay, 10);352 353 int bw = 75;354 QPushButton *btnHints = new QPushButton(tr("&Hints"), this);355 connect(btnHints, SIGNAL(clicked()), SLOT(slot_hints()));356 QPushButton *btnOk = new QPushButton(tr("&Ok"), this );357 btnOk->setDefault(true);358 connect( btnOk, SIGNAL(clicked()), SLOT(slot_ok()) );359 QPushButton *btnClear = new QPushButton(tr("&Clear"), this );360 connect( btnClear, SIGNAL(clicked()), SLOT(slot_clear()) );361 QPushButton *btnCancel = new QPushButton(tr("&Cancel"), this );362 connect( btnCancel, SIGNAL(clicked()), SLOT(close()) );363 bw = QMAX(bw, btnOk->sizeHint().width());364 bw = QMAX(bw, btnClear->sizeHint().width());365 bw = QMAX(bw, btnCancel->sizeHint().width());366 bw = QMAX(bw, btnHints->sizeHint().width());367 btnOk->setFixedWidth(bw);368 btnClear->setFixedWidth(bw);369 btnCancel->setFixedWidth(bw);370 btnHints->setFixedWidth(bw);371 372 l->addStretch(1);373 l->addSpacing(30);374 l->addWidget(btnHints);375 l->addSpacing(20);376 l->addWidget(btnOk);377 l->addWidget(btnClear);378 l->addWidget(btnCancel);379 380 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);381 setCaption(QString(tr("Set Custom Auto Response for %1"))382 .arg(QString::fromUtf8(u->GetAlias())));383 if (*u->CustomAutoResponse())384 mleAwayMsg->setText(QString::fromLocal8Bit(u->CustomAutoResponse()));385 else if (u->StatusToUser() != ICQ_STATUS_OFFLINE)386 mleAwayMsg->setText(tr("I am currently %1.\nYou can leave me a message.")387 .arg(Strings::getStatus(u->StatusToUser(), false)));388 389 gUserManager.DropUser(u);390 391 mleAwayMsg->setFocus();392 QTimer::singleShot(0, mleAwayMsg, SLOT(selectAll()));393 394 show();395 }396 397 398 // -----------------------------------------------------------------------------399 340 void CustomAwayMsgDlg::slot_hints() 400 341 { -
trunk/qt-gui/src/awaymsgdlg.h
r4699 r6367 65 65 Q_OBJECT 66 66 public: 67 CustomAwayMsgDlg(unsigned long, QWidget *parent = 0);68 67 CustomAwayMsgDlg(const char *, unsigned long, QWidget *parent = 0); 69 68 70 69 protected: 71 70 MLEditWrap *mleAwayMsg; 72 unsigned long m_nUin;73 71 char *m_szId; 74 72 unsigned long m_nPPID; -
trunk/qt-gui/src/ewidgets.cpp
r6180 r6367 836 836 addMsg(newEventList[i]); 837 837 */ 838 }839 840 CMessageViewWidget::CMessageViewWidget(unsigned long _nUin, CMainWindow *m, QWidget *parent, const char *name, bool historyMode)841 : MLView(parent,name)842 {843 setTextFormat(RichText);844 m_nUin= _nUin;845 m_szId = NULL; // avoid desalocation error at destructor846 if (historyMode)847 {848 m_useBuffer = true;849 m_nMsgStyle = m->m_histMsgStyle;850 m_nDateFormat = m->m_histDateFormat;851 m_extraSpacing = m->m_histVertSpacing;852 m_appendLineBreak = false;853 }854 else855 {856 m_useBuffer = false;857 m_nMsgStyle = m->m_chatMsgStyle;858 m_nDateFormat = m->m_chatDateFormat;859 m_extraSpacing = m->m_chatVertSpacing;860 m_appendLineBreak = m->m_chatAppendLineBreak;861 }862 m_showNotices = m->m_showNotices;863 m_colorRcv = m->m_colorRcv;864 m_colorSnt = m->m_colorSnt;865 m_colorRcvHistory = m->m_colorRcvHistory;866 m_colorSntHistory = m->m_colorSntHistory;867 m_colorNotice = m->m_colorNotice;868 setPaletteBackgroundColor(m->m_colorChatBkg);869 mainwin = m;870 871 clear();872 873 /*874 // add all unread messages.875 vector<CUserEvent*> newEventList;876 ICQUser *u = gUserManager.FetchUser(_nUin, LOCK_W);877 if (u != NULL && u->NewMessages() > 0)878 {879 for (unsigned short i = 0; i < u->NewMessages(); i++)880 {881 CUserEvent *e = u->EventPeek(i);882 if (e->Direction() == D_RECEIVER && e->SubCommand() == ICQ_CMDxSUB_MSG)883 newEventList.push_back(e);884 }885 }886 gUserManager.DropUser(u);887 for (unsigned short i = 0; i < newEventList.size(); i++)888 addMsg(newEventList[i]); */889 838 } 890 839 -
trunk/qt-gui/src/ewidgets.h
r6180 r6367 222 222 char *m_szId; 223 223 unsigned long m_nPPID; 224 unsigned long m_nUin;225 224 CMainWindow *mainwin; 226 225 public: … … 229 228 CMessageViewWidget(const char *szId, unsigned long nPPID, 230 229 CMainWindow *m, QWidget *parent = 0, const char *name = 0, bool historyMode = false); 231 CMessageViewWidget(unsigned long _nUin, CMainWindow *m,232 QWidget* parent = 0, const char *name = 0, bool historyMode = false);233 230 virtual ~CMessageViewWidget(); 234 231 -
trunk/qt-gui/src/filedlg.cpp
r4699 r6367 143 143 #endif 144 144 } 145 146 CFileDlg::CFileDlg(unsigned long _nUin, CICQDaemon *daemon, QWidget* parent)147 : QWidget(parent, "FileDialog", WDestructiveClose)148 {149 // If we are the server, then we are receiving a file150 m_nUin = _nUin;151 licqDaemon = daemon;152 153 setCaption(tr("Licq - File Transfer (%1)").arg(m_nUin));154 155 unsigned short CR = 0;156 QGridLayout* lay = new QGridLayout(this, 8, 3, 8, 8);157 lay->setColStretch(1, 2);158 159 lblTransferFileName = new QLabel(tr("Current:"), this);160 lay->addWidget(lblTransferFileName, CR, 0);161 nfoTransferFileName = new CInfoField(this, true);162 nfoTransferFileName->setMinimumWidth(nfoTransferFileName->sizeHint().width()*2);163 lay->addWidget(nfoTransferFileName, CR, 1);164 nfoTotalFiles = new CInfoField(this, true);165 nfoTotalFiles->setMinimumWidth((nfoTotalFiles->sizeHint().width()*3)/2);166 lay->addWidget(nfoTotalFiles, CR, 2);167 168 lblLocalFileName = new QLabel(tr("File name:"), this);169 lay->addWidget(lblLocalFileName, ++CR, 0);170 nfoLocalFileName = new CInfoField(this, true);171 lay->addMultiCellWidget(nfoLocalFileName, CR, CR, 1, 2);172 173 lay->addRowSpacing(++CR, 10);174 175 // Information stuff about the current file176 lblTrans = new QLabel(tr("File:"), this);177 lay->addWidget(lblTrans, ++CR, 0);178 barTransfer = new QProgressBar(this);179 lay->addWidget(barTransfer, CR, 1);180 nfoFileSize = new CInfoField(this, true);181 lay->addWidget(nfoFileSize, CR, 2);182 183 // Information about the batch file transfer184 lblBatch = new QLabel(tr("Batch:"), this);185 lay->addWidget(lblBatch, ++CR, 0);186 barBatchTransfer = new QProgressBar(this);187 lay->addWidget(barBatchTransfer, CR, 1);188 nfoBatchSize = new CInfoField(this, true);189 lay->addWidget(nfoBatchSize, CR, 2);190 191 lblTime = new QLabel(tr("Time:"), this);192 lay->addWidget(lblTime, ++CR, 0);193 194 QHBox* hbox = new QHBox(this);195 hbox->setSpacing(8);196 lay->addMultiCellWidget(hbox, CR, CR, 0, 1);197 nfoTime = new CInfoField(hbox, true);198 nfoBPS = new CInfoField(hbox, true);199 lblETA = new QLabel(tr("ETA:"), hbox);200 nfoETA = new CInfoField(this, true);201 lay->addWidget(nfoETA, CR++, 2);202 lay->addRowSpacing(++CR, 10);203 204 mleStatus = new MLEditWrap(true, this);205 ++CR;206 lay->addMultiCellWidget(mleStatus, CR, CR, 0, 2);207 mleStatus->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);208 209 lay->setRowStretch(++CR, 3);210 211 hbox = new QHBox(this);212 hbox->setSpacing(8);213 lay->addMultiCellWidget(hbox, CR, CR, 0, 2);214 215 btnCancel = new QPushButton(tr("&Cancel Transfer"), hbox);216 btnCancel->setMinimumWidth(75);217 connect(btnCancel, SIGNAL(clicked()), this, SLOT(close()));218 219 ftman = new CFileTransferManager(licqDaemon, m_nUin);220 ftman->SetUpdatesEnabled(2);221 sn = new QSocketNotifier(ftman->Pipe(), QSocketNotifier::Read);222 connect(sn, SIGNAL(activated(int)), SLOT(slot_ft()));223 224 #ifdef USE_KDE225 btnOpen = new QPushButton(tr("&Open"), hbox);226 btnOpenDir = new QPushButton(tr("O&pen Dir"), hbox);227 btnOpen->hide();228 btnOpenDir->hide();229 connect(btnOpen, SIGNAL(clicked()), SLOT(slot_open()));230 connect(btnOpenDir, SIGNAL(clicked()), SLOT(slot_opendir()));231 #else232 btnOpen = 0;233 btnOpenDir = 0;234 #endif235 }236 237 145 238 146 //-----Destructor--------------------------------------------------------------- -
trunk/qt-gui/src/filedlg.h
r4699 r6367 39 39 Q_OBJECT 40 40 public: 41 CFileDlg(unsigned long _nUin, CICQDaemon *daemon, QWidget* parent = 0);42 41 CFileDlg(const char *szId, unsigned long nPPID, CICQDaemon *daemon, 43 42 QWidget *parent = 0); … … 50 49 char *Id() { return m_szId; } 51 50 unsigned long PPID() { return m_nPPID; } 52 unsigned long Uin() { return m_nUin; };53 51 54 52 protected: … … 69 67 CFileTransferManager *ftman; 70 68 71 unsigned long m_nUin;72 69 char *m_szId; 73 70 unsigned long m_nPPID; -
trunk/qt-gui/src/mainwin.cpp
r6308 r6367 4683 4683 void CMainWindow::showAuthUserDlg() 4684 4684 { 4685 (void) new AuthUserDlg(licqDaemon, 0, true);4685 (void) new AuthUserDlg(licqDaemon, NULL, 0, true); 4686 4686 } 4687 4687 -
trunk/qt-gui/src/optionsdlg.cpp
r5328 r6367 1697 1697 lay->addWidget(tabViewer); 1698 1698 1699 msgChatViewer = new CMessageViewWidget( 0, gMainWindow, tabViewer);1699 msgChatViewer = new CMessageViewWidget(NULL, 0, gMainWindow, tabViewer); 1700 1700 tabViewer->insertTab(msgChatViewer, "Marge"); 1701 1701 1702 msgHistViewer = new CMessageViewWidget( 0, gMainWindow, tabViewer, 0, true);1702 msgHistViewer = new CMessageViewWidget(NULL, 0, gMainWindow, tabViewer, 0, true); 1703 1703 tabViewer->insertTab(msgHistViewer, tr("History")); 1704 1704 -
trunk/qt-gui/src/refusedlg.cpp
r4699 r6367 64 64 } 65 65 66 CRefuseDlg::CRefuseDlg(unsigned long _nUin, QString t, QWidget* parent)67 : LicqDialog(parent, "RefuseDialog", true)68 {69 ICQUser *u = gUserManager.FetchUser(_nUin, LOCK_R);70 QLabel *lbl = new QLabel(tr("Refusal message for %1 with ").arg(t) + QString::fromUtf8(u->GetAlias()) + ":", this);71 gUserManager.DropUser(u);72 73 mleRefuseMsg = new MLEditWrap(true, this);74 75 QPushButton *btnRefuse = new QPushButton(tr("Refuse"), this );76 connect( btnRefuse, SIGNAL(clicked()), SLOT(accept()) );77 QPushButton *btnCancel = new QPushButton(tr("Cancel"), this );78 connect( btnCancel, SIGNAL(clicked()), SLOT(reject()) );79 int bw = 75;80 bw = QMAX(bw, btnRefuse->sizeHint().width());81 bw = QMAX(bw, btnCancel->sizeHint().width());82 btnRefuse->setFixedWidth(bw);83 btnCancel->setFixedWidth(bw);84 85 QGridLayout *lay = new QGridLayout(this, 3, 5, 15, 10);86 lay->addMultiCellWidget(lbl, 0, 0, 0, 4);87 lay->addMultiCellWidget(mleRefuseMsg, 1, 1, 0, 4);88 lay->addWidget(btnRefuse, 2, 1);89 lay->addWidget(btnCancel, 2, 3);90 lay->setColStretch(0, 2);91 lay->setColStretch(4, 2);92 lay->addColSpacing(2, 10);93 94 setCaption(tr("Licq %1 Refusal").arg(t));95 }96 97 98 66 QString CRefuseDlg::RefuseMessage() 99 67 { -
trunk/qt-gui/src/refusedlg.h
r4699 r6367 30 30 31 31 public: 32 CRefuseDlg(unsigned long _nUin, QString t, QWidget *parent = 0);33 32 CRefuseDlg(const char *, unsigned long, QString, QWidget * = 0); 34 33 QString RefuseMessage(); -
trunk/qt-gui/src/showawaymsgdlg.cpp
r5514 r6367 102 102 } 103 103 104 ShowAwayMsgDlg::ShowAwayMsgDlg(CICQDaemon *_server, CSignalManager* _sigman, unsigned long _nUin, QWidget *parent)105 {106 char szUin[13];107 snprintf(szUin, 12, "%lu", _nUin);108 szUin[12] = 0;109 110 ShowAwayMsgDlg(_server, _sigman, szUin, LICQ_PPID, parent);111 }112 113 114 // -----------------------------------------------------------------------------115 116 104 ShowAwayMsgDlg::~ShowAwayMsgDlg() 117 105 { -
trunk/qt-gui/src/showawaymsgdlg.h
r4699 r6367 38 38 Q_OBJECT 39 39 public: 40 ShowAwayMsgDlg(CICQDaemon *_server, CSignalManager* _sigman,41 unsigned long _nUin, QWidget *parent = 0);42 40 ShowAwayMsgDlg(CICQDaemon *_server, CSignalManager *_sigman, 43 41 const char *szId, unsigned long nPPID, … … 46 44 47 45 protected: 48 unsigned long m_nUin;49 46 char *m_szId; 50 47 unsigned long m_nPPID;
