777 ui.actionNew->trigger(); |
778 ui.actionNew->trigger(); |
778 } |
779 } |
779 about(&mainWindow); |
780 about(&mainWindow); |
780 } |
781 } |
781 ); |
782 ); |
|
783 QObject::connect( |
|
784 ui.actionCopy, |
|
785 &QAction::triggered, |
|
786 [&]{ |
|
787 if (Model* model = currentModelBody(&ui, &documents)) { |
|
788 std::vector<int> selectedRows = rows(ui.modelListView->selectionModel()->selectedRows()); |
|
789 QString text; |
|
790 for (int row : selectedRows) { |
|
791 const std::size_t i = static_cast<std::size_t>(row); |
|
792 text += modelElementToString((*model)[i]); |
|
793 text += QStringLiteral("\r\n"); |
|
794 } |
|
795 app.clipboard()->setText(text); |
|
796 } |
|
797 }); |
782 mainWindow.tabifyDockWidget(ui.messageLogDock, ui.toolOptionsDock); |
798 mainWindow.tabifyDockWidget(ui.messageLogDock, ui.toolOptionsDock); |
783 mainWindow.restoreGeometry(setting<Setting::MainWindowGeometry>()); |
799 mainWindow.restoreGeometry(setting<Setting::MainWindowGeometry>()); |
784 mainWindow.restoreState(setting<Setting::MainWindowState>()); |
800 mainWindow.restoreState(setting<Setting::MainWindowState>()); |
785 // If a dock is made floating and the app is closed, the dock becomes invisible |
801 // If a dock is made floating and the app is closed, the dock becomes invisible |
786 // after the restoreState call. So we make them visible again here. |
802 // after the restoreState call. So we make them visible again here. |