Skip to content

Commit dfc61e8

Browse files
committed
panel.js: add dialog to launch settings when the last panel is removed
If the user removes the last remaining panel, pop up a dialog asking if they want to launch panel settings. This can help prevent situations where the desktop isn't usable for users that don't know how to get to panel settings other than through the panel/menu applet.
1 parent ccf753c commit dfc61e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

js/ui/panel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,14 @@ PanelManager.prototype = {
820820
this._setMainPanel();
821821
this._checkCanAdd();
822822
this._updateAllPointerBarriers();
823+
824+
// If the user removed the last panel, pop up a dialog to ask if they want to open panel settings
825+
if (panelProperties.length == 0) {
826+
let lastPanelRemovedDialog = new ModalDialog.ConfirmDialog(
827+
_("You don't have any panels added.\nDo you want to open panel settings?"),
828+
Lang.bind(this, function() { Util.spawnCommandLine("cinnamon-settings panel"); }));
829+
lastPanelRemovedDialog.open();
830+
}
823831
},
824832

825833
/**

0 commit comments

Comments
 (0)