Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>master
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 474 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,180 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||||
|
* thomas-schweitzer(at)arcor.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License version 2.0 as *
|
||||||
|
* published by the Free Software Foundation. *
|
||||||
|
* *
|
||||||
|
* This program 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 General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program in the file LICENSE.GPL; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef INDENTHANDLER_H
|
||||||
|
#define INDENTHANDLER_H
|
||||||
|
|
||||||
|
#include <tqwidget.h>
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
///-- class UiGuiErrorMessage;
|
||||||
|
///-- class UiGuiIniFileParser;
|
||||||
|
|
||||||
|
class TQComboBox;
|
||||||
|
class TQToolBox;
|
||||||
|
class TQToolButton;
|
||||||
|
class TQVBoxLayout;
|
||||||
|
///-- class TQMenu;
|
||||||
|
///-- class TQLabel;
|
||||||
|
///-- class TQSpinBox;
|
||||||
|
///-- class TQCheckBox;
|
||||||
|
///-- class TQLineEdit;
|
||||||
|
|
||||||
|
|
||||||
|
class IndentHandler : public TQWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
IndentHandler(int indenterID, MainWindow *mainWindow = nullptr, TQWidget *parent = nullptr);
|
||||||
|
~IndentHandler();
|
||||||
|
|
||||||
|
///-- TQString generateShellScript(const TQString &configFilename);
|
||||||
|
///-- TQString callIndenter(TQString sourceCode, TQString inputFileExtension);
|
||||||
|
///-- bool loadConfigFile(TQString filePathName);
|
||||||
|
///-- void resetToDefaultValues();
|
||||||
|
///-- TQStringList getAvailableIndenters();
|
||||||
|
///-- TQString getPossibleIndenterFileExtensions();
|
||||||
|
///-- TQString getParameterString();
|
||||||
|
///-- TQString getIndenterCfgFile();
|
||||||
|
///-- TQString getManual();
|
||||||
|
///-- TQString getCurrentIndenterName();
|
||||||
|
void contextMenuEvent(TQContextMenuEvent *event);
|
||||||
|
///-- int getIndenterId();
|
||||||
|
///--
|
||||||
|
///-- signals:
|
||||||
|
///-- void indenterSettingsChanged();
|
||||||
|
///-- void selectedIndenterIndexChanged(int index);
|
||||||
|
///--
|
||||||
|
///-- protected:
|
||||||
|
///-- bool event(TQEvent *event);
|
||||||
|
///-- void wheelEvent(TQWheelEvent *event);
|
||||||
|
///--
|
||||||
|
private slots:
|
||||||
|
void setIndenter(int indenterID);
|
||||||
|
void showIndenterManual() const;
|
||||||
|
void openConfigFileDialog();
|
||||||
|
void saveasIndentCfgFileDialog();
|
||||||
|
void createIndenterCallShellScript();
|
||||||
|
void resetIndenterParameter();
|
||||||
|
///-- void handleChangedIndenterSettings();
|
||||||
|
///--
|
||||||
|
///-- private:
|
||||||
|
///-- TQString callExecutableIndenter(TQString sourceCode, TQString inputFileExtension);
|
||||||
|
///-- TQString callJavaScriptIndenter(TQString sourceCode);
|
||||||
|
///-- void saveConfigFile(TQString filePathName, TQString parameterString);
|
||||||
|
///-- void readIndentIniFile(TQString iniFilePath);
|
||||||
|
///-- bool createIndenterCallString();
|
||||||
|
///--
|
||||||
|
///-- // Holds a reference to all created pages of the parameter categories toolbox and the pages
|
||||||
|
///-- // boxlayout
|
||||||
|
///-- struct IndenterParameterCategoryPage
|
||||||
|
///-- {
|
||||||
|
///-- TQWidget *widget;
|
||||||
|
///-- TQVBoxLayout *vboxLayout;
|
||||||
|
///-- };
|
||||||
|
///--
|
||||||
|
///-- TQVector<IndenterParameterCategoryPage> _indenterParameterCategoryPages;
|
||||||
|
///--
|
||||||
|
///-- // Holds a reference to all checkboxes needed for boolean parameter setting and the parameters
|
||||||
|
///-- // name
|
||||||
|
///-- struct ParamBoolean
|
||||||
|
///-- {
|
||||||
|
///-- TQString paramName;
|
||||||
|
///-- TQString trueString;
|
||||||
|
///-- TQString falseString;
|
||||||
|
///-- TQCheckBox *checkBox;
|
||||||
|
///-- };
|
||||||
|
///--
|
||||||
|
///-- TQVector<ParamBoolean> _paramBooleans;
|
||||||
|
///--
|
||||||
|
///-- // Holds a reference to all line edits needed for parameter setting and the parameters name
|
||||||
|
///-- struct ParamString
|
||||||
|
///-- {
|
||||||
|
///-- TQString paramName;
|
||||||
|
///-- TQString paramCallName;
|
||||||
|
///-- TQCheckBox *valueEnabledChkBox;
|
||||||
|
///-- TQLineEdit *lineEdit;
|
||||||
|
///-- TQLabel *label;
|
||||||
|
///-- };
|
||||||
|
///--
|
||||||
|
///-- TQVector<ParamString> _paramStrings;
|
||||||
|
///--
|
||||||
|
///-- // Hold a reference to all spin boxes needed for parameter setting and the parameters name
|
||||||
|
///-- struct ParamNumeric
|
||||||
|
///-- {
|
||||||
|
///-- TQString paramName;
|
||||||
|
///-- TQString paramCallName;
|
||||||
|
///-- TQCheckBox *valueEnabledChkBox;
|
||||||
|
///-- TQSpinBox *spinBox;
|
||||||
|
///-- TQLabel *label;
|
||||||
|
///-- };
|
||||||
|
///--
|
||||||
|
///-- TQVector<ParamNumeric> _paramNumerics;
|
||||||
|
///--
|
||||||
|
///-- // Hold a reference to all combo boxes needed for parameter setting and the parameters name
|
||||||
|
///-- struct ParamMultiple
|
||||||
|
///-- {
|
||||||
|
///-- TQString paramName;
|
||||||
|
///-- TQString paramCallName;
|
||||||
|
///-- TQCheckBox *valueEnabledChkBox;
|
||||||
|
///-- TQComboBox *comboBox;
|
||||||
|
///-- TQStringList choicesStrings;
|
||||||
|
///-- TQStringList choicesStringsReadable;
|
||||||
|
///-- };
|
||||||
|
///--
|
||||||
|
///-- TQVector<ParamMultiple> _paramMultiples;
|
||||||
|
///--
|
||||||
|
TQComboBox *m_indenterSelectionCombobox;
|
||||||
|
TQToolButton *m_indenterParameterHelpButton;
|
||||||
|
///-- // Vertical layout box, into which the toolbox will be added
|
||||||
|
TQVBoxLayout *m_toolBoxContainerLayout;
|
||||||
|
TQToolBox *m_indenterParameterCategoriesToolBox;
|
||||||
|
///-- UiGuiIniFileParser *_indenterSettings;
|
||||||
|
///-- TQStringList _indenterParameters;
|
||||||
|
///-- // The indenters name in a descriptive form
|
||||||
|
///-- TQString _indenterName;
|
||||||
|
///-- // The indenters file name (w/o extension), that is being called
|
||||||
|
///-- TQString _indenterFileName;
|
||||||
|
TQString m_indenterDirectoryStr;
|
||||||
|
TQString m_tempDirectoryStr;
|
||||||
|
TQString m_settingsDirectoryStr;
|
||||||
|
///-- TQStringList _indenterIniFileList;
|
||||||
|
///-- TQString _parameterOrder;
|
||||||
|
///-- TQString _globalConfigFilename;
|
||||||
|
///-- TQString _cfgFileParameterEnding;
|
||||||
|
///-- TQString _inputFileParameter;
|
||||||
|
///-- TQString _inputFileName;
|
||||||
|
///-- TQString _outputFileParameter;
|
||||||
|
///-- TQString _outputFileName;
|
||||||
|
///-- TQString _fileTypes;
|
||||||
|
///-- TQString _useCfgFileParameter;
|
||||||
|
///-- TQString _indenterShowHelpParameter;
|
||||||
|
MainWindow *m_mainWindow;
|
||||||
|
TQWidget *m_parent;
|
||||||
|
///-- UiGuiErrorMessage *_errorMessageDialog;
|
||||||
|
TQString m_indenterExecutableCallString;
|
||||||
|
TQString m_indenterExecutableSuffix;
|
||||||
|
///--
|
||||||
|
|
||||||
|
///-- //TODO: This function should go into a string helper/tool class/file.
|
||||||
|
///-- TQString encodeToHTML(const TQString &text);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INDENTHANDLER_H
|
@ -1,195 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
|
||||||
* thomas-schweitzer(at)arcor.de *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License version 2.0 as *
|
|
||||||
* published by the Free Software Foundation. *
|
|
||||||
* *
|
|
||||||
* This program 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 General Public License for more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License *
|
|
||||||
* along with this program in the file LICENSE.GPL; if not, write to the *
|
|
||||||
* Free Software Foundation, Inc., *
|
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#ifndef INDENTHANDLER_H
|
|
||||||
#define INDENTHANDLER_H
|
|
||||||
|
|
||||||
#include <tntqwidget.h>
|
|
||||||
|
|
||||||
class UiGuiErrorMessage;
|
|
||||||
class UiGuiIniFileParser;
|
|
||||||
|
|
||||||
class TQMenu;
|
|
||||||
class TQVBoxLayout;
|
|
||||||
class TQLabel;
|
|
||||||
class TQSpinBox;
|
|
||||||
class TQComboBox;
|
|
||||||
class TQCheckBox;
|
|
||||||
class TQLineEdit;
|
|
||||||
class TQToolButton;
|
|
||||||
class TQToolBox;
|
|
||||||
|
|
||||||
|
|
||||||
class IndentHandler : public TQWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
IndentHandler(int indenterID, TQWidget *mainWindow = NULL, TQWidget *parent = NULL);
|
|
||||||
~IndentHandler();
|
|
||||||
|
|
||||||
TQString generateShellScript(const TQString &configFilename);
|
|
||||||
TQString callIndenter(TQString sourceCode, TQString inputFileExtension);
|
|
||||||
bool loadConfigFile(TQString filePathName);
|
|
||||||
void resetToDefaultValues();
|
|
||||||
TQStringList getAvailableIndenters();
|
|
||||||
TQString getPossibleIndenterFileExtensions();
|
|
||||||
TQString getParameterString();
|
|
||||||
TQString getIndenterCfgFile();
|
|
||||||
TQString getManual();
|
|
||||||
void retranslateUi();
|
|
||||||
TQString getCurrentIndenterName();
|
|
||||||
TQMenu* getIndenterMenu();
|
|
||||||
TQList<TQAction*> getIndenterMenuActions();
|
|
||||||
void contextMenuEvent(TQContextMenuEvent *event);
|
|
||||||
void setParameterChangedCallback(void (*paramChangedCallback)(void));
|
|
||||||
void setWindowClosedCallback(void (*winClosedCallback)(void));
|
|
||||||
int getIndenterId();
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void indenterSettingsChanged();
|
|
||||||
void selectedIndenterIndexChanged(int index);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool event(TQEvent *event);
|
|
||||||
void closeEvent(TQCloseEvent *event);
|
|
||||||
void wheelEvent(TQWheelEvent *event);
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void setIndenter(int indenterID);
|
|
||||||
void showIndenterManual();
|
|
||||||
void openConfigFileDialog();
|
|
||||||
void saveasIndentCfgFileDialog();
|
|
||||||
void createIndenterCallShellScript();
|
|
||||||
void resetIndenterParameter();
|
|
||||||
void handleChangedIndenterSettings();
|
|
||||||
void updateDrawing();
|
|
||||||
|
|
||||||
private:
|
|
||||||
TQString callExecutableIndenter(TQString sourceCode, TQString inputFileExtension);
|
|
||||||
TQString callJavaScriptIndenter(TQString sourceCode);
|
|
||||||
void saveConfigFile(TQString filePathName, TQString parameterString);
|
|
||||||
void readIndentIniFile(TQString iniFilePath);
|
|
||||||
bool createIndenterCallString();
|
|
||||||
void initIndenterMenu();
|
|
||||||
|
|
||||||
// Holds a reference to all created pages of the parameter categories toolbox and the pages
|
|
||||||
// boxlayout
|
|
||||||
struct IndenterParameterCategoryPage
|
|
||||||
{
|
|
||||||
TQWidget *widget;
|
|
||||||
TQVBoxLayout *vboxLayout;
|
|
||||||
};
|
|
||||||
|
|
||||||
TQVector<IndenterParameterCategoryPage> _indenterParameterCategoryPages;
|
|
||||||
|
|
||||||
// Holds a reference to all checkboxes needed for boolean parameter setting and the parameters
|
|
||||||
// name
|
|
||||||
struct ParamBoolean
|
|
||||||
{
|
|
||||||
TQString paramName;
|
|
||||||
TQString trueString;
|
|
||||||
TQString falseString;
|
|
||||||
TQCheckBox *checkBox;
|
|
||||||
};
|
|
||||||
|
|
||||||
TQVector<ParamBoolean> _paramBooleans;
|
|
||||||
|
|
||||||
// Holds a reference to all line edits needed for parameter setting and the parameters name
|
|
||||||
struct ParamString
|
|
||||||
{
|
|
||||||
TQString paramName;
|
|
||||||
TQString paramCallName;
|
|
||||||
TQCheckBox *valueEnabledChkBox;
|
|
||||||
TQLineEdit *lineEdit;
|
|
||||||
TQLabel *label;
|
|
||||||
};
|
|
||||||
|
|
||||||
TQVector<ParamString> _paramStrings;
|
|
||||||
|
|
||||||
// Hold a reference to all spin boxes needed for parameter setting and the parameters name
|
|
||||||
struct ParamNumeric
|
|
||||||
{
|
|
||||||
TQString paramName;
|
|
||||||
TQString paramCallName;
|
|
||||||
TQCheckBox *valueEnabledChkBox;
|
|
||||||
TQSpinBox *spinBox;
|
|
||||||
TQLabel *label;
|
|
||||||
};
|
|
||||||
|
|
||||||
TQVector<ParamNumeric> _paramNumerics;
|
|
||||||
|
|
||||||
// Hold a reference to all combo boxes needed for parameter setting and the parameters name
|
|
||||||
struct ParamMultiple
|
|
||||||
{
|
|
||||||
TQString paramName;
|
|
||||||
TQString paramCallName;
|
|
||||||
TQCheckBox *valueEnabledChkBox;
|
|
||||||
TQComboBox *comboBox;
|
|
||||||
TQStringList choicesStrings;
|
|
||||||
TQStringList choicesStringsReadable;
|
|
||||||
};
|
|
||||||
|
|
||||||
TQVector<ParamMultiple> _paramMultiples;
|
|
||||||
|
|
||||||
TQComboBox *_indenterSelectionCombobox;
|
|
||||||
TQToolButton *_indenterParameterHelpButton;
|
|
||||||
// Vertical layout box, into which the toolbox will be added
|
|
||||||
TQVBoxLayout *_toolBoxContainerLayout;
|
|
||||||
TQToolBox *_indenterParameterCategoriesToolBox;
|
|
||||||
UiGuiIniFileParser *_indenterSettings;
|
|
||||||
TQStringList _indenterParameters;
|
|
||||||
// The indenters name in a descriptive form
|
|
||||||
TQString _indenterName;
|
|
||||||
// The indenters file name (w/o extension), that is being called
|
|
||||||
TQString _indenterFileName;
|
|
||||||
TQString _indenterDirctoryStr;
|
|
||||||
TQString _tempDirctoryStr;
|
|
||||||
TQString _settingsDirctoryStr;
|
|
||||||
TQStringList _indenterIniFileList;
|
|
||||||
TQString _parameterOrder;
|
|
||||||
TQString _globalConfigFilename;
|
|
||||||
TQString _cfgFileParameterEnding;
|
|
||||||
TQString _inputFileParameter;
|
|
||||||
TQString _inputFileName;
|
|
||||||
TQString _outputFileParameter;
|
|
||||||
TQString _outputFileName;
|
|
||||||
TQString _fileTypes;
|
|
||||||
TQString _useCfgFileParameter;
|
|
||||||
TQString _indenterShowHelpParameter;
|
|
||||||
TQWidget *_mainWindow;
|
|
||||||
UiGuiErrorMessage *_errorMessageDialog;
|
|
||||||
TQString _indenterExecutableCallString;
|
|
||||||
TQString _indenterExecutableSuffix;
|
|
||||||
|
|
||||||
TQMenu *_menuIndenter;
|
|
||||||
TQAction *_actionLoadIndenterConfigFile;
|
|
||||||
TQAction *_actionSaveIndenterConfigFile;
|
|
||||||
TQAction *_actionCreateShellScript;
|
|
||||||
TQAction *_actionResetIndenterParameters;
|
|
||||||
// Needed for the NPP plugin.
|
|
||||||
void (*_parameterChangedCallback)(void);
|
|
||||||
// Needed for the NPP plugin.
|
|
||||||
void (*_windowClosedCallback)(void);
|
|
||||||
|
|
||||||
//TODO: This function should go into a string helper/tool class/file.
|
|
||||||
TQString encodeToHTML(const TQString &text);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // INDENTHANDLER_H
|
|
@ -1,51 +0,0 @@
|
|||||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
|
||||||
<author>Thomas_-_S</author>
|
|
||||||
<class>MainWindowUi</class>
|
|
||||||
<widget class="TQMainWindow">
|
|
||||||
<property name="name">
|
|
||||||
<cstring>MainWindowUi</cstring>
|
|
||||||
</property>
|
|
||||||
<widget class="TQWidget" name="centralwidget"/>
|
|
||||||
<widget class="TQStatusBar" name="statusbar"/>
|
|
||||||
<widget class="TQDockWidget" name="dockWidget">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="features">
|
|
||||||
<set>TQDockWidget::DockWidgetFloatable|TQDockWidget::DockWidgetMovable</set>
|
|
||||||
</property>
|
|
||||||
<property name="allowedAreas">
|
|
||||||
<set>TQt::LeftDockWidgetArea|TQt::RightDockWidgetArea</set>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Indenter Settings</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="dockWidgetArea">
|
|
||||||
<number>1</number>
|
|
||||||
</attribute>
|
|
||||||
<widget class="TQWidget" name="dockWidgetContents">
|
|
||||||
<layout class="TQHBoxLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="TQVBoxLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</UI>
|
|