Skip to content

Commit 59ed834

Browse files
Copilotxusheng6
andcommitted
Register TTD widget actions before adding them to menus
Co-authored-by: xusheng6 <[email protected]>
1 parent 767c106 commit 59ed834

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ui/ttdcallswidget.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,23 @@ void TTDCallsQueryWidget::setupUIActions()
165165
m_menu = new Menu();
166166

167167
// Add Copy action with Ctrl+C support
168+
UIAction::registerAction("Copy");
168169
m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL);
169170
m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return canCopy(); }));
170171

172+
UIAction::registerAction("Copy Row");
171173
m_menu->addAction("Copy Row", "Options", MENU_ORDER_NORMAL);
172174
m_actionHandler.bindAction("Copy Row", UIAction([&]() { copySelectedRow(); }, [&]() { return canCopy(); }));
173175

176+
UIAction::registerAction("Copy All");
174177
m_menu->addAction("Copy All", "Options", MENU_ORDER_NORMAL);
175178
m_actionHandler.bindAction("Copy All", UIAction([&]() { copyEntireTable(); }, [&]() { return m_resultsTable->rowCount() > 0; }));
176179

180+
UIAction::registerAction("Column Visibility...");
177181
m_menu->addAction("Column Visibility...", "Options", MENU_ORDER_NORMAL);
178182
m_actionHandler.bindAction("Column Visibility...", UIAction([&]() { showColumnVisibilityDialog(); }));
179183

184+
UIAction::registerAction("Reset Columns");
180185
m_menu->addAction("Reset Columns", "Options", MENU_ORDER_NORMAL);
181186
m_actionHandler.bindAction("Reset Columns", UIAction([&]() { resetColumnsToDefault(); }));
182187
}

ui/ttdmemorywidget.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,18 +273,23 @@ void TTDMemoryQueryWidget::setupUIActions()
273273
m_menu = new Menu();
274274

275275
// Add Copy action with Ctrl+C support
276+
UIAction::registerAction("Copy");
276277
m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL);
277278
m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return canCopy(); }));
278279

280+
UIAction::registerAction("Copy Row");
279281
m_menu->addAction("Copy Row", "Options", MENU_ORDER_NORMAL);
280282
m_actionHandler.bindAction("Copy Row", UIAction([&]() { copySelectedRow(); }, [&]() { return canCopy(); }));
281283

284+
UIAction::registerAction("Copy Table");
282285
m_menu->addAction("Copy Table", "Options", MENU_ORDER_NORMAL);
283286
m_actionHandler.bindAction("Copy Table", UIAction([&]() { copyEntireTable(); }, [&]() { return m_resultsTable->rowCount() > 0; }));
284287

288+
UIAction::registerAction("Columns...");
285289
m_menu->addAction("Columns...", "Options", MENU_ORDER_NORMAL);
286290
m_actionHandler.bindAction("Columns...", UIAction([&]() { showColumnVisibilityDialog(); }));
287291

292+
UIAction::registerAction("Reset Columns to Default");
288293
m_menu->addAction("Reset Columns to Default", "Options", MENU_ORDER_NORMAL);
289294
m_actionHandler.bindAction("Reset Columns to Default", UIAction([&]() { resetColumnsToDefault(); }));
290295
}

0 commit comments

Comments
 (0)