Skip to content

Commit

Permalink
Ported check tool to GTK2.
Browse files Browse the repository at this point in the history
Rules to copy glade2 files
  • Loading branch information
megastep committed Mar 7, 2006
1 parent f804ca9 commit 6c456ab
Show file tree
Hide file tree
Showing 3 changed files with 648 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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; \
Expand All @@ -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; \
Expand Down
27 changes: 23 additions & 4 deletions check.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include <glade/glade.h>


#include "config.h"
#include "arch.h"
#include "setupdb.h"
#include "install.h"
Expand All @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Loading

0 comments on commit 6c456ab

Please sign in to comment.