Skip to content

Commit 851b5b1

Browse files
committed
Lib manager GUI is updated after installing/upgrading library
1 parent a81772a commit 851b5b1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: app/src/cc/arduino/contributions/libraries/ui/LibraryManagerUI.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,11 @@ protected void onUpdatePressed() {
197197
try {
198198
setProgressVisible(true, "");
199199
installer.updateIndex(this::setProgress);
200-
((LibrariesIndexTableModel) contribModel).update();
201200
onIndexesUpdated();
201+
if (contribTable.getCellEditor() != null) {
202+
contribTable.getCellEditor().stopCellEditing();
203+
}
204+
((LibrariesIndexTableModel) contribModel).update();
202205
} catch (Exception e) {
203206
throw new RuntimeException(e);
204207
} finally {
@@ -234,12 +237,11 @@ public void onInstallPressed(final ContributedLibrary lib) {
234237
} else {
235238
installer.install(lib, this::setProgress);
236239
}
237-
// TODO: Do a better job in refreshing only the needed element
240+
onIndexesUpdated();
238241
if (contribTable.getCellEditor() != null) {
239242
contribTable.getCellEditor().stopCellEditing();
240243
}
241244
((LibrariesIndexTableModel) contribModel).update();
242-
onIndexesUpdated();
243245
} catch (Exception e) {
244246
throw new RuntimeException(e);
245247
} finally {
@@ -266,12 +268,11 @@ public void onRemovePressed(final ContributedLibrary lib) {
266268
try {
267269
setProgressVisible(true, tr("Removing..."));
268270
installer.remove(lib, this::setProgress);
269-
// TODO: Do a better job in refreshing only the needed element
271+
onIndexesUpdated();
270272
if (contribTable.getCellEditor() != null) {
271273
contribTable.getCellEditor().stopCellEditing();
272274
}
273275
((LibrariesIndexTableModel) contribModel).update();
274-
onIndexesUpdated();
275276
} catch (Exception e) {
276277
throw new RuntimeException(e);
277278
} finally {

0 commit comments

Comments
 (0)