mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Merge pull request #1735 from profanity-im/feat/first-start
Display a help message upon first start of Profanity
This commit is contained in:
commit
9605334d5a
@ -265,7 +265,6 @@ prefs_reload(void)
|
||||
void
|
||||
prefs_load(char* config_file)
|
||||
{
|
||||
|
||||
if (config_file == NULL) {
|
||||
prefs_loc = files_get_config_path(FILE_PROFRC);
|
||||
} else {
|
||||
|
@ -54,6 +54,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "log.h"
|
||||
#include "config/files.h"
|
||||
#include "config/preferences.h"
|
||||
#include "config/theme.h"
|
||||
#include "command/cmd_defs.h"
|
||||
@ -391,6 +392,27 @@ cons_show_incoming_private_message(const char* const nick, const char* const roo
|
||||
free(priv_show);
|
||||
}
|
||||
|
||||
static void
|
||||
_cons_welcome_first_start(void)
|
||||
{
|
||||
gchar* prefs_loc = files_get_config_path(FILE_PROFANITY_IDENTIFIER);
|
||||
if (!g_file_test(prefs_loc, G_FILE_TEST_EXISTS)) {
|
||||
ProfWin* console = wins_get_console();
|
||||
win_println(console, THEME_DEFAULT, "-", "This seems to be your first time starting Profanity.");
|
||||
win_println(console, THEME_DEFAULT, "-", "");
|
||||
win_println(console, THEME_DEFAULT, "-", "You can connect to an existing XMPP account via /connect myjid@domain.org.");
|
||||
win_println(console, THEME_DEFAULT, "-", "If you plan to connect to this XMPP account regularly we suggest you set up an account:");
|
||||
win_println(console, THEME_DEFAULT, "-", "/account add myaccount");
|
||||
win_println(console, THEME_DEFAULT, "-", "/account set myaccount jid myjid@domain.org");
|
||||
win_println(console, THEME_DEFAULT, "-", "See /help account for more details.");
|
||||
win_println(console, THEME_DEFAULT, "-", "");
|
||||
win_println(console, THEME_DEFAULT, "-", "If you want to register a new XMPP account with a server use:");
|
||||
win_println(console, THEME_DEFAULT, "-", "/register myjid myserver.org");
|
||||
win_println(console, THEME_DEFAULT, "-", "");
|
||||
}
|
||||
g_free(prefs_loc);
|
||||
}
|
||||
|
||||
void
|
||||
cons_about(void)
|
||||
{
|
||||
@ -427,6 +449,8 @@ cons_about(void)
|
||||
cons_check_version(FALSE);
|
||||
}
|
||||
|
||||
_cons_welcome_first_start();
|
||||
|
||||
pnoutrefresh(console->layout->win, 0, 0, 1, 0, rows - 3, cols - 1);
|
||||
|
||||
cons_alert(NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user