-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Free space on disk label in status bar (Closes #6764) #6791
Conversation
@LordNyriox the drive of the default save path. |
Maybe it is better to show free space for a torrent target mount point in a tooltip for the transfers list? |
You mean instead of showing the free space in status bar, I make it shows when the user hover over a torrent (row) in transfer list ? |
Yes. Wouldn't it make more sense that way? |
Personally, I like it more in status bar because most of users download to the same mount point (different folders, yes), by that way I keep an eye on my "main" save area. |
There are many tools to monitor free disk space. Why do you want to do this via a download manager, which is hidden in system tray most of the time? |
To keep an eye on my "main" save area. I don't auto download torrents via RSS. I manually add torrents to qbt. |
Bad idea. That would exclude showing in a tooltip things that actually belong in a tooltip such as the full string of an elided string. |
How? Tooltip can show anything you want. |
Not technically of course. Sure you can use a modifier key for different tooltips or some other condition but that would be unintuitive in this case IMO. |
src/gui/statusbar.cpp
Outdated
{ | ||
QString defaultPath = BitTorrent::Session::instance()->defaultSavePath(); | ||
m_freeSpaceOnDiskLbl->setText(tr("Free space: %1").arg(Utils::Misc::friendlyUnit(Utils::Fs::freeDiskSpaceOnPath(defaultPath)))); | ||
m_freeSpaceOnDiskLbl->setToolTip(defaultPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a bit more expressive tooltip here.
Something like:
setToolTip(QLatin1String("Free disk space in default save path:") + '\n' + defaultPath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about ?
setToolTip(tr("Free disk space in default save path:") + '\n' + defaultPath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This title is drawn over two header lines in the tooltip, maybe we can do
setToolTip(tr("Default save path:") + '\n' + defaultPath)
What do you think?
Also I prefer moving this widget to the left of |
src/gui/statusbar.cpp
Outdated
{ | ||
QString defaultPath = BitTorrent::Session::instance()->defaultSavePath(); | ||
m_freeSpaceOnDiskLbl->setText(tr("Free space: %1").arg(Utils::Misc::friendlyUnit(Utils::Fs::freeDiskSpaceOnPath(defaultPath)))); | ||
m_freeSpaceOnDiskLbl->setToolTip(QString::fromUtf8("<b>") + tr("Default save path:") + QString::fromUtf8("</b><br>") + '\n' + defaultPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setToolTip(QString("<b>%1</b><br>%2").arg(tr("Default save path:"), defaultPath))
There is a translated string for "Default Save Path:" is there any way to use it here? (writing it in the |
@thalieht I think all translatable strings can be translated using |
Yes but i mean that since there is already a translated string why not use it if it's possible. |
src/gui/statusbar.h
Outdated
QPushButton *m_connecStatusLblIcon; | ||
QPushButton *m_altSpeedsBtn; | ||
QWidget *m_container; | ||
QHBoxLayout *m_layout; | ||
void updateFreeSpaceOnDisk(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this up, to just below void updateSpeedLabels();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/gui/statusbar.h
Outdated
QPushButton *m_connecStatusLblIcon; | ||
QPushButton *m_altSpeedsBtn; | ||
QWidget *m_container; | ||
QHBoxLayout *m_layout; | ||
QHBoxLayout *m_layout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove trailing spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
I added WebUI support, Do you think I have to push the new commits as a new PR or just squash it to this PR? PS: the new changes are independent of this PR, I mean that if @evsh sees that this PR is useless I think he won't mind tracking the free space via WebUI of a headless machine. |
New PR, this one is already approved by some of the devs. |
I'm against this feature: unrelated to the app purpose, barely useful and thus waste of resources and screen space. The same in WebUI makes much more sense, because qBt can run on another machine. Do not have any comments to the code. |
Yeah, you can still add the display of the current time :) |
I think I got what you mean and I think you're totally right. It's quite more useful to have this in WebUI. I think we can close this and think about #6829 |
So, done here. Close it ? |
Currently, this PR gives "Free space: 0B". Works after PR #6785.
Free space calculation done against default save path with a tooltip shows the default save path.
Result: