1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Added /about command

Useful for showing version
This commit is contained in:
James Booth 2012-10-23 00:18:28 +01:00
parent 907b5cf801
commit d19afc3507
3 changed files with 45 additions and 18 deletions

View File

@ -61,6 +61,7 @@ static gboolean _cmd_set_boolean_preference(const char * const inp,
// command prototypes
static gboolean _cmd_quit(const char * const inp, struct cmd_help_t help);
static gboolean _cmd_help(const char * const inp, struct cmd_help_t help);
static gboolean _cmd_about(const char * const inp, struct cmd_help_t help);
static gboolean _cmd_prefs(const char * const inp, struct cmd_help_t help);
static gboolean _cmd_who(const char * const inp, struct cmd_help_t help);
static gboolean _cmd_connect(const char * const inp, struct cmd_help_t help);
@ -93,7 +94,7 @@ static struct cmd_t main_commands[] =
_cmd_help,
{ "/help [area|command]", "Show help summary, or help on a specific area or command",
{ "/help [area|command]",
"---------------",
"--------------------",
"Show help options.",
"Specify an area (basic, status, settings, navigation) for more help on that area.",
"Specify the command if you want more detailed help on a specific command.",
@ -102,6 +103,14 @@ static struct cmd_t main_commands[] =
"Example : /help settings",
NULL } } },
{ "/about",
_cmd_about,
{ "/about", "About Profanity",
{ "/about",
"------",
"Show versioning and license information.",
NULL } } },
{ "/connect",
_cmd_connect,
{ "/connect user@host", "Login to jabber.",
@ -594,6 +603,13 @@ _cmd_help(const char * const inp, struct cmd_help_t help)
return TRUE;
}
static gboolean
_cmd_about(const char * const inp, struct cmd_help_t help)
{
cons_about();
return TRUE;
}
static gboolean
_cmd_prefs(const char * const inp, struct cmd_help_t help)
{

View File

@ -103,6 +103,7 @@ void win_bad_show(const char * const msg);
void win_remind(void);
// console window actions
void cons_about(void);
void cons_help(void);
void cons_basic_help(void);
void cons_settings_help(void);

View File

@ -648,6 +648,7 @@ cons_navigation_help(void)
cons_show("F2-F10 : Chat windows.");
cons_show("UP, DOWN : Navigate input history.");
cons_show("LEFT, RIGHT, HOME, END : Edit current input.");
cons_show("ESC : Clear current input.");
cons_show("TAB : Autocomplete command/recipient/login");
cons_show("PAGE UP, PAGE DOWN : Page the main window.");
cons_show("");
@ -772,8 +773,7 @@ win_page_off(void)
static void
_create_windows(void)
{
int rows, cols;
getmaxyx(stdscr, rows, cols);
int cols = getmaxx(stdscr);
max_cols = cols;
// create the console window in 0
@ -788,6 +788,31 @@ _create_windows(void)
scrollok(cons.win, TRUE);
_wins[0] = cons;
cons_about();
// create the chat windows
int i;
for (i = 1; i < NUM_WINS; i++) {
struct prof_win chat;
strcpy(chat.from, "");
chat.win = newpad(PAD_SIZE, cols);
wbkgd(chat.win, COLOUR_TEXT);
chat.y_pos = 0;
chat.paged = 0;
chat.unread = 0;
chat.history_shown = 0;
scrollok(chat.win, TRUE);
_wins[i] = chat;
}
}
void
cons_about(void)
{
int rows, cols;
getmaxyx(stdscr, rows, cols);
_cons_win = _wins[0].win;
if (prefs_get_showsplash()) {
@ -817,21 +842,6 @@ _create_windows(void)
prefresh(_cons_win, 0, 0, 1, 0, rows-3, cols-1);
dirty = TRUE;
// create the chat windows
int i;
for (i = 1; i < NUM_WINS; i++) {
struct prof_win chat;
strcpy(chat.from, "");
chat.win = newpad(PAD_SIZE, cols);
wbkgd(chat.win, COLOUR_TEXT);
chat.y_pos = 0;
chat.paged = 0;
chat.unread = 0;
chat.history_shown = 0;
scrollok(chat.win, TRUE);
_wins[i] = chat;
}
}
static void