Browse Source

Add show/hide statusbar option

adaptive-webui-19844
takiz 9 years ago committed by Vladimir Golovnev (Glassez)
parent
commit
0940a8a764
  1. 10
      src/base/preferences.cpp
  2. 2
      src/base/preferences.h
  3. 10
      src/gui/mainwindow.cpp
  4. 1
      src/gui/mainwindow.h
  5. 9
      src/gui/mainwindow.ui

10
src/base/preferences.cpp

@ -181,6 +181,16 @@ void Preferences::setToolbarDisplayed(bool displayed)
setValue("Preferences/General/ToolbarDisplayed", 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 bool Preferences::minimizeToTray() const
{ {
return value("Preferences/General/MinimizeToTray", false).toBool(); return value("Preferences/General/MinimizeToTray", false).toBool();

2
src/base/preferences.h

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

10
src/gui/mainwindow.cpp

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

1
src/gui/mainwindow.h

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

9
src/gui/mainwindow.ui

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

Loading…
Cancel
Save