commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue-navigator/src/Actions gnome_menu.py


From: Derek Neighbors
Subject: gnue-navigator/src/Actions gnome_menu.py
Date: Wed, 20 Aug 2003 09:57:01 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-navigator
Branch:         
Changes by:     Derek Neighbors <address@hidden>        03/08/20 09:57:01

Modified files:
        src/Actions    : gnome_menu.py 

Log message:
        Made changes so that the program doesn't bomb.  It creates gnome2 style
        files now.  However, it is not properly doing submenus.  It also is
        not issuing proper GConfig commands to get run variables.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-navigator/src/Actions/gnome_menu.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gnue-navigator/src/Actions/gnome_menu.py
diff -c gnue-navigator/src/Actions/gnome_menu.py:1.5 
gnue-navigator/src/Actions/gnome_menu.py:1.6
*** gnue-navigator/src/Actions/gnome_menu.py:1.5        Wed Jan  1 19:45:48 2003
--- gnue-navigator/src/Actions/gnome_menu.py    Wed Aug 20 09:57:01 2003
***************
*** 47,53 ****
      else:
        param, value = (argument, "")
  
!   directory = "~/.gnome/apps/"
  
    if arguments.has_key('menu'):
      directory = os.path.join(directory,arguments['menu'])
--- 47,53 ----
      else:
        param, value = (argument, "")
  
!   directory = "~/.gnome2/vfolders/applications/"
  
    if arguments.has_key('menu'):
      directory = os.path.join(directory,arguments['menu'])
***************
*** 62,74 ****
  
  def buildMenu(process, location):
  
!   description = process._type == 'GNProcesses' and \
!          process.title or process.description
!   directory = os.path.join(location, string.replace(description,'/',''))
  
    if not os.path.exists(directory):
      os.makedirs(directory)
  
    outfile = open(os.path.join(directory,'.directory'),'w')
    outfile.write("""[Desktop Entry]
  Name=%s
--- 62,86 ----
  
  def buildMenu(process, location):
  
! # add this assignment as otherwise undeclared variable errors crop up
! # need to be able to build "directory" before building steps
!   description = ""
!   
! # couldn't get this line to work quite right wasn't sure of the python
! # syntax i believe adding parens around process.title or process.description
! # might fix it, but broke it into something simpler because of my unsuredness
! 
! #  description = process._type == 'GNProcesses' and process.title or 
process.description
!   if process._type == 'GNProcesses':
!     description = process.title or process.description
  
+   directory = os.path.join(location, string.replace(description,'/',''))
    if not os.path.exists(directory):
      os.makedirs(directory)
  
+ # this is the section that needs gutting for gnome2  as they have massively
+ # changed how to do this.  They now use vfolders.  There is a tutorial
+ # found here http://www.gnome.org/start/2.0/menuediting.html
    outfile = open(os.path.join(directory,'.directory'),'w')
    outfile.write("""[Desktop Entry]
  Name=%s
***************
*** 88,117 ****
  
  def makeLinkFile(directory, step):
  
    outfile=open(os.path.join(
!       directory,string.replace(step.description,"/","") + \
        '.desktop'),'w')
  
    if step.type == 'form':
!     command = gConfig("RunFormCommand")
      icon = "gnome-applications.png"
    elif step.type == 'report':
!     command = gConfig("RunReportCommand")
      icon = "gnome-note.png"
  
    outfile.write("""\
  [Desktop Entry]
! Comment=%(description)s
  Exec=%(executable)s %(location)s
  Icon=%(icon)s
- Name=%(description)s
  Terminal=false
  TerminalOptions=
- Type=Application
  MultipleArgs=false
  """ % { 'executable': command,
          'icon': icon,
!         'description': step.description,
          'location': step.location })
  
    outfile.close()
--- 100,134 ----
  
  def makeLinkFile(directory, step):
  
+ # changed step.description to step.title as description seemed invalid
    outfile=open(os.path.join(
!       directory,string.replace(step.title,"/","") + \
        '.desktop'),'w')
  
+ # these two "run commands" have changed, didn't take time to find new names
    if step.type == 'form':
!     command = "fixme" #gConfig("RunFormCommand")
      icon = "gnome-applications.png"
    elif step.type == 'report':
!     command = "fixme" #gConfig("RunReportCommand")
      icon = "gnome-note.png"
  
+ # updated to gnome2 style .desktop entry
    outfile.write("""\
  [Desktop Entry]
! Version=AddLater
! Encoding=UTF-8
! Type=Application
  Exec=%(executable)s %(location)s
  Icon=%(icon)s
  Terminal=false
+ Name=%(description)s
+ Comment=%(description)s
  TerminalOptions=
  MultipleArgs=false
  """ % { 'executable': command,
          'icon': icon,
!         'description': step.title,
          'location': step.location })
  
    outfile.close()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]