Don't show welcome page header in window title (issue #195)

This commit is contained in:
Abs62 2013-01-31 17:01:08 +04:00
parent fac836f29b
commit 9e3dd433a8
2 changed files with 15 additions and 1 deletions

View file

@ -77,6 +77,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
newReleaseCheckTimer( this ),
wordListSelChanged( false )
, wasMaximized( false )
, blockUpdateWindowTitle( false )
#ifdef Q_OS_WIN32
, gdAskMessage( 0xFFFFFFFF )
#endif
@ -634,6 +635,9 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
// After we have dictionaries and groups, we can populate history
// historyChanged();
setWindowTitle( "GoldenDict" );
blockUpdateWindowTitle = true;
addNewTab();
// Create tab list menu
@ -646,6 +650,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
history.enableAdd( false );
blockUpdateWindowTitle = true;
view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId );
history.enableAdd( cfg.preferences.storeHistory );
@ -1474,7 +1480,13 @@ void MainWindow::updateWindowTitle()
ArticleView *view = getCurrentArticleView();
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;
}
}
}

View file

@ -152,6 +152,8 @@ private:
bool wasMaximized; // Window state before minimization
bool blockUpdateWindowTitle;
QPrinter & getPrinter(); // Creates a printer if it's not there and returns it
/// Applies the qt's stylesheet, given the style's name.