chdkptp GTK gui (was Re: chdkptp - alternative ptp client) - page 2 - General Discussion and Assistance - CHDK Forum  

chdkptp GTK gui (was Re: chdkptp - alternative ptp client)

  • 11 Replies
  • 952 Views
*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: chdkptp GTK gui (was Re: chdkptp - alternative ptp client)
« Reply #10 on: 23 / November / 2020, 02:29:12 »
Advertisements
I don't think the LGI GUI should actually require Lua 5.3: Debian installs LGI files for Lua 5.2. However, when I tried to run a Lua 5.2 build, it showed the GUI but got an error when I tried to use commands that print to the console, like
Code: [Select]
(chdkptp:6193): Lgi-WARNING **: 22:12:32.923: Error raised while calling 'lgi.cbk (function: 0x560c78df39f0): GObject': /home/reyalp/chdkptp/lua/gtk_gui.lua:232: attempt to index upvalue 'console_view' (a nil value)

'console_view' is set in the switch_console function which is called when you change tabs; but I'm not explicitly initialising it anywhere.
On my systems switch_console gets called after the main window has finished initialising - perhaps the behaviour is different with Lua 5.2.

Turns out it is the default integer formatting issue (%d vs %f).
Patch attached.

Edit: patch updated to work correctly, and remove redundant code.

Phil.
« Last Edit: 23 / November / 2020, 06:20:20 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 13453
Re: chdkptp GTK gui (was Re: chdkptp - alternative ptp client)
« Reply #11 on: 24 / November / 2020, 00:10:09 »
Turns out it is the default integer formatting issue (%d vs %f).
Patch attached.

Edit: patch updated to work correctly, and remove redundant code.
Thanks, merged into the trunk. LGI GUI now works on linux with either Lua 5.2 or 5.3.
Don't forget what the H stands for.