Commit 66aeb232 authored by Christoph Feck's avatar Christoph Feck
Browse files

QAction::setShortcut -> KActionCollection::setDefaultShortcut

parent 2851d290
......@@ -79,12 +79,12 @@ kpCommandHistoryBase::kpCommandHistoryBase (bool doReadConfig,
{
m_actionUndo = new KToolBarPopupAction (QIcon::fromTheme ("edit-undo"), undoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Undo), m_actionUndo);
m_actionUndo->setShortcuts (KStandardShortcut::shortcut (KStandardShortcut::Undo));
ac->setDefaultShortcuts (m_actionUndo, KStandardShortcut::shortcut (KStandardShortcut::Undo));
connect (m_actionUndo, SIGNAL(triggered(bool)), this, SLOT (undo ()));
m_actionRedo = new KToolBarPopupAction (QIcon::fromTheme ("edit-redo"), redoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Redo), m_actionRedo);
m_actionRedo->setShortcuts (KStandardShortcut::shortcut (KStandardShortcut::Redo));
ac->setDefaultShortcuts (m_actionRedo, KStandardShortcut::shortcut (KStandardShortcut::Redo));
connect (m_actionRedo, SIGNAL(triggered(bool)), this, SLOT (redo ()));
......
......@@ -98,7 +98,7 @@ void kpMainWindow::setupEditMenuActions ()
d->actionPasteInNewWindow->setText (i18n ("Paste in &New Window"));
connect (d->actionPasteInNewWindow, SIGNAL (triggered (bool)),
SLOT (slotPasteInNewWindow ()));
d->actionPasteInNewWindow->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_V);
ac->setDefaultShortcut (d->actionPasteInNewWindow, Qt::CTRL + Qt::SHIFT + Qt::Key_V);
//d->actionDelete = KStandardAction::clear (this, SLOT (slotDelete ()), ac);
d->actionDelete = ac->addAction ("edit_clear");
......
......@@ -123,7 +123,7 @@ void kpMainWindow::setupFileMenuActions ()
d->actionReload->setText (i18n ("Reloa&d"));
d->actionReload->setIcon (QIcon::fromTheme ("view-refresh"));
connect(d->actionReload, SIGNAL(triggered(bool) ), SLOT (slotReload ()));
d->actionReload->setShortcuts(KStandardShortcut::reload ());
ac->setDefaultShortcuts (d->actionReload, KStandardShortcut::reload ());
slotEnableReload ();
d->actionPrint = KStandardAction::print (this, SLOT (slotPrint ()), ac);
......
......@@ -118,50 +118,50 @@ void kpMainWindow::setupImageMenuActions ()
d->actionResizeScale = ac->addAction ("image_resize_scale");
d->actionResizeScale->setText (i18n ("R&esize / Scale..."));
connect (d->actionResizeScale, SIGNAL (triggered (bool)), SLOT (slotResizeScale ()));
d->actionResizeScale->setShortcut(Qt::CTRL + Qt::Key_E);
ac->setDefaultShortcut (d->actionResizeScale, Qt::CTRL + Qt::Key_E);
d->actionCrop = ac->addAction ("image_crop");
d->actionCrop->setText (i18n ("Se&t as Image (Crop)"));
connect (d->actionCrop, SIGNAL (triggered (bool)), SLOT (slotCrop ()));
d->actionCrop->setShortcut(Qt::CTRL + Qt::Key_T);
ac->setDefaultShortcut (d->actionCrop, Qt::CTRL + Qt::Key_T);
d->actionAutoCrop = ac->addAction ("image_auto_crop");
d->actionAutoCrop->setText (autoCropText ());
connect (d->actionAutoCrop, SIGNAL (triggered (bool)), SLOT (slotAutoCrop ()));
d->actionAutoCrop->setShortcut(Qt::CTRL + Qt::Key_U);
ac->setDefaultShortcut (d->actionAutoCrop, Qt::CTRL + Qt::Key_U);
d->actionFlip = ac->addAction ("image_flip");
d->actionFlip->setText (i18n ("&Flip (upside down)"));
connect (d->actionFlip, SIGNAL (triggered (bool)), SLOT (slotFlip ()));
d->actionFlip->setShortcut(Qt::CTRL + Qt::Key_F);
ac->setDefaultShortcut (d->actionFlip, Qt::CTRL + Qt::Key_F);
d->actionMirror = ac->addAction ("image_mirror");
d->actionMirror->setText (i18n ("Mirror (horizontally)"));
connect (d->actionMirror, SIGNAL (triggered (bool)), SLOT (slotMirror ()));
//d->actionMirror->setShortcut(Qt::CTRL + Qt::Key_M);
//ac->setDefaultShortcut (d->actionMirror, Qt::CTRL + Qt::Key_M);
d->actionRotate = ac->addAction ("image_rotate");
d->actionRotate->setText (i18n ("&Rotate..."));
d->actionRotate->setIcon (QIcon::fromTheme ("transform-rotate"));
connect (d->actionRotate, SIGNAL (triggered (bool)), SLOT (slotRotate ()));
d->actionRotate->setShortcut(Qt::CTRL + Qt::Key_R);
ac->setDefaultShortcut (d->actionRotate, Qt::CTRL + Qt::Key_R);
d->actionRotateLeft = ac->addAction ("image_rotate_270deg");
d->actionRotateLeft->setText (i18n ("Rotate &Left"));
d->actionRotateLeft->setIcon (QIcon::fromTheme ("object-rotate-left"));
connect (d->actionRotateLeft, SIGNAL (triggered (bool)), SLOT (slotRotate270 ()));
d->actionRotateLeft->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Left);
ac->setDefaultShortcut (d->actionRotateLeft, Qt::CTRL + Qt::SHIFT + Qt::Key_Left);
d->actionRotateRight = ac->addAction ("image_rotate_90deg");
d->actionRotateRight->setText (i18n ("Rotate Righ&t"));
d->actionRotateRight->setIcon (QIcon::fromTheme ("object-rotate-right"));
connect (d->actionRotateRight, SIGNAL (triggered (bool)), SLOT (slotRotate90 ()));
d->actionRotateRight->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Right);
ac->setDefaultShortcut (d->actionRotateRight, Qt::CTRL + Qt::SHIFT + Qt::Key_Right);
d->actionSkew = ac->addAction ("image_skew");
d->actionSkew->setText (i18n ("S&kew..."));
connect (d->actionSkew, SIGNAL (triggered (bool)), SLOT (slotSkew ()));
d->actionSkew->setShortcut(Qt::CTRL + Qt::Key_K);
ac->setDefaultShortcut (d->actionSkew, Qt::CTRL + Qt::Key_K);
d->actionConvertToBlackAndWhite = ac->addAction ("image_convert_to_black_and_white");
d->actionConvertToBlackAndWhite->setText (i18n ("Reduce to Mo&nochrome (Dithered)"));
......@@ -174,17 +174,17 @@ void kpMainWindow::setupImageMenuActions ()
d->actionInvertColors = ac->addAction ("image_invert_colors");
d->actionInvertColors->setText (i18n ("&Invert Colors"));
connect (d->actionInvertColors, SIGNAL (triggered (bool)), SLOT (slotInvertColors ()));
d->actionInvertColors->setShortcut(Qt::CTRL + Qt::Key_I);
ac->setDefaultShortcut (d->actionInvertColors, Qt::CTRL + Qt::Key_I);
d->actionClear = ac->addAction ("image_clear");
d->actionClear->setText (i18n ("C&lear"));
connect (d->actionClear, SIGNAL (triggered (bool)), SLOT (slotClear ()));
d->actionClear->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_N);
ac->setDefaultShortcut (d->actionClear, Qt::CTRL + Qt::SHIFT + Qt::Key_N);
d->actionMoreEffects = ac->addAction ("image_more_effects");
d->actionMoreEffects->setText (i18n ("&More Effects..."));
connect (d->actionMoreEffects, SIGNAL (triggered (bool)), SLOT (slotMoreEffects ()));
d->actionMoreEffects->setShortcut(Qt::CTRL + Qt::Key_M);
ac->setDefaultShortcut (d->actionMoreEffects, Qt::CTRL + Qt::Key_M);
enableImageMenuDocumentActions (false);
......
......@@ -134,25 +134,25 @@ void kpMainWindow::setupToolActions ()
d->actionPrevToolOptionGroup1 = ac->addAction ("prev_tool_option_group_1");
d->actionPrevToolOptionGroup1->setText (i18n ("Previous Tool Option (Group #1)"));
d->actionPrevToolOptionGroup1->setShortcuts (kpTool::shortcutForKey (Qt::Key_1));
ac->setDefaultShortcuts (d->actionPrevToolOptionGroup1, kpTool::shortcutForKey (Qt::Key_1));
connect (d->actionPrevToolOptionGroup1, SIGNAL (triggered (bool)),
SLOT (slotActionPrevToolOptionGroup1 ()));
d->actionNextToolOptionGroup1 = ac->addAction ("next_tool_option_group_1");
d->actionNextToolOptionGroup1->setText (i18n ("Next Tool Option (Group #1)"));
d->actionNextToolOptionGroup1->setShortcuts (kpTool::shortcutForKey (Qt::Key_2));
ac->setDefaultShortcuts (d->actionNextToolOptionGroup1, kpTool::shortcutForKey (Qt::Key_2));
connect (d->actionNextToolOptionGroup1, SIGNAL (triggered (bool)),
SLOT (slotActionNextToolOptionGroup1 ()));
d->actionPrevToolOptionGroup2 = ac->addAction ("prev_tool_option_group_2");
d->actionPrevToolOptionGroup2->setText (i18n ("Previous Tool Option (Group #2)"));
d->actionPrevToolOptionGroup2->setShortcuts (kpTool::shortcutForKey (Qt::Key_3));
ac->setDefaultShortcuts (d->actionPrevToolOptionGroup2, kpTool::shortcutForKey (Qt::Key_3));
connect (d->actionPrevToolOptionGroup2, SIGNAL (triggered (bool)),
SLOT (slotActionPrevToolOptionGroup2 ()));
d->actionNextToolOptionGroup2 = ac->addAction ("next_tool_option_group_2");
d->actionNextToolOptionGroup2->setText (i18n ("Next Tool Option (Group #2)"));
d->actionNextToolOptionGroup2->setShortcuts (kpTool::shortcutForKey (Qt::Key_4));
ac->setDefaultShortcuts (d->actionNextToolOptionGroup2, kpTool::shortcutForKey (Qt::Key_4));
connect (d->actionNextToolOptionGroup2, SIGNAL (triggered (bool)),
SLOT (slotActionNextToolOptionGroup2 ()));
......
......@@ -71,7 +71,7 @@ void kpMainWindow::setupViewMenuActions ()
d->actionShowGrid = ac->add <KToggleAction> ("view_show_grid");
d->actionShowGrid->setText (i18n ("Show &Grid"));
d->actionShowGrid->setShortcut (Qt::CTRL + Qt::Key_G);
ac->setDefaultShortcut (d->actionShowGrid, Qt::CTRL + Qt::Key_G);
//d->actionShowGrid->setCheckedState (KGuiItem(i18n ("Hide &Grid")));
connect (d->actionShowGrid, SIGNAL (triggered (bool)),
SLOT (slotShowGridToggled ()));
......
......@@ -70,7 +70,7 @@ void kpMainWindow::setupViewMenuThumbnailActions ()
// TODO: This doesn't work when the thumbnail has focus.
// Testcase: Press CTRL+H twice on a fresh KolourPaint.
// The second CTRL+H doesn't close the thumbnail.
d->actionShowThumbnail->setShortcut (Qt::CTRL + Qt::Key_H);
ac->setDefaultShortcut (d->actionShowThumbnail, Qt::CTRL + Qt::Key_H);
//d->actionShowThumbnail->setCheckedState (KGuiItem(i18n ("Hide T&humbnail")));
connect (d->actionShowThumbnail, SIGNAL (triggered (bool)),
SLOT (slotShowThumbnailToggled ()));
......
......@@ -39,7 +39,7 @@ kpToolAction::kpToolAction(const QString &text,
KActionCollection *ac, const QString &name)
: KToggleAction(QIcon::fromTheme(pic), text, ac)
{
KToggleAction::setShortcuts(shortcut);
ac->setDefaultShortcuts(this, shortcut);
if ( receiver && slot )
connect(this, SIGNAL(triggered(bool)), receiver, slot);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment