summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/baside2b.cxx
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2023-01-11 14:46:07 +0000
committerRafael Lima <rafael.palma.lima@gmail.com>2023-01-16 11:28:35 +0000
commitd466df5bc220eb80b8a51ff64507de881b938ed3 (patch)
tree4861946cb4571e5ef05f3bf26144acb6c2f92a6a /basctl/source/basicide/baside2b.cxx
parent465ec8b275f2685a31ee42ca1447a5d44d18a227 (diff)
tdf#106731 Warn user that a module/dialog is read-only in Basic IDE
As discussed in the ticket the Basic IDE does not make it clear that the currently opened module is read-only, which can cause confusion to the user, since they may be pressing keys and seeing no result. With this patch the IDE clarifies that the module/dialog is read-only in two ways: 1) In the status bar the string "(Read-only)" is added after the module/dialog name 2) When a module/dialog is opened an infobar is shown warning that it is read-only. 3) In a module, if the user closed the infobar and tries to edit the code, the infobar is shown again. Change-Id: I15197c4316bb2ed19e54be0c33f4fb61b5bbd862 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145307 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'basctl/source/basicide/baside2b.cxx')
-rw-r--r--basctl/source/basicide/baside2b.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index b5deee9b6a9e..e5de6abb4306 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -627,6 +627,13 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
pBindings->Update( SID_BASICIDE_STAT_POS );
pBindings->Update( SID_BASICIDE_STAT_TITLE );
}
+ if ( rKEvt.GetKeyCode().GetGroup() == KEYGROUP_ALPHA ||
+ rKEvt.GetKeyCode().GetGroup() == KEYGROUP_NUM )
+ {
+ // If the module is read-only, warn that it cannont be edited
+ if ( rModulWindow.IsReadOnly() )
+ rModulWindow.ShowReadOnlyInfoBar();
+ }
if ( !bWasModified && pEditEngine->IsModified() )
{
pBindings->Invalidate( SID_SAVEDOC );