[mednaffe] 83/99: Add widgets in order to read logs
Stephen Kitt
skitt at moszumanska.debian.org
Tue Aug 2 21:00:10 UTC 2016
This is an automated email from the git hooks/post-receive script.
skitt pushed a commit to branch master
in repository mednaffe.
commit 40e37a7998556d8b038b1473fcef057b3497efc6
Author: AmatCoder <amatcoder at gmail.com>
Date: Thu Jul 23 10:57:50 2015 +0200
Add widgets in order to read logs
---
configure.ac | 2 +-
install-sh | 366 ++++++++++++++++++++++++---------------------------
src/Makefile.am | 2 +-
src/Makefile.in | 6 +-
src/command.c | 221 +++++++++++++++----------------
src/common.h | 4 +-
src/input.c | 24 +++-
src/log.c | 57 ++++++++
src/log.h | 34 +++++
src/mednaffe.c | 23 ++--
src/mednaffe_glade.h | 178 ++++++++++++++++++++-----
src/toggles.c | 12 +-
12 files changed, 558 insertions(+), 371 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9226375..d872011 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@ AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
AC_LANG_C
-CFLAGS="-O2 -s -std=c99 -Wall -Wl,-export-dynamic"
+CFLAGS="-g -std=c99 -Wall -Wl,-export-dynamic"
# Checks for libraries.
AC_ARG_ENABLE(gtk3, [AC_HELP_STRING([--enable-gtk3], [Compile against GTK 3.x explicitly])], [enable_gtk3=$enableval], [enable_gtk3="no"])
diff --git a/install-sh b/install-sh
index 377bb86..0b0fdcb 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written
# from scratch.
+tab=' '
nl='
'
-IFS=" "" $nl"
+IFS=" $tab$nl"
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
-# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
posix_mkdir=
# Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -137,46 +122,57 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift;;
+ shift;;
-s) stripcmd=$stripprog;;
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
- -T) no_target_directory=true;;
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) shift
+ break;;
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
*) break;;
esac
shift
done
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -208,6 +204,15 @@ if test $# -eq 0; then
fi
if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw='% 200'
+ u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw=,u+rw
+ u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -269,41 +274,15 @@ do
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
+ dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
@@ -314,74 +293,74 @@ do
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
esac
if
$posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
@@ -391,53 +370,51 @@ do
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
esac
- eval "$initialize_posix_glob"
-
oIFS=$IFS
IFS=/
- $posix_glob set -f
+ set -f
set fnord $dstdir
shift
- $posix_glob set +f
+ set +f
IFS=$oIFS
prefixes=
for d
do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
done
if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
fi
fi
fi
@@ -472,15 +449,12 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
+ set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
@@ -493,24 +467,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
diff --git a/src/Makefile.am b/src/Makefile.am
index f7932f4..6dfdaff 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS=mednaffe
-mednaffe_SOURCES=mednaffe.c about.c active.c command.c list.c toggles.c input.c gui.c prefs.c joystick_linux.c md5.c common.h mednaffe_glade.h settings_glade.h system_glade.h toggles.h prefs.h input.h joystick_linux.h md5.h logo.h
+mednaffe_SOURCES=mednaffe.c about.c active.c command.c list.c toggles.c input.c gui.c prefs.c log.c joystick_linux.c md5.c common.h mednaffe_glade.h settings_glade.h system_glade.h toggles.h prefs.h input.h log.h joystick_linux.h md5.h logo.h
AM_CPPFLAGS = @GTK_CFLAGS@ $(GTK_DEFINES)
LDADD = @GTK_LIBS@
CLEANFILES = *~
diff --git a/src/Makefile.in b/src/Makefile.in
index 1311fd0..4f7b8d2 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -102,7 +102,8 @@ PROGRAMS = $(bin_PROGRAMS)
am_mednaffe_OBJECTS = mednaffe.$(OBJEXT) about.$(OBJEXT) \
active.$(OBJEXT) command.$(OBJEXT) list.$(OBJEXT) \
toggles.$(OBJEXT) input.$(OBJEXT) gui.$(OBJEXT) \
- prefs.$(OBJEXT) joystick_linux.$(OBJEXT) md5.$(OBJEXT)
+ prefs.$(OBJEXT) log.$(OBJEXT) joystick_linux.$(OBJEXT) \
+ md5.$(OBJEXT)
mednaffe_OBJECTS = $(am_mednaffe_OBJECTS)
mednaffe_LDADD = $(LDADD)
mednaffe_DEPENDENCIES =
@@ -252,7 +253,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-mednaffe_SOURCES = mednaffe.c about.c active.c command.c list.c toggles.c input.c gui.c prefs.c joystick_linux.c md5.c common.h mednaffe_glade.h settings_glade.h system_glade.h toggles.h prefs.h input.h joystick_linux.h md5.h logo.h
+mednaffe_SOURCES = mednaffe.c about.c active.c command.c list.c toggles.c input.c gui.c prefs.c log.c joystick_linux.c md5.c common.h mednaffe_glade.h settings_glade.h system_glade.h toggles.h prefs.h input.h log.h joystick_linux.h md5.h logo.h
AM_CPPFLAGS = @GTK_CFLAGS@ $(GTK_DEFINES)
LDADD = @GTK_LIBS@
CLEANFILES = *~
@@ -350,6 +351,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/input.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/joystick_linux.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/list.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/log.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/md5.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mednaffe.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/prefs.Po at am__quote@
diff --git a/src/command.c b/src/command.c
index 4c19937..9c5aa11 100644
--- a/src/command.c
+++ b/src/command.c
@@ -21,6 +21,7 @@
*/
#include "common.h"
+#include "log.h"
#ifdef G_OS_WIN32
#include <windows.h>
@@ -64,17 +65,15 @@ gchar *build_command_win(guidata *gui)
gchar **build_command(guidata *gui)
{
gchar **command;
- gint num = 5;
+ gint num = 3;
GList *list = NULL;
GList *iterator = NULL;
list = g_hash_table_get_keys(gui->clist);
- command = g_new(gchar *, ((g_list_length(list))*2)+7);
+ command = g_new(gchar *, ((g_list_length(list))*2)+5);
command[0] = g_strdup(gui->binpath);
- command[1] = g_strdup("-remote");
- command[2] = g_strdup("Mednafen_");
- command[3] = g_strdup("-psx.dbg_level");
- command[4] = g_strdup("0");
+ command[1] = g_strdup("-psx.dbg_level");
+ command[2] = g_strdup("0");
for (iterator = list; iterator; iterator = iterator->next)
{
command[num] = g_strdup(iterator->data);
@@ -94,74 +93,26 @@ gchar **build_command(guidata *gui)
return command;
}
-gchar* format_err(gchar *string, gsize len)
-{
- gchar *copy;
-
- //memmove(string, string+24, len-27);
- string[len-3] = ' ';
- string[8]=' ';string[14]=' ';string[22]=':';string[23]='\n';
- copy = g_strcompress(string);
- g_free(string);
- return copy;
-}
-
gboolean out_watch( GIOChannel *channel, GIOCondition cond, guidata *gui)
{
- gchar *string;
- gsize size;
+ gsize size;
- if(cond == G_IO_HUP)
+ if (cond == G_IO_HUP)
{
g_io_channel_unref(channel);
return FALSE;
}
- g_io_channel_read_line(channel, &string, &size, NULL, NULL);
+ g_free(gui->m_error);
+ gui->m_error= NULL;
- if (string)
- {
- if (size>9)
- {
- if (string[9]=='e')
- {
- GtkWidget *dialog;
-
- gchar *err = format_err(string, size);
-
- gui->m_error = TRUE;
- if (gui->state==1) gtk_window_present(GTK_WINDOW(gui->topwindow));
- if (gui->state==2) gtk_widget_show(gui->topwindow);
- dialog = gtk_message_dialog_new (GTK_WINDOW(gui->topwindow),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s", err);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- printf ("[Mednaffe] ***ERROR***\n%s", err);
- g_free(err);
- g_io_channel_unref(channel);
-
- return FALSE;
- }
-
- if (string[0]!='M')
- {
- g_io_channel_unref(channel);
- g_free(string);
- return FALSE;
- }
- }
- }
- else
+ if (g_io_channel_read_line(channel, &gui->m_error, &size, NULL, NULL) != G_IO_STATUS_NORMAL)
+ return TRUE;
+
+ if (gui->m_error != NULL)
{
- g_io_channel_unref(channel);
- return FALSE;
+ gtk_text_buffer_insert_at_cursor(gui->textout, gui->m_error, size);
}
-
- g_free(string);
return TRUE;
}
@@ -172,90 +123,106 @@ void child_watch(GPid pid, gint status, guidata *gui)
#ifdef G_OS_WIN32
DWORD lpExitCode=0;
-
GetExitCodeProcess( pid, &lpExitCode);
+
+ gchar *string;
+ gchar *dir = g_path_get_dirname (gui->binpath);
+ gchar *path =g_strconcat(dir, "\\stdout.txt", NULL);
+
+ if (g_file_get_contents(path, &string, NULL, NULL))
+ {
+ print_log("----\n", EMU, gui);
+ print_log(string, EMU, gui);
+
+ gchar **aline = g_strsplit(string, "\n", 0);
+ gint num = g_strv_length(aline);
+ if (num > 2)
+ gui->m_error = g_strconcat("Mednafen error: ", aline[num-2], NULL);
+
+ g_strfreev(aline);
+ }
+ g_free(string);
+ g_free(dir);
+ g_free(path);
+
if (lpExitCode!=0)
{
- gchar *string;
- gchar *err = NULL;
+ if (gui->m_error == NULL)
+ gui->m_error = g_strdup("Mednafen error. Read stdout.txt for details.");
- gui->m_error = TRUE;
+ GtkWidget *dialog;
- gchar *dir = g_win32_get_package_installation_directory_of_module(NULL);
- gchar *path =g_strconcat(dir, "\\stdout.txt", NULL);
+ dialog = gtk_message_dialog_new (GTK_WINDOW(gui->topwindow),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ "%s", gui->m_error);
- if (g_file_get_contents(path, &string, NULL, NULL))
- {
- gchar **aline = g_strsplit(string, "\n", 0);
- gint num = g_strv_length(aline);
- if (num > 2) err = g_strconcat("Mednafen error:\n", aline[num-2], NULL);
- g_free(string);
- g_strfreev(aline);
- }
- g_free(dir);
- g_free(path);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ print_log("***ERROR***: ", FE, gui);
+ print_log(gui->m_error, FE, gui);
+ }
+ #else
+ if (status!=0)
+ {
+ GtkWidget *dialog;
- if (!err) err = g_strdup("Mednafen error.\nRead stdout.txt for details.");
- GtkWidget *dialog;
+ if (gui->state==1) gtk_window_present(GTK_WINDOW(gui->topwindow));
+ if (gui->state==2) gtk_widget_show(gui->topwindow);
+
+ if (gui->m_error == NULL) gui->m_error = g_strdup("Unspecified error");
dialog = gtk_message_dialog_new (GTK_WINDOW(gui->topwindow),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
- "%s", err);
+ "%s", gui->m_error);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- printf ("[Mednaffe] ***ERROR***\n%s", err);
- g_free(err);
+ print_log("***ERROR***: ", FE, gui);
+ print_log(gui->m_error, FE, gui);
}
#endif
+ else
+ {
+ g_hash_table_remove_all(gui->clist);
+
+ /* Send 'video.fs' and 'cheats' every time */
+ gpointer name;
+ name = g_strdup(g_object_get_data(gtk_builder_get_object(
+ gui->builder, "-video.fs"), "cname"));
+
+ g_hash_table_insert(gui->clist, name, name);
+
+ name = g_strdup(g_object_get_data(gtk_builder_get_object(
+ gui->builder, "-cheats"), "cname"));
+
+ g_hash_table_insert(gui->clist, name, name);
+ }
+
+ g_free(gui->m_error);
+ gui->m_error = NULL;
g_spawn_close_pid(pid);
gui->executing = FALSE;
gui->changed = TRUE;
- printf ("[Mednaffe] End of execution catched\n");
- printf ("[Mednaffe] Command line used: '");
-
#ifdef G_OS_WIN32
- printf("%s\n", gui->command);
g_free(gui->command);
#else
- gint i=0;
- while (gui->command[i])
- {
- printf("%s ",gui->command[i]);
- i++;
- }
- printf ("'\n");
g_strfreev(gui->command);
#endif
- if (gui->m_error == FALSE)
- {
- g_hash_table_remove_all(gui->clist);
-
- /* Send 'video.fs' and 'cheats' every time */
- gpointer name;
- name = g_strdup(g_object_get_data(gtk_builder_get_object(
- gui->builder, "-video.fs"), "cname"));
-
- g_hash_table_insert(gui->clist, name, name);
-
- name = g_strdup(g_object_get_data(gtk_builder_get_object(
- gui->builder, "-cheats"), "cname"));
-
- g_hash_table_insert(gui->clist, name, name);
- }
-
- gui->m_error = FALSE;
-
if (gui->state==1) gtk_window_present(GTK_WINDOW(gui->topwindow));
if (gui->state==2) gtk_widget_show(gui->topwindow);
gtk_widget_set_sensitive (gui->launch, TRUE);
gtk_widget_set_sensitive (GTK_WIDGET(gtk_builder_get_object(gui->builder,
"inputbutton")), TRUE);
+
+ print_log("----\n", EMU, gui);
+ print_log("End of execution catched.\n", FE|EMU, gui);
}
#ifdef G_OS_WIN32
@@ -275,12 +242,17 @@ void row_exec(GtkTreeView *treeview, GtkTreePath *patho,
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
gui->command = build_command_win(gui);
- printf ("[Mednaffe] Executing mednafen...\n");
+ delete_log(EMU, gui);
+
+ print_log("Executing mednafen with command line: \n", FE|EMU, gui);
+ print_log(gui->command, FE|EMU, gui);
+ print_log("\n", FE|EMU, gui);
+
ret = CreateProcess(NULL, gui->command, NULL, NULL, FALSE, 0,
NULL, NULL, &si, &pi);
if (!ret)
{
- printf("[Mednaffe] Executing mednafen failed!\n");
+ print_log("Executing mednafen failed!\n", FE, gui);
g_free(gui->command);
return;
}
@@ -311,13 +283,26 @@ void row_exec(GtkTreeView *treeview, GtkTreePath *patho,
return;
gui->command = build_command(gui);
- printf ("[Mednaffe] Executing mednafen...\n");
+
+ delete_log(EMU, gui);
+ print_log("Executing mednafen with command line: \n\"", FE|EMU, gui);
+
+ gint i=0;
+ while (gui->command[i])
+ {
+ print_log(gui->command[i], FE|EMU, gui);
+ print_log(" ", FE|EMU, gui);
+ i++;
+ }
+ print_log("\"\n", FE|EMU, gui);
+ print_log("----\n", EMU, gui);
+
ret = g_spawn_async_with_pipes( NULL, gui->command, NULL,
G_SPAWN_DO_NOT_REAP_CHILD, NULL,
NULL, &pid, NULL, &out, NULL, NULL );
if (!ret)
{
- printf("[Mednaffe] Executing mednafen failed!\n");
+ print_log("Executing mednafen failed!\n", FE, gui);
g_strfreev(gui->command);
return;
}
diff --git a/src/common.h b/src/common.h
index c807cab..302f99d 100644
--- a/src/common.h
+++ b/src/common.h
@@ -60,6 +60,8 @@ typedef struct
GtkWidget *launch;
GtkWidget *systemlist;
GtkWidget *globalist;
+ GtkTextBuffer *textfe;
+ GtkTextBuffer *textout;
GtkBuilder *specific;
GtkBuilder *builder;
GtkBuilder *settings;
@@ -94,5 +96,5 @@ typedef struct
joydata joy[9];
gboolean inputedited;
gboolean inputkeys;
- gboolean m_error;
+ gchar *m_error;
}guidata;
diff --git a/src/input.c b/src/input.c
index 8190702..f6821ac 100644
--- a/src/input.c
+++ b/src/input.c
@@ -23,6 +23,7 @@
#include "common.h"
#include "input.h"
#include "toggles.h"
+#include "log.h"
#ifdef G_OS_UNIX
#include "joystick_linux.h"
@@ -714,8 +715,13 @@ void on_input_clicked (GtkButton *button, guidata *gui)
{
if (GetJoy(a,gui)>0)
{
- gui->joy[a].channel = g_io_channel_unix_new(gui->joy[a].js_fd);
+ gchar *id =g_strdup_printf(" - Unique ID: %016llx\n", gui->joy[a].id);
+ print_log("Joystick detected: ", FE, gui);
+ print_log(gui->joy[a].name, FE, gui);
+ print_log(id, FE, gui);
+ g_free(id);
+ gui->joy[a].channel = g_io_channel_unix_new(gui->joy[a].js_fd);
//g_io_channel_set_flags (gui->joy[a].channel, G_IO_FLAG_NONBLOCK, NULL);
g_io_channel_set_close_on_unref(gui->joy[a].channel, TRUE);
g_io_add_watch(gui->joy[a].channel, G_IO_IN|G_IO_HUP, (GIOFunc)joy_watch, gui);
@@ -775,13 +781,17 @@ void on_input_clicked (GtkButton *button, guidata *gui)
}
}
- /*for(i=0;i<9;i++)
+ for(i=0;i<9;i++)
{
- printf("Index: %i - Instance: %i - Name: %s - ID: %016I64x\n", i,
- SDL_JoystickInstanceID(gui->joy[i].sdljoy),
- SDL_JoystickName(gui->joy[i].sdljoy),
- gui->joy[i].id);
- }*/
+ if (gui->joy[i].name != NULL)
+ {
+ gchar *id =g_strdup_printf(" - Unique ID: %016I64x\n", gui->joy[i].id);
+ print_log("Joystick detected: ", FE, gui);
+ print_log(SDL_JoystickName(gui->joy[i].sdljoy), FE, gui);
+ print_log(id, FE, gui);
+ g_free(id);
+ }
+ }
/* gchar *string;
diff --git a/src/log.c b/src/log.c
new file mode 100644
index 0000000..01b2a13
--- /dev/null
+++ b/src/log.c
@@ -0,0 +1,57 @@
+/*
+ * log.c
+ *
+ * Copyright 2013-2015 AmatCoder
+ *
+ * This file is part of Mednaffe.
+ *
+ * Mednaffe 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mednaffe 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 Mednaffe; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common.h"
+#include "log.h"
+
+void delete_log(elog log, guidata *gui)
+{
+ GtkTextIter start, end;
+
+ if (log & FE)
+ {
+ gtk_text_buffer_get_start_iter (gui->textfe, &start);
+ gtk_text_buffer_get_end_iter (gui->textfe, &end);
+ gtk_text_buffer_delete (gui->textfe, &start, &end);
+ }
+
+ if (log & EMU)
+ {
+ gtk_text_buffer_get_start_iter (gui->textout, &start);
+ gtk_text_buffer_get_end_iter (gui->textout, &end);
+ gtk_text_buffer_delete (gui->textout, &start, &end);
+ }
+}
+
+void print_log(const gchar *text, elog log, guidata *gui)
+{
+ if (log & FE)
+ {
+ printf("%s", text);
+ gtk_text_buffer_insert_at_cursor(gui->textfe, text, -1);
+ }
+
+ if (log & EMU)
+ {
+ gtk_text_buffer_insert_at_cursor(gui->textout, text, -1);
+ }
+}
diff --git a/src/log.h b/src/log.h
new file mode 100644
index 0000000..b8a98ba
--- /dev/null
+++ b/src/log.h
@@ -0,0 +1,34 @@
+/*
+ * log.h
+ *
+ * Copyright 2013-2015 AmatCoder
+ *
+ * This file is part of Mednaffe.
+ *
+ * Mednaffe 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mednaffe 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 Mednaffe; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef LOG_H
+#define LOG_H
+
+typedef enum {
+ FE = 1,
+ EMU = 2
+} elog;
+
+void delete_log(elog log, guidata *gui);
+void print_log(const gchar *text, elog log, guidata *gui);
+
+#endif /* LOG_H */
diff --git a/src/mednaffe.c b/src/mednaffe.c
index 059a0f5..0c2cf09 100644
--- a/src/mednaffe.c
+++ b/src/mednaffe.c
@@ -26,13 +26,14 @@
gcc -g -std=c99 -Wall -DGTK2_ENABLED -o mednaffe about.c
active.c command.c gui.c prefs.c list.c toggles.c
- input.c joystick_linux.c md5.c mednaffe.c
+ log.c input.c joystick_linux.c md5.c mednaffe.c
$(pkg-config --cflags --libs gtk+-2.0 gmodule-export-2.0)
*/
#include "common.h"
#include "toggles.h"
+#include "log.h"
#include "prefs.h"
#include "logo.h"
#include "mednaffe_glade.h"
@@ -264,7 +265,7 @@ G_MODULE_EXPORT
void quit(GtkWidget *widget, guidata *gui)
{
save_prefs(gui);
- printf("[Mednaffe] Exiting Mednaffe...\n");
+ printf("Exiting Mednaffe...\n");
/* To free items makes happy to Valgrind ;-) */
g_object_unref(G_OBJECT(gui->builder));
@@ -295,7 +296,7 @@ void delete(GtkWidget *widget, GdkEvent *event, guidata *gui)
quit(widget,gui);
}
-gchar *get_cfg(const gchar *home)
+gchar *get_cfg(const gchar *home, guidata *gui)
{
gchar *cfg_path;
@@ -307,7 +308,8 @@ gchar *get_cfg(const gchar *home)
#endif
if (g_file_test (cfg_path, G_FILE_TEST_IS_REGULAR))
- printf("[Mednaffe] Mednafen 09x configuration file found\n");
+ print_log("Starting Mednaffe 0.7\n\
+Mednafen 09x configuration file found.\n", FE, gui);
else return NULL;
/*{
@@ -317,7 +319,7 @@ gchar *get_cfg(const gchar *home)
cfg_path = g_strconcat(home, "/.mednafen/mednafen.cfg", NULL);
#endif
if (g_file_test (cfg_path, G_FILE_TEST_IS_REGULAR))
- printf("[Mednaffe] Mednafen 08x configuration file found\n");
+ printf(" Mednafen 08x configuration file found\n");
else
cfg_path = NULL;
}*/
@@ -334,7 +336,6 @@ int main(int argc, char **argv)
/* Init GTK+ */
gtk_init(&argc, &argv);
- printf("[Mednaffe] Starting Mednaffe 0.7...\n");
/* Create new GtkBuilder objects */
gui.builder = gtk_builder_new();
@@ -398,6 +399,12 @@ int main(int argc, char **argv)
gui.launch = GTK_WIDGET(gtk_builder_get_object(gui.builder,
"button1"));
+ gui.textfe = GTK_TEXT_BUFFER(gtk_builder_get_object(gui.builder,
+ "textbufferfe"));
+
+ gui.textout = GTK_TEXT_BUFFER(gtk_builder_get_object(gui.builder,
+ "textbufferout"));
+
/*gui.setlabel = GTK_WIDGET(gtk_builder_get_object(gui.builder,
"settings_label"));
g_object_ref(gui.setlabel);*/
@@ -457,7 +464,7 @@ int main(int argc, char **argv)
gui.treepath = NULL;
gui.editable = NULL;
gui.inputedited = TRUE;
- gui.m_error = FALSE;
+ gui.m_error = NULL;
gui.clist = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
gui.hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
@@ -556,7 +563,7 @@ want to select the file manually?\n");
#endif
/* Search mednafen configuration file */
- gui.cfgfile = get_cfg(home);
+ gui.cfgfile = get_cfg(home, &gui);
if (!gui.cfgfile)
{
show_error("Error: No mednafen configuration file found.\n");
diff --git a/src/mednaffe_glade.h b/src/mednaffe_glade.h
index b477e91..5374b66 100644
--- a/src/mednaffe_glade.h
+++ b/src/mednaffe_glade.h
@@ -924,7 +924,7 @@ static const char *mednaffe_glade =
"</row>\n"
"</data>\n"
"</object>\n"
-"<object class=\"GtkTextBuffer\" id=\"textbuffererror\"/>\n"
+"<object class=\"GtkTextBuffer\" id=\"textbufferfe\"/>\n"
"<object class=\"GtkTextBuffer\" id=\"textbufferout\"/>\n"
"<object class=\"GtkTreeModelFilter\" id=\"treemodelfilter1\">\n"
"<property name=\"child_model\">liststore3</property>\n"
@@ -1051,45 +1051,17 @@ static const char *mednaffe_glade =
"<object class=\"GtkMenuItem\" id=\"menuitem2\">\n"
"<property name=\"visible\">True</property>\n"
"<property name=\"can_focus\">False</property>\n"
-"<property name=\"label\" translatable=\"yes\">Mode</property>\n"
+"<property name=\"label\" translatable=\"yes\">List</property>\n"
"<property name=\"use_underline\">True</property>\n"
"<child type=\"submenu\">\n"
-"<object class=\"GtkMenu\" id=\"menu5\">\n"
-"<property name=\"visible\">True</property>\n"
-"<property name=\"can_focus\">False</property>\n"
-"<child>\n"
-"<object class=\"GtkRadioMenuItem\" id=\"normalmenu\">\n"
+"<object class=\"GtkMenu\" id=\"menu7\">\n"
"<property name=\"visible\">True</property>\n"
"<property name=\"can_focus\">False</property>\n"
-"<property name=\"label\" translatable=\"yes\">Normal</property>\n"
-"<property name=\"use_underline\">True</property>\n"
-"<property name=\"active\">True</property>\n"
-"<property name=\"draw_as_radio\">True</property>\n"
-"<accelerator key=\"n\" signal=\"activate\" modifiers=\"GDK_SHIFT_MASK\"/>\n"
-"<signal name=\"activate\" handler=\"on_normalmenu_activate\" swapped=\"no\"/>\n"
-"</object>\n"
-"</child>\n"
-"<child>\n"
-"<object class=\"GtkRadioMenuItem\" id=\"recursivemenu\">\n"
-"<property name=\"visible\">True</property>\n"
-"<property name=\"can_focus\">False</property>\n"
-"<property name=\"label\" translatable=\"yes\">Recursive</property>\n"
-"<property name=\"use_underline\">True</property>\n"
-"<property name=\"draw_as_radio\">True</property>\n"
-"<property name=\"group\">normalmenu</property>\n"
-"<accelerator key=\"r\" signal=\"activate\" modifiers=\"GDK_SHIFT_MASK\"/>\n"
-"<signal name=\"activate\" handler=\"on_recursivemenu_activate\" swapped=\"no\"/>\n"
-"</object>\n"
-"</child>\n"
-"</object>\n"
-"</child>\n"
-"</object>\n"
-"</child>\n"
"<child>\n"
"<object class=\"GtkMenuItem\" id=\"menuitemfilter\">\n"
"<property name=\"visible\">True</property>\n"
"<property name=\"can_focus\">False</property>\n"
-"<property name=\"label\" translatable=\"yes\">Show In List</property>\n"
+"<property name=\"label\" translatable=\"yes\">Show</property>\n"
"<property name=\"use_underline\">True</property>\n"
"<child type=\"submenu\">\n"
"<object class=\"GtkMenu\" id=\"menu4\">\n"
@@ -1111,7 +1083,7 @@ static const char *mednaffe_glade =
"<object class=\"GtkRadioMenuItem\" id=\"radiomenuzip\">\n"
"<property name=\"visible\">True</property>\n"
"<property name=\"can_focus\">False</property>\n"
-"<property name=\"label\" translatable=\"yes\">Only Zips</property>\n"
+"<property name=\"label\" translatable=\"yes\">Only zips</property>\n"
"<property name=\"use_underline\">True</property>\n"
"<property name=\"draw_as_radio\">True</property>\n"
"<property name=\"group\">radiomenuall</property>\n"
@@ -1135,6 +1107,48 @@ static const char *mednaffe_glade =
"</child>\n"
"</object>\n"
"</child>\n"
+"<child>\n"
+"<object class=\"GtkMenuItem\" id=\"menuitemscan\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">False</property>\n"
+"<property name=\"label\" translatable=\"yes\">Scan Mode</property>\n"
+"<property name=\"use_underline\">True</property>\n"
+"<child type=\"submenu\">\n"
+"<object class=\"GtkMenu\" id=\"menu5\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">False</property>\n"
+"<child>\n"
+"<object class=\"GtkRadioMenuItem\" id=\"normalmenu\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">False</property>\n"
+"<property name=\"label\" translatable=\"yes\">Normal</property>\n"
+"<property name=\"use_underline\">True</property>\n"
+"<property name=\"active\">True</property>\n"
+"<property name=\"draw_as_radio\">True</property>\n"
+"<accelerator key=\"n\" signal=\"activate\" modifiers=\"GDK_SHIFT_MASK\"/>\n"
+"<signal name=\"activate\" handler=\"on_normalmenu_activate\" swapped=\"no\"/>\n"
+"</object>\n"
+"</child>\n"
+"<child>\n"
+"<object class=\"GtkRadioMenuItem\" id=\"recursivemenu\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">False</property>\n"
+"<property name=\"label\" translatable=\"yes\">Recursive</property>\n"
+"<property name=\"use_underline\">True</property>\n"
+"<property name=\"draw_as_radio\">True</property>\n"
+"<property name=\"group\">normalmenu</property>\n"
+"<accelerator key=\"r\" signal=\"activate\" modifiers=\"GDK_SHIFT_MASK\"/>\n"
+"<signal name=\"activate\" handler=\"on_recursivemenu_activate\" swapped=\"no\"/>\n"
+"</object>\n"
+"</child>\n"
+"</object>\n"
+"</child>\n"
+"</object>\n"
+"</child>\n"
+"</object>\n"
+"</child>\n"
+"</object>\n"
+"</child>\n"
"</object>\n"
"</child>\n"
"</object>\n"
@@ -4375,6 +4389,15 @@ static const char *mednaffe_glade =
"<child>\n"
"<placeholder/>\n"
"</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
"</object>\n"
"</child>\n"
"</object>\n"
@@ -4598,6 +4621,15 @@ static const char *mednaffe_glade =
"<child>\n"
"<placeholder/>\n"
"</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
"</object>\n"
"</child>\n"
"</object>\n"
@@ -5442,6 +5474,86 @@ static const char *mednaffe_glade =
"<property name=\"tab_fill\">False</property>\n"
"</packing>\n"
"</child>\n"
+"<child>\n"
+"<object class=\"GtkNotebook\" id=\"notebook4\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">True</property>\n"
+"<child>\n"
+"<object class=\"GtkScrolledWindow\" id=\"scrolledwindow2\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">True</property>\n"
+"<property name=\"hscrollbar_policy\">automatic</property>\n"
+"<property name=\"vscrollbar_policy\">automatic</property>\n"
+"<child>\n"
+"<object class=\"GtkTextView\" id=\"textview2\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">True</property>\n"
+"<property name=\"editable\">False</property>\n"
+"<property name=\"wrap_mode\">word</property>\n"
+"<property name=\"cursor_visible\">False</property>\n"
+"<property name=\"buffer\">textbufferfe</property>\n"
+"</object>\n"
+"</child>\n"
+"</object>\n"
+"</child>\n"
+"<child type=\"tab\">\n"
+"<object class=\"GtkLabel\" id=\"label73\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">False</property>\n"
+"<property name=\"label\" translatable=\"yes\">Front End </property>\n"
+"</object>\n"
+"<packing>\n"
+"<property name=\"tab_fill\">False</property>\n"
+"</packing>\n"
+"</child>\n"
+"<child>\n"
+"<object class=\"GtkScrolledWindow\" id=\"scrolledwindow3\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">True</property>\n"
+"<property name=\"hscrollbar_policy\">automatic</property>\n"
+"<property name=\"vscrollbar_policy\">automatic</property>\n"
+"<child>\n"
+"<object class=\"GtkTextView\" id=\"textview1\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">True</property>\n"
+"<property name=\"editable\">False</property>\n"
+"<property name=\"wrap_mode\">word</property>\n"
+"<property name=\"cursor_visible\">False</property>\n"
+"<property name=\"buffer\">textbufferout</property>\n"
+"</object>\n"
+"</child>\n"
+"</object>\n"
+"<packing>\n"
+"<property name=\"position\">1</property>\n"
+"</packing>\n"
+"</child>\n"
+"<child type=\"tab\">\n"
+"<object class=\"GtkLabel\" id=\"label80\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">False</property>\n"
+"<property name=\"label\" translatable=\"yes\">Emulator </property>\n"
+"</object>\n"
+"<packing>\n"
+"<property name=\"position\">1</property>\n"
+"<property name=\"tab_fill\">False</property>\n"
+"</packing>\n"
+"</child>\n"
+"</object>\n"
+"<packing>\n"
+"<property name=\"position\">3</property>\n"
+"</packing>\n"
+"</child>\n"
+"<child type=\"tab\">\n"
+"<object class=\"GtkLabel\" id=\"label71\">\n"
+"<property name=\"visible\">True</property>\n"
+"<property name=\"can_focus\">False</property>\n"
+"<property name=\"label\" translatable=\"yes\">Logs </property>\n"
+"</object>\n"
+"<packing>\n"
+"<property name=\"position\">3</property>\n"
+"<property name=\"tab_fill\">False</property>\n"
+"</packing>\n"
+"</child>\n"
"</object>\n"
"<packing>\n"
"<property name=\"expand\">True</property>\n"
diff --git a/src/toggles.c b/src/toggles.c
index d2da66b..b31bcf0 100644
--- a/src/toggles.c
+++ b/src/toggles.c
@@ -21,6 +21,7 @@
*/
#include "common.h"
+#include "log.h"
#include "string.h"
void select_rows(guidata *gui)
@@ -374,17 +375,20 @@ gboolean check_version(gchar *stout, guidata *gui)
return FALSE;
}
- gchar *version = g_strconcat(aline[1], " detected...", NULL);
- printf("[Mednaffe] %s\n",version);
+ print_log("Version detected: ", FE, gui);
+ print_log(aline[1], FE, gui);
+ #ifdef G_OS_UNIX
+ print_log("\n", FE, gui);
+ #endif
+ print_log("----\n", FE, gui);
GtkStatusbar *sbversion = GTK_STATUSBAR(gtk_builder_get_object(gui->builder, "sbversion"));
- gtk_statusbar_push(GTK_STATUSBAR(sbversion), 1, version);
+ gtk_statusbar_push(GTK_STATUSBAR(sbversion), 1, aline[1]);
gtk_widget_set_tooltip_text(GTK_WIDGET(sbversion), gui->binpath);
g_strfreev(achar);
g_strfreev(aline);
- g_free(version);
return TRUE;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mednaffe.git
More information about the Pkg-games-commits
mailing list