|
|
@ -82,12 +82,12 @@ MainWindow::MainWindow() : TDEMainWindow(0, "abakus-mainwindow"), m_popup(0), m_
|
|
|
|
buttonGroup->insert(m_degrees);
|
|
|
|
buttonGroup->insert(m_degrees);
|
|
|
|
buttonGroupLayout->addWidget(m_degrees);
|
|
|
|
buttonGroupLayout->addWidget(m_degrees);
|
|
|
|
slotDegrees();
|
|
|
|
slotDegrees();
|
|
|
|
connect(m_degrees, TQT_SIGNAL(clicked()), TQT_SLOT(slotDegrees()));
|
|
|
|
connect(m_degrees, TQ_SIGNAL(clicked()), TQ_SLOT(slotDegrees()));
|
|
|
|
|
|
|
|
|
|
|
|
m_radians = new TQRadioButton(i18n("&Radians"), buttonGroupBox);
|
|
|
|
m_radians = new TQRadioButton(i18n("&Radians"), buttonGroupBox);
|
|
|
|
buttonGroup->insert(m_radians);
|
|
|
|
buttonGroup->insert(m_radians);
|
|
|
|
buttonGroupLayout->addWidget(m_radians);
|
|
|
|
buttonGroupLayout->addWidget(m_radians);
|
|
|
|
connect(m_radians, TQT_SIGNAL(clicked()), TQT_SLOT(slotRadians()));
|
|
|
|
connect(m_radians, TQ_SIGNAL(clicked()), TQ_SLOT(slotRadians()));
|
|
|
|
|
|
|
|
|
|
|
|
m_history = new TQVBox(box);
|
|
|
|
m_history = new TQVBox(box);
|
|
|
|
layout->addWidget(m_history);
|
|
|
|
layout->addWidget(m_history);
|
|
|
@ -97,10 +97,10 @@ MainWindow::MainWindow() : TDEMainWindow(0, "abakus-mainwindow"), m_popup(0), m_
|
|
|
|
m_result = new ResultListView(m_history);
|
|
|
|
m_result = new ResultListView(m_history);
|
|
|
|
m_result->setSelectionMode(TQListView::NoSelection);
|
|
|
|
m_result->setSelectionMode(TQListView::NoSelection);
|
|
|
|
m_result->setHScrollBarMode(ResultListView::AlwaysOff);
|
|
|
|
m_result->setHScrollBarMode(ResultListView::AlwaysOff);
|
|
|
|
connect(m_result, TQT_SIGNAL(signalEntrySelected(const TQString &)),
|
|
|
|
connect(m_result, TQ_SIGNAL(signalEntrySelected(const TQString &)),
|
|
|
|
TQT_SLOT(slotEntrySelected(const TQString &)));
|
|
|
|
TQ_SLOT(slotEntrySelected(const TQString &)));
|
|
|
|
connect(m_result, TQT_SIGNAL(signalResultSelected(const TQString &)),
|
|
|
|
connect(m_result, TQ_SIGNAL(signalResultSelected(const TQString &)),
|
|
|
|
TQT_SLOT(slotResultSelected(const TQString &)));
|
|
|
|
TQ_SLOT(slotResultSelected(const TQString &)));
|
|
|
|
|
|
|
|
|
|
|
|
m_history->setStretchFactor(m_result, 1);
|
|
|
|
m_history->setStretchFactor(m_result, 1);
|
|
|
|
layout->setStretchFactor(m_history, 1);
|
|
|
|
layout->setStretchFactor(m_history, 1);
|
|
|
@ -115,10 +115,10 @@ MainWindow::MainWindow() : TDEMainWindow(0, "abakus-mainwindow"), m_popup(0), m_
|
|
|
|
|
|
|
|
|
|
|
|
KPushButton *evalButton = new KPushButton(i18n("&Evaluate"), editBox);
|
|
|
|
KPushButton *evalButton = new KPushButton(i18n("&Evaluate"), editBox);
|
|
|
|
|
|
|
|
|
|
|
|
connect(evalButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotEvaluate()));
|
|
|
|
connect(evalButton, TQ_SIGNAL(clicked()), TQ_SLOT(slotEvaluate()));
|
|
|
|
|
|
|
|
|
|
|
|
connect(m_edit, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()));
|
|
|
|
connect(m_edit, TQ_SIGNAL(returnPressed()), TQ_SLOT(slotReturnPressed()));
|
|
|
|
connect(m_edit, TQT_SIGNAL(textChanged()), TQT_SLOT(slotTextChanged()));
|
|
|
|
connect(m_edit, TQ_SIGNAL(textChanged()), TQ_SLOT(slotTextChanged()));
|
|
|
|
|
|
|
|
|
|
|
|
m_listSplitter = new TQSplitter(TQt::Vertical, m_mainSplitter);
|
|
|
|
m_listSplitter = new TQSplitter(TQt::Vertical, m_mainSplitter);
|
|
|
|
m_fnList = new FunctionListView(m_listSplitter);
|
|
|
|
m_fnList = new FunctionListView(m_listSplitter);
|
|
|
@ -129,17 +129,17 @@ MainWindow::MainWindow() : TDEMainWindow(0, "abakus-mainwindow"), m_popup(0), m_
|
|
|
|
m_varList->addColumn("Variables");
|
|
|
|
m_varList->addColumn("Variables");
|
|
|
|
m_varList->addColumn("Value");
|
|
|
|
m_varList->addColumn("Value");
|
|
|
|
|
|
|
|
|
|
|
|
connect(FunctionManager::instance(), TQT_SIGNAL(signalFunctionAdded(const TQString &)),
|
|
|
|
connect(FunctionManager::instance(), TQ_SIGNAL(signalFunctionAdded(const TQString &)),
|
|
|
|
this, TQT_SLOT(slotNewFunction(const TQString &)));
|
|
|
|
this, TQ_SLOT(slotNewFunction(const TQString &)));
|
|
|
|
connect(FunctionManager::instance(), TQT_SIGNAL(signalFunctionRemoved(const TQString &)),
|
|
|
|
connect(FunctionManager::instance(), TQ_SIGNAL(signalFunctionRemoved(const TQString &)),
|
|
|
|
this, TQT_SLOT(slotRemoveFunction(const TQString &)));
|
|
|
|
this, TQ_SLOT(slotRemoveFunction(const TQString &)));
|
|
|
|
|
|
|
|
|
|
|
|
connect(ValueManager::instance(), TQT_SIGNAL(signalValueAdded(const TQString &, Abakus::number_t)),
|
|
|
|
connect(ValueManager::instance(), TQ_SIGNAL(signalValueAdded(const TQString &, Abakus::number_t)),
|
|
|
|
this, TQT_SLOT(slotNewValue(const TQString &, Abakus::number_t)));
|
|
|
|
this, TQ_SLOT(slotNewValue(const TQString &, Abakus::number_t)));
|
|
|
|
connect(ValueManager::instance(), TQT_SIGNAL(signalValueChanged(const TQString &, Abakus::number_t)),
|
|
|
|
connect(ValueManager::instance(), TQ_SIGNAL(signalValueChanged(const TQString &, Abakus::number_t)),
|
|
|
|
this, TQT_SLOT(slotChangeValue(const TQString &, Abakus::number_t)));
|
|
|
|
this, TQ_SLOT(slotChangeValue(const TQString &, Abakus::number_t)));
|
|
|
|
connect(ValueManager::instance(), TQT_SIGNAL(signalValueRemoved(const TQString &)),
|
|
|
|
connect(ValueManager::instance(), TQ_SIGNAL(signalValueRemoved(const TQString &)),
|
|
|
|
this, TQT_SLOT(slotRemoveValue(const TQString &)));
|
|
|
|
this, TQ_SLOT(slotRemoveValue(const TQString &)));
|
|
|
|
|
|
|
|
|
|
|
|
setupLayout();
|
|
|
|
setupLayout();
|
|
|
|
|
|
|
|
|
|
|
@ -228,7 +228,7 @@ void MainWindow::slotReturnPressed()
|
|
|
|
// Skip creating list view items if in compact mode.
|
|
|
|
// Skip creating list view items if in compact mode.
|
|
|
|
if(!m_history->isShown()) {
|
|
|
|
if(!m_history->isShown()) {
|
|
|
|
m_edit->setText(resultVal);
|
|
|
|
m_edit->setText(resultVal);
|
|
|
|
TQTimer::singleShot(0, m_edit, TQT_SLOT(selectAll()));
|
|
|
|
TQTimer::singleShot(0, m_edit, TQ_SLOT(selectAll()));
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -276,7 +276,7 @@ void MainWindow::slotReturnPressed()
|
|
|
|
// Skip creating list view items if in compact mode.
|
|
|
|
// Skip creating list view items if in compact mode.
|
|
|
|
if(compact) {
|
|
|
|
if(compact) {
|
|
|
|
m_edit->setText(resultVal);
|
|
|
|
m_edit->setText(resultVal);
|
|
|
|
TQTimer::singleShot(0, m_edit, TQT_SLOT(selectAll()));
|
|
|
|
TQTimer::singleShot(0, m_edit, TQ_SLOT(selectAll()));
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -287,7 +287,7 @@ void MainWindow::slotReturnPressed()
|
|
|
|
m_result->setCurrentItem(item);
|
|
|
|
m_result->setCurrentItem(item);
|
|
|
|
m_result->ensureItemVisible(item);
|
|
|
|
m_result->ensureItemVisible(item);
|
|
|
|
|
|
|
|
|
|
|
|
TQTimer::singleShot(0, m_edit, TQT_SLOT(selectAll()));
|
|
|
|
TQTimer::singleShot(0, m_edit, TQ_SLOT(selectAll()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::slotTextChanged()
|
|
|
|
void MainWindow::slotTextChanged()
|
|
|
@ -411,7 +411,7 @@ void MainWindow::loadConfig()
|
|
|
|
action<TDEToggleAction>("toggleCompactMode")->setChecked(compactMode);
|
|
|
|
action<TDEToggleAction>("toggleCompactMode")->setChecked(compactMode);
|
|
|
|
|
|
|
|
|
|
|
|
if(compactMode)
|
|
|
|
if(compactMode)
|
|
|
|
TQTimer::singleShot(0, this, TQT_SLOT(slotToggleCompactMode()));
|
|
|
|
TQTimer::singleShot(0, this, TQ_SLOT(slotToggleCompactMode()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -503,60 +503,60 @@ void MainWindow::setupLayout()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TDEActionCollection *ac = actionCollection();
|
|
|
|
TDEActionCollection *ac = actionCollection();
|
|
|
|
|
|
|
|
|
|
|
|
KStdAction::quit(kapp, TQT_SLOT(quit()), ac);
|
|
|
|
KStdAction::quit(kapp, TQ_SLOT(quit()), ac);
|
|
|
|
KStdAction::showMenubar(this, TQT_SLOT(slotToggleMenuBar()), ac);
|
|
|
|
KStdAction::showMenubar(this, TQ_SLOT(slotToggleMenuBar()), ac);
|
|
|
|
|
|
|
|
|
|
|
|
TDEToggleAction *ta = new TDEToggleAction(i18n("&Degrees"), SHIFT + ALT + Key_D, this, TQT_SLOT(slotDegrees()), ac, "setDegreesMode");
|
|
|
|
TDEToggleAction *ta = new TDEToggleAction(i18n("&Degrees"), SHIFT + ALT + Key_D, this, TQ_SLOT(slotDegrees()), ac, "setDegreesMode");
|
|
|
|
ta->setExclusiveGroup("TrigMode");
|
|
|
|
ta->setExclusiveGroup("TrigMode");
|
|
|
|
ta->setChecked(trigMode() == Abakus::Degrees);
|
|
|
|
ta->setChecked(trigMode() == Abakus::Degrees);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("&Radians"), SHIFT + ALT + Key_R, this, TQT_SLOT(slotRadians()), ac, "setRadiansMode");
|
|
|
|
ta = new TDEToggleAction(i18n("&Radians"), SHIFT + ALT + Key_R, this, TQ_SLOT(slotRadians()), ac, "setRadiansMode");
|
|
|
|
ta->setExclusiveGroup("TrigMode");
|
|
|
|
ta->setExclusiveGroup("TrigMode");
|
|
|
|
ta->setChecked(trigMode() == Abakus::Radians);
|
|
|
|
ta->setChecked(trigMode() == Abakus::Radians);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("Show &History List"), SHIFT + ALT + Key_H, this, TQT_SLOT(slotToggleHistoryList()), ac, "toggleHistoryList");
|
|
|
|
ta = new TDEToggleAction(i18n("Show &History List"), SHIFT + ALT + Key_H, this, TQ_SLOT(slotToggleHistoryList()), ac, "toggleHistoryList");
|
|
|
|
ta->setChecked(true);
|
|
|
|
ta->setChecked(true);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("Show &Variables"), SHIFT + ALT + Key_V, this, TQT_SLOT(slotToggleVariableList()), ac, "toggleVariableList");
|
|
|
|
ta = new TDEToggleAction(i18n("Show &Variables"), SHIFT + ALT + Key_V, this, TQ_SLOT(slotToggleVariableList()), ac, "toggleVariableList");
|
|
|
|
ta->setChecked(true);
|
|
|
|
ta->setChecked(true);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("Show &Functions"), SHIFT + ALT + Key_F, this, TQT_SLOT(slotToggleFunctionList()), ac, "toggleFunctionList");
|
|
|
|
ta = new TDEToggleAction(i18n("Show &Functions"), SHIFT + ALT + Key_F, this, TQ_SLOT(slotToggleFunctionList()), ac, "toggleFunctionList");
|
|
|
|
ta->setChecked(true);
|
|
|
|
ta->setChecked(true);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("Activate &Compact Mode"), SHIFT + ALT + Key_C, this, TQT_SLOT(slotToggleCompactMode()), ac, "toggleCompactMode");
|
|
|
|
ta = new TDEToggleAction(i18n("Activate &Compact Mode"), SHIFT + ALT + Key_C, this, TQ_SLOT(slotToggleCompactMode()), ac, "toggleCompactMode");
|
|
|
|
ta->setChecked(false);
|
|
|
|
ta->setChecked(false);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("Use R&PN Mode"), SHIFT + ALT + Key_P, this, TQT_SLOT(slotToggleExpressionMode()), ac, "toggleExpressionMode");
|
|
|
|
ta = new TDEToggleAction(i18n("Use R&PN Mode"), SHIFT + ALT + Key_P, this, TQ_SLOT(slotToggleExpressionMode()), ac, "toggleExpressionMode");
|
|
|
|
ta->setChecked(false);
|
|
|
|
ta->setChecked(false);
|
|
|
|
|
|
|
|
|
|
|
|
// Precision actions.
|
|
|
|
// Precision actions.
|
|
|
|
ta = new TDEToggleAction(i18n("&Automatic Precision"), 0, this, TQT_SLOT(slotPrecisionAuto()), ac, "precisionAuto");
|
|
|
|
ta = new TDEToggleAction(i18n("&Automatic Precision"), 0, this, TQ_SLOT(slotPrecisionAuto()), ac, "precisionAuto");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setChecked(true);
|
|
|
|
ta->setChecked(true);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("&3 Decimal Digits"), 0, this, TQT_SLOT(slotPrecision3()), ac, "precision3");
|
|
|
|
ta = new TDEToggleAction(i18n("&3 Decimal Digits"), 0, this, TQ_SLOT(slotPrecision3()), ac, "precision3");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setChecked(false);
|
|
|
|
ta->setChecked(false);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("&8 Decimal Digits"), 0, this, TQT_SLOT(slotPrecision8()), ac, "precision8");
|
|
|
|
ta = new TDEToggleAction(i18n("&8 Decimal Digits"), 0, this, TQ_SLOT(slotPrecision8()), ac, "precision8");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setChecked(false);
|
|
|
|
ta->setChecked(false);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("&15 Decimal Digits"), 0, this, TQT_SLOT(slotPrecision15()), ac, "precision15");
|
|
|
|
ta = new TDEToggleAction(i18n("&15 Decimal Digits"), 0, this, TQ_SLOT(slotPrecision15()), ac, "precision15");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setChecked(false);
|
|
|
|
ta->setChecked(false);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("&50 Decimal Digits"), 0, this, TQT_SLOT(slotPrecision50()), ac, "precision50");
|
|
|
|
ta = new TDEToggleAction(i18n("&50 Decimal Digits"), 0, this, TQ_SLOT(slotPrecision50()), ac, "precision50");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setChecked(false);
|
|
|
|
ta->setChecked(false);
|
|
|
|
|
|
|
|
|
|
|
|
ta = new TDEToggleAction(i18n("C&ustom Precision..."), 0, this, TQT_SLOT(slotPrecisionCustom()), ac, "precisionCustom");
|
|
|
|
ta = new TDEToggleAction(i18n("C&ustom Precision..."), 0, this, TQ_SLOT(slotPrecisionCustom()), ac, "precisionCustom");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setExclusiveGroup("Precision");
|
|
|
|
ta->setChecked(false);
|
|
|
|
ta->setChecked(false);
|
|
|
|
|
|
|
|
|
|
|
|
new TDEAction(i18n("Clear &History"), "edit-clear", SHIFT + ALT + Key_L, m_result, TQT_SLOT(clear()), ac, "clearHistory");
|
|
|
|
new TDEAction(i18n("Clear &History"), "edit-clear", SHIFT + ALT + Key_L, m_result, TQ_SLOT(clear()), ac, "clearHistory");
|
|
|
|
|
|
|
|
|
|
|
|
new TDEAction(i18n("Select Editor"), "goto", Key_F6, m_edit, TQT_SLOT(setFocus()), ac, "select_edit");
|
|
|
|
new TDEAction(i18n("Select Editor"), "goto", Key_F6, m_edit, TQ_SLOT(setFocus()), ac, "select_edit");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::populateListViews()
|
|
|
|
void MainWindow::populateListViews()
|
|
|
@ -682,7 +682,7 @@ void MainWindow::slotToggleCompactMode()
|
|
|
|
|
|
|
|
|
|
|
|
m_oldSize = size();
|
|
|
|
m_oldSize = size();
|
|
|
|
m_newSize = TQSize(0, 0);
|
|
|
|
m_newSize = TQSize(0, 0);
|
|
|
|
TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateSize()));
|
|
|
|
TQTimer::singleShot(0, this, TQ_SLOT(slotUpdateSize()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
m_fnList->setShown(m_wasFnShown);
|
|
|
|
m_fnList->setShown(m_wasFnShown);
|
|
|
@ -694,7 +694,7 @@ void MainWindow::slotToggleCompactMode()
|
|
|
|
action<TDEToggleAction>("toggleHistoryList")->setChecked(m_wasHistoryShown);
|
|
|
|
action<TDEToggleAction>("toggleHistoryList")->setChecked(m_wasHistoryShown);
|
|
|
|
|
|
|
|
|
|
|
|
m_newSize = m_oldSize;
|
|
|
|
m_newSize = m_oldSize;
|
|
|
|
TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateSize()));
|
|
|
|
TQTimer::singleShot(0, this, TQ_SLOT(slotUpdateSize()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|