Skip to content

Commit

Permalink
Merge branch 'staged' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Feb 19, 2022
2 parents 7464fe8 + 49fa66c commit a5a7af6
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 60 deletions.
4 changes: 0 additions & 4 deletions .github/release-drafter.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/release_drafter_workflow.yml

This file was deleted.

14 changes: 14 additions & 0 deletions GoldenDict.exe.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Requirements

This code has been run and tested on Windows XP/Vista/7, Ubuntu Linux, Mac OS X.
This code has been run and tested on Windows 10/11, Ubuntu Linux, Mac OS X.

### External Deps

Expand All @@ -24,7 +24,7 @@ This code has been run and tested on Windows XP/Vista/7, Ubuntu Linux, Mac OS X.
libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev \
qtdeclarative5-dev libxtst-dev liblzo2-dev libbz2-dev \
libao-dev libavutil-dev libavformat-dev libtiff5-dev libeb16-dev \
libqt5webkit5-dev libqt5svg5-dev libqt5x11extras5-dev qttools5-dev \
libqt5svg5-dev libqt5x11extras5-dev qttools5-dev \
qttools5-dev-tools qtmultimedia5-dev libqt5multimedia5-plugins

## How to build
Expand Down
30 changes: 21 additions & 9 deletions articleview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,8 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm, Au
inspectAction.setText( tr( "Inspect" ) );
ui.definition->addAction( &inspectAction );

QWebEnginePage *page = ui.definition->page();
connect(&inspectAction, &QAction::triggered, this, [page, this]() {
if (inspectView == nullptr || !inspectView->isVisible()) {
inspectView = new QWebEngineView();
page->setDevToolsPage(inspectView->page());
page->triggerAction(QWebEnginePage::InspectElement);
inspectView->show();
}
});

connect(&inspectAction, &QAction::triggered, this, &ArticleView::inspectElement);

ui.definition->installEventFilter( this );
ui.searchFrame->installEventFilter( this );
Expand Down Expand Up @@ -512,6 +505,25 @@ void ArticleView::showAnticipation()
ui.definition->setCursor( Qt::WaitCursor );
}

void ArticleView::inspectElement(){
QWebEnginePage *page = ui.definition->page();
if (inspectView == nullptr) {
inspectView = new QWebEngineView();
page->setDevToolsPage( inspectView->page() );
devDialog = new QDialog( this );
devDialog->setWindowTitle( tr( "Inspect" ) );
devDialog->setWindowFlags( Qt::Window );
devDialog->setAttribute( Qt::WidgetAttribute::WA_DeleteOnClose, false );
QVBoxLayout * v = new QVBoxLayout( devDialog );
v->setSpacing( 0 );
v->setContentsMargins( 0, 0, 0, 0 );
v->addWidget( inspectView );
}
page->triggerAction( QWebEnginePage::InspectElement );
devDialog->raise();
devDialog->show();
}

void ArticleView::loadFinished( bool result )
{
setZoomFactor(cfg.preferences.zoomFactor);
Expand Down
3 changes: 2 additions & 1 deletion articleview.hh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ArticleView: public QFrame

//used to hold the F12 inspect source view.
QWebEngineView *inspectView = nullptr;
QDialog * devDialog = nullptr;

/// Any resource we've decided to download off the dictionary gets stored here.
/// Full vector capacity is used for search requests, where we have to make
Expand Down Expand Up @@ -303,7 +304,7 @@ public slots:
//aim to receive signal from html. the fragment url click to navigation through page wil not be intecepted by weburlinteceptor
Q_INVOKABLE void linkClickedInHtml( QUrl const & );
private slots:

void inspectElement();
void loadFinished( bool ok );
void loadProgress(int);
void handleTitleChanged( QString const & title );
Expand Down
9 changes: 2 additions & 7 deletions gls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,8 @@ bool GlsScanner::readNextLine( wstring & out, size_t & offset )
readBufferPtr += pos;
linesRead++;

#ifdef __WIN32
out = line.toStdU32String();
#else
out = line.toStdU32String();
#endif
return true;

out = line.toStdU32String();
return true;
}
}

Expand Down
4 changes: 2 additions & 2 deletions goldendict.pro
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ win32 {
}


#RC_FILE = goldendict.rc
RC_FILE = goldendict.rc
INCLUDEPATH += winlibs/include

# Enable console in Debug mode on Windows, with useful logging messages
Expand Down Expand Up @@ -649,5 +649,5 @@ TS_OUT = $$TRANSLATIONS
TS_OUT ~= s/.ts/.qm/g
PRE_TARGETDEPS += $$TS_OUT

include( qtsingleapplication/src/qtsingleapplication.pri )
include( thirdparty/qtsingleapplication/src/qtsingleapplication.pri )

39 changes: 39 additions & 0 deletions goldendict.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include "windows.h"

IDI_ICON1 ICON DISCARDABLE "icons/programicon.ico"
IDI_ICON2 ICON DISCARDABLE "icons/programicon_old.ico"
#define GOLDENDICT_VER 1,5,0,0
#define GOLDENDICT_VER_STR "1.5.0"

#if !defined( _MSC_VER ) && !defined( GD_NO_MANIFEST ) // Visual Studio embeds the manifest automatically
1 RT_MANIFEST GoldenDict.exe.manifest
#endif

1 VERSIONINFO
FILEVERSION GOLDENDICT_VER
PRODUCTVERSION GOLDENDICT_VER
FILEFLAGS 0x0L
FILEFLAGSMASK 0x3fL
FILEOS 0x00040004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "GoldenDict"
VALUE "FileDescription", "GoldenDict dictionary lookup program"
VALUE "FileVersion", GOLDENDICT_VER_STR
VALUE "LegalCopyright", "www.goldendict.org"
VALUE "InternalName", "goldendict"
VALUE "OriginalFilename", "goldendict.exe"
VALUE "ProductName", "GoldenDict"
VALUE "ProductVersion", GOLDENDICT_VER_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END
2 changes: 1 addition & 1 deletion helpwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void HelpWindow::applyZoomFactor()

zoomInAction->setEnabled( cfg.preferences.helpZoomFactor < 5 );
zoomOutAction->setEnabled( cfg.preferences.helpZoomFactor > 0.2 );
zoomBaseAction->setEnabled( cfg.preferences.helpZoomFactor != 1.0 );
zoomBaseAction->setEnabled( !qFuzzyCompare(cfg.preferences.helpZoomFactor, 1.0) );

if( fontSize > 0 )
{
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3720,7 +3720,7 @@ void MainWindow::adjustCurrentZoomFactor()

zoomIn->setEnabled( cfg.preferences.zoomFactor < 5 );
zoomOut->setEnabled( cfg.preferences.zoomFactor > 0.1 );
zoomBase->setEnabled( cfg.preferences.zoomFactor != 1.0 );
zoomBase->setEnabled( !qFuzzyCompare( cfg.preferences.zoomFactor, 1.0 ) );
}

void MainWindow::scaleArticlesByCurrentZoomFactor()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a5a7af6

Please sign in to comment.