1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 04:54:18 +00:00

Add show/hide statusbar option

This commit is contained in:
takiz 2015-10-30 18:03:44 +05:00 committed by Vladimir Golovnev (Glassez)
parent 1f9ccb44a3
commit 0940a8a764
5 changed files with 32 additions and 0 deletions

View File

@ -181,6 +181,16 @@ void Preferences::setToolbarDisplayed(bool displayed)
setValue("Preferences/General/ToolbarDisplayed", displayed);
}
bool Preferences::isStatusbarDisplayed() const
{
return value("Preferences/General/StatusbarDisplayed", true).toBool();
}
void Preferences::setStatusbarDisplayed(bool displayed)
{
setValue("Preferences/General/StatusbarDisplayed", displayed);
}
bool Preferences::minimizeToTray() const
{
return value("Preferences/General/MinimizeToTray", false).toBool();

View File

@ -119,6 +119,8 @@ public:
void setSystrayIntegration(bool enabled);
bool isToolbarDisplayed() const;
void setToolbarDisplayed(bool displayed);
bool isStatusbarDisplayed() const;
void setStatusbarDisplayed(bool displayed);
bool minimizeToTray() const;
void setMinimizeToTray(bool b);
bool closeToTray() const;

View File

@ -300,6 +300,7 @@ MainWindow::MainWindow(QWidget *parent)
// View settings
m_ui->actionTopToolBar->setChecked(pref->isToolbarDisplayed());
m_ui->actionShowStatusbar->setChecked(pref->isStatusbarDisplayed());
m_ui->actionSpeedInTitleBar->setChecked(pref->speedInTitleBar());
m_ui->actionRSSReader->setChecked(pref->isRSSWidgetEnabled());
m_ui->actionSearchWidget->setChecked(pref->isSearchEnabled());
@ -1284,6 +1285,8 @@ void MainWindow::loadPreferences(bool configureSession)
m_ui->toolBar->setVisible(false);
}
m_statusBar->setVisible(pref->isStatusbarDisplayed());
if (pref->preventFromSuspend() && !m_preventTimer->isActive()) {
m_preventTimer->start(PREVENT_SUSPEND_INTERVAL);
}
@ -1543,6 +1546,13 @@ void MainWindow::on_actionTopToolBar_triggered()
Preferences::instance()->setToolbarDisplayed(isVisible);
}
void MainWindow::on_actionShowStatusbar_triggered()
{
bool isVisible = static_cast<QAction*>(sender())->isChecked();
m_statusBar->setVisible(isVisible);
Preferences::instance()->setStatusbarDisplayed(isVisible);
}
void MainWindow::on_actionSpeedInTitleBar_triggered()
{
m_displaySpeedInTitle = static_cast<QAction * >(sender())->isChecked();

View File

@ -155,6 +155,7 @@ private slots:
void on_actionRSSReader_triggered();
void on_actionSpeedInTitleBar_triggered();
void on_actionTopToolBar_triggered();
void on_actionShowStatusbar_triggered();
void on_actionDonateMoney_triggered();
void on_actionExecutionLogs_triggered(bool checked);
void on_actionNormalMessages_triggered(bool checked);

View File

@ -110,6 +110,7 @@
</widget>
<addaction name="separator"/>
<addaction name="actionTopToolBar"/>
<addaction name="actionShowStatusbar"/>
<addaction name="actionSpeedInTitleBar"/>
<addaction name="separator"/>
<addaction name="actionSearchWidget"/>
@ -300,6 +301,14 @@
<string>Display Top Toolbar</string>
</property>
</action>
<action name="actionShowStatusbar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Status &amp;Bar</string>
</property>
</action>
<action name="actionSpeedInTitleBar">
<property name="checkable">
<bool>true</bool>