From a5d878cdc4363738db31c771dace7c14c4c75d3b Mon Sep 17 00:00:00 2001 From: Nikita Zlobin Date: Sun, 28 Nov 2010 15:14:43 +0500 Subject: [PATCH] gladish: Move help text from code to separate text file --- gui/graph_view.c | 12 ++++-------- gui/help/default.txt | 8 ++++++++ wscript | 5 ++++- 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 gui/help/default.txt diff --git a/gui/graph_view.c b/gui/graph_view.c index b616d2e0..d9fdf36d 100644 --- a/gui/graph_view.c +++ b/gui/graph_view.c @@ -31,6 +31,7 @@ #include "menu.h" #include "../proxies/room_proxy.h" #include "../common/catdup.h" +#include "../common/file.h" struct graph_view { @@ -51,17 +52,12 @@ GtkScrolledWindow * g_main_scrolledwin; static struct graph_view * g_current_view; GtkWidget * g_view_label; -const char * g_view_label_text = - "If you've started ladish for the first time, you should:\n\n" - " 1. Create a new studio (in the menu, Studio -> New Studio)\n" - " 2. Configure JACK (in the menu, Tools -> Configure JACK)\n" - " 3. Start the studio (in the menu, Studio -> Start Studio)\n" - " 4. Start apps (in the menu, Application -> Run)\n" - " 5. Connect their ports by click & drag on canvas\n" - " 6. Save the studio (in the menu, Studio -> Save Studio)\n"; +const char * g_view_label_text = NULL; void view_init(void) { + g_view_label_text = read_file_contents(DATA_DIR "/help/default.txt"); + g_main_scrolledwin = GTK_SCROLLED_WINDOW(get_gtk_builder_widget("main_scrolledwin")); INIT_LIST_HEAD(&g_views); diff --git a/gui/help/default.txt b/gui/help/default.txt new file mode 100644 index 00000000..ff7f716c --- /dev/null +++ b/gui/help/default.txt @@ -0,0 +1,8 @@ +If you've started ladish for the first time, you should: + + 1. Create a new studio (in the menu, Studio -> New Studio) + 2. Configure JACK (in the menu, Tools -> Configure JACK) + 3. Start the studio (in the menu, Studio -> Start Studio) + 4. Start apps (in the menu, Application -> Run) + 5. Connect their ports by click & drag on canvas + 6. Save the studio (in the menu, Studio -> Save Studio) diff --git a/wscript b/wscript index 702cabf8..e1781e3b 100644 --- a/wscript +++ b/wscript @@ -546,7 +546,10 @@ def build(bld): # GtkBuilder UI definitions (XML) bld.install_files('${DATA_DIR}', 'gui/gladish.ui') - + + # Help text + bld.install_files('${DATA_DIR}/help', 'gui/help/default.txt') + bld.install_files('${PREFIX}/bin', 'ladish_control', chmod=0755) # 'Desktop' file (menu entry, icon, etc)