Permalink
Browse files

Ported check tool to GTK2.

Rules to copy glade2 files
  • Loading branch information...
megastep committed Mar 7, 2006
1 parent f804ca9 commit 6c456ab3dde26bad75b4f09e5d9ea8031ad1386a
Showing with 648 additions and 7 deletions.
  1. +3 −3 Makefile.in
  2. +23 −4 check.c
  3. +622 −0 check.gtk2.glade
View
@@ -190,7 +190,7 @@ install-check: check
@if [ -d $(IMAGE)/bin/$(os)/$(arch)/ ]; then \
cp check $(IMAGE)/bin/$(os)/$(arch)/; \
strip $(IMAGE)/bin/$(os)/$(arch)/check; \
- cp check.glade $(IMAGE)/misc/; \
+ cp check.glade check.gtk2.glade $(IMAGE)/misc/; \
else \
echo No directory to copy the binary files to.; \
fi
@@ -217,7 +217,7 @@ install-loki_uninstall: loki_uninstall
cp loki_uninstall $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc)/; \
strip $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc)/loki_uninstall; \
cp README.loki_uninstall $(IMAGE)/loki_uninstall/README; \
- cp icon.xpm uninstall.glade $(IMAGE)/loki_uninstall/; \
+ cp icon.xpm uninstall.glade uninstall.gtk2.glade $(IMAGE)/loki_uninstall/; \
for file in `find image/setup.data -name loki-uninstall.mo -print`; \
do path="$(IMAGE)/loki_uninstall/`dirname $$file | sed 's,image/setup.data/,,'`"; \
mkdir -p $$path; \
@@ -234,7 +234,7 @@ install-loki_uninstall: loki_uninstall
rm -rf $(UPDATES)/data-$(UNINSTALL_VERSION)/; \
mkdir $(UPDATES)/data-$(UNINSTALL_VERSION)/; \
cp README.loki_uninstall $(UPDATES)/data-$(UNINSTALL_VERSION)/README; \
- cp icon.xpm uninstall.glade $(UPDATES)/data-$(UNINSTALL_VERSION)/; \
+ cp icon.xpm uninstall.glade uninstall.gtk2.glade $(UPDATES)/data-$(UNINSTALL_VERSION)/; \
for file in `find image/setup.data -name loki-uninstall.mo -print`; \
do path="$(UPDATES)/data-$(UNINSTALL_VERSION)/`dirname $$file | sed 's,image/setup.data/,,'`"; \
mkdir -p $$path; \
View
27 check.c
@@ -2,7 +2,7 @@
* Check and Rescue Tool for Loki Setup packages. Verifies the consistency of the files,
* and optionally restores them from the original installation medium.
*
- * $Id: check.c,v 1.14 2006-02-10 01:40:36 megastep Exp $
+ * $Id: check.c,v 1.15 2006-03-07 19:30:38 megastep Exp $
*/
#include <stdlib.h>
@@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include <glade/glade.h>
-
+#include "config.h"
#include "arch.h"
#include "setupdb.h"
#include "install.h"
@@ -29,11 +29,23 @@
#undef PACKAGE
#define PACKAGE "loki-uninstall"
+#if defined(ENABLE_GTK2)
+ #define CHECK_GLADE "check.gtk2.glade"
+ #define GLADE_XML_NEW(a, b) glade_xml_new(a, b, NULL)
+#else
+ #define CHECK_GLADE "check.glade"
+ #define GLADE_XML_NEW(a, b) glade_xml_new(a, b)
+#endif
+
product_t *product = NULL;
GtkWidget *file_selector;
GladeXML *check_glade, *rescue_glade = NULL;
extern struct component_elem *current_component;
+#ifdef __linux
+int have_selinux = 0;
+#endif
+
const char *argv0 = NULL;
product_info_t *info;
@@ -369,7 +381,7 @@ on_rescue_button_clicked (GtkButton *button,
{
GtkWidget *window;
- rescue_glade = glade_xml_new("check.glade", "media_select");
+ rescue_glade = GLADE_XML_NEW(CHECK_GLADE, "media_select");
glade_xml_signal_autoconnect(rescue_glade);
/* Ask the user to insert the media */
@@ -400,6 +412,13 @@ int main(int argc, char *argv[])
/* Set the locale */
init_locale();
+#ifdef __linux
+ /* See if we have a SELinux environment */
+ if ( !access("/usr/bin/chcon", X_OK) && !access("/usr/sbin/getenforce", X_OK) ) {
+ have_selinux = 1;
+ }
+#endif
+
if ( argc < 2 ) {
fprintf(stderr, _("Usage: %s product\n"), argv[0]);
return 1;
@@ -411,7 +430,7 @@ int main(int argc, char *argv[])
/* Initialize Glade */
glade_init();
- check_glade = glade_xml_new("check.glade", "check_dialog");
+ check_glade = GLADE_XML_NEW(CHECK_GLADE, "check_dialog");
/* Add all signal handlers defined in glade file */
glade_xml_signal_autoconnect(check_glade);
Oops, something went wrong.

0 comments on commit 6c456ab

Please sign in to comment.