diff --git a/app/musicmuster.py b/app/musicmuster.py index faa89e9..c89cf38 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -496,6 +496,7 @@ class DbDialog(QDialog): self.ui.btnAdd.clicked.connect(self.add_selected) self.ui.btnAddClose.clicked.connect(self.add_selected_and_close) self.ui.btnClose.clicked.connect(self.close) + self.ui.matchList.itemSelectionChanged.connect(self.selection_changed) record = Settings.get_int("dbdialog_width") width = record.f_int or 800 @@ -554,6 +555,14 @@ class DbDialog(QDialog): self.ui.searchString.selectAll() self.ui.searchString.setFocus() + def selection_changed(self): + if not self.ui.matchList.selectedItems(): + return + + item = self.ui.matchList.currentItem() + track_id = item.data(Qt.UserRole) + self.ui.dbPath.setText(Tracks.get_path(track_id)) + class SelectPlaylistDialog(QDialog): def __init__(self, parent=None): @@ -564,6 +573,12 @@ class SelectPlaylistDialog(QDialog): self.ui.buttonBox.accepted.connect(self.open) self.ui.buttonBox.rejected.connect(self.close) + record = Settings.get_int("select_playlist_dialog_width") + width = record.f_int or 800 + record = Settings.get_int("select_playlist_dialog_height") + height = record.f_int or 600 + self.resize(width, height) + for (plid, plname) in [ (a.id, a.name) for a in Playlists.get_all_playlists() ]: @@ -572,6 +587,15 @@ class SelectPlaylistDialog(QDialog): p.setData(Qt.UserRole, plid) self.ui.lstPlaylists.addItem(p) + def __del__(self): + record = Settings.get_int("select_playlist_dialog_height") + if record.f_int != self.height(): + record.update({'f_int': self.height()}) + + record = Settings.get_int("select_playlist_dialog_width") + if record.f_int != self.width(): + record.update({'f_int': self.width()}) + def list_doubleclick(self, entry): self.plid = entry.data(Qt.UserRole) self.accept() diff --git a/app/ui/dlg_SearchDatabase.ui b/app/ui/dlg_SearchDatabase.ui index fcbde29..5f3088e 100644 --- a/app/ui/dlg_SearchDatabase.ui +++ b/app/ui/dlg_SearchDatabase.ui @@ -13,8 +13,8 @@ Dialog - - + + @@ -28,51 +28,54 @@ - - + + + + + + + + + + + + - + + + Qt::Horizontal + + + + 88 + 20 + + + - - - - - Qt::Horizontal - - - - 88 - 20 - - - - - - - - &Add - - - true - - - - - - - A&dd and close - - - - - - - &Close - - - - + + + &Add + + + true + + + + + + + A&dd and close + + + + + + + &Close + +