diff --git a/mainwindow.cc b/mainwindow.cc index 0a9956ac..b1775a89 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -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; + } } } diff --git a/mainwindow.hh b/mainwindow.hh index 35a5cfe8..bdf7f972 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -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.