diff --git a/retroshare-gui/src/gui/ChatDialog.cpp b/retroshare-gui/src/gui/ChatDialog.cpp index de219f407..8b555db9b 100644 --- a/retroshare-gui/src/gui/ChatDialog.cpp +++ b/retroshare-gui/src/gui/ChatDialog.cpp @@ -89,6 +89,7 @@ void ChatDialog::msgSendListCostumPopupMenu( QPoint point ) contextMnu.addAction( privchatAct); contextMnu.exec( mevent->globalPos() ); } + int ChatDialog::loadInitMsg() { std::ostringstream out; @@ -145,11 +146,6 @@ void ChatDialog::insertChat() } n = 1 + n / 2; /* shrink it! */ - //std::cerr << "Space count : " << n << std::endl; - - std::string spaces(" "); - - /* add in lines at the bottom */ int ts = time(NULL); for(it = newchat.begin(); it != newchat.end(); it++) @@ -164,6 +160,7 @@ void ChatDialog::insertChat() std::ostringstream out; QString currenttxt = msgWidget->toHtml(); + QString extraTxt; if ((it->name == lastChatName) && (ts - lastChatTime < 60)) { @@ -173,48 +170,39 @@ void ChatDialog::insertChat() { #if defined(Q_OS_WIN) /* nothing */ - //out << "
" << std::endl; #else - out << "
" << std::endl; + extraTxt += "
\n"; #endif for(int i = 0; i < n; i++) { - out << spaces; + extraTxt += " "; } QString timestamp = "[" + QDateTime::currentDateTime().toString("hh:mm:ss") + "]"; QString name = QString::fromStdString(it->name); - //QString line = "" + timestamp + - // " " + name + " \n
"; QString line = "" + timestamp + " " + name + " \n
"; - out << line.toStdString(); + extraTxt += line; } - out << it -> msg; + extraTxt += QString::fromStdWString(it->msg); /* This might be WIN32 only - or maybe Qt4.2.2 only - but need it for windows at the mom */ #if defined(Q_OS_WIN) - //out << "
"; - //out << "
" << std::endl; - - out << std::endl; + extraTxt += "\n"; #else - out << std::endl; + extraTxt += "\n"; #endif lastChatName = it -> name; lastChatTime = ts; /* add it everytime */ - QString extra = QString::fromStdString(out.str()); - currenttxt += extra; + currenttxt += extraTxt; msgWidget->setHtml(currenttxt); - //std::cerr << " Added Text: " << std::endl; - //std::cerr << out.str() << std::endl; QScrollBar *qsb = msgWidget->verticalScrollBar(); qsb -> setValue(qsb->maximum()); } @@ -233,7 +221,7 @@ void ChatDialog::sendMsg() //font.setItalic(ui.textitalicChatButton->isChecked()); ChatInfo ci; - ci.msg = lineWidget->text().toStdString(); + ci.msg = lineWidget->text().toStdWString(); ci.chatflags = RS_CHAT_PUBLIC; //ci.messageFont = font; //ci.messageColor = textColor; @@ -280,8 +268,8 @@ void ChatDialog::insertSendList() /* (0) Person */ item -> setText(0, QString::fromStdString(details.name)); - //item -> setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); - item -> setFlags(Qt::ItemIsUserCheckable); + item -> setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); + //item -> setFlags(Qt::ItemIsUserCheckable); item -> setCheckState(0, Qt::Checked); /**** NOT SELECTABLE AT THE MOMENT diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index b37f61262..f50fbd43b 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -59,9 +59,11 @@ MessagesDialog::MessagesDialog(QWidget *parent) connect( ui.msgWidget, SIGNAL( itemClicked ( QTreeWidgetItem *, int) ), this, SLOT( updateMessages ( QTreeWidgetItem *, int) ) ); connect( ui.listWidget, SIGNAL( currentRowChanged ( int) ), this, SLOT( changeBox ( int) ) ); - connect(ui.newmessageButton, SIGNAL(clicked()), this, SLOT(newmessage())); connect(ui.removemessageButton, SIGNAL(clicked()), this, SLOT(removemessage())); + + connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview())); + connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended())); mCurrCertId = ""; @@ -86,8 +88,8 @@ MessagesDialog::MessagesDialog(QWidget *parent) msglheader->resizeSection ( 0, 125 ); msglheader->resizeSection ( 1, 100 ); - msglheader->resizeSection ( 2, 100 ); - msglheader->resizeSection ( 3, 200 ); + msglheader->resizeSection ( 2, 250 ); + msglheader->resizeSection ( 3, 50 ); /* Hide platform specific features */ @@ -161,6 +163,64 @@ void MessagesDialog::replytomessage() } +void MessagesDialog::togglefileview() +{ + /* if msg header visible -> hide by changing splitter + * three widgets... + */ + + QList sizeList = ui.msgSplitter->sizes(); + QList::iterator it; + + int listSize = 0; + int msgSize = 0; + int recommendSize = 0; + int i = 0; + + for(it = sizeList.begin(); it != sizeList.end(); it++, i++) + { + if (i == 0) + { + listSize = (*it); + } + else if (i == 1) + { + msgSize = (*it); + } + else if (i == 2) + { + recommendSize = (*it); + } + } + + int totalSize = listSize + msgSize + recommendSize; + + bool toShrink = true; + if (recommendSize < (int) totalSize / 10) + { + toShrink = false; + } + + QList newSizeList; + if (toShrink) + { + newSizeList.push_back(listSize + recommendSize / 3); + newSizeList.push_back(msgSize + recommendSize * 2 / 3); + newSizeList.push_back(0); + } + else + { + /* no change */ + int nlistSize = (totalSize * 2 / 3) * listSize / (listSize + msgSize); + int nMsgSize = (totalSize * 2 / 3) - listSize; + newSizeList.push_back(nlistSize); + newSizeList.push_back(nMsgSize); + newSizeList.push_back(totalSize * 1 / 3); + } + + ui.msgSplitter->setSizes(newSizeList); +} + /* download the recommendations... */ void MessagesDialog::getcurrentrecommended() @@ -318,7 +378,8 @@ void MessagesDialog::insertMessages() item -> setText(1, QString::fromStdString(out.str())); } - item -> setText(2, QString::fromStdString(it->title)); + // Subject + item -> setText(2, QString::fromStdWString(it->title)); // No of Files. { @@ -327,47 +388,11 @@ void MessagesDialog::insertMessages() item -> setText(3, QString::fromStdString(out.str())); } - // Size. - // Msg. - // Rank + item -> setText(4, QString::fromStdString(it->id)); + item -> setText(5, QString::fromStdString(it->msgId)); + if ((oldSelected) && (mid == it->msgId)) { - std::ostringstream out; - out << it -> size; - item -> setText(4, QString::fromStdString(out.str())); - } - - /* strip out the \n and \r symbols */ - std::string tmsg = it -> msg; - for(int i = 0; i < tmsg.length(); i++) - { - if ((tmsg[i] == '\n') || - (tmsg[i] == '\r')) - { - tmsg[i] = ' '; - } - } - item -> setText(5, QString::fromStdString(tmsg)); - - { - std::ostringstream out; - out << "5"; // RANK - item -> setText(6, QString::fromStdString(out.str())); - } - - { - std::ostringstream out; - out << it -> id; - item -> setText(7, QString::fromStdString(out.str())); - } - - { - std::ostringstream out; - out << it -> msgId; - item -> setText(8, QString::fromStdString(out.str())); - if ((oldSelected) && (mid == out.str())) - { - newSelected = item; - } + newSelected = item; } if (it -> msgflags & RS_MSG_NEW) @@ -421,14 +446,21 @@ void MessagesDialog::insertMsgTxtAndFiles() if (!qtwi) { /* blank it */ + ui.dateText-> setText(""); + ui.toText->setText(""); + ui.fromText->setText(""); + ui.filesText->setText(""); + + ui.subjectText->setText(""); ui.msgText->setText(""); ui.msgList->clear(); + return; } else { - cid = qtwi -> text(7).toStdString(); - mid = qtwi -> text(8).toStdString(); + cid = qtwi -> text(4).toStdString(); + mid = qtwi -> text(5).toStdString(); } /* Save the Data.... for later */ @@ -489,43 +521,55 @@ void MessagesDialog::insertMsgTxtAndFiles() /* add the items in! */ tree->insertTopLevelItems(0, items); - /* add the Msg */ - std::ostringstream msgout; std::list::const_iterator pit; - msgout << "Msg Header ----------------- TS: " << mi->ts; - if (mi->msgto.size() > 0) - msgout << std::endl << "To: "; + + QString msgTxt; for(pit = mi->msgto.begin(); pit != mi->msgto.end(); pit++) { - msgout << pit->name << " (" << pit->id << "), "; + msgTxt += QString::fromStdString(pit->name); + msgTxt += " <"; + msgTxt += QString::fromStdString(pit->id); + msgTxt += ">, "; } if (mi->msgcc.size() > 0) - msgout << std::endl << "Cc: "; + msgTxt += "\nCc: "; for(pit = mi->msgcc.begin(); pit != mi->msgcc.end(); pit++) { - msgout << pit->name << " (" << pit->id << "), "; + msgTxt += QString::fromStdString(pit->name); + msgTxt += " <"; + msgTxt += QString::fromStdString(pit->id); + msgTxt += ">, "; } if (mi->msgbcc.size() > 0) - msgout << std::endl << "Bcc: "; + msgTxt += "\nBcc: "; for(pit = mi->msgbcc.begin(); pit != mi->msgbcc.end(); pit++) { - msgout << pit->name << " (" << pit->id << "), "; + msgTxt += QString::fromStdString(pit->name); + msgTxt += " <"; + msgTxt += QString::fromStdString(pit->id); + msgTxt += ">, "; } - msgout << std::endl; - msgout << "----------------------------"; - msgout << std::endl; + { + QDateTime qtime; + qtime.setTime_t(mi->ts); + QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss"); + ui.dateText-> setText(timestamp); + } + ui.toText->setText(msgTxt); + ui.fromText->setText(QString::fromStdString(mi->srcname)); - msgout << "Subject: " << mi -> title << std::endl; - msgout << "Message: " << std::endl; - msgout << mi->msg << std::endl; - - - ui.msgText->setText(QString::fromStdString(msgout.str())); + ui.subjectText->setText(QString::fromStdWString(mi -> title)); + ui.msgText->setText(QString::fromStdWString(mi->msg)); + { + std::ostringstream out; + out << "(" << mi->count << " Files)"; + ui.filesText->setText(QString::fromStdString(out.str())); + } rsiface->unlockData(); /* Unlock Interface */ @@ -545,8 +589,8 @@ bool MessagesDialog::getCurrentMsg(std::string &cid, std::string &mid) QTreeWidgetItem *qtwi = msglist -> currentItem(); if (qtwi) { - cid = qtwi -> text(7).toStdString(); - mid = qtwi -> text(8).toStdString(); + cid = qtwi -> text(4).toStdString(); + mid = qtwi -> text(5).toStdString(); return true; } return false; diff --git a/retroshare-gui/src/gui/MessagesDialog.h b/retroshare-gui/src/gui/MessagesDialog.h index 32932fe1f..3e09c0638 100644 --- a/retroshare-gui/src/gui/MessagesDialog.h +++ b/retroshare-gui/src/gui/MessagesDialog.h @@ -60,6 +60,9 @@ void updateMessages ( QTreeWidgetItem * item, int column ); void getcurrentrecommended(); void getallrecommended(); + /* handle splitter */ + void togglefileview(); + private: bool getCurrentMsg(std::string &cid, std::string &mid); diff --git a/retroshare-gui/src/gui/MessagesDialog.ui b/retroshare-gui/src/gui/MessagesDialog.ui index a61f84c70..36ff3952d 100644 --- a/retroshare-gui/src/gui/MessagesDialog.ui +++ b/retroshare-gui/src/gui/MessagesDialog.ui @@ -5,18 +5,22 @@ 0 0 - 519 - 343 + 747 + 492 - - 5 - 7 + 0 0 + + + 60 + 0 + + @@ -501,12 +505,105 @@ Qt::DefaultContextMenu - - 4 - - - 1 - + + + + + 24 + 24 + + + + + 24 + 24 + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">New Message</p></body></html> + + + QPushButton +{ +border-image: url(:/images/folder-draft24.png); +} +QPushButton:hover +{ +border-image: url(:/images/folder-draft24-hover.png); +} + +QPushButton:pressed +{ +border-image: url(:/images/folder-draft24-pressed.png); +} + + + + + + + + 24 + 24 + + + + false + + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">reply to selected message</p></body></html> + + + +QPushButton +{ +border-image: url(:/images/replymail24.png); +} + +QPushButton:hover +{ +border-image: url(:/images/replymail24-hover.png); +} + +QPushButton:pressed +{ +border-image: url(:/images/replymail-pressed.png); +} + + + + + + + + 24 + 24 + + + + @@ -554,15 +651,28 @@ border-image: url(:/images/deletemail-pressed.png); + + + + Qt::Horizontal + + + + 40 + 20 + + + + - + Qt::Horizontal - 160 + 120 16777215 @@ -626,258 +736,443 @@ border-image: url(:/images/deletemail-pressed.png); - + Qt::Vertical - - - Qt::Vertical + + + + 0 + 5 + - - - Qt::CustomContextMenu + + Qt::CustomContextMenu + + + 16 + + + true + + + 4 + + + + Date - - 16 + + + + From - - true + + + + Subject - - 6 + + + + #Recommendations - - - Date - - - - - From - - - - - Title - - - - - Count - - - - - Size - - - - - Msg - - - - + - - - - 0 - - - 0 - - - - - Qt::CustomContextMenu + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 40 + + + + + + + + + + + + + 0 + 0 + + + + + 60 + 10 + + + + + 16777215 + 10 + + + + + 10 + 75 + true + + + + Subject: + + + + + + + + 2 + 0 + + + + + 0 + 10 + + + + + 16777215 + 10 + + + + + + + + + + + + 0 + 0 + + + + + 60 + 10 + + + + + 16777215 + 10 + + + + + 10 + 75 + true + + + + From: + + + + + + + + 2 + 0 + + + + + 0 + 10 + + + + + 16777215 + 10 + + + + + + + + + + + + 0 + 0 + + + + + 60 + 10 + + + + + 16777215 + 10 + + + + + 10 + 75 + true + + + + Date: + + + + + + + + 2 + 0 + + + + + 0 + 10 + + + + + 16777215 + 10 + + + + + + + + + + + + 0 + 0 + + + + + 60 + 10 + + + + + 16777215 + 10 + + + + + 10 + 75 + true + + + + To: + + + + + + + + 2 + 0 + + + + + 0 + 10 + + + + + 16777215 + 10 + + + + + + + + + + + + + + + + 0 + 10 + - - true - - - - File Name - - - - - Size - - - - - Sources - - - - - Hash - - - - - - 0 - - - 6 - - - - - + + + + + + 0 - - :/images/attachment.png + + 0 - - - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> + + 0 + + + 0 + + + 6 + + + 6 + + + + + + + + :/images/attachment.png + + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">Recommended Files</span></p></body></html> + + + + + + + + 10 + true + + + + + + + + + + + + + + :/images/add_24x24.png + + + + + + + + + Qt::Horizontal + + + + 351 + 20 + + + + + + + + + + + :/images/down.png - - - - Qt::Horizontal - - - - 40 - 20 - - - - + + + Qt::CustomContextMenu + + + true + + + + File Name + + + + + Size + + + + + Sources + + + + + Hash + + + - - - - - 24 - 24 - - - - - 24 - 24 - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">reply to selected message</p></body></html> - - - -QPushButton -{ -border-image: url(:/images/replymail24.png); -} - -QPushButton:hover -{ -border-image: url(:/images/replymail24-hover.png); -} - -QPushButton:pressed -{ -border-image: url(:/images/replymail-pressed.png); -} - - - - - - - - 24 - 24 - - - - - - - - - 24 - 24 - - - - - 24 - 24 - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">New Message</p></body></html> - - - QPushButton -{ -border-image: url(:/images/folder-draft24.png); -} -QPushButton:hover -{ -border-image: url(:/images/folder-draft24-hover.png); -} - -QPushButton:pressed -{ -border-image: url(:/images/folder-draft24-pressed.png); -} - - - - - - - - 24 - 24 - - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - diff --git a/retroshare-gui/src/gui/PeersDialog.cpp b/retroshare-gui/src/gui/PeersDialog.cpp index 0ed9c0fc8..d52e6343e 100644 --- a/retroshare-gui/src/gui/PeersDialog.cpp +++ b/retroshare-gui/src/gui/PeersDialog.cpp @@ -336,11 +336,24 @@ void PeersDialog::chatfriend() if (!i) return; - std::string status = (i -> text(1)).toStdString(); std::string name = (i -> text(2)).toStdString(); std::string id = (i -> text(10)).toStdString(); + + RsPeerDetails detail; + if (!rsPeers->getPeerDetails(id, detail)) + { + return; + } - if (status != "Online") + if (detail.state & RS_PEER_STATE_CONNECTED) + { + /* must reference ChatDialog */ + if (chatDialog) + { + chatDialog->getPrivateChat(id, name, true); + } + } + else { /* info dialog */ QMessageBox::StandardButton sb = QMessageBox::question ( NULL, @@ -351,16 +364,11 @@ void PeersDialog::chatfriend() { msgfriend(); } - return; - } - - /* must reference ChatDialog */ - if (chatDialog) - { - chatDialog->getPrivateChat(id, name, true); } + return; } + void PeersDialog::msgfriend() { std::cerr << "SharedFilesDialog::msgfriend()" << std::endl; diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index ef158c140..13b0e6481 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -200,7 +200,7 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) /* add in lines at the bottom */ - std::ostringstream out; + QString extraTxt; int ts = time(NULL); @@ -222,70 +222,65 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) { QString line = "
\n ----- PEER OFFLINE (Chat will be lost) ----- \n
"; - out << line.toStdString(); + extraTxt += line; } - if ((ci->name == lastChatName) && (ts - lastChatTime < 60)) - { - /* no name */ - } - else - { + if ((ci->name == lastChatName) && (ts - lastChatTime < 60)) + { + /* no name */ + } + else + { #if defined(Q_OS_WIN) // Nothing. #else - out << "
" << std::endl; + extraTxt += "
\n"; #endif - for(int i = 0; i < n; i++) - { - out << spaces; - } + for(int i = 0; i < n; i++) + { + extraTxt += " "; + } - //out << "[ " << ci->name << " +" << ts - lastChatTime << "s ]" << std::endl; - //out << "
" << std::endl; - QString timestamp = "(" + QDateTime::currentDateTime().toString("hh:mm:ss") + ") "; //QString pre = tr("Peer:" ); QString name = QString::fromStdString(ci->name); QString line = "" + timestamp + " " + name + " \n
"; - out << line.toStdString(); + extraTxt += line; - } - out << ci -> msg; + } + extraTxt += QString::fromStdWString(ci -> msg); /* This might be WIN32 only - or maybe Qt4.2.2 only - but need it for windows at the mom */ #if defined(Q_OS_WIN) - //out << "
"; // << std::endl; - out << std::endl; + extraTxt += "\n"; #else - out << std::endl; + extraTxt += "\n"; #endif - lastChatTime = ts; - lastChatName = ci->name; - - QString extra = QString::fromStdString(out.str()); - currenttxt += extra; - - msgWidget->setHtml(currenttxt); - -// std::cerr << " Added Text: " << std::endl; -// std::cerr << out.str() << std::endl; - QScrollBar *qsb = msgWidget->verticalScrollBar(); - qsb -> setValue(qsb->maximum()); -} - - -void PopupChatDialog::sendChat() -{ - QLineEdit *lineWidget = ui.lineEdit; - - ChatInfo ci; - + lastChatTime = ts; + lastChatName = ci->name; + + currenttxt += extraTxt; + + msgWidget->setHtml(currenttxt); + +// std::cerr << " Added Text: " << std::endl; +// std::cerr << out.str() << std::endl; + QScrollBar *qsb = msgWidget->verticalScrollBar(); + qsb -> setValue(qsb->maximum()); +} + + +void PopupChatDialog::sendChat() +{ + QLineEdit *lineWidget = ui.lineEdit; + + ChatInfo ci; + { rsiface->lockData(); /* Lock Interface */ const RsConfig &conf = rsiface->getConfig(); @@ -296,7 +291,7 @@ void PopupChatDialog::sendChat() rsiface->unlockData(); /* Unlock Interface */ } - ci.msg = lineWidget->text().toStdString(); + ci.msg = lineWidget->text().toStdWString(); ci.chatflags = RS_CHAT_PRIVATE; addChatMsg(&ci); diff --git a/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp b/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp index 07ad14540..b3781462e 100644 --- a/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp +++ b/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp @@ -162,13 +162,13 @@ void ChanMsgDialog::insertSendList() /* (0) Person */ item -> setText(0, QString::fromStdString(detail.name)); /* () Org */ - item -> setText(1, QString::fromStdString(detail.org)); + //item -> setText(1, QString::fromStdString(detail.org)); /* () Location */ - item -> setText(2, QString::fromStdString(detail.location)); + //item -> setText(2, QString::fromStdString(detail.location)); /* () Country */ - item -> setText(3, QString::fromStdString(detail.email)); + //item -> setText(3, QString::fromStdString(detail.email)); /* () Id */ - item -> setText(4, QString::fromStdString(detail.id)); + item -> setText(1, QString::fromStdString(detail.id)); item -> setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); //item -> setCheckState(0, Qt::Checked); @@ -192,7 +192,7 @@ void ChanMsgDialog::insertSendList() /* remove old items ??? */ sendWidget->clear(); - sendWidget->setColumnCount(6); + sendWidget->setColumnCount(1); /* add the items in! */ sendWidget->insertTopLevelItems(0, items); @@ -378,8 +378,8 @@ void ChanMsgDialog::sendMessage() /* construct a message */ MessageInfo mi; - mi.title = ui.titleEdit->text().toStdString(); - mi.msg = ui.msgText->toPlainText().toStdString(); + mi.title = ui.titleEdit->text().toStdWString(); + mi.msg = ui.msgText->toPlainText().toStdWString(); /* filled in later */ //mi.msgId = rand(); @@ -451,7 +451,7 @@ void ChanMsgDialog::togglePersonItem( QTreeWidgetItem *item, int col ) std::cerr << "TogglePersonItem()" << std::endl; /* extract id */ - std::string id = (item -> text(4)).toStdString(); + std::string id = (item -> text(1)).toStdString(); /* get state */ bool inMsg = (Qt::Checked == item -> checkState(0)); /* alway column 0 */ diff --git a/retroshare-gui/src/rsiface/notifyqt.cpp b/retroshare-gui/src/rsiface/notifyqt.cpp index bbe758515..0a82cb520 100644 --- a/retroshare-gui/src/rsiface/notifyqt.cpp +++ b/retroshare-gui/src/rsiface/notifyqt.cpp @@ -248,8 +248,12 @@ void NotifyQt::displayMessages() for(it = msgs.begin(); it != msgs.end(); it++) { out << "Message: "; - out << it->title << std::endl; - out << "\t" << it->msg << std::endl; + + std::string cnv_title(it->title.begin(), it->title.end()); + out << cnv_title << std::endl; + std::string cnv_msg(it->msg.begin(), it->msg.end()); + out << "\t" << cnv_msg << std::endl; + const std::list &files = it -> files; for(fit = files.begin(), i = 1; fit != files.end(); fit++, i++) { diff --git a/retroshare-gui/src/rsiface/rstypes.h b/retroshare-gui/src/rsiface/rstypes.h index 820d83cb6..ac7fdbcde 100644 --- a/retroshare-gui/src/rsiface/rstypes.h +++ b/retroshare-gui/src/rsiface/rstypes.h @@ -187,11 +187,11 @@ class MessageInfo: public BaseInfo std::list msgcc; std::list msgbcc; - std::string title; - std::string msg; + std::wstring title; + std::wstring msg; - std::string attach_title; - std::string attach_comment; + std::wstring attach_title; + std::wstring attach_comment; std::list files; int size; /* total of files */ int count; /* file count */ @@ -228,7 +228,7 @@ class ChatInfo: public BaseInfo std::string rsid; unsigned int chatflags; std::string name; - std::string msg; + std::wstring msg; }; /* matched to the uPnP states */