diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-03-21 00:19:02 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-03-21 00:19:02 +0100 |
commit | 5ebed0cd5dc2eb2f71e18b24148903f3c10ebf69 (patch) | |
tree | 8da511b975aea9f8e8eb081993a761031a1996e2 /SConstruct | |
parent | b6b63a3c51eab072483ac0c7ad07f107bb790788 (diff) |
Implemented a very basic configuration dialog.
This code is a bit hackish, all configuration options should be
collected in a single place (eg. a config struct) in order to
easily keep track of all configuration options.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -36,10 +36,11 @@ env.ParseConfig('pkg-config --cflags --libs gthread-2.0') def build_ui(target, source, env): f = open(str(target[0]), 'w') - f.write('#ifndef _WALLS_UI_H_\n') - f.write('#define _WALLS_UI_H_\n') + uiname = str(target[0]).rsplit('.', 1)[0] + f.write('#ifndef _%s_H_\n' % uiname.upper()) + f.write('#define _%s_H_\n' % uiname.upper()) f.write('#include <gtk/gtk.h>\n') - f.write('gchar *%s_string = \n' % str(target[0]).rsplit('.', 1)[0]) + f.write('gchar *%s_string = \n' % uiname) for line in open(str(source[0]), 'r'): f.write('"%s"\n' % line.replace('"', '\\"').strip()) f.write(';\n') @@ -50,6 +51,7 @@ ui_builder = Builder(action = build_ui) env['BUILDERS']['walls_ui'] = ui_builder env.walls_ui('walls_ui.h', 'walls.ui') env.walls_ui('tags_ui.h', 'tags.ui') +env.walls_ui('config_ui.h', 'config.ui') walls = env.Program('walls', Glob('*.c')) destdir = ARGUMENTS.get('DESTDIR', '') |