diff options
author | Hennes Rohling <hro@openoffice.org> | 2003-06-10 12:40:41 +0000 |
---|---|---|
committer | Hennes Rohling <hro@openoffice.org> | 2003-06-10 12:40:41 +0000 |
commit | 58f319d4c472c24cbf1a08bcbad2f9b3729ae7a4 (patch) | |
tree | 06cd4bc2f5b2631554a83e01407ed2debb5a7074 /crashrep/source | |
parent | 9694a798cd745ba08e92c76fe45dfa07eccb4a6b (diff) |
#110104# Don't start if gnome accessibility is enabled
Diffstat (limited to 'crashrep/source')
-rwxr-xr-x | crashrep/source/unx/main.cxx | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx index 31e31efa1684..c32d0ccf7499 100755 --- a/crashrep/source/unx/main.cxx +++ b/crashrep/source/unx/main.cxx @@ -2,9 +2,9 @@ * * $RCSfile: main.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: hro $ $Date: 2003-06-10 13:09:27 $ + * last change: $Author: hro $ $Date: 2003-06-10 13:40:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1061,11 +1061,32 @@ static bool setup_version() return 0 != g_strReportServer.length(); } +// Use gconftool-2 to determine if gnome accessiblity is enabled + +static bool get_accessibility_state() +{ + bool bAccessible = false; + FILE *fin = popen( "gconftool-2 -g /desktop/gnome/interface/accessibility", "r"); + + if ( fin ) + { + char buffer[sizeof("true")]; + + bAccessible = fgets( buffer, sizeof(buffer), fin ) && 0 == strcmp( buffer, "true" ); + + fclose( fin ); + } + + return bAccessible; +} + int main( int argc, char** argv ) { freopen( "/dev/null", "w", stderr ); - if ( setup_version() ) + // Don't start if accessiblity is enabled or report server is not given + + if ( setup_version() && !get_accessibility_state() ) { gtk_set_locale (); gtk_init (&argc, &argv); |