Merge branch 'dictionaries-dialog-save-restore-geometry' of https://github.com/vedgy/goldendict into Temp

This commit is contained in:
Abs62 2021-06-23 20:47:25 +03:00
commit bc7fe1a3a8
3 changed files with 12 additions and 0 deletions

View file

@ -1100,6 +1100,11 @@ Class load() THROW_SPEC( exError )
if ( !inspectorGeometry.isNull() )
c.inspectorGeometry = QByteArray::fromBase64( inspectorGeometry.toElement().text().toLatin1() );
QDomNode dictionariesDialogGeometry = root.namedItem( "dictionariesDialogGeometry" );
if ( !dictionariesDialogGeometry.isNull() )
c.dictionariesDialogGeometry = QByteArray::fromBase64( dictionariesDialogGeometry.toElement().text().toLatin1() );
QDomNode timeForNewReleaseCheck = root.namedItem( "timeForNewReleaseCheck" );
if ( !timeForNewReleaseCheck.isNull() )
@ -2094,6 +2099,10 @@ void save( Class const & c ) THROW_SPEC( exError )
opt.appendChild( dd.createTextNode( QString::fromLatin1( c.inspectorGeometry.toBase64() ) ) );
root.appendChild( opt );
opt = dd.createElement( "dictionariesDialogGeometry" );
opt.appendChild( dd.createTextNode( QString::fromLatin1( c.dictionariesDialogGeometry.toBase64() ) ) );
root.appendChild( opt );
opt = dd.createElement( "timeForNewReleaseCheck" );
opt.appendChild( dd.createTextNode( c.timeForNewReleaseCheck.toString( Qt::ISODate ) ) );
root.appendChild( opt );

View file

@ -677,6 +677,7 @@ struct Class
QByteArray popupWindowGeometry; // Geometry saved by QMainWindow
QByteArray dictInfoGeometry; // Geometry of "Dictionary info" window
QByteArray inspectorGeometry; // Geometry of WebKit inspector window
QByteArray dictionariesDialogGeometry; // Geometry of Dictionaries dialog
QByteArray helpWindowGeometry; // Geometry of help window
QByteArray helpSplitterState; // Geometry of help splitter

View file

@ -2035,7 +2035,9 @@ void MainWindow::editDictionaries( unsigned editDictionaryGroup )
if ( editDictionaryGroup != Instances::Group::NoGroupId )
dicts.editGroup( editDictionaryGroup );
dicts.restoreGeometry( cfg.dictionariesDialogGeometry );
dicts.exec();
cfg.dictionariesDialogGeometry = newCfg.dictionariesDialogGeometry = dicts.saveGeometry();
if ( dicts.areDictionariesChanged() || dicts.areGroupsChanged() )
{