[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: KDE/kdelibs/kdeui
From: Aurélien Gâteau <agateau () kde ! org>
Date: 2010-11-13 21:08:18
Message-ID: 20101113210818.77437AC8A0 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1196662 by gateau:
Removed KStandardAction::showHideStatusbar() and showHideMenubar()
CCMAIL:kde-core-devel@kde.org
M +0 -50 actions/kstandardaction.cpp
M +0 -12 actions/kstandardaction.h
M +8 -9 xmlgui/kxmlguiwindow.cpp
--- trunk/KDE/kdelibs/kdeui/actions/kstandardaction.cpp #1196661:1196662
@@ -534,33 +534,6 @@
return ret;
}
-KDualAction *showHideMenubar(const QObject *recvr, const char *slot, QObject \
*parent)
-{
- KDualAction *ret = new KDualAction(
- i18n( "Show &Menubar" ),
- i18n( "Hide Menubar" ),
- parent);
- ret->setObjectName(name(ShowMenubar));
-
- ret->setShortcut( KStandardShortcut::shortcut( KStandardShortcut::ShowMenubar ) );
-
- ret->setWhatsThis( i18n( "Show Menubar<p>"
- "Shows the menubar again after it has been hidden</p>" ) \
);
-
- ret->setIconForStates( KIcon( "show-menu" ) );
-
- ret->setActive( true );
-
- if ( recvr && slot )
- QObject::connect( ret, SIGNAL( activeChangedByUser( bool ) ), recvr, slot );
-
- KActionCollection *collection = qobject_cast<KActionCollection *>(parent);
- if (collection)
- collection->addAction(ret->objectName(), ret);
-
- return ret;
-}
-
KToggleAction *showStatusbar(const QObject *recvr, const char *slot, QObject \
*parent) {
KToggleAction *ret = new KToggleAction(i18n( "Show St&atusbar" ), parent);
@@ -581,29 +554,6 @@
return ret;
}
-KDualAction *showHideStatusbar(const QObject *recvr, const char *slot, QObject \
*parent)
-{
- KDualAction *ret = new KDualAction(
- i18n( "Show Statusbar" ),
- i18n( "Hide Statusbar" ),
- parent);
- ret->setObjectName(name(ShowStatusbar));
-
- ret->setWhatsThis( i18n( "Show Statusbar<br /><br />"
- "Shows the statusbar, which is the bar at the bottom of \
the window used for status information." ) );
-
- ret->setActive( true );
-
- if ( recvr && slot )
- QObject::connect( ret, SIGNAL( activeChangedByUser( bool ) ), recvr, slot );
-
- KActionCollection *collection = qobject_cast<KActionCollection *>(parent);
- if (collection)
- collection->addAction(ret->objectName(), ret);
-
- return ret;
-}
-
KToggleFullScreenAction *fullScreen(const QObject *recvr, const char *slot, QWidget* \
window, QObject *parent) {
KToggleFullScreenAction *ret;
--- trunk/KDE/kdelibs/kdeui/actions/kstandardaction.h #1196661:1196662
@@ -522,23 +522,11 @@
KDEUI_EXPORT KToggleAction *showMenubar(const QObject *recvr, const char *slot, \
QObject *parent);
/**
- * Show/Hide the menubar.
- * @since 4.6
- */
- KDEUI_EXPORT KDualAction *showHideMenubar(const QObject *recvr, const char *slot, \
QObject *parent);
-
- /**
* Show/Hide the statusbar.
*/
KDEUI_EXPORT KToggleAction *showStatusbar(const QObject *recvr, const char *slot, \
QObject *parent);
/**
- * Show/Hide the statusbar.
- * @since 4.6
- */
- KDEUI_EXPORT KDualAction *showHideStatusbar(const QObject *recvr, const char \
*slot, QObject *parent);
-
- /**
* Switch to/from full screen mode
*/
KDEUI_EXPORT KToggleFullScreenAction *fullScreen(const QObject *recvr, const char \
*slot, QWidget *window, QObject *parent);
--- trunk/KDE/kdelibs/kdeui/xmlgui/kxmlguiwindow.cpp #1196661:1196662
@@ -52,7 +52,6 @@
#include <kauthorized.h>
#include <kconfig.h>
#include <kdebug.h>
-#include <kdualaction.h>
#include <kedittoolbar.h>
#include <khelpmenu.h>
#include <klocale.h>
@@ -81,7 +80,7 @@
QSize defaultSize;
KDEPrivate::ToolBarHandler *toolBarHandler;
- KDualAction *showStatusBarAction;
+ KToggleAction *showStatusBarAction;
QPointer<KEditToolBar> toolBarEditor;
KXMLGUIFactory *factory;
};
@@ -321,15 +320,15 @@
void KXmlGuiWindow::createStandardStatusBarAction(){
K_D(KXmlGuiWindow);
if(!d->showStatusBarAction){
- d->showStatusBarAction = KStandardAction::showHideStatusbar(this, \
SLOT(setSettingsDirty()), actionCollection()); + d->showStatusBarAction = \
KStandardAction::showStatusbar(this, SLOT(setSettingsDirty()), \
actionCollection());
KStatusBar *sb = statusBar(); // Creates statusbar if it doesn't exist \
already.
- connect(d->showStatusBarAction, SIGNAL(activeChangedByUser(bool)), sb, \
SLOT(setVisible(bool)));
- d->showStatusBarAction->setActive(sb->isHidden());
+ connect(d->showStatusBarAction, SIGNAL(toggled(bool)), sb, \
SLOT(setVisible(bool))); + d->showStatusBarAction->setChecked(sb->isHidden());
} else {
// If the language has changed, we'll need to grab the new text and \
whatsThis
- KDualAction *tmpStatusBar = KStandardAction::showHideStatusbar(NULL, NULL, \
NULL);
- d->showStatusBarAction->setInactiveGuiItem(tmpStatusBar->inactiveGuiItem());
- d->showStatusBarAction->setActiveGuiItem(tmpStatusBar->activeGuiItem());
+ KAction *tmpStatusBar = KStandardAction::showStatusbar(NULL, NULL, NULL);
+ d->showStatusBarAction->setText(tmpStatusBar->text());
+ d->showStatusBarAction->setWhatsThis(tmpStatusBar->whatsThis());
delete tmpStatusBar;
}
}
@@ -351,7 +350,7 @@
KMainWindow::applyMainWindowSettings(config, force);
KStatusBar *sb = qFindChild<KStatusBar *>(this);
if (sb && d->showStatusBarAction)
- d->showStatusBarAction->setActive(!sb->isHidden());
+ d->showStatusBarAction->setChecked(!sb->isHidden());
}
// KDE5 TODO: change it to "using KXMLGUIBuilder::finalizeGUI;" in the header
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic