Mercurial > hg > easyhg
comparison mainwindow.cpp @ 361:4cd753e083cc feature_91b
Add Rename and Copy to right-button menu on file status widget.
(This is the real feature 91 -- I bungled the feature number with the earlier feature_91 branch, which actually addressed feature 106.)
author | Chris Cannam |
---|---|
date | Thu, 17 Mar 2011 17:34:23 +0000 |
parents | ea6f76c0aa76 |
children | 73fb5ef55744 |
comparison
equal
deleted
inserted
replaced
358:ea6f76c0aa76 | 361:4cd753e083cc |
---|---|
775 tr("Revert"))) { | 775 tr("Revert"))) { |
776 | 776 |
777 m_lastRevertedFiles = files; | 777 m_lastRevertedFiles = files; |
778 | 778 |
779 m_runner->requestAction(HgAction(ACT_REVERT, m_workFolderPath, params)); | 779 m_runner->requestAction(HgAction(ACT_REVERT, m_workFolderPath, params)); |
780 } | |
781 } | |
782 | |
783 | |
784 void MainWindow::hgRenameFiles(QStringList files) | |
785 { | |
786 QString renameTo; | |
787 | |
788 QString file; | |
789 if (files.empty()) return; | |
790 file = files[0]; | |
791 | |
792 if (ConfirmCommentDialog::confirmAndGetShortComment | |
793 (this, | |
794 tr("Rename"), | |
795 tr("Rename <code>%1</code> to:").arg(xmlEncode(file)), | |
796 renameTo, | |
797 tr("Rename"))) { | |
798 | |
799 if (renameTo != "" && renameTo != file) { | |
800 | |
801 QStringList params; | |
802 | |
803 params << "rename" << "--" << file << renameTo; | |
804 | |
805 m_runner->requestAction(HgAction(ACT_RENAME_FILE, m_workFolderPath, params)); | |
806 } | |
807 } | |
808 } | |
809 | |
810 | |
811 void MainWindow::hgCopyFiles(QStringList files) | |
812 { | |
813 QString copyTo; | |
814 | |
815 QString file; | |
816 if (files.empty()) return; | |
817 file = files[0]; | |
818 | |
819 if (ConfirmCommentDialog::confirmAndGetShortComment | |
820 (this, | |
821 tr("Copy"), | |
822 tr("Copy <code>%1</code> to:").arg(xmlEncode(file)), | |
823 copyTo, | |
824 tr("Copy"))) { | |
825 | |
826 if (copyTo != "" && copyTo != file) { | |
827 | |
828 QStringList params; | |
829 | |
830 params << "copy" << "--" << file << copyTo; | |
831 | |
832 m_runner->requestAction(HgAction(ACT_COPY_FILE, m_workFolderPath, params)); | |
833 } | |
780 } | 834 } |
781 } | 835 } |
782 | 836 |
783 | 837 |
784 void MainWindow::hgMarkFilesResolved(QStringList files) | 838 void MainWindow::hgMarkFilesResolved(QStringList files) |
2300 this, SLOT(hgCommitFiles(QStringList))); | 2354 this, SLOT(hgCommitFiles(QStringList))); |
2301 | 2355 |
2302 connect(m_hgTabs, SIGNAL(revertFiles(QStringList)), | 2356 connect(m_hgTabs, SIGNAL(revertFiles(QStringList)), |
2303 this, SLOT(hgRevertFiles(QStringList))); | 2357 this, SLOT(hgRevertFiles(QStringList))); |
2304 | 2358 |
2359 connect(m_hgTabs, SIGNAL(renameFiles(QStringList)), | |
2360 this, SLOT(hgRenameFiles(QStringList))); | |
2361 | |
2362 connect(m_hgTabs, SIGNAL(copyFiles(QStringList)), | |
2363 this, SLOT(hgCopyFiles(QStringList))); | |
2364 | |
2305 connect(m_hgTabs, SIGNAL(addFiles(QStringList)), | 2365 connect(m_hgTabs, SIGNAL(addFiles(QStringList)), |
2306 this, SLOT(hgAddFiles(QStringList))); | 2366 this, SLOT(hgAddFiles(QStringList))); |
2307 | 2367 |
2308 connect(m_hgTabs, SIGNAL(removeFiles(QStringList)), | 2368 connect(m_hgTabs, SIGNAL(removeFiles(QStringList)), |
2309 this, SLOT(hgRemoveFiles(QStringList))); | 2369 this, SLOT(hgRemoveFiles(QStringList))); |