-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf ui: Complete the breakdown of util/newt.c
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
- Loading branch information
Arnaldo Carvalho de Melo
committed
Aug 10, 2010
1 parent
d1b4f24
commit 1e6dd07
Showing
10 changed files
with
96 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <newt.h> | ||
#include <signal.h> | ||
#include <stdbool.h> | ||
|
||
#include "../cache.h" | ||
#include "../debug.h" | ||
#include "browser.h" | ||
#include "helpline.h" | ||
|
||
static void newt_suspend(void *d __used) | ||
{ | ||
newtSuspend(); | ||
raise(SIGTSTP); | ||
newtResume(); | ||
} | ||
|
||
void setup_browser(void) | ||
{ | ||
if (!isatty(1) || !use_browser || dump_trace) { | ||
use_browser = 0; | ||
setup_pager(); | ||
return; | ||
} | ||
|
||
use_browser = 1; | ||
newtInit(); | ||
newtCls(); | ||
newtSetSuspendCallback(newt_suspend, NULL); | ||
ui_helpline__init(); | ||
ui_browser__init(); | ||
} | ||
|
||
void exit_browser(bool wait_for_ok) | ||
{ | ||
if (use_browser > 0) { | ||
if (wait_for_ok) { | ||
char title[] = "Fatal Error", ok[] = "Ok"; | ||
newtWinMessage(title, ok, ui_helpline__last_msg); | ||
} | ||
newtFinished(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef _PERF_UI_UTIL_H_ | ||
#define _PERF_UI_UTIL_H_ 1 | ||
|
||
#include <stdbool.h> | ||
|
||
int ui__popup_menu(int argc, char * const argv[]); | ||
int ui__help_window(const char *text); | ||
bool ui__dialog_yesno(const char *msg); | ||
|
||
#endif /* _PERF_UI_UTIL_H_ */ |