From 0424cf5e104aacc875e4077cd0619f2b04699a03 Mon Sep 17 00:00:00 2001 From: "Benjamin L. Campbell" Date: Fri, 27 Jun 2014 08:38:26 -0500 Subject: [PATCH 1/3] applications plugin: Launch first application matching search on ENTER keypress. --- install | 6 ++++++ test | 1 + usr/lib/linuxmint/mintMenu/plugins/applications.py | 12 ++++++++++++ 3 files changed, 19 insertions(+) create mode 100755 install diff --git a/install b/install new file mode 100755 index 0000000..3042e50 --- /dev/null +++ b/install @@ -0,0 +1,6 @@ +#!/bin/bash +umask 002 + +sudo rm -rf /usr/lib/linuxmint/mintMenu +sudo cp -R usr / +sudo glib-compile-schemas /usr/share/glib-2.0/schemas diff --git a/test b/test index 420ee58..eac076c 100755 --- a/test +++ b/test @@ -1,4 +1,5 @@ #!/bin/bash +umask 002 sudo rm -rf /usr/lib/linuxmint/mintMenu sudo cp -R usr / diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index fd62351..766038b 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -833,6 +833,10 @@ class pluginclass( object ): i.hide() else: shownList.append(i) + #if this is the first matching item + #focus it + if(not showns): + i.grab_focus() showns = True if (not showns and os.path.exists("/usr/lib/linuxmint/mintInstall/icon.svg")): if len(text) >= 3: @@ -891,6 +895,7 @@ class pluginclass( object ): # Forward all text to the search box def keyPress( self, widget, event ): + if event.string.strip() != "" or event.keyval == Gdk.KEY_BackSpace: self.searchEntry.grab_focus() gtk.gtk_editable_set_position(hash(self.searchEntry), -1) @@ -1323,8 +1328,15 @@ class pluginclass( object ): self.favoritesAdd( self.favoritesBuildLauncher( uri ) ) def Search( self, widget ): + text = self.searchEntry.get_text().strip() if text != "": + for app_button in self.applicationsBox.get_children(): + if( isinstance(app_button, ApplicationLauncher) and app_button.filterText( text ) ): + app_button.execute() + self.mintMenuWin.hide() + return + self.mintMenuWin.hide() fullstring = self.searchtool.replace( "%s", text ) os.system(fullstring + " &") From d384a6278cda0f90e142bfad28ac7e4444cbd04e Mon Sep 17 00:00:00 2001 From: "Benjamin L. Campbell" Date: Mon, 30 Jun 2014 11:14:38 -0500 Subject: [PATCH 2/3] Fix space behavior. --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 766038b..28cae15 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -902,6 +902,11 @@ class pluginclass( object ): self.searchEntry.event( event ) return True + + if event.keyval == Gdk.KEY_space: + self.searchEntry.event( event ) + return True + if event.keyval == Gdk.KEY_Down and self.searchEntry.is_focus(): self.applicationsBox.get_children()[0].grab_focus() From 71a563b970c6c8de906798a09373d3584906a68c Mon Sep 17 00:00:00 2001 From: Tom Dunlap Date: Wed, 20 Apr 2016 13:51:56 -0700 Subject: [PATCH 3/3] Remove "install" and "test" script I assume that these scripts were added for local testing purposes. I am removing them because they are not in the upstream origin and are not required for recommended installation. If the maintainers find these scripts useful, please feel free to revert this commit. --- install | 6 ------ test | 8 -------- 2 files changed, 14 deletions(-) delete mode 100755 install delete mode 100755 test diff --git a/install b/install deleted file mode 100755 index 3042e50..0000000 --- a/install +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -umask 002 - -sudo rm -rf /usr/lib/linuxmint/mintMenu -sudo cp -R usr / -sudo glib-compile-schemas /usr/share/glib-2.0/schemas diff --git a/test b/test deleted file mode 100755 index eac076c..0000000 --- a/test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -umask 002 - -sudo rm -rf /usr/lib/linuxmint/mintMenu -sudo cp -R usr / -sudo glib-compile-schemas /usr/share/glib-2.0/schemas - -python /usr/lib/linuxmint/mintMenu/mintMenu.py