diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 221e29cdb..7e805212d 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -91,6 +91,9 @@ MessagesDialog::MessagesDialog(QWidget *parent) connect(ui.actionSave_as, SIGNAL(triggered()), this, SLOT(fileSaveAs())); + connect( ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); + connect( ui.filterPatternLineEdit, SIGNAL( textChanged(const QString &)), this, SLOT(toggleclearButton())); + connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged())); @@ -168,6 +171,9 @@ MessagesDialog::MessagesDialog(QWidget *parent) //sertting default filter by column as subject proxyModel->setFilterKeyColumn(ui.filterColumnComboBox->currentIndex()); + + ui.clearButton->hide(); + /* Hide platform specific features */ #ifdef Q_WS_WIN @@ -1299,3 +1305,26 @@ void MessagesDialog::updateMessageSummaryList() } } + +/** clear Filter **/ +void MessagesDialog::clearFilter() +{ + ui.filterPatternLineEdit->clear(); + ui.filterPatternLineEdit->setFocus(); +} + +/* toggle clearButton */ +void MessagesDialog::toggleclearButton() +{ + QString text = ui.filterPatternLineEdit->text(); + + if (text.isEmpty()) + { + ui.clearButton->hide(); + } + else + { + ui.clearButton->show(); + } + +} \ No newline at end of file diff --git a/retroshare-gui/src/gui/MessagesDialog.h b/retroshare-gui/src/gui/MessagesDialog.h index 14243ba68..2ece8a1b1 100644 --- a/retroshare-gui/src/gui/MessagesDialog.h +++ b/retroshare-gui/src/gui/MessagesDialog.h @@ -89,6 +89,9 @@ private slots: void filterRegExpChanged(); void filterColumnChanged(); + + void clearFilter(); + void toggleclearButton(); private: /** A RetroShare Settings object used for saving/loading settings */ diff --git a/retroshare-gui/src/gui/MessagesDialog.ui b/retroshare-gui/src/gui/MessagesDialog.ui index 90e70c4c7..1302f7d51 100644 --- a/retroshare-gui/src/gui/MessagesDialog.ui +++ b/retroshare-gui/src/gui/MessagesDialog.ui @@ -534,6 +534,60 @@ border: 1px solid #CCCCCC;} 2 + + 6 + + + + + + 0 + 0 + + + + + 167777 + 167777 + + + + <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> + + + + + + Compose + + + + :/images/folder-draft24.png:/images/folder-draft24.png + + + + 24 + 24 + + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Vertical + + + @@ -654,6 +708,13 @@ p, li { white-space: pre-wrap; } + + + + Qt::Vertical + + + @@ -698,64 +759,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 167777 - 167777 - - - - <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> - - - - - - Compose - - - - :/images/folder-draft24.png:/images/folder-draft24.png - - - - 24 - 24 - - - - Qt::ToolButtonIconOnly - - - true - - - - - - - Qt::Vertical - - - - - - - Qt::Vertical - - - @@ -829,8 +832,65 @@ p, li { white-space: pre-wrap; } + + + + Qt::Horizontal + + + + 40 + 20 + + + + - + + + 1 + + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + Reset + + + QPushButton +{ + border-image: url(:/images/closenormal.png) +} + +QPushButton:hover +{ +border-image: url(:/images/closehover.png) +} + +QPushButton:pressed { +border-image: url(:/images/closepressed.png) +} + + + + + + + @@ -859,19 +919,6 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - - 40 - 20 - - - -