akregator/src

actionmanagerimpl.cpp
00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2005 Frank Osterfeld <frank.osterfeld at kdemail.net>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #include <tqwidget.h>
00026 #include <tdeaction.h>
00027 #include <tdeactioncollection.h>
00028 #include <tdelocale.h>
00029 #include <tdepopupmenu.h>
00030 #include <tdeshortcut.h>
00031 #include <kxmlguifactory.h>
00032 
00033 #include <tqmap.h>
00034 #include <tqstring.h>
00035 #include <tqvaluelist.h>
00036 
00037 #include "actionmanagerimpl.h"
00038 #include "akregatorconfig.h"
00039 #include "akregator_part.h"
00040 #include "akregator_view.h"
00041 #include "articlelistview.h"
00042 #include "articleviewer.h"
00043 #include "feed.h"
00044 #include "feedlistview.h"
00045 #include "fetchqueue.h"
00046 #include "folder.h"
00047 #include "listtabwidget.h"
00048 #include "kernel.h"
00049 #include "speechclient.h"
00050 #include "tag.h"
00051 #include "tagaction.h"
00052 #include "tagnode.h"
00053 #include "tagset.h"
00054 #include "trayicon.h"
00055 #include "treenode.h"
00056 #include "treenodevisitor.h"
00057 #include "tabwidget.h"
00058 #include "tdestdaccel.h"
00059 
00060 
00061 
00062 #include <kdebug.h>
00063 
00064 namespace Akregator
00065 {
00066 
00067 class ActionManagerImpl::NodeSelectVisitor : public TreeNodeVisitor
00068 {
00069     public:
00070     NodeSelectVisitor(ActionManagerImpl* manager) : m_manager(manager) {}
00071     virtual ~NodeSelectVisitor() {}
00072 
00073     virtual bool visitFeed(Feed* node)
00074     {
00075         TDEAction* remove = m_manager->action("feed_remove");
00076         if (remove)
00077             remove->setEnabled(true);
00078         TDEAction* hp = m_manager->action("feed_homepage");
00079         if (hp)
00080             hp->setEnabled(!node->htmlUrl().isEmpty());
00081         m_manager->action("feed_fetch")->setText(i18n("&Fetch Feed"));
00082         m_manager->action("feed_remove")->setText(i18n("&Delete Feed"));
00083         m_manager->action("feed_modify")->setText(i18n("&Edit Feed..."));
00084         m_manager->action("feed_mark_all_as_read")->setText(i18n("&Mark Feed as Read"));
00085 
00086         return true;
00087     }
00088 
00089     virtual bool visitFolder(Folder* node)
00090     {
00091         TDEAction* remove = m_manager->action("feed_remove");
00092         if (remove)
00093             remove->setEnabled(node->parent()); // root nodes must not be deleted
00094         TDEAction* hp = m_manager->action("feed_homepage");
00095         if (hp)
00096             hp->setEnabled(false);
00097 
00098         m_manager->action("feed_fetch")->setText(i18n("&Fetch Feeds"));
00099         m_manager->action("feed_remove")->setText(i18n("&Delete Folder"));
00100         m_manager->action("feed_modify")->setText(i18n("&Rename Folder"));
00101         m_manager->action("feed_mark_all_as_read")->setText(i18n("&Mark Feeds as Read"));
00102 
00103         return true;
00104     }
00105 
00106     virtual bool visitTagNode(TagNode* /*node*/)
00107     {
00108         TDEAction* remove = m_manager->action("feed_remove");
00109         if (remove)
00110             remove->setEnabled(true);
00111         TDEAction* hp = m_manager->action("feed_homepage");
00112         if (hp)
00113             hp->setEnabled(false);
00114         m_manager->action("feed_mark_all_as_read")->setText(i18n("&Mark Articles as Read"));
00115         m_manager->action("feed_remove")->setText(i18n("&Delete Tag"));
00116         m_manager->action("feed_modify")->setText(i18n("&Edit Tag..."));
00117 
00118         return true;
00119     }
00120     private:
00121     ActionManagerImpl* m_manager;
00122 };
00123 
00124 class ActionManagerImpl::ActionManagerImplPrivate
00125 {
00126 public:
00127 
00128     NodeSelectVisitor* nodeSelectVisitor;
00129     ArticleListView* articleList;
00130     ListTabWidget* listTabWidget;
00131     View* view;
00132     ArticleViewer* articleViewer;
00133     Part* part;
00134     TrayIcon* trayIcon;
00135     TDEActionMenu* tagMenu;
00136     TDEActionCollection* actionCollection;
00137     TagSet* tagSet;
00138     TQMap<TQString, TagAction*> tagActions;
00139     TabWidget* tabWidget;
00140     TDEAction* speakSelectedArticlesAction;
00141 };
00142 
00143 void ActionManagerImpl::slotUpdateTagActions(bool enabled, const TQStringList& tagIds)
00144 {
00145     if (Settings::showTaggingGUI() && d->tagMenu)
00146     {
00147         d->tagMenu->setEnabled(enabled);
00148         TQValueList<TagAction*> actions = d->tagActions.values();
00149 
00150         for (TQValueList<TagAction*>::ConstIterator it = actions.begin(); it != actions.end(); ++it)
00151         {
00152             (*it)->setChecked(tagIds.contains((*it)->tag().id()));
00153         }
00154     }
00155 }
00156 
00157 void ActionManagerImpl::setTagSet(TagSet* tagSet)
00158 {
00159     if (tagSet == d->tagSet)
00160         return;
00161 
00162     if (d->tagSet != 0)
00163     {
00164         disconnect(d->tagSet, TQT_SIGNAL(signalTagAdded(const Tag&)), this, TQT_SLOT(slotTagAdded(const Tag&)));
00165         disconnect(d->tagSet, TQT_SIGNAL(signalTagRemoved(const Tag&)), this, TQT_SLOT(slotTagRemoved(const Tag&)));
00166     }
00167 
00168     d->tagSet = tagSet;
00169 
00170     if (tagSet != 0)
00171     {
00172         connect(d->tagSet, TQT_SIGNAL(signalTagAdded(const Tag&)), this, TQT_SLOT(slotTagAdded(const Tag&)));
00173         connect(d->tagSet, TQT_SIGNAL(signalTagRemoved(const Tag&)), this, TQT_SLOT(slotTagRemoved(const Tag&)));
00174     }
00175 
00176     TQValueList<TagAction*> actions = d->tagActions.values();
00177     for (TQValueList<TagAction*>::ConstIterator it = actions.begin(); it != actions.end(); ++it)
00178     {
00179         d->tagMenu->remove(*it);
00180         delete *it;
00181     }
00182 
00183 
00184     d->tagActions.clear();
00185 
00186     //TODO: remove actions from menus, delete actions, clear maps
00187 
00188     if (tagSet != 0L)
00189     {
00190         TQValueList<Tag> list = tagSet->toMap().values();
00191         for (TQValueList<Tag>::ConstIterator it = list.begin(); it != list.end(); ++it)
00192             slotTagAdded(*it);
00193     }
00194 }
00195 
00196 void ActionManagerImpl::slotTagAdded(const Tag& tag)
00197 {
00198     if (!Settings::showTaggingGUI())
00199         return;
00200 
00201     if (!d->tagActions.contains(tag.id()))
00202     {
00203         d->tagActions[tag.id()] = new TagAction(tag, TQT_TQOBJECT(d->view), TQT_SLOT(slotAssignTag(const Tag&, bool)), d->tagMenu);
00204         d->tagMenu->insert(d->tagActions[tag.id()]);
00205     }
00206 }
00207 
00208 void ActionManagerImpl::slotTagRemoved(const Tag& tag)
00209 {
00210     if (!Settings::showTaggingGUI())
00211         return;
00212 
00213     TQString id = tag.id();
00214     TagAction* action = d->tagActions[id];
00215     d->tagMenu->remove(action);
00216     d->tagActions.remove(id);
00217     delete action;
00218 }
00219 
00220 void ActionManagerImpl::slotNodeSelected(TreeNode* node)
00221 {
00222     if (node != 0)
00223         d->nodeSelectVisitor->visit(node);
00224 }
00225 
00226 ActionManagerImpl::ActionManagerImpl(Part* part, TQObject* parent, const char* name) : ActionManager(parent, name), d(new ActionManagerImplPrivate)
00227 {
00228     d->nodeSelectVisitor = new NodeSelectVisitor(this);
00229     d->part = part;
00230     d->tagSet = 0;
00231     d->listTabWidget = 0;
00232     d->articleList = 0;
00233     d->trayIcon = 0;
00234     d->articleViewer = 0;
00235     d->view = 0;
00236     d->tabWidget = 0;
00237     d->tagMenu = 0;
00238     d->speakSelectedArticlesAction = 0;
00239     d->actionCollection = part->actionCollection();
00240     initPart();
00241 }
00242 
00243 ActionManagerImpl::~ActionManagerImpl()
00244 {
00245     delete d->nodeSelectVisitor;
00246     delete d;
00247     d = 0;
00248 }
00249 
00250 void ActionManagerImpl::initTrayIcon(TrayIcon* trayIcon)
00251 {
00252     if (d->trayIcon)
00253         return;
00254     else d->trayIcon = trayIcon;
00255 
00256     TDEPopupMenu* traypop = trayIcon->contextMenu();
00257 
00258     if (actionCollection()->action("feed_fetch_all"))
00259         actionCollection()->action("feed_fetch_all")->plug(traypop, 1);
00260     if (actionCollection()->action("akregator_configure_akregator"))
00261         actionCollection()->action("akregator_configure_akregator")->plug(traypop, 2);
00262 }
00263 
00264 void ActionManagerImpl::initPart()
00265 {
00266     new TDEAction(i18n("&Import Feeds..."), "", "", d->part, TQT_SLOT(fileImport()), d->actionCollection, "file_import");
00267     new TDEAction(i18n("&Export Feeds..."), "", "", d->part, TQT_SLOT(fileExport()), d->actionCollection, "file_export");
00268     //new TDEAction(i18n("&Get Feeds From Web..."), "", "", d->part, TQT_SLOT(fileGetFeeds()), d->actionCollection, "file_getfromweb");
00269 
00270     new TDEAction(i18n("Send &Link Address..."), "mail_generic", "", d->part, TQT_SLOT(fileSendLink()), d->actionCollection, "file_sendlink");
00271     new TDEAction(i18n("Send &File..."), "mail_generic", "", d->part, TQT_SLOT(fileSendFile()), d->actionCollection, "file_sendfile");
00272 
00273     KStdAction::configureNotifications(d->part, TQT_SLOT(showKNotifyOptions()), d->actionCollection); // options_configure_notifications
00274     new TDEAction( i18n("Configure &Akregator..."), "configure", "", d->part, TQT_SLOT(showOptions()), d->actionCollection, "akregator_configure_akregator" );
00275 }
00276 
00277 void ActionManagerImpl::initView(View* view)
00278 {
00279     if (d->view)
00280         return;
00281     else
00282         d->view = view;
00283 
00284     // tag actions
00285     new TDEAction(i18n("&New Tag..."), "", "",  TQT_TQOBJECT(d->view), TQT_SLOT(slotNewTag()), actionCollection(), "tag_new");
00286 
00287     // Feed/Feed Group popup menu
00288     new TDEAction(i18n("&Open Homepage"), "", "Ctrl+H",  TQT_TQOBJECT(d->view), TQT_SLOT(slotOpenHomepage()), actionCollection(), "feed_homepage");
00289     new TDEAction(i18n("&Add Feed..."), "bookmark_add", "Insert", TQT_TQOBJECT(d->view), TQT_SLOT(slotFeedAdd()), actionCollection(), "feed_add");
00290     new TDEAction(i18n("Ne&w Folder..."), "folder-new", "Shift+Insert", TQT_TQOBJECT(d->view), TQT_SLOT(slotFeedAddGroup()), actionCollection(), "feed_add_group");
00291     new TDEAction(i18n("&Delete Feed"), "edit-delete", "Alt+Delete", TQT_TQOBJECT(d->view), TQT_SLOT(slotFeedRemove()), actionCollection(), "feed_remove");
00292     new TDEAction(i18n("&Edit Feed..."), "edit", "F2", TQT_TQOBJECT(d->view), TQT_SLOT(slotFeedModify()), actionCollection(), "feed_modify");
00293         TDEActionMenu* vm = new TDEActionMenu( i18n( "&View Mode" ), actionCollection(), "view_mode" );
00294 
00295     TDERadioAction *ra = new TDERadioAction(i18n("&Normal View"), "view_top_bottom", "Ctrl+Shift+1", TQT_TQOBJECT(d->view), TQT_SLOT(slotNormalView()), actionCollection(), "normal_view");
00296     ra->setExclusiveGroup( "ViewMode" );
00297     vm->insert(ra);
00298 
00299     ra = new TDERadioAction(i18n("&Widescreen View"), "view_left_right", "Ctrl+Shift+2", TQT_TQOBJECT(d->view), TQT_SLOT(slotWidescreenView()), actionCollection(), "widescreen_view");
00300     ra->setExclusiveGroup( "ViewMode" );
00301     vm->insert(ra);
00302 
00303     ra = new TDERadioAction(i18n("C&ombined View"), "view_text", "Ctrl+Shift+3", TQT_TQOBJECT(d->view), TQT_SLOT(slotCombinedView()), actionCollection(), "combined_view");
00304     ra->setExclusiveGroup( "ViewMode" );
00305     vm->insert(ra);
00306 
00307     // toolbar / feed menu
00308     new TDEAction(i18n("&Fetch Feed"), "go-down", TDEStdAccel::shortcut(TDEStdAccel::Reload), TQT_TQOBJECT(d->view), TQT_SLOT(slotFetchCurrentFeed()), actionCollection(), "feed_fetch");
00309     new TDEAction(i18n("Fe&tch All Feeds"), "go-bottom", "Ctrl+L", TQT_TQOBJECT(d->view), TQT_SLOT(slotFetchAllFeeds()), actionCollection(), "feed_fetch_all");
00310 
00311     TDEAction* stopAction = new TDEAction(i18n( "&Abort Fetches" ), "process-stop", Key_Escape, Kernel::self()->fetchQueue(), TQT_SLOT(slotAbort()), actionCollection(), "feed_stop");
00312     stopAction->setEnabled(false);
00313 
00314     new TDEAction(i18n("&Mark Feed as Read"), "goto", "Ctrl+R", TQT_TQOBJECT(d->view), TQT_SLOT(slotMarkAllRead()), actionCollection(), "feed_mark_all_as_read");
00315     new TDEAction(i18n("Ma&rk All Feeds as Read"), "goto", "Ctrl+Shift+R", TQT_TQOBJECT(d->view), TQT_SLOT(slotMarkAllFeedsRead()), actionCollection(), "feed_mark_all_feeds_as_read");
00316 
00317     // Settings menu
00318     TDEToggleAction* sqf = new TDEToggleAction(i18n("Show Quick Filter"), TQString(), 0, TQT_TQOBJECT(d->view), TQT_SLOT(slotToggleShowQuickFilter()), actionCollection(), "show_quick_filter");
00319     sqf->setChecked( Settings::showQuickFilter() );
00320 
00321     new TDEAction( i18n("Open in Tab"), "tab_new", "Shift+Return", TQT_TQOBJECT(d->view), TQT_SLOT(slotOpenCurrentArticle()), actionCollection(), "article_open" );
00322     new TDEAction( i18n("Open in Background Tab"), TQString(), "tab_new", TQT_TQOBJECT(d->view), TQT_SLOT(slotOpenCurrentArticleBackgroundTab()), actionCollection(), "article_open_background_tab" );
00323     new TDEAction( i18n("Open in External Browser"), "window-new", "Ctrl+Shift+Return", TQT_TQOBJECT(d->view), TQT_SLOT(slotOpenCurrentArticleExternal()), actionCollection(), "article_open_external" );
00324     new TDEAction( i18n("Copy Link Address"), TQString(), TQString(), TQT_TQOBJECT(d->view), TQT_SLOT(slotCopyLinkAddress()), actionCollection(), "article_copy_link_address" );
00325 
00326     new TDEAction(i18n("Pre&vious Unread Article"), "", Key_Minus, TQT_TQOBJECT(d->view), TQT_SLOT(slotPrevUnreadArticle()),actionCollection(), "go_prev_unread_article");
00327     new TDEAction(i18n("Ne&xt Unread Article"), "", Key_Plus, TQT_TQOBJECT(d->view), TQT_SLOT(slotNextUnreadArticle()),actionCollection(), "go_next_unread_article");
00328 
00329     new TDEAction(i18n("&Delete"), "edit-delete", "Delete", TQT_TQOBJECT(d->view), TQT_SLOT(slotArticleDelete()), actionCollection(), "article_delete");
00330 
00331     if (Settings::showTaggingGUI())
00332     {
00333         d->tagMenu = new TDEActionMenu ( i18n( "&Set Tags" ), "rss_tag",  actionCollection(), "article_tagmenu" );
00334         d->tagMenu->setEnabled(false); // only enabled when articles are selected
00335     }
00336     TDEActionMenu* statusMenu = new TDEActionMenu ( i18n( "&Mark As" ),
00337                                     actionCollection(), "article_set_status" );
00338 
00339     d->speakSelectedArticlesAction = new TDEAction(i18n("&Speak Selected Articles"), "kttsd", "", TQT_TQOBJECT(d->view), TQT_SLOT(slotTextToSpeechRequest()), actionCollection(), "akr_texttospeech");
00340 
00341     TDEAction* abortTTS = new TDEAction(i18n( "&Stop Speaking" ), "media-playback-stop", Key_Escape, SpeechClient::self(), TQT_SLOT(slotAbortJobs()), actionCollection(), "akr_aborttexttospeech");
00342     abortTTS->setEnabled(false);
00343 
00344     connect(SpeechClient::self(), TQT_SIGNAL(signalActivated(bool)),
00345     abortTTS, TQT_SLOT(setEnabled(bool)));
00346 
00347     statusMenu->insert(new TDEAction(KGuiItem(i18n("as in: mark as read","&Read"), "",
00348                        i18n("Mark selected article as read")),
00349     "Ctrl+E", TQT_TQOBJECT(d->view), TQT_SLOT(slotSetSelectedArticleRead()),
00350     actionCollection(), "article_set_status_read"));
00351 
00352     statusMenu->insert(new TDEAction(KGuiItem(i18n("&New"), "",
00353                         i18n("Mark selected article as new")),
00354     "Ctrl+N", TQT_TQOBJECT(d->view), TQT_SLOT(slotSetSelectedArticleNew()),
00355     actionCollection(), "article_set_status_new" ));
00356 
00357 
00358     statusMenu->insert(new TDEAction(KGuiItem(i18n("&Unread"), "",
00359                        i18n("Mark selected article as unread")),
00360     "Ctrl+U", TQT_TQOBJECT(d->view), TQT_SLOT(slotSetSelectedArticleUnread()),
00361     actionCollection(), "article_set_status_unread"));
00362 
00363     TDEToggleAction* importantAction = new TDEToggleAction(i18n("&Mark as Important"), "flag", "Ctrl+I", actionCollection(), "article_set_status_important");
00364     importantAction->setCheckedState(i18n("Remove &Important Mark"));
00365     connect(importantAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(d->view), TQT_SLOT(slotArticleToggleKeepFlag(bool)));
00366 
00367 
00368     new TDEAction( i18n("Move Node Up"), TQString(), "Shift+Alt+Up", TQT_TQOBJECT(view), TQT_SLOT(slotMoveCurrentNodeUp()), d->actionCollection, "feedstree_move_up" );
00369     new TDEAction( i18n("Move Node Down"), TQString(),  "Shift+Alt+Down", TQT_TQOBJECT(view), TQT_SLOT(slotMoveCurrentNodeDown()), d->actionCollection, "feedstree_move_down" );
00370     new TDEAction( i18n("Move Node Left"), TQString(), "Shift+Alt+Left", TQT_TQOBJECT(view), TQT_SLOT(slotMoveCurrentNodeLeft()), d->actionCollection, "feedstree_move_left" );
00371     new TDEAction( i18n("Move Node Right"), TQString(), "Shift+Alt+Right", TQT_TQOBJECT(view), TQT_SLOT(slotMoveCurrentNodeRight()), d->actionCollection, "feedstree_move_right");
00372 }
00373 
00374 void ActionManagerImpl::initArticleViewer(ArticleViewer* articleViewer)
00375 {
00376     if (d->articleViewer)
00377         return;
00378     else
00379         d->articleViewer = articleViewer;
00380 }
00381 
00382 void ActionManagerImpl::initArticleListView(ArticleListView* articleList)
00383 {
00384     if (d->articleList)
00385         return;
00386     else
00387         d->articleList = articleList;
00388 
00389     new TDEAction( i18n("&Previous Article"), TQString(), "Left", TQT_TQOBJECT(articleList), TQT_SLOT(slotPreviousArticle()), actionCollection(), "go_previous_article" );
00390     new TDEAction( i18n("&Next Article"), TQString(), "Right", TQT_TQOBJECT(articleList), TQT_SLOT(slotNextArticle()), actionCollection(), "go_next_article" );
00391 }
00392 
00393 void ActionManagerImpl::initListTabWidget(ListTabWidget* listTabWidget)
00394 {
00395     if (d->listTabWidget)
00396         return;
00397     else
00398         d->listTabWidget = listTabWidget;
00399 
00400     new TDEAction(i18n("&Previous Feed"), "", "P", TQT_TQOBJECT(listTabWidget),  TQT_SLOT(slotPrevFeed()),actionCollection(), "go_prev_feed");
00401     new TDEAction(i18n("&Next Feed"), "", "N", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotNextFeed()),actionCollection(), "go_next_feed");
00402     new TDEAction(i18n("N&ext Unread Feed"), "", "Alt+Plus", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotNextUnreadFeed()),actionCollection(), "go_next_unread_feed");
00403     new TDEAction(i18n("Prev&ious Unread Feed"), "", "Alt+Minus", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotPrevUnreadFeed()),actionCollection(), "go_prev_unread_feed");
00404 
00405     new TDEAction( i18n("Go to Top of Tree"), TQString(), "Ctrl+Home", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotItemBegin()), d->actionCollection, "feedstree_home" );
00406     new TDEAction( i18n("Go to Bottom of Tree"), TQString(), "Ctrl+End", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotItemEnd()), d->actionCollection, "feedstree_end" );
00407     new TDEAction( i18n("Go Left in Tree"), TQString(), "Ctrl+Left", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotItemLeft()), d->actionCollection, "feedstree_left" );
00408     new TDEAction( i18n("Go Right in Tree"), TQString(), "Ctrl+Right", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotItemRight()), d->actionCollection, "feedstree_right" );
00409     new TDEAction( i18n("Go Up in Tree"), TQString(), "Ctrl+Up", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotItemUp()), d->actionCollection, "feedstree_up" );
00410     new TDEAction( i18n("Go Down in Tree"), TQString(), "Ctrl+Down", TQT_TQOBJECT(listTabWidget), TQT_SLOT(slotItemDown()), d->actionCollection, "feedstree_down" );
00411 }
00412 
00413 void ActionManagerImpl::initTabWidget(TabWidget* tabWidget)
00414 {
00415     if (d->tabWidget)
00416         return;
00417     else
00418         d->tabWidget = tabWidget;
00419 
00420     new TDEAction(i18n("Select Next Tab"), "", "Ctrl+Period", TQT_TQOBJECT(d->tabWidget), TQT_SLOT(slotNextTab()),actionCollection(), "select_next_tab");
00421     new TDEAction(i18n("Select Previous Tab"), "", "Ctrl+Comma", TQT_TQOBJECT(d->tabWidget), TQT_SLOT(slotPreviousTab()),actionCollection(), "select_previous_tab");
00422     new TDEAction( i18n("Detach Tab"), "tab_breakoff", CTRL+SHIFT+Key_B, TQT_TQOBJECT(d->tabWidget), TQT_SLOT(slotDetachTab()), actionCollection(), "tab_detach" );
00423     new TDEAction( i18n("Copy Link Address"), TQString(), TQString(), TQT_TQOBJECT(d->tabWidget), TQT_SLOT(slotCopyLinkAddress()), actionCollection(), "tab_copylinkaddress" );
00424     new TDEAction( i18n("&Close Tab"), "tab_remove", TDEStdAccel::close(), TQT_TQOBJECT(d->tabWidget), TQT_SLOT(slotCloseTab()), actionCollection(), "tab_remove" );
00425 }
00426 
00427 TQWidget* ActionManagerImpl::container(const char* name)
00428 {
00429     return d->part->factory()->container(name, d->part);
00430 }
00431 
00432 
00433 TDEActionCollection* ActionManagerImpl::actionCollection()
00434 {
00435     return d->actionCollection;
00436 }
00437 TDEAction* ActionManagerImpl::action(const char* name, const char* classname)
00438 {
00439     return d->actionCollection != 0 ? d->actionCollection->action(name, classname) : 0;
00440 }
00441 
00442 } // namespace Akregator
00443 
00444 #include "actionmanagerimpl.moc"