Bug 446249 - [feature] - improve "--import-layout" functionality
Summary: [feature] - improve "--import-layout" functionality
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Unmaintained
Component: application (other bugs)
Version First Reported In: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-29 18:04 UTC by Michail Vourlakos
Modified: 2021-11-30 19:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 0.10.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michail Vourlakos 2021-11-29 18:04:15 UTC
SUMMARY
Import layout should work even when Latte is already working. An already codepath could be to use the Latte "switchLayout" dbus interface for that case.

Things need implementation/improvement:
    1. Drop "switchLayout" for absolute latte layout filepaths
    2. Introduce a new dbus api "importLayout" that will accept an absolute latte layout filepath and an optional layout_name
    3. Make "importLayout" to use dbus interface when needed
    4. When using "importLayout" the "single layout at all cases" memory usage should be applied
   
All above steps should make Latte ready to support Plasma Look N' Feel packages.
Comment 1 Michail Vourlakos 2021-11-29 18:05:53 UTC
the Plasma Look N' Feel approach can use Feren OS solution: https://github.com/feren-OS/plasma-workspace-patching/blob/7d4d674e2188d47db7df1e555f1baec910ff41c8/kcms/desktoplayout/kcm.cpp#L296
Comment 2 The Feren OS Dev 2021-11-29 18:26:15 UTC
What needs to happen is this:
- Command line argument is left as it usually is, BUT...
- Whenever Latte is already running, and said command line argument is used on a new instance, instead of launching Latte Settings it needs to send the DBus signal to the proper Latte instance to make it switch the layout to the .layout.latte file's one.

Once that's done, Global Theme applying a Latte layout can just call the command via already identified means (via the Feren OS patch linked prior) to switch the layout reliably.
Comment 3 Michail Vourlakos 2021-11-30 19:28:40 UTC
Git commit 0e63e7dd0b0f19aeee3e740fb49c021b2412ea99 by Michail Vourlakos.
Committed on 30/11/2021 at 19:28.
Pushed by mvourlakos into branch 'v0.10'.

get ready for Plasma LookNFeel packages

--introduce enable/disableAutostart from command line
--accept import-layout from command line when latte is already running
--introduce --suggested-layout-name to be used with
  import-layout in order to provide a preferred layout name
  e.g. latte-dock --import-layout /blah/blah/mywhat.layout.latte
       --suggested-layout-name MyAwesomeLayout
--dbus:introduce "setAutostart" function
--dbus:introduce "importLayoutFile" function
FIXED-IN:0.10.5

M  +7    -0    app/dbus/org.kde.LatteDock.xml
M  +38   -22   app/lattecorona.cpp
M  +3    -0    app/lattecorona.h
M  +53   -6    app/layouts/importer.cpp
M  +5    -2    app/layouts/importer.h
M  +32   -3    app/main.cpp
M  +13   -34   app/settings/universalsettings.cpp

https://invent.kde.org/plasma/latte-dock/commit/0e63e7dd0b0f19aeee3e740fb49c021b2412ea99
Comment 4 Michail Vourlakos 2021-11-30 19:29:17 UTC
Git commit e0bfff4c4886d294d0f10dc1638a2930a516c61f by Michail Vourlakos.
Committed on 30/11/2021 at 19:29.
Pushed by mvourlakos into branch 'master'.

get ready for Plasma LookNFeel packages

--introduce enable/disableAutostart from command line
--accept import-layout from command line when latte is already running
--introduce --suggested-layout-name to be used with
  import-layout in order to provide a preferred layout name
  e.g. latte-dock --import-layout /blah/blah/mywhat.layout.latte
       --suggested-layout-name MyAwesomeLayout
--dbus:introduce "setAutostart" function
--dbus:introduce "importLayoutFile" function
FIXED-IN:0.10.5

M  +7    -0    app/dbus/org.kde.LatteDock.xml
M  +38   -22   app/lattecorona.cpp
M  +3    -0    app/lattecorona.h
M  +53   -6    app/layouts/importer.cpp
M  +5    -2    app/layouts/importer.h
M  +32   -3    app/main.cpp
M  +13   -34   app/settings/universalsettings.cpp

https://invent.kde.org/plasma/latte-dock/commit/e0bfff4c4886d294d0f10dc1638a2930a516c61f