mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Added /about command
Useful for showing version
This commit is contained in:
parent
907b5cf801
commit
d19afc3507
@ -61,6 +61,7 @@ static gboolean _cmd_set_boolean_preference(const char * const inp,
|
|||||||
// command prototypes
|
// command prototypes
|
||||||
static gboolean _cmd_quit(const char * const inp, struct cmd_help_t help);
|
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_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_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_who(const char * const inp, struct cmd_help_t help);
|
||||||
static gboolean _cmd_connect(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,
|
_cmd_help,
|
||||||
{ "/help [area|command]", "Show help summary, or help on a specific area or command",
|
{ "/help [area|command]", "Show help summary, or help on a specific area or command",
|
||||||
{ "/help [area|command]",
|
{ "/help [area|command]",
|
||||||
"---------------",
|
"--------------------",
|
||||||
"Show help options.",
|
"Show help options.",
|
||||||
"Specify an area (basic, status, settings, navigation) for more help on that area.",
|
"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.",
|
"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",
|
"Example : /help settings",
|
||||||
NULL } } },
|
NULL } } },
|
||||||
|
|
||||||
|
{ "/about",
|
||||||
|
_cmd_about,
|
||||||
|
{ "/about", "About Profanity",
|
||||||
|
{ "/about",
|
||||||
|
"------",
|
||||||
|
"Show versioning and license information.",
|
||||||
|
NULL } } },
|
||||||
|
|
||||||
{ "/connect",
|
{ "/connect",
|
||||||
_cmd_connect,
|
_cmd_connect,
|
||||||
{ "/connect user@host", "Login to jabber.",
|
{ "/connect user@host", "Login to jabber.",
|
||||||
@ -594,6 +603,13 @@ _cmd_help(const char * const inp, struct cmd_help_t help)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_cmd_about(const char * const inp, struct cmd_help_t help)
|
||||||
|
{
|
||||||
|
cons_about();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_cmd_prefs(const char * const inp, struct cmd_help_t help)
|
_cmd_prefs(const char * const inp, struct cmd_help_t help)
|
||||||
{
|
{
|
||||||
|
1
src/ui.h
1
src/ui.h
@ -103,6 +103,7 @@ void win_bad_show(const char * const msg);
|
|||||||
void win_remind(void);
|
void win_remind(void);
|
||||||
|
|
||||||
// console window actions
|
// console window actions
|
||||||
|
void cons_about(void);
|
||||||
void cons_help(void);
|
void cons_help(void);
|
||||||
void cons_basic_help(void);
|
void cons_basic_help(void);
|
||||||
void cons_settings_help(void);
|
void cons_settings_help(void);
|
||||||
|
@ -648,6 +648,7 @@ cons_navigation_help(void)
|
|||||||
cons_show("F2-F10 : Chat windows.");
|
cons_show("F2-F10 : Chat windows.");
|
||||||
cons_show("UP, DOWN : Navigate input history.");
|
cons_show("UP, DOWN : Navigate input history.");
|
||||||
cons_show("LEFT, RIGHT, HOME, END : Edit current input.");
|
cons_show("LEFT, RIGHT, HOME, END : Edit current input.");
|
||||||
|
cons_show("ESC : Clear current input.");
|
||||||
cons_show("TAB : Autocomplete command/recipient/login");
|
cons_show("TAB : Autocomplete command/recipient/login");
|
||||||
cons_show("PAGE UP, PAGE DOWN : Page the main window.");
|
cons_show("PAGE UP, PAGE DOWN : Page the main window.");
|
||||||
cons_show("");
|
cons_show("");
|
||||||
@ -772,8 +773,7 @@ win_page_off(void)
|
|||||||
static void
|
static void
|
||||||
_create_windows(void)
|
_create_windows(void)
|
||||||
{
|
{
|
||||||
int rows, cols;
|
int cols = getmaxx(stdscr);
|
||||||
getmaxyx(stdscr, rows, cols);
|
|
||||||
max_cols = cols;
|
max_cols = cols;
|
||||||
|
|
||||||
// create the console window in 0
|
// create the console window in 0
|
||||||
@ -788,6 +788,31 @@ _create_windows(void)
|
|||||||
scrollok(cons.win, TRUE);
|
scrollok(cons.win, TRUE);
|
||||||
|
|
||||||
_wins[0] = cons;
|
_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;
|
_cons_win = _wins[0].win;
|
||||||
|
|
||||||
if (prefs_get_showsplash()) {
|
if (prefs_get_showsplash()) {
|
||||||
@ -817,21 +842,6 @@ _create_windows(void)
|
|||||||
prefresh(_cons_win, 0, 0, 1, 0, rows-3, cols-1);
|
prefresh(_cons_win, 0, 0, 1, 0, rows-3, cols-1);
|
||||||
|
|
||||||
dirty = TRUE;
|
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
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user