Exemplo n.º 1
0
def set_font(ctrl, size, bold=False, underline=False):
    f = ctrl.Font
    if is_vista(): f.SetFaceName('Segoe UI')
    f.PointSize = size
    if bold: f.Weight = wx.FONTWEIGHT_BOLD
    if underline: f.SetUnderlined(True)
    ctrl.Font = f
Exemplo n.º 2
0
def _remove_virtual_store():
    '''
    Since Vista, the operating system has provided a mechanism to allow apps to seamlessly write to "program files",
    even if UAC is on. However, the actual on-disk location is not in %PROGRAMFILES%. It's something called the "virtual
    store", and if a file exists in the virtual store, we can read it even if we're actually trying to read from program
    files. This can cause issues when updating if modules have been removed but still exist in the virtual store.

    This function returns a list of all files in the app's virtual store for the purposes of having the updater process
    delete them.
    '''
    if not os.name == 'nt':
        return []

    import gui.native.win.winutil as winutil
    if not winutil.is_vista():
        return []

    # remove c:\Users\%USER%\AppData\Local\VirtualStore\Program Files\Digsby
    # if it exists

    to_remove = []
    # TODO: remove app name here, get it from the app object or something
    for virtual_store in ((stdpaths.userlocaldata / 'VirtualStore' / 'Program Files' / 'Digsby'),
                          (stdpaths.userlocaldata / 'VirtualStore' / 'Program Files (x86)' / 'Digsby')):

        with util.traceguard:
            if virtual_store.isdir():
                to_remove.extend(virtual_store.walkfiles())

    return to_remove
Exemplo n.º 3
0
def launch_sysdefault_email(email = None):
    '''
    Launch the system's default mail client.

    If email is not None, a new message with the email address specified will
    be opened.

    Return True if a program was launched.
    '''

    import wx
    if 'wxMSW' in wx.PlatformInfo:
        from gui.native.win.winutil import is_vista
        if is_vista(): return launch_sysdefault_email_vista(email)

    # ask the system what is used for "mailto://"
    #
    # example return value: u'"C:\\PROGRA~1\\MICROS~1\\Office12\\OUTLOOK.EXE" -c IPM.Note /m "%1"'
    #

    mailclient = urlprotocol.get('mailto')

    log.info('mail client is %r', mailclient)

    if not mailclient.strip():
        mailclient_error()
        return False

    # replace %ENVVARS%
    mailclient = envexpand(mailclient)


    # start the program!
    try:
        args = shlex.split(mailclient.encode(locale.getpreferredencoding()))

        # only grab the first part (hopefully the executable)
        args = args[:1]

        log.info('launching %r', args)

        if Popen(args):
            return True
    except Exception, e:
        print_exc()
        msg = e.message
Exemplo n.º 4
0
def launch_sysdefault_email(email=None):
    '''
    Launch the system's default mail client.

    If email is not None, a new message with the email address specified will
    be opened.

    Return True if a program was launched.
    '''

    import wx
    if 'wxMSW' in wx.PlatformInfo:
        from gui.native.win.winutil import is_vista
        if is_vista(): return launch_sysdefault_email_vista(email)

    # ask the system what is used for "mailto://"
    #
    # example return value: u'"C:\\PROGRA~1\\MICROS~1\\Office12\\OUTLOOK.EXE" -c IPM.Note /m "%1"'
    #

    mailclient = urlprotocol.get('mailto')

    log.info('mail client is %r', mailclient)

    if not mailclient.strip():
        mailclient_error()
        return False

    # replace %ENVVARS%
    mailclient = envexpand(mailclient)

    # start the program!
    try:
        args = shlex.split(mailclient.encode(locale.getpreferredencoding()))

        # only grab the first part (hopefully the executable)
        args = args[:1]

        log.info('launching %r', args)

        if Popen(args):
            return True
    except Exception, e:
        print_exc()
        msg = e.message
Exemplo n.º 5
0
WALL_OF_TEXT = _(
u'''\
Help Digsby stay free for all users. Allow Digsby to use part of your computer's idle processing power to contribute to commercial grid computing projects by enabling the Research Module.
<p>
This module turns on after your computer has been completely idle (no mouse or keyboard movement) for a period of time. It turns off the instant you move your mouse or press a key, so it has no effect on your PC's performance when you're using it. The research module also runs as a low priority, sandboxed Java process, so that other tasks your computer is doing will get done first, and so that it is completely secure.
<p>
For more details, see the <a href="http://wiki.digsby.com/doku.php?id=cpuusage">Research Module FAQ</a>.
'''
)

# TODO move all this into the WebKitDisplay class
if config.platform == 'win':
    import gui.native.win.winutil as winutil

    if winutil.is_vista():
        font = 'Segoe UI, Tahoma, MS Sans Serif; font-size: 9pt;'
    else:
        font = 'Tahoma, MS Sans Serif; font-size: 11px;'
else:
    font = 'Arial 12px' # TODO: other platforms.


css = u'''\
body {
margin: 0;
overflow: hidden;
cursor: default;
background-color: white;
font-family: %s;
-webkit-text-size-adjust: none;
Exemplo n.º 6
0
from util import traceguard
from gui.browser.webkit import WebKitDisplay

WALL_OF_TEXT = _(u'''\
Help Digsby stay free for all users. Allow Digsby to use part of your computer's idle processing power to contribute to commercial grid computing projects by enabling the Research Module.
<p>
This module turns on after your computer has been completely idle (no mouse or keyboard movement) for a period of time. It turns off the instant you move your mouse or press a key, so it has no effect on your PC's performance when you're using it. The research module also runs as a low priority, sandboxed Java process, so that other tasks your computer is doing will get done first, and so that it is completely secure.
<p>
For more details, see the <a href="http://wiki.digsby.com/doku.php?id=cpuusage">Research Module FAQ</a>.
''')

# TODO move all this into the WebKitDisplay class
if config.platform == 'win':
    import gui.native.win.winutil as winutil

    if winutil.is_vista():
        font = 'Segoe UI, Tahoma, MS Sans Serif; font-size: 9pt;'
    else:
        font = 'Tahoma, MS Sans Serif; font-size: 11px;'
else:
    font = 'Arial 12px'  # TODO: other platforms.

css = u'''\
body {
margin: 0;
overflow: hidden;
cursor: default;
background-color: white;
font-family: %s;
-webkit-text-size-adjust: none;
-webkit-user-select: none;