Added option to hide toolbars.

This commit is contained in:
Martin Rotter 2014-03-27 13:43:13 +01:00
parent 2399c39d1f
commit 2629136a77
5 changed files with 41 additions and 1 deletions

View File

@ -10,6 +10,7 @@ Fixed:
Added:
<ul>
<li>Added option to hide main toolbars.</li>
<li>"Defragment database" button shortcut is now changeable.</li>
<li>Added option to clear keyboard shortcuts.</li>
<li>Added "progress bar" to web browser.</li>

View File

@ -97,6 +97,9 @@ void FeedMessageViewer::saveSize() {
KEY_MESSAGES_VIEW + QString::number(MSG_DB_DCREATED_INDEX),
width_column_date);
}
// Store "visibility" of toolbars.
settings->setValue(APP_CFG_GUI, "enable_toolbars", m_toolBarsEnabled);
}
void FeedMessageViewer::loadSize() {
@ -132,6 +135,12 @@ void FeedMessageViewer::quit() {
m_feedDownloader->deleteLater();
}
void FeedMessageViewer::setToolBarsEnabled(bool enable) {
m_toolBarsEnabled = enable;
m_toolBarFeeds->setVisible(enable);
m_toolBarMessages->setVisible(enable);
}
void FeedMessageViewer::updateTrayIconStatus(int unread_messages,
int total_messages) {
Q_UNUSED(total_messages)
@ -263,6 +272,8 @@ void FeedMessageViewer::createConnections() {
SIGNAL(triggered()), this, SLOT(switchFeedComponentVisibility()));
connect(form_main->m_ui->m_actionSelectNextFeedCategory,
SIGNAL(triggered()), m_feedsView, SLOT(selectNextItem()));
connect(form_main->m_ui->m_actionSwitchToolBars,
SIGNAL(toggled(bool)), this, SLOT(setToolBarsEnabled(bool)));
connect(form_main->m_ui->m_actionSelectPreviousFeedCategory,
SIGNAL(triggered()), m_feedsView, SLOT(selectPreviousItem()));
connect(form_main->m_ui->m_actionSelectNextMessage,

View File

@ -60,7 +60,14 @@ class FeedMessageViewer : public TabContent {
// stops any child widgets/workers.
void quit();
inline bool areToolBarsEnabled() const {
return m_toolBarsEnabled;
}
public slots:
// Enables/disables main toolbars.
void setToolBarsEnabled(bool enable);
// Runs "cleanup" of the database.
void vacuumDatabase();
@ -91,6 +98,7 @@ class FeedMessageViewer : public TabContent {
void createConnections();
private:
bool m_toolBarsEnabled;
QToolBar *m_toolBarFeeds;
QToolBar *m_toolBarMessages;

View File

@ -92,7 +92,7 @@ QList<QAction*> FormMain::allActions() {
actions << m_ui->m_actionSettings << m_ui->m_actionQuit <<
m_ui->m_actionFullscreen << m_ui->m_actionAboutGuard <<
m_ui->m_actionSwitchFeedsList << m_ui->m_actionSwitchMainWindow <<
m_ui->m_actionSwitchMainMenu;
m_ui->m_actionSwitchMainMenu << m_ui->m_actionSwitchToolBars;
// Add web browser actions
actions << m_ui->m_actionAddBrowser << m_ui->m_actionCloseCurrentTab <<
@ -271,6 +271,7 @@ void FormMain::setupIcons() {
m_ui->m_actionFullscreen->setIcon(icon_theme_factory->fromTheme("view-fullscreen"));
m_ui->m_actionSwitchFeedsList->setIcon(icon_theme_factory->fromTheme("view-switch-list"));
m_ui->m_actionSwitchMainMenu->setIcon(icon_theme_factory->fromTheme("view-switch-menu"));
m_ui->m_actionSwitchToolBars->setIcon(icon_theme_factory->fromTheme("view-switch-list"));
m_ui->m_menuShowHide->setIcon(icon_theme_factory->fromTheme("view-switch"));
// Web browser.
@ -339,6 +340,7 @@ void FormMain::loadSize() {
// Adjust dimensions of "feeds & messages" widget.
m_ui->m_tabWidget->feedMessageViewer()->loadSize();
m_ui->m_actionSwitchToolBars->setChecked(settings->value(APP_CFG_GUI, "enable_toolbars", true).toBool());
}
void FormMain::saveSize() {

View File

@ -76,6 +76,7 @@
<addaction name="m_actionFullscreen"/>
<addaction name="m_actionSwitchFeedsList"/>
<addaction name="m_actionSwitchMainMenu"/>
<addaction name="m_actionSwitchToolBars"/>
</widget>
<addaction name="m_menuShowHide"/>
<addaction name="m_actionSwitchMainWindow"/>
@ -497,6 +498,23 @@
<string>Report a &amp;bug...</string>
</property>
</action>
<action name="m_actionSwitchToolBars">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Toolbars</string>
</property>
<property name="toolTip">
<string>Switch visibility of main toolbars.</string>
</property>
<property name="shortcut">
<string notr="true">T</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>