Commit 381433dd authored by Simon Hausmann's avatar Simon Hausmann
Browse files

merged branches/work/kaction-cleanup-branch, courtesy of

Kevin, Laurent, Thomas and me.

svn path=/trunk/KDE/kdebase/konqueror/; revision=621518
parent ff84d3bd
......@@ -94,106 +94,155 @@ void KEBApp::createActions() {
(void) KStandardAction::print(actn, SLOT( slotPrint() ), actionCollection());
// actions
KAction* actnDelete = new KAction(KIcon("editdelete"), i18n("&Delete"), actionCollection(), "delete");
QAction* actnDelete = actionCollection()->addAction("delete");
actnDelete->setIcon(KIcon("editdelete"));
actnDelete->setText(i18n("&Delete"));
actnDelete->setShortcut(Qt::Key_Delete);
connect(actnDelete, SIGNAL( triggered() ), actn, SLOT( slotDelete() ));
KAction* actnRename = new KAction(KIcon("text"), i18n("Rename"), actionCollection(), "rename");
QAction* actnRename = actionCollection()->addAction("rename");
actnRename->setIcon(KIcon("text"));
actnRename->setText(i18n("Rename"));
actnRename->setShortcut(Qt::Key_F2);
connect(actnRename, SIGNAL( triggered() ), actn, SLOT( slotRename() ));
KAction* actnChangeURL = new KAction(KIcon("text"), i18n("C&hange URL"), actionCollection(), "changeurl");
QAction* actnChangeURL = actionCollection()->addAction("changeurl");
actnChangeURL->setIcon(KIcon("text"));
actnChangeURL->setText(i18n("C&hange URL"));
actnChangeURL->setShortcut(Qt::Key_F3);
connect(actnChangeURL, SIGNAL( triggered() ), actn, SLOT( slotChangeURL() ));
KAction* actnChangeComment = new KAction(KIcon("text"), i18n("C&hange Comment"), actionCollection(), "changecomment");
QAction* actnChangeComment = actionCollection()->addAction("changecomment");
actnChangeComment->setIcon(KIcon("text"));
actnChangeComment->setText(i18n("C&hange Comment"));
actnChangeComment->setShortcut(Qt::Key_F4);
connect(actnChangeComment, SIGNAL( triggered() ), actn, SLOT( slotChangeComment() ));
KAction* actnChangeIcon = new KAction(KIcon("icons"), i18n("Chan&ge Icon..."), actionCollection(), "changeicon");
QAction* actnChangeIcon = actionCollection()->addAction("changeicon");
actnChangeIcon->setIcon(KIcon("icons"));
actnChangeIcon->setText(i18n("Chan&ge Icon..."));
connect(actnChangeIcon, SIGNAL( triggered() ), actn, SLOT( slotChangeIcon() ));
KAction* actnUpdateFavIcon = new KAction(i18n("Update Favicon"), actionCollection(), "updatefavicon");
QAction* actnUpdateFavIcon = actionCollection()->addAction("updatefavicon");
actnUpdateFavIcon->setText(i18n("Update Favicon"));
connect(actnUpdateFavIcon, SIGNAL( triggered() ), actn, SLOT( slotUpdateFavIcon() ));
KAction* actnRecursiveSort = new KAction(i18n("Recursive Sort"), actionCollection(), "recursivesort");
QAction* actnRecursiveSort = actionCollection()->addAction("recursivesort");
actnRecursiveSort->setText(i18n("Recursive Sort"));
connect(actnRecursiveSort, SIGNAL( triggered() ), actn, SLOT( slotRecursiveSort() ));
KAction* actnNewFolder = new KAction(KIcon("folder_new"), i18n("&New Folder..."), actionCollection(), "newfolder");
QAction* actnNewFolder = actionCollection()->addAction("newfolder");
actnNewFolder->setIcon(KIcon("folder_new"));
actnNewFolder->setText(i18n("&New Folder..."));
actnNewFolder->setShortcut(Qt::CTRL+Qt::Key_N);
connect(actnNewFolder, SIGNAL( triggered() ), actn, SLOT( slotNewFolder() ));
KAction* actnNewBookmark = new KAction(KIcon("www"), i18n("&New Bookmark"), actionCollection(), "newbookmark");
QAction* actnNewBookmark = actionCollection()->addAction("newbookmark");
actnNewBookmark->setIcon(KIcon("www"));
actnNewBookmark->setText(i18n("&New Bookmark"));
connect(actnNewBookmark, SIGNAL( triggered() ), actn, SLOT( slotNewBookmark() ));
KAction* actnInsertSeparator = new KAction(i18n("&Insert Separator"), actionCollection(), "insertseparator");
QAction* actnInsertSeparator = actionCollection()->addAction("insertseparator");
actnInsertSeparator->setText(i18n("&Insert Separator"));
actnInsertSeparator->setShortcut(Qt::CTRL+Qt::Key_I);
connect(actnInsertSeparator, SIGNAL( triggered() ), actn, SLOT( slotInsertSeparator() ));
KAction* actnSort = new KAction(i18n("&Sort Alphabetically"), actionCollection(), "sort");
QAction* actnSort = actionCollection()->addAction("sort");
actnSort->setText(i18n("&Sort Alphabetically"));
connect(actnSort, SIGNAL( triggered() ), actn, SLOT( slotSort() ));
KAction* actnSetAsToolbar = new KAction(KIcon("bookmark_toolbar"), i18n("Set as T&oolbar Folder"), actionCollection(), "setastoolbar");
QAction* actnSetAsToolbar = actionCollection()->addAction("setastoolbar");
actnSetAsToolbar->setIcon(KIcon("bookmark_toolbar"));
actnSetAsToolbar->setText(i18n("Set as T&oolbar Folder"));
connect(actnSetAsToolbar, SIGNAL( triggered() ), actn, SLOT( slotSetAsToolbar() ));
KAction* actnExpandAll = new KAction(i18n("&Expand All Folders"), actionCollection(), "expandall");
QAction* actnExpandAll = actionCollection()->addAction("expandall");
actnExpandAll->setText(i18n("&Expand All Folders"));
connect(actnExpandAll, SIGNAL( triggered() ), actn, SLOT( slotExpandAll() ));
KAction* actnCollapseAll = new KAction(i18n("Collapse &All Folders"), actionCollection(), "collapseall");
QAction* actnCollapseAll = actionCollection()->addAction("collapseall");
actnCollapseAll->setText(i18n("Collapse &All Folders"));
connect(actnCollapseAll, SIGNAL( triggered() ), actn, SLOT( slotCollapseAll() ));
KAction* actnOpenLink = new KAction(KIcon("fileopen"), i18n("&Open in Konqueror"), actionCollection(), "openlink");
QAction* actnOpenLink = actionCollection()->addAction("openlink");
actnOpenLink->setIcon(KIcon("fileopen"));
actnOpenLink->setText(i18n("&Open in Konqueror"));
connect(actnOpenLink, SIGNAL( triggered() ), actn, SLOT( slotOpenLink() ));
KAction* actnTestSelection = new KAction(KIcon("bookmark"), i18n("Check &Status"), actionCollection(), "testlink");
QAction* actnTestSelection = actionCollection()->addAction("testlink");
actnTestSelection->setIcon(KIcon("bookmark"));
actnTestSelection->setText(i18n("Check &Status"));
connect(actnTestSelection, SIGNAL( triggered() ), actn, SLOT( slotTestSelection() ));
KAction* actnTestAll = new KAction(i18n("Check Status: &All"), actionCollection(), "testall");
QAction* actnTestAll = actionCollection()->addAction("testall");
actnTestAll->setText(i18n("Check Status: &All"));
connect(actnTestAll, SIGNAL( triggered() ), actn, SLOT( slotTestAll() ));
KAction* actnUpdateAllFavIcons = new KAction(i18n("Update All &Favicons"), actionCollection(), "updateallfavicons");
QAction* actnUpdateAllFavIcons = actionCollection()->addAction("updateallfavicons");
actnUpdateAllFavIcons->setText(i18n("Update All &Favicons"));
connect(actnUpdateAllFavIcons, SIGNAL( triggered() ), actn, SLOT( slotUpdateAllFavIcons() ));
KAction* actnCancelAllTests = new KAction(i18n("Cancel &Checks"), actionCollection(), "canceltests");
QAction* actnCancelAllTests = actionCollection()->addAction("canceltests");
actnCancelAllTests->setText(i18n("Cancel &Checks"));
connect(actnCancelAllTests, SIGNAL( triggered() ), actn, SLOT( slotCancelAllTests() ));
KAction* actnCancelFavIconUpdates = new KAction(i18n("Cancel &Favicon Updates"), actionCollection(), "cancelfaviconupdates");
QAction* actnCancelFavIconUpdates = actionCollection()->addAction("cancelfaviconupdates");
actnCancelFavIconUpdates->setText(i18n("Cancel &Favicon Updates"));
connect(actnCancelFavIconUpdates, SIGNAL( triggered() ), actn, SLOT( slotCancelFavIconUpdates() ));
KAction* actnImportNS = new KAction(KIcon("netscape"), i18n("Import &Netscape Bookmarks..."), actionCollection(), "importNS");
QAction* actnImportNS = actionCollection()->addAction("importNS");
actnImportNS->setIcon(KIcon("netscape"));
actnImportNS->setText(i18n("Import &Netscape Bookmarks..."));
connect(actnImportNS, SIGNAL( triggered() ), actn, SLOT( slotImport() ));
KAction* actnImportOpera = new KAction(KIcon("opera"), i18n("Import &Opera Bookmarks..."), actionCollection(), "importOpera");
QAction* actnImportOpera = actionCollection()->addAction("importOpera");
actnImportOpera->setIcon(KIcon("opera"));
actnImportOpera->setText(i18n("Import &Opera Bookmarks..."));
connect(actnImportOpera, SIGNAL( triggered() ), actn, SLOT( slotImport() ));
KAction* actnImportCrashes = new KAction(i18n("Import All &Crash Sessions as Bookmarks..."), actionCollection(), "importCrashes");
QAction* actnImportCrashes = actionCollection()->addAction("importCrashes");
actnImportCrashes->setText(i18n("Import All &Crash Sessions as Bookmarks..."));
connect(actnImportCrashes, SIGNAL( triggered() ), actn, SLOT( slotImport() ));
KAction* actnImportGaleon = new KAction(i18n("Import &Galeon Bookmarks..."), actionCollection(), "importGaleon");
QAction* actnImportGaleon = actionCollection()->addAction("importGaleon");
actnImportGaleon->setText(i18n("Import &Galeon Bookmarks..."));
connect(actnImportGaleon, SIGNAL( triggered() ), actn, SLOT( slotImport() ));
KAction* actnImportKDE2 = new KAction(i18n("Import &KDE2/KDE3 Bookmarks..."), actionCollection(), "importKDE2");
QAction* actnImportKDE2 = actionCollection()->addAction("importKDE2");
actnImportKDE2->setText(i18n("Import &KDE2/KDE3 Bookmarks..."));
connect(actnImportKDE2, SIGNAL( triggered() ), actn, SLOT( slotImport() ));
KAction* actnImportIE = new KAction(i18n("Import &IE Bookmarks..."), actionCollection(), "importIE");
QAction* actnImportIE = actionCollection()->addAction("importIE");
actnImportIE->setText(i18n("Import &IE Bookmarks..."));
connect(actnImportIE, SIGNAL( triggered() ), actn, SLOT( slotImport() ));
KAction* actnImportMoz = new KAction(KIcon("mozilla"), i18n("Import &Mozilla Bookmarks..."), actionCollection(), "importMoz");
QAction* actnImportMoz = actionCollection()->addAction("importMoz");
actnImportMoz->setIcon(KIcon("mozilla"));
actnImportMoz->setText(i18n("Import &Mozilla Bookmarks..."));
connect(actnImportMoz, SIGNAL( triggered() ), actn, SLOT( slotImport() ));
KAction* actnExportNS = new KAction(KIcon("netscape"), i18n("Export to &Netscape Bookmarks"), actionCollection(), "exportNS");
QAction* actnExportNS = actionCollection()->addAction("exportNS");
actnExportNS->setIcon(KIcon("netscape"));
actnExportNS->setText(i18n("Export to &Netscape Bookmarks"));
connect(actnExportNS, SIGNAL( triggered() ), actn, SLOT( slotExportNS() ));
KAction* actnExportOpera = new KAction(KIcon("opera"), i18n("Export to &Opera Bookmarks..."), actionCollection(), "exportOpera");
QAction* actnExportOpera = actionCollection()->addAction("exportOpera");
actnExportOpera->setIcon(KIcon("opera"));
actnExportOpera->setText(i18n("Export to &Opera Bookmarks..."));
connect(actnExportOpera, SIGNAL( triggered() ), actn, SLOT( slotExportOpera() ));
KAction* actnExportHTML = new KAction(KIcon("html"), i18n("Export to &HTML Bookmarks..."), actionCollection(), "exportHTML");
QAction* actnExportHTML = actionCollection()->addAction("exportHTML");
actnExportHTML->setIcon(KIcon("html"));
actnExportHTML->setText(i18n("Export to &HTML Bookmarks..."));
connect(actnExportHTML, SIGNAL( triggered() ), actn, SLOT( slotExportHTML() ));
KAction* actnExportIE = new KAction(i18n("Export to &IE Bookmarks..."), actionCollection(), "exportIE");
QAction* actnExportIE = actionCollection()->addAction("exportIE");
actnExportIE->setText(i18n("Export to &IE Bookmarks..."));
connect(actnExportIE, SIGNAL( triggered() ), actn, SLOT( slotExportIE() ));
KAction* actnExportMoz = new KAction(KIcon("mozilla"), i18n("Export to &Mozilla Bookmarks..."), actionCollection(), "exportMoz");
QAction* actnExportMoz = actionCollection()->addAction("exportMoz");
actnExportMoz->setIcon(KIcon("mozilla"));
actnExportMoz->setText(i18n("Export to &Mozilla Bookmarks..."));
connect(actnExportMoz, SIGNAL( triggered() ), actn, SLOT( slotExportMoz() ));
}
......
......@@ -40,7 +40,6 @@
#include <kmessagebox.h>
#include <konq_settings.h>
#include <kpropertiesdialog.h>
#include <kseparatoraction.h>
#include <kstaticdeleter.h>
#include <kstandardaction.h>
#include <kparts/factory.h>
......@@ -210,22 +209,28 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
// Don't repaint on configuration changes during construction
m_bInit = true;
m_paDotFiles = new KToggleAction( i18n( "Show &Hidden Files" ), actionCollection(), "show_dot" );
m_paDotFiles = new KToggleAction( i18n( "Show &Hidden Files" ), this );
actionCollection()->addAction( "show_dot", m_paDotFiles );
connect(m_paDotFiles, SIGNAL(triggered(bool) ), SLOT( slotShowDot() ));
// m_paDotFiles->setCheckedState(i18n("Hide &Hidden Files"));
m_paDotFiles->setToolTip( i18n( "Toggle displaying of hidden dot files" ) );
m_paDirectoryOverlays = new KToggleAction( i18n( "&Folder Icons Reflect Contents" ), actionCollection(), "show_directory_overlays" );
m_paDirectoryOverlays = new KToggleAction( i18n( "&Folder Icons Reflect Contents" ), this );
actionCollection()->addAction( "show_directory_overlays", m_paDirectoryOverlays );
connect(m_paDirectoryOverlays, SIGNAL(triggered(bool) ), SLOT( slotShowDirectoryOverlays() ));
m_pamPreview = new KActionMenu( i18n( "&Preview" ), actionCollection(), "iconview_preview" );
m_pamPreview = new KActionMenu( i18n( "&Preview" ), this );
actionCollection()->addAction( "iconview_preview", m_pamPreview );
m_paEnablePreviews = new KToggleAction( i18n("Enable Previews"), actionCollection(), "iconview_preview_all" );
m_paEnablePreviews = new KToggleAction( i18n("Enable Previews"), this );
actionCollection()->addAction( "iconview_preview_all", m_paEnablePreviews );
m_paEnablePreviews->setCheckedState( KGuiItem(i18n("Disable Previews")) );
connect( m_paEnablePreviews, SIGNAL( toggled( bool ) ), this, SLOT( slotPreview( bool ) ) );
m_paEnablePreviews->setIcon(KIcon("thumbnail"));
m_pamPreview->addAction( m_paEnablePreviews );
m_pamPreview->addAction( new KSeparatorAction(actionCollection()) );
QAction *sep_act = new QAction(this);
sep_act->setSeparator(true);
m_pamPreview->addAction(sep_act);
KService::List plugins = KServiceTypeTrader::self()->query( "ThumbCreator" );
QMap< QString, KToggleAction* > previewActions;
......@@ -236,24 +241,31 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
preview->QAction::setObjectName( QByteArray( preview->name() ) + ',' + ( *it )->desktopEntryName().toLatin1() );
else
{
preview = new KToggleAction( (*it)->name(), actionCollection(), (*it)->desktopEntryName().toLatin1() );
preview = new KToggleAction( (*it)->name(), this );
actionCollection()->addAction( (*it)->desktopEntryName().toLatin1(), preview );
connect( preview, SIGNAL( toggled( bool ) ), this, SLOT( slotPreview( bool ) ) );
m_pamPreview->addAction( preview );
m_paPreviewPlugins.append( preview );
}
}
KToggleAction *soundPreview = new KToggleAction( i18n("Sound Files"), actionCollection(), "audio/" );
KToggleAction *soundPreview = new KToggleAction( i18n("Sound Files"), this );
actionCollection()->addAction( "audio/", soundPreview );
connect( soundPreview, SIGNAL( toggled( bool ) ), this, SLOT( slotPreview( bool ) ) );
m_pamPreview->addAction( soundPreview );
m_paPreviewPlugins.append( soundPreview );
// m_pamSort = new KActionMenu( i18n( "Sort..." ), actionCollection(), "sort" );
KToggleAction *aSortByNameCS = new KToggleAction( i18n( "By Name (Case Sensitive)" ), actionCollection(), "sort_nc" );
KToggleAction *aSortByNameCI = new KToggleAction( i18n( "By Name (Case Insensitive)" ), actionCollection(), "sort_nci" );
KToggleAction *aSortBySize = new KToggleAction( i18n( "By Size" ), actionCollection(), "sort_size" );
KToggleAction *aSortByType = new KToggleAction( i18n( "By Type" ), actionCollection(), "sort_type" );
KToggleAction *aSortByDate = new KToggleAction( i18n( "By Date" ), actionCollection(), "sort_date" );
KToggleAction *aSortByNameCS = new KToggleAction( i18n( "By Name (Case Sensitive)" ), this );
actionCollection()->addAction( "sort_nc", aSortByNameCS );
KToggleAction *aSortByNameCI = new KToggleAction( i18n( "By Name (Case Insensitive)" ), this );
actionCollection()->addAction( "sort_nci", aSortByNameCI );
KToggleAction *aSortBySize = new KToggleAction( i18n( "By Size" ), this );
actionCollection()->addAction( "sort_size", aSortBySize );
KToggleAction *aSortByType = new KToggleAction( i18n( "By Type" ), this );
actionCollection()->addAction( "sort_type", aSortByType );
KToggleAction *aSortByDate = new KToggleAction( i18n( "By Date" ), this );
actionCollection()->addAction( "sort_date", aSortByDate );
QActionGroup* sorting = new QActionGroup(this);
sorting->setExclusive(true);
......@@ -280,8 +292,10 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
KToggleAction *sort_action = dynamic_cast<KToggleAction *>(actionCollection()->action(sortcrit.toLatin1().constData()));
if(sort_action!=NULL) sort_action->trigger();
m_paSortDirsFirst = new KToggleAction( i18n( "Folders First" ), actionCollection(), "sort_directoriesfirst" );
KToggleAction *aSortDescending = new KToggleAction( i18n( "Descending" ), actionCollection(), "sort_descend" );
m_paSortDirsFirst = new KToggleAction( i18n( "Folders First" ), this );
actionCollection()->addAction( "sort_directoriesfirst", m_paSortDirsFirst );
KToggleAction *aSortDescending = new KToggleAction( i18n( "Descending" ), this );
actionCollection()->addAction( "sort_descend", aSortDescending );
m_paSortDirsFirst->setChecked( KonqIconViewFactory::defaultViewProps()->isDirsFirst() );
......@@ -306,17 +320,22 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
m_pamSort->insert( aSortDescending );
*/
m_paSelect = new KAction( i18n( "Se&lect..." ), actionCollection(), "select" );
m_paSelect = actionCollection()->addAction("select");
m_paSelect->setText( i18n( "Se&lect..." ) );
connect(m_paSelect, SIGNAL(triggered(bool) ), SLOT( slotSelect() ));
m_paSelect->setShortcut(Qt::CTRL+Qt::Key_Plus);
m_paUnselect = new KAction( i18n( "Unselect..." ), actionCollection(), "unselect" );
m_paUnselect = actionCollection()->addAction("unselect");
m_paUnselect->setText( i18n( "Unselect..." ) );
connect(m_paUnselect, SIGNAL(triggered(bool) ), SLOT( slotUnselect() ));
m_paUnselect->setShortcut(Qt::CTRL+Qt::Key_Minus);
m_paSelectAll = KStandardAction::selectAll( this, SLOT( slotSelectAll() ), actionCollection(), "selectall" );
m_paUnselectAll = new KAction( i18n( "Unselect All" ), actionCollection(), "unselectall" );
m_paSelectAll = KStandardAction::selectAll( this, SLOT( slotSelectAll() ), this );
actionCollection()->addAction( "selectall", m_paSelectAll );
m_paUnselectAll = actionCollection()->addAction("unselectall");
m_paUnselectAll->setText( i18n( "Unselect All" ) );
connect(m_paUnselectAll, SIGNAL(triggered(bool) ), SLOT( slotUnselectAll() ));
m_paUnselectAll->setShortcut(Qt::CTRL+Qt::Key_U);
m_paInvertSelection = new KAction( i18n( "&Invert Selection" ), actionCollection(), "invertselection" );
m_paInvertSelection = actionCollection()->addAction("invertselection");
m_paInvertSelection->setText( i18n( "&Invert Selection" ) );
connect(m_paInvertSelection, SIGNAL(triggered(bool) ), SLOT( slotInvertSelection() ));
m_paInvertSelection->setShortcut(Qt::CTRL+Qt::Key_Asterisk);
......
......@@ -206,11 +206,11 @@ protected:
Q3PtrList<KToggleAction> m_paPreviewPlugins;
KActionMenu *m_pamSort;
KAction *m_paSelect;
KAction *m_paUnselect;
KAction *m_paSelectAll;
KAction *m_paUnselectAll;
KAction *m_paInvertSelection;
QAction *m_paSelect;
QAction *m_paUnselect;
QAction *m_paSelectAll;
QAction *m_paUnselectAll;
QAction *m_paInvertSelection;
KToggleAction *m_paSortDirsFirst;
......
......@@ -86,8 +86,8 @@ void KonqBidiHistoryAction::fillHistoryPopup( const QList<HistoryEntry*> &histor
///////////////////////////////
KonqBidiHistoryAction::KonqBidiHistoryAction ( const QString & text, KActionCollection* parent, const char* name )
: KAction( text, parent, name )
KonqBidiHistoryAction::KonqBidiHistoryAction ( const QString & text, QObject *parent )
: KAction( text, parent )
{
setShortcutConfigurable(false);
m_firstIndex = 0;
......@@ -185,43 +185,37 @@ void KonqBidiHistoryAction::slotTriggered( QAction* action )
///////////////////////////////
KonqLogoAction::KonqLogoAction( const QString& text, const KShortcut& accel, KActionCollection* parent, const char* name )
: KAction( text, parent, name )
KonqLogoAction::KonqLogoAction( const QString& text, QObject* parent )
: KAction( text, parent )
{
setShortcut(accel);
//setToolBarWidgetFactory(this);
}
KonqLogoAction::KonqLogoAction( const QString& text, const KShortcut& accel,
QObject* receiver, const char* slot, KActionCollection* parent, const char* name )
: KAction( text, parent, name )
KonqLogoAction::KonqLogoAction( const QString& text, QObject* receiver, const char* slot, QObject* parent )
: KAction( text, parent )
{
setShortcut(accel);
connect(this, SIGNAL(triggered(bool)), receiver, slot);
//setToolBarWidgetFactory(this);
}
KonqLogoAction::KonqLogoAction( const QString& text, const KIcon& pix, const KShortcut& accel, KActionCollection* parent, const char* name )
: KAction( text, parent, name )
KonqLogoAction::KonqLogoAction( const QString& text, const KIcon& pix, QObject* parent )
: KAction( text, parent )
{
setIcon(pix);
setShortcut(accel);
//setToolBarWidgetFactory(this);
}
KonqLogoAction::KonqLogoAction( const QString& text, const KIcon& pix, const KShortcut& accel, QObject* receiver, const char* slot, KActionCollection* parent, const char* name )
: KAction( text, parent, name )
KonqLogoAction::KonqLogoAction( const QString& text, const KIcon& pix, QObject* receiver, const char* slot, QObject* parent )
: KAction( text, parent )
{
setIcon(pix);
setShortcut(accel);
connect(this, SIGNAL(triggered(bool)), receiver, slot);
//setToolBarWidgetFactory(this);
}
KonqLogoAction::KonqLogoAction( const QStringList& icons, QObject* receiver,
const char* slot, KActionCollection* parent,
const char* name )
: KAction( QString(), parent, name ) // text missing !
const char* slot, QObject* parent )
: KAction( QString(), parent ) // text missing !
{
iconList = icons;
connect(this, SIGNAL(toggled(bool)), receiver, slot);
......@@ -277,8 +271,8 @@ QWidget * KonqLogoAction::createWidget( QWidget * parent )
KonqViewModeAction::KonqViewModeAction( const QString& desktopEntryName,
const QString &text, const KIcon &icon,
KActionCollection *parent, const char *name )
: KAction( icon, text, parent, name ),
QObject* parent )
: KAction( icon, text, parent ),
m_desktopEntryName( desktopEntryName )
{
setMenu(new QMenu());
......@@ -358,9 +352,8 @@ KonqHistoryList* KonqMostOftenURLSAction::s_mostEntries = 0;
uint KonqMostOftenURLSAction::s_maxEntries = 0;
KonqMostOftenURLSAction::KonqMostOftenURLSAction( const QString& text,
KActionCollection *parent,
const char *name )
: KActionMenu( KIcon("goto"), text, parent, name )
QObject* parent )
: KActionMenu( KIcon("goto"), text, parent )
{
setDelayed( false );
......
......@@ -37,7 +37,7 @@ class KonqBidiHistoryAction : public KAction
{
Q_OBJECT
public:
KonqBidiHistoryAction( const QString & text, KActionCollection* parent = 0, const char* name = 0 );
KonqBidiHistoryAction( const QString & text, QObject * parent );
virtual ~KonqBidiHistoryAction();
void fillGoMenu( const QList<HistoryEntry*> &history, int historyIndex );
......@@ -71,16 +71,12 @@ class KonqLogoAction : public KAction
{
Q_OBJECT
public:
KonqLogoAction( const QString& text, const KShortcut& accel = KShortcut(), KActionCollection* parent = 0, const char* name = 0 );
KonqLogoAction( const QString& text, const KShortcut& accel,
QObject* receiver, const char* slot, KActionCollection* parent, const char* name = 0 );
KonqLogoAction( const QString& text, const KIcon& pix, const KShortcut& accel = KShortcut(),
KActionCollection* parent = 0, const char* name = 0 );
KonqLogoAction( const QString& text, const KIcon& pix, const KShortcut& accel,
QObject* receiver, const char* slot, KActionCollection* parent, const char* name = 0 );
KonqLogoAction( const QString& text, QObject* parent );
KonqLogoAction( const QString& text, QObject* receiver, const char* slot, QObject* parent );
KonqLogoAction( const QString& text, const KIcon& pix, QObject* parent );
KonqLogoAction( const QString& text, const KIcon& pix, QObject* receiver, const char* slot, QObject* parent );
// text missing !
KonqLogoAction( const QStringList& icons, QObject* receiver,
const char* slot, KActionCollection* parent, const char* name = 0 );
KonqLogoAction( const QStringList& icons, QObject* receiver, const char* slot, QObject* parent );
void start();
void stop();
......@@ -101,7 +97,7 @@ class KonqViewModeAction : public KAction
public:
KonqViewModeAction( const QString& desktopEntryName,
const QString &text, const KIcon &icon,
KActionCollection *parent, const char *name );
QObject* parent );
virtual ~KonqViewModeAction();
QString desktopEntryName() const { return m_desktopEntryName; }
......@@ -123,8 +119,7 @@ class KonqMostOftenURLSAction : public KActionMenu
Q_OBJECT
public:
KonqMostOftenURLSAction( const QString& text, KActionCollection *parent,
const char *name );
KonqMostOftenURLSAction( const QString& text, QObject* parent );
virtual ~KonqMostOftenURLSAction();
static bool numberOfVisitOrder( const KonqHistoryEntry& lhs, const KonqHistoryEntry& rhs ) {
......
......@@ -150,7 +150,8 @@ void KonqFrameStatusBar::splitFrameMenu()
// We have to ship the remove view action ourselves,
// since this may not be the active view (passive view)
KAction actRemoveView(KIcon("view_remove"), i18n("Close View"), (KActionCollection*)0, "removethisview");
KAction actRemoveView(KIcon("view_remove"), i18n("Close View"), 0);
actRemoveView.setObjectName("removethisview");
connect(&actRemoveView, SIGNAL(triggered(bool)), m_pParentKonqFrame, SLOT(slotRemoveView()));
//KonqView * nextView = mw->viewManager()->chooseNextView( m_pParentKonqFrame->childView() );
actRemoveView.setEnabled( mw->mainViewsCount() > 1 || m_pParentKonqFrame->childView()->isToggleView() || m_pParentKonqFrame->childView()->isPassiveMode() );
......
......@@ -22,6 +22,7 @@
#include <kiconloader.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kactioncollection.h>
#include <kservicetypetrader.h>
#include "konq_view.h"
......@@ -154,7 +155,8 @@ void PopupMenuGUIClient::addEmbeddingService( QDomElement &menu, int idx, const
action.setAttribute( "group", "preview" );
KAction *act = new KAction( name, actionCollection(), actName );
QAction *act = actionCollection()->addAction( actName );
act->setText( name );
act->setIcon( KIcon(service->icon()) );
QObject::connect(act, SIGNAL(triggered(bool)), m_mainWindow, SLOT( slotOpenEmbedded() ));
}
......@@ -193,7 +195,8 @@ ToggleViewGUIClient::ToggleViewGUIClient( KonqMainWindow *mainWindow )
QString description = i18n( "Show %1" , (*cIt)->name() );
QString name = (*cIt)->desktopEntryName();
//kDebug(1202) << "ToggleViewGUIClient: name=" << name << endl;
KToggleAction *action = new KToggleAction( description, mainWindow->actionCollection(), name.toLatin1() );
KToggleAction *action = new KToggleAction( description, this );
mainWindow->actionCollection()->addAction( name.toLatin1(), action );
action->setCheckedState( KGuiItem(i18n( "Hide %1" , (*cIt)->name() )) );
// HACK
......
This diff is collapsed.
......@@ -610,58 +610,58 @@ private: // members
KNewMenu * m_pMenuNew;
KAction *m_paPrint;
QAction *m_paPrint;
KonqBookmarkActionMenu *m_pamBookmarks;
KToolBarPopupAction *m_paUp;
KToolBarPopupAction *m_paBack;
KToolBarPopupAction *m_paForward;
KAction *m_paHome;
QAction *m_paHome;
KonqBidiHistoryAction *m_paHistory;
KAction *m_paSaveViewProfile;
QAction *m_paSaveViewProfile;
KToggleAction *m_paSaveViewPropertiesLocally;
QAction *m_paRemoveLocalProperties;
KAction *m_paSplitViewHor;
KAction *m_paSplitViewVer;
KAction *m_paAddTab;
KAction *m_paDuplicateTab;
KAction *m_paBreakOffTab;
KAction *m_paRemoveView;
KAction *m_paRemoveTab;
KAction *m_paRemoveOtherTabs;
KAction *m_paActivateNextTab;
KAction *m_paActivatePrevTab;
KAction *m_paSaveRemoveViewProfile;
QAction *m_paSplitViewHor;
QAction *m_paSplitViewVer;
QAction *m_paAddTab;
QAction *m_paDuplicateTab;
QAction *m_paBreakOffTab;
QAction *m_paRemoveView;
QAction *m_paRemoveTab;
QAction *m_paRemoveOtherTabs;
QAction *m_paActivateNextTab;
QAction *m_paActivatePrevTab;
QAction *m_paSaveRemoveViewProfile;
KActionMenu *m_pamLoadViewProfile;
KToggleAction *m_paLockView;
KToggleAction *m_paLinkView;
KAction *m_paReload;
KAction *m_paReloadAllTabs;
KAction *m_paUndo;
KAction *m_paCut;
KAction *m_paCopy;