mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Don't show welcome page header in window title (issue #195)
This commit is contained in:
parent
fac836f29b
commit
9e3dd433a8
|
@ -77,6 +77,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
newReleaseCheckTimer( this ),
|
newReleaseCheckTimer( this ),
|
||||||
wordListSelChanged( false )
|
wordListSelChanged( false )
|
||||||
, wasMaximized( false )
|
, wasMaximized( false )
|
||||||
|
, blockUpdateWindowTitle( false )
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
, gdAskMessage( 0xFFFFFFFF )
|
, gdAskMessage( 0xFFFFFFFF )
|
||||||
#endif
|
#endif
|
||||||
|
@ -634,6 +635,9 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
// After we have dictionaries and groups, we can populate history
|
// After we have dictionaries and groups, we can populate history
|
||||||
// historyChanged();
|
// historyChanged();
|
||||||
|
|
||||||
|
setWindowTitle( "GoldenDict" );
|
||||||
|
|
||||||
|
blockUpdateWindowTitle = true;
|
||||||
addNewTab();
|
addNewTab();
|
||||||
|
|
||||||
// Create tab list menu
|
// Create tab list menu
|
||||||
|
@ -646,6 +650,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
|
|
||||||
history.enableAdd( false );
|
history.enableAdd( false );
|
||||||
|
|
||||||
|
blockUpdateWindowTitle = true;
|
||||||
|
|
||||||
view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId );
|
view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId );
|
||||||
|
|
||||||
history.enableAdd( cfg.preferences.storeHistory );
|
history.enableAdd( cfg.preferences.storeHistory );
|
||||||
|
@ -1474,7 +1480,13 @@ void MainWindow::updateWindowTitle()
|
||||||
ArticleView *view = getCurrentArticleView();
|
ArticleView *view = getCurrentArticleView();
|
||||||
if ( view )
|
if ( view )
|
||||||
{
|
{
|
||||||
setWindowTitle( tr( "%1 - %2" ).arg( view->getTitle(), tr ( "GoldenDict" ) ) );
|
QString str = view->getTitle();
|
||||||
|
if( !str.isEmpty() )
|
||||||
|
{
|
||||||
|
if( !blockUpdateWindowTitle )
|
||||||
|
setWindowTitle( tr( "%1 - %2" ).arg( str, tr ( "GoldenDict" ) ) );
|
||||||
|
blockUpdateWindowTitle = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,8 @@ private:
|
||||||
|
|
||||||
bool wasMaximized; // Window state before minimization
|
bool wasMaximized; // Window state before minimization
|
||||||
|
|
||||||
|
bool blockUpdateWindowTitle;
|
||||||
|
|
||||||
QPrinter & getPrinter(); // Creates a printer if it's not there and returns it
|
QPrinter & getPrinter(); // Creates a printer if it's not there and returns it
|
||||||
|
|
||||||
/// Applies the qt's stylesheet, given the style's name.
|
/// Applies the qt's stylesheet, given the style's name.
|
||||||
|
|
Loading…
Reference in a new issue