Skip to content

Commit 2133180

Browse files
opt: website script column disabled (#2685)
* opt: website script column disabled --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 8a5f9e3 commit 2133180

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

locale/crowdin.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,10 +3470,6 @@ from Stardict, Babylon and GLS dictionaries</source>
34703470
<source>Save debug messages to gd_log.txt in the config folder</source>
34713471
<translation type="unfinished"></translation>
34723472
</message>
3473-
<message>
3474-
<source>Open website dictionary in seperate tab</source>
3475-
<translation type="unfinished"></translation>
3476-
</message>
34773473
<message>
34783474
<source>S&amp;can</source>
34793475
<translation type="unfinished"></translation>
@@ -3486,6 +3482,10 @@ from Stardict, Babylon and GLS dictionaries</source>
34863482
<source>Suppress JavaScript dialogs</source>
34873483
<translation type="unfinished"></translation>
34883484
</message>
3485+
<message>
3486+
<source>Open website dictionary in separate tab</source>
3487+
<translation type="unfinished"></translation>
3488+
</message>
34893489
</context>
34903490
<context>
34913491
<name>ProgramTypeEditor</name>
@@ -4208,6 +4208,10 @@ Full list of availiable languages can be found &lt;a href=&quot;https://linguali
42084208
<source>Only available when opening websites in separate tabs. Can be a file path (relative to config directory or absolute) or direct script content.</source>
42094209
<translation type="unfinished"></translation>
42104210
</message>
4211+
<message>
4212+
<source>This column is disabled because &quot;Open website dictionary in separate tab&quot; option is not enabled in Preferences.</source>
4213+
<translation type="unfinished"></translation>
4214+
</message>
42114215
</context>
42124216
<context>
42134217
<name>WordFinder</name>

src/ui/edit_sources_models.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,10 @@ QVariant WebSitesModel::data( const QModelIndex & index, int role ) const
731731
}
732732

733733
if ( role == Qt::ToolTipRole ) {
734+
if ( index.column() == 4 && !GlobalBroadcaster::instance()->getPreference()->openWebsiteInNewTab ) {
735+
return tr(
736+
"This column is disabled because \"Open website dictionary in separate tab\" option is not enabled in Preferences." );
737+
}
734738
return QVariant();
735739
}
736740

@@ -749,13 +753,6 @@ QVariant WebSitesModel::data( const QModelIndex & index, int role ) const
749753
}
750754
}
751755

752-
// Set appropriate background for disabled Script column based on dark mode
753-
if ( role == Qt::BackgroundRole && index.column() == 4 ) { // Script column
754-
if ( !GlobalBroadcaster::instance()->getPreference()->openWebsiteInNewTab ) {
755-
return getScriptColumnBackground();
756-
}
757-
}
758-
759756
if ( role == Qt::CheckStateRole && !index.column() ) {
760757
return webSites[ index.row() ].enabled ? Qt::Checked : Qt::Unchecked;
761758
}

src/ui/preferences.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,7 @@ from Stardict, Babylon and GLS dictionaries</string>
19371937
<item>
19381938
<widget class="QCheckBox" name="openWebsiteInNewTab">
19391939
<property name="text">
1940-
<string>Open website dictionary in seperate tab</string>
1940+
<string>Open website dictionary in separate tab</string>
19411941
</property>
19421942
</widget>
19431943
</item>

0 commit comments

Comments
 (0)