mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
+ Warn if a user's running certain X.Org releases which have the RECORD
extension broken.
This commit is contained in:
parent
0fd5ddee85
commit
230ab47891
30
src/broken_xrecord.cc
Normal file
30
src/broken_xrecord.cc
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* This file is (c) 2008-2009 Konstantin Isakov <ikm@users.berlios.de>
|
||||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
||||
|
||||
#include "broken_xrecord.hh"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/record.h>
|
||||
#include <QX11Info>
|
||||
#endif
|
||||
|
||||
bool isRECORDBroken()
|
||||
{
|
||||
#ifdef Q_WS_X11
|
||||
|
||||
char const * vendor = ServerVendor( QX11Info::display() );
|
||||
|
||||
if ( vendor && strstr( vendor, "X.Org" ) )
|
||||
{
|
||||
int release = VendorRelease( QX11Info::display() );
|
||||
|
||||
return release >= 10600000 && release < 10701000;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
13
src/broken_xrecord.hh
Normal file
13
src/broken_xrecord.hh
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* This file is (c) 2008-2009 Konstantin Isakov <ikm@users.berlios.de>
|
||||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
||||
|
||||
#ifndef __BROKEN_XRECORD_HH_INCLUDED__
|
||||
#define __BROKEN_XRECORD_HH_INCLUDED__
|
||||
|
||||
/// Returns true if the RECORD extension is likely to be broken. Under Windows
|
||||
/// it always returns false.
|
||||
/// This function is to be removed once the RECORD extension is working again
|
||||
/// on all the major distributions.
|
||||
bool isRECORDBroken();
|
||||
|
||||
#endif
|
|
@ -118,7 +118,8 @@ HEADERS += folding.hh \
|
|||
website.hh \
|
||||
orderandprops.hh \
|
||||
language.hh \
|
||||
dictionarybar.hh
|
||||
dictionarybar.hh \
|
||||
broken_xrecord.hh
|
||||
FORMS += groups.ui \
|
||||
dictgroupwidget.ui \
|
||||
mainwindow.ui \
|
||||
|
@ -188,7 +189,8 @@ SOURCES += folding.cc \
|
|||
website.cc \
|
||||
orderandprops.cc \
|
||||
language.cc \
|
||||
dictionarybar.cc
|
||||
dictionarybar.cc \
|
||||
broken_xrecord.cc
|
||||
win32 {
|
||||
SOURCES += mouseover_win32/ThTypes.c
|
||||
HEADERS += mouseover_win32/ThTypes.h
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "language.hh"
|
||||
#include "langcoder.hh"
|
||||
#include <QMessageBox>
|
||||
#include "broken_xrecord.hh"
|
||||
|
||||
Preferences::Preferences( QWidget * parent, Config::Preferences const & p ):
|
||||
QDialog( parent ), prevInterfaceLanguage( 0 )
|
||||
|
@ -135,6 +136,9 @@ Preferences::Preferences( QWidget * parent, Config::Preferences const & p ):
|
|||
ui.audioPlaybackProgramLabel->hide();
|
||||
#endif
|
||||
|
||||
if ( !isRECORDBroken() )
|
||||
ui.brokenXRECORD->hide();
|
||||
|
||||
// Proxy server
|
||||
|
||||
ui.useProxyServer->setChecked( p.proxyServer.enabled );
|
||||
|
|
|
@ -645,6 +645,26 @@ seconds, which is specified here.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="brokenXRECORD">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#ff0000;">Note: You appear to be running an X.Org XServer release which has the RECORD extension broken. Hotkeys in GoldenDict will probably not work. This must be fixed in the server itself. Please refer to the following </span><a href="https://bugs.freedesktop.org/show_bug.cgi?id=20500"><span style=" text-decoration: underline; color:#0000ff;">bug entry</span></a><span style=" color:#ff0000;"> and leave a comment there if you like.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_12">
|
||||
<property name="orientation">
|
||||
|
|
Loading…
Reference in a new issue