diff options
Diffstat (limited to 'src/qalculatepreferencesdialog.cpp')
-rw-r--r-- | src/qalculatepreferencesdialog.cpp | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/src/qalculatepreferencesdialog.cpp b/src/qalculatepreferencesdialog.cpp index 46c5882..02d9eee 100644 --- a/src/qalculatepreferencesdialog.cpp +++ b/src/qalculatepreferencesdialog.cpp @@ -21,24 +21,24 @@ #include "qalculate_tde_utils.h" #include <klocale.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qtooltip.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqtooltip.h> #include <kdeversion.h> #if KDE_VERSION_MAJOR > 3 || KDE_VERSION_MINOR > 1 #include <kfontrequester.h> #endif #if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2 -#include <qtabwidget.h> +#include <tqtabwidget.h> #else #include <ktabwidget.h> #endif -#include <qpushbutton.h> -#include <qfont.h> -#include <qpushbutton.h> -#include <qlayout.h> +#include <tqpushbutton.h> +#include <tqfont.h> +#include <tqpushbutton.h> +#include <tqlayout.h> #include <kcolorbutton.h> #include "kqalculate.h" @@ -47,29 +47,29 @@ extern PrintOptions printops; extern EvaluationOptions evalops; extern bool fetch_exchange_rates_at_startup, save_mode_on_exit, save_defs_on_exit; extern bool use_custom_result_font, use_custom_expression_font, use_custom_status_font; -extern QString custom_result_font, custom_expression_font, custom_status_font; -extern QWidget *expressionWidget, *resultWidget, *statusWidget_l; +extern TQString custom_result_font, custom_expression_font, custom_status_font; +extern TQWidget *expressionWidget, *resultWidget, *statusWidget_l; extern bool close_to_systray; extern bool display_expression_status; -extern QColor status_error_color; -extern QColor status_warning_color; +extern TQColor status_error_color; +extern TQColor status_warning_color; extern int use_icon_buttons; extern bool rpn_keypad_only; #if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2 #include <kfontdialog.h> -class KFontRequester : public QWidget +class KFontRequester : public TQWidget { Q_OBJECT public: - KFontRequester( QWidget *parent=0L, const char *name=0L, + KFontRequester( TQWidget *parent=0L, const char *name=0L, bool onlyFixed=false ); - QFont font() const { return m_selFont; } - virtual void setFont( const QFont &font, bool onlyFixed=false ); + TQFont font() const { return m_selFont; } + virtual void setFont( const TQFont &font, bool onlyFixed=false ); protected: @@ -82,24 +82,24 @@ class KFontRequester : public QWidget protected: bool m_onlyFixed; - QString m_sampleText, m_title; - QLabel *m_sampleLabel; - QPushButton *m_button; - QFont m_selFont; + TQString m_sampleText, m_title; + TQLabel *m_sampleLabel; + TQPushButton *m_button; + TQFont m_selFont; }; -KFontRequester::KFontRequester( QWidget *parent, const char *name, - bool onlyFixed ) : QWidget( parent, name ), +KFontRequester::KFontRequester( TQWidget *parent, const char *name, + bool onlyFixed ) : TQWidget( parent, name ), m_onlyFixed( onlyFixed ) { - QHBoxLayout *layout = new QHBoxLayout( this, 0, KDialog::spacingHint() ); + TQHBoxLayout *layout = new TQHBoxLayout( this, 0, KDialog::spacingHint() ); - m_sampleLabel = new QLabel( this, "m_sampleLabel" ); - m_button = new QPushButton( i18n( "Choose..." ), this, "m_button" ); + m_sampleLabel = new TQLabel( this, "m_sampleLabel" ); + m_button = new TQPushButton( i18n( "Choose..." ), this, "m_button" ); - m_sampleLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); + m_sampleLabel->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); setFocusProxy( m_button ); layout->addWidget( m_sampleLabel, 1 ); @@ -111,7 +111,7 @@ KFontRequester::KFontRequester( QWidget *parent, const char *name, } -void KFontRequester::setFont( const QFont &font, bool onlyFixed ) +void KFontRequester::setFont( const TQFont &font, bool onlyFixed ) { m_selFont = font; m_onlyFixed = onlyFixed; @@ -137,124 +137,124 @@ void KFontRequester::displaySampleText() size = m_selFont.pixelSize(); if ( m_sampleText.isEmpty() ) - m_sampleLabel->setText( QString( "%1 %2" ).arg( m_selFont.family() ) + m_sampleLabel->setText( TQString( "%1 %2" ).arg( m_selFont.family() ) .arg( size ) ); else m_sampleLabel->setText( m_sampleText ); } #endif -QalculatePreferencesDialog::QalculatePreferencesDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Preferences"), Ok | Apply | Cancel, Ok, false) { +QalculatePreferencesDialog::QalculatePreferencesDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Preferences"), Ok | Apply | Cancel, Ok, false) { #if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2 - QTabWidget *tabs = new QTabWidget(this); + TQTabWidget *tabs = new TQTabWidget(this); #else - QTabWidget *tabs = new KTabWidget(this); + TQTabWidget *tabs = new KTabWidget(this); #endif setMainWidget(tabs); - QWidget *page1 = new QWidget(this); - QWidget *page2 = new QWidget(this); + TQWidget *page1 = new TQWidget(this); + TQWidget *page2 = new TQWidget(this); tabs->addTab(page1, i18n("General")); tabs->addTab(page2, i18n("Fonts")); - QVBoxLayout *vbox = new QVBoxLayout(page1, spacingHint()); - systrayButton = new QCheckBox(i18n("Close to system tray"), page1); - QToolTip::add(systrayButton, i18n("If the application will reside in the system tray when the window is closed")); + TQVBoxLayout *vbox = new TQVBoxLayout(page1, spacingHint()); + systrayButton = new TQCheckBox(i18n("Close to system tray"), page1); + TQToolTip::add(systrayButton, i18n("If the application will reside in the system tray when the window is closed")); vbox->addWidget(systrayButton); - statusButton = new QCheckBox(i18n("Display expression status"), page1); - QToolTip::add(statusButton, i18n("If as-you-type expression status shall be displayed below the expression entry")); + statusButton = new TQCheckBox(i18n("Display expression status"), page1); + TQToolTip::add(statusButton, i18n("If as-you-type expression status shall be displayed below the expression entry")); vbox->addWidget(statusButton); - iconsButton = new QCheckBox(i18n("Use icon buttons"), page1); - QToolTip::add(iconsButton, i18n("Use icons instead of text on the top-right buttons. The third state uses the style setting for icons on buttons.")); + iconsButton = new TQCheckBox(i18n("Use icon buttons"), page1); + TQToolTip::add(iconsButton, i18n("Use icons instead of text on the top-right buttons. The third state uses the style setting for icons on buttons.")); iconsButton->setTristate(true); vbox->addWidget(iconsButton); - fetchExchangeRatesButton = new QCheckBox(i18n("Update exchange rates on start"), page1); - QToolTip::add(fetchExchangeRatesButton, i18n("If current exchange rates shall be downloaded from the internet at program start")); + fetchExchangeRatesButton = new TQCheckBox(i18n("Update exchange rates on start"), page1); + TQToolTip::add(fetchExchangeRatesButton, i18n("If current exchange rates shall be downloaded from the internet at program start")); vbox->addWidget(fetchExchangeRatesButton); - saveModeButton = new QCheckBox(i18n("Save mode on exit"), page1); - QToolTip::add(saveModeButton, i18n("If the mode of the calculator shall be restored")); + saveModeButton = new TQCheckBox(i18n("Save mode on exit"), page1); + TQToolTip::add(saveModeButton, i18n("If the mode of the calculator shall be restored")); vbox->addWidget(saveModeButton); - saveDefsButton = new QCheckBox(i18n("Save definitions on exit"), page1); - QToolTip::add(saveDefsButton, i18n("If changes to functions, units and variables shall be saved automatically")); + saveDefsButton = new TQCheckBox(i18n("Save definitions on exit"), page1); + TQToolTip::add(saveDefsButton, i18n("If changes to functions, units and variables shall be saved automatically")); vbox->addWidget(saveDefsButton); - rpnKeypadOnlyButton = new QCheckBox(i18n("Use only keypad keys for RPN"), page1); - QToolTip::add(rpnKeypadOnlyButton, i18n("Use only keypad keys for RPN operations (+-*/^) and use the rest of the keyboard for expression entry")); + rpnKeypadOnlyButton = new TQCheckBox(i18n("Use only keypad keys for RPN"), page1); + TQToolTip::add(rpnKeypadOnlyButton, i18n("Use only keypad keys for RPN operations (+-*/^) and use the rest of the keyboard for expression entry")); vbox->addWidget(rpnKeypadOnlyButton); - dotAsSeparatorButton = new QCheckBox(i18n("Ignores dots in numbers"), page1); - QToolTip::add(dotAsSeparatorButton, i18n("Allow dots, '.', to be used as thousands separator instead of as an alternative to decimal sign")); + dotAsSeparatorButton = new TQCheckBox(i18n("Ignores dots in numbers"), page1); + TQToolTip::add(dotAsSeparatorButton, i18n("Allow dots, '.', to be used as thousands separator instead of as an alternative to decimal sign")); if(CALCULATOR->getDecimalPoint() == ".") dotAsSeparatorButton->hide(); vbox->addWidget(dotAsSeparatorButton); - unicodeButton = new QCheckBox(i18n("Enable unicode signs"), page1); - QToolTip::add(unicodeButton, i18n("Disable this if you have problems with some fancy characters")); + unicodeButton = new TQCheckBox(i18n("Enable unicode signs"), page1); + TQToolTip::add(unicodeButton, i18n("Disable this if you have problems with some fancy characters")); vbox->addWidget(unicodeButton); - lowerCaseButton = new QCheckBox(i18n("Use lower case in numbers"), page1); - QToolTip::add(lowerCaseButton, i18n("If lower case letters should be used in numbers with non-decimal base")); + lowerCaseButton = new TQCheckBox(i18n("Use lower case in numbers"), page1); + TQToolTip::add(lowerCaseButton, i18n("If lower case letters should be used in numbers with non-decimal base")); vbox->addWidget(lowerCaseButton); - lowerCaseEButton = new QCheckBox(i18n("Use lower case \"e\""), page1); - QToolTip::add(lowerCaseEButton, i18n("If \"e\"; shall be used instead of \"E\" in numbers")); + lowerCaseEButton = new TQCheckBox(i18n("Use lower case \"e\""), page1); + TQToolTip::add(lowerCaseEButton, i18n("If \"e\"; shall be used instead of \"E\" in numbers")); vbox->addWidget(lowerCaseEButton); - alternativeBasePrefixButton = new QCheckBox(i18n("Alternative base prefixes"), page1); - QToolTip::add(alternativeBasePrefixButton, i18n("If hexadecimal numbers shall be displayed with \"0x0\" and binary numbers with \"0b00\" as prefixes")); + alternativeBasePrefixButton = new TQCheckBox(i18n("Alternative base prefixes"), page1); + TQToolTip::add(alternativeBasePrefixButton, i18n("If hexadecimal numbers shall be displayed with \"0x0\" and binary numbers with \"0b00\" as prefixes")); vbox->addWidget(alternativeBasePrefixButton); - spellOutLogicalOperatorsButton = new QCheckBox(i18n("Spell out logical operators"), page1); - QToolTip::add(spellOutLogicalOperatorsButton, i18n("If logical and/or shall be displayed as \"&&\"/\"||\" or \"and\"/\"or\"")); + spellOutLogicalOperatorsButton = new TQCheckBox(i18n("Spell out logical operators"), page1); + TQToolTip::add(spellOutLogicalOperatorsButton, i18n("If logical and/or shall be displayed as \"&&\"/\"||\" or \"and\"/\"or\"")); vbox->addWidget(spellOutLogicalOperatorsButton); - QGridLayout *grid = new QGridLayout(vbox); - multiplicationLabel = new QLabel(i18n("Multiplication sign:"), page1); + TQGridLayout *grid = new TQGridLayout(vbox); + multiplicationLabel = new TQLabel(i18n("Multiplication sign:"), page1); grid->addWidget(multiplicationLabel, 0, 0); - QButtonGroup *group = new QButtonGroup(); - dotButton = new QRadioButton(SIGN_MULTIDOT, page1); + TQButtonGroup *group = new TQButtonGroup(); + dotButton = new TQRadioButton(SIGN_MULTIDOT, page1); group->insert(dotButton, 0); grid->addWidget(dotButton, 0, 1); - exButton = new QRadioButton(SIGN_MULTIPLICATION, page1); + exButton = new TQRadioButton(SIGN_MULTIPLICATION, page1); group->insert(exButton, 1); grid->addWidget(exButton, 0, 2); - asteriskButton = new QRadioButton("*", page1); + asteriskButton = new TQRadioButton("*", page1); group->insert(asteriskButton, 2); grid->addWidget(asteriskButton, 0, 3); - divisionLabel = new QLabel(i18n("Division sign:"), page1); + divisionLabel = new TQLabel(i18n("Division sign:"), page1); grid->addWidget(divisionLabel, 1, 0); - group = new QButtonGroup(); - divisionSlashButton = new QRadioButton(" " SIGN_DIVISION_SLASH " ", page1); + group = new TQButtonGroup(); + divisionSlashButton = new TQRadioButton(" " SIGN_DIVISION_SLASH " ", page1); group->insert(divisionSlashButton, 0); grid->addWidget(divisionSlashButton, 1, 1); - divisionButton = new QRadioButton(SIGN_DIVISION, page1); + divisionButton = new TQRadioButton(SIGN_DIVISION, page1); group->insert(divisionButton, 1); grid->addWidget(divisionButton, 1, 2); - slashButton = new QRadioButton("/", page1); + slashButton = new TQRadioButton("/", page1); group->insert(slashButton, 2); grid->addWidget(slashButton, 1, 3); - vbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); + vbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); - vbox = new QVBoxLayout(page2, spacingHint()); - useCustomResultFontButton = new QCheckBox(i18n("Custom result font"), page2); + vbox = new TQVBoxLayout(page2, spacingHint()); + useCustomResultFontButton = new TQCheckBox(i18n("Custom result font"), page2); vbox->addWidget(useCustomResultFontButton); resultFontEdit = new KFontRequester(page2); vbox->addWidget(resultFontEdit); - useCustomExpressionFontButton = new QCheckBox(i18n("Custom expression font"), page2); + useCustomExpressionFontButton = new TQCheckBox(i18n("Custom expression font"), page2); vbox->addWidget(useCustomExpressionFontButton); expressionFontEdit = new KFontRequester(page2); vbox->addWidget(expressionFontEdit); - useCustomStatusFontButton = new QCheckBox(i18n("Custom status font"), page2); + useCustomStatusFontButton = new TQCheckBox(i18n("Custom status font"), page2); vbox->addWidget(useCustomStatusFontButton); statusFontEdit = new KFontRequester(page2); vbox->addWidget(statusFontEdit); - grid = new QGridLayout(vbox); - grid->addWidget(new QLabel(i18n("Status error color:"), page2), 0, 0); + grid = new TQGridLayout(vbox); + grid->addWidget(new TQLabel(i18n("Status error color:"), page2), 0, 0); #if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR < 1 statusErrorColorButton = new KColorButton(page2); #else statusErrorColorButton = new KColorButton("red", "red", page2); #endif grid->addWidget(statusErrorColorButton, 0, 1); - grid->addWidget(new QLabel(i18n("Status warning color:"), page2), 1, 0); + grid->addWidget(new TQLabel(i18n("Status warning color:"), page2), 1, 0); #if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR < 1 statusWarningColorButton = new KColorButton(page2); #else statusWarningColorButton = new KColorButton("blue", "blue", page2); #endif grid->addWidget(statusWarningColorButton, 1, 1); - vbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); + vbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); connect(useCustomResultFontButton, SIGNAL(toggled(bool)), resultFontEdit, SLOT(setEnabled(bool))); @@ -279,15 +279,15 @@ void QalculatePreferencesDialog::slotApply() { close_to_systray = systrayButton->isChecked(); display_expression_status = statusButton->isChecked(); switch(iconsButton->state()) { - case QButton::Off: { + case TQButton::Off: { use_icon_buttons = 0; break; } - case QButton::On: { + case TQButton::On: { use_icon_buttons = 1; break; } - case QButton::NoChange: { + case TQButton::NoChange: { use_icon_buttons = -1; break; } @@ -349,15 +349,15 @@ bool QalculatePreferencesDialog::editPreferences() { useCustomResultFontButton->setChecked(use_custom_result_font); useCustomExpressionFontButton->setChecked(use_custom_expression_font); useCustomStatusFontButton->setChecked(use_custom_status_font); - QFont font1(resultWidget->font()); + TQFont font1(resultWidget->font()); font1.fromString(custom_result_font); resultFontEdit->setFont(font1); resultFontEdit->setEnabled(use_custom_result_font); - QFont font2(expressionWidget->font()); + TQFont font2(expressionWidget->font()); font2.fromString(custom_expression_font); expressionFontEdit->setFont(font2); expressionFontEdit->setEnabled(use_custom_expression_font); - QFont font3(statusWidget_l->font()); + TQFont font3(statusWidget_l->font()); font3.fromString(custom_status_font); statusFontEdit->setFont(font3); statusFontEdit->setEnabled(use_custom_status_font); |