Accepted scots improved options patch
This commit is contained in:
parent
69bd6ba6bc
commit
1b2e04ee75
|
@ -1,6 +1,7 @@
|
||||||
========================== version 0.5.2 ========================
|
========================== version 0.5.2 ========================
|
||||||
Cleanup:
|
Cleanup:
|
||||||
* Fixed silly hack when forcing GTK event processing.
|
* Fixed silly hack when forcing GTK event processing.
|
||||||
|
* Accepted patch from Scott Brown on improved options file system
|
||||||
========================== version 0.5.1 ========================
|
========================== version 0.5.1 ========================
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
* Updated chooser filters
|
* Updated chooser filters
|
||||||
|
|
35
gfceu
35
gfceu
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# gfceu - Graphical launcher for FCE Ultra.
|
# gfceu - Graphical launcher for FCE Ultra.
|
||||||
# Designed on Ubuntu, with platfrom independence in mind.
|
# Designed on Ubuntu, with platfrom independence in mind.
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
# Copyright (C) 2006 Lukas Sabota <punkrockguy318@comcast.net>
|
# Copyright (C) 2006 Lukas Sabota <punkrockguy318@comcast.net>
|
||||||
##
|
##
|
||||||
"""
|
"""
|
||||||
|
@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import pickle
|
import pickle
|
||||||
|
import shutil
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from subprocess import Popen
|
from subprocess import Popen
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ def load_options():
|
||||||
ifile.close()
|
ifile.close()
|
||||||
|
|
||||||
def save_options():
|
def save_options():
|
||||||
global options, optionsfile
|
global options, optionsfile, appconfigdir
|
||||||
ofile = file(optionsfile, 'w')
|
ofile = file(optionsfile, 'w')
|
||||||
pickle.dump(options, ofile)
|
pickle.dump(options, ofile)
|
||||||
ofile.close()
|
ofile.close()
|
||||||
|
@ -176,6 +177,30 @@ def give_widgets():
|
||||||
options = game_options()
|
options = game_options()
|
||||||
give_widgets()
|
give_widgets()
|
||||||
|
|
||||||
|
def setup_environment ():
|
||||||
|
"""
|
||||||
|
Configures the environment if this is the first time the application
|
||||||
|
has been run. For instance, it checks for the options file and creates
|
||||||
|
it if it doesn't exist. It also converts between the old version and
|
||||||
|
the new version of this application, which stores the options file in
|
||||||
|
a separate directory.
|
||||||
|
"""
|
||||||
|
|
||||||
|
global appconfigdir, old_optionsfile, optionsfile
|
||||||
|
|
||||||
|
|
||||||
|
if not os.path.exists(appconfigdir):
|
||||||
|
# this is the first time the application is run.
|
||||||
|
# create the directory
|
||||||
|
gfceu_message("Creating application settings directory")
|
||||||
|
os.mkdir(appconfigdir)
|
||||||
|
|
||||||
|
if os.path.exists(old_optionsfile):
|
||||||
|
# for full backwards compatibility, this file is processed, but moved
|
||||||
|
# to the new directory and filename for future compatibility
|
||||||
|
gfceu_message("Old version of options file found, converting to new version")
|
||||||
|
shutil.move(old_optionsfile,optionsfile)
|
||||||
|
|
||||||
def set_options():
|
def set_options():
|
||||||
"""
|
"""
|
||||||
set_options()
|
set_options()
|
||||||
|
@ -472,7 +497,9 @@ def no_network_radio_clicked(arg1):
|
||||||
# Globals
|
# Globals
|
||||||
xml = None
|
xml = None
|
||||||
options = None
|
options = None
|
||||||
optionsfile = os.getenv('HOME')+'/.gfceu_options'
|
appconfigdir = os.getenv('HOME') + '/.gfceu'
|
||||||
|
old_optionsfile = os.getenv('HOME')+'/.gfceu_options'
|
||||||
|
optionsfile = appconfigdir + 'gfceu_options.dat'
|
||||||
fceu_binary = None
|
fceu_binary = None
|
||||||
fceu_server_binary = None
|
fceu_server_binary = None
|
||||||
#version is defined earlier in the code
|
#version is defined earlier in the code
|
||||||
|
@ -530,7 +557,7 @@ if __name__ == '__main__':
|
||||||
}
|
}
|
||||||
|
|
||||||
xml.signal_autoconnect (dic)
|
xml.signal_autoconnect (dic)
|
||||||
|
setup_environment()
|
||||||
# Set the global options
|
# Set the global options
|
||||||
options = game_options()
|
options = game_options()
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
|
||||||
setup(name="gfceu",
|
setup(name="gfceu",
|
||||||
version="0.5.1",
|
version="0.5.2",
|
||||||
scripts = ['gfceu'],
|
scripts = ['gfceu'],
|
||||||
data_files=[('share/gfceu/',['gfceu.glade', 'gfceu_big.png', 'gfceu.png']),
|
data_files=[('share/gfceu/',['gfceu.glade', 'gfceu_big.png', 'gfceu.png']),
|
||||||
('share/pixmaps/', ['gfceu.png']),
|
('share/pixmaps/', ['gfceu.png']),
|
||||||
|
|
Loading…
Reference in New Issue