diff options
author | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-11-03 03:13:42 +0000 |
---|---|---|
committer | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-11-03 03:13:42 +0000 |
commit | 0a7829bb3ee59c73edf473759857e1c8c57b3f80 (patch) | |
tree | 51cbf8595acc7c754c8e4b4d29bf40d00493e027 /helper-utilities | |
parent | bc9594959bffffeef4d6f2f3016f841a205f03f9 (diff) | |
download | nautilus-0a7829bb3ee59c73edf473759857e1c8c57b3f80.tar.gz |
Add a error dialog helper utility that can be called from shell scripts to
* configure.in:
* helper-utilities/Makefile.am:
* helper-utilities/error-dialog/.cvsignore:
* helper-utilities/error-dialog/Makefile.am:
* helper-utilities/error-dialog/nautilus-error-dialog.c: (main):
* nautilus.spec.in:
Add a error dialog helper utility that can be called from shell
scripts to display errors to the user.
* components/services/nautilus-dependent-shared/eazel-services-footer.c:
Pavel made me do this at gun point. Make the links activate on
mouse up not down.
Diffstat (limited to 'helper-utilities')
-rw-r--r-- | helper-utilities/Makefile.am | 1 | ||||
-rw-r--r-- | helper-utilities/error-dialog/.cvsignore | 5 | ||||
-rw-r--r-- | helper-utilities/error-dialog/Makefile.am | 23 | ||||
-rw-r--r-- | helper-utilities/error-dialog/nautilus-error-dialog.c | 72 |
4 files changed, 101 insertions, 0 deletions
diff --git a/helper-utilities/Makefile.am b/helper-utilities/Makefile.am index 6181abf5e..190def6ae 100644 --- a/helper-utilities/Makefile.am +++ b/helper-utilities/Makefile.am @@ -6,4 +6,5 @@ endif SUBDIRS = \ $(AUTHENTICATE_HELPER_SUBDIRS) \ + error-dialog \ $(NULL) diff --git a/helper-utilities/error-dialog/.cvsignore b/helper-utilities/error-dialog/.cvsignore new file mode 100644 index 000000000..d271c8170 --- /dev/null +++ b/helper-utilities/error-dialog/.cvsignore @@ -0,0 +1,5 @@ +.deps +.libs +Makefile +Makefile.in +nautilus-error-dialog diff --git a/helper-utilities/error-dialog/Makefile.am b/helper-utilities/error-dialog/Makefile.am new file mode 100644 index 000000000..d11a3a7c2 --- /dev/null +++ b/helper-utilities/error-dialog/Makefile.am @@ -0,0 +1,23 @@ +NULL = + +INCLUDES = \ + -DPREFIX=\"$(prefix)\" \ + -DG_LOG_DOMAIN=\"NautilusErrorDialog\" \ + -I$(top_srcdir) \ + $(GNOMEUI_CFLAGS) \ + $(NULL) + +bin_PROGRAMS = nautilus-error-dialog + +nautilus_error_dialog_SOURCES =\ + nautilus-error-dialog.c \ + $(NULL) + +nautilus_error_dialog_LDADD = \ + $(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \ + $(GNOMEUI_LIBS) \ + $(GCONF_LIBS) \ + $(PAM_LIBS) \ + $(top_builddir)/libnautilus/libnautilus.la \ + $(BONOBO_LIBS) \ + $(NULL) diff --git a/helper-utilities/error-dialog/nautilus-error-dialog.c b/helper-utilities/error-dialog/nautilus-error-dialog.c new file mode 100644 index 000000000..9677e9d1b --- /dev/null +++ b/helper-utilities/error-dialog/nautilus-error-dialog.c @@ -0,0 +1,72 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * Copyright (C) 2000 Eazel, Inc + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ramiro Estrugo <ramiro@eazel.com> + */ + +/* nautilus-error-dialog.c - A very simple program used to post an + * error dialog. + */ + +#include <config.h> + +#include <libnautilus-extensions/nautilus-stock-dialogs.h> +#include <gnome.h> +#include <popt.h> + +int main (int argc, char *argv[]) +{ + GnomeDialog *error_dialog; + poptContext popt_context; + + char *title = NULL; + char *message = NULL; + + const char *default_title = "Default Title"; + const char *default_message = "Default Message"; + + const char *the_title = NULL; + const char *the_message = NULL; + + struct poptOption options[] = { + { "message", '\0', POPT_ARG_STRING, &message, 0, N_("Message."), NULL }, + { "title", '\0', POPT_ARG_STRING, &title, 0, N_("Title."), NULL }, + POPT_AUTOHELP + { NULL, '\0', 0, NULL, 0, NULL, NULL } + }; + + g_log_set_always_fatal ((GLogLevelFlags) 0xFFFF); + + gnome_init_with_popt_table ("nautilus-error-dialog", + VERSION, + argc, + argv, + options, + 0, + &popt_context); + + the_title = title ? title : default_title; + the_message = message ? message : default_message; + + error_dialog = nautilus_error_dialog (the_message, the_title, NULL); + + gnome_dialog_run_and_close (GNOME_DIALOG (error_dialog)); + + return 0; +} |