Mercurial > hg > easyhg
comparison src/mainwindow.cpp @ 624:38c84c66ad7a
* Added "show in" to show selected file in explorer
author | Sam Izzo <sam@humbug.net> |
---|---|
date | Sun, 26 Aug 2012 01:59:53 +1000 |
parents | 2d5b831c1a0a |
children | db62a0cb3037 |
comparison
equal
deleted
inserted
replaced
623:0ef4ed400ced | 624:38c84c66ad7a |
---|---|
853 | 853 |
854 void MainWindow::hgUnIgnoreFiles(QStringList files) | 854 void MainWindow::hgUnIgnoreFiles(QStringList files) |
855 { | 855 { |
856 // Not implemented: edit the .hgignore instead | 856 // Not implemented: edit the .hgignore instead |
857 hgEditIgnore(); | 857 hgEditIgnore(); |
858 } | |
859 | |
860 void MainWindow::hgShowIn(QStringList files) | |
861 { | |
862 foreach (QString file, files) | |
863 { | |
864 QStringList args; | |
865 #if defined Q_OS_WIN32 | |
866 // Although the Win32 API is quite happy to have | |
867 // forward slashes as directory separators, Windows | |
868 // Explorer is not | |
869 file = file.replace('/', '\\'); | |
870 args << "/select," << file; | |
871 // FIXME: This shouldn't be using a hardcoded path. | |
872 QProcess::execute("c:/windows/explorer.exe", args); | |
873 #else if defined(Q_OS_MAC) | |
874 args << file; | |
875 QProcess::execute("/usr/bin/open", args); | |
876 #endif | |
877 } | |
858 } | 878 } |
859 | 879 |
860 QString MainWindow::getDiffBinaryName() | 880 QString MainWindow::getDiffBinaryName() |
861 { | 881 { |
862 QSettings settings; | 882 QSettings settings; |
2668 connect(m_hgTabs, SIGNAL(ignoreFiles(QStringList)), | 2688 connect(m_hgTabs, SIGNAL(ignoreFiles(QStringList)), |
2669 this, SLOT(hgIgnoreFiles(QStringList))); | 2689 this, SLOT(hgIgnoreFiles(QStringList))); |
2670 | 2690 |
2671 connect(m_hgTabs, SIGNAL(unIgnoreFiles(QStringList)), | 2691 connect(m_hgTabs, SIGNAL(unIgnoreFiles(QStringList)), |
2672 this, SLOT(hgUnIgnoreFiles(QStringList))); | 2692 this, SLOT(hgUnIgnoreFiles(QStringList))); |
2693 | |
2694 connect(m_hgTabs, SIGNAL(showIn(QStringList)), | |
2695 this, SLOT(hgShowIn(QStringList))); | |
2673 } | 2696 } |
2674 | 2697 |
2675 void MainWindow::enableDisableActions() | 2698 void MainWindow::enableDisableActions() |
2676 { | 2699 { |
2677 DEBUG << "MainWindow::enableDisableActions" << endl; | 2700 DEBUG << "MainWindow::enableDisableActions" << endl; |