[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kate
From:       Christoph Cullmann <cullmann () kde ! org>
Date:       2010-11-16 19:44:16
Message-ID: 20101116194416.C1D1DAC8A0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1197852 by cullmann:

Merge the KateScriptConsole by Miquel Sabaté
Thanks for contribution, hope this improves further ;)



 M  +1 -0      CMakeLists.txt  
 M  +2 -1      data/katepartui.rc  
 A             script/katescriptconsole.cpp   [License: LGPL (v2)]
 A             script/katescriptconsole.h   [License: LGPL (v2)]
 M  +31 -0     view/kateview.cpp  
 M  +5 -0      view/kateview.h  
 M  +2 -0      view/kateviewhelpers.cpp  
 M  +1 -0      view/kateviewhelpers.h  


--- trunk/KDE/kdelibs/kate/CMakeLists.txt #1197851:1197852
@@ -81,6 +81,7 @@
 script/katetemplatescript.cpp
 script/katescriptmanager.cpp
 script/katescriptaction.cpp
+script/katescriptconsole.cpp
 
 # scripting wrappers
 script/katescriptdocument.cpp
--- trunk/KDE/kdelibs/kate/data/katepartui.rc #1197851:1197852
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="KatePartView" version="55">
+<kpartgui name="KatePartView" version="58">
 <MenuBar>
   <Menu name="file" noMerge="1"><text>&amp;File</text>
     <Action name="file_save" group="save_merge" />
@@ -36,6 +36,7 @@
 
   <Menu name="view" noMerge="1"><text>&amp;View</text>
     <Action name="switch_to_cmd_line" group="view_operations" />
+    <Action name="switch_to_console" group="view_operations" />
     <Separator group="view_operations" />
     <Action name="view_schemas" group="view_operations" />
     <Separator group="view_operations" />
--- trunk/KDE/kdelibs/kate/view/kateview.cpp #1197851:1197852
@@ -56,6 +56,7 @@
 #include "katebuffer.h"
 #include "script/katescriptmanager.h"
 #include "script/katescriptaction.h"
+#include "script/katescriptconsole.h"
 #include "kateswapfile.h"
 #include "katerecoverbar.h"
 #include "katebrokenswapfilebar.h"
@@ -124,6 +125,7 @@
     , m_recoverBar(0)
     , m_brokenSwapFileBar(0)
     , m_cmdLine (0)
+    , m_console (0)
     , m_searchBar (0)
     , m_viModeBar (0)
     , m_gotoBar (0)
@@ -551,6 +553,11 @@
   a->setWhatsThis(i18n("Show/hide the command line on the bottom of the view."));
   connect(a, SIGNAL(triggered(bool)), SLOT(switchToCmdLine()));
 
+  a = m_switchConsole = ac->addAction("switch_to_console");
+  a->setText(i18n("Show the JavaScript Console"));
+  a->setWhatsThis(i18n("Show/hide the JavaScript Console on the bottom of the view."));
+  connect(a, SIGNAL(triggered(bool)), SLOT(switchToConsole()));
+
   a = m_viInputModeAction = new KToggleAction(i18n("&VI Input Mode"), this);
   ac->addAction("view_vi_input_mode", a);
   a->setShortcut(QKeySequence(Qt::CTRL + Qt::META + Qt::Key_V));
@@ -1427,6 +1434,20 @@
   hideViModeBar();
 }
 
+void KateView::switchToConsole ()
+{
+  if (!m_console) {
+    m_console = new KateScriptConsole (this, bottomViewBar());
+    bottomViewBar()->addBarWidget(m_console);
+    bottomViewBar()->showBarWidget(m_console);
+  } else {
+    bottomViewBar()->showBarWidget(m_console);
+    m_console->setupLayout();
+  }
+  m_console->setFocus ();
+  hideViModeBar();
+}
+
 KateRenderer *KateView::renderer ()
 {
   return m_renderer;
@@ -2595,6 +2616,16 @@
   return m_cmdLine;
 }
 
+KateScriptConsole *KateView::consoleBar ()
+{
+  if (!m_console) {
+    m_console = new KateScriptConsole (this, bottomViewBar());
+    bottomViewBar()->addBarWidget(m_console);
+  }
+
+  return m_console;
+}
+
 KateSearchBar *KateView::searchBar (bool initHintAsPower)
 {
   if (!m_searchBar) {
--- trunk/KDE/kdelibs/kate/view/kateview.h #1197851:1197852
@@ -64,6 +64,7 @@
 class KateSpellingMenu;
 class KateRecoverBar;
 class KateBrokenSwapFileBar;
+class KateScriptConsole;
 
 class KToggleAction;
 class KAction;
@@ -508,6 +509,7 @@
     void toggleWWMarker();
     void toggleWriteLock();
     void switchToCmdLine ();
+    void switchToConsole ();
     void slotReadWriteChanged ();
 
   Q_SIGNALS:
@@ -547,6 +549,7 @@
     KSelectAction*         m_setDynWrapIndicators;
     KToggleAction*         m_toggleWWMarker;
     KAction*               m_switchCmdLine;
+    KAction*               m_switchConsole;
     KToggleAction*         m_viInputModeAction;
 
     KSelectAction*         m_setEndOfLine;
@@ -614,6 +617,7 @@
     KateViewBar *topViewBar() const;
     KateViewBar *bottomViewBar() const;
     KateCommandLineBar *cmdLineBar ();
+    KateScriptConsole *consoleBar ();
     KateDictionaryBar *dictionaryBar();
     
   private:
@@ -636,6 +640,7 @@
     KateBrokenSwapFileBar *m_brokenSwapFileBar;
     // created on demand..., only access them through the above accessors....
     KateCommandLineBar *m_cmdLine;
+    KateScriptConsole *m_console;
     KateSearchBar *m_searchBar;
     KateViModeBar *m_viModeBar;
     KateGotoBar *m_gotoBar;
--- trunk/KDE/kdelibs/kate/view/kateviewhelpers.cpp #1197851:1197852
@@ -1935,6 +1935,8 @@
 {
   Q_ASSERT(barWidget != 0);
 
+  KateViewBarWidget *current=qobject_cast<KateViewBarWidget*>(m_stack->currentWidget());
+  current->switched();
   // raise correct widget
   m_stack->setCurrentWidget (barWidget);
   barWidget->show();
--- trunk/KDE/kdelibs/kate/view/kateviewhelpers.h #1197851:1197852
@@ -251,6 +251,7 @@
     explicit KateViewBarWidget (bool addCloseButton, QWidget* parent = 0);
 
     virtual void closed(){};
+    virtual void switched(){};
   protected:
     /**
      * @return widget that should be used to add controls to bar widget
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic