a Gambas recent files Lister (TrayIcon)

Post

Posted
Rating:
#1 (In Topic #710)
Banned
 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

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’
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
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’
right click → make launcher → desktop or menu → File or directory does not exist MakeIcon.MakeMe.21

MakeIcon 15

Code (gambas)

  1. u = IIf(UseRoot, User.Name, Me.UserName())

Code (gambas)

  1. u = User.Name

MakeIcon 36

Code (gambas)

  1. dtf = "/home/" & u & "/Desktop/" & n & ".desktop"

Code (gambas)

  1. dtf = "/home/" & u & "/Schreibtisch/" & n & ".desktop"
Online now: No Back to the top

Post

Posted
Rating:
#4
Banned
Oops sorry. Its because the Form has no icon yet…
The make launcher command is looking for FMain.Icon.
Easily fixed.

Thanks Mike <EMOJI seq="1f60e" tseq="1f60e">😎</EMOJI>

And that there Is what we call the desktop of a developer <EMOJI seq="1f609" tseq="1f609">😉</EMOJI><EMOJI seq="1f923" tseq="1f923">🤣</EMOJI>

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 <EMOJI seq="1f632" tseq="1f632">😲</EMOJI>

Re. Desktop…
Darn it why can't you Germans just speak English? <EMOJI seq="1f923" tseq="1f923">🤣</EMOJI><EMOJI seq="1f923" tseq="1f923">🤣</EMOJI>
I'll use the gb.desktop command instead.

Cheers again
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’

BruceSteers said

Thanks Mike <EMOJI seq="1f60e" tseq="1f60e">😎</EMOJI>

micha or pj would be quite sufficient … but mike is still ok

BruceSteers said

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 <EMOJI seq="1f632" tseq="1f632">😲</EMOJI>

yeah … thats what i can do best … did you tried with a username longer than eight chars?

BruceSteers said

Darn it why can't you Germans just speak English? <EMOJI seq="1f923" tseq="1f923">🤣</EMOJI><EMOJI seq="1f923" tseq="1f923">🤣</EMOJI>

i do speak english but it seems that xfce like german more   :P   <EMOJI seq="1f923" tseq="1f923">🤣</EMOJI>
Online now: No Back to the top

Post

Posted
Rating:
#6
Banned

PJBlack said


MakeIcon 36

Code (gambas)

  1. dtf = "/home/" & u & "/Desktop/" & n & ".desktop"

Code (gambas)

  1. dtf = "/home/" & u & "/Schreibtisch/" & n & ".desktop"

You (or rather "I") should use this.. (as it has the gb.desktop component)

Code (gambas)

  1. dtf = Desktop.Path &/ n & ".desktop"
  2.  

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?

Code (gambas)

  1. Public Sub UserName() As String
  2.  
  3.  
  4.   Shell "w -h|awk '\{print $1}'" Wait To u
  5.   If InStr(u, "\n") Then u = Split(u, "\n")[0]  ' if more than one result get the first one.
  6.    Return Trim(u)
  7.  
  8.  
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’

BruceSteers said

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

w -h
gives:

Code

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
Online now: No Back to the top

Post

Posted
Rating:
#8
Banned
 Uploaded latest version.
Had a few updates/tweaks/fixes
(see first post)
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
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: -

Code (gambas)

  1. Public Sub AddItem(m As Menu)
  2.  
  3.   Inc GridView1.Rows.Count
  4.   If m.Picture Then GridView1[GridView1.Rows.Max, 0].Picture = m.Picture
  5.   GridView1.Rows[GridView1.Rows.Max].Height = -1
  6.   GridView1.Columns[0].Width = -1
  7.   'GridView1[GridView1.Rows.Max, 1].Text = m.Text
  8.   GridView1[GridView1.Rows.Max, 1].Text = Mid(m.Text, RInStr(m.Text, "/") + 1)
  9.   'GridView1[GridView1.Rows.Max, 1].Alignment = Align.Right
  10.   sDates.Add(m.Tag)
  11.  

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

<IMG src="https://www.cogier.com/gambas/GLaunch2.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#10
Banned

cogier said

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: -

Code (gambas)

  1. Public Sub AddItem(m As Menu)
  2.  
  3.   Inc GridView1.Rows.Count
  4.   If m.Picture Then GridView1[GridView1.Rows.Max, 0].Picture = m.Picture
  5.   GridView1.Rows[GridView1.Rows.Max].Height = -1
  6.   GridView1.Columns[0].Width = -1
  7.   'GridView1[GridView1.Rows.Max, 1].Text = m.Text
  8.   GridView1[GridView1.Rows.Max, 1].Text = Mid(m.Text, RInStr(m.Text, "/") + 1)
  9.   'GridView1[GridView1.Rows.Max, 1].Alignment = Align.Right
  10.   sDates.Add(m.Tag)
  11.  

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 :)
Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Yes, that works well. I use Linux Mint Cinnamon and discovered that the autostart feature needs a delay or else the GLaunch icon appears on the desktop and not in the system tray. My glaunch.gambas.desktop file now looks like this: -

Code

[Desktop Entry]
Type=Application
Exec=/home/charlie/Dropbox/gambas/glaunch/glaunch.gambas
Hidden=false
Name=glaunch
X-MATE-Autostart-enabled=true
X-MATE-Autostart-Delay=3
X-GNOME-Autostart-Delay=3

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

I still think there is an issue here.
<IMG src="https://www.cogier.com/gambas/glaunch3.png"> </IMG>

Thanks, Bruce, I will advise if I find any other issues. :D
Online now: No Back to the top

Post

Posted
Rating:
#12
Banned

cogier said

Yes, that works well. I use Linux Mint Cinnamon and discovered that the autostart feature needs a delay or else the GLaunch icon appears on the desktop and not in the system tray. My glaunch.gambas.desktop file now looks like this: -

Code

[Desktop Entry]
Type=Application
Exec=/home/charlie/Dropbox/gambas/glaunch/glaunch.gambas
Hidden=false
Name=glaunch
X-MATE-Autostart-enabled=true
X-MATE-Autostart-Delay=3
X-GNOME-Autostart-Delay=3

Yes, i was suprised to see the tray icon worked on your cinnamon desktop while i only ever got the icon, then i found i had to add the SystemTray app to the panel.
I had the same issue as you and found in my cinamon desktop menu i had the Startup Applications (cinnamon) application and just like in MATE i was able to set the delay there.

I have now added the X-GNOME-Autostart-Delay=3 the the autostart option :)
Thank you

cogier said

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

I still think there is an issue here.
<IMG src="https://www.cogier.com/gambas/glaunch3.png"> </IMG>
Thanks, Bruce, I will advise if I find any other issues. :D

That's odd, it works as expected here?  i'll see if i can find a bug..

Cheers
Online now: No Back to the top

Post

Posted
Rating:
#13
Banned

BruceSteers said

That's odd, it works as expected here?  i'll see if i can find a bug..

Cheers

Scratch that, this seems to be a cinnamon only bug for me.  and not just the showtoolbar menu , ANY toggle set just stays the same although the functions are operating, on gnome and mate it works just as expected.
Online now: No Back to the top

Post

Posted
Rating:
#14
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Is there a way to hide the program showing on the task changer?

<IMG src="https://www.cogier.com/gambas/GambasRecent.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#15
Banned

cogier said

Is there a way to hide the program showing on the task changer?

Yes sorry (had to investigate that)

seems setting the forms NoTabFocus to true fixes that :)

Updated the archive in first post.

Cheers :)
Online now: No Back to the top

Post

Posted
Rating:
#16
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Hi Bruce,

Yes, that has fixed the [Alt]+
Online now: No Back to the top

Post

Posted
Rating:
#17
Banned

cogier said

Hi Bruce,

Yes, that has fixed the [Alt]+

Doh!!  lol
Cheers again Charlie.

Yep a silly error
  If m.Picture Then GridView1[GridView1.Rows.Max, 0].Picture = m.Picture

Needed to be…

  If m.Picture Then
    GridView1[GridView1.Rows.Max, 0].Picture = m.Picture
  Endif

i  forget about that right hand evaluation thing sometimes
Sorry about that  (updated archive)

I also reported the toggle menu and cinnamon issue on the bugtracker, will soon have it fixed…
Online now: No Back to the top

Post

Posted
Rating:
#18
Banned
 I have tried to fix that menu bug on cinnamon but cannot.
I've modified the application to not use the popup menu if on cinnamon tray icon. (not uploaded it yet)

But I found it is ONLY on the tray icon menu you get this error.

The same menu pops up if you left click the tray icon then right click in the list window (outside of the GridView)
That menu works just fine and is the same menu.
It's a cinnamon TrayIcon popup menu only specific bug.
Online now: No Back to the top

Post

Posted
Rating:
#19
Banned

BruceSteers said


I also reported the toggle menu and cinnamon issue on the bugtracker, will soon have it fixed…


Looks like it's now fixed :)
Raise the 'LayoutUpdated' D-Bus signal when the current desktop is 'Cinnamon',... (f9207cb5) · Commits · Gambas / gambas · GitLab

Thank you Benoit :)
Online now: No Back to the top

Post

Posted
Rating:
#20
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
I'll check this out in the next stable release.

It may have fixed another issue with my desktop when 2 TrayIcons are showing.

<IMG src="https://www.cogier.com/gambas/TrayIcon1.png"> </IMG>

Then with my AlarmTimer running: -

<IMG src="https://www.cogier.com/gambas/TrayIcon2.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#21
Banned
Couple of updates…

Added an opacity setting option

There was a glitch or 2 in the new search box, it now refreshes grid properly and only uses filenames not paths in the search

Also now window can be resized and moved without the title bar visible by clicking bottom right to resize and between the search box and close buttons for move.

(updated archive in first post)

For some reason on my system after moving/resizing it seems to loose the height of a title bar on next open, cant stop it doing that :(
Otherwise it's cool :)
Online now: No Back to the top

Post

Posted
Rating:
#22
Banned
I was getting a glitch

"Mostly" the startup delay worked okay but occasionally it would fail and load the pseudo icon and not open in the systray.

I have added a fix for this.
A new option "Wait for SysTray" forces the app to wait for up to 60 seconds if no systray is loaded and checks every second.

Code (gambas)

  1.   $bHasTray = Desktop.HasSystemTray
  2.   $bWaitForTray = Settings["WaitForTray", False]
  3.   If $bWaitForTray And If Not $bHasTray Then
  4.     For c As Integer = 1 To 60
  5.       Wait 1
  6.       fList.Retries = c
  7.       $bHasTray = Desktop.HasSystemTray
  8.       If $bHasTray Then Break
  9.     Next
  10.  
  11.  

If the program had to wait then it tells you so on the About dialog and as a tooltip.  (just for curiosity)

Updated the archive on the first post.
Online now: No Back to the top

Post

Posted
Rating:
#23
Banned
 Have made some updates to this….
including…

it no longer has option to show/hide window titlebar for resizing as resizing works by grabbing any edge now.

it has a directory lister.  it makes a note of the most commonly used folder for the projects in your gambas recents list and has an option to list ALL the projects in that dir.

option to open on single or double click

option to re-compile projects.

option to kill running tasks matching the name of your project (uses pgrep -f, can be useful for programs that have hung)

it has an updater option. checks it's gitlab repo for updates and if yes it downloads and re-compiles the new source.

Respects
BruceS

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#24
Banned
Big update here..   8-)

Changes of note…

new options form , the menu was getting too large.

Attachment

re-designed the list position saving as was glitching sometimes forgetting it's position.

You can just scroll the mouse wheel on the trayicon to select items and then clicking the tray icon will open the project.

Right click an item to get the following options…
* Execute the projects .gambas file (this option is hidden if no exe exists)
* Execute the project with gbx (use gbx3 to run the project directory, no exe required)
* Open the project directory
* Re-compile and make exe (use gbc3 and gba3 to quickly re-compile the project and make the executable)
* Kill Tasks (Kill all found instances of the task name, hidden if none are found and for glaunch itself) This is useful if you have problems with an active hung program.


Launcher icon actions.
Set the glaunch.desktop icon that will add the selected number of gambas recents to the Actions list. (Actions are right click icon options)
Many launchers do not update the icons very often but the list will be refreshed at each boot.
I've just been messing around here trying to get a crude recents lists option like ms-windows does when you right click an icon.
It works but could probably do with more development. the icon can be dragged onto the buttonbox if you don't know it's location.

Also now when the gambas recent list is read it makes a note of the most used project parent directory,
then it populates another list via Task.class with ALL the projects found in that folder

Image

Main window

Main window

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#25
Banned
 also with not using menus but having checkboxes now i was able to add many informative tooltips.
plus i added a load of info to the readme.
Online now: No Back to the top
1 guest and 0 members have just viewed this.