Finish off the indenter code and update to TQ_OBJECT

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/3/head
Michele Calgaro 1 year ago
parent c529f9057e
commit e19f9a02df
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -25,7 +25,7 @@
class AboutDialog : public AboutDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
AboutDialog(TQWidget *parent = NULL, WFlags flags = 0);

@ -51,9 +51,6 @@
#include <tqtoolbox.h>
#include <tqtoolbutton.h>
#include <tqtooltip.h>
//--- #include <tqsettings.h>
//--- #include <tqbytearray.h>
//--- #include <tqtscript.h>
// \defgroup grp_Indenter All concerning handling of the indenter.
@ -311,39 +308,7 @@ TQString IndentHandler::generateShellScript(const TQString &configFilename)
*/
TQString IndentHandler::callIndenter(const TQString &sourceCode, const TQString &inputFileExtension)
{
if (m_indenterExecutableSuffix == ".js")
{
return callJavaScriptIndenter(sourceCode);
}
else
{
return callExecutableIndenter(sourceCode, inputFileExtension);
}
}
/*
\brief Format \a sourceCode by calling the interpreted JavaScript code of the indenter.
The \a inputFileExtension has to be given as parameter so the called indenter
can identify the programming language if needed.
*/
TQString IndentHandler::callJavaScriptIndenter(const TQString &sourceCode)
{
//--- TQScriptEngine engine;
//---
//--- engine.globalObject().setProperty("unformattedCode", sourceCode);
//---
//--- TQFile jsDecoderFile(m_indenterExecutableCallString);
//--- TQString jsDecoderCode;
//--- if (jsDecoderFile.open(TQFile::ReadOnly))
//--- {
//--- jsDecoderCode = jsDecoderFile.readAll();
//--- }
//--- jsDecoderFile.close();
//---
//--- TQScriptValue value = engine.evaluate(jsDecoderCode);
//--- return value.toString();
return "";
return callExecutableIndenter(sourceCode, inputFileExtension);
}
/*
@ -1279,13 +1244,13 @@ void IndentHandler::setIndenter(int indenterID)
TQApplication::restoreOverrideCursor();
}
//--- /*
//--- \brief Returns a string containing by the indenter supported file types/extensions divided by a space.
//--- */
//--- TQString IndentHandler::getPossibleIndenterFileExtensions()
//--- {
//--- return m_fileTypes;
//--- }
/*
\brief Returns a string containing by the indenter supported file types/extensions divided by a space.
*/
TQString IndentHandler::getPossibleIndenterFileExtensions()
{
return m_fileTypes;
}
/*
\brief Returns the path and filename of the current indenter config file.
@ -1523,20 +1488,20 @@ bool IndentHandler::createIndenterCallString()
return false;
}
//--- /*
//--- \brief Returns a string that points to where the indenters manual can be found.
//--- */
//--- TQString IndentHandler::getManual()
//--- {
//--- if (m_indenterSettings != nullptr)
//--- {
//--- return m_indenterSettings->value("header/manual").toString();
//--- }
//--- else
//--- {
//--- return "";
//--- }
//--- }
/*
\brief Returns a string that points to where the indenters manual can be found.
*/
TQString IndentHandler::getManual()
{
if (m_indenterSettings != nullptr)
{
return m_indenterSettings->value("header/manual").toString();
}
else
{
return "";
}
}
/*
\brief This slot gets the reference to the indenters manual and opens it.
@ -1676,30 +1641,6 @@ void IndentHandler::resetIndenterParameter()
}
}
//--- /*
//--- \brief Catch some events and let some other be handled by the super class.
//---
//--- Is needed for use as Notepad++ plugin.
//--- */
//--- bool IndentHandler::event(TQEvent *event)
//--- {
//--- if (event->type() == TQEvent::WindowActivate)
//--- {
//--- event->accept();
//--- return true;
//--- }
//--- else if (event->type() == TQEvent::WindowDeactivate)
//--- {
//--- event->accept();
//--- return true;
//--- }
//--- else
//--- {
//--- event->ignore();
//--- return TQWidget::event(event);
//--- }
//--- }
/*
\brief Emits the \a indenterSettingsChanged signal
*/

@ -40,7 +40,7 @@ class TQVBoxLayout;
class IndentHandler : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
IndentHandler(int indenterID, MainWindow *mainWindow = nullptr, TQWidget *parent = nullptr);
@ -51,20 +51,15 @@ class IndentHandler : public TQWidget
bool loadConfigFile(const TQString &filePathName);
void resetToDefaultValues();
TQStringList getAvailableIndenters();
///-- TQString getPossibleIndenterFileExtensions();
TQString getPossibleIndenterFileExtensions();
TQString getParameterString();
TQString getIndenterCfgFile();
///-- TQString getManual();
TQString getManual();
TQString getCurrentIndenterName();
void contextMenuEvent(TQContextMenuEvent *event);
signals:
void indenterSettingsChanged();
///-- void selectedIndenterIndexChanged(int index);
///-- protected:
///-- bool event(TQEvent *event);
///-- void wheelEvent(TQWheelEvent *event);
private slots:
void setIndenter(int indenterID);
@ -78,7 +73,6 @@ class IndentHandler : public TQWidget
private:
TQString callExecutableIndenter(const TQString &sourceCode, const TQString &inputFileExt);
TQString callJavaScriptIndenter(const TQString &sourceCode);
void saveConfigFile(const TQString &filePathName, const TQString &parameterString);
void readIndentIniFile(const TQString &iniFilePath);
bool createIndenterCallString();

@ -522,9 +522,8 @@ void MainWindow::openSourceFileDialog(const TQString &fileName)
return;
}
TQString openedSourceFileContent = "";
TQString fileExtensions = "*.h *.c *.cpp *.*"; // Remove this line when the indenter is available
///-- TQString fileExtensions = tr("Supported by indenter") + " (" +
///-- m_indentHandler->getPossibleIndenterFileExtensions() + ");;" + tr("All files") + " (*.*)";
TQString fileExtensions = tr("Supported by indenter") + " (" +
m_indentHandler->getPossibleIndenterFileExtensions() + ");;" + tr("All files") + " (*.*)";
TQString fileToOpen = fileName;
if (fileToOpen.isEmpty())
@ -565,9 +564,8 @@ void MainWindow::openSourceFileDialog(const TQString &fileName)
*/
bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction)
{
TQString fileExtensions = "*.h *.c *.cpp *.*"; // Remove this line when the indenter is available
//--- TQString fileExtensions = tr("Supported by indenter") + " (" +
//--- m_indentHandler->getPossibleIndenterFileExtensions() + ");;" + tr("All files") + " (*.*)";
TQString fileExtensions = tr("Supported by indenter") + " (" +
m_indentHandler->getPossibleIndenterFileExtensions() + ");;" + tr("All files") + " (*.*)";
TQString fileName = TQFileDialog::getSaveFileName(m_currentSourceFile, fileExtensions, this, nullptr,
tr("Save source code file"));

@ -28,7 +28,7 @@ class TQCheckBox;
class UiGuiErrorMessage : public TQErrorMessage
{
Q_OBJECT
TQ_OBJECT
public:
UiGuiErrorMessage(TQWidget *parent = nullptr);

@ -30,7 +30,7 @@ class TQSettings;
class UiGuiSettings : public TQObject
{
Q_OBJECT
TQ_OBJECT
private:
UiGuiSettings();

@ -29,7 +29,7 @@ class TQSplashScreen;
class AboutDialogGraphicsView : public TQGraphicsView
{
Q_OBJECT
TQ_OBJECT
public:
AboutDialogGraphicsView(AboutDialog *aboutDialog, TQWidget *parentWindow = NULL);

@ -34,7 +34,7 @@ class QsciLexer;
class UiGuiHighlighter : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
UiGuiHighlighter(TQextScintilla *parent);

@ -28,7 +28,7 @@ class TQTcpSocket;
class UiGuiIndentServer : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
UiGuiIndentServer(void);

@ -32,7 +32,7 @@ namespace Ui
class UiGuiSettingsDialog : public TQDialog
{
Q_OBJECT
TQ_OBJECT
public:
UiGuiSettingsDialog(TQWidget *parent, TQSharedPointer<UiGuiSettings> settings);

@ -36,7 +36,7 @@ namespace tschweitzer
class TSLogger : public TQDialog
{
Q_OBJECT
TQ_OBJECT
public:
static TSLogger* getInstance(int verboseLevel);

Loading…
Cancel
Save