1
0
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:
Michael Vetter 2022-07-05 12:23:47 +02:00 committed by GitHub
commit 9605334d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

@ -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 {

View File

@ -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);