summaryrefslogtreecommitdiff
path: root/audio/audtty/patches/04-code_refactoring.patch
diff options
context:
space:
mode:
Diffstat (limited to 'audio/audtty/patches/04-code_refactoring.patch')
-rw-r--r--audio/audtty/patches/04-code_refactoring.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/audio/audtty/patches/04-code_refactoring.patch b/audio/audtty/patches/04-code_refactoring.patch
new file mode 100644
index 0000000000..022d68c7c2
--- /dev/null
+++ b/audio/audtty/patches/04-code_refactoring.patch
@@ -0,0 +1,91 @@
+From ead43f353675d4c8952facf57920ce79533955a6 Mon Sep 17 00:00:00 2001
+From: Chris Taylor <chris@code-monkeys.org>
+Date: Fri, 05 Mar 2010 06:24:05 +0000
+Subject: Code refactoring.
+
+-Split browser creation code off into its own object. update_browser.
+-If exiting from opening creation use update_browser() to repaint browser.
+
+
+Signed-off-by: Chris Taylor <chris@code-monkeys.org>
+---
+diff --git a/browse.c b/browse.c
+index c736e64..232d374 100644
+--- a/browse.c
++++ b/browse.c
+@@ -50,7 +50,7 @@ void add_file(gboolean dir);
+ void remove_win( void );
+ void display_error(gchar *message, gchar *name, gboolean type);
+ void open_directory( void );
+-
++void update_browser(void);
+
+ void file_browser(gint height)
+ {
+@@ -63,28 +63,15 @@ void file_browser(gint height)
+ cont.length = 1;
+ cont.first=0;
+ cont.pos_height=0;
+- clear();
++ clear();
+ refresh();
+-
++
+ browser.location = newwin(1, 0, 0, 0);
+ browser.title = newwin(1, 0, 1, 0);
+ browser.list = newwin(cont.height, 0, 3, 0);
+
+-
+- wcolor_set(browser.location, 1, NULL);
+- wcolor_set(browser.title, 1, NULL);
+- wcolor_set(browser.list, 1, NULL);
+-
+- mvwtitledhline(browser.title, 0, "File Browser");
+- wnoutrefresh(browser.title);
+- wnoutrefresh(browser.list);
+-
+- doupdate();
+-
+-
+- get_contents();
+- browser_paint(&cont);
+-
++ update_browser();
++
+ while((c=getch()))
+ {
+ switch(c)
+@@ -399,7 +386,10 @@ void open_directory( void )
+ get_contents();
+ return;
+ case ENTER:
+- if(strlen(buffer)==0) return;
++ if(strlen(buffer)==0) {
++ update_browser();
++ return;
++ }
+ else {
+ cont.location=g_strdup(buffer);
+ g_chdir(buffer);
+@@ -429,4 +419,18 @@ void open_directory( void )
+ doupdate();
+ }
+ return;
++}
++
++void update_browser(void)
++{
++ wcolor_set(browser.location, 1, NULL);
++ wcolor_set(browser.title, 1, NULL);
++ wcolor_set(browser.list, 1, NULL);
++ mvwtitledhline(browser.title, 0, "File Browser");
++ wnoutrefresh(browser.title);
++ wnoutrefresh(browser.list);
++ doupdate();
++ get_contents();
++ browser_paint(&cont);
++ return;
+ }
+\ No newline at end of file
+--
+cgit v0.8.3.4-115-g1759