Page 1 of 2

a Gambas recent files Lister (TrayIcon)

Posted: Friday 23rd July 2021 8:42am
by BruceSteers
Here's something i just made.
I call it GLaunch

I have put in in my startup applications so it starts with my desktop. (Note: i HAD to put a 2 second delay on MATE)

It makes a tray icon and populates a list by reading the gambas recent files save file.

It gets the icons (for the projects) and displays them in either the right click popup menu or the left click gridview Form.

Pop menu offers project can be launched/folder opened.
Left click an item and it loads the IDE with the project.

If system tray is not supported it makes a psuedo icon (small borderless window) you can move/lock

Option to set GUI mode like gb.gtk / gb.qt

Re: a Gambas recent files Lister (TrayIcon

Posted: Friday 23rd July 2021 9:26am
by PJBlack
my built-in mr monk is rotating right now ...
the arrangement of your desktop icons is ... "$%ยง&$/(&)/=(?)(TURESRXGCHJV

ok just took my psychotropic drugs ... now he is quiet :-)

again a very nice idea from you

Re: a Gambas recent files Lister (TrayIcon

Posted: Friday 23rd July 2021 9:37am
by PJBlack
right click --> make launcher --> desktop or menu --> File or directory does not exist MakeIcon.MakeMe.21

MakeIcon 15
u = IIf(UseRoot, User.Name, Me.UserName())
u = User.Name
MakeIcon 36
dtf = "/home/" & u & "/Desktop/" & n & ".desktop"
dtf = "/home/" & u & "/Schreibtisch/" & n & ".desktop"

Re: a Gambas recent files Lister (TrayIcon

Posted: Friday 23rd July 2021 1:35pm
by BruceSteers
Oops sorry. Its because the Form has no icon yet...
The make launcher command is looking for FMain.Icon.
Easily fixed.

Thanks Mike ๐Ÿ˜Ž

And that there Is what we call the desktop of a developer ๐Ÿ˜‰๐Ÿคฃ

Makeicon 15,
Why did you remove that line?
My command will use your user name even if run as root if asked to..
You broke it ๐Ÿ˜ฒ

Re. Desktop...
Darn it why can't you Germans just speak English? ๐Ÿคฃ๐Ÿคฃ
I'll use the gb.desktop command instead.

Cheers again

Re: a Gambas recent files Lister (TrayIcon

Posted: Friday 23rd July 2021 6:04pm
by PJBlack
BruceSteers wrote: โ†‘
Friday 23rd July 2021 1:35pm
Thanks Mike ๐Ÿ˜Ž
micha or pj would be quite sufficient ... but mike is still ok
BruceSteers wrote: โ†‘
Friday 23rd July 2021 1:35pm
Makeicon 15,
Why did you remove that line?
My command will use your user name even if run as root if asked to..
You broke it ๐Ÿ˜ฒ
yeah ... thats what i can do best ... did you tried with a username longer than eight chars?
BruceSteers wrote: โ†‘
Friday 23rd July 2021 1:35pm
Darn it why can't you Germans just speak English? ๐Ÿคฃ๐Ÿคฃ
i do speak english but it seems that xfce like german more :P ๐Ÿคฃ

Re: a Gambas recent files Lister (TrayIcon

Posted: Friday 23rd July 2021 7:48pm
by BruceSteers
PJBlack wrote: โ†‘
Friday 23rd July 2021 9:37am

MakeIcon 36
dtf = "/home/" & u & "/Desktop/" & n & ".desktop"
dtf = "/home/" & u & "/Schreibtisch/" & n & ".desktop"
You (or rather "I") should use this.. (as it has the gb.desktop component)
dtf = Desktop.Path &/ n & ".desktop"
I've updated the above archive :) cheers again Micha :)

About the username with more than 8 chars..
Here is the function that gets the name.. i cannot see how a difference in number of chars will affect anything?
Public Sub UserName() As String

  Dim u As String

  Shell "w -h|awk '{print $1}'" Wait To u
  If InStr(u, "\n") Then u = Split(u, "\n")[0]  ' if more than one result get the first one.
   Return Trim(u)

End

Re: a Gambas recent files Lister (TrayIcon

Posted: Saturday 24th July 2021 5:45am
by PJBlack
BruceSteers wrote: โ†‘
Friday 23rd July 2021 7:48pm
About the username with more than 8 chars..
Here is the function that gets the name.. i cannot see how a difference in number of chars will affect anything?

User.Name = "mnaltrogge"
Me.UserName = "mnaltrog" because

Code: Select all

w -h
gives:

Code: Select all

mnaltrog tty7      07:29   11:40  36.84 s  0.99 s xfce4-session
mnaltrog pts/0     07:40    0.00 s  0.06 s  0.00 s w -h

Re: a Gambas recent files Lister (TrayIcon)

Posted: Thursday 4th August 2022 12:22pm
by BruceSteers
Uploaded latest version.
Had a few updates/tweaks/fixes
(see first post)

Re: a Gambas recent files Lister (TrayIcon)

Posted: Thursday 4th August 2022 4:03pm
by cogier
I like this little program. It is now installed it on my Linux Mint Cinnamon system without issue.

I noticed that the 'Show toolbar' option still says 'Show toolbar' when the toolbar is showing!

There is an unused variable $List (Line 12 fList.class)

I found the listings with '/here/there/and_down_here/somewhere/etc/' a bit overpowering, so a possible option could be added to simplify this. I have changed the following lines: -
Public Sub AddItem(m As Menu)

  Inc GridView1.Rows.Count
  If m.Picture Then GridView1[GridView1.Rows.Max, 0].Picture = m.Picture
  GridView1.Rows[GridView1.Rows.Max].Height = -1
  GridView1.Columns[0].Width = -1
  'GridView1[GridView1.Rows.Max, 1].Text = m.Text
  GridView1[GridView1.Rows.Max, 1].Text = Mid(m.Text, RInStr(m.Text, "/") + 1)
  'GridView1[GridView1.Rows.Max, 1].Alignment = Align.Right
  sDates.Add(m.Tag)

End
The result is, but it doesn't work any more, will check on this later..: -

Image

Re: a Gambas recent files Lister (TrayIcon)

Posted: Thursday 4th August 2022 6:38pm
by BruceSteers
cogier wrote: โ†‘
Thursday 4th August 2022 4:03pm
I like this little program. It is now installed it on my Linux Mint Cinnamon system without issue.

I noticed that the 'Show toolbar' option still says 'Show toolbar' when the toolbar is showing!

There is an unused variable $List (Line 12 fList.class)

I found the listings with '/here/there/and_down_here/somewhere/etc/' a bit overpowering, so a possible option could be added to simplify this. I have changed the following lines: -
Public Sub AddItem(m As Menu)

  Inc GridView1.Rows.Count
  If m.Picture Then GridView1[GridView1.Rows.Max, 0].Picture = m.Picture
  GridView1.Rows[GridView1.Rows.Max].Height = -1
  GridView1.Columns[0].Width = -1
  'GridView1[GridView1.Rows.Max, 1].Text = m.Text
  GridView1[GridView1.Rows.Max, 1].Text = Mid(m.Text, RInStr(m.Text, "/") + 1)
  'GridView1[GridView1.Rows.Max, 1].Alignment = Align.Right
  sDates.Add(m.Tag)

End
The result is, but it doesn't work any more, will check on this later..: -
Cheers Charlie, glad you like it.

Does the Showtoolbar checkbox show correctly? it should be a toggle menu so the text does not change just the checkbox state.

I have now added the option to use filepaths or not.

The gridview.text was checked later in the prog for operation so removing the path broke things for you.
I set the path that gets read later to the Tag property not the text so .Text can be anything now :)