[ZeroBrane Studio] Re: save icon remains disabled

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: "zerobrane@xxxxxxxxxxxxx" <zerobrane@xxxxxxxxxxxxx>
  • Date: Fri, 25 Mar 2016 15:40:40 -0700

Hi Thijs,

Windows 10, 64 bit
The tab shows the asterisk next to the filename, indicating the file has
changed. Yet both the save and save-all buttons remain greyed out.
(I think I’ve seen this on linux too)

Does this issue still happen to you? I don't see this happening on
Win8.1 machine I use, but can find Win10 computer to try this on.

Did you have a chance to try any of the patches I suggested earlier? Thanks.

Paul.

On Mon, Jan 11, 2016 at 9:55 AM, Paul K <paul@xxxxxxxxxxxxx> wrote:
Hi Thijs,

One more question: does it also happen with other toolbar icons? For
example, when you switch focus from the editor to the Output/Console
panels, bookmark and breakpoint icons on the toolbar should get
disabled (and then enabled when the focus is switched back).

If the issue only happens with Save icons, could you try the following patch:

diff --git a/src/editor/proto.lua b/src/editor/proto.lua
index da6f82c..758b7ca 100644
--- a/src/editor/proto.lua
+++ b/src/editor/proto.lua
@@ -15,6 +15,7 @@ ide.proto.Document = {__index = {
   SetModified = function(self, modified)
     self.isModified = modified
     self:SetTabText()
+    ide:GetToolBar():UpdateWindowUI(wx.wxUPDATE_UI_FROMIDLE)
   end,
   SetTabText = function(self, text)
     ide:GetEditorNotebook():SetPageText(self.index,


I'm still interested in the answers to earlier questions and the
results from the patch in my previous email. Thank you.

Paul.

On Mon, Jan 11, 2016 at 9:11 AM, Paul K <paul@xxxxxxxxxxxxx> wrote:
Hi Thijs,

Does it happen all the time on all (edited) tabs? Only on new
(untitled) tabs?

2 tabs, both existing files, both the same problem
Tested it by simply typing into the file

Just to confirm; you just launch the IDE and type something into an
existing file and the toolbar save icons are not updated. Does it ever
update later to a correct state?

If only toolbars are
disabled, can you run
"ide:GetToolBar():UpdateWindowUI(wx.wxUPDATE_UI_FROMIDLE)" in the console
to see if this refreshes the toolbar?

Yes, that updated both buttons and they get enabled.

Ok, so it's the toolbar only. I can only think of one thing that may
be related to the toolbar refresh: I disable UI updates when the app
is inactive, but maybe there are cases when the app activate is not
correctly detected. Could you apply the following patch to see if this
fixes the issue:

diff --git a/src/editor/commands.lua b/src/editor/commands.lua
index 8695659..ac390cd 100644
--- a/src/editor/commands.lua
+++ b/src/editor/commands.lua
@@ -1002,8 +1002,8 @@ ide.editorApp:Connect(wx.wxEVT_ACTIVATE_APP,
       if not active then saveAutoRecovery(true) end

       -- disable UI refresh when app is inactive, but only when not running
-      wx.wxUpdateUIEvent.SetUpdateInterval(
-        (active or ide:GetLaunchedProcess()) and updateInterval or -1)
+--      wx.wxUpdateUIEvent.SetUpdateInterval(
+--        (active or ide:GetLaunchedProcess()) and updateInterval or -1)

       PackageEventHandle(active and "onAppFocusSet" or
"onAppFocusLost", ide.editorApp)
     end

Paul.

Other related posts: