File: project_view.py

package info (click to toggle)
gnat-gps 5.3dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 50,360 kB
  • ctags: 11,617
  • sloc: ada: 374,346; ansic: 92,327; python: 15,979; xml: 12,186; sh: 3,277; makefile: 1,113; awk: 154; perl: 128; java: 17
file content (18 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
## This script changes the label of the project view and set it to the current
## project file path. Upon a project changed, the title is properly updated.

from GPS import *

def update_project_view_title (t):
   new_name = Project.root().file().name()
   new_short_name = Project.root().name()
   view = MDI.get ("Project View")

   if view != None:
      view.rename (new_name, new_short_name)
      t.remove()

def on_project_changed (h):
   t = Timeout (100, update_project_view_title)

Hook ("project_changed").add (on_project_changed)