|
|
|
@ -31,7 +31,7 @@
|
|
|
|
|
#include <kactionclasses.h>
|
|
|
|
|
#include <kinputdialog.h>
|
|
|
|
|
|
|
|
|
|
#include <layout.h>
|
|
|
|
|
#include <tqlayout.h>
|
|
|
|
|
#include <tqvbox.h>
|
|
|
|
|
#include <tqhbox.h>
|
|
|
|
|
#include <tqradiobutton.h>
|
|
|
|
@ -54,20 +54,20 @@ MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_in
|
|
|
|
|
{
|
|
|
|
|
m_mainSplitter = new TQSplitter(this);
|
|
|
|
|
TQWidget *box = new TQWidget(m_mainSplitter);
|
|
|
|
|
TQVBoxLayout *layout = new TQVBoxLayout(box);
|
|
|
|
|
m_layout = layout;
|
|
|
|
|
layout->setSpacing(6);
|
|
|
|
|
layout->setMargin(6);
|
|
|
|
|
TQVBoxLayout *tqlayout = new TQVBoxLayout(box);
|
|
|
|
|
m_layout = tqlayout;
|
|
|
|
|
tqlayout->setSpacing(6);
|
|
|
|
|
tqlayout->setMargin(6);
|
|
|
|
|
|
|
|
|
|
TQWidget *configBox = new TQWidget(box);
|
|
|
|
|
layout->addWidget(configBox);
|
|
|
|
|
tqlayout->addWidget(configBox);
|
|
|
|
|
|
|
|
|
|
TQHBoxLayout *configLayout = new TQHBoxLayout(configBox);
|
|
|
|
|
|
|
|
|
|
configLayout->addWidget(new TQWidget(configBox));
|
|
|
|
|
|
|
|
|
|
TQLabel *label = new TQLabel(i18n("History: "), configBox);
|
|
|
|
|
label->setAlignment(AlignCenter);
|
|
|
|
|
label->tqsetAlignment(AlignCenter);
|
|
|
|
|
configLayout->addWidget(label);
|
|
|
|
|
|
|
|
|
|
TQButtonGroup *buttonGroup = new TQButtonGroup(0);
|
|
|
|
@ -90,7 +90,7 @@ MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_in
|
|
|
|
|
connect(m_radians, TQT_SIGNAL(clicked()), TQT_SLOT(slotRadians()));
|
|
|
|
|
|
|
|
|
|
m_history = new TQVBox(box);
|
|
|
|
|
layout->addWidget(m_history);
|
|
|
|
|
tqlayout->addWidget(m_history);
|
|
|
|
|
m_history->setSpacing(6);
|
|
|
|
|
m_history->setMargin(0);
|
|
|
|
|
|
|
|
|
@ -103,10 +103,10 @@ MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_in
|
|
|
|
|
TQT_SLOT(slotResultSelected(const TQString &)));
|
|
|
|
|
|
|
|
|
|
m_history->setStretchFactor(m_result, 1);
|
|
|
|
|
layout->setStretchFactor(m_history, 1);
|
|
|
|
|
tqlayout->setStretchFactor(m_history, 1);
|
|
|
|
|
|
|
|
|
|
TQHBox *editBox = new TQHBox(box);
|
|
|
|
|
layout->addWidget(editBox);
|
|
|
|
|
tqlayout->addWidget(editBox);
|
|
|
|
|
editBox->setSpacing(6);
|
|
|
|
|
|
|
|
|
|
m_edit = new Editor(editBox);
|
|
|
|
@ -222,7 +222,7 @@ void MainWindow::slotReturnPressed()
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
m_insert = false;
|
|
|
|
|
resultVal = i18n("Error: %1").arg(RPNParser::errorString());
|
|
|
|
|
resultVal = i18n("Error: %1").tqarg(RPNParser::errorString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Skip creating list view items if in compact mode.
|
|
|
|
@ -318,7 +318,7 @@ void MainWindow::slotUpdateSize()
|
|
|
|
|
if(m_newSize != TQSize(0, 0))
|
|
|
|
|
resize(m_newSize);
|
|
|
|
|
else
|
|
|
|
|
resize(width(), minimumSize().height());
|
|
|
|
|
resize(width(), tqminimumSize().height());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::slotDegrees()
|
|
|
|
@ -454,8 +454,8 @@ void MainWindow::saveConfig()
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
list += TQString("%1=%2")
|
|
|
|
|
.arg(*it)
|
|
|
|
|
.arg(ValueManager::instance()->value(*it).toString());
|
|
|
|
|
.tqarg(*it)
|
|
|
|
|
.tqarg(ValueManager::instance()->value(*it).toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config.writeEntry("Saved Variables", list);
|
|
|
|
@ -492,7 +492,7 @@ void MainWindow::saveConfig()
|
|
|
|
|
TQString var = manager->function(*it)->userFn->varName;
|
|
|
|
|
TQString expr = fn->operand()->infixString();
|
|
|
|
|
|
|
|
|
|
saveList += TQString("set %1(%2) = %3").arg(*it).arg(var).arg(expr);
|
|
|
|
|
saveList += TQString("set %1(%2) = %3").tqarg(*it).tqarg(var).tqarg(expr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config.writeEntry("FunctionList", saveList);
|
|
|
|
@ -631,7 +631,7 @@ void MainWindow::slotNewFunction(const TQString &name)
|
|
|
|
|
{
|
|
|
|
|
UserFunction *userFn = FunctionManager::instance()->function(name)->userFn;
|
|
|
|
|
UnaryFunction *fn = dynamic_cast<UnaryFunction *>(userFn->fn);
|
|
|
|
|
TQString fnName = TQString("%1(%2)").arg(name, userFn->varName);
|
|
|
|
|
TQString fnName = TQString("%1(%2)").tqarg(name, userFn->varName);
|
|
|
|
|
TQString expr = fn->operand()->infixString();
|
|
|
|
|
|
|
|
|
|
new KListViewItem(m_fnList, fnName, expr);
|
|
|
|
@ -640,7 +640,7 @@ void MainWindow::slotNewFunction(const TQString &name)
|
|
|
|
|
void MainWindow::slotRemoveFunction(const TQString &name)
|
|
|
|
|
{
|
|
|
|
|
UserFunction *userFn = FunctionManager::instance()->function(name)->userFn;
|
|
|
|
|
TQString fnName = TQString("%1(%2)").arg(name, userFn->varName);
|
|
|
|
|
TQString fnName = TQString("%1(%2)").tqarg(name, userFn->varName);
|
|
|
|
|
|
|
|
|
|
TQListViewItem *item = 0;
|
|
|
|
|
while((item = m_fnList->findItem(fnName, 0)) != 0)
|
|
|
|
@ -714,7 +714,7 @@ TQString MainWindow::interpolateExpression(const TQString &text, ResultListViewT
|
|
|
|
|
unsigned numPos = stackStr.mid(1).toUInt();
|
|
|
|
|
|
|
|
|
|
if(!m_result->getStackValue(numPos, value)) {
|
|
|
|
|
new ResultListViewText(m_result, text, i18n("Marker %1 isn't set").arg(stackStr), after, true);
|
|
|
|
|
new ResultListViewText(m_result, text, i18n("Marker %1 isn't set").tqarg(stackStr), after, true);
|
|
|
|
|
return TQString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|