Permalink
Browse files

Fixed Issue #860

  • Loading branch information...
1 parent ce1e529 commit e96168e611b40ba8f22cf0cf600a6633c32af2d9 @diegosarmentero diegosarmentero committed Sep 29, 2012
Showing with 28 additions and 5 deletions.
  1. +11 −0 ninja_ide/gui/actions.py
  2. +17 −1 ninja_ide/gui/misc/misc_container.py
  3. +0 −4 ninja_ide/gui/status_bar.py
View
@@ -295,6 +295,11 @@ def install_shortcuts(self, ide):
self.connect(self.ide.mainContainer,
SIGNAL("openProject(QString)"), self.open_project)
+ # Not Configurable Shortcuts
+ self._shortEsc = QShortcut(QKeySequence(Qt.Key_Escape), self.ide)
+ self.connect(self._shortEsc, SIGNAL("activated()"),
+ self._shortcut_escape)
+
def update_shortcuts(self):
"""If the user update the key binded to any shortcut, update them."""
resources.load_shortcuts()
@@ -350,6 +355,12 @@ def update_shortcuts(self):
self.shortMoveTabSplit.setKey(short("move-tab-to-next-split"))
self.shortChangeTabVisibility.setKey(short("change-tab-visibility"))
+ def _shortcut_escape(self):
+ if self.ide.misc.isVisible():
+ self.ide.misc.hide()
+ elif self.ide.status.isVisible():
+ self.ide.status.hide_status()
+
def move_tab_to_next_split(self):
self.ide.mainContainer.move_tab_to_next_split(
self.ide.mainContainer.actualTab)
@@ -20,8 +20,12 @@
from PyQt4.QtGui import QToolBar
from PyQt4.QtGui import QPushButton
from PyQt4.QtGui import QIcon
+from PyQt4.QtGui import QStyle
from PyQt4.QtGui import QStackedWidget
+from PyQt4.QtGui import QHBoxLayout
from PyQt4.QtGui import QVBoxLayout
+from PyQt4.QtGui import QSpacerItem
+from PyQt4.QtGui import QSizePolicy
from PyQt4.QtCore import SIGNAL
from PyQt4.QtWebKit import QWebPage
@@ -57,7 +61,9 @@ def __init__(self, parent=None):
vbox.setSpacing(0)
self.__toolbar = QToolBar()
- vbox.addWidget(self.__toolbar)
+ self.__toolbar.setObjectName('custom')
+ hbox = QHBoxLayout()
+ vbox.addLayout(hbox)
self.stack = StackedWidget()
vbox.addWidget(self.stack)
@@ -87,10 +93,19 @@ def __init__(self, parent=None):
self._btnWeb.setToolTip(self.tr("Web Preview"))
self._btnFind = QPushButton(QIcon(resources.IMAGES['find']), '')
self._btnFind.setToolTip(self.tr("Find in Files"))
+ #Toolbar
+ hbox.addWidget(self.__toolbar)
self.__toolbar.addWidget(self._btnConsole)
self.__toolbar.addWidget(self._btnRun)
self.__toolbar.addWidget(self._btnWeb)
self.__toolbar.addWidget(self._btnFind)
+ self.__toolbar.addSeparator()
+ hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
+ btn_close = QPushButton(
+ self.style().standardIcon(QStyle.SP_DialogCloseButton), '')
+ btn_close.setObjectName('navigation_button')
+ btn_close.setToolTip(self.tr('F4: Show/Hide'))
+ hbox.addWidget(btn_close)
self.connect(self._btnConsole, SIGNAL("clicked()"),
lambda: self._item_changed(0))
@@ -100,6 +115,7 @@ def __init__(self, parent=None):
lambda: self._item_changed(2))
self.connect(self._btnFind, SIGNAL("clicked()"),
lambda: self._item_changed(3))
+ self.connect(btn_close, SIGNAL('clicked()'), self.hide)
def gain_focus(self):
self._console.setFocus()
@@ -25,7 +25,6 @@
from PyQt4.QtGui import QFileSystemModel
from PyQt4.QtGui import QTextDocument
from PyQt4.QtGui import QWidget
-from PyQt4.QtGui import QShortcut
from PyQt4.QtGui import QKeySequence
from PyQt4.QtGui import QVBoxLayout
from PyQt4.QtGui import QHBoxLayout
@@ -84,8 +83,6 @@ def __init__(self, parent=None):
self.addWidget(self._widgetStatus)
- self._shortEsc = QShortcut(QKeySequence(Qt.Key_Escape), self)
-
self.connect(self, SIGNAL("messageChanged(QString)"), self.message_end)
self.connect(self._replaceWidget._btnCloseReplace, SIGNAL("clicked()"),
lambda: self._replaceWidget.setVisible(False))
@@ -95,7 +92,6 @@ def __init__(self, parent=None):
self.replace_all)
self.connect(self._replaceWidget._btnReplaceSelection,
SIGNAL("clicked()"), self.replace_selected)
- self.connect(self._shortEsc, SIGNAL("activated()"), self.hide_status)
self.connect(self._fileSystemOpener.btnClose, SIGNAL("clicked()"),
self.hide_status)
self.connect(self._fileSystemOpener, SIGNAL("requestHide()"),

0 comments on commit e96168e

Please sign in to comment.