Pārlūkot izejas kodu

Rename ctkConsoleWidget/ctkPythonShell into ctkConsole/ctkPythonConsole

Jean-Christophe Fillion-Robin 15 gadi atpakaļ
vecāks
revīzija
ff8759bec9

+ 1 - 1
Applications/ctkSimplePythonShell/Testing/Python/ctkWidgetsTest.py

@@ -5,7 +5,7 @@ from qt import QTimer
 w = ctkMatrixWidget()
 w = ctkMatrixWidget()
 w.show()
 w.show()
 
 
-if not _ctkPythonShellInstance.isInteractive:
+if not _ctkPythonConsoleInstance.isInteractive:
   #QTimer().singleShot(0, app(), SLOT('quit()'))
   #QTimer().singleShot(0, app(), SLOT('quit()'))
   t = QTimer()
   t = QTimer()
   t.setInterval(250)
   t.setInterval(250)

+ 3 - 3
Applications/ctkSimplePythonShell/Testing/Python/derivedQWidgetTest.py

@@ -13,7 +13,7 @@ class ExampleWidget(QWidget):
     checkbox = QCheckBox('Shell Visibility', self)
     checkbox = QCheckBox('Shell Visibility', self)
     layout.addWidget(checkbox);
     layout.addWidget(checkbox);
     checkbox.setChecked(True)
     checkbox.setChecked(True)
-    checkbox.connect('toggled(bool)', _ctkPythonShellInstance, 'setVisible(bool)')
+    checkbox.connect('toggled(bool)', _ctkPythonConsoleInstance, 'setVisible(bool)')
     
     
     self.button = QPushButton('Quit', self)
     self.button = QPushButton('Quit', self)
     layout.addWidget(self.button);
     layout.addWidget(self.button);
@@ -29,8 +29,8 @@ class ExampleWidget(QWidget):
 w = ExampleWidget()
 w = ExampleWidget()
 w.show()
 w.show()
 
 
-if not _ctkPythonShellInstance.isInteractive:
-  #QTimer().singleShot(0, app(), SLOT('quit()'))
+if not _ctkPythonConsoleInstance.isInteractive:
+  #QTimer().singleShot(250, app(), SLOT('quit()'))
   t = QTimer()
   t = QTimer()
   t.setInterval(250)
   t.setInterval(250)
   t.connect('timeout()', app(), 'quit()')
   t.connect('timeout()', app(), 'quit()')

+ 7 - 7
Applications/ctkSimplePythonShell/ctkSimplePythonShellMain.cpp

@@ -4,7 +4,7 @@
 #include <QTextStream>
 #include <QTextStream>
 
 
 // CTK includes
 // CTK includes
-#include <ctkPythonShell.h>
+#include <ctkPythonConsole.h>
 #include <ctkCommandLineParser.h>
 #include <ctkCommandLineParser.h>
 
 
 #include "ctkSimplePythonManager.h"
 #include "ctkSimplePythonManager.h"
@@ -54,14 +54,14 @@ int main(int argc, char** argv)
   
   
   ctkSimplePythonManager pythonManager;
   ctkSimplePythonManager pythonManager;
   
   
-  ctkPythonShell shell(&pythonManager);
-  shell.setAttribute(Qt::WA_QuitOnClose, true);
-  shell.resize(600, 280);
-  shell.show();
+  ctkPythonConsole console(&pythonManager);
+  console.setAttribute(Qt::WA_QuitOnClose, true);
+  console.resize(600, 280);
+  console.show();
 
 
-  shell.setProperty("isInteractive", parsedArgs.contains("interactive"));
+  console.setProperty("isInteractive", parsedArgs.contains("interactive"));
 
 
-  pythonManager.addObjectToPythonMain("_ctkPythonShellInstance", &shell);
+  pythonManager.addObjectToPythonMain("_ctkPythonConsoleInstance", &console);
 
 
   ctkTestWrappedQProperty testWrappedQProperty;
   ctkTestWrappedQProperty testWrappedQProperty;
   pythonManager.addObjectToPythonMain("_testWrappedQPropertyInstance", &testWrappedQProperty);
   pythonManager.addObjectToPythonMain("_testWrappedQPropertyInstance", &testWrappedQProperty);

+ 3 - 3
Libs/Scripting/Python/Widgets/CMakeLists.txt

@@ -16,13 +16,13 @@ SET(KIT_export_directive "CTK_SCRIPTING_PYTHON_WIDGETS_EXPORT")
   
   
 # Source files
 # Source files
 SET(KIT_SRCS
 SET(KIT_SRCS
-  ctkPythonShell.cpp
-  ctkPythonShell.h
+  ctkPythonConsole.cpp
+  ctkPythonConsole.h
   )
   )
 
 
 # Headers that should run through moc
 # Headers that should run through moc
 SET(KIT_MOC_SRCS
 SET(KIT_MOC_SRCS
-  ctkPythonShell.h
+  ctkPythonConsole.h
   )
   )
 
 
 # UI files
 # UI files

+ 2 - 2
Libs/Scripting/Python/Widgets/Testing/Cpp/CMakeLists.txt

@@ -1,7 +1,7 @@
 SET(KIT ${PROJECT_NAME})
 SET(KIT ${PROJECT_NAME})
 
 
 CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
 CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
-  ctkPythonShellTest1.cpp
+  ctkPythonConsoleTest1.cpp
   #EXTRA_INCLUDE TestingMacros.h
   #EXTRA_INCLUDE TestingMacros.h
   )
   )
 
 
@@ -24,4 +24,4 @@ ENDMACRO( SIMPLE_TEST  )
 # Add Tests
 # Add Tests
 #
 #
 
 
-SIMPLE_TEST( ctkPythonShellTest1 )
+SIMPLE_TEST( ctkPythonConsoleTest1 )

+ 6 - 6
Libs/Scripting/Python/Widgets/Testing/Cpp/ctkPythonShellTest1.cpp

@@ -24,23 +24,23 @@
 #include <QPushButton>
 #include <QPushButton>
 
 
 // CTK includes
 // CTK includes
-#include "ctkPythonShell.h"
+#include "ctkPythonConsole.h"
 #include "ctkAbstractPythonManager.h"
 #include "ctkAbstractPythonManager.h"
 
 
 // STD includes
 // STD includes
-#include <stdlib.h>
+#include <cstdlib>
 #include <iostream>
 #include <iostream>
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-int ctkPythonShellTest1(int argc, char * argv [] )
+int ctkPythonConsoleTest1(int argc, char * argv [] )
 {
 {
   QApplication app(argc, argv);
   QApplication app(argc, argv);
 
 
-  QPushButton button("Show PythonShell");
+  QPushButton button("Show PythonConsole");
 
 
-  ctkPythonShell pythonShell(new ctkAbstractPythonManager);
+  ctkPythonConsole pythonConsole(new ctkAbstractPythonManager);
 
 
-  QObject::connect(&button, SIGNAL(clicked()), &pythonShell, SLOT(show()));
+  QObject::connect(&button, SIGNAL(clicked()), &pythonConsole, SLOT(show()));
 
 
   button.show();
   button.show();
 
 

+ 37 - 37
Libs/Scripting/Python/Widgets/ctkPythonShell.cpp

@@ -64,9 +64,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <PythonQtObjectPtr.h>
 #include <PythonQtObjectPtr.h>
 
 
 // CTK includes
 // CTK includes
-#include <ctkConsoleWidget.h>
+#include <ctkConsole.h>
 #include <ctkAbstractPythonManager.h>
 #include <ctkAbstractPythonManager.h>
-#include "ctkPythonShell.h"
+#include "ctkPythonConsole.h"
 
 
 #ifdef __GNUC__
 #ifdef __GNUC__
 // Disable warnings related to Python macros and functions
 // Disable warnings related to Python macros and functions
@@ -76,13 +76,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #endif
 #endif
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-// ctkPythonShellCompleter
+// ctkPythonConsoleCompleter
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-class ctkPythonShellCompleter : public ctkConsoleWidgetCompleter
+class ctkPythonConsoleCompleter : public ctkConsoleCompleter
 {
 {
 public:
 public:
-  ctkPythonShellCompleter(ctkPythonShell& p) : Parent(p)
+  ctkPythonConsoleCompleter(ctkPythonConsole& p) : Parent(p)
     {
     {
     this->setParent(&p);
     this->setParent(&p);
     }
     }
@@ -140,28 +140,28 @@ public:
       this->popup()->setCurrentIndex(this->completionModel()->index(0, 0));
       this->popup()->setCurrentIndex(this->completionModel()->index(0, 0));
       }
       }
     }
     }
-  ctkPythonShell& Parent;
+  ctkPythonConsole& Parent;
 };
 };
 
 
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-// ctkPythonShellPrivate
+// ctkPythonConsolePrivate
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-class ctkPythonShellPrivate
+class ctkPythonConsolePrivate
 {
 {
-  Q_DECLARE_PUBLIC(ctkPythonShell);
+  Q_DECLARE_PUBLIC(ctkPythonConsole);
 protected:
 protected:
-  ctkPythonShell* const q_ptr;
+  ctkPythonConsole* const q_ptr;
 public:
 public:
-  ctkPythonShellPrivate(ctkPythonShell& object, ctkAbstractPythonManager* pythonManager)
+  ctkPythonConsolePrivate(ctkPythonConsole& object, ctkAbstractPythonManager* pythonManager)
     : q_ptr(&object), Console(&object), PythonManager(pythonManager), MultilineStatement(false),
     : q_ptr(&object), Console(&object), PythonManager(pythonManager), MultilineStatement(false),
     InteractiveConsole(0)
     InteractiveConsole(0)
   {
   {
   }
   }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-  ~ctkPythonShellPrivate()
+  ~ctkPythonConsolePrivate()
   {
   {
   }
   }
 
 
@@ -260,7 +260,7 @@ public:
 
 
   /// Provides a console for gathering user input and displaying 
   /// Provides a console for gathering user input and displaying 
   /// Python output
   /// Python output
-  ctkConsoleWidget Console;
+  ctkConsole Console;
 
 
   ctkAbstractPythonManager* PythonManager;
   ctkAbstractPythonManager* PythonManager;
 
 
@@ -271,25 +271,25 @@ public:
 };
 };
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-// ctkPythonShell methods
+// ctkPythonConsole methods
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-ctkPythonShell::ctkPythonShell(ctkAbstractPythonManager* pythonManager, QWidget* parentObject):
+ctkPythonConsole::ctkPythonConsole(ctkAbstractPythonManager* pythonManager, QWidget* parentObject):
   Superclass(parentObject),
   Superclass(parentObject),
-  d_ptr(new ctkPythonShellPrivate(*this, pythonManager))
+  d_ptr(new ctkPythonConsolePrivate(*this, pythonManager))
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
 
 
   // Layout UI
   // Layout UI
   QVBoxLayout* const boxLayout = new QVBoxLayout(this);
   QVBoxLayout* const boxLayout = new QVBoxLayout(this);
   boxLayout->setMargin(0);
   boxLayout->setMargin(0);
   boxLayout->addWidget(&d->Console);
   boxLayout->addWidget(&d->Console);
 
 
-  this->setObjectName("pythonShell");
+  this->setObjectName("pythonConsole");
 
 
   this->setFocusProxy(&d->Console);
   this->setFocusProxy(&d->Console);
 
 
-  ctkPythonShellCompleter* completer = new ctkPythonShellCompleter(*this);
+  ctkPythonConsoleCompleter* completer = new ctkPythonConsoleCompleter(*this);
   d->Console.setCompleter(completer);
   d->Console.setCompleter(completer);
   
   
   QObject::connect(
   QObject::connect(
@@ -317,22 +317,22 @@ ctkPythonShell::ctkPythonShell(ctkAbstractPythonManager* pythonManager, QWidget*
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-ctkPythonShell::~ctkPythonShell()
+ctkPythonConsole::~ctkPythonConsole()
 {
 {
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::clear()
+void ctkPythonConsole::clear()
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
   d->Console.clear();
   d->Console.clear();
   d->promptForInput();
   d->promptForInput();
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::executeScript(const QString& script)
+void ctkPythonConsole::executeScript(const QString& script)
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
   Q_UNUSED(script);
   Q_UNUSED(script);
   
   
   this->printStdout("\n");
   this->printStdout("\n");
@@ -344,7 +344,7 @@ void ctkPythonShell::executeScript(const QString& script)
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-QStringList ctkPythonShell::getPythonAttributes(const QString& pythonVariableName)
+QStringList ctkPythonConsole::getPythonAttributes(const QString& pythonVariableName)
 {
 {
 //   this->makeCurrent();
 //   this->makeCurrent();
 
 
@@ -406,9 +406,9 @@ QStringList ctkPythonShell::getPythonAttributes(const QString& pythonVariableNam
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::printStdout(const QString& text)
+void ctkPythonConsole::printStdout(const QString& text)
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
 
 
   QTextCharFormat format = d->Console.getFormat();
   QTextCharFormat format = d->Console.getFormat();
   format.setForeground(QColor(0, 150, 0));
   format.setForeground(QColor(0, 150, 0));
@@ -420,9 +420,9 @@ void ctkPythonShell::printStdout(const QString& text)
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::printMessage(const QString& text)
+void ctkPythonConsole::printMessage(const QString& text)
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
 
 
   QTextCharFormat format = d->Console.getFormat();
   QTextCharFormat format = d->Console.getFormat();
   format.setForeground(QColor(0, 0, 150));
   format.setForeground(QColor(0, 0, 150));
@@ -432,9 +432,9 @@ void ctkPythonShell::printMessage(const QString& text)
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::printStderr(const QString& text)
+void ctkPythonConsole::printStderr(const QString& text)
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
 
 
   QTextCharFormat format = d->Console.getFormat();
   QTextCharFormat format = d->Console.getFormat();
   format.setForeground(QColor(255, 0, 0));
   format.setForeground(QColor(255, 0, 0));
@@ -446,9 +446,9 @@ void ctkPythonShell::printStderr(const QString& text)
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::onExecuteCommand(const QString& Command)
+void ctkPythonConsole::onExecuteCommand(const QString& Command)
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
 
 
   QString command = Command;
   QString command = Command;
   command.replace(QRegExp("\\s*$"), "");
   command.replace(QRegExp("\\s*$"), "");
@@ -465,16 +465,16 @@ void ctkPythonShell::onExecuteCommand(const QString& Command)
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::promptForInput()
+void ctkPythonConsole::promptForInput()
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
   d->promptForInput();
   d->promptForInput();
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-void ctkPythonShell::internalExecuteCommand(const QString& command)
+void ctkPythonConsole::internalExecuteCommand(const QString& command)
 {
 {
-  Q_D(ctkPythonShell);
+  Q_D(ctkPythonConsole);
   emit this->executing(true);  
   emit this->executing(true);  
   d->executeCommand(command);
   d->executeCommand(command);
   emit this->executing(false);
   emit this->executing(false);

+ 10 - 10
Libs/Scripting/Python/Widgets/ctkPythonShell.h

@@ -49,8 +49,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 =========================================================================*/
 =========================================================================*/
 
 
-#ifndef __ctkPythonShell_h
-#define __ctkPythonShell_h
+#ifndef __ctkPythonConsole_h
+#define __ctkPythonConsole_h
 
 
 // Qt includes
 // Qt includes
 #include <QWidget>
 #include <QWidget>
@@ -60,23 +60,23 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 /**
 /**
   Qt widget that provides an interactive "shell" interface to an embedded Python interpreter.
   Qt widget that provides an interactive "shell" interface to an embedded Python interpreter.
-  You can put an instance of ctkPythonShell in a dialog or a window, and the user will be able
+  You can put an instance of ctkPythonConsole in a dialog or a window, and the user will be able
   to enter Python commands and see their output, while the UI is still responsive.
   to enter Python commands and see their output, while the UI is still responsive.
   
   
   \sa pqConsoleWidget, pqPythonDialog
   \sa pqConsoleWidget, pqPythonDialog
 */  
 */  
 
 
-class ctkPythonShellPrivate;
+class ctkPythonConsolePrivate;
 class ctkAbstractPythonManager;
 class ctkAbstractPythonManager;
 
 
-class CTK_SCRIPTING_PYTHON_WIDGETS_EXPORT ctkPythonShell : public QWidget
+class CTK_SCRIPTING_PYTHON_WIDGETS_EXPORT ctkPythonConsole : public QWidget
 {
 {
   Q_OBJECT
   Q_OBJECT
   
   
 public:
 public:
   typedef QWidget Superclass; 
   typedef QWidget Superclass; 
-  ctkPythonShell(ctkAbstractPythonManager* pythonManager, QWidget* parentObject = 0);
-  ~ctkPythonShell();
+  ctkPythonConsole(ctkAbstractPythonManager* pythonManager, QWidget* parentObject = 0);
+  ~ctkPythonConsole();
 
 
   /// Prints some text on the shell.
   /// Prints some text on the shell.
   void printMessage(const QString&);
   void printMessage(const QString&);
@@ -99,11 +99,11 @@ protected slots:
   void onExecuteCommand(const QString&);
   void onExecuteCommand(const QString&);
 
 
 protected:
 protected:
-  QScopedPointer<ctkPythonShellPrivate> d_ptr;
+  QScopedPointer<ctkPythonConsolePrivate> d_ptr;
 
 
 private:
 private:
-  Q_DECLARE_PRIVATE(ctkPythonShell);
-  Q_DISABLE_COPY(ctkPythonShell);
+  Q_DECLARE_PRIVATE(ctkPythonConsole);
+  Q_DISABLE_COPY(ctkPythonConsole);
 
 
   void promptForInput();
   void promptForInput();
   void internalExecuteCommand(const QString&);
   void internalExecuteCommand(const QString&);

+ 3 - 3
Libs/Widgets/CMakeLists.txt

@@ -33,8 +33,8 @@ SET(KIT_SRCS
   ctkColorDialog.h
   ctkColorDialog.h
   ctkColorPickerButton.cpp
   ctkColorPickerButton.cpp
   ctkColorPickerButton.h
   ctkColorPickerButton.h
-  ctkConsoleWidget.cpp
-  ctkConsoleWidget.h
+  ctkConsole.cpp
+  ctkConsole.h
   ctkConfirmExitDialog.cpp
   ctkConfirmExitDialog.cpp
   ctkConfirmExitDialog.h
   ctkConfirmExitDialog.h
   ctkCoordinatesWidget.cpp
   ctkCoordinatesWidget.cpp
@@ -146,7 +146,7 @@ SET(KIT_MOC_SRCS
   ctkColorDialog.h
   ctkColorDialog.h
   ctkColorPickerButton.h
   ctkColorPickerButton.h
   ctkConfirmExitDialog.h
   ctkConfirmExitDialog.h
-  ctkConsoleWidget.h
+  ctkConsole.h
   ctkCoordinatesWidget.h
   ctkCoordinatesWidget.h
   ctkDirectoryButton.h
   ctkDirectoryButton.h
   ctkDoubleRangeSlider.h
   ctkDoubleRangeSlider.h

+ 2 - 2
Libs/Widgets/Testing/Cpp/CMakeLists.txt

@@ -15,7 +15,7 @@ CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cxx
   ctkColorPickerButtonTest1.cpp
   ctkColorPickerButtonTest1.cpp
   ctkComboBoxTest1.cpp
   ctkComboBoxTest1.cpp
   ctkConfirmExitDialogTest1.cpp
   ctkConfirmExitDialogTest1.cpp
-  ctkConsoleWidgetTest1.cpp
+  ctkConsoleTest1.cpp
   ctkCoordinatesWidgetTest1.cpp
   ctkCoordinatesWidgetTest1.cpp
   ctkDirectoryButtonTest1.cpp
   ctkDirectoryButtonTest1.cpp
   ctkDoubleRangeSliderTest1.cpp
   ctkDoubleRangeSliderTest1.cpp
@@ -96,7 +96,7 @@ SIMPLE_TEST( ctkColorDialogTest2 )
 SIMPLE_TEST( ctkColorPickerButtonTest1 )
 SIMPLE_TEST( ctkColorPickerButtonTest1 )
 SIMPLE_TEST( ctkComboBoxTest1 )
 SIMPLE_TEST( ctkComboBoxTest1 )
 SIMPLE_TEST( ctkConfirmExitDialogTest1 )
 SIMPLE_TEST( ctkConfirmExitDialogTest1 )
-SIMPLE_TEST( ctkConsoleWidgetTest1 )
+SIMPLE_TEST( ctkConsoleTest1 )
 SIMPLE_TEST( ctkCoordinatesWidgetTest1 )
 SIMPLE_TEST( ctkCoordinatesWidgetTest1 )
 SIMPLE_TEST( ctkDateRangeWidgetTest1 )
 SIMPLE_TEST( ctkDateRangeWidgetTest1 )
 SIMPLE_TEST( ctkDirectoryButtonTest1 )
 SIMPLE_TEST( ctkDirectoryButtonTest1 )

+ 5 - 5
Libs/Widgets/Testing/Cpp/ctkConsoleWidgetTest1.cpp

@@ -23,20 +23,20 @@
 #include <QTimer>
 #include <QTimer>
 
 
 // CTK includes
 // CTK includes
-#include "ctkConsoleWidget.h"
+#include "ctkConsole.h"
 
 
 // STD includes
 // STD includes
-#include <stdlib.h>
+#include <cstdlib>
 #include <iostream>
 #include <iostream>
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-int ctkConsoleWidgetTest1(int argc, char * argv [] )
+int ctkConsoleTest1(int argc, char * argv [] )
 {
 {
   QApplication app(argc, argv);
   QApplication app(argc, argv);
 
 
-  ctkConsoleWidget widget;
+  ctkConsole console;
 
 
-  widget.show();
+  console.show();
 
 
   QTimer autoExit;
   QTimer autoExit;
   if (argc < 2 || QString(argv[1]) != "-I")
   if (argc < 2 || QString(argv[1]) != "-I")

+ 33 - 33
Libs/Widgets/ctkConsoleWidget.cpp

@@ -62,19 +62,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <QScrollBar>
 #include <QScrollBar>
 
 
 // CTK includes
 // CTK includes
-#include "ctkConsoleWidget.h"
+#include "ctkConsole.h"
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-// ctkConsoleWidgetPrivate
+// ctkConsolePrivate
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-class ctkConsoleWidgetPrivate : public QTextEdit
+class ctkConsolePrivate : public QTextEdit
 {
 {
-  Q_DECLARE_PUBLIC(ctkConsoleWidget);
+  Q_DECLARE_PUBLIC(ctkConsole);
 protected:
 protected:
-  ctkConsoleWidget* const q_ptr;
+  ctkConsole* const q_ptr;
 public:
 public:
-  ctkConsoleWidgetPrivate(ctkConsoleWidget& object) :
+  ctkConsolePrivate(ctkConsole& object) :
     QTextEdit(&object),
     QTextEdit(&object),
     q_ptr(&object),
     q_ptr(&object),
     InteractivePosition(documentEnd())
     InteractivePosition(documentEnd())
@@ -288,7 +288,7 @@ public:
   /// else do nothing.
   /// else do nothing.
   void selectCompletion()
   void selectCompletion()
   {
   {
-    Q_Q(ctkConsoleWidget);
+    Q_Q(ctkConsole);
     if (this->Completer && this->Completer->completionCount() == 1)
     if (this->Completer && this->Completer->completionCount() == 1)
       {
       {
       q->insertCompletion(this->Completer->currentCompletion());
       q->insertCompletion(this->Completer->currentCompletion());
@@ -356,7 +356,7 @@ public:
   /// Implements command-execution
   /// Implements command-execution
   void internalExecuteCommand()
   void internalExecuteCommand()
     {
     {
-    Q_Q(ctkConsoleWidget);
+    Q_Q(ctkConsole);
 
 
     // First update the history cache. It's essential to update the
     // First update the history cache. It's essential to update the
     // this->CommandPosition before calling internalExecuteCommand() since that
     // this->CommandPosition before calling internalExecuteCommand() since that
@@ -375,9 +375,9 @@ public:
     q->internalExecuteCommand(command);
     q->internalExecuteCommand(command);
     }
     }
 
 
-  void setCompleter(ctkConsoleWidgetCompleter* completer)
+  void setCompleter(ctkConsoleCompleter* completer)
     {
     {
-    Q_Q(ctkConsoleWidget);
+    Q_Q(ctkConsole);
 
 
     if (this->Completer)
     if (this->Completer)
       {
       {
@@ -396,7 +396,7 @@ public:
     }
     }
 
 
   /// A custom completer
   /// A custom completer
-  QPointer<ctkConsoleWidgetCompleter> Completer;
+  QPointer<ctkConsoleCompleter> Completer;
 
 
   /** Stores the beginning of the area of interactive input, outside which
   /** Stores the beginning of the area of interactive input, outside which
   changes can't be made to the text edit contents */
   changes can't be made to the text edit contents */
@@ -408,49 +408,49 @@ public:
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-// ctkConsoleWidget methods
+// ctkConsole methods
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-ctkConsoleWidget::ctkConsoleWidget(QWidget* parentObject) :
+ctkConsole::ctkConsole(QWidget* parentObject) :
   QWidget(parentObject),
   QWidget(parentObject),
-  d_ptr(new ctkConsoleWidgetPrivate(*this))
+  d_ptr(new ctkConsolePrivate(*this))
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
   QVBoxLayout* const l = new QVBoxLayout(this);
   QVBoxLayout* const l = new QVBoxLayout(this);
   l->setMargin(0);
   l->setMargin(0);
   l->addWidget(d);
   l->addWidget(d);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-ctkConsoleWidget::~ctkConsoleWidget()
+ctkConsole::~ctkConsole()
 {
 {
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-QTextCharFormat ctkConsoleWidget::getFormat()
+QTextCharFormat ctkConsole::getFormat()
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
   return d->currentCharFormat();
   return d->currentCharFormat();
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::setFormat(const QTextCharFormat& Format)
+void ctkConsole::setFormat(const QTextCharFormat& Format)
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
   d->setCurrentCharFormat(Format);
   d->setCurrentCharFormat(Format);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::setCompleter(ctkConsoleWidgetCompleter* completer)
+void ctkConsole::setCompleter(ctkConsoleCompleter* completer)
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
   d->setCompleter(completer);
   d->setCompleter(completer);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::insertCompletion(const QString& completion)
+void ctkConsole::insertCompletion(const QString& completion)
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
   QTextCursor tc = d->textCursor();
   QTextCursor tc = d->textCursor();
   tc.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor);
   tc.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor);
   if (tc.selectedText()==".")
   if (tc.selectedText()==".")
@@ -469,9 +469,9 @@ void ctkConsoleWidget::insertCompletion(const QString& completion)
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::printString(const QString& Text)
+void ctkConsole::printString(const QString& Text)
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
   d->textCursor().movePosition(QTextCursor::End);
   d->textCursor().movePosition(QTextCursor::End);
   d->textCursor().insertText(Text);
   d->textCursor().insertText(Text);
   d->InteractivePosition = d->documentEnd();
   d->InteractivePosition = d->documentEnd();
@@ -479,17 +479,17 @@ void ctkConsoleWidget::printString(const QString& Text)
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::printCommand(const QString& cmd)
+void ctkConsole::printCommand(const QString& cmd)
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
   d->textCursor().insertText(cmd);
   d->textCursor().insertText(cmd);
   d->updateCommandBuffer();
   d->updateCommandBuffer();
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::prompt(const QString& text)
+void ctkConsole::prompt(const QString& text)
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
 
 
   QTextCursor text_cursor = d->textCursor();
   QTextCursor text_cursor = d->textCursor();
 
 
@@ -510,9 +510,9 @@ void ctkConsoleWidget::prompt(const QString& text)
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::clear()
+void ctkConsole::clear()
 {
 {
-  Q_D(ctkConsoleWidget);
+  Q_D(ctkConsole);
 
 
   d->clear();
   d->clear();
 
 
@@ -522,7 +522,7 @@ void ctkConsoleWidget::clear()
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void ctkConsoleWidget::internalExecuteCommand(const QString& Command)
+void ctkConsole::internalExecuteCommand(const QString& Command)
 {
 {
   emit this->executeCommand(Command);
   emit this->executeCommand(Command);
 }
 }

+ 13 - 13
Libs/Widgets/ctkConsoleWidget.h

@@ -49,8 +49,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 =========================================================================*/
 =========================================================================*/
 
 
-#ifndef __ctkConsoleWidget_h
-#define __ctkConsoleWidget_h
+#ifndef __ctkConsole_h
+#define __ctkConsole_h
 
 
 // Qt includes
 // Qt includes
 #include <QWidget>
 #include <QWidget>
@@ -60,8 +60,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // CTK includes
 // CTK includes
 #include "ctkWidgetsExport.h"
 #include "ctkWidgetsExport.h"
 
 
-class ctkConsoleWidgetPrivate;
-class ctkConsoleWidgetCompleter;
+class ctkConsolePrivate;
+class ctkConsoleCompleter;
 
 
 
 
 /// Qwidget that provides an interactive console - you can send text to the
 /// Qwidget that provides an interactive console - you can send text to the
@@ -69,13 +69,13 @@ class ctkConsoleWidgetCompleter;
 /// executeCommand() slot.
 /// executeCommand() slot.
 ///  
 ///  
 /// \sa pqPythonShell, pqOutputWindow
 /// \sa pqPythonShell, pqOutputWindow
-class CTK_WIDGETS_EXPORT ctkConsoleWidget : public QWidget
+class CTK_WIDGETS_EXPORT ctkConsole : public QWidget
 {
 {
   Q_OBJECT
   Q_OBJECT
   
   
 public:
 public:
-  ctkConsoleWidget(QWidget* parentObject = 0);
-  virtual ~ctkConsoleWidget();
+  ctkConsole(QWidget* parentObject = 0);
+  virtual ~ctkConsole();
 
 
   /// Returns the current formatting that will be used by printString
   /// Returns the current formatting that will be used by printString
   QTextCharFormat getFormat();
   QTextCharFormat getFormat();
@@ -84,7 +84,7 @@ public:
   void setFormat(const QTextCharFormat& Format);
   void setFormat(const QTextCharFormat& Format);
 
 
   /// Set a completer for this console widget
   /// Set a completer for this console widget
-  void setCompleter(ctkConsoleWidgetCompleter* completer);
+  void setCompleter(ctkConsoleCompleter* completer);
   
   
 signals:
 signals:
   /// Signal emitted whenever the user enters a command
   /// Signal emitted whenever the user enters a command
@@ -115,17 +115,17 @@ public slots:
 protected:
 protected:
 
 
 protected:
 protected:
-  QScopedPointer<ctkConsoleWidgetPrivate> d_ptr;
+  QScopedPointer<ctkConsolePrivate> d_ptr;
 
 
 private:
 private:
-  Q_DECLARE_PRIVATE(ctkConsoleWidget);
-  Q_DISABLE_COPY(ctkConsoleWidget);
+  Q_DECLARE_PRIVATE(ctkConsole);
+  Q_DISABLE_COPY(ctkConsole);
 
 
   void internalExecuteCommand(const QString& Command);
   void internalExecuteCommand(const QString& Command);
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-class CTK_WIDGETS_EXPORT ctkConsoleWidgetCompleter : public QCompleter
+class CTK_WIDGETS_EXPORT ctkConsoleCompleter : public QCompleter
 {
 {
 public:
 public:
 
 
@@ -136,4 +136,4 @@ public:
 };
 };
 
 
 
 
-#endif // !__ctkConsoleWidget_h
+#endif