You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1043 lines
37 KiB
1043 lines
37 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
Copyright (C) 2005 Raphael Langerhorst <raphael.langerhorst@kdemail.net>
|
||
|
(C) 2002-2004 Ariya Hidayat <ariya@kde.org>
|
||
|
(C) 2002-2003 Norbert Andres <nandres@web.de>
|
||
|
(C) 2000-2005 Laurent Montel <montel@kde.org>
|
||
|
(C) 2002 John Dailey <dailey@vt.edu>
|
||
|
(C) 2002 Philipp Mueller <philipp.mueller@gmx.de>
|
||
|
(C) 2001-2002 David Faure <faure@kde.org>
|
||
|
(C) 2001 Werner Trobin <trobin@kde.org>
|
||
|
(C) 2000 Bernd Johannes Wuebben <wuebben@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
14 years ago
|
#include <tqvbox.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
14 years ago
|
#include <tqcheckbox.h>
|
||
|
#include <tqcombobox.h>
|
||
|
#include <tqvgroupbox.h>
|
||
|
#include <tqwhatsthis.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdeconfig.h>
|
||
15 years ago
|
#include <kstatusbar.h>
|
||
|
#include <knuminput.h>
|
||
12 years ago
|
#include <tdespell.h>
|
||
12 years ago
|
#include <tdemessagebox.h>
|
||
13 years ago
|
#include <tdeversion.h>
|
||
15 years ago
|
#include <kcolorbutton.h>
|
||
|
|
||
|
#include <KoTabBar.h>
|
||
|
#include <KoSpeaker.h>
|
||
|
|
||
|
#include "kspread_sheet.h"
|
||
|
#include "kspread_sheetprint.h"
|
||
|
#include "kspread_doc.h"
|
||
|
#include "kspread_canvas.h"
|
||
|
#include "kspread_view.h"
|
||
|
#include "kspread_locale.h"
|
||
|
#include "kspread_editors.h"
|
||
|
|
||
|
#include "kspread_dlg_preference.h"
|
||
|
|
||
|
using namespace KSpread;
|
||
|
|
||
14 years ago
|
PreferenceDialog::PreferenceDialog( View* parent, const char* /*name*/)
|
||
15 years ago
|
: KDialogBase(KDialogBase::IconList,i18n("Configure KSpread") ,
|
||
|
KDialogBase::Ok | KDialogBase::Cancel| KDialogBase::Default,
|
||
|
KDialogBase::Ok)
|
||
|
|
||
|
{
|
||
14 years ago
|
m_pView=parent;
|
||
15 years ago
|
|
||
14 years ago
|
connect(this, TQT_SIGNAL(okClicked()),this,TQT_SLOT(slotApply()));
|
||
15 years ago
|
|
||
10 years ago
|
TQVBox *page2=addVBoxPage(i18n("Locale Settings"), TQString(),BarIcon("go-home",TDEIcon::SizeMedium));
|
||
14 years ago
|
_localePage=new parameterLocale(parent,page2 );
|
||
15 years ago
|
|
||
12 years ago
|
TQVBox *page3=addVBoxPage(i18n("Interface"), TQString(),BarIcon("signature", TDEIcon::SizeMedium) );
|
||
14 years ago
|
_configure = new configure(parent,page3 );
|
||
15 years ago
|
|
||
12 years ago
|
TQVBox * page4=addVBoxPage(i18n("Misc"), TQString(),BarIcon("misc",TDEIcon::SizeMedium) );
|
||
14 years ago
|
_miscParameter = new miscParameters(parent,page4 );
|
||
15 years ago
|
|
||
12 years ago
|
TQVBox *page5=addVBoxPage(i18n("Color"), TQString(),BarIcon("colorize",TDEIcon::SizeMedium) );
|
||
14 years ago
|
_colorParameter=new colorParameters(parent,page5 );
|
||
15 years ago
|
|
||
12 years ago
|
TQVBox *page6=addVBoxPage(i18n("Page Layout"), TQString(),BarIcon("edit",TDEIcon::SizeMedium) );
|
||
14 years ago
|
_layoutPage=new configureLayoutPage(parent,page6 );
|
||
15 years ago
|
|
||
14 years ago
|
TQVBox *page7 = addVBoxPage( i18n("Spelling"), i18n("Spell Checker Behavior"),
|
||
10 years ago
|
BarIcon("tools-check-spelling", TDEIcon::SizeMedium) );
|
||
14 years ago
|
_spellPage=new configureSpellPage(parent,page7);
|
||
15 years ago
|
|
||
|
if (KoSpeaker::isKttsdInstalled()) {
|
||
14 years ago
|
TQVBox *page8 = addVBoxPage( i18n("Abbreviation for Text-to-Speech", "TTS"),
|
||
12 years ago
|
i18n("Text-to-Speech Settings"), BarIcon("access", TDEIcon::SizeMedium) );
|
||
14 years ago
|
_ttsPage=new configureTTSPage(parent, page8);
|
||
15 years ago
|
} else _ttsPage = 0;
|
||
|
|
||
|
}
|
||
|
|
||
|
void PreferenceDialog::openPage(int flags)
|
||
|
{
|
||
|
if(flags & KS_LOCALE)
|
||
|
showPage( 0 );
|
||
|
else if(flags & KS_INTERFACE)
|
||
|
showPage( 1 );
|
||
|
else if(flags & KS_MISC)
|
||
|
showPage( 2 );
|
||
|
else if(flags & KS_COLOR)
|
||
|
showPage( 3 );
|
||
|
else if(flags & KS_LAYOUT)
|
||
|
showPage( 4 );
|
||
|
else if(flags & KS_SPELLING)
|
||
|
showPage( 5 );
|
||
|
}
|
||
|
|
||
|
void PreferenceDialog::slotApply()
|
||
|
{
|
||
|
m_pView->doc()->emitBeginOperation( false );
|
||
|
_configure->apply();
|
||
|
_miscParameter->apply();
|
||
|
_colorParameter->apply();
|
||
|
_layoutPage->apply();
|
||
|
_spellPage->apply();
|
||
|
_localePage->apply();
|
||
|
if (_ttsPage) _ttsPage->apply();
|
||
|
m_pView->doc()->refreshInterface();
|
||
|
m_pView->slotUpdateView( m_pView->activeSheet() );
|
||
|
}
|
||
|
|
||
|
void PreferenceDialog::slotDefault()
|
||
|
{
|
||
|
switch(activePageIndex())
|
||
|
{
|
||
|
case 1:
|
||
|
_configure->slotDefault();
|
||
|
break;
|
||
|
case 2:
|
||
|
_miscParameter->slotDefault();
|
||
|
break;
|
||
|
case 3:
|
||
|
_colorParameter->slotDefault();
|
||
|
break;
|
||
|
case 4:
|
||
|
_layoutPage->slotDefault();
|
||
|
break;
|
||
|
case 5:
|
||
|
_spellPage->slotDefault();
|
||
|
break;
|
||
|
case 6:
|
||
|
_ttsPage->slotDefault();
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
parameterLocale::parameterLocale( View* _view, TQVBox *box , char *name )
|
||
14 years ago
|
:TQObject ( box->parent(),name)
|
||
15 years ago
|
{
|
||
|
m_pView = _view;
|
||
|
m_bUpdateLocale=false;
|
||
14 years ago
|
TQGroupBox* tmpTQGroupBox = new TQVGroupBox( i18n("Settings"), box, "GroupBox" );
|
||
15 years ago
|
|
||
12 years ago
|
TDELocale* locale=_view->doc()->locale();
|
||
15 years ago
|
|
||
14 years ago
|
m_language=new TQLabel( tmpTQGroupBox,"label");
|
||
|
m_number=new TQLabel( tmpTQGroupBox,"label6");
|
||
|
m_date=new TQLabel( tmpTQGroupBox,"label1");
|
||
|
m_shortDate=new TQLabel( tmpTQGroupBox,"label5");
|
||
|
m_time=new TQLabel( tmpTQGroupBox,"label2");
|
||
|
m_money=new TQLabel( tmpTQGroupBox,"label3");
|
||
15 years ago
|
|
||
|
updateToMatchLocale(locale);
|
||
|
|
||
14 years ago
|
m_updateButton=new TQPushButton ( i18n("&Update Locale Settings"), tmpTQGroupBox);
|
||
|
connect(m_updateButton, TQT_SIGNAL(clicked()),this,TQT_SLOT(updateDefaultSystemConfig()));
|
||
15 years ago
|
}
|
||
|
|
||
|
void parameterLocale::apply()
|
||
|
{
|
||
|
if (m_bUpdateLocale)
|
||
|
{
|
||
|
m_pView->doc()->emitBeginOperation( false );
|
||
|
m_pView->doc()->refreshLocale();
|
||
|
m_pView->slotUpdateView( m_pView->activeSheet() );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void parameterLocale::updateDefaultSystemConfig()
|
||
|
{
|
||
|
m_bUpdateLocale=true;
|
||
|
static_cast<Locale*>(m_pView->doc()->locale())->defaultSystemConfig( );
|
||
12 years ago
|
TDELocale* locale=m_pView->doc()->locale();
|
||
15 years ago
|
updateToMatchLocale( locale );
|
||
|
}
|
||
|
|
||
12 years ago
|
void parameterLocale::updateToMatchLocale(TDELocale* locale)
|
||
15 years ago
|
{
|
||
13 years ago
|
m_language->setText( i18n("Language: %1").arg( locale->language() ));
|
||
|
m_number->setText( i18n("Default number format: %1").arg( locale->formatNumber(12.55) ));
|
||
|
m_date->setText( i18n("Long date format: %1").arg( locale->formatDate( TQDate::currentDate() )));
|
||
|
m_shortDate->setText( i18n("Short date format: %1").arg( locale->formatDate( TQDate::currentDate() ,true) ));
|
||
|
m_time->setText( i18n("Time format: %1").arg( locale->formatTime( TQTime::currentTime() ) ));
|
||
|
m_money->setText( i18n("Currency format: %1").arg( locale->formatMoney(12.55) ));
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
configure::configure( View* _view, TQVBox *box , char *name )
|
||
14 years ago
|
:TQObject ( box->parent(),name)
|
||
15 years ago
|
{
|
||
|
m_pView = _view;
|
||
|
|
||
|
bool vertical=true;
|
||
|
bool horizontal=true;
|
||
|
bool rowHeader=true;
|
||
|
bool colHeader=true;
|
||
|
bool tabbar=true;
|
||
|
bool formulaBar=true;
|
||
|
bool statusBar=true;
|
||
|
m_oldBackupFile = true;
|
||
|
|
||
14 years ago
|
TQGroupBox* tmpTQGroupBox = new TQVGroupBox( i18n("Settings"), box, "GroupBox" );
|
||
15 years ago
|
|
||
|
config = Factory::global()->config();
|
||
|
int _page=1;
|
||
|
|
||
|
oldRecent=10;
|
||
|
oldAutoSaveValue=KoDocument::defaultAutoSave()/60;
|
||
|
|
||
|
if( config->hasGroup("Parameters" ))
|
||
|
{
|
||
|
config->setGroup( "Parameters" );
|
||
|
_page=config->readNumEntry( "NbPage" ,1) ;
|
||
|
horizontal=config->readBoolEntry("Horiz ScrollBar",true);
|
||
|
vertical=config->readBoolEntry("Vert ScrollBar",true);
|
||
|
colHeader=config->readBoolEntry("Column Header",true);
|
||
|
rowHeader=config->readBoolEntry("Row Header",true);
|
||
|
tabbar=config->readBoolEntry("Tabbar",true);
|
||
|
formulaBar=config->readBoolEntry("Formula bar",true);
|
||
13 years ago
|
statusBar=config->readBoolEntry("Status bar",true);
|
||
15 years ago
|
oldRecent=config->readNumEntry( "NbRecentFile" ,10);
|
||
|
oldAutoSaveValue=config->readNumEntry("AutoSave",KoDocument::defaultAutoSave()/60);
|
||
|
m_oldBackupFile=config->readBoolEntry("BackupFile",m_oldBackupFile);
|
||
|
}
|
||
14 years ago
|
nbPage=new KIntNumInput(_page, tmpTQGroupBox , 10);
|
||
15 years ago
|
nbPage->setRange(1, 10, 1);
|
||
|
nbPage->setLabel(i18n("Number of sheets open at the &beginning:"));
|
||
14 years ago
|
TQWhatsThis::add(nbPage, i18n( "Controls how many worksheets will be created if the option Start with an empty document is chosen when KSpread is started." ) );
|
||
15 years ago
|
|
||
14 years ago
|
nbRecentFile=new KIntNumInput(oldRecent, tmpTQGroupBox , 10);
|
||
15 years ago
|
nbRecentFile->setRange(1, 20, 1);
|
||
|
nbRecentFile->setLabel(i18n("&Number of files to show in Recent Files list:"));
|
||
14 years ago
|
TQWhatsThis::add(nbRecentFile, i18n( "Controls the maximum number of filenames that are shown when you select File-> Open Recent." ) );
|
||
15 years ago
|
|
||
14 years ago
|
autoSaveDelay=new KIntNumInput(oldAutoSaveValue, tmpTQGroupBox , 10);
|
||
15 years ago
|
autoSaveDelay->setRange(0, 60, 1);
|
||
|
autoSaveDelay->setLabel(i18n("Au&tosave delay (minutes):"));
|
||
|
autoSaveDelay->setSpecialValueText(i18n("Do not save automatically"));
|
||
|
autoSaveDelay->setSuffix(i18n("min"));
|
||
14 years ago
|
TQWhatsThis::add(autoSaveDelay, i18n( "Here you can select the time between autosaves, or disable this feature altogether by choosing Do not save automatically (drag the slider to the far left)." ) );
|
||
15 years ago
|
|
||
14 years ago
|
m_createBackupFile = new TQCheckBox( i18n("Create backup files"), tmpTQGroupBox );
|
||
15 years ago
|
m_createBackupFile->setChecked( m_oldBackupFile );
|
||
14 years ago
|
TQWhatsThis::add(m_createBackupFile, i18n( "Check this box if you want some backup files created. This is checked per default." ) );
|
||
15 years ago
|
|
||
14 years ago
|
showVScrollBar=new TQCheckBox(i18n("Show &vertical scrollbar"),tmpTQGroupBox);
|
||
15 years ago
|
showVScrollBar->setChecked(vertical);
|
||
14 years ago
|
TQWhatsThis::add(showVScrollBar, i18n( "Check or uncheck this box to show or hide the vertical scrollbar in all sheets." ) );
|
||
15 years ago
|
|
||
14 years ago
|
showHScrollBar=new TQCheckBox(i18n("Show &horizontal scrollbar"),tmpTQGroupBox);
|
||
15 years ago
|
showHScrollBar->setChecked(horizontal);
|
||
14 years ago
|
TQWhatsThis::add(showHScrollBar, i18n( "Check or uncheck this box to show or hide the horizontal scrollbar in all sheets." ) );
|
||
15 years ago
|
|
||
14 years ago
|
showColHeader=new TQCheckBox(i18n("Show c&olumn header"),tmpTQGroupBox);
|
||
15 years ago
|
showColHeader->setChecked(colHeader);
|
||
14 years ago
|
TQWhatsThis::add(showColHeader, i18n( "Check this box to show the column letters across the top of each worksheet." ) );
|
||
|
showRowHeader=new TQCheckBox(i18n("Show &row header"),tmpTQGroupBox);
|
||
15 years ago
|
showRowHeader->setChecked(rowHeader);
|
||
14 years ago
|
TQWhatsThis::add(showRowHeader, i18n( "Check this box to show the row numbers down the left side." ) );
|
||
15 years ago
|
|
||
14 years ago
|
showTabBar =new TQCheckBox(i18n("Show ta&bs"),tmpTQGroupBox);
|
||
15 years ago
|
showTabBar->setChecked(tabbar);
|
||
14 years ago
|
TQWhatsThis::add(showTabBar, i18n( "This check box controls whether the sheet tabs are shown at the bottom of the worksheet." ) );
|
||
15 years ago
|
|
||
14 years ago
|
showFormulaBar =new TQCheckBox(i18n("Sho&w formula toolbar"),tmpTQGroupBox);
|
||
15 years ago
|
showFormulaBar->setChecked(formulaBar);
|
||
14 years ago
|
TQWhatsThis::add(showFormulaBar, i18n( "Here is where you can choose to show or hide the Formula bar." ) );
|
||
15 years ago
|
|
||
14 years ago
|
showStatusBar =new TQCheckBox(i18n("Show stat&us bar"),tmpTQGroupBox);
|
||
15 years ago
|
showStatusBar->setChecked(statusBar);
|
||
14 years ago
|
TQWhatsThis::add(showStatusBar, i18n( "Uncheck this box if you want to hide the status bar." ) );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void configure::slotDefault()
|
||
|
{
|
||
|
showHScrollBar->setChecked(true);
|
||
|
showRowHeader->setChecked(true);
|
||
|
showVScrollBar->setChecked(true);
|
||
|
showColHeader->setChecked(true);
|
||
|
showTabBar->setChecked(true);
|
||
|
showFormulaBar->setChecked(true);
|
||
|
showStatusBar->setChecked(true);
|
||
|
nbPage->setValue(1);
|
||
|
nbRecentFile->setValue(10);
|
||
|
autoSaveDelay->setValue(KoDocument::defaultAutoSave()/60);
|
||
|
m_createBackupFile->setChecked( true );
|
||
|
}
|
||
|
|
||
|
|
||
|
void configure::apply()
|
||
|
{
|
||
|
m_pView->doc()->emitBeginOperation( false );
|
||
|
config->setGroup( "Parameters" );
|
||
|
config->writeEntry( "NbPage", nbPage->value());
|
||
|
Doc *doc =m_pView->doc();
|
||
|
bool active=true;
|
||
|
active=showHScrollBar->isChecked();
|
||
|
if( m_pView->horzScrollBar()->isVisible()!=active)
|
||
|
{
|
||
|
config->writeEntry( "Horiz ScrollBar",active);
|
||
|
if( active)
|
||
|
m_pView->horzScrollBar()->show();
|
||
|
else
|
||
|
m_pView->horzScrollBar()->hide();
|
||
|
doc->setShowHorizontalScrollBar(active);
|
||
|
}
|
||
|
active=showVScrollBar->isChecked();
|
||
|
if( m_pView->vertScrollBar()->isVisible()!=active)
|
||
|
{
|
||
|
config->writeEntry( "Vert ScrollBar", active);
|
||
|
if(active)
|
||
|
m_pView->vertScrollBar()->show();
|
||
|
else
|
||
|
m_pView->vertScrollBar()->hide();
|
||
|
doc->setShowVerticalScrollBar(active);
|
||
|
|
||
|
}
|
||
|
active=showColHeader->isChecked();
|
||
|
if( m_pView->hBorderWidget()->isVisible()!=active)
|
||
|
{
|
||
|
config->writeEntry( "Column Header", active);
|
||
|
if( active)
|
||
|
m_pView->hBorderWidget()->show();
|
||
|
else
|
||
|
m_pView->hBorderWidget()->hide();
|
||
|
doc->setShowColHeader(active);
|
||
|
}
|
||
|
|
||
|
active=showRowHeader->isChecked();
|
||
|
if( m_pView->vBorderWidget()->isVisible()!=active)
|
||
|
{
|
||
|
config->writeEntry( "Row Header", active);
|
||
|
if( active)
|
||
|
m_pView->vBorderWidget()->show();
|
||
|
else
|
||
|
m_pView->vBorderWidget()->hide();
|
||
|
doc->setShowRowHeader(active);
|
||
|
}
|
||
|
|
||
|
active=showTabBar->isChecked();
|
||
|
if(m_pView->tabBar()->isVisible()!=active)
|
||
|
{
|
||
|
config->writeEntry( "Tabbar", active);
|
||
|
if(active)
|
||
|
m_pView->tabBar()->show();
|
||
|
else
|
||
|
m_pView->tabBar()->hide();
|
||
|
doc->setShowTabBar(active);
|
||
|
}
|
||
|
|
||
|
active=showFormulaBar->isChecked();
|
||
|
if(m_pView->posWidget()->isVisible()!=active)
|
||
|
{
|
||
|
config->writeEntry( "Formula bar",active);
|
||
|
m_pView->editWidget()->showEditWidget(active);
|
||
|
if(active)
|
||
|
m_pView->posWidget()->show();
|
||
|
else
|
||
|
m_pView->posWidget()->hide();
|
||
|
doc->setShowFormulaBar(active);
|
||
|
}
|
||
|
|
||
|
active=showStatusBar->isChecked();
|
||
13 years ago
|
config->writeEntry( "Status bar",active);
|
||
15 years ago
|
m_pView->showStatusBar( active );
|
||
|
|
||
|
int val=nbRecentFile->value();
|
||
|
if( oldRecent!= val)
|
||
|
{
|
||
|
config->writeEntry( "NbRecentFile",val);
|
||
|
m_pView->changeNbOfRecentFiles(val);
|
||
|
}
|
||
|
val=autoSaveDelay->value();
|
||
|
if(val!=oldAutoSaveValue)
|
||
|
{
|
||
|
config->writeEntry( "AutoSave", val );
|
||
|
doc->setAutoSave(val*60);
|
||
|
}
|
||
|
|
||
|
bool state =m_createBackupFile->isChecked();
|
||
|
if(state!=m_oldBackupFile)
|
||
|
{
|
||
|
config->writeEntry( "BackupFile", state );
|
||
|
doc->setBackupFile( state);
|
||
|
m_oldBackupFile=state;
|
||
|
}
|
||
|
|
||
|
m_pView->slotUpdateView( m_pView->activeSheet() );
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
miscParameters::miscParameters( View* _view,TQVBox *box, char *name )
|
||
14 years ago
|
:TQObject ( box->parent(),name)
|
||
15 years ago
|
{
|
||
|
m_pView = _view;
|
||
|
|
||
|
|
||
14 years ago
|
TQGroupBox* tmpTQGroupBox = new TQVGroupBox( i18n("Misc"), box, "GroupBox" );
|
||
15 years ago
|
|
||
|
config = Factory::global()->config();
|
||
|
indentUnit = _view->doc()->unit();
|
||
|
double _indent = KoUnit::toUserValue( 10.0, indentUnit);
|
||
|
bool m_bMsgError=false;
|
||
|
if( config->hasGroup("Parameters" ))
|
||
|
{
|
||
|
config->setGroup( "Parameters" );
|
||
|
_indent = config->readDoubleNumEntry( "Indent" , _indent ) ;
|
||
|
m_bMsgError=config->readBoolEntry( "Msg error" ,false) ;
|
||
|
}
|
||
|
|
||
|
if( config->hasGroup("Misc") )
|
||
|
{
|
||
|
config->setGroup( "Misc" );
|
||
|
m_oldNbRedo=config->readNumEntry("UndoRedo",m_oldNbRedo);
|
||
|
}
|
||
|
|
||
14 years ago
|
m_undoRedoLimit=new KIntNumInput( m_oldNbRedo, tmpTQGroupBox );
|
||
15 years ago
|
m_undoRedoLimit->setLabel(i18n("Undo/redo limit:"));
|
||
|
m_undoRedoLimit->setRange(10, 60, 1);
|
||
|
|
||
|
|
||
14 years ago
|
TQLabel *label=new TQLabel(i18n("&Completion mode:"), tmpTQGroupBox);
|
||
15 years ago
|
|
||
14 years ago
|
typeCompletion=new TQComboBox(tmpTQGroupBox);
|
||
15 years ago
|
label->setBuddy(typeCompletion);
|
||
14 years ago
|
TQWhatsThis::add(typeCompletion, i18n( "Lets you choose the (auto) text completion mode from a range of options in the drop down selection box." ) );
|
||
|
TQStringList listType;
|
||
15 years ago
|
listType+=i18n("None");
|
||
|
listType+=i18n("Manual");
|
||
|
listType+=i18n("Popup");
|
||
|
listType+=i18n("Automatic");
|
||
|
listType+=i18n("Semi-Automatic");
|
||
|
typeCompletion->insertStringList(listType);
|
||
|
typeCompletion->setCurrentItem(0);
|
||
|
comboChanged=false;
|
||
14 years ago
|
connect(typeCompletion,TQT_SIGNAL(activated( const TQString & )),this,TQT_SLOT(slotTextComboChanged(const TQString &)));
|
||
15 years ago
|
|
||
14 years ago
|
label=new TQLabel(i18n("&Pressing enter moves cell cursor:"), tmpTQGroupBox);
|
||
|
typeOfMove=new TQComboBox( tmpTQGroupBox);
|
||
15 years ago
|
label->setBuddy(typeOfMove);
|
||
|
listType.clear();
|
||
|
listType+=i18n("Down");
|
||
|
listType+=i18n("Up");
|
||
|
listType+=i18n("Right");
|
||
|
listType+=i18n("Left");
|
||
|
listType+=i18n("Down, First Column");
|
||
|
typeOfMove->insertStringList(listType);
|
||
|
typeOfMove->setCurrentItem(0);
|
||
14 years ago
|
TQWhatsThis::add(typeOfMove, i18n( "When you have selected a cell, pressing the Enter key will move the cell cursor one cell left, right, up or down, as determined by this setting." ) );
|
||
15 years ago
|
|
||
14 years ago
|
label=new TQLabel(i18n("&Method of calc:"), tmpTQGroupBox);
|
||
15 years ago
|
|
||
14 years ago
|
typeCalc=new TQComboBox( tmpTQGroupBox);
|
||
15 years ago
|
label->setBuddy(typeCalc);
|
||
14 years ago
|
TQStringList listTypeCalc;
|
||
15 years ago
|
listTypeCalc+=i18n("Sum");
|
||
|
listTypeCalc+=i18n("Min");
|
||
|
listTypeCalc+=i18n("Max");
|
||
|
listTypeCalc+=i18n("Average");
|
||
|
listTypeCalc+=i18n("Count");
|
||
|
listTypeCalc+=i18n("CountA");
|
||
|
listTypeCalc+=i18n("None");
|
||
|
typeCalc->insertStringList(listTypeCalc);
|
||
|
typeCalc->setCurrentItem(0);
|
||
14 years ago
|
TQWhatsThis::add(typeCalc, i18n( "This drop down selection box can be used to choose the calculation performed by the Statusbar Summary function." ) );
|
||
15 years ago
|
|
||
14 years ago
|
// valIndent = new KDoubleNumInput( _indent, tmpTQGroupBox , 10.0 );
|
||
|
valIndent = new KDoubleNumInput( tmpTQGroupBox );
|
||
15 years ago
|
valIndent->setRange( KoUnit::toUserValue( 0.0, indentUnit ),
|
||
|
KoUnit::toUserValue( 400.0, indentUnit ),
|
||
|
KoUnit::toUserValue( 10.0, indentUnit) );
|
||
|
// valIndent->setRange( 0.0, 100.0, 10.0 );
|
||
|
valIndent->setValue ( KoUnit::toUserValue( _indent, indentUnit ) );
|
||
14 years ago
|
TQWhatsThis::add(valIndent, i18n( "Lets you define the amount of indenting used by the Increase Indent and Decrease Indent option in the Format menu." ) );
|
||
13 years ago
|
valIndent->setLabel(i18n("&Indentation step (%1):").arg(KoUnit::unitName(indentUnit)));
|
||
15 years ago
|
|
||
14 years ago
|
msgError= new TQCheckBox(i18n("&Show error message for invalid formulae"),tmpTQGroupBox);
|
||
15 years ago
|
msgError->setChecked(m_bMsgError);
|
||
14 years ago
|
TQWhatsThis::add(msgError, i18n( "If this box is checked a message box will pop up when what you have entered into a cell cannot be understood by KSpread." ) );
|
||
15 years ago
|
|
||
|
initComboBox();
|
||
|
}
|
||
|
|
||
14 years ago
|
void miscParameters::slotTextComboChanged(const TQString &)
|
||
15 years ago
|
{
|
||
|
comboChanged=true;
|
||
|
}
|
||
|
|
||
|
void miscParameters::initComboBox()
|
||
|
{
|
||
12 years ago
|
TDEGlobalSettings::Completion tmpCompletion=TDEGlobalSettings::CompletionAuto;
|
||
15 years ago
|
if( config->hasGroup("Parameters" ))
|
||
|
{
|
||
|
config->setGroup( "Parameters" );
|
||
12 years ago
|
tmpCompletion=( TDEGlobalSettings::Completion)config->readNumEntry( "Completion Mode" ,TDEGlobalSettings::CompletionAuto) ;
|
||
15 years ago
|
config->writeEntry( "Completion Mode", (int)tmpCompletion);
|
||
|
}
|
||
|
switch(tmpCompletion )
|
||
|
{
|
||
12 years ago
|
case TDEGlobalSettings::CompletionNone:
|
||
15 years ago
|
typeCompletion->setCurrentItem(0);
|
||
|
break;
|
||
12 years ago
|
case TDEGlobalSettings::CompletionAuto:
|
||
15 years ago
|
typeCompletion->setCurrentItem(3);
|
||
|
break;
|
||
12 years ago
|
case TDEGlobalSettings::CompletionMan:
|
||
15 years ago
|
typeCompletion->setCurrentItem(4);
|
||
|
break;
|
||
12 years ago
|
case TDEGlobalSettings::CompletionShell:
|
||
15 years ago
|
typeCompletion->setCurrentItem(1);
|
||
|
break;
|
||
12 years ago
|
case TDEGlobalSettings::CompletionPopup:
|
||
15 years ago
|
typeCompletion->setCurrentItem(2);
|
||
|
break;
|
||
|
default :
|
||
|
typeCompletion->setCurrentItem(0);
|
||
|
break;
|
||
|
}
|
||
|
switch( m_pView->doc()->getMoveToValue( ))
|
||
|
{
|
||
14 years ago
|
case KSpread::Bottom:
|
||
15 years ago
|
typeOfMove->setCurrentItem(0);
|
||
|
break;
|
||
14 years ago
|
case KSpread::Left:
|
||
15 years ago
|
typeOfMove->setCurrentItem(3);
|
||
|
break;
|
||
14 years ago
|
case KSpread::Top:
|
||
15 years ago
|
typeOfMove->setCurrentItem(1);
|
||
|
break;
|
||
14 years ago
|
case KSpread::Right:
|
||
15 years ago
|
typeOfMove->setCurrentItem(2);
|
||
|
break;
|
||
14 years ago
|
case KSpread::BottomFirst:
|
||
15 years ago
|
typeOfMove->setCurrentItem(4);
|
||
|
break;
|
||
|
default :
|
||
|
typeOfMove->setCurrentItem(0);
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
switch( m_pView->doc()->getTypeOfCalc())
|
||
|
{
|
||
|
case SumOfNumber:
|
||
|
typeCalc->setCurrentItem(0);
|
||
|
break;
|
||
|
case Min:
|
||
|
typeCalc->setCurrentItem(1);
|
||
|
break;
|
||
|
case Max:
|
||
|
typeCalc->setCurrentItem(2);
|
||
|
break;
|
||
|
case Average:
|
||
|
typeCalc->setCurrentItem(3);
|
||
|
break;
|
||
|
case Count:
|
||
|
typeCalc->setCurrentItem(4);
|
||
|
break;
|
||
|
case CountA:
|
||
|
typeCalc->setCurrentItem(5);
|
||
|
break;
|
||
|
case NoneCalc:
|
||
|
typeCalc->setCurrentItem(6);
|
||
|
break;
|
||
|
default :
|
||
|
typeCalc->setCurrentItem(0);
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
void miscParameters::slotDefault()
|
||
|
{
|
||
|
m_undoRedoLimit->setValue(30);
|
||
|
valIndent->setValue( KoUnit::toUserValue( 10.0, indentUnit) );
|
||
|
typeCompletion->setCurrentItem(3);
|
||
|
typeOfMove->setCurrentItem(0);
|
||
|
msgError->setChecked(false);
|
||
|
typeCalc->setCurrentItem(0);
|
||
|
}
|
||
|
|
||
|
|
||
|
void miscParameters::apply()
|
||
|
{
|
||
|
kdDebug() << "Applying misc preferences" << endl;
|
||
|
|
||
|
config->setGroup( "Misc" );
|
||
|
int const newUndo=m_undoRedoLimit->value();
|
||
|
if( newUndo!=m_oldNbRedo )
|
||
|
{
|
||
|
config->writeEntry("UndoRedo",newUndo);
|
||
|
m_pView->doc()->setUndoRedoLimit(newUndo);
|
||
|
m_oldNbRedo=newUndo;
|
||
|
}
|
||
|
|
||
|
config->setGroup( "Parameters" );
|
||
12 years ago
|
TDEGlobalSettings::Completion tmpCompletion=TDEGlobalSettings::CompletionNone;
|
||
15 years ago
|
|
||
|
switch(typeCompletion->currentItem())
|
||
|
{
|
||
|
case 0:
|
||
12 years ago
|
tmpCompletion=TDEGlobalSettings::CompletionNone;
|
||
15 years ago
|
break;
|
||
|
case 1:
|
||
12 years ago
|
tmpCompletion=TDEGlobalSettings::CompletionShell;
|
||
15 years ago
|
break;
|
||
|
case 2:
|
||
12 years ago
|
tmpCompletion=TDEGlobalSettings::CompletionPopup;
|
||
15 years ago
|
break;
|
||
|
case 3:
|
||
12 years ago
|
tmpCompletion=TDEGlobalSettings::CompletionAuto;
|
||
15 years ago
|
break;
|
||
|
case 4:
|
||
12 years ago
|
tmpCompletion=TDEGlobalSettings::CompletionMan;
|
||
15 years ago
|
break;
|
||
|
}
|
||
|
|
||
|
|
||
|
if(comboChanged)
|
||
|
{
|
||
|
m_pView->doc()->setCompletionMode(tmpCompletion);
|
||
|
config->writeEntry( "Completion Mode", (int)tmpCompletion);
|
||
|
}
|
||
|
|
||
14 years ago
|
KSpread::MoveTo tmpMoveTo=KSpread::Bottom;
|
||
15 years ago
|
switch(typeOfMove->currentItem())
|
||
|
{
|
||
|
case 0:
|
||
14 years ago
|
tmpMoveTo=KSpread::Bottom;
|
||
15 years ago
|
break;
|
||
|
case 1:
|
||
14 years ago
|
tmpMoveTo=KSpread::Top;
|
||
15 years ago
|
break;
|
||
|
case 2:
|
||
14 years ago
|
tmpMoveTo=KSpread::Right;
|
||
15 years ago
|
break;
|
||
|
case 3:
|
||
14 years ago
|
tmpMoveTo=KSpread::Left;
|
||
15 years ago
|
break;
|
||
|
case 4:
|
||
14 years ago
|
tmpMoveTo=KSpread::BottomFirst;
|
||
15 years ago
|
break;
|
||
|
}
|
||
|
if(tmpMoveTo!=m_pView->doc()->getMoveToValue())
|
||
|
{
|
||
|
m_pView->doc()->setMoveToValue(tmpMoveTo);
|
||
|
config->writeEntry( "Move", (int)tmpMoveTo);
|
||
|
}
|
||
|
|
||
|
MethodOfCalc tmpMethodCalc=SumOfNumber;
|
||
|
switch(typeCalc->currentItem())
|
||
|
{
|
||
|
case 0:
|
||
|
tmpMethodCalc =SumOfNumber;
|
||
|
break;
|
||
|
case 1:
|
||
|
tmpMethodCalc=Min;
|
||
|
break;
|
||
|
case 2:
|
||
|
tmpMethodCalc=Max;
|
||
|
break;
|
||
|
case 3:
|
||
|
tmpMethodCalc=Average;
|
||
|
break;
|
||
|
case 4:
|
||
|
tmpMethodCalc=Count;
|
||
|
break;
|
||
|
case 5:
|
||
|
tmpMethodCalc=CountA;
|
||
|
break;
|
||
|
case 6:
|
||
|
tmpMethodCalc=NoneCalc;
|
||
|
break;
|
||
|
|
||
|
}
|
||
|
if(tmpMethodCalc!=m_pView->doc()->getTypeOfCalc())
|
||
|
{
|
||
|
m_pView->doc()->setTypeOfCalc(tmpMethodCalc);
|
||
|
config->writeEntry( "Method of Calc", (int)tmpMethodCalc);
|
||
|
m_pView->calcStatusBarOp();
|
||
|
m_pView->initCalcMenu();
|
||
|
}
|
||
|
|
||
|
double val = valIndent->value();
|
||
|
if( val != m_pView->doc()->getIndentValue() )
|
||
|
{
|
||
|
KoUnit::Unit oldUnit = m_pView->doc()->unit();
|
||
|
m_pView->doc()->setUnit(indentUnit);
|
||
|
m_pView->doc()->setIndentValue( val );
|
||
|
m_pView->doc()->setUnit(oldUnit);
|
||
|
config->writeEntry( "Indent", KoUnit::fromUserValue( val, indentUnit ) );
|
||
|
}
|
||
|
|
||
|
bool active=msgError->isChecked();
|
||
|
if(active!=m_pView->doc()->getShowMessageError())
|
||
|
{
|
||
|
m_pView->doc()->setShowMessageError( active);
|
||
|
config->writeEntry( "Msg error" ,(int)active);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
14 years ago
|
colorParameters::colorParameters( View* _view,TQVBox *box , char *name )
|
||
14 years ago
|
:TQObject ( box->parent(),name)
|
||
15 years ago
|
{
|
||
|
m_pView = _view;
|
||
|
config = Factory::global()->config();
|
||
|
|
||
14 years ago
|
TQColor _gridColor(TQt::lightGray);
|
||
15 years ago
|
|
||
|
if ( config->hasGroup("KSpread Color" ) )
|
||
|
{
|
||
|
config->setGroup( "KSpread Color" );
|
||
|
_gridColor = config->readColorEntry("GridColor",&_gridColor);
|
||
|
}
|
||
|
|
||
14 years ago
|
TQGroupBox* tmpTQGroupBox = new TQVGroupBox( i18n("Color"), box, "GroupBox" );
|
||
15 years ago
|
|
||
14 years ago
|
TQLabel *label = new TQLabel(i18n("&Grid color:"), tmpTQGroupBox,"label20" );
|
||
15 years ago
|
|
||
|
gridColor = new KColorButton( _gridColor,
|
||
14 years ago
|
TQt::lightGray,
|
||
|
tmpTQGroupBox );
|
||
|
TQWhatsThis::add(gridColor, i18n( "Click here to change the grid color ie the color of the borders of each cell." ) );
|
||
15 years ago
|
label->setBuddy(gridColor);
|
||
|
|
||
14 years ago
|
TQColor _pbColor(TQt::red);
|
||
15 years ago
|
if ( config->hasGroup("KSpread Color" ) )
|
||
|
{
|
||
|
config->setGroup( "KSpread Color" );
|
||
|
_pbColor = config->readColorEntry("PageBorderColor", &_pbColor);
|
||
|
}
|
||
|
|
||
14 years ago
|
TQLabel * label2 = new TQLabel( i18n("&Page borders:"), tmpTQGroupBox, "label21" );
|
||
15 years ago
|
|
||
|
pageBorderColor = new KColorButton( _pbColor,
|
||
14 years ago
|
TQt::red,
|
||
|
tmpTQGroupBox );
|
||
|
TQWhatsThis::add(pageBorderColor, i18n( "When the View ->Show Page Borders menu item is checked, the page borders are displayed. Click here to choose another color for the borders than the default red." ) );
|
||
15 years ago
|
|
||
|
label2->setBuddy(pageBorderColor);
|
||
|
}
|
||
|
|
||
|
void colorParameters::apply()
|
||
|
{
|
||
14 years ago
|
TQColor _col = gridColor->color();
|
||
15 years ago
|
if ( m_pView->doc()->gridColor() != _col )
|
||
|
{
|
||
|
m_pView->doc()->setGridColor( _col );
|
||
|
config->setGroup( "KSpread Color" );
|
||
|
config->writeEntry( "GridColor", _col );
|
||
|
}
|
||
|
|
||
14 years ago
|
TQColor _pbColor = pageBorderColor->color();
|
||
15 years ago
|
if ( m_pView->doc()->pageBorderColor() != _pbColor )
|
||
|
{
|
||
|
m_pView->doc()->changePageBorderColor( _pbColor );
|
||
|
config->setGroup( "KSpread Color" );
|
||
|
config->writeEntry( "PageBorderColor", _pbColor );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void colorParameters::slotDefault()
|
||
|
{
|
||
|
gridColor->setColor( lightGray );
|
||
|
pageBorderColor->setColor( red );
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
14 years ago
|
configureLayoutPage::configureLayoutPage( View* _view,TQVBox *box , char *name )
|
||
14 years ago
|
:TQObject ( box->parent(),name)
|
||
15 years ago
|
{
|
||
|
m_pView = _view;
|
||
|
|
||
14 years ago
|
TQGroupBox* tmpTQGroupBox = new TQGroupBox( 0, Qt::Vertical, i18n("Default Parameters"), box, "GroupBox" );
|
||
13 years ago
|
tmpTQGroupBox->layout()->setSpacing(KDialog::spacingHint());
|
||
|
tmpTQGroupBox->layout()->setMargin(KDialog::marginHint());
|
||
15 years ago
|
|
||
13 years ago
|
TQGridLayout *grid1 = new TQGridLayout(tmpTQGroupBox->layout(),8,1);
|
||
15 years ago
|
grid1->addRowSpacing( 0, KDialog::marginHint() );
|
||
|
grid1->setRowStretch( 7, 10 );
|
||
|
|
||
|
config = Factory::global()->config();
|
||
|
|
||
14 years ago
|
TQLabel *label=new TQLabel(i18n("Default page &size:"), tmpTQGroupBox);
|
||
15 years ago
|
|
||
|
grid1->addWidget(label,0,0);
|
||
|
|
||
14 years ago
|
defaultSizePage=new TQComboBox( tmpTQGroupBox);
|
||
15 years ago
|
label->setBuddy(defaultSizePage);
|
||
|
defaultSizePage->insertStringList( KoPageFormat::allFormats() );
|
||
|
defaultSizePage->setCurrentItem(1);
|
||
14 years ago
|
TQWhatsThis::add(defaultSizePage, i18n( "Choose the default page size for your worksheet among all the most common page sizes.\nNote that you can overwrite the page size for the current sheet using the Format -> Page Layout... dialog." ) );
|
||
15 years ago
|
grid1->addWidget(defaultSizePage,1,0);
|
||
|
|
||
14 years ago
|
label=new TQLabel(i18n("Default page &orientation:"), tmpTQGroupBox);
|
||
15 years ago
|
grid1->addWidget(label,2,0);
|
||
|
|
||
14 years ago
|
defaultOrientationPage=new TQComboBox( tmpTQGroupBox);
|
||
15 years ago
|
label->setBuddy(defaultOrientationPage);
|
||
|
|
||
14 years ago
|
TQStringList listType;
|
||
15 years ago
|
listType+=i18n( "Portrait" );
|
||
|
listType+=i18n( "Landscape" );
|
||
|
defaultOrientationPage->insertStringList(listType);
|
||
|
defaultOrientationPage->setCurrentItem(0);
|
||
14 years ago
|
TQWhatsThis::add(defaultOrientationPage, i18n( "Choose the sheet orientation: portrait or lanscape.\nNote that you can overwrite the orientation for the current sheet using the Format -> Page Layout... dialog." ) );
|
||
15 years ago
|
grid1->addWidget(defaultOrientationPage,3,0);
|
||
|
|
||
14 years ago
|
label=new TQLabel(tmpTQGroupBox);
|
||
15 years ago
|
label->setText(i18n("Default page &unit:"));
|
||
|
grid1->addWidget(label,4,0);
|
||
14 years ago
|
defaultUnit=new TQComboBox( tmpTQGroupBox);
|
||
15 years ago
|
label->setBuddy(defaultUnit);
|
||
|
|
||
|
defaultUnit->insertStringList(KoUnit::listOfUnitName());
|
||
|
defaultUnit->setCurrentItem(0);
|
||
14 years ago
|
TQWhatsThis::add(defaultUnit, i18n( "Choose the default unit that will be used in your sheet.\nNote that you can overwrite the unit for the current sheet using the Format -> Page Layout... dialog." ) );
|
||
15 years ago
|
grid1->addWidget(defaultUnit,5,0);
|
||
|
initCombo();
|
||
|
|
||
|
}
|
||
|
|
||
|
void configureLayoutPage::slotDefault()
|
||
|
{
|
||
|
defaultSizePage->setCurrentItem(1);
|
||
|
defaultOrientationPage->setCurrentItem(0);
|
||
|
defaultUnit->setCurrentItem(0);
|
||
|
}
|
||
|
|
||
|
void configureLayoutPage::initCombo()
|
||
|
{
|
||
|
paper=1;
|
||
|
orientation=0;
|
||
|
unit=0;
|
||
|
if( config->hasGroup("KSpread Page Layout" ))
|
||
|
{
|
||
|
config->setGroup( "KSpread Page Layout" );
|
||
|
paper=config->readNumEntry( "Default size page" ,1);
|
||
|
orientation=config->readNumEntry( "Default orientation page" ,0);
|
||
|
unit=config->readNumEntry( "Default unit page" ,0);
|
||
|
}
|
||
|
|
||
|
defaultUnit->setCurrentItem(m_pView->doc()->unit());
|
||
|
defaultSizePage->setCurrentItem(paper);
|
||
|
defaultOrientationPage->setCurrentItem(orientation);
|
||
|
}
|
||
|
|
||
|
|
||
|
void configureLayoutPage::apply()
|
||
|
{
|
||
|
m_pView->doc()->emitBeginOperation( false );
|
||
|
config->setGroup( "KSpread Page Layout" );
|
||
|
|
||
|
if( paper != defaultSizePage->currentItem() )
|
||
|
{
|
||
|
unsigned int sizePage = defaultSizePage->currentItem();
|
||
|
config->writeEntry( "Default size page", sizePage );
|
||
|
m_pView->activeSheet()->print()->setPaperFormat( (KoFormat)sizePage );
|
||
|
}
|
||
|
if( orientation != defaultOrientationPage->currentItem() )
|
||
|
{
|
||
|
unsigned int orientationPage = defaultOrientationPage->currentItem();
|
||
|
config->writeEntry( "Default orientation page", orientationPage );
|
||
|
m_pView->activeSheet()->print()->setPaperOrientation( (KoOrientation)orientationPage );
|
||
|
}
|
||
|
if( unit != defaultUnit->currentItem() )
|
||
|
{
|
||
|
unsigned int unitPage = defaultUnit->currentItem();
|
||
|
config->writeEntry( "Default unit page", unitPage );
|
||
|
m_pView->doc()->setUnit( (KoUnit::Unit)unitPage );
|
||
|
}
|
||
|
m_pView->slotUpdateView( m_pView->activeSheet() );
|
||
|
}
|
||
|
|
||
14 years ago
|
configureSpellPage::configureSpellPage( View* _view,TQVBox *box , char *name )
|
||
14 years ago
|
:TQObject ( box->parent(),name)
|
||
15 years ago
|
{
|
||
|
m_pView = _view;
|
||
|
|
||
|
config = Factory::global()->config();
|
||
|
|
||
|
|
||
|
m_spellConfigWidget = new KSpellConfig( box, "spell_check",m_pView->doc()->getKSpellConfig()/*, false*/);
|
||
14 years ago
|
dontCheckUpperWord = new TQCheckBox( i18n("Skip all uppercase words"),box);
|
||
13 years ago
|
TQWhatsThis::add(dontCheckUpperWord, i18n( "If checked, the words written in uppercase letters are not spell checked. This might be useful if you have a lot of acronyms such as TDE for example." ) );
|
||
14 years ago
|
dontCheckTitleCase = new TQCheckBox( i18n("Do not check title case"),box);
|
||
|
TQWhatsThis::add(dontCheckTitleCase, i18n( "Check this box if you want the spellchecker to ignore the title case, for example My Own Spreadsheet or My own spreadsheet. If this is unchecked, the spell checker will ask for a uppercase letter in the title nouns." ) );
|
||
15 years ago
|
|
||
14 years ago
|
TQWidget* spacer = new TQWidget( box );
|
||
13 years ago
|
spacer->setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) );
|
||
15 years ago
|
|
||
|
if( config->hasGroup("KSpell kspread") )
|
||
|
{
|
||
|
config->setGroup( "KSpell kspread" );
|
||
|
|
||
|
dontCheckUpperWord->setChecked(config->readBoolEntry("KSpell_dont_check_upper_word",false));
|
||
|
dontCheckTitleCase->setChecked(config->readBoolEntry("KSpell_dont_check_title_case",false));
|
||
|
}
|
||
|
//m_spellConfigWidget->addIgnoreList( m_pView->doc()->spellListIgnoreAll() );
|
||
|
}
|
||
|
|
||
|
|
||
|
void configureSpellPage::apply()
|
||
|
{
|
||
|
m_pView->doc()->emitBeginOperation( false );
|
||
|
|
||
|
KSpellConfig *_spellConfig = m_spellConfigWidget;
|
||
|
config->setGroup( "KSpell kspread" );
|
||
|
config->writeEntry ("KSpell_NoRootAffix",(int) _spellConfig->noRootAffix ());
|
||
|
config->writeEntry ("KSpell_RunTogether", (int) _spellConfig->runTogether ());
|
||
|
config->writeEntry ("KSpell_Dictionary", _spellConfig->dictionary ());
|
||
|
config->writeEntry ("KSpell_DictFromList",(int) _spellConfig->dictFromList());
|
||
|
config->writeEntry ("KSpell_Encoding", (int) _spellConfig->encoding());
|
||
|
config->writeEntry ("KSpell_Client", _spellConfig->client());
|
||
|
// m_spellConfigWidget->saveDictionary();
|
||
|
Doc* doc = m_pView->doc();
|
||
|
doc->setKSpellConfig(*_spellConfig);
|
||
|
|
||
|
bool state=dontCheckUpperWord->isChecked();
|
||
|
config->writeEntry ("KSpell_dont_check_upper_word",(int)state);
|
||
|
doc->setDontCheckUpperWord(state);
|
||
|
|
||
|
state=dontCheckTitleCase->isChecked();
|
||
|
config->writeEntry("KSpell_dont_check_title_case",(int)state);
|
||
|
doc->setDontCheckTitleCase(state);
|
||
|
|
||
|
//m_pView->doc()->addIgnoreWordAllList( m_spellConfigWidget->ignoreList() );
|
||
|
|
||
|
m_pView->slotUpdateView( m_pView->activeSheet() );
|
||
|
}
|
||
|
|
||
|
void configureSpellPage::slotDefault()
|
||
|
{
|
||
|
//FIXME
|
||
|
//m_spellConfigWidget->setDefault();
|
||
|
}
|
||
|
|
||
|
////
|
||
|
|
||
14 years ago
|
configureTTSPage::configureTTSPage( View *_view, TQVBox *box, char *name )
|
||
14 years ago
|
: TQObject( box->parent(), name )
|
||
15 years ago
|
{
|
||
|
Q_UNUSED(_view);
|
||
|
|
||
14 years ago
|
m_cbSpeakPointerWidget = new TQCheckBox(i18n("Speak widget under &mouse pointer"), box);
|
||
|
m_cbSpeakFocusWidget = new TQCheckBox(i18n("Speak widget with &focus"), box);
|
||
|
m_gbScreenReaderOptions = new TQVGroupBox("", box);
|
||
15 years ago
|
m_gbScreenReaderOptions->setMargin( KDialog::marginHint() );
|
||
|
m_gbScreenReaderOptions->setInsideSpacing( KDialog::spacingHint() );
|
||
14 years ago
|
m_cbSpeakTooltips = new TQCheckBox(i18n("Speak &tool tips"), m_gbScreenReaderOptions);
|
||
|
m_cbSpeakWhatsThis = new TQCheckBox(i18n("Speak &What's This"), m_gbScreenReaderOptions);
|
||
|
m_cbSpeakDisabled = new TQCheckBox(i18n("Verbal indication if widget is disabled (grayed)",
|
||
15 years ago
|
"&Say whether disabled"), m_gbScreenReaderOptions);
|
||
14 years ago
|
m_cbSpeakAccelerators = new TQCheckBox(i18n("Spea&k accelerators"), m_gbScreenReaderOptions);
|
||
|
TQHBox* hbAcceleratorPrefix = new TQHBox(m_gbScreenReaderOptions);
|
||
|
TQWidget* spacer = new TQWidget(hbAcceleratorPrefix);
|
||
15 years ago
|
spacer->setMinimumWidth(2 * KDialog::marginHint());
|
||
|
m_lblAcceleratorPrefix =
|
||
14 years ago
|
new TQLabel(i18n("A word spoken before another word", "Pr&efaced by the word:"),
|
||
15 years ago
|
hbAcceleratorPrefix);
|
||
14 years ago
|
m_leAcceleratorPrefixWord = new TQLineEdit(i18n("Keyboard accelerator, such as Alt+F", "Accelerator"),
|
||
15 years ago
|
hbAcceleratorPrefix);
|
||
|
m_lblAcceleratorPrefix->setBuddy(m_leAcceleratorPrefixWord);
|
||
14 years ago
|
TQHBox* hbPollingInterval = new TQHBox(m_gbScreenReaderOptions);
|
||
15 years ago
|
hbPollingInterval->setMargin( 0 );
|
||
14 years ago
|
TQLabel* lblPollingInterval = new TQLabel(i18n("&Polling interval:"), hbPollingInterval);
|
||
15 years ago
|
m_iniPollingInterval = new KIntNumInput(hbPollingInterval);
|
||
|
m_iniPollingInterval->setSuffix(" ms");
|
||
|
m_iniPollingInterval->setRange(100, 5000, 100, true);
|
||
|
lblPollingInterval->setBuddy(m_iniPollingInterval);
|
||
|
|
||
|
config = Factory::global()->config();
|
||
|
config->setGroup("TTS");
|
||
|
m_cbSpeakPointerWidget->setChecked(config->readBoolEntry("SpeakPointerWidget", false));
|
||
|
m_cbSpeakFocusWidget->setChecked(config->readBoolEntry("SpeakFocusWidget", false));
|
||
|
m_cbSpeakTooltips->setChecked(config->readBoolEntry("SpeakTooltips", true));
|
||
|
m_cbSpeakWhatsThis->setChecked(config->readBoolEntry("SpeakWhatsThis", false));
|
||
|
m_cbSpeakDisabled->setChecked(config->readBoolEntry("SpeakDisabled", true));
|
||
|
m_cbSpeakAccelerators->setChecked(config->readBoolEntry("SpeakAccelerators", true));
|
||
|
m_leAcceleratorPrefixWord->setText(config->readEntry("AcceleratorPrefixWord",
|
||
|
i18n("Keyboard accelerator, such as Alt+F", "Accelerator")));
|
||
|
m_iniPollingInterval->setValue(config->readNumEntry("PollingInterval", 600));
|
||
|
|
||
|
screenReaderOptionChanged();
|
||
14 years ago
|
connect(m_cbSpeakPointerWidget, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(screenReaderOptionChanged()));
|
||
|
connect(m_cbSpeakFocusWidget, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(screenReaderOptionChanged()));
|
||
|
connect(m_cbSpeakAccelerators, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(screenReaderOptionChanged()));
|
||
15 years ago
|
}
|
||
|
|
||
|
void configureTTSPage::slotDefault()
|
||
|
{
|
||
|
m_cbSpeakPointerWidget->setChecked(false);
|
||
|
m_cbSpeakFocusWidget->setChecked(false);
|
||
|
m_cbSpeakTooltips->setChecked(true);
|
||
|
m_cbSpeakWhatsThis->setChecked(false);
|
||
|
m_cbSpeakDisabled->setChecked(true);
|
||
|
m_cbSpeakAccelerators->setChecked(true);
|
||
|
m_leAcceleratorPrefixWord->setText(i18n("Keyboard accelerator, such as Alt+F", "Accelerator"));
|
||
|
m_iniPollingInterval->setValue(600);
|
||
|
}
|
||
|
|
||
|
void configureTTSPage::apply()
|
||
|
{
|
||
|
config->setGroup("TTS");
|
||
|
config->writeEntry("SpeakPointerWidget", m_cbSpeakPointerWidget->isChecked());
|
||
|
config->writeEntry("SpeakFocusWidget", m_cbSpeakFocusWidget->isChecked());
|
||
|
config->writeEntry("SpeakTooltips", m_cbSpeakTooltips->isChecked());
|
||
|
config->writeEntry("SpeakWhatsThis", m_cbSpeakWhatsThis->isChecked());
|
||
|
config->writeEntry("SpeakDisabled", m_cbSpeakDisabled->isChecked());
|
||
|
config->writeEntry("SpeakAccelerators", m_cbSpeakAccelerators->isChecked());
|
||
|
config->writeEntry("AcceleratorPrefixWord", m_leAcceleratorPrefixWord->text());
|
||
|
config->writeEntry("PollingInterval", m_iniPollingInterval->value());
|
||
|
if (kospeaker) kospeaker->readConfig(config);
|
||
|
}
|
||
|
|
||
|
void configureTTSPage::screenReaderOptionChanged()
|
||
|
{
|
||
|
m_gbScreenReaderOptions->setEnabled(
|
||
|
m_cbSpeakPointerWidget->isChecked() || m_cbSpeakFocusWidget->isChecked());
|
||
|
m_leAcceleratorPrefixWord->setEnabled(m_cbSpeakAccelerators->isChecked());
|
||
|
m_lblAcceleratorPrefix->setEnabled(m_cbSpeakAccelerators->isChecked());
|
||
|
}
|
||
|
|
||
|
#include "kspread_dlg_preference.moc"
|