Changeset View
Changeset View
Standalone View
Standalone View
src/kjotswidget.cpp
Show First 20 Lines • Show All 347 Lines • ▼ Show 20 Line(s) | 116 | { | |||
---|---|---|---|---|---|
348 | action->setText(i18nc("@action Paste the text in the clipboard without rich text formatting.", "Paste Plain Text")); | 348 | action->setText(i18nc("@action Paste the text in the clipboard without rich text formatting.", "Paste Plain Text")); | ||
349 | connect(action, &QAction::triggered, editor, &KJotsEdit::pastePlainText); | 349 | connect(action, &QAction::triggered, editor, &KJotsEdit::pastePlainText); | ||
350 | 350 | | |||
351 | KStandardAction::preferences(this, SLOT(configure()), actionCollection); | 351 | KStandardAction::preferences(this, SLOT(configure()), actionCollection); | ||
352 | 352 | | |||
353 | bookmarkMenu = actionCollection->add<KActionMenu>(QLatin1String("bookmarks")); | 353 | bookmarkMenu = actionCollection->add<KActionMenu>(QLatin1String("bookmarks")); | ||
354 | bookmarkMenu->setText(i18n("&Bookmarks")); | 354 | bookmarkMenu->setText(i18n("&Bookmarks")); | ||
355 | KJotsBookmarks *bookmarks = new KJotsBookmarks(treeview); | 355 | KJotsBookmarks *bookmarks = new KJotsBookmarks(treeview); | ||
356 | /*KBookmarkMenu *bmm =*/ new KBookmarkMenu( | 356 | KBookmarkMenu *bmm = new KBookmarkMenu( | ||
357 | KBookmarkManager::managerForFile( | 357 | KBookmarkManager::managerForFile( | ||
358 | QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).first() + QStringLiteral("/kjots/bookmarks.xml"), | 358 | QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).first() + QStringLiteral("/kjots/bookmarks.xml"), | ||
359 | QStringLiteral("kjots")), | 359 | QStringLiteral("kjots")), | ||
360 | bookmarks, bookmarkMenu->menu(), actionCollection); | 360 | bookmarks, bookmarkMenu->menu()); | ||
361 | 361 | | |||
362 | // "Add bookmark" and "make text bold" actions have conflicting shortcuts (ctrl + b) | 362 | // "Add bookmark" and "make text bold" actions have conflicting shortcuts (ctrl + b) | ||
363 | // Make add_bookmark use ctrl+shift+b to resolve that. | 363 | // Make add_bookmark use ctrl+shift+b to resolve that. | ||
364 | QAction *bm_action = qobject_cast<QAction *>(actionCollection->action(QLatin1String("add_bookmark"))); | 364 | QAction *bm_action = bmm->addBookmarkAction(); | ||
365 | Q_ASSERT(bm_action); | 365 | actionCollection->addAction(QStringLiteral("add_bookmark"), bm_action); | ||
366 | bm_action->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_B); | 366 | actionCollection->setDefaultShortcut(bm_action, Qt::CTRL | Qt::SHIFT | Qt::Key_B); | ||
367 | actionCollection->addAction(QStringLiteral("edit_bookmark"), bmm->editBookmarksAction()); | ||||
368 | actionCollection->addAction(QStringLiteral("add_bookmarks_list"), bmm->bookmarkTabsAsFolderAction()); | ||||
369 | | ||||
367 | 370 | | |||
368 | KStandardAction::find(this, SLOT(onShowSearch()), actionCollection); | 371 | KStandardAction::find(this, SLOT(onShowSearch()), actionCollection); | ||
369 | action = KStandardAction::findNext(this, SLOT(onRepeatSearch()), actionCollection); | 372 | action = KStandardAction::findNext(this, SLOT(onRepeatSearch()), actionCollection); | ||
370 | action->setEnabled(false); | 373 | action->setEnabled(false); | ||
371 | KStandardAction::replace(this, SLOT(onShowReplace()), actionCollection); | 374 | KStandardAction::replace(this, SLOT(onShowReplace()), actionCollection); | ||
372 | 375 | | |||
373 | action = actionCollection->addAction(QLatin1String("save_to")); | 376 | action = actionCollection->addAction(QLatin1String("save_to")); | ||
374 | action->setText(i18n("Rename...")); | 377 | action->setText(i18n("Rename...")); | ||
▲ Show 20 Lines • Show All 1497 Lines • Show Last 20 Lines |