diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 0a5d792cb..000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,4 +0,0 @@ -template: | - ## What’s Changed - - $CHANGES \ No newline at end of file diff --git a/.github/workflows/release_drafter_workflow.yml b/.github/workflows/release_drafter_workflow.yml deleted file mode 100644 index ea06ddf2f..000000000 --- a/.github/workflows/release_drafter_workflow.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Release Drafter - -on: - workflow_dispatch: - push: - # branches to consider in the event; optional, defaults to all - branches: - - staged - # pull_request event is required only for autolabeler - pull_request: - # Only following types are handled by the action, but one can default to all as well - # types: [opened, reopened, synchronize] - # pull_request_target event is required for autolabeler to support PRs from forks - # pull_request_target: - # types: [opened, reopened, synchronize] - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # (Optional) GitHub Enterprise requires GHE_HOST variable set - #- name: Set GHE_HOST - # run: | - # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV - - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@master - # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # with: - # config-name: my-config.yml - # disable-autolabeler: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/GoldenDict.exe.manifest b/GoldenDict.exe.manifest new file mode 100644 index 000000000..c1375d4ee --- /dev/null +++ b/GoldenDict.exe.manifest @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 2b13aceee..c273367a1 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/articleview.cc b/articleview.cc index 4b1ac8917..f1506402d 100644 --- a/articleview.cc +++ b/articleview.cc @@ -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 ); @@ -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); diff --git a/articleview.hh b/articleview.hh index 521756b81..1fb0c86c8 100644 --- a/articleview.hh +++ b/articleview.hh @@ -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 @@ -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 ); diff --git a/gls.cc b/gls.cc index 9702d4e1c..a0a26cac0 100644 --- a/gls.cc +++ b/gls.cc @@ -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; } } diff --git a/goldendict.pro b/goldendict.pro index 113eb5209..507546d41 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -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 @@ -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 ) diff --git a/goldendict.rc b/goldendict.rc new file mode 100644 index 000000000..f6fbce0cb --- /dev/null +++ b/goldendict.rc @@ -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 diff --git a/helpwindow.cc b/helpwindow.cc index 8630afcbb..fb81d04d9 100644 --- a/helpwindow.cc +++ b/helpwindow.cc @@ -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 ) { diff --git a/mainwindow.cc b/mainwindow.cc index 70fbb37f7..ee475d1b7 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -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() diff --git a/qtsingleapplication/INSTALL.TXT b/thirdparty/qtsingleapplication/INSTALL.TXT similarity index 100% rename from qtsingleapplication/INSTALL.TXT rename to thirdparty/qtsingleapplication/INSTALL.TXT diff --git a/qtsingleapplication/README.TXT b/thirdparty/qtsingleapplication/README.TXT similarity index 100% rename from qtsingleapplication/README.TXT rename to thirdparty/qtsingleapplication/README.TXT diff --git a/qtsingleapplication/source.txt b/thirdparty/qtsingleapplication/source.txt similarity index 100% rename from qtsingleapplication/source.txt rename to thirdparty/qtsingleapplication/source.txt diff --git a/qtsingleapplication/src/QtLockedFile b/thirdparty/qtsingleapplication/src/QtLockedFile similarity index 100% rename from qtsingleapplication/src/QtLockedFile rename to thirdparty/qtsingleapplication/src/QtLockedFile diff --git a/qtsingleapplication/src/QtSingleApplication b/thirdparty/qtsingleapplication/src/QtSingleApplication similarity index 100% rename from qtsingleapplication/src/QtSingleApplication rename to thirdparty/qtsingleapplication/src/QtSingleApplication diff --git a/qtsingleapplication/src/qtlocalpeer.cpp b/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp similarity index 100% rename from qtsingleapplication/src/qtlocalpeer.cpp rename to thirdparty/qtsingleapplication/src/qtlocalpeer.cpp diff --git a/qtsingleapplication/src/qtlocalpeer.h b/thirdparty/qtsingleapplication/src/qtlocalpeer.h similarity index 100% rename from qtsingleapplication/src/qtlocalpeer.h rename to thirdparty/qtsingleapplication/src/qtlocalpeer.h diff --git a/qtsingleapplication/src/qtlockedfile.cpp b/thirdparty/qtsingleapplication/src/qtlockedfile.cpp similarity index 100% rename from qtsingleapplication/src/qtlockedfile.cpp rename to thirdparty/qtsingleapplication/src/qtlockedfile.cpp diff --git a/qtsingleapplication/src/qtlockedfile.h b/thirdparty/qtsingleapplication/src/qtlockedfile.h similarity index 100% rename from qtsingleapplication/src/qtlockedfile.h rename to thirdparty/qtsingleapplication/src/qtlockedfile.h diff --git a/qtsingleapplication/src/qtlockedfile_unix.cpp b/thirdparty/qtsingleapplication/src/qtlockedfile_unix.cpp similarity index 100% rename from qtsingleapplication/src/qtlockedfile_unix.cpp rename to thirdparty/qtsingleapplication/src/qtlockedfile_unix.cpp diff --git a/qtsingleapplication/src/qtlockedfile_win.cpp b/thirdparty/qtsingleapplication/src/qtlockedfile_win.cpp similarity index 100% rename from qtsingleapplication/src/qtlockedfile_win.cpp rename to thirdparty/qtsingleapplication/src/qtlockedfile_win.cpp diff --git a/qtsingleapplication/src/qtsingleapplication.cpp b/thirdparty/qtsingleapplication/src/qtsingleapplication.cpp similarity index 100% rename from qtsingleapplication/src/qtsingleapplication.cpp rename to thirdparty/qtsingleapplication/src/qtsingleapplication.cpp diff --git a/qtsingleapplication/src/qtsingleapplication.h b/thirdparty/qtsingleapplication/src/qtsingleapplication.h similarity index 100% rename from qtsingleapplication/src/qtsingleapplication.h rename to thirdparty/qtsingleapplication/src/qtsingleapplication.h diff --git a/qtsingleapplication/src/qtsingleapplication.pri b/thirdparty/qtsingleapplication/src/qtsingleapplication.pri similarity index 100% rename from qtsingleapplication/src/qtsingleapplication.pri rename to thirdparty/qtsingleapplication/src/qtsingleapplication.pri diff --git a/qtsingleapplication/src/qtsinglecoreapplication.cpp b/thirdparty/qtsingleapplication/src/qtsinglecoreapplication.cpp similarity index 100% rename from qtsingleapplication/src/qtsinglecoreapplication.cpp rename to thirdparty/qtsingleapplication/src/qtsinglecoreapplication.cpp diff --git a/qtsingleapplication/src/qtsinglecoreapplication.h b/thirdparty/qtsingleapplication/src/qtsinglecoreapplication.h similarity index 100% rename from qtsingleapplication/src/qtsinglecoreapplication.h rename to thirdparty/qtsingleapplication/src/qtsinglecoreapplication.h diff --git a/qtsingleapplication/src/qtsinglecoreapplication.pri b/thirdparty/qtsingleapplication/src/qtsinglecoreapplication.pri similarity index 100% rename from qtsingleapplication/src/qtsinglecoreapplication.pri rename to thirdparty/qtsingleapplication/src/qtsinglecoreapplication.pri