Commit d43fa937 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/kdegraphics/kolourpaint/; revision=621518
parent 9d80f022
......@@ -45,6 +45,7 @@
#include <kstandardshortcut.h>
#include <kstandardaction.h>
#include <ktoolbarpopupaction.h>
#include <kactioncollection.h>
#include <kpdefs.h>
#include <kpdocument.h>
......@@ -253,17 +254,15 @@ kpCommandHistoryBase::kpCommandHistoryBase (bool doReadConfig,
KActionCollection *ac)
: d (new kpCommandHistoryBasePrivate ())
{
m_actionUndo = new KToolBarPopupAction (undoActionText (),
QLatin1String ("undo"),
KStandardShortcut::shortcut (KStandardShortcut::Undo),
this, SLOT (undo ()),
ac, KStandardAction::name (KStandardAction::Undo));
m_actionRedo = new KToolBarPopupAction (redoActionText (),
QLatin1String ("redo"),
KStandardShortcut::shortcut (KStandardShortcut::Redo),
this, SLOT (redo ()),
ac, KStandardAction::name (KStandardAction::Redo));
m_actionUndo = new KToolBarPopupAction (KIcon ("undo"), undoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Undo), m_actionUndo);
m_actionUndo->setShortcuts (KStandardShortcut::shortcut (KStandardShortcut::Undo));
connect (m_actionUndo, SIGNAL(triggered(bool)), this, SLOT (undo ()));
m_actionRedo = new KToolBarPopupAction (KIcon ("redo"), redoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Redo), m_actionRedo);
m_actionRedo->setShortcuts (KStandardShortcut::shortcut (KStandardShortcut::Redo));
connect (m_actionRedo, SIGNAL(triggered(bool)), this, SLOT (redo ()));
m_actionUndo->setEnabled (false);
......
......@@ -41,7 +41,7 @@ kpToolAction::kpToolAction (const QString &text,
const QString &pic, const KShortcut &shortcut,
const QObject *receiver, const char *slot,
KActionCollection *ac, const QString &name)
: KToggleAction (KIcon (pic), text, ac, name)
: KToggleAction (KIcon (pic), text, ac)
{
#if DEBUG_KP_TOOL_ACTION
kDebug () << "kpToolAction<" << name << ">::kpToolAction(shortcut="
......@@ -54,6 +54,8 @@ kpToolAction::kpToolAction (const QString &text,
connect (this, SIGNAL (triggered (bool)), receiver, slot);
updateToolTip ();
ac->addAction (name, this);
}
kpToolAction::~kpToolAction ()
......
......@@ -57,7 +57,7 @@ class QSize;
class QStringList;
class QUrl;
class KAction;
class QAction;
class KFontAction;
class KFontSizeAction;
class KSelectAction;
......@@ -184,7 +184,7 @@ private slots:
void updateToolOptionPrevNextActionsEnabled ();
private:
kpTool *m_toolSpraycan, *m_toolBrush,
kpTool *m_toolSpraycan, *m_toolBrush,
*m_toolColorEraser, *m_toolColorPicker,
*m_toolCurve, *m_toolEllipse,
*m_toolEllipticalSelection, *m_toolEraser,
......@@ -198,7 +198,7 @@ private:
int m_lastToolNumber;
bool m_toolActionsEnabled;
KAction *m_actionPrevToolOptionGroup1,
QAction *m_actionPrevToolOptionGroup1,
*m_actionNextToolOptionGroup1,
*m_actionPrevToolOptionGroup2,
*m_actionNextToolOptionGroup2;
......@@ -282,9 +282,9 @@ private:
void setupFileMenuActions ();
void enableFileMenuDocumentActions (bool enable = true);
KAction *m_actionNew, *m_actionOpen;
QAction *m_actionNew, *m_actionOpen;
KRecentFilesAction *m_actionOpenRecent;
KAction *m_actionSave, *m_actionSaveAs, *m_actionExport,
QAction *m_actionSave, *m_actionSaveAs, *m_actionExport,
*m_actionReload,
*m_actionPrint, *m_actionPrintPreview,
*m_actionMail,
......@@ -372,7 +372,7 @@ private:
bool m_editMenuDocumentActionsEnabled;
KAction *m_actionUndo, *m_actionRedo,
QAction *m_actionUndo, *m_actionRedo,
*m_actionCut, *m_actionCopy,
*m_actionPaste, *m_actionPasteInNewWindow,
*m_actionDelete,
......@@ -437,7 +437,7 @@ private:
void enableViewMenuDocumentActions (bool enable = true);
void actionShowGridUpdate ();
KAction *m_actionActualSize,
QAction *m_actionActualSize,
*m_actionFitToPage, *m_actionFitToWidth, *m_actionFitToHeight,
*m_actionZoomIn, *m_actionZoomOut;
KSelectAction *m_actionZoom;
......@@ -464,14 +464,14 @@ private slots:
public:
void zoomIn (bool centerUnderCursor = false);
void zoomOut (bool centerUnderCursor = false);
public slots:
void slotZoomIn ();
void slotZoomOut ();
private:
void zoomAccordingToZoomAction (bool centerUnderCursor = false);
private slots:
void slotZoom ();
......@@ -525,7 +525,7 @@ private:
bool m_imageMenuDocumentActionsEnabled;
KAction *m_actionResizeScale,
QAction *m_actionResizeScale,
*m_actionCrop, *m_actionAutoCrop,
*m_actionFlip, *m_actionRotate, *m_actionSkew,
*m_actionConvertToBlackAndWhite, *m_actionConvertToGrayscale,
......@@ -570,7 +570,7 @@ private:
void enableSettingsMenuDocumentActions (bool enable = true);
KToggleAction *m_actionShowPath;
KAction *m_actionKeyBindings, *m_actionConfigureToolbars, *m_actionConfigure;
QAction *m_actionKeyBindings, *m_actionConfigureToolbars, *m_actionConfigure;
KToggleFullScreenAction *m_actionFullScreen;
private slots:
......
......@@ -42,6 +42,7 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <kstandardaction.h>
#include <kactioncollection.h>
#include <kxmlguifactory.h>
#include <kpcommandhistory.h>
......@@ -110,21 +111,25 @@ void kpMainWindow::setupEditMenuActions ()
m_actionCut = KStandardAction::cut (this, SLOT (slotCut ()), ac);
m_actionCopy = KStandardAction::copy (this, SLOT (slotCopy ()), ac);
m_actionPaste = KStandardAction::paste (this, SLOT (slotPaste ()), ac);
m_actionPasteInNewWindow = new KAction(i18n ("Paste in &New Window"), ac, "edit_paste_in_new_window");
m_actionPasteInNewWindow = ac->addAction ("edit_paste_in_new_window");
m_actionPasteInNewWindow->setText (i18n ("Paste in &New Window"));
connect(m_actionPasteInNewWindow, SIGNAL(triggered(bool) ), SLOT (slotPasteInNewWindow ()));
m_actionPasteInNewWindow->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_V);
//m_actionDelete = KStandardAction::clear (this, SLOT (slotDelete ()), ac);
m_actionDelete = new KAction(i18n ("&Delete Selection"), ac, "edit_clear");
m_actionDelete = ac->addAction ("edit_clear");
m_actionDelete->setText (i18n ("&Delete Selection"));
connect(m_actionDelete, SIGNAL(triggered(bool) ), SLOT (slotDelete ()));
m_actionSelectAll = KStandardAction::selectAll (this, SLOT (slotSelectAll ()), ac);
m_actionDeselect = KStandardAction::deselect (this, SLOT (slotDeselect ()), ac);
m_actionCopyToFile = new KAction(i18n ("C&opy to File..."), ac, "edit_copy_to_file");
m_actionCopyToFile = ac->addAction ("edit_copy_to_file");
m_actionCopyToFile->setText (i18n ("C&opy to File..."));
connect(m_actionCopyToFile, SIGNAL(triggered(bool) ), SLOT (slotCopyToFile ()));
m_actionPasteFromFile = new KAction(i18n ("Paste &From File..."), ac, "edit_paste_from_file");
m_actionPasteFromFile = ac->addAction ("edit_paste_from_file");
m_actionPasteFromFile->setText (i18n ("Paste &From File..."));
connect(m_actionPasteFromFile, SIGNAL(triggered(bool) ), SLOT (slotPasteFromFile ()));
......
......@@ -37,6 +37,7 @@
#include <kapplication.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kfiledialog.h>
......@@ -74,13 +75,15 @@ void kpMainWindow::setupFileMenuActions ()
m_actionSave = KStandardAction::save (this, SLOT (slotSave ()), ac);
m_actionSaveAs = KStandardAction::saveAs (this, SLOT (slotSaveAs ()), ac);
m_actionExport = new KAction(i18n ("E&xport..."), ac, "file_export");
m_actionExport = ac->addAction("file_export");
m_actionExport->setText (i18n ("E&xport..."));
connect(m_actionExport, SIGNAL(triggered(bool) ), SLOT (slotExport ()));
//m_actionRevert = KStandardAction::revert (this, SLOT (slotRevert ()), ac);
m_actionReload = new KAction(i18n ("Reloa&d"), ac, "file_revert");
m_actionReload = ac->addAction ("file_revert");
m_actionReload->setText (i18n ("Reloa&d"));
connect(m_actionReload, SIGNAL(triggered(bool) ), SLOT (slotReload ()));
m_actionReload->setShortcut(KStandardShortcut::reload ());
m_actionReload->setShortcuts(KStandardShortcut::reload ());
slotEnableReload ();
m_actionPrint = KStandardAction::print (this, SLOT (slotPrint ()), ac);
......@@ -88,9 +91,11 @@ void kpMainWindow::setupFileMenuActions ()
m_actionMail = KStandardAction::mail (this, SLOT (slotMail ()), ac);
m_actionSetAsWallpaperCentered = new KAction(i18n ("Set as Wa&llpaper (Centered)"), ac, "file_set_as_wallpaper_centered");
m_actionSetAsWallpaperCentered = ac->addAction ("file_set_as_wallpaper_centered");
m_actionSetAsWallpaperCentered->setText (i18n ("Set as Wa&llpaper (Centered)"));
connect(m_actionSetAsWallpaperCentered, SIGNAL(triggered(bool) ), SLOT (slotSetAsWallpaperCentered ()));
m_actionSetAsWallpaperTiled = new KAction(i18n ("Set as Wallpaper (&Tiled)"), ac, "file_set_as_wallpaper_tiled");
m_actionSetAsWallpaperTiled = ac->addAction ("file_set_as_wallpaper_tiled");
m_actionSetAsWallpaperTiled->setText (i18n ("Set as Wallpaper (&Tiled)"));
connect(m_actionSetAsWallpaperTiled, SIGNAL(triggered(bool) ), SLOT (slotSetAsWallpaperTiled ()));
m_actionClose = KStandardAction::close (this, SLOT (slotClose ()), ac);
......
......@@ -31,6 +31,7 @@
#include <QtDBus>
#include <kaction.h>
#include <kactioncollection.h>
#include <qlabel.h>
#include <kconfig.h>
#include <kdebug.h>
......@@ -54,8 +55,8 @@ void kpMainWindow::setupHelpMenuActions ()
// from a digital camera in future versions of KolourPaint. Hence
// "Acquiring" is more appropriate.
// -- Thurston
d->m_actionHelpTakingScreenshots = new KAction (i18n ("Acquiring &Screenshots"),
ac, "help_taking_screenshots");
d->m_actionHelpTakingScreenshots = ac->addAction ("help_taking_screenshots");
d->m_actionHelpTakingScreenshots->setText (i18n ("Acquiring &Screenshots"));
connect (d->m_actionHelpTakingScreenshots, SIGNAL (triggered (bool)),
SLOT (slotHelpTakingScreenshots ()));
......@@ -184,8 +185,8 @@ void kpMainWindow::slotHelpTakingScreenshots ()
QLabel *messageLabel = new QLabel (message, &dlg);
messageLabel->setOpenExternalLinks(true);
#ifdef __GNUC__
#warning "not define into qlabel"
#endif
#warning "not define into qlabel"
#endif
//messageLabel->setNotifyClick (true); // Fire urlClick() signal.
connect (messageLabel, SIGNAL (urlClick (const QString &)),
this, SLOT (slotHelpTakingScreenshotsFollowLink (const QString &)));
......
......@@ -33,6 +33,7 @@
#include <qsize.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
......@@ -94,53 +95,66 @@ void kpMainWindow::setupImageMenuActions ()
{
KActionCollection *ac = actionCollection ();
m_actionResizeScale = new KAction(i18n ("R&esize / Scale..."), ac, "image_resize_scale");
m_actionResizeScale = ac->addAction ("image_resize_scale");
m_actionResizeScale->setText (i18n ("R&esize / Scale..."));
connect(m_actionResizeScale, SIGNAL(triggered(bool) ), SLOT (slotResizeScale ()));
m_actionResizeScale->setShortcut(Qt::CTRL + Qt::Key_E);
m_actionCrop = new KAction(i18n ("Se&t as Image (Crop)"), ac, "image_crop");
m_actionCrop = ac->addAction ("image_crop");
m_actionCrop->setText (i18n ("Se&t as Image (Crop)"));
connect(m_actionCrop, SIGNAL(triggered(bool) ), SLOT (slotCrop ()));
m_actionCrop->setShortcut(Qt::CTRL + Qt::Key_T);
m_actionAutoCrop = new KAction(autoCropText (), ac, "image_auto_crop");
m_actionAutoCrop = ac->addAction ("image_auto_crop");
m_actionAutoCrop->setText (autoCropText ());
connect(m_actionAutoCrop, SIGNAL(triggered(bool) ), SLOT (slotAutoCrop ()));
m_actionAutoCrop->setShortcut(Qt::CTRL + Qt::Key_U);
m_actionFlip = new KAction(i18n ("&Flip..."), ac, "image_flip");
m_actionFlip = ac->addAction ("image_flip");
m_actionFlip->setText (i18n ("&Flip..."));
connect(m_actionFlip, SIGNAL(triggered(bool) ), SLOT (slotFlip ()));
m_actionFlip->setShortcut(Qt::CTRL + Qt::Key_F);
m_actionRotate = new KAction(i18n ("&Rotate..."), ac, "image_rotate");
m_actionRotate = ac->addAction ("image_rotate");
m_actionRotate->setText (i18n ("&Rotate..."));
connect(m_actionRotate, SIGNAL(triggered(bool) ), SLOT (slotRotate ()));
m_actionRotate->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_R);
m_actionRotate = new KAction(i18n ("Rotate 90 Degrees Counterclockwise"), ac, "image_rotate_270deg");
m_actionRotate = ac->addAction ("image_rotate_270deg");
m_actionRotate->setText (i18n ("Rotate 90 Degrees Counterclockwise"));
connect(m_actionRotate, SIGNAL(triggered(bool) ), SLOT (slotRotate270 ()));
m_actionRotate->setShortcut(Qt::CTRL + Qt::Key_L);
m_actionRotate = new KAction(i18n ("Rotate 90 Degrees Clockwise"), ac, "image_rotate_90deg");
m_actionRotate = ac->addAction ("image_rotate_90deg");
m_actionRotate->setText (i18n ("Rotate 90 Degrees Clockwise"));
connect(m_actionRotate, SIGNAL(triggered(bool) ), SLOT (slotRotate90 ()));
m_actionRotate->setShortcut(Qt::CTRL + Qt::Key_R);
m_actionSkew = new KAction(i18n ("S&kew..."), ac, "image_skew");
m_actionSkew = ac->addAction ("image_skew");
m_actionSkew->setText (i18n ("S&kew..."));
connect(m_actionSkew, SIGNAL(triggered(bool) ), SLOT (slotSkew ()));
m_actionSkew->setShortcut(Qt::CTRL + Qt::Key_K);
m_actionConvertToBlackAndWhite = new KAction(i18n ("Reduce to Mo&nochrome (Dithered)"), ac, "image_convert_to_black_and_white");
m_actionConvertToBlackAndWhite = ac->addAction ("image_convert_to_black_and_white");
m_actionConvertToBlackAndWhite->setText (i18n ("Reduce to Mo&nochrome (Dithered)"));
connect(m_actionConvertToBlackAndWhite, SIGNAL(triggered(bool) ), SLOT (slotConvertToBlackAndWhite ()));
m_actionConvertToGrayscale = new KAction(i18n ("Reduce to &Grayscale"), ac, "image_convert_to_grayscale");
m_actionConvertToGrayscale = ac->addAction ("image_convert_to_grayscale");
m_actionConvertToGrayscale->setText (i18n ("Reduce to &Grayscale"));
connect(m_actionConvertToGrayscale, SIGNAL(triggered(bool) ), SLOT (slotConvertToGrayscale ()));
m_actionInvertColors = new KAction(i18n ("&Invert Colors"), ac, "image_invert_colors");
m_actionInvertColors = ac->addAction ("image_invert_colors");
m_actionInvertColors->setText (i18n ("&Invert Colors"));
connect(m_actionInvertColors, SIGNAL(triggered(bool) ), SLOT (slotInvertColors ()));
m_actionInvertColors->setShortcut(Qt::CTRL + Qt::Key_I);
m_actionClear = new KAction(i18n ("C&lear"), ac, "image_clear");
m_actionClear = ac->addAction ("image_clear");
m_actionClear->setText (i18n ("C&lear"));
connect(m_actionClear, SIGNAL(triggered(bool) ), SLOT (slotClear ()));
m_actionClear->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_N);
m_actionMoreEffects = new KAction(i18n ("&More Effects..."), ac, "image_more_effects");
m_actionMoreEffects = ac->addAction ("image_more_effects");
m_actionMoreEffects->setText (i18n ("&More Effects..."));
connect(m_actionMoreEffects, SIGNAL(triggered(bool) ), SLOT (slotMoreEffects ()));
m_actionMoreEffects->setShortcut(Qt::CTRL + Qt::Key_M);
......
......@@ -32,7 +32,7 @@
class QActionGroup;
class KAction;
class QAction;
class KToggleAction;
......@@ -46,7 +46,7 @@ struct kpMainWindowPrivate
bool m_configThumbnailShowRectangle;
KToggleAction *m_actionShowThumbnailRectangle;
KAction *m_actionHelpTakingScreenshots;
QAction *m_actionHelpTakingScreenshots;
int m_moreEffectsDialogLastEffect;
bool m_resizeScaleDialogLastKeepAspect;
......
......@@ -38,6 +38,7 @@
#include <kmessagebox.h>
#include <kstandardaction.h>
#include <ktogglefullscreenaction.h>
#include <kactioncollection.h>
#include <kpdefs.h>
#include <kpdocument.h>
......@@ -58,11 +59,12 @@ void kpMainWindow::setupSettingsMenuActions ()
createStandardStatusBarAction ();
m_actionFullScreen = KStandardAction::fullScreen (this, SLOT (slotFullScreen ()), ac,
this/*window*/);
m_actionFullScreen = KStandardAction::fullScreen (this, SLOT (slotFullScreen ()),
this/*window*/, ac);
m_actionShowPath = new KToggleAction(i18n ("Show &Path"), ac, "settings_show_path");
m_actionShowPath = ac->add<KToggleAction> ("settings_show_path");
m_actionShowPath->setText (i18n ("Show &Path"));
connect(m_actionShowPath, SIGNAL(triggered(bool) ), SLOT (slotShowPathToggled ()));
m_actionShowPath->setCheckedState (KGuiItem(i18n ("Hide &Path")));
slotEnableSettingsShowPath ();
......
......@@ -37,6 +37,7 @@
#include <kicon.h>
#include <klocale.h>
#include <ktoggleaction.h>
#include <kactioncollection.h>
#include <kpcolortoolbar.h>
#include <kpdefs.h>
......@@ -52,28 +53,37 @@ void kpMainWindow::setupTextToolBarActions ()
{
KActionCollection *ac = actionCollection ();
m_actionTextFontFamily = new KFontAction (i18n ("Font Family"), KShortcut(),
this, SLOT (slotTextFontFamilyChanged ()), ac, "text_font_family");
m_actionTextFontSize = new KFontSizeAction (i18n ("Font Size"), KShortcut(),
this, SLOT (slotTextFontSizeChanged ()), ac, "text_font_size");
m_actionTextFontFamily = ac->add<KFontAction> ("text_font_family");
m_actionTextFontFamily->setText (i18n ("Font Family"));
connect (m_actionTextFontFamily, SIGNAL(triggered (int)),
this, SLOT (slotTextFontFamilyChanged ()));
m_actionTextBold = new KToggleAction (KIcon ("text_bold"),
i18n ("Bold"), ac, "text_bold");
m_actionTextFontSize = ac->add<KFontSizeAction> ("text_font_size");
m_actionTextFontSize->setText (i18n ("Font Size"));
connect (m_actionTextFontSize, SIGNAL(fontSizeChanged (int)),
this, SLOT (slotTextFontSizeChanged ()));
m_actionTextBold = ac->add<KToggleAction> ("text_bold");
m_actionTextBold->setIcon (KIcon ("text_bold"));
m_actionTextBold->setText (i18n ("Bold"));
connect (m_actionTextBold, SIGNAL (triggered (bool)),
SLOT (slotTextBoldChanged ()));
m_actionTextItalic = new KToggleAction (KIcon ("text_italic"),
i18n ("Italic"), ac, "text_italic");
m_actionTextItalic = ac->add<KToggleAction> ("text_italic");
m_actionTextItalic->setIcon (KIcon ("text_italic"));
m_actionTextItalic->setText (i18n ("Italic"));
connect (m_actionTextItalic, SIGNAL (triggered (bool)),
SLOT (slotTextItalicChanged ()));
m_actionTextUnderline = new KToggleAction (KIcon ("text_under"),
i18n ("Underline"), ac, "text_underline");
m_actionTextUnderline = ac->add<KToggleAction> ("text_underline");
m_actionTextUnderline->setIcon (KIcon ("text_under"));
m_actionTextUnderline->setText (i18n ("Underline"));
connect (m_actionTextUnderline, SIGNAL (triggered (bool)),
SLOT (slotTextUnderlineChanged ()));
m_actionTextStrikeThru = new KToggleAction (KIcon ("text_strike"),
i18n ("Strike Through"), ac, "text_strike_thru");
m_actionTextStrikeThru = ac->add<KToggleAction> ("text_strike_thru");
m_actionTextStrikeThru->setIcon (KIcon ("text_strike"));
m_actionTextStrikeThru->setText (i18n ("Strike Through"));
connect (m_actionTextStrikeThru, SIGNAL (triggered (bool)),
SLOT (slotTextStrikeThruChanged ()));
......
......@@ -33,6 +33,7 @@
#include <qlist.h>
#include <kapplication.h>
#include <kactioncollection.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kglobal.h>
......@@ -103,31 +104,27 @@ void kpMainWindow::setupToolActions ()
KActionCollection *ac = actionCollection ();
m_actionPrevToolOptionGroup1 = new KAction (
i18n ("Previous Tool Option (Group #1)"),
ac, "prev_tool_option_group_1");
m_actionPrevToolOptionGroup1->setShortcut (kpTool::shortcutForKey (Qt::Key_1));
m_actionPrevToolOptionGroup1 = ac->addAction ("prev_tool_option_group_1");
m_actionPrevToolOptionGroup1->setText (i18n ("Previous Tool Option (Group #1)"));
m_actionPrevToolOptionGroup1->setShortcuts (kpTool::shortcutForKey (Qt::Key_1));
connect (m_actionPrevToolOptionGroup1, SIGNAL (triggered (bool)),
SLOT (slotActionPrevToolOptionGroup1 ()));
m_actionNextToolOptionGroup1 = new KAction (
i18n ("Next Tool Option (Group #1)"),
ac, "next_tool_option_group_1");
m_actionNextToolOptionGroup1->setShortcut (kpTool::shortcutForKey (Qt::Key_2));
m_actionNextToolOptionGroup1 = ac->addAction ("next_tool_option_group_1");
m_actionNextToolOptionGroup1->setText (i18n ("Next Tool Option (Group #1)"));
m_actionNextToolOptionGroup1->setShortcuts (kpTool::shortcutForKey (Qt::Key_2));
connect (m_actionNextToolOptionGroup1, SIGNAL (triggered (bool)),
SLOT (slotActionNextToolOptionGroup1 ()));
m_actionPrevToolOptionGroup2 = new KAction (
i18n ("Previous Tool Option (Group #2)"),
ac, "prev_tool_option_group_2");
m_actionPrevToolOptionGroup2->setShortcut (kpTool::shortcutForKey (Qt::Key_3));
m_actionPrevToolOptionGroup2 = ac->addAction ("prev_tool_option_group_2");
m_actionPrevToolOptionGroup2->setText (i18n ("Previous Tool Option (Group #2)"));
m_actionPrevToolOptionGroup2->setShortcuts (kpTool::shortcutForKey (Qt::Key_3));
connect (m_actionPrevToolOptionGroup2, SIGNAL (triggered (bool)),
SLOT (slotActionPrevToolOptionGroup2 ()));
m_actionNextToolOptionGroup2 = new KAction (
i18n ("Next Tool Option (Group #2)"),
ac, "next_tool_option_group_2");
m_actionNextToolOptionGroup2->setShortcut (kpTool::shortcutForKey (Qt::Key_4));
m_actionNextToolOptionGroup2 = ac->addAction ("next_tool_option_group_2");
m_actionNextToolOptionGroup2->setText (i18n ("Next Tool Option (Group #2)"));
m_actionNextToolOptionGroup2->setShortcuts (kpTool::shortcutForKey (Qt::Key_4));
connect (m_actionNextToolOptionGroup2, SIGNAL (triggered (bool)),
SLOT (slotActionNextToolOptionGroup2 ()));
}
......
......@@ -41,6 +41,7 @@
#include <kselectaction.h>
#include <kstandardaction.h>
#include <ktoggleaction.h>
#include <kactioncollection.h>
#include <kpdefs.h>
#include <kpdocument.h>
......@@ -79,8 +80,8 @@ void kpMainWindow::setupViewMenuActions ()
m_actionZoomOut = KStandardAction::zoomOut (this, SLOT (slotZoomOut ()), ac);
m_actionZoom = new KSelectAction (
i18n ("&Zoom"), actionCollection (), "view_zoom_to");
m_actionZoom = actionCollection()->add<KSelectAction> ("view_zoom_to");
m_actionZoom->setText (i18n ("&Zoom"));
connect (m_actionZoom, SIGNAL (triggered (QAction *)), SLOT (slotZoom ()));
m_actionZoom->setEditable (true);
......@@ -93,25 +94,24 @@ void kpMainWindow::setupViewMenuActions ()
m_zoomList.append (1000); m_zoomList.append (1200); m_zoomList.append (1600);
m_actionShowGrid = new KToggleAction (i18n ("Show &Grid"),
actionCollection (), "view_show_grid");
m_actionShowGrid = actionCollection()->add<KToggleAction> ("view_show_grid");
m_actionShowGrid->setText (i18n ("Show &Grid"));
m_actionShowGrid->setShortcut (Qt::CTRL + Qt::Key_G);
m_actionShowGrid->setCheckedState (KGuiItem(i18n ("Hide &Grid")));
connect (m_actionShowGrid, SIGNAL (triggered (bool)),
SLOT (slotShowGridToggled ()));
m_actionShowThumbnail = new KToggleAction (i18n ("Show T&humbnail"),
actionCollection (), "view_show_thumbnail");
m_actionShowThumbnail = actionCollection()->add<KToggleAction> ("view_show_thumbnail");
m_actionShowThumbnail->setText (i18n ("Show T&humbnail"));
m_actionShowThumbnail->setShortcut (Qt::CTRL + Qt::Key_H);
m_actionShowThumbnail->setCheckedState (KGuiItem(i18n ("Hide T&humbnail")));
connect (m_actionShowThumbnail, SIGNAL (triggered (bool)),
SLOT (slotShowThumbnailToggled ()));
// Please do not use setCheckedState() here - it wouldn't make sense
m_actionZoomedThumbnail = new KToggleAction (
i18n ("Zoo&med Thumbnail Mode"),
actionCollection (), "view_zoomed_thumbnail");
m_actionZoomedThumbnail = actionCollection()->add<KToggleAction> ("view_zoomed_thumbnail");
m_actionZoomedThumbnail->setText (i18n ("Zoo&med Thumbnail Mode"));
connect (m_actionZoomedThumbnail, SIGNAL (triggered (bool)),
SLOT (slotZoomedThumbnailToggled ()));
......@@ -120,8 +120,8 @@ void kpMainWindow::setupViewMenuActions ()
// Also, don't use "Show Thumbnail Rectangle" because if entire doc
// can be seen in scrollView, checking option won't "Show" anything
// since rect _surrounds_ entire doc (hence, won't be rendered).
d->m_actionShowThumbnailRectangle = new KToggleAction ( i18n ("Enable Thumbnail &Rectangle"),
actionCollection (), "view_show_thumbnail_rectangle");
d->m_actionShowThumbnailRectangle = actionCollection()->add<KToggleAction> ("view_show_thumbnail_rectangle");
d->m_actionShowThumbnailRectangle->setText (i18n ("Enable Thumbnail &Rectangle"));
connect (d->m_actionShowThumbnailRectangle, SIGNAL (triggered (bool)),
SLOT (slotThumbnailShowRectangleToggled ()));
......@@ -290,7 +290,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor)
m_actionZoom->setCurrentItem (index);
#if DEBUG_KP_MAIN_WINDOW
kDebug () << "\tcurrentItem="
<< m_actionZoom->currentItem ()
<< m_actionZoom->currentItem ()
<< " action="
<< m_actionZoom->action (m_actionZoom->currentItem ())
<< " checkedAction"
......@@ -782,7 +782,7 @@ void kpMainWindow::zoomAccordingToZoomAction (bool centerUnderCursor)
// This might be a new zoom level the user has typed in.
zoomTo (zoomLevelFromString (m_actionZoom->currentText ()),
centerUnderCursor);
centerUnderCursor);
}
// private 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