-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tool plugin for Py-ChemShell finished; removed all changes to command…
…s and gui
- Loading branch information
Showing
11 changed files
with
1,999 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Meta-Objects | ||
set(chemshelltool_MOC_HDRS | ||
chemshelltool.hui | ||
chemshelltooldialog.h | ||
) | ||
QT5_WRAP_CPP(chemshelltool_MOC_SRCS ${chemshelltool_MOC_HDRS} OPTIONS -I${PROJECT_SOURCE_DIR}/src) | ||
|
||
SET(chemshelltool_UIS | ||
chemshelltooldialog.ui | ||
) | ||
QT5_WRAP_UI(chemshelltool_UIS_H ${chemshelltool_UIS}) | ||
|
||
# Resources | ||
set(chemshelltool_RES_QRC | ||
chemshelltool_icons.qrc | ||
) | ||
QT5_ADD_RESOURCES(chemshelltool_RES ${chemshelltool_RES_QRC}) | ||
|
||
add_library(chemshelltool MODULE | ||
chemshelltool_funcs.cpp | ||
chemshelltooldialog_funcs.cpp | ||
${chemshelltool_RES} | ||
${chemshelltool_MOC_SRCS} | ||
${chemshelltool_UIS_H} | ||
) | ||
target_link_libraries(chemshelltool | ||
plugins | ||
${PLUGIN_LINK_LIBS} | ||
) | ||
set_target_properties(chemshelltool PROPERTIES | ||
LIBRARY_OUTPUT_DIRECTORY ${Aten_BINARY_DIR}/data/plugins | ||
COMPILE_DEFINITIONS "QT_PLUGIN" | ||
PREFIX "" | ||
) | ||
|
||
# Install Targets | ||
if(UNIX AND NOT APPLE) | ||
install(TARGETS chemshelltool | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/aten/plugins COMPONENT RuntimePlugins | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/aten/plugins COMPONENT RuntimePlugins | ||
) | ||
endif(UNIX AND NOT APPLE) | ||
|
||
# Includes | ||
target_include_directories(chemshelltool PRIVATE | ||
${PROJECT_SOURCE_DIR}/src | ||
${PROJECT_BINARY_DIR}/src | ||
${Qt5Core_INCLUDE_DIRS} | ||
${Qt5Gui_INCLUDE_DIRS} | ||
${Qt5Widgets_INCLUDE_DIRS} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* | ||
*** ChemShell Tool Plugin | ||
*** src/plugins/tool_chemshell/chemshelltool.hui | ||
Copyright T. Youngs 2016-2018 | ||
|
||
This file is part of Aten. | ||
|
||
Aten is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
Aten 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 Aten. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef ATEN_CHEMSHELLPLUGIN_H | ||
#define ATEN_CHEMSHELLPLUGIN_H | ||
|
||
#include "plugins/interfaces/toolplugin.h" | ||
#include "plugins/interfaces/fileplugin.h" | ||
#include "gui/mainwindow.h" | ||
#include "main/aten.h" | ||
#include <QDir> | ||
#include "base/kvmap.h" | ||
#include "base/prefs.h" | ||
#include "base/encoderdefinition.h" | ||
#include "model/bundle.h" | ||
#include "model/fragment.h" | ||
#include "model/fragmentgroup.h" | ||
#include "templates/list.h" | ||
#include "parser/program.h" | ||
#include "parser/variablelist.h" | ||
#include "methods/partitioningscheme.h" | ||
#include "gui/useractions.h" | ||
#include "plugins/pluginstore.h" | ||
#include "base/namespace.h" | ||
|
||
// forward declarations | ||
class AtenWindow; | ||
class FileParser; | ||
|
||
ATEN_BEGIN_NAMESPACE | ||
|
||
// ChemShell Tool Plugin | ||
class ChemShellToolPlugin : public QObject, public ToolPluginInterface | ||
{ | ||
Q_OBJECT | ||
Q_PLUGIN_METADATA(IID "com.projectaten.Aten.CSToolPluginInterface.v1") | ||
Q_INTERFACES(AtenSpace::ToolPluginInterface) | ||
|
||
|
||
public: | ||
// Constructor | ||
ChemShellToolPlugin(); | ||
// Destructor | ||
~ChemShellToolPlugin(); | ||
|
||
|
||
private: | ||
AtenWindow* atenWindow(); | ||
|
||
/* | ||
* Instance Handling | ||
*/ | ||
private: | ||
// Return a copy of the plugin object | ||
BasePluginInterface* makeCopy() const; | ||
void renameKeywords(); | ||
|
||
|
||
/* | ||
* Definition | ||
*/ | ||
public: | ||
// Return type of plugin | ||
PluginTypes::PluginType type() const; | ||
// Return category of plugin | ||
int category() const; | ||
// Return name of plugin | ||
QString name() const; | ||
// Return nickname of plugin | ||
QString nickname() const; | ||
// Return whether plugin is enabled | ||
bool enabled() const; | ||
// Return description (long name) of plugin | ||
QString description() const; | ||
|
||
|
||
/* | ||
* Tool Definition | ||
*/ | ||
public: | ||
// Return button label to use in GUI | ||
QString buttonLabel() const; | ||
// Return icon for button in GUI | ||
QIcon buttonIcon() const; | ||
// Return group name for tool (used to group similar tools together) | ||
QString groupName() const; | ||
// Return whether the tool is enabled (appears in the GUI) | ||
bool isEnabled() const; | ||
// Return whether the tool has a dialog | ||
bool hasDialog() const; | ||
// Show the dialog for the tool | ||
bool showDialog(); | ||
// Run the tool with the current settings | ||
bool runTool(); | ||
|
||
/* | ||
* QObject / Signals | ||
*/ | ||
public: | ||
// Return interface as QObject | ||
QObject* object(); | ||
|
||
signals: | ||
void updateWidgets(int); | ||
}; | ||
|
||
ATEN_END_NAMESPACE | ||
|
||
#endif |
Oops, something went wrong.