Lazarus

Announcements => Third party => Topic started by: lainz on April 02, 2018, 12:40:03 am

Title: FPC Paymo Widget (Open Source)
Post by: lainz on April 02, 2018, 12:40:03 am
Hi, we're using Paymo (https://www.paymoapp.com/) to track projects and now we have our own widget.

FPC Paymo Widget
https://github.com/Arandusoft/fpcpaymowidget

It uses the Paymo API, but can be used with a compatible API hosted on your own server.

It currently can do:
- list tasks with time entries
- start a time entry from the list of tasks
- start a new task and time entry (+ button)
- start a new time entry from an existing task (+ button, "Use Existing Task")
- choose from all projects, tasks lists, and lists (completed or not)
- get / set the current running task
- edit any time entry (switch project / switch task list)
- the UI is almost identical to the official widget

Fancy things:
- the UI is made all with the LCL + BGRAControls + own AnimatedPanel (with easing animation)
- all done with FPC trunk + Lazarus trunk
- tested and working in Linux, Mac and Windows 10
- translations (currently English and Spanish)

Why we make this?
- Because the official Paymo Widget is not native, is made with Electron and consumes almost 80 mb of RAM.
- We made it native and consumes almost nothing!
- To show how good is FPC and Lazarus for desktop.

This is almost finished. Soon we will distribute binaries.
Title: Re: FPC Paymo Widget (Open Source)
Post by: Phil on April 02, 2018, 11:49:36 pm
Hi, we're using Paymo (https://www.paymoapp.com/) to track projects and now we have our own widget.

I've never heard of Paymo, so perhaps my question is one of ignorance, but isn't this an app, not a widget?

By "widget", I would assume that it's a control that someone could use in their own app.
Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 02, 2018, 11:58:33 pm
That's not the meaning of the word Widget used here.

On Windows, a widget is a tool that's shown on desktop, a small tool.

Like this:
https://www.microsoft.com/en-us/store/p/widgets-hd/9wzdncrdqfbt#

On Windows 7 or XP "Gadgets".

This is the original app
https://www.paymoapp.com/download/
Title: Re: FPC Paymo Widget (Open Source)
Post by: Phil on April 03, 2018, 12:10:05 am
That's not the meaning of the word Widget used here.

On Windows, a widget is a tool that's shown on desktop, a small tool.

Sorry, I meant in terms of Lazarus, eg, a "widgetset" (gtk2, win32, cocoa) is a set of widgets (TEdit, TMemo, etc.).

Yes, I see now that they use the word widget too (and also app - doubly confusing). I would say they goofed there - maybe not native English speakers?

Yeah, it does look like with Electron their app is way, way bigger than it oughta be. 137MB footprint on macOS, with 118MB of that in the Electron framework. Yikes.

Are you actually using Paymo to keep track of time spent on projects? I would guess many programmers would chafe at having to track their time the way lawyers do.

Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 03, 2018, 12:24:38 am
Is not that bad =)

I learned to track time in University, we used also lines of code and a small description of what was done. But we use repositories for the track of changes and lines, so is not that strict.

Is more like a supercharged to-do list.

The thing is that there is a lot of customer support, and is the way to track who is the client that spend more time on support. Plus the most time consuming project, etc.
Title: Re: FPC Paymo Widget (Open Source)
Post by: Phil on April 03, 2018, 12:38:16 am
Is more like a supercharged to-do list.

Does it work okay with Cocoa widgetset? From your script it looks like that's the default (good example of build modes, by the way).

The betas of macOS 10.13.4 this winter had a warning the first time 32-bit apps were run, but now that 10.13.4 is out it looks like Apple dropped the warning for now (at least I haven't seen any warnings). Maybe they were just testing that feature for 10.14 or something.

Once macOS starts warning about 32-bit apps, I would think that would be the end of default Lazarus as a viable tool for production GUI apps on macOS. And if Cocoa widgetset won't do, then a Plan B would be in order (Swift?).
 
Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 03, 2018, 01:11:17 am
I added all build modes but not Cocoa one.

I don't have a real Mac to test, it's my boos the one did the build script and added that build target.

He tested it and works fine.

I'm not Mac expert but if you say that Swift is the way it must be.
Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 03, 2018, 10:37:56 pm
Hi, version 1.0 released
https://github.com/Arandusoft/fpcpaymowidget#fpc-paymo-widget

Working with Free accounts also, if anyone want to try.
Title: Re: FPC Paymo Widget (Open Source)
Post by: Phil on April 03, 2018, 10:46:30 pm
Hi, version 1.0 released
https://github.com/Arandusoft/fpcpaymowidget#fpc-paymo-widget

Normally Mac apps support App Transport Security (ATS), as required by the Apple app stores. OpenSSL does not support it.

https://developer.apple.com/library/content/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html#//apple_ref/doc/uid/TP40011172-CH13-SW3
Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 03, 2018, 11:32:54 pm
Ok. Thanks Phil.

There's a way to use that with FPHTTPClient?
Title: Re: FPC Paymo Widget (Open Source)
Post by: Phil on April 03, 2018, 11:37:05 pm

There's a way to use that with FPHTTPClient?

No, Indy, Synapse and FPC's HTTP client all use OpenSSL (FPC's uses Synapse's SSL code). But you can use the little ns_url_request.pas unit here to do GET and POST requests. Download the "Useful Objective Pascal" .zip:

https://macpgmr.github.io/

Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 04, 2018, 01:49:24 am
Thanks.

I'm sure this can be considered.

BTW there will be amazing to integrate that into FPC, to don't worry about using FPHTTPClient or not, to make things easier.

Maybe making an FPHTTPClient compatible object that can be used with no changing a single line of the original code.
Title: Re: FPC Paymo Widget (Open Source)
Post by: ps on April 04, 2018, 09:53:28 am
Once macOS starts warning about 32-bit apps, I would think that would be the end of default Lazarus as a viable tool for production GUI apps on macOS. And if Cocoa widgetset won't do, then a Plan B would be in order (Swift?).
Lazarus can't build Cocoa 64bit app?
Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 04, 2018, 03:41:57 pm
Lazarus can't build Cocoa 64bit app?

Seems that is very buggy.

Actually my boos said that this FPC Paymo Widget it works better with Qt widgetset.
Title: Re: FPC Paymo Widget (Open Source)
Post by: esvignolo on April 04, 2018, 09:19:14 pm
That's not the meaning of the word Widget used here.

On Windows, a widget is a tool that's shown on desktop, a small tool.

Sorry, I meant in terms of Lazarus, eg, a "widgetset" (gtk2, win32, cocoa) is a set of widgets (TEdit, TMemo, etc.).

Yes, I see now that they use the word widget too (and also app - doubly confusing). I would say they goofed there - maybe not native English speakers?

Yeah, it does look like with Electron their app is way, way bigger than it oughta be. 137MB footprint on macOS, with 118MB of that in the Electron framework. Yikes.

Are you actually using Paymo to keep track of time spent on projects? I would guess many programmers would chafe at having to track their time the way lawyers do.

Hi Phil, with respect to the widgetset for mac ... I did tests in carbon (there are problems with the icons of the tray), in cocoa64 (this quite well, but there are events in the tedit that do not run, or methods in the listbox that do not work well ), and finally in qt5 for mac it works best.
Regarding the monitoring of hours with respect to customers / projects, we are a small software development company, and, basically, hours of development are sold, which means that it is best to have these variables measured.
Finally another interesting aspect to take into account in terms of measurement and progress is the Goldilocks rule.

https://lifehacker.com/how-to-stay-motivated-in-life-and-work-using-the-goldil-1783132075

Regards!
Title: Re: FPC Paymo Widget (Open Source)
Post by: Phil on April 05, 2018, 12:06:03 am
Lazarus can't build Cocoa 64bit app?

Seems that is very buggy.

Actually my boos said that this FPC Paymo Widget it works better with Qt widgetset.

I wonder, are you sure you want to use the _name_ of their company / product in your app? Some companies don't like that, particularly if they've trademarked their name.

Same with the .ico - is that your IP, or theirs?

Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 05, 2018, 06:03:33 pm
Yes, we will in time make this app stand alone from paymo, using a custom api, or custom storage and also add options to work offline as a regular app.
We will change the name and all the icons.
Title: Re: FPC Paymo Widget (Open Source)
Post by: Phil on April 06, 2018, 03:48:17 am
We will change the name and all the icons.

While you're at it, you'll also want to create a proper Info.plist and icon file for Mac, two things that Lazarus can't create.

Open the app's .ico file in Preview and copy it to the clipboard. Then open Icon Composer and paste the image into the appropriate size class (eg, 128 x 128). Save as an .icns file.

Since you're already working around Lazarus limitations with a script, just add copying of the .icns file into the .app bundle to the script, eg, cp -p MyApp.icns MyApp.app/Contents/Resources.

Now make a copy of the useless, generic Info.plist that Lazarus creates for the .app bundle and edit it. Add something like this to activate the icon:

    <key>CFBundleIconFile</key>
    <string>MyApp.icns</string>

Add to your script to copy this file too, eg, cp -p Info.plist MyApp.app/Contents .

You'll also want to change the bundle ID in the Info.plist. The bundle ID is how macOS identifies the app. By default, the bundle ID that Lazarus creates will be something like com.company.MyApp. You definitely don't want that floating around as your bundle ID.

You can adjust many other settings in Info.plist, for example the app's version. That way if anyone selects the app in Finder and presses Cmd+I to get info on the app, the popup will display the correct version, rather than the default version that Lazarus assigns your app (0.1).

Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 19, 2018, 01:10:32 am
There are some changes on macOS, that @esvignolo added.

And also we have a new icon:
https://github.com/Arandusoft/fpcpaymowidget/blob/master/paymowidget.png

I don't know if we will change the name, any ideas on a good name?
Title: Re: FPC Paymo Widget (Open Source)
Post by: lainz on April 28, 2018, 04:59:24 pm
Hi, just to say that you can now configure it with your own API (in the settings file), that can be a limited one with only the endpoints used by this app.

Offline working is in the ToDo list.
TinyPortal © 2005-2018