mirror of
https://github.com/lutris/lutris
synced 2024-10-14 19:53:53 +00:00
Lutris marathon day 4 : Asteroids
This commit is contained in:
parent
b1cad4d335
commit
e04644980c
32
bin/lutris
32
bin/lutris
|
@ -18,6 +18,7 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import gtk
|
import gtk
|
||||||
|
import gobject
|
||||||
|
|
||||||
# Check if we are working in the source tree or from the installed
|
# Check if we are working in the source tree or from the installed
|
||||||
# package and mangle the python path accordingly
|
# package and mangle the python path accordingly
|
||||||
|
@ -48,8 +49,6 @@ from lutris.system_config_dialog import SystemConfigDialog
|
||||||
from lutris.gui.google_image_dialog import GoogleImageDialog
|
from lutris.gui.google_image_dialog import GoogleImageDialog
|
||||||
from lutris.gui.edit_game_config_dialog import EditGameConfigDialog
|
from lutris.gui.edit_game_config_dialog import EditGameConfigDialog
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class LutrisWindow(gtk.Window):
|
class LutrisWindow(gtk.Window):
|
||||||
__gtype_name__ = "LutrisWindow"
|
__gtype_name__ = "LutrisWindow"
|
||||||
|
|
||||||
|
@ -129,7 +128,24 @@ class LutrisWindow(gtk.Window):
|
||||||
self.game_list_scrolledwindow = self.builder.get_object("game_list_scrolledwindow")
|
self.game_list_scrolledwindow = self.builder.get_object("game_list_scrolledwindow")
|
||||||
self.game_list_scrolledwindow.add_with_viewport(self.game_list_grid_view)
|
self.game_list_scrolledwindow.add_with_viewport(self.game_list_grid_view)
|
||||||
|
|
||||||
|
#Timer
|
||||||
|
self.timer_id = gobject.timeout_add(1000, self.refresh_status)
|
||||||
|
|
||||||
|
def refresh_status(self):
|
||||||
|
###FIXME !!
|
||||||
|
# if hasattr(self.running_game.game_process, "pid"):
|
||||||
|
# self.status_text = "Game is running (pid: %s)" % str(self.running_game.game_process.pid)
|
||||||
|
# self.status_bar.push(self.status_bar_context_id,self.status_text)
|
||||||
|
# else:
|
||||||
|
# self.status_bar.push(self.status_bar_context_id,"Welcome to Lutris")
|
||||||
|
for index in range(0,3):
|
||||||
|
if os.path.exists("/dev/input/js%d" % index):
|
||||||
|
self.joystick_icons[index].show()
|
||||||
|
else:
|
||||||
|
self.joystick_icons[index].hide()
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_game_list(self):
|
def get_game_list(self):
|
||||||
game_list = []
|
game_list = []
|
||||||
for file in os.listdir(constants.game_config_path):
|
for file in os.listdir(constants.game_config_path):
|
||||||
|
@ -226,17 +242,15 @@ class LutrisWindow(gtk.Window):
|
||||||
|
|
||||||
def add_game(self,widget,data=None):
|
def add_game(self,widget,data=None):
|
||||||
add_game_dialog = AddGameDialog(self)
|
add_game_dialog = AddGameDialog(self)
|
||||||
logging.debug("opening dialog")
|
if hasattr(add_game_dialog,"game_info"):
|
||||||
game_info = add_game_dialog.game_info
|
game_info = add_game_dialog.game_info
|
||||||
logging.debug(game_info)
|
self.game_list_grid_view.append_row(game_info)
|
||||||
self.game_list_grid_view.append_row(game_info)
|
|
||||||
|
|
||||||
def import_cedega(self,widget,data=None):
|
def import_cedega(self,widget,data=None):
|
||||||
cedega = runners.cedega.cedega()
|
cedega = runners.cedega.cedega()
|
||||||
cedega.import_games()
|
cedega.import_games()
|
||||||
self.get_game_list()
|
self.get_game_list()
|
||||||
|
|
||||||
|
|
||||||
def import_steam(self,widget,data=None):
|
def import_steam(self,widget,data=None):
|
||||||
logging.debug("Import from steam not yet implemented")
|
logging.debug("Import from steam not yet implemented")
|
||||||
|
|
||||||
|
@ -277,8 +291,6 @@ class LutrisWindow(gtk.Window):
|
||||||
|
|
||||||
def set_game_cover(self):
|
def set_game_cover(self):
|
||||||
if self.gameName:
|
if self.gameName:
|
||||||
logging.debug("Setting cover for :")
|
|
||||||
logging.debug(self.gameName)
|
|
||||||
extensions = ["png", "jpg", "jpeg"]
|
extensions = ["png", "jpg", "jpeg"]
|
||||||
for extension in extensions:
|
for extension in extensions:
|
||||||
coverFile = os.path.join(constants.cover_path, self.gameName + "." + extension)
|
coverFile = os.path.join(constants.cover_path, self.gameName + "." + extension)
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 797 B |
BIN
data/media/lutris.png
Executable file
BIN
data/media/lutris.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
1102
data/media/lutris.svg
Executable file
1102
data/media/lutris.svg
Executable file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 58 KiB |
|
@ -5,7 +5,7 @@
|
||||||
<!-- interface-naming-policy project-wide -->
|
<!-- interface-naming-policy project-wide -->
|
||||||
<object class="AddgameDialog" id="addgame_dialog">
|
<object class="AddgameDialog" id="addgame_dialog">
|
||||||
<property name="border_width">5</property>
|
<property name="border_width">5</property>
|
||||||
<property name="icon">../media/icon.png</property>
|
<property name="icon">../media/lutris.svg</property>
|
||||||
<property name="type_hint">normal</property>
|
<property name="type_hint">normal</property>
|
||||||
<property name="has_separator">False</property>
|
<property name="has_separator">False</property>
|
||||||
<child internal-child="vbox">
|
<child internal-child="vbox">
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="button2">
|
<object class="GtkButton" id="button2">
|
||||||
<property name="label" translatable="yes">gtk-cancel</property>
|
<property name="label">gtk-cancel</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="button1">
|
<object class="GtkButton" id="button1">
|
||||||
<property name="label" translatable="yes">gtk-ok</property>
|
<property name="label">gtk-ok</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
<property name="width_request">650</property>
|
<property name="width_request">650</property>
|
||||||
<property name="height_request">500</property>
|
<property name="height_request">500</property>
|
||||||
<property name="title" translatable="yes">Lutris</property>
|
<property name="title" translatable="yes">Lutris</property>
|
||||||
<property name="icon">../media/icon.png</property>
|
<property name="icon">../media/lutris.svg</property>
|
||||||
|
<property name="icon_name">lutris</property>
|
||||||
<signal name="destroy" handler="on_destroy"/>
|
<signal name="destroy" handler="on_destroy"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkVBox" id="vbox1">
|
<object class="GtkVBox" id="vbox1">
|
||||||
|
@ -271,23 +272,14 @@
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkHBox" id="hbox2">
|
<object class="GtkHBox" id="hbox2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="status_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="xpad">5</property>
|
|
||||||
<property name="ypad">5</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="js0image">
|
<object class="GtkImage" id="js0image">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="icon_name">input-gaming</property>
|
<property name="icon_name">input-gaming</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
@ -297,6 +289,8 @@
|
||||||
<property name="icon_name">input-gaming</property>
|
<property name="icon_name">input-gaming</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
<property name="position">2</property>
|
<property name="position">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
@ -306,6 +300,8 @@
|
||||||
<property name="icon_name">input-gaming</property>
|
<property name="icon_name">input-gaming</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
<property name="position">3</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
@ -315,9 +311,23 @@
|
||||||
<property name="icon_name">input-gaming</property>
|
<property name="icon_name">input-gaming</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
<property name="position">4</property>
|
<property name="position">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="status_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="xpad">5</property>
|
||||||
|
<property name="ypad">5</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack_type">end</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">0</property>
|
<property name="position">0</property>
|
||||||
|
@ -326,6 +336,7 @@
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
<property name="position">3</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
12
debian/changelog
vendored
12
debian/changelog
vendored
|
@ -1,3 +1,15 @@
|
||||||
|
lutris (0.2~public2) lucid; urgency=low
|
||||||
|
|
||||||
|
* New release.
|
||||||
|
|
||||||
|
-- Mathieu Comandon <strycore@gmail.com> Tue, 02 Mar 2010 00:57:57 +0100
|
||||||
|
|
||||||
|
lutris (0.2~public2) lucid; urgency=low
|
||||||
|
|
||||||
|
* New release.
|
||||||
|
|
||||||
|
-- Mathieu Comandon <strycore@gmail.com> Tue, 02 Mar 2010 00:54:43 +0100
|
||||||
|
|
||||||
lutris (0.2~public2) lucid; urgency=low
|
lutris (0.2~public2) lucid; urgency=low
|
||||||
|
|
||||||
* New release.
|
* New release.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=Lutris
|
Name=Lutris
|
||||||
Comment=Lutris application
|
Comment=Lutris application
|
||||||
Categories=GNOME;Utility;
|
Categories=GNOME;Games;
|
||||||
Exec=lutris
|
Exec=lutris
|
||||||
Icon=/usr/share/lutris/media/icon.png
|
Icon=/usr/share/lutris/media/lutris.svg
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|
|
@ -159,13 +159,11 @@ class LutrisConfig():
|
||||||
|
|
||||||
|
|
||||||
def get_path(self,runner):
|
def get_path(self,runner):
|
||||||
if self.config is None:
|
if "system" in self.config:
|
||||||
return os.path.expanduser("~")
|
if "game_path" in self.config["system"]:
|
||||||
if runner in self.config:
|
return self.config["system"]["game_path"]
|
||||||
if "game_path" in self.config[runner]:
|
logging.debug("Fail !")
|
||||||
return self.config[runner]["game_path"]
|
logging.debug(self.config)
|
||||||
if "game_path" in self.config:
|
|
||||||
return self.config["game_path"]
|
|
||||||
return os.path.expanduser("~")
|
return os.path.expanduser("~")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,6 +173,7 @@ class ConfigVBox(gtk.VBox):
|
||||||
file_chooser.set_size_request(200,30)
|
file_chooser.set_size_request(200,30)
|
||||||
|
|
||||||
file_chooser.set_action(gtk.FILE_CHOOSER_ACTION_OPEN)
|
file_chooser.set_action(gtk.FILE_CHOOSER_ACTION_OPEN)
|
||||||
|
file_chooser.set_current_folder("/media/seagate300")
|
||||||
file_chooser.set_current_folder(self.lutris_config.get_path(self.runner_class))
|
file_chooser.set_current_folder(self.lutris_config.get_path(self.runner_class))
|
||||||
file_chooser.connect("file-set",self.on_chooser_file_set,option_name)
|
file_chooser.connect("file-set",self.on_chooser_file_set,option_name)
|
||||||
if value:
|
if value:
|
||||||
|
@ -199,8 +200,6 @@ class ConfigVBox(gtk.VBox):
|
||||||
|
|
||||||
def on_chooser_file_set(self,filechooser_widget,option):
|
def on_chooser_file_set(self,filechooser_widget,option):
|
||||||
filename = filechooser_widget.get_filename()
|
filename = filechooser_widget.get_filename()
|
||||||
logging.debug(self.save_in_key)
|
|
||||||
logging.debug(self.lutris_config.config)
|
|
||||||
self.real_config[self.save_in_key][option] = filename
|
self.real_config[self.save_in_key][option] = filename
|
||||||
|
|
||||||
def generate_multiple_file_chooser(self,option_name,label,value=None):
|
def generate_multiple_file_chooser(self,option_name,label,value=None):
|
||||||
|
|
|
@ -55,15 +55,15 @@ class LutrisGame():
|
||||||
self.runner_name = self.game_config["runner"]
|
self.runner_name = self.game_config["runner"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print "Error in %s config file : No runner" % self.name
|
print "Error in %s config file : No runner" % self.name
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
self.machine = eval(self.runner_name+"."+self.runner_name+"(self.game_config)")
|
self.machine = eval(self.runner_name+"."+self.runner_name+"(self.game_config)")
|
||||||
except AttributeError,msg:
|
except AttributeError,msg:
|
||||||
logging.error("Malformed configuration file : %s" % self.name)
|
logging.error("Malformed configuration file (Attribute Error) : %s" % self.name)
|
||||||
logging.error(msg)
|
logging.error(msg)
|
||||||
return False
|
return False
|
||||||
except KeyError,msg:
|
except KeyError,msg:
|
||||||
logging.error("Malformed configuration file : %s" % self.name)
|
logging.error("Malformed configuration file (Key Error) : %s" % self.name)
|
||||||
logging.error(msg)
|
logging.error(msg)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('/home/strider/Devel/lutris')
|
import logging
|
||||||
|
#sys.path.append('/home/strider/Devel/lutris')
|
||||||
|
|
||||||
from lutris.config import LutrisConfig
|
from lutris.config import LutrisConfig
|
||||||
|
|
||||||
|
@ -29,71 +30,105 @@ class FtpDialog(gtk.Dialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
gtk.Dialog.__init__(self)
|
gtk.Dialog.__init__(self)
|
||||||
self.set_title("FTP Manager")
|
self.set_title("FTP Manager")
|
||||||
self.set_size_request(600,500)
|
|
||||||
self.connect("destroy", self.destroy_cb)
|
self.connect("destroy", self.destroy_cb)
|
||||||
self.main_hbox = gtk.HBox()
|
self.main_hbox = gtk.HBox()
|
||||||
self.vbox.pack_start(self.main_hbox)
|
self.vbox.pack_start(self.main_hbox)
|
||||||
|
|
||||||
self.runner_list = gtk.Label("Runner list go here")
|
|
||||||
self.main_hbox.pack_start(self.runner_list)
|
|
||||||
|
|
||||||
self.ftp_vbox = gtk.VBox()
|
self.ftp_vbox = gtk.VBox()
|
||||||
self.ftp_vbox.pack_start(gtk.Label("Ftp"),False,False,5)
|
|
||||||
|
|
||||||
destination_label = gtk.Label()
|
destination_label = self.label("FTP settings",bold=True)
|
||||||
destination_label.set_markup("<b>Destination</b>")
|
|
||||||
self.ftp_vbox.pack_start(destination_label,False,False,5)
|
self.ftp_vbox.pack_start(destination_label,False,False,5)
|
||||||
|
|
||||||
label_width = 70
|
|
||||||
label_height = 20
|
|
||||||
|
|
||||||
#Server
|
#Server
|
||||||
server_hbox = gtk.HBox()
|
host_hbox = gtk.HBox()
|
||||||
server_label = gtk.Label("Server")
|
host_label = self.label("Server")
|
||||||
server_label.set_size_request(label_width,label_width)
|
self.host_entry = gtk.Entry()
|
||||||
self.server_entry = gtk.Entry()
|
self.host_entry.connect("grab-focus",self.focus_entry)
|
||||||
server_hbox.pack_start(server_label)
|
host_hbox.pack_start(host_label,False,False,1)
|
||||||
server_hbox.pack_start(self.server_entry)
|
host_hbox.pack_start(self.host_entry,False,False,1)
|
||||||
self.ftp_vbox.pack_start(server_hbox,False,False,2)
|
self.ftp_vbox.pack_start(host_hbox,False,False,2)
|
||||||
|
|
||||||
#login
|
#login
|
||||||
login_hbox = gtk.HBox()
|
login_hbox = gtk.HBox()
|
||||||
login_label = gtk.Label("login")
|
login_label = self.label("Login")
|
||||||
login_label.set_size_request(label_width,label_width)
|
|
||||||
self.login_entry = gtk.Entry()
|
self.login_entry = gtk.Entry()
|
||||||
login_hbox.pack_start(login_label)
|
self.login_entry.connect("grab-focus",self.focus_entry)
|
||||||
login_hbox.pack_start(self.login_entry)
|
login_hbox.pack_start(login_label,False,False,1)
|
||||||
|
login_hbox.pack_start(self.login_entry,False,False,1)
|
||||||
self.ftp_vbox.pack_start(login_hbox,False,False,2)
|
self.ftp_vbox.pack_start(login_hbox,False,False,2)
|
||||||
|
|
||||||
#password
|
#password
|
||||||
password_hbox = gtk.HBox()
|
password_hbox = gtk.HBox()
|
||||||
password_label = gtk.Label("password")
|
password_label = self.label("Password")
|
||||||
password_label.set_size_request(label_width,label_width)
|
|
||||||
self.password_entry = gtk.Entry()
|
self.password_entry = gtk.Entry()
|
||||||
password_hbox.pack_start(password_label)
|
self.password_entry.set_visibility(False)
|
||||||
password_hbox.pack_start(self.password_entry)
|
password_hbox.pack_start(password_label,False,False,1)
|
||||||
|
password_hbox.pack_start(self.password_entry,False,False,1)
|
||||||
self.ftp_vbox.pack_start(password_hbox,False,False,2)
|
self.ftp_vbox.pack_start(password_hbox,False,False,2)
|
||||||
|
|
||||||
#folder
|
#folder
|
||||||
folder_hbox = gtk.HBox()
|
folder_hbox = gtk.HBox()
|
||||||
folder_label = gtk.Label("folder")
|
folder_label = self.label("Folder")
|
||||||
folder_label.set_size_request(label_width,label_width)
|
|
||||||
self.folder_entry = gtk.Entry()
|
self.folder_entry = gtk.Entry()
|
||||||
folder_hbox.pack_start(folder_label)
|
folder_hbox.pack_start(folder_label,False,False,1)
|
||||||
folder_hbox.pack_start(self.folder_entry)
|
folder_hbox.pack_start(self.folder_entry,False,False,1)
|
||||||
self.ftp_vbox.pack_start(folder_hbox,False,False,2)
|
self.ftp_vbox.pack_start(folder_hbox,False,False,2)
|
||||||
|
|
||||||
|
#Runner list
|
||||||
|
runner_hbox = gtk.HBox()
|
||||||
|
runner_label = self.label("Runner")
|
||||||
|
runner_hbox.pack_start(runner_label,False,False,1)
|
||||||
|
self.ftp_vbox.pack_start(runner_hbox,False,False,2)
|
||||||
|
|
||||||
#Destination
|
#Destination
|
||||||
self.destination_entry = gtk.Entry()
|
self.destination_entry = gtk.Entry()
|
||||||
self.ftp_vbox.pack_start(self.destination_entry,False,False,5)
|
self.ftp_vbox.pack_start(self.destination_entry,False,False,2)
|
||||||
|
|
||||||
|
#Connect button
|
||||||
|
self.connect_button = gtk.Button("Connect")
|
||||||
|
self.connect_button.connect("clicked",self.connect_ftp)
|
||||||
|
self.ftp_vbox.pack_start(self.connect_button,False,False,2)
|
||||||
|
|
||||||
|
self.main_hbox.pack_start(self.ftp_vbox,False,False,2)
|
||||||
|
|
||||||
|
|
||||||
self.main_hbox.pack_start(self.ftp_vbox,False,False,5)
|
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
|
||||||
self.load_runner_config()
|
self.load_runner_config()
|
||||||
|
|
||||||
|
def label(self,text,bold=False,x=70,y=20):
|
||||||
|
label = gtk.Label()
|
||||||
|
if bold:
|
||||||
|
label.set_markup("<b>%s</b>" % text)
|
||||||
|
else:
|
||||||
|
label.set_markup("%s" % text)
|
||||||
|
label.set_size_request(x,y)
|
||||||
|
label.set_alignment(0,0.5)
|
||||||
|
label.set_padding(5,5)
|
||||||
|
return label
|
||||||
|
|
||||||
def destroy_cb(self,widget):
|
def destroy_cb(self,widget):
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
||||||
|
def focus_entry(self,widget,data=None):
|
||||||
|
widget.modify_base(gtk.STATE_NORMAL,gtk.gdk.Color("#FFFFFF"))
|
||||||
|
|
||||||
|
def connect_ftp(self,widget,data=None):
|
||||||
|
validate_widgets = [self.host_entry, self.login_entry]
|
||||||
|
valid = True
|
||||||
|
for val_widget in validate_widgets:
|
||||||
|
print val_widget
|
||||||
|
if not val_widget.get_text():
|
||||||
|
val_widget.modify_base(gtk.STATE_NORMAL,gtk.gdk.Color("#FF0000"))
|
||||||
|
valid = False
|
||||||
|
if valid == False:
|
||||||
|
return False
|
||||||
|
host = self.host_entry.get_text()
|
||||||
|
if not host:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
logging.debug("Host : %s" % self.host_entry.get_text() )
|
||||||
|
self.host_entry.modify_base(gtk.STATE_NORMAL,gtk.gdk.Color("#FF0000"))
|
||||||
|
|
||||||
def load_runner_config(self,runner_name = "sdlmame"):
|
def load_runner_config(self,runner_name = "sdlmame"):
|
||||||
lutris_config = LutrisConfig(runner=runner_name)
|
lutris_config = LutrisConfig(runner=runner_name)
|
||||||
|
@ -101,5 +136,4 @@ class FtpDialog(gtk.Dialog):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
FtpDialog()
|
FtpDialog()
|
||||||
gtk.main()
|
gtk.main()
|
||||||
|
|
|
@ -24,8 +24,8 @@ import runners
|
||||||
from lutris.config_vbox import ConfigVBox
|
from lutris.config_vbox import ConfigVBox
|
||||||
|
|
||||||
class InstallerConfigVBox(ConfigVBox):
|
class InstallerConfigVBox(ConfigVBox):
|
||||||
def __init__(self,lutris_config):
|
def __init__(self,lutris_config,caller):
|
||||||
ConfigVBox.__init__(self,"game")
|
ConfigVBox.__init__(self,"game",caller)
|
||||||
self.lutris_config = lutris_config
|
self.lutris_config = lutris_config
|
||||||
self.lutris_config.config_type = "game"
|
self.lutris_config.config_type = "game"
|
||||||
self.runner_class = self.lutris_config.runner
|
self.runner_class = self.lutris_config.runner
|
||||||
|
|
|
@ -92,7 +92,7 @@ class InstallerDialog(gtk.Dialog):
|
||||||
self.notebook.append_page(self.runner_config_scrolled_window,gtk.Label("Runner configuration"))
|
self.notebook.append_page(self.runner_config_scrolled_window,gtk.Label("Runner configuration"))
|
||||||
|
|
||||||
#System configuration
|
#System configuration
|
||||||
self.system_config_vbox = SystemConfigVBox(self.lutris_config)
|
self.system_config_vbox = SystemConfigVBox(self.lutris_config,"game")
|
||||||
self.system_config_scrolled_window = gtk.ScrolledWindow()
|
self.system_config_scrolled_window = gtk.ScrolledWindow()
|
||||||
self.system_config_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
|
self.system_config_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
|
||||||
self.system_config_scrolled_window.add_with_viewport(self.system_config_vbox)
|
self.system_config_scrolled_window.add_with_viewport(self.system_config_vbox)
|
||||||
|
@ -119,6 +119,7 @@ class InstallerDialog(gtk.Dialog):
|
||||||
|
|
||||||
#Run the installer
|
#Run the installer
|
||||||
runner = eval("runners."+self.runner_class+"."+self.runner_class+"()")
|
runner = eval("runners."+self.runner_class+"."+self.runner_class+"()")
|
||||||
|
self.lutris_config.update_global_config()
|
||||||
command = runner.get_install_command(self.lutris_config.config["game"]["installer"])
|
command = runner.get_install_command(self.lutris_config.config["game"]["installer"])
|
||||||
if command:
|
if command:
|
||||||
logging.debug("Running installer : %s" % command)
|
logging.debug("Running installer : %s" % command)
|
||||||
|
@ -131,7 +132,6 @@ class InstallerDialog(gtk.Dialog):
|
||||||
#self.game_info = {"Game Name": realname,"Runner": self.runner_class , "name": game_identifier}
|
#self.game_info = {"Game Name": realname,"Runner": self.runner_class , "name": game_identifier}
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
||||||
|
|
||||||
def on_runner_changed(self,widget):
|
def on_runner_changed(self,widget):
|
||||||
selected_runner = widget.get_active()
|
selected_runner = widget.get_active()
|
||||||
scroll_windows_children = [self.installer_config_scrolled_window.get_children(),self.runner_config_scrolled_window.get_children(),self.system_config_scrolled_window.get_children()]
|
scroll_windows_children = [self.installer_config_scrolled_window.get_children(),self.runner_config_scrolled_window.get_children(),self.system_config_scrolled_window.get_children()]
|
||||||
|
@ -148,17 +148,17 @@ class InstallerDialog(gtk.Dialog):
|
||||||
logging.debug("loading config before adding game : ")
|
logging.debug("loading config before adding game : ")
|
||||||
logging.debug(self.lutris_config.config)
|
logging.debug(self.lutris_config.config)
|
||||||
#Load game box
|
#Load game box
|
||||||
self.installer_config_vbox = InstallerConfigVBox(self.lutris_config)
|
self.installer_config_vbox = InstallerConfigVBox(self.lutris_config,"game")
|
||||||
self.installer_config_scrolled_window.add_with_viewport(self.installer_config_vbox)
|
self.installer_config_scrolled_window.add_with_viewport(self.installer_config_vbox)
|
||||||
self.installer_config_scrolled_window.show_all()
|
self.installer_config_scrolled_window.show_all()
|
||||||
|
|
||||||
#Load runner box
|
#Load runner box
|
||||||
self.runner_options_vbox = RunnerConfigVBox(self.lutris_config)
|
self.runner_options_vbox = RunnerConfigVBox(self.lutris_config,"game")
|
||||||
self.runner_config_scrolled_window.add_with_viewport(self.runner_options_vbox)
|
self.runner_config_scrolled_window.add_with_viewport(self.runner_options_vbox)
|
||||||
self.runner_config_scrolled_window.show_all()
|
self.runner_config_scrolled_window.show_all()
|
||||||
|
|
||||||
#Load system box
|
#Load system box
|
||||||
self.system_config_vbox = SystemConfigVBox(self.lutris_config)
|
self.system_config_vbox = SystemConfigVBox(self.lutris_config,"game")
|
||||||
self.system_config_scrolled_window.add_with_viewport(self.system_config_vbox)
|
self.system_config_scrolled_window.add_with_viewport(self.system_config_vbox)
|
||||||
self.system_config_scrolled_window.show_all()
|
self.system_config_scrolled_window.show_all()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2010-02-21 00:42+0100\n"
|
"POT-Creation-Date: 2010-03-02 00:58+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -37,69 +37,73 @@ msgid "Fullscreen"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:4
|
#: ../data/ui/LutrisWindow.ui.h:4
|
||||||
msgid "Global preferences"
|
msgid "Get games from FTP"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:5
|
#: ../data/ui/LutrisWindow.ui.h:5
|
||||||
msgid "Import"
|
msgid "Global preferences"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:6
|
#: ../data/ui/LutrisWindow.ui.h:6
|
||||||
msgid "Import games from ScummVM"
|
msgid "Import"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:7
|
#: ../data/ui/LutrisWindow.ui.h:7
|
||||||
msgid "Install and configure runners"
|
msgid "Import games from ScummVM"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:8
|
#: ../data/ui/LutrisWindow.ui.h:8
|
||||||
msgid "Install game"
|
msgid "Install and configure runners"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:9
|
#: ../data/ui/LutrisWindow.ui.h:9
|
||||||
msgid "Lutris"
|
msgid "Install game"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:10
|
#: ../data/ui/LutrisWindow.ui.h:10
|
||||||
msgid "Manage runners"
|
msgid "Lutris"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:11
|
#: ../data/ui/LutrisWindow.ui.h:11
|
||||||
msgid "Mount ISO"
|
msgid "Manage runners"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:12
|
#: ../data/ui/LutrisWindow.ui.h:12
|
||||||
msgid "Quit"
|
msgid "Mount ISO"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:13
|
#: ../data/ui/LutrisWindow.ui.h:13
|
||||||
msgid "Remove"
|
msgid "Quit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:14
|
#: ../data/ui/LutrisWindow.ui.h:14
|
||||||
msgid "Reset"
|
msgid "Remove"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:15
|
#: ../data/ui/LutrisWindow.ui.h:15
|
||||||
msgid "ScummVM"
|
msgid "Reset"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:16
|
#: ../data/ui/LutrisWindow.ui.h:16
|
||||||
msgid "Steam"
|
msgid "ScummVM"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:17
|
#: ../data/ui/LutrisWindow.ui.h:17
|
||||||
msgid "_Help"
|
msgid "Steam"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:18
|
#: ../data/ui/LutrisWindow.ui.h:18
|
||||||
msgid "_Lutris"
|
msgid "_Help"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:19
|
#: ../data/ui/LutrisWindow.ui.h:19
|
||||||
msgid "_Tools"
|
msgid "_Lutris"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/ui/LutrisWindow.ui.h:20
|
#: ../data/ui/LutrisWindow.ui.h:20
|
||||||
|
msgid "_Tools"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../data/ui/LutrisWindow.ui.h:21
|
||||||
msgid "configure the default options"
|
msgid "configure the default options"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os.path
|
||||||
# -*- coding:Utf-8 -*-
|
# -*- coding:Utf-8 -*-
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## Lutris
|
## Lutris
|
||||||
|
@ -30,23 +31,29 @@ class sdlmame(Runner):
|
||||||
self.description = "Runs arcade games with SDLMame"
|
self.description = "Runs arcade games with SDLMame"
|
||||||
self.machine = "Arcade"
|
self.machine = "Arcade"
|
||||||
self.is_installable = False
|
self.is_installable = False
|
||||||
|
self.fullscreen = True
|
||||||
self.game_options = [{"option": "file", "type":"single", "name":"rom", "label":"Rom file"}]
|
self.game_options = [{"option": "rom", "type":"single","label":"Rom file"}]
|
||||||
self.runner_options = []
|
self.runner_options = [{"option":"windowed","type":"bool","label":"Windowed"}]
|
||||||
|
|
||||||
if settings:
|
if settings:
|
||||||
self.romdir = settings["path"]
|
self.romdir = os.path.dirname(settings["game"]["rom"])
|
||||||
self.rom = settings["rom"]
|
self.rom = os.path.basename(settings["game"]["rom"])
|
||||||
self.mameconfigdir = os.path.join(os.path.expanduser("~"),".mame")
|
self.mameconfigdir = os.path.join(os.path.expanduser("~"),".mame")
|
||||||
if not os.path.exists(os.path.join(self.mameconfigdir,"mame.ini")):
|
if "sdlmame" in settings.config:
|
||||||
try:
|
if "windowed" in settings["sdlmame"]:
|
||||||
os.makedirs(self.mameconfigdir)
|
self.fullscreen = not settings["sdlmame"]["windowed"]
|
||||||
except OSError:
|
|
||||||
print "mame directory already exists"
|
|
||||||
os.chdir(self.mameconfigdir)
|
|
||||||
subprocess.Popen([self.executable,"-createconfig"],stdout=subprocess.PIPE).communicate()[0]
|
|
||||||
|
|
||||||
|
|
||||||
def play(self):
|
def play(self):
|
||||||
|
if not os.path.exists(os.path.join(self.mameconfigdir,"mame.ini")):
|
||||||
|
try:
|
||||||
|
os.makedirs(self.mameconfigdir)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
os.chdir(self.mameconfigdir)
|
||||||
|
subprocess.Popen([self.executable,"-createconfig"],stdout=subprocess.PIPE).communicate()[0]
|
||||||
os.chdir(self.romdir)
|
os.chdir(self.romdir)
|
||||||
return [self.executable,"-inipath",self.mameconfigdir,"-skip_gameinfo","-rompath",self.romdir,self.rom]
|
arguments = []
|
||||||
|
if not self.fullscreen:
|
||||||
|
arguments = arguments + ["-window"]
|
||||||
|
return [self.executable,"-inipath",self.mameconfigdir,"-skip_gameinfo","-rompath",self.romdir,self.rom] + arguments
|
2
setup.py
2
setup.py
|
@ -63,7 +63,7 @@ def update_desktop_file(datadir):
|
||||||
|
|
||||||
for line in fin:
|
for line in fin:
|
||||||
if 'Icon=' in line:
|
if 'Icon=' in line:
|
||||||
line = "Icon=%s\n" % (datadir + 'media/icon.png')
|
line = "Icon=%s\n" % (datadir + 'media/lutris.svg')
|
||||||
fout.write(line)
|
fout.write(line)
|
||||||
fout.flush()
|
fout.flush()
|
||||||
fout.close()
|
fout.close()
|
||||||
|
|
Loading…
Reference in a new issue