mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-03 12:47:31 +01:00
Merge pull request #4212 from paperbagcorner/searchtooltip
Don't translate field names in the library search filter tool tip
This commit is contained in:
commit
5066dcf696
@ -20,12 +20,14 @@
|
||||
#include "libraryquery.h"
|
||||
#include "groupbydialog.h"
|
||||
#include "ui_libraryfilterwidget.h"
|
||||
#include "core/song.h"
|
||||
#include "ui/iconloader.h"
|
||||
#include "ui/settingsdialog.h"
|
||||
|
||||
#include <QActionGroup>
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
#include <QRegExp>
|
||||
#include <QSettings>
|
||||
#include <QSignalMapper>
|
||||
#include <QTimer>
|
||||
@ -39,6 +41,13 @@ LibraryFilterWidget::LibraryFilterWidget(QWidget* parent)
|
||||
filter_applies_to_model_(true),
|
||||
delay_behaviour_(DelayedOnLargeLibraries) {
|
||||
ui_->setupUi(this);
|
||||
|
||||
// Add the available fields to the tooltip here instead of the ui
|
||||
// file to prevent that they get translated by mistake.
|
||||
QString available_fields =
|
||||
Song::kFtsColumns.join(", ").replace(QRegExp("\\bfts"), "");
|
||||
ui_->filter->setToolTip(ui_->filter->toolTip().arg(available_fields));
|
||||
|
||||
connect(ui_->filter, SIGNAL(returnPressed()), SIGNAL(ReturnPressed()));
|
||||
connect(filter_delay_, SIGNAL(timeout()), SLOT(FilterDelayTimeout()));
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
<item>
|
||||
<widget class="QSearchField" name="filter" native="true">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Prefix a word with a field name to limit the search to that field, e.g. <span style=" font-weight:600;">artist:</span><span style=" font-style:italic;">Bode</span> searches the library for all artists that contain the word Bode.</p><p><span style=" font-weight:600;">Available fields: </span><span style=" font-style:italic;">title, album, artist, albumartist, composer, performer, grouping, genre, comment</span>.</p></body></html></string>
|
||||
<string><html><head/><body><p>Prefix a word with a field name to limit the search to that field, e.g. <span style=" font-weight:600;">artist:</span><span style=" font-style:italic;">Bode</span> searches the library for all artists that contain the word Bode.</p><p><span style=" font-weight:600;">Available fields: </span><span style=" font-style:italic;">%1</span>.</p></body></html></string>
|
||||
</property>
|
||||
<property name="placeholderText" stdset="0">
|
||||
<string>Enter search terms here</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user