CVS commit by ariya: action to show/hide the formula bar M +2 -1 kspread.rc 1.117 M +15 -1 kspread_view.cc 1.756 M +5 -0 kspread_view.h 1.243 --- koffice/kspread/kspread.rc #1.116:1.117 @@ -1,3 +1,3 @@ - + &File @@ -151,4 +151,5 @@ + --- koffice/kspread/kspread_view.cc #1.755:1.756 @@ -554,4 +554,5 @@ public: KToggleAction* showStatusBar; KToggleAction* showTabBar; + KToggleAction* showFormulaBar; KToggleAction* showCommentIndicator; KAction* preference; @@ -1170,4 +1171,10 @@ void ViewPrivate::initActions() actions->showTabBar->setToolTip(i18n("Show the tab bar.")); + actions->showFormulaBar = new KToggleAction( i18n("Show Formula Bar"), + 0, ac, "showFormulaBar" ); + QObject::connect( actions->showFormulaBar, SIGNAL( toggled( bool ) ), + view, SLOT( showFormulaBar( bool ) ) ); + actions->showFormulaBar->setToolTip(i18n("Show the formula bar.")); + actions->showCommentIndicator = new KToggleAction( i18n("Show Comment Indicator"), 0, ac, "showCommentIndicator" ); @@ -1347,4 +1354,5 @@ void ViewPrivate::adjustActions( bool mo actions->showStatusBar->setChecked( doc->showStatusBar() ); actions->showTabBar->setChecked( doc->showTabBar() ); + actions->showFormulaBar->setChecked( doc->showFormulaBar() ); actions->showCommentIndicator->setChecked( doc->showCommentIndicator() ); @@ -4636,4 +4644,10 @@ void KSpreadView::showTabBar( bool b ) } +void KSpreadView::showFormulaBar( bool b ) +{ + d->doc->setShowFormulaBar( b ); + refreshView(); +} + void KSpreadView::showCommentIndicator( bool b ) { @@ -4863,5 +4877,5 @@ void KSpreadView::refreshView() d->actions->alignRight->setEnabled( !active ); } - active = d->doc->getShowFormulaBar(); + active = d->doc->showFormulaBar(); editWidget()->showEditWidget( active ); --- koffice/kspread/kspread_view.h #1.242:1.243 @@ -459,4 +459,9 @@ public slots: /** + * Shows the formula bar if b is true, otherwise the formula bar will be hidden. + */ + void showFormulaBar( bool b ); + + /** * If b is true, a red triangle is displayed on the corner of cells * which have comments.