Skip to content

Commit

Permalink
Added config option UrlInWindowTitle (GitHub issue #77)
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Apr 26, 2018
1 parent a45f7fc commit 43a7e65
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
15 changes: 14 additions & 1 deletion README.md
Expand Up @@ -9,7 +9,7 @@ Target Platforms: Linux, BSD, Unix-like systems

License: GPL V2

Updated: 2018-02-08
Updated: 2018-04-26


## Overview
Expand Down Expand Up @@ -67,6 +67,19 @@ _Full-size images and descriptions on the [Screenshots Page](https://github.com/

**Latest stable release: V1.4**

- 2018-04-26 Implemented [GitHub issue #77](https://github.com/shundhammer/qdirstat/issues/77):
Show the current URL in the window title. This is disabled by default.
You can enable it manually in the config file (`~/.config/QDirStat/QDirStat.conf`):

[MainWindow]
...
UrlInWindowTitle=true

Some day this will be configurable in a new tab in the configuration dialog,
but right now there are only some very few options that would go to such a
"General" or "Misc" tab that it would look pretty lost and unorganized.


- 2018-02-08 Fixed [GitHub issue #74](https://github.com/shundhammer/qdirstat/issues/74):
Crash deleting folder while scan is in progress

Expand Down
9 changes: 7 additions & 2 deletions src/MainWindow.cpp
Expand Up @@ -54,6 +54,7 @@ MainWindow::MainWindow():
_configDialog(0),
_modified( false ),
_verboseSelection( false ),
_urlInWindowTitle( false ),
_statusBarTimeout( 3000 ), // millisec
_treeLevelMapper(0)
{
Expand Down Expand Up @@ -327,6 +328,7 @@ void MainWindow::readSettings()
bool showTreemap = settings.value( "ShowTreemap" , true ).toBool();
bool treemapOnSide = settings.value( "TreemapOnSide" , false ).toBool();
_verboseSelection = settings.value( "VerboseSelection" , false ).toBool();
_urlInWindowTitle = settings.value( "UrlInWindowTitle" , false ).toBool();

settings.endGroup();

Expand All @@ -351,6 +353,7 @@ void MainWindow::writeSettings()
settings.setValue( "ShowTreemap" , _ui->actionShowTreemap->isChecked() );
settings.setValue( "TreemapOnSide" , _ui->actionTreemapAsSidePanel->isChecked() );
settings.setValue( "VerboseSelection" , _verboseSelection );
settings.setValue( "UrlInWindowTitle" , _urlInWindowTitle );

settings.endGroup();

Expand Down Expand Up @@ -476,11 +479,13 @@ void MainWindow::openUrl( const QString & url )
try
{
_dirTreeModel->openUrl( url );
setWindowTitle( "QDirStat " + url );

if ( _urlInWindowTitle )
setWindowTitle( "QDirStat " + url );
}
catch ( const SysCallFailedException & ex )
{
setWindowFilePath( "QDirStat" );
setWindowTitle( "QDirStat" );
CAUGHT( ex );

QMessageBox errorPopup( QMessageBox::Warning, // icon
Expand Down
1 change: 1 addition & 0 deletions src/MainWindow.h
Expand Up @@ -306,6 +306,7 @@ protected slots:
QElapsedTimer _stopWatch;
bool _modified;
bool _verboseSelection;
bool _urlInWindowTitle;
int _statusBarTimeout; // millisec
QSignalMapper * _treeLevelMapper;
};
Expand Down

0 comments on commit 43a7e65

Please sign in to comment.