331 lines
19 KiB
HTML
331 lines
19 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.13.2"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>musredit: PReplaceConfirmationDialog Class Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">musredit<span id="projectnumber"> 1.0.0</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.13.2 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search',false);
|
|
$(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){ initResizable(false); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div><!-- top -->
|
|
<div id="doc-content">
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classPReplaceConfirmationDialog-members.html">List of all members</a> </div>
|
|
<div class="headertitle"><div class="title">PReplaceConfirmationDialog Class Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Confirmation dialog for interactive find-and-replace operations.
|
|
<a href="#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="PReplaceConfirmationDialog_8h_source.html">PReplaceConfirmationDialog.h</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for PReplaceConfirmationDialog:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classPReplaceConfirmationDialog__inherit__graph.png" border="0" usemap="#aPReplaceConfirmationDialog_inherit__map" alt="Inheritance graph"/></div>
|
|
<map name="aPReplaceConfirmationDialog_inherit__map" id="aPReplaceConfirmationDialog_inherit__map">
|
|
<area shape="rect" title="Confirmation dialog for interactive find-and-replace operations." alt="" coords="16,98,212,126"/>
|
|
<area shape="rect" title=" " alt="" coords="5,14,76,42"/>
|
|
<area shape="poly" title=" " alt="" coords="64,52,104,96,100,99,60,55"/>
|
|
<area shape="rect" title=" " alt="" coords="100,5,275,50"/>
|
|
<area shape="poly" title=" " alt="" coords="160,63,128,99,124,96,156,60"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<div class="dynheader">
|
|
Collaboration diagram for PReplaceConfirmationDialog:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classPReplaceConfirmationDialog__coll__graph.png" border="0" usemap="#aPReplaceConfirmationDialog_coll__map" alt="Collaboration graph"/></div>
|
|
<map name="aPReplaceConfirmationDialog_coll__map" id="aPReplaceConfirmationDialog_coll__map">
|
|
<area shape="rect" title="Confirmation dialog for interactive find-and-replace operations." alt="" coords="16,98,212,126"/>
|
|
<area shape="rect" title=" " alt="" coords="5,14,76,42"/>
|
|
<area shape="poly" title=" " alt="" coords="64,52,104,96,100,99,60,55"/>
|
|
<area shape="rect" title=" " alt="" coords="100,5,275,50"/>
|
|
<area shape="poly" title=" " alt="" coords="160,63,128,99,124,96,156,60"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:ac1d6edf773d613bc4d9334b2955b5277" id="r_ac1d6edf773d613bc4d9334b2955b5277"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ac1d6edf773d613bc4d9334b2955b5277">PReplaceConfirmationDialog</a> (QWidget *parent=nullptr)</td></tr>
|
|
<tr class="memdesc:ac1d6edf773d613bc4d9334b2955b5277"><td class="mdescLeft"> </td><td class="mdescRight">Constructs the replace confirmation dialog. <br /></td></tr>
|
|
<tr class="separator:ac1d6edf773d613bc4d9334b2955b5277"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8bbe278dd405f742ce86e9a071756ce7" id="r_a8bbe278dd405f742ce86e9a071756ce7"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="#a8bbe278dd405f742ce86e9a071756ce7">~PReplaceConfirmationDialog</a> ()</td></tr>
|
|
<tr class="memdesc:a8bbe278dd405f742ce86e9a071756ce7"><td class="mdescLeft"> </td><td class="mdescRight">Virtual destructor. <br /></td></tr>
|
|
<tr class="separator:a8bbe278dd405f742ce86e9a071756ce7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Confirmation dialog for interactive find-and-replace operations. </p>
|
|
<p>This dialog provides user control over individual replacement operations during interactive find-and-replace sessions in musredit. When the user performs a "Replace" (as opposed to "Replace All") operation, this dialog appears for each match, allowing fine-grained control over which instances should be replaced.</p>
|
|
<dl class="section user"><dt>Dialog Purpose:</dt><dd>The dialog serves as an interactive confirmation mechanism that prevents unintended replacements by giving users the opportunity to review each match before replacement occurs.</dd></dl>
|
|
<dl class="section user"><dt>Typical User Actions:</dt><dd>The dialog typically provides several options (exact buttons defined in UI):<ul>
|
|
<li><b>Replace</b>: Confirm this replacement and move to next match</li>
|
|
<li><b>Skip</b>: Leave this match unchanged and move to next match</li>
|
|
<li><b>Replace All</b>: Replace this and all remaining matches without further confirmation</li>
|
|
<li><b>Cancel/Close</b>: Abort the replace operation entirely</li>
|
|
</ul>
|
|
</dd></dl>
|
|
<dl class="section user"><dt>Usage Context:</dt><dd>This dialog is invoked during interactive find-and-replace workflows:<ol type="1">
|
|
<li>User opens Find/Replace dialog (Edit → Find/Replace)</li>
|
|
<li>User enters search term and replacement text</li>
|
|
<li>User clicks "Replace" button (not "Replace All")</li>
|
|
<li>Editor finds first match and shows context</li>
|
|
<li>This confirmation dialog appears</li>
|
|
<li>User makes decision (replace/skip/etc.)</li>
|
|
<li>Process repeats for next match until completion or cancellation</li>
|
|
</ol>
|
|
</dd></dl>
|
|
<dl class="section user"><dt>Dialog Behavior:</dt><dd><ul>
|
|
<li>Modal: Blocks interaction with main editor until decision is made</li>
|
|
<li>Non-resizable: Fixed size appropriate for decision buttons</li>
|
|
<li>Centered over parent: Appears centered on the editor window</li>
|
|
<li>Quick keyboard access: Buttons typically have keyboard shortcuts</li>
|
|
</ul>
|
|
</dd></dl>
|
|
<dl class="section user"><dt>Integration:</dt><dd>The dialog integrates with musredit's find-and-replace engine, which:<ul>
|
|
<li>Highlights the current match in the editor</li>
|
|
<li>Manages the search state across multiple matches</li>
|
|
<li>Executes the replacement based on user choice</li>
|
|
<li>Advances to the next match after each decision</li>
|
|
</ul>
|
|
</dd></dl>
|
|
<dl class="section note"><dt>Note</dt><dd>The dialog is modal, requiring explicit user action before continuing. </dd>
|
|
<dd>
|
|
Return values (via exec()) indicate the user's choice for action. </dd>
|
|
<dd>
|
|
The actual button configuration and return values are defined in the UI file and handled by the calling find-and-replace code.</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd>musredit For the <a class="el" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627" title="Main entry point for the musredit application.">main</a> text editor with find-and-replace functionality </dd>
|
|
<dd>
|
|
<a class="el" href="classPFindDialog.html" title="Dialog for searching text in the editor.">PFindDialog</a> For the primary find/replace dialog interface </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="PReplaceConfirmationDialog_8h_source.html#l00110">110</a> of file <a class="el" href="PReplaceConfirmationDialog_8h_source.html">PReplaceConfirmationDialog.h</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="ac1d6edf773d613bc4d9334b2955b5277" name="ac1d6edf773d613bc4d9334b2955b5277"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac1d6edf773d613bc4d9334b2955b5277">◆ </a></span>PReplaceConfirmationDialog()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">PReplaceConfirmationDialog::PReplaceConfirmationDialog </td>
|
|
<td>(</td>
|
|
<td class="paramtype">QWidget *</td> <td class="paramname"><span class="paramname"><em>parent</em></span><span class="paramdefsep"> = </span><span class="paramdefval">nullptr</span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Constructs the replace confirmation dialog. </p>
|
|
<p>Constructor - Initializes the replace confirmation dialog.</p>
|
|
<p>Initializes the dialog with a simple confirmation interface for find-and-replace operations. The dialog is configured as modal to ensure users make an explicit decision before continuing with the replacement process.</p>
|
|
<p>The constructor sets up the UI from the Qt Designer UI file and configures basic dialog properties. The actual button configuration, labels, and layout are defined in the UI file.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">parent</td><td>Pointer to the parent widget (typically the main editor window). If nullptr, the dialog has no parent. The parent-child relationship ensures:<ul>
|
|
<li>Proper dialog centering over the parent window</li>
|
|
<li>Automatic cleanup when parent is destroyed</li>
|
|
<li>Consistent styling and theme inheritance</li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section note"><dt>Note</dt><dd>The dialog is created but not shown by the constructor. The caller must invoke exec() to display it modally. </dd>
|
|
<dd>
|
|
Parent ownership is recommended to ensure proper cleanup and visual integration with the main application.</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd>exec() Qt method to display the dialog and wait for user response </dd>
|
|
<dd>
|
|
setupUi() Qt Designer generated UI initialization</dd></dl>
|
|
<p>Sets up a simple, focused dialog for confirming individual replacements during interactive find-and-replace operations. The initialization is minimal, establishing only the essential dialog configuration for user interaction.</p>
|
|
<p><b>Initialization Process:</b></p>
|
|
<ol type="1">
|
|
<li><b>Base Class Initialization</b>: Calls QDialog constructor with parent widget to establish proper parent-child relationship</li>
|
|
<li><b>UI Setup</b>: Loads the dialog layout, labels, and buttons from the Qt Designer UI file via setupUi(). The UI file defines:<ul>
|
|
<li>Dialog title and dimensions</li>
|
|
<li>Confirmation message text</li>
|
|
<li>Action buttons (Replace, Skip, Replace All, Cancel, etc.)</li>
|
|
<li>Button layout and spacing</li>
|
|
<li>Keyboard shortcuts for quick access</li>
|
|
</ul>
|
|
</li>
|
|
<li><b>Modal Configuration</b>: Sets the dialog as modal using setModal(true), ensuring that:<ul>
|
|
<li>The dialog blocks interaction with the main editor</li>
|
|
<li>User must make an explicit decision</li>
|
|
<li>No other editor operations can occur until dialog is closed</li>
|
|
<li>Focus remains on the dialog until user responds</li>
|
|
</ul>
|
|
</li>
|
|
</ol>
|
|
<p><b>Dialog Workflow:</b></p>
|
|
<p>After construction, the typical usage pattern is:</p><ol type="1">
|
|
<li>Caller creates dialog instance (this constructor executes)</li>
|
|
<li>Caller updates dialog text to show current match context (optional)</li>
|
|
<li>Caller invokes exec() to display dialog and wait for user response</li>
|
|
<li>User clicks a button (Replace, Skip, Replace All, Cancel)</li>
|
|
<li>Dialog returns with appropriate QDialog result code</li>
|
|
<li>Caller interprets result and takes appropriate action</li>
|
|
<li>Process repeats for next match or terminates</li>
|
|
</ol>
|
|
<p><b>Button Actions (typical configuration):</b></p><ul>
|
|
<li><b>Replace button</b>: Returns QDialog::Accepted, triggers replacement</li>
|
|
<li><b>Skip button</b>: Returns custom code, advances without replacing</li>
|
|
<li><b>Replace All</b>: Returns custom code, batch replaces remaining matches</li>
|
|
<li><b>Cancel button</b>: Returns QDialog::Rejected, aborts operation</li>
|
|
</ul>
|
|
<p><b>Modal Behavior Benefits:</b></p><ul>
|
|
<li>Prevents accidental document edits during confirmation</li>
|
|
<li>Maintains clear workflow state</li>
|
|
<li>Ensures user attention on decision</li>
|
|
<li>Simplifies state management in calling code</li>
|
|
</ul>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">parent</td><td>Pointer to the parent widget, typically the main musredit editor window. The parent relationship provides:<ul>
|
|
<li>Automatic dialog centering over parent window</li>
|
|
<li>Consistent visual style and theme</li>
|
|
<li>Automatic cleanup when parent is destroyed</li>
|
|
<li>Proper z-order (dialog appears on top of parent)</li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<p>If nullptr, the dialog has no parent and will not center over any specific window, though it will still be modal with respect to the application.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>The dialog is created but not displayed by the constructor. Use exec() or show() to make it visible to the user. </dd>
|
|
<dd>
|
|
The actual button configuration and return codes are determined by the UI file design and any signal-slot connections established there. </dd>
|
|
<dd>
|
|
Modal dialogs entered via exec() run their own event loop, blocking the calling code until the dialog closes. </dd>
|
|
<dd>
|
|
The simple constructor design (no parameters for search/replace text) suggests the dialog may be updated after construction but before display, or that it shows generic confirmation text.</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd>exec() Qt method to display the dialog modally and return user choice </dd>
|
|
<dd>
|
|
setModal() Qt method that configures modal behavior (called here) </dd>
|
|
<dd>
|
|
setupUi() Qt Designer generated method that constructs the UI </dd>
|
|
<dd>
|
|
QDialog For base class documentation on dialog behavior and return codes </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="PReplaceConfirmationDialog_8cpp_source.html#l00123">123</a> of file <a class="el" href="PReplaceConfirmationDialog_8cpp_source.html">PReplaceConfirmationDialog.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8bbe278dd405f742ce86e9a071756ce7" name="a8bbe278dd405f742ce86e9a071756ce7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8bbe278dd405f742ce86e9a071756ce7">◆ </a></span>~PReplaceConfirmationDialog()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual PReplaceConfirmationDialog::~PReplaceConfirmationDialog </td>
|
|
<td>(</td>
|
|
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel virtual">virtual</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Virtual destructor. </p>
|
|
<p>Default destructor implementation. Qt's parent-child ownership system automatically handles cleanup of UI elements created by setupUi(). No manual resource cleanup is required.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>Declared virtual to ensure proper cleanup in inheritance hierarchies, following C++ best practices. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="PReplaceConfirmationDialog_8h_source.html#l00154">154</a> of file <a class="el" href="PReplaceConfirmationDialog_8h_source.html">PReplaceConfirmationDialog.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
|
<li>/workspace/LMU/musrfit/src/musredit_qt6/musredit/<a class="el" href="PReplaceConfirmationDialog_8h_source.html">PReplaceConfirmationDialog.h</a></li>
|
|
<li>/workspace/LMU/musrfit/src/musredit_qt6/musredit/<a class="el" href="PReplaceConfirmationDialog_8cpp_source.html">PReplaceConfirmationDialog.cpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2
|
|
</small></address>
|
|
</div><!-- doc-content -->
|
|
</body>
|
|
</html>
|