Skip to content

Commit 0ee0fcc

Browse files
committed
[Lib manager] Fix only member being rendered incorrectly if filter active and update/install
1 parent b1b609e commit 0ee0fcc

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

app/src/cc/arduino/contributions/libraries/ui/LibraryManagerUI.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ protected void onUpdatePressed() {
200200
try {
201201
setProgressVisible(true, "");
202202
installer.updateIndex(this::setProgress);
203-
onIndexesUpdated();
203+
//onIndexesUpdated();
204204
} catch (Exception e) {
205205
throw new RuntimeException(e);
206206
} finally {
@@ -218,8 +218,10 @@ public void onInstallPressed(final ContributedLibrary lib, final Optional<Contri
218218
try {
219219
setProgressVisible(true, tr("Installing..."));
220220
installer.install(lib, mayReplaced, this::setProgress);
221-
onIndexesUpdated();
222221
// TODO: Do a better job in refreshing only the needed element
222+
if (contribTable.getCellEditor() != null) {
223+
contribTable.getCellEditor().stopCellEditing();
224+
}
223225
((LibrariesIndexTableModel) contribModel).update();
224226
} catch (Exception e) {
225227
throw new RuntimeException(e);
@@ -247,8 +249,10 @@ public void onRemovePressed(final ContributedLibrary lib) {
247249
try {
248250
setProgressVisible(true, tr("Removing..."));
249251
installer.remove(lib, this::setProgress);
250-
onIndexesUpdated();
251252
// TODO: Do a better job in refreshing only the needed element
253+
if (contribTable.getCellEditor() != null) {
254+
contribTable.getCellEditor().stopCellEditing();
255+
}
252256
((LibrariesIndexTableModel) contribModel).update();
253257
} catch (Exception e) {
254258
throw new RuntimeException(e);
@@ -260,9 +264,4 @@ public void onRemovePressed(final ContributedLibrary lib) {
260264
installerThread.setUncaughtExceptionHandler(new InstallerJDialogUncaughtExceptionHandler(this, noConnectionErrorMessage));
261265
installerThread.start();
262266
}
263-
264-
protected void onIndexesUpdated() throws Exception {
265-
// Empty
266-
}
267-
268267
}

app/src/cc/arduino/contributions/ui/InstallerJDialog.java

-4
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ protected void onFilter(String[] _filters) {
127127
contribTable.getCellEditor().stopCellEditing();
128128
}
129129
updateIndexFilter(filters, categoryFilter);
130-
if (contribModel.getRowCount() == 1) {
131-
// TODO: understand why it doesn't work
132-
//contribTable.addRowSelectionInterval(0, 0);
133-
}
134130
}
135131
};
136132

0 commit comments

Comments
 (0)