Пример #1
0
    def __init__(self, applet, iid, debug_flag, manual_poscorrect):
        self.__gobject_init__()
        self.debug_flag = debug_flag
        self.manual_poscorrect = manual_poscorrect

        gettext.bindtextdomain(config.GETTEXT_PACKAGE(),
                               config.GNOMELOCALEDIR())
        gettext.textdomain(config.GETTEXT_PACKAGE())

        locale.bindtextdomain(config.GETTEXT_PACKAGE(),
                              config.GNOMELOCALEDIR())
        locale.textdomain(config.GETTEXT_PACKAGE())

        self.applet = applet
        self.__loadIcon__()

        self.ev_box = gtk.EventBox()

        self.image = gtk.Image()
        self.image.set_from_pixbuf(self.iconPixbuf)

        self.main_loaded = False

        self.ev_box.add(self.image)
        self.ev_box.show()
        self.ev_box.set_events(gtk.gdk.BUTTON_PRESS_MASK)
        self.ev_box.connect("button_press_event", self.event_box_clicked)
        self.applet.add(self.ev_box)

        self.create_menu()
        self.applet.show_all()
Пример #2
0
# Read through the comments of the implementations of other languages
# and don't touch the implementation for English unless you know what
# you are doing.

# If your language 'can' get correctly translated by using only the po
# files, it means that you don't have to touch these files at all. In
# that case the advice is simple: don't touch it. hehe :)

import config

##
## I18N
##
import locale
import gettext
domain = config.GETTEXT_PACKAGE()
gettext.bindtextdomain(domain, config.GNOMELOCALEDIR())
gettext.textdomain(domain)
_ = gettext.gettext

# Fallback to english if locale setting is unknown
# or translation for this locale is not available
if gettext.find(domain) == None:
    language = "C"
else:
    language = ""
try:
    locale.setlocale(locale.LC_ALL, language)
except:
    warnings.warn_explicit(
        "Locale not supported by Python. Using the fallback 'C' locale.",
Пример #3
0
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#python modules
import sys

#custom modules
import config
from MSDeviceManager import MSDeviceManager
from MSConfig import MSConfig
from MSSystray import MSSystray

##
## I18N
##
import gettext, locale
gettext.install(config.GETTEXT_PACKAGE(), config.GNOMELOCALEDIR(), unicode=1)

gettext.bindtextdomain('mount-systray', config.GNOMELOCALEDIR())
if hasattr(gettext, 'bind_textdomain_codeset'):
    gettext.bind_textdomain_codeset('mount-systray', 'UTF-8')
gettext.textdomain('mount-systray')

locale.bindtextdomain('mount-systray', config.GNOMELOCALEDIR())
if hasattr(locale, 'bind_textdomain_codeset'):
    locale.bind_textdomain_codeset('mount-systray', 'UTF-8')
locale.textdomain('mount-systray')

try:
    import pygtk
    #tell pyGTK, if possible, that we want GTKv2
    pygtk.require("2.0")
Пример #4
0
import subprocess

#custom modules
import config
import crontab
import crontabEditor
import at
import atEditor
import setuserWindow
import addWindow
import data
import template
import template_chooser
import template_manager

gtk.glade.bindtextdomain(config.GETTEXT_PACKAGE(), config.GNOMELOCALEDIR())


##
## The MainWindow class
##
class main:
    def __init__(self,
                 debug_flag=None,
                 inapplet=False,
                 manual_poscorrect=False):
        self.debug_flag = debug_flag
        self.inapplet = inapplet
        self.manual_poscorrect = manual_poscorrect

        self.__loadIcon__()