diff --git a/.gitignore b/.gitignore index ecf9f7099..9a8091201 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ Makefile* Thumbs.db *.pro.user .kdev4 -*.kdev4 +*.kdev4 \ No newline at end of file diff --git a/retroshare-gui/src/Info.plist b/retroshare-gui/src/Info.plist index 1dfea76cf..93b6d131a 100755 --- a/retroshare-gui/src/Info.plist +++ b/retroshare-gui/src/Info.plist @@ -44,5 +44,6 @@ + NSRequiresAquaSystemAppearance diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index dea3ea4e2..884355d87 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -71,14 +71,14 @@ #define IMAGE_CREATE "" #define IMAGE_PUBLIC ":/icons/png/chats.png" #define IMAGE_PRIVATE ":/icons/png/chats-private.png" -#define IMAGE_SUBSCRIBE ":/images/edit_add24.png" -#define IMAGE_UNSUBSCRIBE ":/images/cancel.png" +#define IMAGE_SUBSCRIBE ":/icons/png/enter.png" +#define IMAGE_UNSUBSCRIBE ":/icons/png/leave2.png" #define IMAGE_PEER_ENTERING ":images/user/add_user24.png" #define IMAGE_PEER_LEAVING ":images/user/remove_user24.png" -#define IMAGE_TYPING ":images/typing.png" +#define IMAGE_TYPING ":images/typing.png" #define IMAGE_MESSAGE ":images/chat.png" #define IMAGE_AUTOSUBSCRIBE ":images/accepted16.png" -#define IMAGE_COPYRSLINK ":/images/copyrslink.png" +#define IMAGE_COPYRSLINK ":/icons/png/copy.png" ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags) : RsAutoUpdatePage(5000, parent, flags) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index b0a438930..e0e3d838e 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -121,8 +121,11 @@ #include #define IMAGE_QUIT ":/icons/png/exit.png" -#define IMAGE_PREFERENCES ":/icons/png/options.png" +#define IMAGE_PREFERENCES ":/icons/png/options2.png" #define IMAGE_ABOUT ":/icons/png/info.png" +#define IMAGE_STATS ":/icons/png/netgraph2.png" +#define IMAGE_CLOSE ":/icons/png/exit2.png" + #define IMAGE_ADDFRIEND ":/icons/png/invite.png" #define IMAGE_RETROSHARE ":/icons/logo_128.png" #define IMAGE_NOONLINE ":/icons/logo_0_connected_128.png" @@ -130,9 +133,8 @@ #define IMAGE_TWOONLINE ":/icons/logo_2_connected_128.png" #define IMAGE_OVERLAY ":/icons/star_overlay_128.png" -#define IMAGE_BWGRAPH ":/images/ksysguard.png" +#define IMAGE_BWGRAPH ":/icons/png/bandwidth.png" #define IMAGE_MESSENGER ":/images/rsmessenger48.png" -#define IMAGE_CLOSE ":/images/close_normal.png" #define IMAGE_BLOCK ":/images/blockdevice.png" #define IMAGE_COLOR ":/images/highlight.png" #define IMAGE_GAMES ":/images/kgames.png" @@ -146,7 +148,6 @@ #define IMAGE_PLUGINS ":/images/extension_32.png" #define IMAGE_BLOGS ":/images/kblogger.png" -#define IMAGE_DHT ":/images/dht16.png" /*static*/ bool MainWindow::hiddenmode = false; @@ -609,7 +610,7 @@ void MainWindow::createTrayIcon() trayMenu->addAction(QIcon(":/images/emblem-web.png"), tr("Show web interface"), this, SLOT(showWebinterface())); #endif // ENABLE_WEBUI trayMenu->addAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth Graph"), this, SLOT(showBandwidthGraph())); - trayMenu->addAction(QIcon(IMAGE_DHT), tr("Statistics"), this, SLOT(showStatisticsWindow())); + trayMenu->addAction(QIcon(IMAGE_STATS), tr("Statistics"), this, SLOT(showStatisticsWindow())); #ifdef UNFINISHED diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index da04f457a..d5bbc3d2b 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -132,8 +132,8 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi // Add a button to invite friends. // inviteFriendsButton = new QToolButton ; - inviteFriendsButton->setMinimumSize(icon_size); - inviteFriendsButton->setMaximumSize(icon_size); + //inviteFriendsButton->setMinimumSize(icon_size); + //inviteFriendsButton->setMaximumSize(icon_size); inviteFriendsButton->setText(QString()) ; inviteFriendsButton->setAutoRaise(true) ; inviteFriendsButton->setToolTip(tr("Invite friends to this lobby")); @@ -177,8 +177,8 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi connect(ownIdChooser,SIGNAL(currentIndexChanged(int)),this,SLOT(changeNickname())) ; unsubscribeButton = new QToolButton; - unsubscribeButton->setMinimumSize(icon_size); - unsubscribeButton->setMaximumSize(icon_size); + //unsubscribeButton->setMinimumSize(icon_size); + //unsubscribeButton->setMaximumSize(icon_size); unsubscribeButton->setText(QString()) ; unsubscribeButton->setAutoRaise(true) ; unsubscribeButton->setToolTip(tr("Leave this chat room (Unsubscribe)")); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index cce118f78..144eeae6f 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.ui +++ b/retroshare-gui/src/gui/chat/ChatWidget.ui @@ -807,17 +807,20 @@ border-image: url(:/images/closepressed.png) QFrame::Plain + + 3 + 2 - 2 + 0 2 - 2 + 0 diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp index 66e871fd1..fa038f7fc 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "CreateGxsChannelMsg.h" #include "gui/gxs/GxsIdDetails.h" @@ -72,7 +73,8 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId connect(thumbNailCb, SIGNAL(toggled(bool)), this, SLOT(allowAutoMediaThumbNail(bool))); connect(tabWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint))); connect(generateCheckBox, SIGNAL(toggled(bool)), generateSpinBox, SLOT(setEnabled(bool))); - + connect(addPictureButton, SIGNAL(clicked()), this, SLOT(addPicture())); + connect(msgEdit, SIGNAL(textChanged()), this, SLOT(checkLength())); generateSpinBox->setEnabled(false); thumbNailCb->setVisible(false); @@ -94,6 +96,26 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId #endif } +static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000; + +void CreateGxsChannelMsg::checkLength() +{ + QString text; + RsHtml::optimizeHtml(msgEdit, text); + std::wstring msg = text.toStdWString(); + int charRemains = MAX_ALLOWED_GXS_MESSAGE_SIZE - msg.length(); + if(charRemains >= 0) { + text = tr("It remains %1 characters after HTML conversion.").arg(charRemains); + infoLabel->setStyleSheet("QLabel#infoLabel { }"); + }else{ + text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains)); + infoLabel->setStyleSheet("QLabel#infoLabel {color: red; font: bold; }"); + } + buttonBox->button(QDialogButtonBox::Ok)->setToolTip(text); + buttonBox->button(QDialogButtonBox::Ok)->setEnabled(charRemains>=0); + infoLabel->setText(text); +} + CreateGxsChannelMsg::~CreateGxsChannelMsg() { Settings->saveWidgetInformation(this); @@ -741,6 +763,18 @@ void CreateGxsChannelMsg::addThumbnail() thumbnail_label->setPixmap(picture); } +void CreateGxsChannelMsg::addPicture() +{ + QString file; + if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg)", file)) { + QString encodedImage; + if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, MAX_ALLOWED_GXS_MESSAGE_SIZE - 200)) { + QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage); + msgEdit->textCursor().insertFragment(fragment); + } + } +} + void CreateGxsChannelMsg::loadChannelPostInfo(const uint32_t &token) { #ifdef DEBUG_CREATE_GXS_MSG diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h index bb8f15518..96b9dd6d3 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h @@ -69,6 +69,8 @@ private slots: void contextMenu(QPoint) ; void addThumbnail(); + void addPicture(); + void checkLength(); void allowAutoMediaThumbNail(bool); private: diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui index 3f4cd7d4b..8b53c93d6 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui @@ -6,8 +6,8 @@ 0 0 - 875 - 659 + 671 + 513 @@ -96,19 +96,6 @@ - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">Attachments:</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Use Drag and Drop / Add Files button, to Hash new files.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Copy/Paste RetroShare links from your shares</span></p></body></html> - - - @@ -131,6 +118,30 @@ p, li { white-space: pre-wrap; } + + + + Add Picture + + + + :/images/add_image24.png:/images/add_image24.png + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">Attachments:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Use Drag and Drop / Add Files button, to Hash new files.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Copy/Paste RetroShare links from your shares</span></p></body></html> + + + @@ -194,6 +205,13 @@ p, li { white-space: pre-wrap; } + + + + + + + @@ -302,8 +320,8 @@ p, li { white-space: pre-wrap; } 0 0 - 767 - 42 + 812 + 24 @@ -390,17 +408,17 @@ p, li { white-space: pre-wrap; } + + MimeTextEdit + QTextEdit +
gui/common/MimeTextEdit.h
+
HeaderFrame QFrame
gui/common/HeaderFrame.h
1
- - MimeTextEdit - QTextEdit -
gui/common/MimeTextEdit.h
-
diff --git a/retroshare-gui/src/gui/icons.qrc b/retroshare-gui/src/gui/icons.qrc index abbdf8995..a7d13522a 100644 --- a/retroshare-gui/src/gui/icons.qrc +++ b/retroshare-gui/src/gui/icons.qrc @@ -80,6 +80,7 @@ icons/png/chat-lobbies.png icons/png/circles.png icons/png/empty-circle.png + icons/png/enter.png icons/png/exit.png icons/png/feedreader-notify.png icons/png/feedreader.png @@ -98,14 +99,16 @@ icons/png/invite.png icons/png/keyring.png icons/png/leave.png + icons/png/leave2.png icons/png/messages-notify.png icons/png/messages.png icons/png/microphone_mute.png icons/png/microphone.png icons/png/netgraph.png + icons/png/netgraph2.png icons/png/network-notify.png icons/png/network.png - icons/png/network2.png + icons/png/network2.png icons/png/network-puplic.png icons/png/newsfeed-notify.png icons/png/newsfeed.png @@ -271,12 +274,16 @@ icons/png/correct.png icons/png/comment.png icons/png/chats.png - icons/png/chats-private.png + icons/png/chats-private.png icons/png/fileshare.png icons/png/forum.png icons/png/message.png icons/png/newsfeed2.png icons/png/postedlinks.png icons/png/people2.png + icons/png/bandwidth.png + icons/png/netgraph2.png + icons/png/options2.png + icons/png/exit2.png diff --git a/retroshare-gui/src/gui/icons/png/bandwidth.png b/retroshare-gui/src/gui/icons/png/bandwidth.png new file mode 100644 index 000000000..e7032dbf6 Binary files /dev/null and b/retroshare-gui/src/gui/icons/png/bandwidth.png differ diff --git a/retroshare-gui/src/gui/icons/png/enter.png b/retroshare-gui/src/gui/icons/png/enter.png new file mode 100644 index 000000000..84b71ec4a Binary files /dev/null and b/retroshare-gui/src/gui/icons/png/enter.png differ diff --git a/retroshare-gui/src/gui/icons/png/exit2.png b/retroshare-gui/src/gui/icons/png/exit2.png new file mode 100644 index 000000000..102927bec Binary files /dev/null and b/retroshare-gui/src/gui/icons/png/exit2.png differ diff --git a/retroshare-gui/src/gui/icons/png/leave2.png b/retroshare-gui/src/gui/icons/png/leave2.png new file mode 100644 index 000000000..ea852a46c Binary files /dev/null and b/retroshare-gui/src/gui/icons/png/leave2.png differ diff --git a/retroshare-gui/src/gui/icons/png/netgraph2.png b/retroshare-gui/src/gui/icons/png/netgraph2.png new file mode 100644 index 000000000..8ee18c4a1 Binary files /dev/null and b/retroshare-gui/src/gui/icons/png/netgraph2.png differ diff --git a/retroshare-gui/src/gui/icons/png/options2.png b/retroshare-gui/src/gui/icons/png/options2.png new file mode 100644 index 000000000..bd113e887 Binary files /dev/null and b/retroshare-gui/src/gui/icons/png/options2.png differ diff --git a/retroshare-gui/src/gui/icons/svg/netgraph2.svg b/retroshare-gui/src/gui/icons/svg/netgraph2.svg new file mode 100644 index 000000000..518258a58 --- /dev/null +++ b/retroshare-gui/src/gui/icons/svg/netgraph2.svg @@ -0,0 +1,51 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-gui/src/gui/icons/svg/options-blank.svg b/retroshare-gui/src/gui/icons/svg/options-blank.svg new file mode 100644 index 000000000..fbb3f6bf9 --- /dev/null +++ b/retroshare-gui/src/gui/icons/svg/options-blank.svg @@ -0,0 +1,59 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.h b/retroshare-gui/src/gui/msgs/MessagesDialog.h index 9eeb577f0..1671df268 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.h +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.h @@ -26,7 +26,7 @@ #include "mainpage.h" #include "ui_MessagesDialog.h" -#define IMAGE_MESSAGES ":/icons/png/messages.png" +#define IMAGE_MESSAGES ":/icons/png/message.png" class RSTreeWidgetItemCompareRole; class MessageWidget;