diff options
author | Arno <am@disconnect.de> | 2010-11-28 11:58:57 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-11-28 11:58:57 +0100 |
commit | d1837c9c92c9f38a464f0473001db4e9a57d44e7 (patch) | |
tree | 9d815a4c1e1c550871565c92d7e0c8f312f05f72 /shemov.cpp | |
parent | eb4139c5c525c03d4c75c0a47acc92157008ca06 (diff) | |
download | SheMov-d1837c9c92c9f38a464f0473001db4e9a57d44e7.tar.gz SheMov-d1837c9c92c9f38a464f0473001db4e9a57d44e7.tar.bz2 SheMov-d1837c9c92c9f38a464f0473001db4e9a57d44e7.zip |
Added action to copy file path to clipboard
4 new actions to copy the file path to clipboard. It's either the unix
full path, the unix dir, the windows full path or the windows dir. For
the latter '/' is replaced with '\' and a drive letter is prepended.
The drive letter is configurable in the ConfigurationDialog. While at it
I revamped it and added another tab to make it more user friendly.
Diffstat (limited to 'shemov.cpp')
-rw-r--r-- | shemov.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -433,6 +433,20 @@ void SheMov::createActions(){ connect(mDeleteFilesFromTreeA, SIGNAL(triggered()), mATree->filesWidget(), SLOT(removeFiles())); mFilePropertiesA = new QAction(tr("Properties..."), this); connect(mFilePropertiesA, SIGNAL(triggered()), mATree->filesWidget(), SLOT(fileProperties())); + QSignalMapper *copyMapper = new QSignalMapper(this); + mCopyUnixFullPathA = new QAction(tr("Copy unix file"), this); + copyMapper->setMapping(mCopyUnixFullPathA, ArchiveTreeView::UnixFullPath); + connect(mCopyUnixFullPathA, SIGNAL(triggered()), copyMapper, SLOT(map())); + mCopyUnixDirA = new QAction(tr("Copy unix directory"), this); + copyMapper->setMapping(mCopyUnixDirA, ArchiveTreeView::UnixDir); + connect(mCopyUnixDirA, SIGNAL(triggered()), copyMapper, SLOT(map())); + mCopyWindowsFullPathA = new QAction(tr("Copy windows file"), this); + copyMapper->setMapping(mCopyWindowsFullPathA, ArchiveTreeView::WindowsFullPath); + connect(mCopyWindowsFullPathA, SIGNAL(triggered()), copyMapper, SLOT(map())); + mCopyWindowsDirA = new QAction(tr("Copy windows directory"), this); + copyMapper->setMapping(mCopyWindowsDirA, ArchiveTreeView::WindowsDir); + connect(mCopyWindowsDirA, SIGNAL(triggered()), copyMapper, SLOT(map())); + connect(copyMapper, SIGNAL(mapped(int)), mATree, SLOT(copyPath(int))); // misc mOpenWithMapperFS = new QSignalMapper(this); @@ -583,6 +597,20 @@ void SheMov::createMenus(){ QAction *sep9 = new QAction(this); sep9->setSeparator(true); mATree->filesWidget()->filesTree()->addAction(sep9); + QMenu *copyMenu = new QMenu(this); + copyMenu->addAction(mCopyUnixFullPathA); + copyMenu->addAction(mCopyUnixDirA); + QAction *sep13 = new QAction(this); + sep13->setSeparator(true); + copyMenu->addAction(sep13); + copyMenu->addAction(mCopyWindowsFullPathA); + copyMenu->addAction(mCopyWindowsDirA); + QAction *copyAction = new QAction(tr("Copy to clipboard"), this); + copyAction->setMenu(copyMenu); + mATree->filesWidget()->filesTree()->addAction(copyAction); + QAction *sep12 = new QAction(this); + sep12->setSeparator(true); + mATree->filesWidget()->filesTree()->addAction(sep12); mATree->filesWidget()->filesTree()->addAction(mFilePropertiesA); } |