... with checkbox state changes.Updating the state and reopening the dialog
for it to actually affect the query seems counter intuitive. Also, no need to
save state when dialog closes, as the setting will already be updated.
The dialog is somewhat analogous to track search dialog. Some noticeable
points are:
* Allow searching for albums from clusters, by right clicking.
* Move save and restore state/size logic to individual classes, from parent
class `SearchDialog`. Both dialogs have different number of columns, and
elements.
... for purpose of extracting label information. Reason being, `count`
element isn't present in `label_info_list` element of search xml.
Checking for length of children has same effect as with checking count
element.
Three parts:
(1) The monkey patching of EncodedTextSpec to ignore encoding errors
when using latin1 as encoding.
This gets replaced with a new id3text function which makes sure
that any value passed to mutagen can be encoded with the selected
encoding
(2) MultiSpec monkey patch to not null terminate a list of strings.
While this is valid according to the spec mutagen decided to terminate
all strings (not only the text lists handled here). If this is a
problem it should be discussed upstream (mutagen).
(3) compatid3 which implemented id3v2.3 support and added some
additional frames.
This gets replaced with the id3v2.3 support implemented upstream.
The additional frames still get passed to mutagen and, to match
the previous implementation, update_to_v23() gets wrapped to
allow some v2.4 only frames.
The newly added id3v2.3 code depends on mutagen 1.22+
This happens with displaying error. New widgets may appear without
existing being cleared. To avoid this:
1. Pass parent widget to `error_label` so it gets removed with parent.
2. Use `takeAt` rather than `itemAt` as it's more suitable for removing
widgets according to Qt docs. For reference:
http://doc.qt.io/qt-4.8/qlayout.html#itemAt and
http://doc.qt.io/qt-4.8/qlayout.html#takeAt
Some noticeable points:
* `save_state` can check whether table is loaded or not. No need to
check it in `accept` and `reject`. Also `table_loaded` isn't required
anymore.
* Keep file formats list in alphabatic order, in `makeqrc.py`.
* Import `Track` and use `isinstance` to check whether object belongs to
it.
The ResultTable is resized using size information from
config.setting["searchdialog_header_state"]. As this value is updated
only when the dialog is closed, any ongoing changes (i.e. without
closing the dialog) will be ignored. This patch avoids that.
Exception can be generated after the table widget has been deleted. Say,
table is displayed first. But for next search, some network error
occurs. The table widget will get deleted by
`add_widget_to_center_layout` as soon as progress widget is displayed.
`self.table` would have the widget reference, but it's cleared from memory,
resulting in an exception, like -> "wrapped object has been deleted".
To avoid this, unreference `self.table` if corresponding widget is
to be deleted. The other two widgets namely `self.progress_widget` and
`self.error_widget` aren't (and probably wouldn't in future) accessed by
any other method. So, no need to explicity unreference them. They will
be reassigned a new widget when `show_progress` and `show_error` are called
respectively.
There are existing methods to parse xml nodes of a recording. Use
them to avoid duplicating code.
For extracting country details, use separate functionality. Reason
being, current `release_to_metadata` method uses `country` element
to extract country details. This element is obsolete as there
can be multiple countries, and this element returns only one.
The `country` element (used till now) is obsolete. It contains
information of a single country where album is released. Instead
extract all country codes from iso_3166_1_code_list element and
display them.