removed cedega runner

This commit is contained in:
Mathieu Comandon 2011-07-07 01:42:37 +02:00
parent 6a017abda3
commit 07fb3274f9
14 changed files with 69 additions and 161 deletions

View file

@ -82,16 +82,6 @@
<signal name="activate" handler="import_scummvm" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="cedega_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Cedega</property>
<property name="use_underline">True</property>
<signal name="activate" handler="import_cedega" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="steam_menuitem">
<property name="visible">True</property>

14
debian/changelog vendored
View file

@ -1,3 +1,17 @@
lutris (0.2.6ubuntu1) natty; urgency=low
* Forgot to actually remove cedega stuff ... Silly me
-- Mathieu Comandon <strycore@gmail.com> Thu, 12 May 2011 03:40:27 +0200
lutris (0.2.6) natty; urgency=low
* Improved appearence of runners dialog
* Removed Cedega runner (Not maintained anymore)
* Minor Bugfixes
-- Mathieu Comandon <strycore@gmail.com> Thu, 12 May 2011 03:32:12 +0200
lutris (0.2.5r2) natty; urgency=low
* xdg is a build dependency

View file

@ -23,8 +23,8 @@ import lutris.constants as constants
class LutrisConfig():
"""Class where all the configuration handling happens.
Lutris configuration uses a cascading mecanism where
Lutris configuration uses a cascading mecanism where
each higher, more specific level override the lower ones.
The config files are stored in a YAML format and are easy to edit manually.
@ -33,7 +33,7 @@ class LutrisConfig():
def __init__(self, runner=None, game=None):
#Check if configuration directories exists and create them if needed.
#FIXME: This isn't the right place for this piece of code, it has
# nothing to do with configuration files.
# nothing to do with configuration files.
config_paths = [constants.lutris_config_path,
constants.runner_config_path,
constants.GAME_CONFIG_PATH,
@ -139,6 +139,17 @@ class LutrisConfig():
os.remove(os.path.join(constants.GAME_CONFIG_PATH,
game_name + constants.CONFIG_EXTENSION))
def is_valid(self):
"""
Check the config data and return True if config is ok
"""
try:
self.runner_name = self.game_config["runner"]
except KeyError:
print "Error in %s config file : No runner" % self.game
return False
return True
def save(self, type=None):
"""Save configuration file

View file

@ -20,7 +20,7 @@ from xdg import BaseDirectory
import sys
name = "Lutris"
version = "0.2.5"
version = "0.2.6"
website = "http://lutris.net"
protocol_version = 1
INSTALLER_URL = "http://lutris.net/media/installers/"

View file

@ -41,10 +41,11 @@ try:
import lutris.coverflow.covergl
import lutris.coverflow.anim
except ImportError,msg:
print "Pyglet Error: %s" % str(msg)
print "Pyglet Import Error: %s" % str(msg)
PYGLET_ENABLED = False
except pyglet.window.NoSuchConfigException,msg:
print "Pyglet Error: %s" % str(msg)
except pyglet.window.NoSuchConfigException, msg:
print "Pyglet Unhandled Error: %s" % str(msg)
PYGLET_ENABLED = False
Z_NEAR = 1.0

View file

@ -63,9 +63,10 @@ def get_list():
#error_dialog.run()
#error_dialog.destroy()
print message
game_list.append({"name": Game.real_name,
"runner": Game.runner_name,
"id":game_name})
else:
game_list.append({"name": Game.real_name,
"runner": Game.runner_name,
"id":game_name})
return game_list
class LutrisGame():
@ -81,26 +82,28 @@ class LutrisGame():
self.load_success = self.load_config()
def load_config(self):
#Load the game's configuration
"""
Load the game's configuration.
"""
self.game_config = LutrisConfig(game=self.name)
if "realname" in self.game_config.config:
self.real_name = self.game_config["realname"]
else:
self.real_name = self.name
try:
if self.game_config.is_valid():
self.runner_name = self.game_config["runner"]
except KeyError:
print "Error in %s config file : No runner" % self.name
if "realname" in self.game_config.config:
self.real_name = self.game_config["realname"]
else:
self.real_name = self.name
else:
return False
try:
runner_module = __import__("lutris.runners.%s" %
self.runner_name, globals(), locals(),
[self.runner_name], -1 )
runner_module = __import__("lutris.runners.%s" % self.runner_name,
globals(), locals(),
[self.runner_name], -1)
runner_cls = getattr(runner_module, self.runner_name)
self.machine = runner_cls(self.game_config)
except ImportError, msg:
logger.error("Invalid runner %s" % self.runner_name)
logger.error(msg)
except AttributeError, msg:
logger.error("Invalid configuration file (Attribute Error) : %s" % self.name)
logger.error(msg)
@ -226,11 +229,7 @@ class LutrisGame():
self.timer_id = None
logger.debug("game has quit at %s" % time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime()))
if self.game_thread is not None and self.game_thread.pid:
if self.game_thread.cedega:
for pid in self.game_thread.pid:
os.kill(pid, SIGKILL)
else:
os.kill(self.game_thread.pid + 1, SIGKILL)
os.kill(self.game_thread.pid + 1, SIGKILL)
if 'reset_desktop' in self.game_config.config['system']:
if self.game_config.config['system']['reset_desktop']:
self.lutris_desktop_control.reset_desktop()

View file

@ -19,6 +19,7 @@ import gtk
import gtk.gdk
import lutris.constants
class AboutLutrisDialog(gtk.AboutDialog):
__gtype_name__ = "AboutLutrisDialog"

View file

@ -129,9 +129,9 @@ class LutrisWindow(gtk.Window):
self.game_treeview.connect("cursor-changed", self.select_game)
self.game_treeview.connect("button-press-event", self.mouse_menu)
#self.game_column = self.game_list_grid_view.get_column(0)
#self.game_cell = self.game_column.get_cell_renderers()[0]
#self.game_cell.connect('edited', self.game_name_edited_callback)
self.game_column = self.game_treeview.get_column(1)
self.game_cell = self.game_column.get_cell_renderers()[0]
self.game_cell.connect('edited', self.game_name_edited_callback)
self.game_list_scrolledwindow = self.builder.get_object("game_list_scrolledwindow")
self.game_list_scrolledwindow.add_with_viewport(self.game_treeview)
@ -146,7 +146,7 @@ class LutrisWindow(gtk.Window):
#Timer
self.timer_id = gobject.timeout_add(1000, self.refresh_status)
def refresh_status(self):
if hasattr(self, "running_game"):
@ -214,7 +214,7 @@ class LutrisWindow(gtk.Window):
def select_game(self, treeview):
""" Method triggered when a game is selected in the list.
"""
#Set buttons states
@ -269,14 +269,6 @@ class LutrisWindow(gtk.Window):
self.game_treeview.add_row(game_info)
self.game_treeview.sort_rows()
def import_cedega(self, widget, data=None):
from lutris.runners.cedega import cedega
cedega = cedega()
result = cedega.import_games()
if result is not True:
NoticeDialog(result)
self.get_game_list()
def import_steam(self, widget, data=None):
NoticeDialog("Import from steam not yet implemented")
@ -303,15 +295,14 @@ class LutrisWindow(gtk.Window):
def edit_game_name(self, button):
"""Change game name"""
self.game_cell.set_property('editable', True)
self.game_list_grid_view.set_cursor(self.paths[0][0], self.game_column, True)
self.game_treeview.set_cursor(self.paths[0][0], self.game_column, True)
def game_name_edited_callback(self, widget, index, new_name):
self.game_list_grid_view.get_model()[index][0] = new_name
self.game_treeview.get_model()[index][0] = new_name
new_name_game_config = LutrisConfig(game=self.get_selected_game())
new_name_game_config.config["realname"] = new_name
new_name_game_config.save(type="game")
self.game_cell.set_property('editable', False)
self.game_cell.set_property('editable', False)
def edit_game_configuration(self, button):
"""Edit game preferences"""

View file

@ -58,7 +58,9 @@ class GameTreeView(gtk.TreeView):
def add_row(self, game):
model = self.get_model()
s = "%s \n<small>%s</small>" % (game['name'], game['runner'])
icon_path = os.path.join(lutris.constants.DATA_PATH, 'media/runner_icons', game['runner'] + '.png')
icon_path = os.path.join(lutris.constants.DATA_PATH,
'media/runner_icons',
game['runner'] + '.png')
pix = gtk.gdk.pixbuf_new_from_file_at_size(icon_path,
ICON_SIZE, ICON_SIZE)
row = model.append([game['id'], pix, s,])
@ -74,7 +76,6 @@ class GameTreeView(gtk.TreeView):
class DownloadProgressBox(gtk.HBox):
__gsignals__ = {'complete' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
'cancelrequested' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,

View file

@ -1,4 +1,4 @@
__all__ = ["linux", "wine", 'steam', 'cedega',"sdlmame", "mednafen",
__all__ = ["linux", "wine", 'steam',"sdlmame", "mednafen",
"scummvm", "snes9x", "gens", "uae", "nulldc", "openmsx", 'dolphin',
"dosbox", "pcsx", "atari800", "mupen64plus",
"frotz", "browser", 'osmose', 'vice', 'hatari', 'stella', 'jzintv', 'o2em']

View file

@ -1,83 +0,0 @@
# -*- coding:Utf-8 -*-
###############################################################################
## Lutris
##
## Copyright (C) 2009 Mathieu Comandon strycore@gmail.com
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
###############################################################################
from lutris.config import LutrisConfig
from lutris.runners.runner import Runner
import ConfigParser
import os
class cedega(Runner):
"""What the hell, Cedega is dead now, bring on GameTree Linux"""
def __init__(self,settings = None):
self.executable = "cedega"
self.description = "Runs Windows games with Cedega"
self.machine = "Windows games"
self.is_installable = False
self.game_options = [{"option":"shortcut",
"type": "string",
"label": "Shortcut"},
{"option":"folder",
"type": "string",
"label": "Folder"}]
self.runner_options = []
if settings:
self.folder=settings["game"]["folder"]
self.game = settings["game"]["shortcut"]
def import_games(self):
if not self.is_installed():
return "Cedega is not installed"
cedega_settings_dir = os.path.join(os.path.expanduser('~'),".cedega")
if (os.path.exists(cedega_settings_dir)):
os.chdir(cedega_settings_dir)
dirs = os.listdir(cedega_settings_dir)
for game_folder in dirs:
if not game_folder.startswith(".") and game_folder != "configuration_profiles":
shortcuts = self.get_cedega_shortcuts(os.path.join(cedega_settings_dir,
game_folder))
for shortcut in shortcuts:
print "Importing %s - %s" % (game_folder, shortcut)
self.add_game(game_folder,shortcut)
return True
else:
return "No Cedega directory"
def get_cedega_shortcuts(self,path):
os.chdir(path)
if os.path.exists("./games.ini"):
cedega_config = ConfigParser.ConfigParser()
cedega_config.read("./games.ini")
shortcuts = cedega_config.sections()
return shortcuts
def add_game(self,folder,shortcut):
lutris_config = LutrisConfig()
lutris_config.config = {"runner": "cedega",
"realname": shortcut,
"game": {"folder": folder, "shortcut": shortcut}}
lutris_config.save(type="game")
def play(self):
return [self.executable,
"--run",
"\"" + self.folder + "\"",
"\"" + self.game + "\""]

View file

@ -73,7 +73,6 @@ class steam(wine):
if the steam executable is on the harddrive
"""
return True
if not self.check_depends():
return False
if not self.game_path or \
@ -145,6 +144,8 @@ class steam(wine):
self.check_regedit_keys() #From parent wine runner
print self.game_path
print self.game_exe
steam_full_path = os.path.join(self.game_path, self.game_exe)
command = ['wine', '"' + steam_full_path + '"', '-applaunch', self.appid, self.args]
return {'command': command }

View file

@ -25,7 +25,6 @@ from os.path import exists
from signal import SIGKILL
from os import kill, killpg
from lutris.runners.cedega import cedega
class LutrisThread(threading.Thread):
"""Runs the game in a separate thread"""
@ -38,7 +37,6 @@ class LutrisThread(threading.Thread):
self.game_process = None
self.return_code = None
self.pid = 99999
self.cedega = False
self.killswitch = killswitch
if type(self.killswitch) == type(str()) and not exists(self.killswitch):
# Prevent setting a killswitch to a file that doesn't exists
@ -46,8 +44,6 @@ class LutrisThread(threading.Thread):
def run(self):
self.timer_id = gobject.timeout_add(2000, self.poke_process)
if "cedega" in self.command:
self.cedega = True
logging.debug(self.command)
self.game_process = subprocess.Popen(self.command, shell=True,
stdout=subprocess.PIPE,
@ -71,19 +67,9 @@ class LutrisThread(threading.Thread):
kill(self.game_process.pid + 1, SIGKILL)
self.pid = None
return False
if self.cedega:
command = "ps -ef | grep winex_ver | grep -v grep | awk '{print $2}'"
pid = subprocess.Popen(command, shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
self.pid = []
for item in pid[0].split("\n"):
if item:
self.pid.append(item)
else:
self.pid = self.game_process.pid
self.pid = self.game_process.pid
self.return_code = self.game_process.poll()
if self.return_code is not None and not self.cedega:
if self.return_code is not None:
logging.debug("Game quit")
self.pid = None
return False

View file

@ -50,10 +50,6 @@ msgstr ""
msgid "Add game"
msgstr ""
#: ../data/ui/LutrisWindow.ui.h:2
msgid "Cedega"
msgstr ""
#: ../data/ui/LutrisWindow.ui.h:3
msgid "Fullscreen"
msgstr ""