diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 1996ce503..dbbfa4fb8 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -167,13 +167,11 @@ ForumsDialog::ForumsDialog(QWidget *parent) lastViewType = -1; /* add filter actions */ - ui.filterLineEdit->addFilter(QIcon(), tr("Title"), COLUMN_THREAD_TITLE); - ui.filterLineEdit->addFilter(QIcon(), tr("Date"), COLUMN_THREAD_DATE); - ui.filterLineEdit->addFilter(QIcon(), tr("Author"), COLUMN_THREAD_AUTHOR); - ui.filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_THREAD_CONTENT); + ui.filterLineEdit->addFilter(QIcon(), tr("Title"), COLUMN_THREAD_TITLE, tr("Search Title")); + ui.filterLineEdit->addFilter(QIcon(), tr("Date"), COLUMN_THREAD_DATE, tr("Search Date")); + ui.filterLineEdit->addFilter(QIcon(), tr("Author"), COLUMN_THREAD_AUTHOR, tr("Search Author")); + ui.filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_THREAD_CONTENT, tr("Search Content")); ui.filterLineEdit->setCurrentFilter(COLUMN_THREAD_TITLE); - // can be removed when the actions of the filter line edit have own placeholder text - ui.filterLineEdit->setPlaceholderText(tr("Search this forum...")) ; // load settings processSettings(true); diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 21e8e55b8..9558841f7 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -92,7 +92,8 @@ FriendsDialog::FriendsDialog(QWidget *parent) connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends())); connect( ui.filter_lineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString))); - ui.filter_lineEdit->setPlaceholderText(tr("Search")) ; + ui.filter_lineEdit->setPlaceholderText(tr("Search")) ; + ui.filter_lineEdit->showFilterIcon(); ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME); ui.avatar->setOwnId(); diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index a8430f445..03708d4ab 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -226,8 +226,6 @@ MessagesDialog::MessagesDialog(QWidget *parent) ui.filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_CONTENT, tr("Search Content")); ui.filterLineEdit->addFilter(QIcon(), tr("Tags"), COLUMN_TAGS, tr("Search Tags")); ui.filterLineEdit->addFilter(QIcon(), tr("Attachments"), COLUMN_ATTACHEMENTS, tr("Search Attachments")); - // can be removed when the actions of the filter line edit have own placeholder text - ui.filterLineEdit->setPlaceholderText(tr("Search...")) ; //setting default filter by column as subject ui.filterLineEdit->setCurrentFilter(COLUMN_SUBJECT); diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index 33bff43e4..dcc6e074e 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -133,6 +133,9 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) ui.displaytoolButton->setMenu(ui.friendList->createDisplayMenu()); + ui.filterLineEdit->setPlaceholderText(tr("Search")) ; + ui.filterLineEdit->showFilterIcon(); + // load settings RsAutoUpdatePage::lockAllEvents(); ui.friendList->setShowStatusColumn(false); diff --git a/retroshare-gui/src/gui/MessengerWindow.ui b/retroshare-gui/src/gui/MessengerWindow.ui index 3bfe60f5c..9750bcfa1 100644 --- a/retroshare-gui/src/gui/MessengerWindow.ui +++ b/retroshare-gui/src/gui/MessengerWindow.ui @@ -14,7 +14,7 @@ RetroShare Messenger - + :/images/rstray3.png:/images/rstray3.png @@ -118,28 +118,11 @@ 2 - - - 2 + + + Search Friends - - - - - - - :/images/find-16.png - - - - - - - Search Friends - - - - + @@ -147,7 +130,7 @@ Add a Friend - + :/images/user/add_user24.png:/images/user/add_user24.png @@ -167,7 +150,7 @@ Share Files for your Friends - + :/images/friendsfolder24.png:/images/friendsfolder24.png @@ -184,7 +167,7 @@ - + :/images/looknfeel.png:/images/looknfeel.png @@ -253,6 +236,11 @@ + + LineEditClear + QLineEdit +
gui/common/LineEditClear.h
+
AvatarWidget QLabel @@ -265,11 +253,6 @@
gui/common/FriendList.h
1
- - LineEditClear - QLineEdit -
gui/common/LineEditClear.h
-
LogoBar QFrame @@ -277,8 +260,6 @@ 1
- - - + diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index 12adb4c21..67ce1b51e 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -166,8 +166,8 @@ NetworkDialog::NetworkDialog(QWidget *parent) timer2->start(1000); /* add filter actions */ - ui.filterLineEdit->addFilter(QIcon(), tr("Name"), COLUMN_PEERNAME); - ui.filterLineEdit->addFilter(QIcon(), tr("Peer ID"), COLUMN_PEERID); + ui.filterLineEdit->addFilter(QIcon(), tr("Name"), COLUMN_PEERNAME, tr("Search Name")); + ui.filterLineEdit->addFilter(QIcon(), tr("Peer ID"), COLUMN_PEERID, tr("Search Peer ID")); ui.filterLineEdit->setCurrentFilter(COLUMN_PEERNAME); updateNetworkStatus(); diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp index 11b32d6df..7d439fc94 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp @@ -97,6 +97,7 @@ FriendSelectionWidget::FriendSelectionWidget(QWidget *parent) : ui->friendList->sortItems(COLUMN_NAME, Qt::AscendingOrder); ui->filterLineEdit->setPlaceholderText(tr("Search Friends")); + ui->filterLineEdit->showFilterIcon(); } FriendSelectionWidget::~FriendSelectionWidget() diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 6af62c591..2e4fa97ef 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -88,8 +88,6 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) : ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_NAME_INDEX , tr("Search Title")); ui->filterLineEdit->addFilter(QIcon(), tr("Description"), FILTER_DESC_INDEX , tr("Search Description")); ui->filterLineEdit->setCurrentFilter(FILTER_NAME_INDEX); - // can be removed when the actions of the filter line edit have own placeholder text - ui->filterLineEdit->setPlaceholderText(tr("Enter a Keyword here")); } GroupTreeWidget::~GroupTreeWidget() diff --git a/retroshare-gui/src/gui/common/LineEditClear.cpp b/retroshare-gui/src/gui/common/LineEditClear.cpp index 3f8fd0596..cbb4400a1 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.cpp +++ b/retroshare-gui/src/gui/common/LineEditClear.cpp @@ -35,17 +35,7 @@ LineEditClear::LineEditClear(QWidget *parent) : QLineEdit(parent) { mActionGroup = NULL; - - mFilterButton = new QToolButton(this); - mFilterButton->setFixedSize(16, 16); - QPixmap filterPixmap(IMAGE_FILTER); - mFilterButton->setIcon(QIcon(filterPixmap)); - mFilterButton->setIconSize(filterPixmap.size()); - mFilterButton->setCursor(Qt::ArrowCursor); - mFilterButton->setStyleSheet("QToolButton { border: none; padding: 0px; }" - "QToolButton[popupMode=\"2\"] { padding-right: 10px; }" - "QToolButton::menu-indicator[popupMode=\"2\"] { subcontrol-origin: padding; subcontrol-position: bottom right; top: 5px; left: -3px; width: 7px; }"); - mFilterButton->move(2, 2); + mFilterButton = NULL; mClearButton = new QToolButton(this); mClearButton->setFixedSize(16, 16); @@ -70,7 +60,7 @@ LineEditClear::LineEditClear(QWidget *parent) int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); QSize msz = minimumSizeHint(); setMinimumSize( - qMax(msz.width(), mClearButton->sizeHint().height() + mFilterButton->sizeHint().width() + frameWidth * 2), + qMax(msz.width(), mClearButton->sizeHint().height() + /*mFilterButton->sizeHint().width() + */frameWidth * 2), qMax(msz.height(), mClearButton->sizeHint().height() + frameWidth * 2)); } @@ -82,7 +72,7 @@ void LineEditClear::resizeEvent(QResizeEvent *) #if QT_VERSION < 0x040700 sz = mFilterLabel->sizeHint(); - mFilterLabel->move(frameWidth + mFilterButton->sizeHint().width() + 5, (rect().bottom() + 1 - sz.height())/2); + mFilterLabel->move(frameWidth + (mFilterButton ? mFilterButton->sizeHint().width() + 5 : 0), (rect().bottom() + 1 - sz.height())/2); #endif } @@ -118,7 +108,27 @@ void LineEditClear::reposButtons() int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); setStyleSheet(QString("QLineEdit { padding-right: %1px; padding-left: %2px; }") .arg(mClearButton->sizeHint().width() + frameWidth + 1) - .arg(mFilterButton->sizeHint().width() + frameWidth + 1)); + .arg(mFilterButton ? mFilterButton->sizeHint().width() + frameWidth + 1 : 0)); +} + +void LineEditClear::showFilterIcon() +{ + if (mFilterButton) { + return; + } + + mFilterButton = new QToolButton(this); + mFilterButton->setFixedSize(16, 16); + QPixmap filterPixmap(IMAGE_FILTER); + mFilterButton->setIcon(QIcon(filterPixmap)); + mFilterButton->setIconSize(filterPixmap.size()); + mFilterButton->setCursor(Qt::ArrowCursor); + mFilterButton->setStyleSheet("QToolButton { border: none; padding: 0px; }" + "QToolButton[popupMode=\"2\"] { padding-right: 10px; }" + "QToolButton::menu-indicator[popupMode=\"2\"] { subcontrol-origin: padding; subcontrol-position: bottom right; top: 5px; left: -3px; width: 7px; }"); + mFilterButton->move(2, 2); + + reposButtons(); } void LineEditClear::updateClearButton(const QString& text) @@ -133,6 +143,8 @@ void LineEditClear::addFilter(const QIcon &icon, const QString &text, int id, co action->setCheckable(true); mDescription[id] = description; + showFilterIcon(); + if (mActionGroup == NULL) { mFilterButton->setFixedSize(26, 16); mFilterButton->setPopupMode(QToolButton::InstantPopup); @@ -157,6 +169,10 @@ void LineEditClear::addFilter(const QIcon &icon, const QString &text, int id, co void LineEditClear::setCurrentFilter(int id) { + if (mFilterButton == NULL) { + return; + } + QMenu *menu = mFilterButton->menu(); if (menu) { Q_FOREACH (QAction *action, menu->actions()) { diff --git a/retroshare-gui/src/gui/common/LineEditClear.h b/retroshare-gui/src/gui/common/LineEditClear.h index f0cee2fe7..98b1b69e0 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.h +++ b/retroshare-gui/src/gui/common/LineEditClear.h @@ -43,6 +43,8 @@ public: void setCurrentFilter(int id); int currentFilter(); + void showFilterIcon(); + //#if QT_VERSION < 0x040700 // for Qt version with setPlaceholderText too to set the tooltip of the lineedit void setPlaceholderText(const QString &text); diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp index b93210dc1..d1545b2df 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -114,6 +114,8 @@ ImHistoryBrowser::ImHistoryBrowser(const std::string &peerId, QTextEdit *edit, Q connect(ui.listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged())); connect(ui.listWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); + ui.filterLineEdit->showFilterIcon(); + // embed smileys ? if (m_isPrivateChat) { embedSmileys = Settings->valueFromGroup("Chat", "Emoteicons_PrivatChat", true).toBool(); diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui index fa7675808..0c5c40b0b 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui @@ -49,7 +49,10 @@ - + + 2 + + 2 @@ -57,16 +60,6 @@ 1 - - - - - - - :/images/find-16.png - - - diff --git a/retroshare-gui/src/lang/retroshare_en.ts b/retroshare-gui/src/lang/retroshare_en.ts index 673b922e9..9b73065c5 100644 --- a/retroshare-gui/src/lang/retroshare_en.ts +++ b/retroshare-gui/src/lang/retroshare_en.ts @@ -4092,7 +4092,19 @@ p, li { white-space: pre-wrap; } - Search this forum... + Search Title + + + + Search Date + + + + Search Author + + + + Search Content @@ -5482,10 +5494,6 @@ p, li { white-space: pre-wrap; } GroupTreeWidget - - Enter a Keyword here - - Title @@ -7234,10 +7242,6 @@ Do you want to save message ? Search Attachments - - Search... - - MessengerWindow @@ -7257,6 +7261,10 @@ Do you want to save message ? Search Friends + + Search + + MsgItem @@ -7535,6 +7543,14 @@ Right-click and select 'make friend' to be able to connect. Display + + Search Name + + + + Search Peer ID + + NetworkPage