summaryrefslogtreecommitdiffstats
path: root/OpenFilesScreen.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-03-23 15:26:56 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-03-23 15:26:56 -0300
commitd0c72c3fb29d535f5bb12b651e3bcaa516650199 (patch)
tree2c01b7d96d50a7f47334093a1ed8ff4962cec204 /OpenFilesScreen.c
parent1084a3ff8faf3aa98e8e9fbdab97a08a2c40482e (diff)
Move FunctionBar inside Panel
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r--OpenFilesScreen.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c
index 7dfc32a9..168c6c14 100644
--- a/OpenFilesScreen.c
+++ b/OpenFilesScreen.c
@@ -12,6 +12,7 @@ in the source distribution for its full text.
#include "ListItem.h"
#include "IncSet.h"
#include "String.h"
+#include "FunctionBar.h"
#include <string.h>
#include <stdio.h>
@@ -26,7 +27,6 @@ in the source distribution for its full text.
/*{
#include "Process.h"
#include "Panel.h"
-#include "FunctionBar.h"
typedef struct OpenFiles_Data_ {
char* data[256];
@@ -47,21 +47,21 @@ typedef struct OpenFilesScreen_ {
Process* process;
pid_t pid;
Panel* display;
- FunctionBar* bar;
} OpenFilesScreen;
}*/
-static const char* ofsFunctions[] = {"Search ", "Filter ", "Refresh", "Done ", NULL};
+static const char* OpenFilesScreenFunctions[] = {"Search ", "Filter ", "Refresh", "Done ", NULL};
-static const char* ofsKeys[] = {"F3", "F4", "F5", "Esc"};
+static const char* OpenFilesScreenKeys[] = {"F3", "F4", "F5", "Esc"};
-static int ofsEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27};
+static int OpenFilesScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27};
OpenFilesScreen* OpenFilesScreen_new(Process* process) {
OpenFilesScreen* this = (OpenFilesScreen*) malloc(sizeof(OpenFilesScreen));
this->process = process;
- this->display = Panel_new(0, 1, COLS, LINES-3, false, Class(ListItem));
+ FunctionBar* bar = FunctionBar_new(OpenFilesScreenFunctions, OpenFilesScreenKeys, OpenFilesScreenEvents);
+ this->display = Panel_new(0, 1, COLS, LINES-3, false, Class(ListItem), bar);
if (Process_isThread(process))
this->pid = process->tgid;
else
@@ -173,7 +173,7 @@ void OpenFilesScreen_run(OpenFilesScreen* this) {
Panel* panel = this->display;
Panel_setHeader(panel, " FD TYPE DEVICE SIZE NODE NAME");
- FunctionBar* bar = FunctionBar_new(ofsFunctions, ofsKeys, ofsEvents);
+ FunctionBar* bar = panel->defaultBar;
IncSet* inc = IncSet_new(bar);
Vector* lines = Vector_new(panel->items->type, true, DEFAULT_SIZE);
@@ -241,6 +241,5 @@ void OpenFilesScreen_run(OpenFilesScreen* this) {
}
Vector_delete(lines);
- FunctionBar_delete((Object*)bar);
IncSet_delete(inc);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy