fix: select library screen skipped even we have 2+ libraries
This commit is contained in:
@@ -11,10 +11,13 @@ Item {
|
||||
width: Math.min(0.66 * parent.width, 320)
|
||||
height: parent.height
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
ListView {
|
||||
id: listView
|
||||
clip: true
|
||||
anchors.fill: parent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
model: AppController.foldersModel
|
||||
delegate: ItemDelegate {
|
||||
text: model.display
|
||||
@@ -24,6 +27,14 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
Layout.fillWidth: true
|
||||
text: "Select Library"
|
||||
onClicked: function() {
|
||||
AppController.selectedLibraryId = -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
@@ -25,11 +25,6 @@ Control {
|
||||
AppController.selectedLibraryId = model.libraryId
|
||||
}
|
||||
}
|
||||
onCountChanged: function() {
|
||||
if (count == 1) {
|
||||
AppController.selectedLibraryId = model.data(modelIndex(0), LibraryItem.IdRole)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +32,13 @@ Control {
|
||||
AppController.updateLibraries()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AppController
|
||||
onLibrariesLoaded: function(count) {
|
||||
if (count === 1) {
|
||||
AppController.selectedLibraryId = model.data(modelIndex(0), LibraryItem.IdRole)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ void AppController::updateLibraries()
|
||||
libraryObj["name"].toString(),
|
||||
libraryObj["uuid"].toString()));
|
||||
}
|
||||
emit librariesLoaded(array.count());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
Q_INVOKABLE QString comicImageSource(int page);
|
||||
|
||||
signals:
|
||||
void librariesLoaded(int count);
|
||||
void connectionStateChanged(ConnectionState newState);
|
||||
void currentLibraryIdChanged(int newLibraryId);
|
||||
void currentComicIdChanged(QString newComicId);
|
||||
|
||||
Reference in New Issue
Block a user