Commit 865d80d9027832b55c41b71b91838b22ec5f6e88
1 parent
9260d4df
Exists in
develop
Fixing win32 build, validating system settings on startup.
Showing
3 changed files
with
28 additions
and
5 deletions
Show diff stats
Makefile.in
| ... | ... | @@ -29,7 +29,7 @@ datarootdir=@datarootdir@ |
| 29 | 29 | localedir=@localedir@ |
| 30 | 30 | docdir=@docdir@ |
| 31 | 31 | sysconfdir=@sysconfdir@ |
| 32 | -datadir=$(datarootdir)/@PRODUCT_NAME@ | |
| 32 | +datadir="$(datarootdir)/@PRODUCT_NAME@" | |
| 33 | 33 | |
| 34 | 34 | #---[ Configuration ]-------------------------------------------------------------------- |
| 35 | 35 | |
| ... | ... | @@ -97,7 +97,6 @@ CFLAGS= \ |
| 97 | 97 | -Isrc/include \ |
| 98 | 98 | -I$(srcdir)/src/include \ |
| 99 | 99 | -DBUILD_DATE=`date +%Y%m%d` \ |
| 100 | - -DDATADIR=$(datadir) \ | |
| 101 | 100 | @LIBV3270_CFLAGS@ \ |
| 102 | 101 | @GTK_CFLAGS@ |
| 103 | 102 | ... | ... |
configure.ac
| ... | ... | @@ -107,7 +107,7 @@ case "$host" in |
| 107 | 107 | app_cv_osname="linux" |
| 108 | 108 | app_rls_ldflags="" |
| 109 | 109 | |
| 110 | - CFLAGS="$CFLAGS -pthread -DLIBDIR=\$(libdir)" | |
| 110 | + CFLAGS="$CFLAGS -pthread -DLIBDIR=\$(libdir) -DDATADIR=\$(datadir)" | |
| 111 | 111 | LDFLAGS="$LDFLAGS -pthread" |
| 112 | 112 | AC_SUBST(DEFAULT_UI_STYLE,0) |
| 113 | 113 | ... | ... |
src/objects/application/application.c
| ... | ... | @@ -430,8 +430,6 @@ void startup(GApplication *application) { |
| 430 | 430 | |
| 431 | 431 | G_APPLICATION_CLASS(pw3270Application_parent_class)->startup(application); |
| 432 | 432 | |
| 433 | -// GSettings *settings = pw3270_application_get_settings(application); | |
| 434 | - | |
| 435 | 433 | // |
| 436 | 434 | // Common actions |
| 437 | 435 | // |
| ... | ... | @@ -525,6 +523,32 @@ void activate(GApplication *application) { |
| 525 | 523 | |
| 526 | 524 | GtkWidget * window = pw3270_application_window_new(GTK_APPLICATION(application),NULL); |
| 527 | 525 | |
| 526 | + if(!PW3270_APPLICATION(application)->settings) { | |
| 527 | + | |
| 528 | + GtkWidget * dialog = gtk_message_dialog_new_with_markup( | |
| 529 | + NULL, | |
| 530 | + 0, | |
| 531 | + GTK_MESSAGE_ERROR, | |
| 532 | + GTK_BUTTONS_CLOSE, | |
| 533 | + _("Initialization has failed") | |
| 534 | + ); | |
| 535 | + | |
| 536 | + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),_("Unable to initialize settings. Application may crash in unexpected ways")); | |
| 537 | + | |
| 538 | + gtk_window_set_title(GTK_WINDOW(dialog),_("System settings error")); | |
| 539 | + | |
| 540 | + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); | |
| 541 | + | |
| 542 | + gtk_widget_show_all(dialog); | |
| 543 | + | |
| 544 | + gtk_dialog_run(GTK_DIALOG(dialog)); | |
| 545 | + | |
| 546 | + gtk_widget_destroy(dialog); | |
| 547 | + | |
| 548 | + g_application_quit(G_APPLICATION(application)); | |
| 549 | + | |
| 550 | + } | |
| 551 | + | |
| 528 | 552 | // Present the new window |
| 529 | 553 | pw3270_window_set_current_page(window,0); |
| 530 | 554 | gtk_window_present(GTK_WINDOW(window)); | ... | ... |