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

List:       kde-commits
Subject:    extragear/utils/yakuake
From:       Eike Hein <hein () kde ! org>
Date:       2009-03-27 18:07:11
Message-ID: 1238177231.406696.25578.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 945565 by hein:

* Move updating the toggle actions in the tab bar context menu
  to a separate method from that used to update the tab move
  actions states, and add sanity-checking for an invalid index.
* Remove default shortcut from the Prevent Closing toggle action.
* Changelog updates.
* Assorted cleanup (string fixes, line length).


 M  +5 -4      ChangeLog  
 M  +2 -2      app/mainwindow.cpp  
 M  +11 -3     app/tabbar.cpp  
 M  +1 -0      app/tabbar.h  


--- trunk/extragear/utils/yakuake/ChangeLog #945564:945565
@@ -13,7 +13,8 @@
 * Rewrote the translucency support not to use X11-specific code on Qt 4.5
   or higher and KDE 4.3 or higher.
 * Added a feature to disable keyboard input for a session (via a user-con-
-  figured shortcut or the context menu).
+  figured shortcut or the context menu), including D-Bus calls to get/set
+  this state bit.
 * On KDE 4.2 and higher, the first-run dialog now no longer allows setting
   a multi-key shortcut to open/close the window, consistent with the short-
   cut configuration dialog (the required API is new in 4.2). The reason
@@ -23,9 +24,9 @@
 * Fixed the 'removeTerminal(int terminalId)' D-Bus call always closing the
   active terminal of the session containing the target terminal, rather than
   the target terminal.
-* Added a feature to prevent a session from being closed (set through keyboard
-  shortcut or context menu). This lock only works if the session is closed
-  through either Close Session or Close Active Terminal.
+* Added a feature to prevent a session from being closed (toggled via a user-
+  configured shortcut or the context menu) by way of Yakuake's own shortcuts
+  and actions, including D-Bus calls to get/set this state bit.
 * Started fix for Disable Keyboard Input and Prevent Session Closing context
   menus states being carried over to all sessions even if other sessions are
   not really affected (still needs some more fixing though).
--- trunk/extragear/utils/yakuake/app/mainwindow.cpp #945564:945565
@@ -296,8 +296,8 @@
     connect(action, SIGNAL(toggled(bool)), this, \
SLOT(handleContextDependentToggleAction(bool)));  m_contextDependentActions << \
action;  
-    action = actionCollection()->addAction("toggle-session-closable");
-    action->setText(i18nc("@action", "Prevent Session Closing"));
+    action = actionCollection()->addAction("toggle-prevent-closing");
+    action->setText(i18nc("@action", "Prevent Closing"));
     action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_P));
     action->setCheckable(true);
     connect(action, SIGNAL(toggled(bool)), this, \
                SLOT(handleContextDependentToggleAction(bool)));
--- trunk/extragear/utils/yakuake/app/tabbar.cpp #945564:945565
@@ -141,7 +141,6 @@
 void TabBar::updateMoveActions(int index)
 {
     if (index == -1) return;
-    int sessionId = sessionAtTab(index);
 
     m_mainWindow->actionCollection()->action("move-session-left")->setEnabled(false);
                
     m_mainWindow->actionCollection()->action("move-session-right")->setEnabled(false);
 @@ -151,10 +150,17 @@
 
     if (index != m_tabs.indexOf(m_tabs.last()))
         m_mainWindow->actionCollection()->action("move-session-right")->setEnabled(true);
 +}
 
-    m_mainWindow->actionCollection()->action("toggle-keyboard-input")->setChecked(!m_mainWindow->sessionStack()->isKeyboardInputEnabled(sessionId));
 +void TabBar::updateToggleActions(int index)
+{
+    int sessionId = sessionAtTab(index);
+    if (sessionId == -1) return;
 
-    m_mainWindow->actionCollection()->action("toggle-session-closable")->setChecked(!m_mainWindow->sessionStack()->isSessionClosable(sessionId));
 +    KActionCollection* actionCollection = m_mainWindow->actionCollection();
+
+    actionCollection->action("toggle-keyboard-input")->setChecked(!m_mainWindow->sessionStack()->isKeyboardInputEnabled(sessionId));
 +    actionCollection->action("toggle-prevent-closing")->setChecked(!m_mainWindow->sessionStack()->isSessionClosable(sessionId));
  }
 
 void TabBar::contextMenuEvent(QContextMenuEvent* event)
@@ -168,6 +174,7 @@
     else
     {
         updateMoveActions(index);
+        updateToggleActions(index);
 
         m_mainWindow->setContextDependentActionsQuiet(true);
 
@@ -184,6 +191,7 @@
         m_mainWindow->setContextDependentActionsQuiet(false);
 
         updateMoveActions(m_tabs.indexOf(m_selectedSessionId));
+        updateToggleActions(index);
     }
 
     QWidget::contextMenuEvent(event);
--- trunk/extragear/utils/yakuake/app/tabbar.h #945564:945565
@@ -107,6 +107,7 @@
         int tabAt(int x);
 
         void updateMoveActions(int index);
+        void updateToggleActions(int index);
         
         int drawButton(int x, int y, int index, QPainter& painter);
         


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

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