1 #include "copyworker.h"
\r
2 #include "deleteworker.h"
\r
3 #include "mainwindow.h"
\r
4 #include "operationdialog.h"
\r
5 #include "overwritedialog.h"
\r
6 #include "renamemultidialog.h"
\r
7 #include "renamesingledialog.h"
\r
8 #include "renameworker.h"
\r
9 #include "ui_mainwindow.h"
\r
10 #include <QFileSystemModel>
\r
12 #include <QKeyEvent>
\r
13 #include <QDesktopServices>
\r
14 #include <QSettings>
\r
15 #include <QFileDialog>
\r
16 #include <QMessageBox>
\r
19 #include <QInputDialog>
\r
21 MainWindow::MainWindow(QWidget *parent) :
\r
22 QMainWindow(parent),
\r
23 ui(new Ui::MainWindow)
\r
28 bool checked = settings.value("Common/ShowHidden", false).toBool();
\r
29 ui->view_Hidden->setChecked(checked);
\r
31 // メニューのシグナル/スロットを設定する
\r
32 connect(ui->action_Command, SIGNAL(triggered()), this, SLOT(onActionCommand()));
\r
33 connect(ui->action_Exec, SIGNAL(triggered()), this, SLOT(onActionExec()));
\r
34 connect(ui->action_Open, SIGNAL(triggered()), this, SLOT(onActionOpen()));
\r
35 connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(onActionQuit()));
\r
36 connect(ui->action_Setting, SIGNAL(triggered()), this, SLOT(onActionSetting()));
\r
38 connect(ui->mark_All, SIGNAL(triggered()), this, SLOT(onMarkAll()));
\r
39 connect(ui->mark_AllFiles, SIGNAL(triggered()), this, SLOT(onMarkAllFiles()));
\r
40 connect(ui->mark_AllOff, SIGNAL(triggered()), this, SLOT(onMarkAllOff()));
\r
41 connect(ui->mark_Invert, SIGNAL(triggered()), this, SLOT(onMarkInvert()));
\r
42 connect(ui->mark_Toggle, SIGNAL(triggered()), this, SLOT(onMarkToggle()));
\r
44 connect(ui->move_Down, SIGNAL(triggered()), this, SLOT(onMoveCursorDown()));
\r
45 connect(ui->move_Up, SIGNAL(triggered()), this, SLOT(onMoveCursorUp()));
\r
46 connect(ui->move_Begin, SIGNAL(triggered()), this, SLOT(onMoveCursorBegin()));
\r
47 connect(ui->move_End, SIGNAL(triggered()), this, SLOT(onMoveCursorEnd()));
\r
48 connect(ui->move_Back, SIGNAL(triggered()), this, SLOT(onMoveBack()));
\r
49 connect(ui->move_Forward, SIGNAL(triggered()), this, SLOT(onMoveForward()));
\r
50 connect(ui->move_Home, SIGNAL(triggered()), this, SLOT(onMoveHome()));
\r
51 connect(ui->move_Jump, SIGNAL(triggered()), this, SLOT(onMoveJump()));
\r
52 connect(ui->move_Parent, SIGNAL(triggered()), this, SLOT(onMoveParent()));
\r
53 connect(ui->move_Root, SIGNAL(triggered()), this, SLOT(onMoveRoot()));
\r
55 connect(ui->view_FromOther, SIGNAL(triggered()), this, SLOT(onViewFromOther()));
\r
56 connect(ui->view_ToOther, SIGNAL(triggered()), this, SLOT(onViewToOther()));
\r
57 connect(ui->view_Hidden, SIGNAL(triggered()), this, SLOT(onViewHidden()));
\r
58 connect(ui->view_Swap, SIGNAL(triggered()), this, SLOT(onViewSwap()));
\r
60 connect(ui->cmd_Copy, SIGNAL(triggered()), this, SLOT(onCmdCopy()));
\r
61 connect(ui->cmd_Delete, SIGNAL(triggered()), this, SLOT(onCmdDelete()));
\r
62 connect(ui->cmd_NewFile, SIGNAL(triggered()), this, SLOT(onCmdNewFile()));
\r
63 connect(ui->cmd_NewFolder, SIGNAL(triggered()), this, SLOT(onCmdNewFolder()));
\r
64 connect(ui->cmd_Rename, SIGNAL(triggered()), this, SLOT(onCmdRename()));
\r
66 connect(ui->help_About, SIGNAL(triggered()), this, SLOT(onHelpAbout()));
\r
69 setWindowTitle(tr("げふぅ v0.00"));
\r
71 setWindowIcon(QIcon(":/images/Gefu.png"));
\r
78 path = settings.value("Left/dir", QDir::homePath()).toString();
\r
79 ui->folderPanel_L->setCurrentFolder(path);
\r
81 path = settings.value("Right/dir", QDir::homePath()).toString();
\r
82 ui->folderPanel_R->setCurrentFolder(path);
\r
85 MainWindow::~MainWindow()
\r
89 settings.setValue("Left/dir", ui->folderPanel_L->dir()->absolutePath());
\r
90 settings.setValue("Right/dir", ui->folderPanel_R->dir()->absolutePath());
\r
95 void MainWindow::setStatusText(const QString &str)
\r
97 ui->statusBar->showMessage(str);
\r
100 FolderPanel* MainWindow::activePanel()
\r
102 if (ui->folderPanel_L->fileTable()->hasFocus()) {
\r
103 return ui->folderPanel_L;
\r
105 if (ui->folderPanel_R->fileTable()->hasFocus()) {
\r
106 return ui->folderPanel_R;
\r
112 FolderPanel* MainWindow::inactivePanel()
\r
114 FolderPanel *fp = activePanel();
\r
115 if (fp == ui->folderPanel_L) {
\r
116 return ui->folderPanel_R;
\r
118 if (fp == ui->folderPanel_R) {
\r
119 return ui->folderPanel_L;
\r
126 /// \brief MainWindow::onActionCommand
\r
130 void MainWindow::onActionCommand()
\r
132 FolderPanel *fp = activePanel();
\r
137 QString command = "";
\r
138 for (int n = 0; n < fp->fileTable()->rowCount(); n++) {
\r
139 if (fp->fileTable()->item(n, 0)->checkState() == Qt::Checked) {
\r
140 QString path = fp->fileTable()->item(n, 1)->text();
\r
141 path = fp->dir()->absoluteFilePath(path);
\r
142 path = QDir::cleanPath(path);
\r
143 path = QDir::toNativeSeparators(path);
\r
145 QFileInfo info(path);
\r
146 if (info.isExecutable()) {
\r
147 command = "\"" + path + "\" " + command;
\r
150 command += " \"" + path + "\"";
\r
155 if (command.isEmpty()) {
\r
156 // int row = fp->fileTable()->currentIndex().row();
\r
157 int row = fp->fileTable()->currentRow();
\r
158 QString path = fp->fileTable()->item(row, 1)->text();
\r
159 path = fp->dir()->absoluteFilePath(path);
\r
160 path = QDir::cleanPath(path);
\r
161 path = QDir::toNativeSeparators(path);
\r
163 command = "\"" + path + "\"";
\r
166 QInputDialog dlg(this);
\r
167 dlg.setInputMode(QInputDialog::TextInput);
\r
168 dlg.setLabelText(tr("コマンドを入力:"));
\r
169 dlg.setWindowTitle(tr("コマンドを実行"));
\r
170 dlg.setTextValue(command);
\r
171 dlg.resize(500, 100);
\r
172 int ret = dlg.exec();
\r
173 command = dlg.textValue();
\r
174 if (ret == QDialog::Accepted && !command.isEmpty()) {
\r
175 QProcess process(this);
\r
176 process.setWorkingDirectory(fp->dir()->absolutePath());
\r
177 if (!process.startDetached(command)) {
\r
178 QMessageBox::critical(
\r
181 tr("コマンドの実行に失敗しました。<br/>") + command);
\r
187 /// \brief MainWindow::onActionExec
\r
189 /// アプリケーションで開きます(Shift + Enter)
\r
191 void MainWindow::onActionExec()
\r
193 FolderPanel *fp = activePanel();
\r
199 for (int n = 0; n < fp->fileTable()->rowCount(); n++) {
\r
200 if (fp->fileTable()->item(n, 0)->checkState() == Qt::Checked) {
\r
201 QString path = fp->fileTable()->item(n, 1)->text();
\r
202 path = fp->dir()->absoluteFilePath(path);
\r
203 path = QDir::toNativeSeparators(path);
\r
204 QDesktopServices::openUrl(QUrl("file:///" + path));
\r
210 // int row = fp->fileTable()->currentIndex().row();
\r
211 int row = fp->fileTable()->currentRow();
\r
212 QString path = fp->fileTable()->item(row, 1)->text();
\r
213 path = fp->dir()->absoluteFilePath(path);
\r
214 path = QDir::toNativeSeparators(path);
\r
215 QDesktopServices::openUrl(QUrl("file:///" + path));
\r
220 /// \brief MainWindow::onActionOpen
\r
222 /// フォルダを開きます(Enter)
\r
224 void MainWindow::onActionOpen()
\r
226 FolderPanel *fp = activePanel();
\r
231 // int row = fp->fileTable()->currentIndex().row();
\r
232 int row = fp->fileTable()->currentRow();
\r
233 QString path = fp->fileTable()->item(row, 1)->text();
\r
234 path = fp->dir()->absoluteFilePath(path);
\r
235 QFileInfo info(path);
\r
237 if (info.isDir()) {
\r
238 fp->setCurrentFolder(path);
\r
243 /// \brief MainWindow::onActionQuit
\r
245 /// アプリケーションを終了します(Q)
\r
247 void MainWindow::onActionQuit()
\r
253 /// \brief MainWindow::onActionSetting
\r
255 /// 環境設定ダイアログを表示します(Z)
\r
257 void MainWindow::onActionSetting()
\r
259 QMessageBox::information(this, tr("情報"), tr("環境設定機能は未実装です。"));
\r
263 /// \brief MainWindow::on_mark_All_triggered
\r
265 /// すべてマークします(Shift + A)
\r
267 void MainWindow::onMarkAll()
\r
269 FolderPanel *fp = activePanel();
\r
275 if (fp->fileTable()->item(row, 1)->text() == "..") {
\r
279 for (; row < fp->fileTable()->rowCount(); row++) {
\r
280 fp->fileTable()->item(row, 0)->setCheckState(Qt::Checked);
\r
285 /// \brief MainWindow::onMarkAllFiles
\r
287 /// すべての「ファイル」をマークします(A)
\r
289 void MainWindow::onMarkAllFiles()
\r
291 FolderPanel *fp = activePanel();
\r
297 if (fp->fileTable()->item(row, 1)->text() == "..") {
\r
301 for (; row < fp->fileTable()->rowCount(); row++) {
\r
302 QString path = fp->fileTable()->item(row, 1)->text();
\r
303 path = fp->dir()->absoluteFilePath(path);
\r
305 QFileInfo info(path);
\r
306 if (info.isDir()) {
\r
307 fp->fileTable()->item(row, 0)->setCheckState(Qt::Unchecked);
\r
310 fp->fileTable()->item(row, 0)->setCheckState(Qt::Checked);
\r
316 /// \brief MainWindow::onMarkAllOff
\r
318 /// すべてのマークを解除します(U)
\r
320 void MainWindow::onMarkAllOff()
\r
322 FolderPanel *fp = activePanel();
\r
328 if (fp->fileTable()->item(row, 1)->text() == "..") {
\r
332 for (; row < fp->fileTable()->rowCount(); row++) {
\r
333 fp->fileTable()->item(row, 0)->setCheckState(Qt::Unchecked);
\r
338 /// \brief MainWindow::onMarkInvert
\r
342 void MainWindow::onMarkInvert()
\r
344 FolderPanel *fp = activePanel();
\r
350 if (fp->fileTable()->item(row, 1)->text() == "..") {
\r
354 for (; row < fp->fileTable()->rowCount(); row++) {
\r
355 QTableWidgetItem *item = fp->fileTable()->item(row, 0);
\r
356 if (item->checkState() == Qt::Checked) {
\r
357 item->setCheckState(Qt::Unchecked);
\r
360 item->setCheckState(Qt::Checked);
\r
366 /// \brief MainWindow::onMarkToggle
\r
368 /// マークを設定または解除します(Space)
\r
370 void MainWindow::onMarkToggle()
\r
372 FolderPanel *fp = activePanel();
\r
377 // int row = fp->fileTable()->currentIndex().row();
\r
378 int row = fp->fileTable()->currentRow();
\r
379 QTableWidgetItem *item = fp->fileTable()->item(row, 0);
\r
380 if (fp->fileTable()->item(row, 1)->text() != "..") {
\r
381 if (item->checkState() == Qt::Checked) {
\r
382 item->setCheckState(Qt::Unchecked);
\r
385 item->setCheckState(Qt::Checked);
\r
388 // 最終行でなければ、次のアイテムに移動する
\r
389 if (row < fp->fileTable()->rowCount() - 1) {
\r
390 QModelIndex nextIndex = fp->fileTable()->model()->index(row + 1, 1);
\r
391 fp->fileTable()->setCurrentIndex(nextIndex);
\r
396 /// \brief MainWindow::onMoveCursorDown
\r
398 /// カーソルを下に移動します(J)
\r
400 void MainWindow::onMoveCursorDown()
\r
402 FolderPanel *fp = activePanel();
\r
407 // int row = fp->fileTable()->currentIndex().row();
\r
408 int row = fp->fileTable()->currentRow();
\r
409 if (row < fp->fileTable()->rowCount() - 1) {
\r
410 QModelIndex nextIndex = fp->fileTable()->model()->index(row + 1, 1);
\r
411 fp->fileTable()->setCurrentIndex(nextIndex);
\r
416 /// \brief MainWindow::onMoveCursorUp
\r
418 /// カーソルを上に移動します(K)
\r
420 void MainWindow::onMoveCursorUp()
\r
422 FolderPanel *fp = activePanel();
\r
427 // int row = fp->fileTable()->currentIndex().row();
\r
428 int row = fp->fileTable()->currentRow();
\r
430 QModelIndex nextIndex = fp->fileTable()->model()->index(row - 1, 1);
\r
431 fp->fileTable()->setCurrentIndex(nextIndex);
\r
436 /// \brief MainWindow::onMoveCursorBegin
\r
438 /// カーソルを先頭に移動します(G)
\r
440 void MainWindow::onMoveCursorBegin()
\r
442 FolderPanel *fp = activePanel();
\r
447 QModelIndex nextIndex = fp->fileTable()->model()->index(0, 1);
\r
448 fp->fileTable()->setCurrentIndex(nextIndex);
\r
452 /// \brief MainWindow::onMoveCursorEnd
\r
454 /// カーソルを末尾に移動します(Shift + G)
\r
455 void MainWindow::onMoveCursorEnd()
\r
457 FolderPanel *fp = activePanel();
\r
462 int row = fp->fileTable()->rowCount() - 1;
\r
463 QModelIndex nextIndex = fp->fileTable()->model()->index(row, 1);
\r
464 fp->fileTable()->setCurrentIndex(nextIndex);
\r
468 /// \brief MainWindow::onMoveBack
\r
470 /// 前の履歴に戻ります(Alt + ←)
\r
472 void MainWindow::onMoveBack()
\r
474 QMessageBox::information(this, tr("情報"), tr("履歴機能は未実装です。"));
\r
478 /// \brief MainWindow::onMoveForward
\r
480 /// 次の履歴に進みます(Alt + →)
\r
482 void MainWindow::onMoveForward()
\r
484 QMessageBox::information(this, tr("情報"), tr("履歴機能は未実装です。"));
\r
489 /// \brief MainWindow::onMoveHome
\r
491 /// ホームフォルダに移動します(H)
\r
493 void MainWindow::onMoveHome()
\r
495 FolderPanel *fp = activePanel();
\r
500 fp->setCurrentFolder(QDir::homePath());
\r
504 /// \brief MainWindow::onMoveJump
\r
506 /// フォルダを選択して移動します(Shift + J)
\r
507 void MainWindow::onMoveJump()
\r
509 FolderPanel *fp = activePanel();
\r
514 QString path = QFileDialog::getExistingDirectory(
\r
517 fp->dir()->absolutePath());
\r
518 if (!path.isEmpty()) {
\r
519 fp->setCurrentFolder(path);
\r
524 /// \brief MainWindow::onMoveOther
\r
526 /// キーボードフォーカスを他方のパネルに移動します(TAB)
\r
528 void MainWindow::onMoveOther()
\r
530 FolderPanel *fp = this->inactivePanel();
\r
532 fp->fileTable()->setFocus();
\r
537 /// \brief MainWindow::onMoveParent
\r
539 /// 親フォルダに移動します(Backspace)
\r
541 void MainWindow::onMoveParent()
\r
543 FolderPanel *fp = activePanel();
\r
548 if (!fp->dir()->isRoot()) {
\r
549 QString path = fp->dir()->absoluteFilePath("..");
\r
550 fp->setCurrentFolder(path);
\r
555 /// \brief MainWindow::onMoveRoot
\r
557 /// ルートフォルダに移動します()
\r
558 void MainWindow::onMoveRoot()
\r
560 FolderPanel *fp = activePanel();
\r
565 if (!fp->dir()->isRoot()) {
\r
566 fp->setCurrentFolder(QDir::rootPath());
\r
571 /// \brief MainWindow::onViewFromOther
\r
573 /// 隣のパネルと同じフォルダを表示します(O)
\r
575 void MainWindow::onViewFromOther()
\r
577 FolderPanel *fp1 = activePanel();
\r
578 FolderPanel *fp2 = inactivePanel();
\r
579 if (fp1 == NULL || fp2 == NULL) {
\r
583 fp1->setCurrentFolder(fp2->dir()->absolutePath());
\r
587 /// \brief MainWindow::onViewToOther
\r
589 /// 隣のパネルに同じフォルダを表示します(Shift + O)
\r
591 void MainWindow::onViewToOther()
\r
593 FolderPanel *fp1 = activePanel();
\r
594 FolderPanel *fp2 = inactivePanel();
\r
595 if (fp1 == NULL || fp2 == NULL) {
\r
599 fp2->setCurrentFolder(fp1->dir()->absolutePath());
\r
603 /// \brief MainWindow::onViewHidden
\r
605 /// 隠しファイルの表示/非表示を切り替えます(Shift + H)
\r
606 void MainWindow::onViewHidden()
\r
608 QSettings settings;
\r
609 bool checked = !settings.value("Common/ShowHidden", false).toBool();
\r
610 settings.setValue("Common/ShowHidden", checked);
\r
613 ui->folderPanel_L->dir()->setFilter(ui->folderPanel_L->dir()->filter() | QDir::Hidden);
\r
614 ui->folderPanel_R->dir()->setFilter(ui->folderPanel_R->dir()->filter() | QDir::Hidden);
\r
617 ui->folderPanel_L->dir()->setFilter(ui->folderPanel_L->dir()->filter() ^ QDir::Hidden);
\r
618 ui->folderPanel_R->dir()->setFilter(ui->folderPanel_R->dir()->filter() ^ QDir::Hidden);
\r
621 ui->folderPanel_L->setCurrentFolder(ui->folderPanel_L->dir()->absolutePath());
\r
622 ui->folderPanel_R->setCurrentFolder(ui->folderPanel_R->dir()->absolutePath());
\r
626 /// \brief MainWindow::onViewSwap
\r
628 /// パネルの表示内容を交換します(W)
\r
630 void MainWindow::onViewSwap()
\r
632 FolderPanel *fp1 = activePanel();
\r
633 FolderPanel *fp2 = inactivePanel();
\r
634 if (fp1 == NULL || fp2 == NULL) {
\r
638 QString path1 = fp1->dir()->absolutePath();
\r
639 QString path2 = fp2->dir()->absolutePath();
\r
641 fp1->setCurrentFolder(path2);
\r
642 fp2->setCurrentFolder(path1);
\r
645 void MainWindow::onCmdCopy()
\r
647 FolderPanel *fp = activePanel();
\r
652 QStringList list = selectedItems(fp);
\r
653 if (list.isEmpty()) {
\r
657 CopyWorker *worker = new CopyWorker();
\r
658 connect(worker, SIGNAL(askOverWrite(bool*,int*,int*,QString*,QString,QString)),
\r
659 this, SLOT(onAskOverWrite(bool*,int*,int*,QString*,QString,QString)));
\r
660 worker->setCopyList(&list);
\r
661 worker->setTargetDir(inactivePanel()->dir()->absolutePath());
\r
663 OperationDialog opDlg(this);
\r
664 opDlg.setWindowTitle(tr("コピー"));
\r
665 opDlg.setWorker(worker);
\r
667 ui->folderPanel_L->UninstallWatcher();
\r
668 ui->folderPanel_R->UninstallWatcher();
\r
670 ui->folderPanel_L->setCurrentFolder(ui->folderPanel_L->dir()->absolutePath());
\r
671 ui->folderPanel_R->setCurrentFolder(ui->folderPanel_R->dir()->absolutePath());
\r
675 void MainWindow::onAskOverWrite(bool *bOk, int *prevCopyMethod, int *copyMethod,
\r
676 QString *alias, const QString srcPath,
\r
677 const QString tgtPath)
\r
679 OverWriteDialog dlg;
\r
680 dlg.setCopyMethod(*prevCopyMethod);
\r
681 dlg.setSameMethodChecked(*copyMethod != OverWriteDialog::Undefined);
\r
682 dlg.setFileInfo(srcPath, tgtPath);
\r
683 if (dlg.exec() == QDialog::Rejected) {
\r
687 *prevCopyMethod = dlg.copyMethod();
\r
688 if (dlg.isSameMethodChecked()) {
\r
689 *copyMethod = *prevCopyMethod;
\r
691 *alias = dlg.alias();
\r
694 CopyWorker *worker = static_cast<CopyWorker*>(sender());
\r
695 worker->endAsking();
\r
699 /// \brief MainWindow::onCmdDelete
\r
703 void MainWindow::onCmdDelete()
\r
705 FolderPanel *fp = activePanel();
\r
710 QStringList list = selectedItems(fp);
\r
711 if (list.isEmpty()) {
\r
716 if (list.size() == 1) {
\r
717 msg = QFileInfo(list.at(0)).fileName();
\r
720 msg = tr("%1個のアイテム").arg(list.size());
\r
722 int ret = QMessageBox::question(
\r
725 msg + tr("を削除します<br/>よろしいですか?"));
\r
726 if (ret == QMessageBox::Yes) {
\r
727 DeleteWorker *worker = new DeleteWorker();
\r
728 worker->setDeleteList(&list);
\r
730 OperationDialog opDlg(this);
\r
731 opDlg.setWindowTitle(tr("削除"));
\r
732 opDlg.setWorker(worker);
\r
734 ui->folderPanel_L->UninstallWatcher();
\r
735 ui->folderPanel_R->UninstallWatcher();
\r
737 ui->folderPanel_L->setCurrentFolder(ui->folderPanel_L->dir()->absolutePath());
\r
738 ui->folderPanel_R->setCurrentFolder(ui->folderPanel_R->dir()->absolutePath());
\r
743 /// \brief MainWindow::onCmdNewFile
\r
747 void MainWindow::onCmdNewFile()
\r
749 FolderPanel *fp = activePanel();
\r
755 QString name = QInputDialog::getText(
\r
762 if (bOk && !name.isEmpty()) {
\r
763 QFile file(fp->dir()->absoluteFilePath(name));
\r
764 if (!file.open(QIODevice::WriteOnly)) {
\r
765 QMessageBox::critical(this,
\r
767 tr("ファイルの作成に失敗しました。"));
\r
776 /// \brief MainWindow::onCmdNewFolder
\r
780 void MainWindow::onCmdNewFolder()
\r
782 FolderPanel *fp = activePanel();
\r
788 QString name = QInputDialog::getText(
\r
795 if (bOk && !name.isEmpty()) {
\r
796 if (!fp->dir()->mkpath(name)) {
\r
797 QMessageBox::critical(this,
\r
799 tr("フォルダの作成に失敗しました。"));
\r
805 /// \brief MainWindow::onCmdRename
\r
809 void MainWindow::onCmdRename()
\r
811 FolderPanel *fp = activePanel();
\r
816 QStringList list = selectedItems(fp);
\r
817 if (list.isEmpty()) {
\r
821 IRenameDialog *dlg;
\r
822 if (list.size() == 1) {
\r
823 dlg = new RenameSingleDialog(this);
\r
826 dlg = new RenameMultiDialog(this);
\r
828 dlg->setWorkingDirectory(fp->dir()->absolutePath());
\r
829 dlg->setNames(list);
\r
830 int dlgResult = dlg->exec();
\r
831 if (dlgResult == QDialog::Accepted && !dlg->renameMap().isEmpty()) {
\r
832 RenameWorker *worker = new RenameWorker();
\r
833 worker->setRenameMap(&dlg->renameMap());
\r
835 OperationDialog opDlg(this);
\r
836 opDlg.setWindowTitle(tr("名前を変更"));
\r
837 opDlg.setWorker(worker);
\r
839 ui->folderPanel_L->UninstallWatcher();
\r
840 ui->folderPanel_R->UninstallWatcher();
\r
842 ui->folderPanel_L->setCurrentFolder(ui->folderPanel_L->dir()->absolutePath());
\r
843 ui->folderPanel_R->setCurrentFolder(ui->folderPanel_R->dir()->absolutePath());
\r
848 /// \brief MainWindow::onHelpAbout
\r
850 /// アプリケーションの概要を表示します(?)
\r
852 void MainWindow::onHelpAbout()
\r
854 QMessageBox::about(
\r
857 tr("<h3>Gefu Ver0.00</h3>"
\r
858 "<center>Gefu is Experimental File Utility.<br/>"
\r
859 "(げふぅは実験的なファイルユーティリティです)</center>"
\r
860 "<p>Copyright 2014 @miyabi_satoh All rights reserved.</p>"));
\r
863 QStringList MainWindow::selectedItems(FolderPanel *fp)
\r
866 for (int n = 0; n < fp->fileTable()->rowCount(); n++) {
\r
867 if (fp->fileTable()->item(n, 0)->checkState() == Qt::Checked) {
\r
868 list << fp->dir()->absoluteFilePath(fp->fileTable()->item(n, 1)->text());
\r
872 if (list.isEmpty()) {
\r
873 int row = fp->fileTable()->currentRow();
\r
874 QString name = fp->fileTable()->item(row, 1)->text();
\r
875 if (name != "..") {
\r
876 list << fp->dir()->absoluteFilePath(name);
\r