~vcs-imports/gnote/master

« back to all changes in this revision

Viewing changes to src/searchnoteswidget.cpp

  • Committer: Aurimas Černius
  • Date: 2023-01-01 17:34:27 UTC
  • mto: This revision was merged to the branch mainline in revision 3665.
  • Revision ID: git-v1:2b042f6ee6962c5a6d13d15283b4def251d59050
Register to actions on embed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1366
1366
  notebooks::NotebookManager::prompt_delete_notebook(m_gnote, get_owning_window(), notebook);
1367
1367
}
1368
1368
 
 
1369
void SearchNotesWidget::embed(EmbeddableWidgetHost *h)
 
1370
{
 
1371
  EmbeddableWidget::embed(h);
 
1372
  if(auto win = dynamic_cast<MainWindow*>(host())) {
 
1373
    if(auto action = win->find_action("open-note")) {
 
1374
      action->signal_activate().connect([this](const Glib::VariantBase&) { on_open_note(); });
 
1375
    }
 
1376
    if(auto action = win->find_action("open-note-new-window")) {
 
1377
      action->signal_activate().connect([this](const Glib::VariantBase&) { on_open_note_new_window(); });
 
1378
    }
 
1379
    if(auto action = win->find_action("delete-note")) {
 
1380
      action->signal_activate().connect([this](const Glib::VariantBase&) { delete_selected_notes(); });
 
1381
    }
 
1382
  }
 
1383
}
 
1384
 
1369
1385
void SearchNotesWidget::foreground()
1370
1386
{
1371
1387
  EmbeddableWidget::foreground();