\hypertarget{class_duplicate_popup}{}\doxysection{Duplicate\+Popup Class Reference}
\label{class_duplicate_popup}\index{DuplicatePopup@{DuplicatePopup}}
Inheritance diagram for Duplicate\+Popup\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_duplicate_popup}
\end{center}
\end{figure}
\doxysubsection*{Public Slots}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{class_duplicate_popup_af4b4fb1a2856a3dcc1a9b6809540b732}{update\+Values}} ()
\item 
void \mbox{\hyperlink{class_duplicate_popup_a15cff862ac16ac4ff47e4b5e6cc6860f}{on\+Apply\+Pressed}} ()
\item 
void \mbox{\hyperlink{class_duplicate_popup_a8ed73d83a11a87238c6d7df33c6430d1}{on\+OKPressed}} ()
\item 
void \mbox{\hyperlink{class_duplicate_popup_a5470132075f5c6ab14a810ae65643c72}{on\+Selection\+Changed}} ()
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{class_duplicate_popup_aacb2dc41a3c4f299f48abf93f665d94b}{get\+Values}} (int \&start, int \&step)
\end{DoxyCompactItemize}
\doxysubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{class_duplicate_popup_aec82cf1d7800402d9c54a04b5db96f91}{show\+Event}} (QShow\+Event $\ast$) override
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_duplicate_popup_afc0921f84ec37d2447803152318a2493}\label{class_duplicate_popup_afc0921f84ec37d2447803152318a2493}} 
\index{DuplicatePopup@{DuplicatePopup}!DuplicatePopup@{DuplicatePopup}}
\index{DuplicatePopup@{DuplicatePopup}!DuplicatePopup@{DuplicatePopup}}
\doxysubsubsection{\texorpdfstring{DuplicatePopup()}{DuplicatePopup()}}
{\footnotesize\ttfamily Duplicate\+Popup\+::\+Duplicate\+Popup (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}


\begin{DoxyCode}{0}
\DoxyCodeLine{00091     : QDialog(\mbox{\hyperlink{class_t_app_a24088f8647d5d9447fcec6b9b9bbf9eb}{TApp::instance}}()-\/>getMainWindow()), m\_count(0), m\_upTo(0) \{}
\DoxyCodeLine{00092   setWindowTitle(tr(\textcolor{stringliteral}{"{}Repeat"{}}));}
\DoxyCodeLine{00093 }
\DoxyCodeLine{00094   m\_countFld = \textcolor{keyword}{new} \mbox{\hyperlink{class_d_v_gui_1_1_int_line_edit}{DVGui::IntLineEdit}}(\textcolor{keyword}{this});}
\DoxyCodeLine{00095   m\_upToFld  = \textcolor{keyword}{new} \mbox{\hyperlink{class_d_v_gui_1_1_int_line_edit}{DVGui::IntLineEdit}}(\textcolor{keyword}{this});}
\DoxyCodeLine{00096 }
\DoxyCodeLine{00097   m\_okBtn     = \textcolor{keyword}{new} QPushButton(tr(\textcolor{stringliteral}{"{}Repeat"{}}), \textcolor{keyword}{this});}
\DoxyCodeLine{00098   m\_cancelBtn = \textcolor{keyword}{new} QPushButton(tr(\textcolor{stringliteral}{"{}Close"{}}), \textcolor{keyword}{this});}
\DoxyCodeLine{00099   m\_applyBtn  = \textcolor{keyword}{new} QPushButton(tr(\textcolor{stringliteral}{"{}Apply"{}}), \textcolor{keyword}{this});}
\DoxyCodeLine{00100 }
\DoxyCodeLine{00101   \textcolor{comment}{//-\/-\/-\/-\/layout}}
\DoxyCodeLine{00102   QVBoxLayout *mainLayout = \textcolor{keyword}{new} QVBoxLayout();}
\DoxyCodeLine{00103   mainLayout-\/>setMargin(10);}
\DoxyCodeLine{00104   mainLayout-\/>setSpacing(10);}
\DoxyCodeLine{00105   \{}
\DoxyCodeLine{00106     QHBoxLayout *upperLay = \textcolor{keyword}{new} QHBoxLayout();}
\DoxyCodeLine{00107     upperLay-\/>setMargin(0);}
\DoxyCodeLine{00108     upperLay-\/>setSpacing(5);}
\DoxyCodeLine{00109     \{}
\DoxyCodeLine{00110       upperLay-\/>addWidget(\textcolor{keyword}{new} QLabel(tr(\textcolor{stringliteral}{"{}Times:"{}}), \textcolor{keyword}{this}), 0);}
\DoxyCodeLine{00111       upperLay-\/>addWidget(m\_countFld, 1);}
\DoxyCodeLine{00112       upperLay-\/>addSpacing(10);}
\DoxyCodeLine{00113       upperLay-\/>addWidget(\textcolor{keyword}{new} QLabel(tr(\textcolor{stringliteral}{"{}Up to Frame:"{}}), \textcolor{keyword}{this}), 0);}
\DoxyCodeLine{00114       upperLay-\/>addWidget(m\_upToFld, 1);}
\DoxyCodeLine{00115     \}}
\DoxyCodeLine{00116     mainLayout-\/>addLayout(upperLay, 0);}
\DoxyCodeLine{00117 }
\DoxyCodeLine{00118     QHBoxLayout *bottomLay = \textcolor{keyword}{new} QHBoxLayout();}
\DoxyCodeLine{00119     bottomLay-\/>setMargin(0);}
\DoxyCodeLine{00120     bottomLay-\/>setSpacing(10);}
\DoxyCodeLine{00121     \{}
\DoxyCodeLine{00122       bottomLay-\/>addWidget(m\_okBtn);}
\DoxyCodeLine{00123       bottomLay-\/>addWidget(m\_applyBtn);}
\DoxyCodeLine{00124       bottomLay-\/>addWidget(m\_cancelBtn);}
\DoxyCodeLine{00125     \}}
\DoxyCodeLine{00126     mainLayout-\/>addLayout(bottomLay, 0);}
\DoxyCodeLine{00127   \}}
\DoxyCodeLine{00128   setLayout(mainLayout);}
\DoxyCodeLine{00129 }
\DoxyCodeLine{00130   \textcolor{comment}{//-\/-\/-\/-\/signal-\/slot connections}}
\DoxyCodeLine{00131   \textcolor{keywordtype}{bool} ret = \textcolor{keyword}{true};}
\DoxyCodeLine{00132   ret      = ret \&\& connect(m\_countFld, SIGNAL(editingFinished()), \textcolor{keyword}{this},}
\DoxyCodeLine{00133                        SLOT(updateValues()));}
\DoxyCodeLine{00134   ret = ret \&\& connect(m\_upToFld, SIGNAL(editingFinished()), \textcolor{keyword}{this},}
\DoxyCodeLine{00135                        SLOT(updateValues()));}
\DoxyCodeLine{00136 }
\DoxyCodeLine{00137   ret = ret \&\& connect(m\_okBtn, SIGNAL(clicked()), \textcolor{keyword}{this}, SLOT(onOKPressed()));}
\DoxyCodeLine{00138   ret = ret \&\& connect(m\_cancelBtn, SIGNAL(clicked()), \textcolor{keyword}{this}, SLOT(close()));}
\DoxyCodeLine{00139   ret = ret \&\&}
\DoxyCodeLine{00140         connect(m\_applyBtn, SIGNAL(clicked()), \textcolor{keyword}{this}, SLOT(onApplyPressed()));}
\DoxyCodeLine{00141 }
\DoxyCodeLine{00142   ret = ret \&\& connect(\mbox{\hyperlink{class_t_app_a24088f8647d5d9447fcec6b9b9bbf9eb}{TApp::instance}}()-\/>getCurrentSelection(),}
\DoxyCodeLine{00143                        SIGNAL(selectionChanged(\mbox{\hyperlink{class_t_selection}{TSelection}} *)), \textcolor{keyword}{this},}
\DoxyCodeLine{00144                        SLOT(onSelectionChanged()));}
\DoxyCodeLine{00145   assert(ret);}
\DoxyCodeLine{00146 \}}

\end{DoxyCode}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_duplicate_popup_aacb2dc41a3c4f299f48abf93f665d94b}\label{class_duplicate_popup_aacb2dc41a3c4f299f48abf93f665d94b}} 
\index{DuplicatePopup@{DuplicatePopup}!getValues@{getValues}}
\index{getValues@{getValues}!DuplicatePopup@{DuplicatePopup}}
\doxysubsubsection{\texorpdfstring{getValues()}{getValues()}}
{\footnotesize\ttfamily void Duplicate\+Popup\+::get\+Values (\begin{DoxyParamCaption}\item[{int \&}]{start,  }\item[{int \&}]{step }\end{DoxyParamCaption})}


\begin{DoxyCode}{0}
\DoxyCodeLine{00246                                                     \{}
\DoxyCodeLine{00247   count = m\_countFld-\/>text().toInt();}
\DoxyCodeLine{00248   upTo  = m\_upToFld-\/>text().toInt();}
\DoxyCodeLine{00249 \}}

\end{DoxyCode}
\mbox{\Hypertarget{class_duplicate_popup_a15cff862ac16ac4ff47e4b5e6cc6860f}\label{class_duplicate_popup_a15cff862ac16ac4ff47e4b5e6cc6860f}} 
\index{DuplicatePopup@{DuplicatePopup}!onApplyPressed@{onApplyPressed}}
\index{onApplyPressed@{onApplyPressed}!DuplicatePopup@{DuplicatePopup}}
\doxysubsubsection{\texorpdfstring{onApplyPressed}{onApplyPressed}}
{\footnotesize\ttfamily void Duplicate\+Popup\+::on\+Apply\+Pressed (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [slot]}}


\begin{DoxyCode}{0}
\DoxyCodeLine{00150                                     \{}
\DoxyCodeLine{00151   \mbox{\hyperlink{class_t_cell_selection}{TCellSelection}} *selection = \textcolor{keyword}{dynamic\_cast<}\mbox{\hyperlink{class_t_cell_selection}{TCellSelection}} *\textcolor{keyword}{>}(}
\DoxyCodeLine{00152       \mbox{\hyperlink{class_t_app_a24088f8647d5d9447fcec6b9b9bbf9eb}{TApp::instance}}()-\/>\mbox{\hyperlink{class_t_app_a6e0ee1978807a89009571ed5ce44323b}{getCurrentSelection}}()-\/>getSelection());}
\DoxyCodeLine{00153   \textcolor{keywordflow}{if} (!selection) \textcolor{keywordflow}{return};}
\DoxyCodeLine{00154 }
\DoxyCodeLine{00155   \textcolor{keywordtype}{int} count = 0, upTo = 0;}
\DoxyCodeLine{00156   getValues(count, upTo);}
\DoxyCodeLine{00157 }
\DoxyCodeLine{00158   \textcolor{keywordflow}{try} \{}
\DoxyCodeLine{00159     \textcolor{keywordtype}{int} r0, r1, c0, c1;}
\DoxyCodeLine{00160     selection-\/>getSelectedCells(r0, c0, r1, c1);}
\DoxyCodeLine{00161     \mbox{\hyperlink{class_t_undo}{TUndo}} *undo = \textcolor{keyword}{new} DuplicateUndo(r0, c0, r1, c1, (\textcolor{keywordtype}{int})upTo -\/ 1);}
\DoxyCodeLine{00162     TUndoManager::manager()-\/>add(undo);}
\DoxyCodeLine{00163     \mbox{\hyperlink{class_t_app}{TApp}} *app         = \mbox{\hyperlink{class_t_app_a24088f8647d5d9447fcec6b9b9bbf9eb}{TApp::instance}}();}
\DoxyCodeLine{00164     \mbox{\hyperlink{class_toonz_scene}{ToonzScene}} *scene = app-\/>\mbox{\hyperlink{class_t_app_abbbf1fae564e9e510826eda4f6637d20}{getCurrentScene}}()-\/>getScene();}
\DoxyCodeLine{00165     \mbox{\hyperlink{class_t_xsheet}{TXsheet}} *xsh      = scene-\/>\mbox{\hyperlink{class_toonz_scene_ae3c828e3223fd809fd59189233d0576a}{getXsheet}}();}
\DoxyCodeLine{00166     xsh-\/>\mbox{\hyperlink{class_t_xsheet_a8be007d48d0e987aa3985fe800507b54}{duplicateCells}}(r0, c0, r1, c1, (\textcolor{keywordtype}{int})upTo -\/ 1);}
\DoxyCodeLine{00167     \mbox{\hyperlink{class_t_app_a24088f8647d5d9447fcec6b9b9bbf9eb}{TApp::instance}}()-\/>\mbox{\hyperlink{class_t_app_abbbf1fae564e9e510826eda4f6637d20}{getCurrentScene}}()-\/>setDirtyFlag(\textcolor{keyword}{true});}
\DoxyCodeLine{00168     \mbox{\hyperlink{class_t_app_a24088f8647d5d9447fcec6b9b9bbf9eb}{TApp::instance}}()-\/>\mbox{\hyperlink{class_t_app_a13f509e753824cb0500787f68bb51a09}{getCurrentXsheet}}()-\/>notifyXsheetChanged();}
\DoxyCodeLine{00169   \} \textcolor{keywordflow}{catch} (...) \{}
\DoxyCodeLine{00170     DVGui::error((\textcolor{stringliteral}{"{}Cannot duplicate"{}}));}
\DoxyCodeLine{00171   \}}
\DoxyCodeLine{00172 \}}

\end{DoxyCode}
\mbox{\Hypertarget{class_duplicate_popup_a8ed73d83a11a87238c6d7df33c6430d1}\label{class_duplicate_popup_a8ed73d83a11a87238c6d7df33c6430d1}} 
\index{DuplicatePopup@{DuplicatePopup}!onOKPressed@{onOKPressed}}
\index{onOKPressed@{onOKPressed}!DuplicatePopup@{DuplicatePopup}}
\doxysubsubsection{\texorpdfstring{onOKPressed}{onOKPressed}}
{\footnotesize\ttfamily void Duplicate\+Popup\+::on\+OKPressed (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [slot]}}


\begin{DoxyCode}{0}
\DoxyCodeLine{00176                                  \{}
\DoxyCodeLine{00177   onApplyPressed();}
\DoxyCodeLine{00178   close();}
\DoxyCodeLine{00179 \}}

\end{DoxyCode}
\mbox{\Hypertarget{class_duplicate_popup_a5470132075f5c6ab14a810ae65643c72}\label{class_duplicate_popup_a5470132075f5c6ab14a810ae65643c72}} 
\index{DuplicatePopup@{DuplicatePopup}!onSelectionChanged@{onSelectionChanged}}
\index{onSelectionChanged@{onSelectionChanged}!DuplicatePopup@{DuplicatePopup}}
\doxysubsubsection{\texorpdfstring{onSelectionChanged}{onSelectionChanged}}
{\footnotesize\ttfamily void Duplicate\+Popup\+::on\+Selection\+Changed (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [slot]}}


\begin{DoxyCode}{0}
\DoxyCodeLine{00183                                         \{}
\DoxyCodeLine{00184   \textcolor{keywordflow}{if} (isVisible()) \{}
\DoxyCodeLine{00185     m\_count = 0;}
\DoxyCodeLine{00186     updateValues();}
\DoxyCodeLine{00187   \}}
\DoxyCodeLine{00188 \}}

\end{DoxyCode}
\mbox{\Hypertarget{class_duplicate_popup_aec82cf1d7800402d9c54a04b5db96f91}\label{class_duplicate_popup_aec82cf1d7800402d9c54a04b5db96f91}} 
\index{DuplicatePopup@{DuplicatePopup}!showEvent@{showEvent}}
\index{showEvent@{showEvent}!DuplicatePopup@{DuplicatePopup}}
\doxysubsubsection{\texorpdfstring{showEvent()}{showEvent()}}
{\footnotesize\ttfamily void Duplicate\+Popup\+::show\+Event (\begin{DoxyParamCaption}\item[{QShow\+Event $\ast$}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}}


\begin{DoxyCode}{0}
\DoxyCodeLine{00192                                            \{}
\DoxyCodeLine{00193   \textcolor{comment}{/*-\/-\/ ダイアログを開くたびにcount値を初期値に戻す -\/-\/*/}}
\DoxyCodeLine{00194   m\_countFld-\/>\mbox{\hyperlink{class_d_v_gui_1_1_int_line_edit_ac16f2b6d59faec8c3f73944f01e46f53}{setValue}}(1);}
\DoxyCodeLine{00195   m\_upToFld-\/>\mbox{\hyperlink{class_d_v_gui_1_1_int_line_edit_ac16f2b6d59faec8c3f73944f01e46f53}{setValue}}(1);}
\DoxyCodeLine{00196   m\_count = 0;}
\DoxyCodeLine{00197   m\_upTo  = 0;}
\DoxyCodeLine{00198   updateValues();}
\DoxyCodeLine{00199 \}}

\end{DoxyCode}
\mbox{\Hypertarget{class_duplicate_popup_af4b4fb1a2856a3dcc1a9b6809540b732}\label{class_duplicate_popup_af4b4fb1a2856a3dcc1a9b6809540b732}} 
\index{DuplicatePopup@{DuplicatePopup}!updateValues@{updateValues}}
\index{updateValues@{updateValues}!DuplicatePopup@{DuplicatePopup}}
\doxysubsubsection{\texorpdfstring{updateValues}{updateValues}}
{\footnotesize\ttfamily void Duplicate\+Popup\+::update\+Values (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [slot]}}


\begin{DoxyCode}{0}
\DoxyCodeLine{00203                                   \{}
\DoxyCodeLine{00204   \textcolor{keywordtype}{int} count, upTo;}
\DoxyCodeLine{00205   getValues(count, upTo);}
\DoxyCodeLine{00206   \textcolor{keywordflow}{if} (count == m\_count \&\& upTo == m\_upTo) \textcolor{keywordflow}{return};}
\DoxyCodeLine{00207   \mbox{\hyperlink{class_t_cell_selection}{TCellSelection}} *selection = \textcolor{keyword}{dynamic\_cast<}\mbox{\hyperlink{class_t_cell_selection}{TCellSelection}} *\textcolor{keyword}{>}(}
\DoxyCodeLine{00208       \mbox{\hyperlink{class_t_app_a24088f8647d5d9447fcec6b9b9bbf9eb}{TApp::instance}}()-\/>\mbox{\hyperlink{class_t_app_a6e0ee1978807a89009571ed5ce44323b}{getCurrentSelection}}()-\/>getSelection());}
\DoxyCodeLine{00209 }
\DoxyCodeLine{00210   \textcolor{keywordflow}{if} (!selection) \{}
\DoxyCodeLine{00211     m\_countFld-\/>setEnabled(\textcolor{keyword}{false});}
\DoxyCodeLine{00212     m\_upToFld-\/>setEnabled(\textcolor{keyword}{false});}
\DoxyCodeLine{00213     m\_okBtn-\/>setEnabled(\textcolor{keyword}{false});}
\DoxyCodeLine{00214     m\_applyBtn-\/>setEnabled(\textcolor{keyword}{false});}
\DoxyCodeLine{00215     \textcolor{keywordflow}{return};}
\DoxyCodeLine{00216   \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{00217     m\_countFld-\/>setEnabled(\textcolor{keyword}{true});}
\DoxyCodeLine{00218     m\_upToFld-\/>setEnabled(\textcolor{keyword}{true});}
\DoxyCodeLine{00219     m\_okBtn-\/>setEnabled(\textcolor{keyword}{true});}
\DoxyCodeLine{00220     m\_applyBtn-\/>setEnabled(\textcolor{keyword}{true});}
\DoxyCodeLine{00221   \}}
\DoxyCodeLine{00222 }
\DoxyCodeLine{00223   \textcolor{keywordtype}{int} r0, r1, c0, c1;}
\DoxyCodeLine{00224   selection-\/>getSelectedCells(r0, c0, r1, c1);}
\DoxyCodeLine{00225   \textcolor{keywordtype}{int} chunkSize = r1 -\/ r0 + 1;}
\DoxyCodeLine{00226 }
\DoxyCodeLine{00227   \textcolor{keywordflow}{if} (count != m\_count) \{}
\DoxyCodeLine{00228     \textcolor{keywordflow}{if} (count < 1) count = 1;}
\DoxyCodeLine{00229     upTo                 = r1 + 1 + count * chunkSize;}
\DoxyCodeLine{00230   \}}
\DoxyCodeLine{00231   \textcolor{comment}{/*-\/-\/ upToを編集した場合 -\/-\/*/}}
\DoxyCodeLine{00232   \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{00233     \textcolor{keywordflow}{if} (upTo < r1 + 1 + 1) upTo = r1 + 1 + 1;}
\DoxyCodeLine{00234     count                       = (upTo -\/ (r1 + 2) + chunkSize) / chunkSize;}
\DoxyCodeLine{00235     \textcolor{keywordflow}{if} (count < 1) upTo         = 1;}
\DoxyCodeLine{00236   \}}
\DoxyCodeLine{00237   m\_count = count;}
\DoxyCodeLine{00238   m\_upTo  = upTo;}
\DoxyCodeLine{00239 }
\DoxyCodeLine{00240   m\_countFld-\/>setText(QString::number(m\_count));}
\DoxyCodeLine{00241   m\_upToFld-\/>setText(QString::number(m\_upTo));}
\DoxyCodeLine{00242 \}}

\end{DoxyCode}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
E\+:/opentoonz/toonz/sources/toonz/duplicatepopup.\+h\item 
E\+:/opentoonz/toonz/sources/toonz/duplicatepopup.\+cpp\end{DoxyCompactItemize}
