Lazarus

Announcements => Third party => Topic started by: wp on November 14, 2015, 05:38:47 pm

Title: Lazarus MailingList Reader
Post by: wp on November 14, 2015, 05:38:47 pm
The lazarus mailing list (see link in the left panel) is fully loaded with valuable information for both new and experienced users. Unfortunately, it is a bit difficult to access this information. There is an archive of previous mails (http://lists.lazarus.freepascal.org/pipermail/lazarus/ (http://lists.lazarus.freepascal.org/pipermail/lazarus/)), but it is a pain to open each mail one by one, and there are no searching capabilities.

Therefore, I wrote a little tool which downloads the archived mail threads into a searchable tree structure. Mails can be selected by month. The initial building-up of the tree takes some time, but the tree can be saved, and then subsequent loads are fast. Unfortunately the archived mails do not contain any attachments of the original mails.

Tested on Windows 7, but it should work on Linux as well.

Download of executable:
http://sourceforge.net/projects/wp-laz/files/Lazarus%20MailingList%20Reader/LazarusMailingListReader-0.1.zip/download (http://sourceforge.net/projects/wp-laz/files/Lazarus%20MailingList%20Reader/LazarusMailingListReader-0.1.zip/download)

Download of source:
https://sourceforge.net/p/wp-laz/code/HEAD/tree/Lazarus%20MailingList%20Reader/ (https://sourceforge.net/p/wp-laz/code/HEAD/tree/Lazarus%20MailingList%20Reader/)

Compilation requires some third-party packages:
Title: Re: Lazarus MailingList Reader
Post by: aradeonas on November 14, 2015, 07:46:11 pm
Very clean and usefully wp,Thanks.
Can you add better moving between mail topics and answers so we can go next and prev easier?
Also search seems don't work or cause crash.
Title: Re: Lazarus MailingList Reader
Post by: wp on November 14, 2015, 08:34:21 pm
Can you add better moving between mail topics and answers so we can go next and prev easier?
What are you thinking of?

Also search seems don't work or cause crash.
It is working here. If the search expression is not found after the current mail (or before it if search goes backward) nothing happens, maybe you interpret this as "don't work". I should say that search looks in the subject and name columns. If the button "Search Body" is down it looks also in the body part of the mail.

Can you be more specific how to reproduce the crash? What is the search expression? Which mails (month/year) are loaded? Which message is selected when you start the search? Is the search going forward or backward? Is "Search body" active?
Title: Re: Lazarus MailingList Reader
Post by: aradeonas on November 14, 2015, 08:49:27 pm
Just downlod 2015 November and try to search "jwatlhelp32" and nothing happen.
this word is in first conversion with subject of "Kill running program by name" and forth email.
Also I played with next and prev search button and when I hit prev multiple time it will crash,just play with it and you will see.

For browsing next and prev button like navigator will be enough for now.
Title: Re: Lazarus MailingList Reader
Post by: wp on November 14, 2015, 11:47:30 pm
Just downlod 2015 November and try to search "jwatlhelp32" and nothing happen
Did you press the "Search Body" button (next to the search forward/backward buttons)?

An improved version is available for download from http://sourceforge.net/projects/wp-laz/files/Lazarus%20MailingList%20Reader/LazarusMailingListReader-trunk.zip/download
Title: Re: Lazarus MailingList Reader
Post by: aradeonas on November 15, 2015, 08:47:51 am
Everything works now,Thanks.  ;D
Title: Re: Lazarus MailingList Reader
Post by: aradeonas on November 15, 2015, 08:58:20 am
Also :
1- Search should has an option to serach multiple time in body.For example when you search "resize" one mail has this multiple time and it will be highlighted but if you hit next it go for the next topic but it should has an option for going to next occurrence.
2- Please and copy-past option to mail body.
3- Blue highlite seems gas a bug.
Just check the first mail from Michael and you see after "Greetings, it will be blue untill ://"
4- I think it good to send a announcement to mail list for this useful program,many one can read their old mails! If you want I can do this.
Again thanks.
Title: Re: Lazarus MailingList Reader
Post by: aradeonas on November 15, 2015, 09:00:46 am
@Others,
Check old messages it is fun to read.
Title: Re: Lazarus MailingList Reader
Post by: Old_Dog on November 15, 2015, 09:49:34 am
This is good too, all the emails in forum format, leledumbo put it up.

http://free-pascal-lazarus.989080.n3.nabble.com/
Title: Re: Lazarus MailingList Reader
Post by: wp on November 15, 2015, 09:31:19 pm
Replaced the http://sourceforge.net/projects/wp-laz/files/Lazarus%20MailingList%20Reader/LazarusMailingListReader-trunk.zip/download by an updated version covering aradeonas' requests:
I started testing in Linux (Mint 17.1) and came across several issues, the most severe one being that the mail reader thread hangs after completion when it is destroyed. No idea what's wrong here (no - the "UseCThreads" is defined!). But I'll have to investigate further and will maybe post a separate question.

@Old_Dog: Thanks for this link, I did not know it before.
Title: Re: Lazarus MailingList Reader
Post by: aradeonas on November 16, 2015, 10:25:05 am
 :D
that was a typo,it has a bug! and now it solved.
Search is very good.

Thanks.
Title: Re: Lazarus MailingList Reader
Post by: balazsszekely on November 16, 2015, 01:44:00 pm
@wp

1. Very nicely done!
2. Please set the SplashForm Position from poDesktopCenter to poScreenCenter, because on dual monitor system half of the form is on the first monitor half on the second.
3. Thread issue:
    a. Add(procedure TMainForm.StartMailReaderThread)
           FreeOnTerminate := True;
           OnTerminate := @MailReaderThreadTerminate;
           OnMailLoad := @MailLoadedHandler;
   b. Remove(procedure MailReaderThreadTerminate)
          thread := TMailReaderThread(Sender);
          idx := thread.ThreadIndex;
         //  thread.Free;
         FThreadPool[idx] := nil;
Title: Re: Lazarus MailingList Reader
Post by: wp on November 16, 2015, 04:18:34 pm
Thanks, GetMem - you are answering one of the questions that I wanted to ask today. I'm not very experienced with threads, but what is wrong with Thread.FreeOnTerminate = false?
Title: Re: Lazarus MailingList Reader
Post by: rvk on November 16, 2015, 06:09:45 pm
At this point you have FreeOnTerminate := true;

In that case this code isn't really safe (in procedure TMainForm.StopMailReaderThreads):
Code: Pascal  [Select][+][-]
  1.   for i:=0 to High(FThreadPool) do
  2.     if FThreadPool[i] <> nil then
  3.     begin
  4.       FThreadPool[i].OnTerminate := nil;
  5.       FThreadPool[i].Terminate;
  6.       FThreadPool[i].WaitFor;
  7.       FreeAndNil(FThreadPool[i]);
  8.     end;

After FThreadPool.Terminate the FThreadPool will free itself and calling FThreadPool.WaitFor, and probably FreeAndNil too, can be dangerous.

Code: Pascal  [Select][+][-]
  1.   for i:=0 to High(FThreadPool) do
  2.     if FThreadPool[i] <> nil then
  3.     begin
  4.       FThreadPool[i].OnTerminate := nil;
  5.       FThreadPool[i].Terminate;
  6.       FThreadPool[i] := nil; // if you really want it to be nil but don't call WaitFor or Free after terminate with FreeOnTerminate := true
  7.       //FThreadPool[i].WaitFor;
  8.       //FreeAndNil(FThreadPool[i]);
  9.     end;
Title: Re: Lazarus MailingList Reader
Post by: wp on November 16, 2015, 06:49:05 pm
Hey, Rik, you are answering my questions faster than I can ask them...

Yes, after applying GetMem's idea of using FreeOnTerminate=true and thus no longer destroying the thread by myself, I ran into the problem that it was not possible any more to cancel a running thread by the corresponding toolbar button or by closing the application - and this reminds me of why I had introduced the FreeOnTerminate=false in the first place.

But with your suggestion, everything is fine, even in Linux. I'll be updating sourceforge shortly. The new version will also have fixes for some memory leaks.
Title: Re: Lazarus MailingList Reader
Post by: balazsszekely on November 16, 2015, 10:01:20 pm
t's never safe to free a thread from inside of its own events including OnTerminate, furthermore WaitFor can lead to deadlock if not handled properly. This was true back in the delphi days, on multiplatform it's even worse. I never ever free the thread manually or call WaitFor. FreeOnTerminate always works, even under OSX.
Other then this @rvk is right, to be perferctly honest I didn't even noticed procedure StopMailReaderThreads, that is why I like this forum. 
Title: Re: Lazarus MailingList Reader
Post by: balazsszekely on November 17, 2015, 08:09:24 am
@wp
I don't want to insist on poDestkopCenter, if you like it this way it's perfectly fine,  I won't mention it again, but in my opinion it looks ugly on dual monitor(see screenshot). poScreenCenter always display the form on the currently active monitor(where lmlr.exe is opened).
Title: Re: Lazarus MailingList Reader
Post by: rvk on November 17, 2015, 09:41:32 am
... but in my opinion it looks ugly on dual monitor(see screenshot).
And if you haven't glued your screens together it looks even worse  :P

I'm still wondering why there is a poDestkopCenter. I can't imagine a case where you would want to use that. And when you don't have a multi-monitor setup you can always make the mistake in choosing this option (which you never should).
Title: Re: Lazarus MailingList Reader
Post by: balazsszekely on November 17, 2015, 09:52:10 am
Quote
And if you haven't glued your screens together it looks even worse  :P
:D

Quote
I'm still wondering why there is a poDestkopCenter
The only difference AFAIK is:  Form.Top(poDesktopCenter) = Form.Top(poScreenCenter) - TaskBarHeight, or the other way arround.
Title: Re: Lazarus MailingList Reader
Post by: wp on November 17, 2015, 11:14:00 am
@GetMem: You are absolutely correct - poDesktopCenter is not nice! Strange, I thought I'd never had set the Position like that this, but looking at the svn message shows me that it was always poDesktopCenter... I hope it is fixed now.
Title: Re: Lazarus MailingList Reader
Post by: rvk on November 17, 2015, 11:51:54 am
I wouldn't be me, if I couldn't resist suggesting some options :)
Title: Re: Lazarus MailingList Reader
Post by: wp on November 17, 2015, 12:20:25 pm
Automatic update of mail-items. Save the last updated date in config and make an Auto-update option when you start the program and the last-date has changed, retrieve all mail-items from the month of that last-date to the month of today.
Good idea.

Seeing that search is probably a big part of the program, a keyboard shortcut option for it would be nice. F3 to open the search-option (or if it's already open, search the next occurrence) and Shift+F3 to search backwards.
Since all commands are built around actions this shouldn't be too difficult.

Any plans to also include the FPC-devel list for automatic retrieval (which has the same format) ? (and if there isn't already, a possibility to start the program with a parameter specifying which archive, so you can create to distinct shortcuts for each mail-list)
Do you know the url where the FPC-devel list resides? What about having both mailing lists together?

Now the mail-items are editable. Is that done for a reason? Changing a mail-item shouldn't be necessary (I think). Now it "eats" my tab-key so I can't tab and shift-tab through the windows. (yeah, I'm a keyboard-Junkie :) )
I left editing on intentionally because sometimes there are annoying typos etc. I am also thinking of drag&drop of the nodes because people (like me) sometimes don't reply correctly and this opens another thread on the same topic. But I see the point: this could be another option for the settings dialog.

And last... (but this might be nitpicking) adding ebTop to the EdgeBorder (which was default I think). Attached is a screenshot on Windows 10. I've noticed this with other programs too on Windows 10. Microsoft removed a line-border from the title-bar, which leaves all programs to not have clear border between panels and titlebar (which isn't aesthetically pleasing to the eye.) Also attached a screenshot with ebTop+ebBottom for EdgeBottom. I'm not sure how it would look on other platforms though.
Yes - I hate Windows10... The upper bar looks a bit strange on Win7, so maybe an IFDEF would be fine here. Do you know how to detect that Win10 is running?
Title: Re: Lazarus MailingList Reader
Post by: rvk on November 17, 2015, 12:41:24 pm
Do you know the url where the FPC-devel list resides? What about having both mailing lists together?
At the left of the forum you can click "Mailing lists" in the Free Pascal section. You directed here: http://lists.freepascal.org/mailman/listinfo
I think fpc-devel is the most active (but there are some less active-ones too). The same goes for Lazarus mailing lists. There is lazarus-other and lazarus-es but these aren't very active.
I'm not sure if mixing them would be advantageous. It would depend if you use the program primarily to read or to search. Of course it could also be possible to load multiple archives and have a visible switch to make them active or not. If you activate multiple archives they are all in the same window. Just a thought. Not sure if it's doable.

Now the mail-items are editable. Is that done for a reason? Changing a mail-item shouldn't be necessary (I think). Now it "eats" my tab-key so I can't tab and shift-tab through the windows. (yeah, I'm a keyboard-Junkie :) )
I left editing on intentionally because sometimes there are annoying typos etc. I am also thinking of drag&drop of the nodes because people (like me) sometimes don't answer correctly and this opens another thread on the same topic. But I see the point: this could be another option for the settings dialog.
You could at least set the WantTabs to false for SynMailBody. That way you can use tab to escape from the Mailbody. I can't imagine you want tabs in a mail anyway. And that way the mail stays editable.

Yes - I hate Windows10... The upper bar looks a bit strange on Win7, so maybe an IFDEF would be fine here. Do you know how to detect that Win10 is running?
You might not even see the ebTop on other systems. So maybe this could be added regardless (if you don't see a "double" line in Linux).
But an IDFEF couldn't work because that is at compile time. If you really want to check it, you need to check it at runtime.

Code: Pascal  [Select][+][-]
  1. {$IFDEF WINDOWS}uses win32proc;{$ENDIF}
  2. ...
  3. {$IFDEF WINDOWS}
  4. if WindowsVersion >= wv10 then
  5.   Showmessage('I an on Windows 10 or later');
  6. {$ENDIF}

But maybe this also depends on themes. (O, hey, they removed the Classic Theme from Windows 10 :))
Title: Re: Lazarus MailingList Reader
Post by: rvk on November 17, 2015, 01:11:42 pm
Found a typo:
Code: Pascal  [Select][+][-]
  1. function TMainForm.SaveFile: Boolean;
  2. ...
  3.   with SaveDialog do begin
  4.     InitialDir := ExtractFileDir(FileName);
  5.     FileName := ExtractFileName(FFilename);
That ExtractFileDir should be done on FFileName and not on FileName.

(Now, when I click Save, it doesn't start where the original file was. In a previous version this worked ok.)

Edit:
O, and another one:
Code: Pascal  [Select][+][-]
  1.   with OpenLocalFilesDialog do begin
  2.     if FFileName <> '' then begin
  3.       InitialDir := ExtractFileDir(FFileName);
  4.       FileName := ExtractFileName(FFileName);
  5.       if Lowercase(ExtractFileExt(FileName)) = '.gz' then
  6.         FilterIndex := 1
  7.       else if Lowercase(ExtractFileExt(Filename)) = '.txt' then
  8.         FilterIndex := 2;
  9.     end;
Shouldn't that also be on FFileName (and not FileName). I think you need to check all your FFileName and FileName occurrences :)
Title: Re: Lazarus MailingList Reader
Post by: wp on November 19, 2015, 12:40:54 am
New version, now with access to all fpc/Lazarus mailing lists: http://sourceforge.net/projects/wp-laz/files/Lazarus%20MailingList%20Reader/LazarusMailingListReader-0.2.zip
Title: Re: Lazarus MailingList Reader
Post by: mdalacu on November 19, 2015, 07:49:53 am
Please, add proxy support. Thx.
Title: Re: Lazarus MailingList Reader
Post by: wp on November 19, 2015, 06:01:06 pm
The new trunk version (exe download: http://sourceforge.net/projects/wp-laz/files/Lazarus%20MailingList%20Reader/LazarusMailingListReader-trunk.zip) contains some kind of proxy support. Unfortunately I cannot test it because I am connected to the internet directly. Please test and notify me of the results.

The new version also provides incremental search for the search combobox.
Title: Re: Lazarus MailingList Reader
Post by: John Landmesser on August 03, 2016, 02:35:25 pm
trying to compile lmlr on linux i get errors:

lmlrmailarchiveform.pas(287,91) Error: Illegal type conversion: "TMailingList" to "TObject"

source line 287:

  for ml in TMailingList do
    if Settings.MailArchiveURLs[ml][1] <> '-' then
{ TODO : nix compile on linux }      CbMailingLists.Items.AddObject(MailingListNames[ml], TObject(ml));

Compiles ok on Win32

There is nothing special with "CbMailingLists.Items.AddObject(MailingListNames[ml], TObject(ml));" so what the compiler complaines about?

SysInfo:
Lazarus 1.7 r52780 FPC 3.0.0 x86_64-linux-gtk 2

Debian Sid
CPU~Dual core Pentium E5200 (-MCP-) speed/max~2000/2500 MHz Kernel~4.7.0-towo.1-siduction-amd64 x86_64 Up~53 min Mem~1987.3/3948.2MB HDD~160.0GB(46.7% used) Procs~184 Client~Shell inxi~2.3.0

Quote:
"@John: Just checked the Lazarus MailingList Reader on Linux, compiling fine. Maybe you use the wrong VirtualTreeView package, mine is version 5.8 in the branches folder of virtualtreeview-new (lazarus-ccr). If this does not solve your issue please continue this discussion via PM or in the forum."

I have the VirtualTreeView package 4.8.7.3 from branches folder. There is no version 5.8

It's a mess with these versions of VirtualTreeView, giving up!

Title: Re: Lazarus MailingList Reader
Post by: wp on August 03, 2016, 03:42:22 pm
64 bit? Then it is the missing cast to PtrInt because pointers and integers have different sizes. I don't have a 64-bit Linux available, but this code compiles fine on for 64 bit on Win:

Code: Pascal  [Select][+][-]
  1.   CbMailingLists.Items.AddObject(MailingListNames[ml], TObject(PtrInt(ml)));
  2.  
  3. // same at line 363:
  4.   CbMailingLists.ItemIndex := CbMailingLists.Items.IndexOfObject(TObject(PtrInt(AValue)));

Sorry for the confusion with the VTV version number - it is 4.8 of course.
Title: Re: Lazarus MailingList Reader
Post by: John Landmesser on August 03, 2016, 04:22:49 pm
Thats it, thank you very much :-))
Title: Re: Lazarus MailingList Reader
Post by: Ondrej Pokorny on August 04, 2016, 12:29:38 pm
I'm still wondering why there is a poDestkopCenter. I can't imagine a case where you would want to use that. And when you don't have a multi-monitor setup you can always make the mistake in choosing this option (which you never should).

It's because of Delphi compatiblity. Use poWorkAreaCenter - it's the same but works nicely on multi-monitor setup.
Title: Re: Lazarus MailingList Reader
Post by: Thausand on April 07, 2019, 04:40:40 pm
Therefore, I wrote a little tool which downloads the archived mail threads into a searchable tree structure. Mails can be selected by month. The initial building-up of the tree takes some time, but the tree can be saved, and then subsequent loads are fast. Unfortunately the archived mails do not contain any attachments of the original mails.

Tested on Windows 7, but it should work on Linux as well.
Thanks you very much for reader wp.

It work good on Linux too !!! (*)

(*) couple day ago stop working. URL change http to https for Lazarus list  :'(

I make small test see if can fix. I can fix and work  :)

Synapse many SSL option so not set stone SSL. Then need way to make SLL choose for compile. Is you project and i not know good how to make choose different SSL for compile.

I add unit ssl_openssl use by function DownloadFile. Then do sudo apt-get install libssl-dev and build reader then work.

I sorry write old topic but seem good place to be ?
Title: Re: Lazarus MailingList Reader
Post by: wp on April 07, 2019, 06:17:48 pm
Updated the links the to the new https addresses and made https work, at least on Windows (you must copy the libeay32.dll and ssleay32.dll of the correct bitness into the folder with the exe).
Title: Re: Lazarus MailingList Reader
Post by: Thausand on April 07, 2019, 07:05:31 pm
Thanks you very many wp ..

I have question: where i find package laz.virtualtreeview_package ?

I freepascal 3.0.4 / lazarus 2.0.0
Title: Re: Lazarus MailingList Reader
Post by: wp on April 07, 2019, 07:52:28 pm
Sorry, this is the VirtualTreeViews package which comes with Laz trunk. In case of v2.0 you can open lmlrMain.pas and .lfm, lmlrArchiveForm.pas and .lfm in an external editor, and replace "laz.virtualtrees" by "virtualtrees" in "uses", and TLazVirtualStringTree by TVirtualStringTree; an in lmlr.lpi, replace "laz.virtualtreeview_package" by "virtualtreeview_package". If you have installed the virtualtreeviews package of Laz2.0 then you should be able to open the project now in Lazarus.
Title: Re: Lazarus MailingList Reader
Post by: Thausand on April 07, 2019, 08:04:38 pm
Ok. thanksy for let now.

I have own work and i think test new you reader and see how work and tell :)

Is ok if you make trunk work.

Good, i make condition comparison. Can make use LCL_FULLVERSION i think ? (i no see manual LCL_FULLVERSION explain but can see source Lazarus use LCL_FULLVERSION).

I try. Good for learn  :)
Title: Re: Lazarus MailingList Reader
Post by: zoltanleo on April 19, 2019, 10:05:42 pm
Hi all.

I use LMLR v.0.2.1. When I try to download mail from a Lazarus branch, I get an error "Mail archive index is empty". However, mail from the branch of the FPС is loaded and displayed correctly.
Title: Re: Lazarus MailingList Reader
Post by: wp on April 19, 2019, 10:21:02 pm
LMLR v0.2.1 is two years old, I should take the time to prepare another release... In the meantime use its trunk version which was fixed recently to use the new urls of the Lazarus mailing list site. Note that you must have the openssl dlls (libeay32.dll and ssleay32.dll) in the exe folder because the urls are https now.
Title: Re: Lazarus MailingList Reader
Post by: AlexTP on April 20, 2019, 08:49:12 am
Pls prepare the new release, I need Linux x64 one.
For Win release, pls put DLLs into zip and put zip into Releases on Github..
TinyPortal © 2005-2018