Commit e58e61f1 authored by Jeremy White's avatar Jeremy White

Give the user a hint if they do not provide any password.

parent 0716787c
......@@ -123,6 +123,20 @@ void gui_destroy(gui_t *gui)
gui->window = NULL;
}
void gui_report_error(gui_t *gui, const char *message)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW(gui->window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
message);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
#if defined(GUI_MAIN)
#include <locale.h>
#include <string.h>
......
......@@ -49,4 +49,6 @@ void gui_destroy(gui_t *gui);
void gui_remote_connected(gui_t *gui, const char *details);
void gui_remote_disconnected(gui_t *gui);
void gui_report_error(gui_t *gui, const char *message);
#endif
......@@ -98,6 +98,16 @@ int main(int argc, char *argv[])
goto exit;
gui_created = 1;
/*------------------------------------------------------------------------
** Make sure we have a way to operate.
**----------------------------------------------------------------------*/
if (options_impossible_config(&session.options)) {
gui_report_error(&session.gui,
"You must provide some authentication method.\n"
"Refer to the x11spice man page for more details.");
goto exit;
}
/*------------------------------------------------------------------------
** Start up a spice server
**----------------------------------------------------------------------*/
......
......@@ -460,6 +460,20 @@ int options_process_io(options_t *options)
return 0;
}
int options_impossible_config(options_t *options)
{
if (options->spice_password)
return 0;
if (options->generate_password || options->password_file)
return 0;
if (options->disable_ticketing)
return 0;
return 1;
}
#if defined(OPTIONS_MAIN)
int main(int argc, char *argv[])
{
......
......@@ -74,5 +74,6 @@ int options_parse_arguments(int argc, char *argv[], options_t *options);
int options_process_io(options_t *options);
void options_free(options_t *options);
void options_from_config(options_t *options);
int options_impossible_config(options_t *options);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment