~gladex/gladex/plugin-impl

« back to all changes in this revision

Viewing changes to src/gladex_callbacks.py

  • Committer: Oumar Aziz OUATTARA
  • Date: 2008-02-25 20:11:35 UTC
  • mfrom: (155.1.10 gladex)
  • Revision ID: wattazoum@wattazoum-laptop-20080225201135-wm13wuexdferqf9a
Plugin interface designed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
1
"""
3
2
    gladex - Generate source code from Glade XML files.
4
3
 
22
21
#from threading import Timer
23
22
from threading import *
24
23
from time import sleep
 
24
from gettext import gettext as _
25
25
import sys, os, stat
26
26
import pwd, grp, locale
27
27
import pygtk
31
31
import inspect
32
32
import gladex_functions as gxf
33
33
import plugins
 
34
from . import getResource
 
35
from . import Infos
34
36
 
35
37
global_data = {}
36
38
global_data["main_window_mapped"]=False
37
39
 
38
 
<<<<<<< TREE
39
 
=======
40
40
class fallbackplugin:
41
41
        def info(self):
42
42
                pass
64
64
        def on_directory_change(widget):
65
65
                pass
66
66
#
67
 
>>>>>>> MERGE-SOURCE
68
 
 
69
67
 
70
68
def load_plugins():
71
69
        """load_plugins()
341
339
        This is a event function, called when about is clicked from the menu.
342
340
        The function will open and handel the about dialog.
343
341
        """
344
 
        about = wtree.get_widget("about_gladex")
345
 
        responce = about.run()
346
 
        if responce == gtk.RESPONSE_CANCEL or responce==gtk.RESPONSE_DELETE_EVENT:
347
 
                about.hide()
348
 
        pass
 
342
        about = gtk.AboutDialog()
 
343
        about.set_name(Infos.NAME)
 
344
        about.set_version(Infos.VERSION)
 
345
        about.set_comments(Infos.DESCRIPTION)
 
346
        about.set_license(Infos.LICENSE)
 
347
        about.set_transient_for(global_data["tree"].get_widget("MainWindow"))
 
348
        about.set_copyright("The Gladex authors")
 
349
        about.set_translator_credits(_("translator-credits"))
 
350
        about.set_authors(["Charles Edward Pax <pax@rutgers.edu>","Christopher Pax <cp67@njit.edu>","Oumar Aziz OUATTARA <wattazoum@gmail.com>"])
 
351
        about.set_website(Infos.WEBSITE)
 
352
        about.set_website_label(Infos.WEBSITE_LABEL)
 
353
        about.set_logo(gtk.gdk.pixbuf_new_from_file(getResource("gladex-logo.png")))
 
354
        about.run()
 
355
        about.destroy()
 
356
        
 
357
#       about = wtree.get_widget("about_gladex")
 
358
#       responce = about.run()
 
359
#       if responce == gtk.RESPONSE_CANCEL or responce==gtk.RESPONSE_DELETE_EVENT:
 
360
#               about.hide()
 
361
#       pass
349
362
#
350
363
 
351
364
def on_help_menu_activate(widget, data, wtree):
353
366
        This is a event function, that is called when the 'help' is clicked in the menu.
354
367
        uses yelp upon our docs.
355
368
        """
356
 
        yelp = os.popen("yelp file://"+os.path.dirname(__file__)+"/docs/gladex-manual.xml")
 
369
        yelp = os.popen("yelp %s" % getResource("gladex-manual.xml"))
357
370
        os.unlink(yelp)
358
371
#
359
372
 
409
422
        pass
410
423
#       
411
424
def on_open_examples_activate(widget,data,wtree):
412
 
        commands.getoutput("nautilus "+os.path.dirname(__file__)+"/examples")
 
425
        commands.getoutput("nautilus "+os.path.dirname(getResource("example.glade")))
413
426
        pass
414
427
#