~ubuntu-branches/ubuntu/karmic/quodlibet/karmic

« back to all changes in this revision

Viewing changes to quodlibet/qltk/session.py

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2009-01-30 23:55:34 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20090130235534-l4e72ulw0vqfo17w
Tags: 2.0-1ubuntu1
* Merge from Debian experimental (LP: #276856), remaining Ubuntu changes:
  + debian/patches/40-use-music-profile.patch:
    - Use the "Music and Movies" pipeline per default.
* Refresh the above patch for new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2006 Joe Wreschnig
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License version 2 as
 
5
# published by the Free Software Foundation
 
6
#
 
7
# $Id: session.py 4330 2008-09-14 03:19:26Z piman $
 
8
 
 
9
import os
 
10
import sys
 
11
 
 
12
import gtk
 
13
 
 
14
from quodlibet import const
 
15
 
 
16
def init():
 
17
    try: import gnome, gnome.ui
 
18
    except ImportError: return
 
19
 
 
20
    gnome.init("quodlibet", const.VERSION)
 
21
    client = gnome.ui.master_client()
 
22
    client.set_restart_style(gnome.ui.RESTART_IF_RUNNING)
 
23
    command = os.path.normpath(os.path.join(os.getcwd(), sys.argv[0]))
 
24
    try: client.set_restart_command([command] + sys.argv[1:])
 
25
    except TypeError:
 
26
        # Fedora systems have a broken gnome-python wrapper for this function.
 
27
        # http://www.sacredchao.net/quodlibet/ticket/591
 
28
        # http://trac.gajim.org/ticket/929
 
29
        client.set_restart_command(len(sys.argv), [command] + sys.argv[1:])
 
30
    client.connect('die', gtk.main_quit)