#include "preferencedialog.h"\r
#include "folderview.h"\r
#include "searchbox.h"\r
-#include "locationbox.h"\r
#include "copymoveworker.h"\r
#include "operationdialog.h"\r
#include "overwritedialog.h"\r
#include "simpleimageview.h"\r
#include "mainwindow.h"\r
#include "ui_mainwindow.h"\r
+#include "bookmarkdialog.h"\r
\r
#include <QCheckBox>\r
#include <QCloseEvent>\r
MainWindow::MainWindow(QWidget *parent) :\r
QMainWindow(parent),\r
ui(new Ui::MainWindow),\r
- m_focusedView(NULL),\r
+ m_activeView(NULL),\r
m_overwriteDialog(NULL),\r
m_viewMode(ModeBasic)\r
{\r
fp->folderView()->setObjectName(QString("folderView%1").arg(i));\r
\r
fp->initialize(this);\r
+ fp->updateAppearance(i == 2);\r
}\r
\r
QSettings settings;\r
+ // ブックマークメニューを初期化する\r
+ initBookmark();\r
+\r
// メニュー項目の状態を初期化する\r
ui->view_Hidden->setChecked(settings.value(IniKey_ShowHidden).toBool());\r
ui->view_System->setChecked(settings.value(IniKey_ShowSystem).toBool());\r
- ui->action_OpenEditor->setEnabled(!settings.value(IniKey_EditorPath).toString().isEmpty());\r
- ui->action_OpenTerminal->setEnabled(!settings.value(IniKey_TerminalPath).toString().isEmpty());\r
\r
// 追加のショートカットキーを設定する\r
QList<QKeySequence> shortcuts;\r
if (now == ui->pane1->folderPanel()->folderView() ||\r
now == ui->pane2->folderPanel()->folderView())\r
{\r
- FolderView *view = static_cast<FolderView*>(now);\r
- ui->statusBar->showMessage(view->currentItem().absoluteFilePath());\r
+ m_activeView = qobject_cast<FolderView*>(now);\r
+ ui->statusBar->showMessage(m_activeView->currentItem().absoluteFilePath());\r
+ m_activeView->parentPanel()->updateAppearance(false);\r
+ otherSideFolderView(m_activeView)->parentPanel()->updateAppearance(true);\r
}\r
\r
if (now) {\r
{\r
qDebug() << "MainWindow::executeCommand";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QFileInfoList list = view->selectedItems();\r
+ QFileInfoList list = m_activeView->selectedItems();\r
QString command = QString::null;\r
foreach (const QFileInfo &info, list) {\r
#ifdef Q_OS_MAC\r
int ret = dlg.exec();\r
command = dlg.textValue();\r
if (ret == QDialog::Accepted && !command.isEmpty()) {\r
- startProcess(command, view->dir(), tr("コマンドの実行に失敗しました。"));\r
+ startProcess(command, m_activeView->dir(), tr("コマンドの実行に失敗しました。"));\r
}\r
}\r
\r
-void MainWindow::historyBack()\r
+void MainWindow::expandLeft()\r
{\r
- qDebug() << "MainWindow::historyBack();";\r
+ qDebug() << "MainWindow::expandLeft();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
+ QList<int> sizes = ui->splitter->sizes();\r
+ QList<int> newSizes;\r
+\r
+ newSizes << sizes[0] + 30;\r
+ newSizes << sizes[1] - 30;\r
+\r
+ ui->splitter->setSizes(newSizes);\r
\r
- if (view->historyBack()) {\r
- updateActions();\r
- }\r
}\r
\r
-void MainWindow::historyForward()\r
+void MainWindow::expandRight()\r
{\r
- qDebug() << "MainWindow::historyForward();";\r
+ qDebug() << "MainWindow::expandLeft();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
+ QList<int> sizes = ui->splitter->sizes();\r
+ QList<int> newSizes;\r
+\r
+ newSizes << sizes[0] - 30;\r
+ newSizes << sizes[1] + 30;\r
+\r
+ ui->splitter->setSizes(newSizes);\r
\r
- if (view->historyForward()) {\r
- updateActions();\r
- }\r
}\r
\r
-void MainWindow::itemFound()\r
+void MainWindow::historyBack()\r
{\r
- qDebug() << "MainWindow::itemFound";\r
-\r
- SearchBox *box = sender()->parent()->findChild<SearchBox*>("searchBox");\r
- Q_CHECK_PTR(box);\r
+ qDebug() << "MainWindow::historyBack();";\r
\r
- QPalette pal = box->palette();\r
- pal.setColor(QPalette::Text, QPalette().text().color());\r
- box->setPalette(pal);\r
+ if (m_activeView->historyBack()) {\r
+ updateActions();\r
+ }\r
}\r
\r
-void MainWindow::itemNotFound()\r
+void MainWindow::historyForward()\r
{\r
- qDebug() << "MainWindow::itemNotFound";\r
-\r
- SearchBox *box = sender()->parent()->findChild<SearchBox*>("searchBox");\r
- Q_CHECK_PTR(box);\r
+ qDebug() << "MainWindow::historyForward();";\r
\r
- QPalette pal = box->palette();\r
- pal.setColor(QPalette::Text, Qt::red);\r
- box->setPalette(pal);\r
+ if (m_activeView->historyForward()) {\r
+ updateActions();\r
+ }\r
}\r
\r
void MainWindow::markAll()\r
{\r
qDebug() << "MainWindow::markAll();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->setCheckStateAll(true);\r
+ m_activeView->setCheckStateAll(Qt::Checked);\r
}\r
\r
void MainWindow::markAllFiles()\r
{\r
qDebug() << "MainWindow::markAllFiles();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->setCheckStateAllFiles();\r
+ m_activeView->setCheckStateAllFiles();\r
}\r
\r
void MainWindow::markAllOff()\r
{\r
qDebug() << "MainWindow::markAllOff();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->setCheckStateAll(false);\r
+ m_activeView->setCheckStateAll(Qt::Unchecked);\r
}\r
\r
void MainWindow::markInvert()\r
{\r
qDebug() << "MainWindow::markInvert();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->invertCheckState();\r
+ m_activeView->invertCheckState();\r
}\r
\r
void MainWindow::markToggle()\r
{\r
qDebug() << "MainWindow::markToggle();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->toggleCheckState(view->currentIndex());\r
+ m_activeView->toggleCheckState(m_activeView->currentIndex());\r
}\r
\r
void MainWindow::moveItems()\r
{\r
qDebug() << "MainWindow::moveItems";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QFileInfoList list = view->selectedItems();\r
+ QFileInfoList list = m_activeView->selectedItems();\r
if (list.isEmpty()) {\r
return;\r
}\r
\r
- QSettings settings;\r
- if (settings.value(IniKey_ConfirmMove).toBool()) {\r
- if (QMessageBox::question(this, tr("確認"), tr("移動を実行しますか?"))\r
- != QMessageBox::Yes)\r
- {\r
- return;\r
- }\r
- }\r
-\r
- // 上書き確認ダイアログを初期化する\r
- m_overwriteDialog->reset();\r
-\r
- // ワーカースレッドを作成する\r
- FolderView *other = otherSideFolderView(view);\r
- CopyMoveWorker *worker = new CopyMoveWorker();\r
- connect(worker, SIGNAL(askOverWrite(QString*,QString*,QString,QString)),\r
- this, SLOT(askOverWrite(QString*,QString*,QString,QString)));\r
- worker->setCopyList(&list);\r
- worker->setTargetDir(other->dir());\r
- worker->setMoveMode(true);\r
-\r
- // 進捗ダイアログを表示して、処理を開始する\r
- OperationDialog opDlg(this);\r
- opDlg.setWindowTitle(tr("移動"));\r
- opDlg.setWorker(worker);\r
- opDlg.setAutoClose(settings.value(IniKey_AutoCloseMove).toBool());\r
+ int row = m_activeView->currentIndex().row();\r
\r
- opDlg.exec();\r
+ QString tgtPath = otherSideFolderView(m_activeView)->dir();\r
+ moveItems(list, tgtPath);\r
+ m_activeView->refresh();\r
\r
- settings.setValue(IniKey_AutoCloseMove, opDlg.autoClose());\r
-\r
- // 念のため、リフレッシュ\r
-// ui->folderView1->refresh();\r
-// ui->folderView2->refresh();\r
+ if (row >= m_activeView->model()->rowCount()) {\r
+ row = m_activeView->model()->rowCount() - 1;\r
+ }\r
+ m_activeView->setCurrentIndex(m_activeView->model()->index(row, 1));\r
}\r
\r
+\r
void MainWindow::leftKeyPress()\r
{\r
qDebug() << "MainWindow::leftKeyPress();";\r
}\r
}\r
\r
-void MainWindow::returnPressInSearchBox()\r
-{\r
- qDebug() << "MainWindow::returnPressInSearchBox";\r
-\r
- if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {\r
- emit ui->action_SearchPrev->triggered();\r
- }\r
- else {\r
- emit ui->action_SearchNext->triggered();\r
- }\r
-}\r
-\r
void MainWindow::showFileInfo(const QString &str)\r
{\r
qDebug() << "MainWindow::showFileInfo();" << str;\r
QLabel *label = ui->statusBar->findChild<QLabel*>("Right");\r
Q_CHECK_PTR(label);\r
\r
-// label->resize(QFontMetrics(label->font()).boundingRect(str).width(),\r
-// label->height());\r
label->setText(str);\r
}\r
\r
{\r
qDebug() << "MainWindow::chooseFolder();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
QString path = QFileDialog::getExistingDirectory(\r
- this, tr("フォルダを選択"), view->dir());\r
+ this, tr("フォルダを選択"), m_activeView->dir());\r
if (!path.isEmpty()) {\r
- view->setPath(path, true);\r
+ m_activeView->setPath(path, true);\r
updateActions();\r
}\r
}\r
{\r
qDebug() << "MainWindow::copyFilenameToClipboard();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
QClipboard *clipboard = QApplication::clipboard();\r
- clipboard->setText(view->currentItem().fileName());\r
+ clipboard->setText(m_activeView->currentItem().fileName());\r
}\r
\r
void MainWindow::copyFullpathTpClipboard()\r
{\r
qDebug() << "MainWindow::copyFullpathTpClipboard();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
QClipboard *clipboard = QApplication::clipboard();\r
- clipboard->setText(view->currentItem().absoluteFilePath());\r
+ clipboard->setText(m_activeView->currentItem().absoluteFilePath());\r
}\r
\r
void MainWindow::askOverWrite(QString *copyMethod,\r
updateActions();\r
}\r
\r
-void MainWindow::dropAccept(const QFileInfoList &list)\r
+void MainWindow::dropAccept(const QFileInfoList &list, QDropEvent *event)\r
{\r
qDebug() << "MainWindow::dropAccept();";\r
\r
FolderView *view = static_cast<FolderView*>(sender());\r
Q_CHECK_PTR(view);\r
\r
- copyItems(list, view->dir());\r
+ bool move = false;\r
+ QMenu menu(this);\r
+ QAction *actCopy = menu.addAction(tr("コピー"));\r
+ QAction *actMove = menu.addAction(tr("移動"));\r
+ menu.addSeparator();\r
+ menu.addAction(tr("キャンセル"));\r
+\r
+ QAction *selected = menu.exec(view->mapToGlobal(event->pos()));\r
+ if (selected == actMove) {\r
+ moveItems(list, view->dir());\r
+ }\r
+ else if (selected == actCopy) {\r
+ copyItems(list, view->dir());\r
+ }\r
}\r
\r
void MainWindow::copyItems(const QFileInfoList &list, const QString &tgtDir)\r
{\r
- qDebug() << "MainWindow::copyItems();";\r
+ qDebug() << "MainWindow::copyItems();" << tgtDir;\r
\r
QSettings settings;\r
if (settings.value(IniKey_ConfirmCopy).toBool()) {\r
opDlg.exec();\r
\r
settings.setValue(IniKey_AutoCloseCopy, opDlg.autoClose());\r
+}\r
+\r
+void MainWindow::moveItems(const QFileInfoList &list, const QString &tgtDir)\r
+{\r
+ qDebug() << "MainWindow::moveItems();" << tgtDir;\r
+\r
+ QSettings settings;\r
+ if (settings.value(IniKey_ConfirmMove).toBool()) {\r
+ if (QMessageBox::question(this, tr("確認"), tr("移動を実行しますか?"))\r
+ != QMessageBox::Yes)\r
+ {\r
+ return;\r
+ }\r
+ }\r
+\r
+ // 上書き確認ダイアログを初期化する\r
+ m_overwriteDialog->reset();\r
\r
- // 念のため、リフレッシュ\r
-// ui->folderView1->refresh();\r
-// ui->folderView2->refresh();\r
+ // ワーカースレッドを作成する\r
+ CopyMoveWorker *worker = new CopyMoveWorker();\r
+ connect(worker, SIGNAL(askOverWrite(QString*,QString*,QString,QString)),\r
+ this, SLOT(askOverWrite(QString*,QString*,QString,QString)));\r
+ worker->setCopyList(&list);\r
+ worker->setTargetDir(tgtDir);\r
+ worker->setMoveMode(true);\r
+\r
+ // 進捗ダイアログを表示して、処理を開始する\r
+ OperationDialog opDlg(this);\r
+ opDlg.setWindowTitle(tr("移動"));\r
+ opDlg.setWorker(worker);\r
+ opDlg.setAutoClose(settings.value(IniKey_AutoCloseMove).toBool());\r
+\r
+ opDlg.exec();\r
+\r
+ settings.setValue(IniKey_AutoCloseMove, opDlg.autoClose());\r
}\r
\r
void MainWindow::copyItems()\r
{\r
qDebug() << "MainWindow::copyItems";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QFileInfoList list = view->selectedItems();\r
+ QFileInfoList list = m_activeView->selectedItems();\r
if (list.isEmpty()) {\r
return;\r
}\r
\r
- QString tgtPath = otherSideFolderView(view)->dir();\r
+ QString tgtPath = otherSideFolderView(m_activeView)->dir();\r
copyItems(list, tgtPath);\r
}\r
\r
{\r
qDebug() << "MainWindow::createFile";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
bool bOk;\r
QString name = QInputDialog::getText(\r
this, tr("ファイルを作成"), tr("ファイル名:"),\r
return;\r
}\r
\r
- QDir dir(view->dir());\r
+ QDir dir(m_activeView->dir());\r
QFile file(dir.absoluteFilePath(name));\r
if (!file.open(QIODevice::WriteOnly)) {\r
QMessageBox::critical(\r
if (settings.value(IniKey_OpenAfterCreateFile).toBool()) {\r
openEditor(dir.absoluteFilePath(name));\r
}\r
+\r
+ m_activeView->refresh();\r
+ m_activeView->searchItem(name);\r
}\r
}\r
\r
{\r
qDebug() << "MainWindow::createFolder";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
bool bOk;\r
QString name = QInputDialog::getText(\r
this, tr("フォルダを作成"), tr("フォルダ名:"),\r
return;\r
}\r
\r
- QDir dir(view->dir());\r
+ QDir dir(m_activeView->dir());\r
if (!dir.mkpath(name)) {\r
QMessageBox::critical(\r
this, tr("エラー"),\r
else {\r
QSettings settings;\r
if (settings.value(IniKey_MoveAfterCreateFolder).toBool()) {\r
- view->setPath(dir.absoluteFilePath(name), true);\r
+ m_activeView->setPath(dir.absoluteFilePath(name), true);\r
}\r
+\r
+ m_activeView->refresh();\r
+ m_activeView->searchItem(name);\r
}\r
}\r
\r
{\r
qDebug() << "MainWindow::deleteItems";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QFileInfoList list = view->selectedItems();\r
+ QFileInfoList list = m_activeView->selectedItems();\r
if (list.isEmpty()) {\r
return;\r
}\r
opDlg.setWorker(worker);\r
opDlg.setAutoClose(settings.value(IniKey_AutoCloseDelete).toBool());\r
\r
+ int row = m_activeView->currentIndex().row();\r
+\r
opDlg.exec();\r
+ m_activeView->refresh();\r
\r
- settings.setValue(IniKey_AutoCloseDelete, opDlg.autoClose());\r
+ if (row >= m_activeView->model()->rowCount()) {\r
+ row = m_activeView->model()->rowCount() - 1;\r
+ }\r
+ m_activeView->setCurrentIndex(m_activeView->model()->index(row, 1));\r
\r
- // 念のため、リフレッシュ\r
-// ui->folderView1->refresh();\r
-// ui->folderView2->refresh();\r
+ settings.setValue(IniKey_AutoCloseDelete, opDlg.autoClose());\r
}\r
\r
void MainWindow::open(const QModelIndex &index)\r
{\r
Q_UNUSED(index);\r
- qDebug() << "MainWindow::open";\r
+ qDebug() << "MainWindow::open" << index;\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QFileInfo info = view->currentItem();\r
+ QFileInfo info = m_activeView->currentItem();\r
if (info.isDir()) {\r
- view->setPath(info.absoluteFilePath(), true);\r
+ m_activeView->setPath(info.absoluteFilePath(), true);\r
updateActions();\r
return;\r
}\r
\r
- setUpdatesEnabled(false);\r
-\r
- m_focusedView = view;\r
if (ui->pane3->setViewItem(info)) {\r
ui->pane3->setVisible(true);\r
ui->splitter->setVisible(false);\r
\r
setViewMode(ModeFullView);\r
- // focusChangeでupdateActionsされるので不要\r
-// updateActions();\r
}\r
else {\r
ui->pane3->setVisible(false);\r
+ if (index.isValid()) {\r
+ QString path = QDir::toNativeSeparators(info.absoluteFilePath());\r
+ QDesktopServices::openUrl(QUrl("file:///" + path));\r
+ }\r
}\r
-\r
- setUpdatesEnabled(true);\r
}\r
\r
void MainWindow::openEditor(const QString &path)\r
{\r
qDebug() << "MainWindow::openEditor";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
QSettings settings;\r
- QString exe = settings.value(IniKey_EditorPath).toString();\r
+ QString exe = settings.value(IniKey_PathEditor).toString();\r
if (exe.isEmpty()) {\r
QMessageBox::critical(\r
this, tr("エラー"),\r
\r
QFileInfoList list;\r
if (path.isEmpty()) {\r
- list = view->selectedItems();\r
+ list = m_activeView->selectedItems();\r
}\r
else {\r
list << path;\r
}\r
\r
+ QString files;\r
foreach (const QFileInfo &info, list) {\r
- QString opt = settings.value(IniKey_EditorOption).toString();\r
- replaceVars(opt, info);\r
-\r
+ files += " " + QQ(info.absoluteFilePath());\r
+ }\r
#ifdef Q_OS_MAC\r
- QString command = "open -a " + exe + " " + opt;\r
+ QString command = "open -a " + exe + files;\r
#else\r
- QString command = QQ(exe) + " " + opt;\r
+ QString command = exe + files;\r
#endif\r
- if (!startProcess(command, info.absolutePath(), tr("外部エディタの起動に失敗しました。"))) {\r
- break;\r
- }\r
- Sleep(100);\r
+ if (!startProcess(command, m_activeView->dir(), tr("外部エディタの起動に失敗しました。"))) {\r
+ qDebug() << command;\r
}\r
}\r
\r
{\r
qDebug() << "MainWindow::openTerminal";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
QSettings settings;\r
- QString exe = settings.value(IniKey_TerminalPath).toString();\r
+ QString exe = settings.value(IniKey_PathTerminal).toString();\r
if (exe.isEmpty()) {\r
QMessageBox::critical(\r
this, tr("エラー"),\r
return;\r
}\r
\r
- foreach (const QFileInfo &info, view->selectedItems()) {\r
- QString opt = settings.value(IniKey_TerminalOption).toString();\r
- replaceVars(opt, info);\r
+ QSet<QString> dirs;\r
+ foreach (const QFileInfo &info, m_activeView->selectedItems()) {\r
+ if (info.isDir()) {\r
+ dirs.insert(info.absoluteFilePath());\r
+ }\r
+ else {\r
+ dirs.insert(info.absolutePath());\r
+ }\r
+ }\r
\r
+ foreach (const QString &dir, dirs) {\r
#ifdef Q_OS_MAC\r
- QString command = "open -a " + QQ(exe) + " --args " + opt;\r
+ QString command = "open -n -a " + exe + " " + QQ(dir);\r
#else\r
- QString command = QQ(exe) + " " + opt;\r
+ QString command = exe + " " + QQ(dir);\r
#endif\r
- if (!startProcess(command, info.absolutePath(), tr("ターミナルの起動に失敗しました。"))) {\r
+ if (!startProcess(command, m_activeView->dir(), tr("ターミナルの起動に失敗しました。"))) {\r
+ qDebug() << command;\r
break;\r
}\r
- Sleep(100);\r
}\r
}\r
\r
+void MainWindow::openArchiver()\r
+{\r
+ qDebug() << "MainWindow::openArchiver";\r
+\r
+ QSettings settings;\r
+ QString exe = settings.value(IniKey_PathArchiver).toString();\r
+ if (exe.isEmpty()) {\r
+ QMessageBox::critical(\r
+ this, tr("エラー"),\r
+ tr("アーカイバのパスが未定義です。"));\r
+ return;\r
+ }\r
+\r
+ QString files;\r
+ foreach (const QFileInfo &info, m_activeView->selectedItems()) {\r
+ files += " " + QQ(info.absoluteFilePath());\r
+ }\r
+#ifdef Q_OS_MAC\r
+ QString command = "open -a " + exe + files;\r
+#else\r
+ QString command = exe + files;\r
+#endif\r
+ if (!startProcess(command, m_activeView->dir(), tr("アーカイバの起動に失敗しました。"))) {\r
+ qDebug() << command;\r
+ }\r
+}\r
+\r
+void MainWindow::openBookmark()\r
+{\r
+ qDebug() << "MainWindow::openBookmark();";\r
+\r
+ QAction *action = qobject_cast<QAction*>(sender());\r
+ Q_CHECK_PTR(action);\r
+\r
+ QSettings settings;\r
+ int i = action->data().toInt();\r
+ m_activeView->setPath(settings.value(IniKey_BookmarkEntryPath(i)).toString(), true);\r
+}\r
+\r
void MainWindow::refresh()\r
{\r
qDebug() << "MainWindow::refresh();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->refresh();\r
+ m_activeView->refresh();\r
}\r
\r
void MainWindow::renameItems()\r
{\r
qDebug() << "MainWindow::renameItems";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QFileInfoList list = view->selectedItems();\r
+ QFileInfoList list = m_activeView->selectedItems();\r
if (list.isEmpty()) {\r
return;\r
}\r
else {\r
dlg = new RenameMultiDialog(this);\r
}\r
- dlg->setWorkingDirectory(view->dir());\r
+ dlg->setWorkingDirectory(m_activeView->dir());\r
dlg->setNames(list);\r
int dlgResult = dlg->exec();\r
if (dlgResult != QDialog::Accepted || dlg->renameMap().isEmpty()) {\r
opDlg.setAutoClose(settings.value(IniKey_AutoCloseRename).toBool());\r
\r
opDlg.exec();\r
+ m_activeView->refresh();\r
+\r
+ QFileInfo info(dlg->renameMap().first());\r
+ m_activeView->searchItem(info.fileName());\r
\r
settings.setValue(IniKey_AutoCloseRename, opDlg.autoClose());\r
}\r
\r
-void MainWindow::retrieveFinish()\r
+void MainWindow::shellExecute()\r
{\r
- qDebug() << "MainWindow::retrieveFinish();";\r
+ qDebug() << "MainWindow::shellExecute";\r
\r
- ui->statusBar->showMessage(tr("レディ"), 5000);\r
+ foreach (const QFileInfo &info, m_activeView->selectedItems()) {\r
+ QString path = QDir::toNativeSeparators(info.absoluteFilePath());\r
+ QDesktopServices::openUrl(QUrl("file:///" + path));\r
+ }\r
}\r
\r
-void MainWindow::retrieveStart(const QString &path)\r
+void MainWindow::showBookmarkDialog()\r
{\r
- qDebug() << "MainWindow::retrieveStart();" << path;\r
+ qDebug() << "MainWindow::showBookmarkDialog();";\r
+\r
+ BookmarkDialog dlg(this);\r
+ dlg.setEditMode(false);\r
+ if (dlg.exec() == QDialog::Accepted) {\r
+ int n = dlg.selectedIndex();\r
\r
- ui->statusBar->showMessage(tr("ファイルリストを取得しています..."));\r
+ QSettings settings;\r
+ m_activeView->setPath(settings.value(IniKey_BookmarkEntryPath(n)).toString(), true);\r
+ }\r
}\r
\r
-void MainWindow::shellExecute()\r
+void MainWindow::editBookmark()\r
{\r
- qDebug() << "MainWindow::shellExecute";\r
+ qDebug() << "MainWindow::showBookmarkDialog();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
+ BookmarkDialog dlg(this);\r
+ dlg.setEditMode(true);\r
\r
- foreach (const QFileInfo &info, view->selectedItems()) {\r
- QString path = QDir::toNativeSeparators(info.absoluteFilePath());\r
- QDesktopServices::openUrl(QUrl("file:///" + path));\r
+ if (dlg.exec() == QDialog::Accepted) {\r
+ initBookmark();\r
}\r
}\r
\r
{\r
qDebug() << "MainWindow::showFilterDialog();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QString filters = view->nameFilters().join(" ");\r
+ QString filters = m_activeView->nameFilters().join(" ");\r
\r
QInputDialog dlg(this);\r
dlg.setInputMode(QInputDialog::TextInput);\r
dlg.resize(width() * 0.8, dlg.height());\r
\r
if (dlg.exec() == QDialog::Accepted) {\r
- static_cast<FolderPanel*>(view->parent())->setNameFilters(dlg.textValue());\r
- view->refresh();\r
+ static_cast<FolderPanel*>(m_activeView->parent())->setNameFilters(dlg.textValue());\r
+ int row = m_activeView->currentIndex().row();\r
+\r
+ m_activeView->refresh();\r
+\r
+ if (row >= m_activeView->model()->rowCount()) {\r
+ row = m_activeView->model()->rowCount() - 1;\r
+ }\r
+\r
+ m_activeView->setCurrentIndex(m_activeView->model()->index(row, 1));\r
+\r
}\r
}\r
\r
{\r
qDebug() << "MainWindow::showHistoryDialog();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- FolderView *vOther = otherSideFolderView(view);\r
+ FolderView *vOther = otherSideFolderView(m_activeView);\r
\r
HistoryDialog dlg(this);\r
- if (view->side() == "Left") {\r
+ if (m_activeView->side() == "Left") {\r
dlg.setDefaultLeft(true);\r
- dlg.setHistory(view->history(), vOther->history());\r
+ dlg.setHistory(m_activeView->history(), vOther->history());\r
}\r
else {\r
dlg.setDefaultLeft(false);\r
- dlg.setHistory(vOther->history(), view->history());\r
+ dlg.setHistory(vOther->history(), m_activeView->history());\r
}\r
\r
if (dlg.exec() == QDialog::Accepted) {\r
- if (view->side() == dlg.selectedSide()) {\r
- view->setHistoryIndexAt(dlg.selectedIndex());\r
+ if (m_activeView->side() == dlg.selectedSide()) {\r
+ m_activeView->setHistoryIndexAt(dlg.selectedIndex());\r
}\r
else {\r
- view->setPath(vOther->history()->at(dlg.selectedIndex()), true);\r
+ m_activeView->setPath(vOther->history()->at(dlg.selectedIndex()), true);\r
}\r
}\r
}\r
{\r
qDebug() << "MainWindow::showSortDialog();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
SortDialog dlg(this);\r
- dlg.setRightOrLeft(view->side());\r
+ dlg.setRightOrLeft(m_activeView->side());\r
\r
if (dlg.exec() == QDialog::Accepted) {\r
- view->setSorting();\r
- view->refresh();\r
+ m_activeView->setSorting();\r
+ m_activeView->refresh();\r
}\r
}\r
\r
+void MainWindow::splitCenter()\r
+{\r
+ qDebug() << "MainWindow::splitCenter();";\r
+\r
+ QList<int> sizes = ui->splitter->sizes();\r
+ int sizeTotal = sizes[0] + sizes[1];\r
+ sizes[0] = sizeTotal / 2;\r
+ sizes[1] = sizeTotal - sizes[0];\r
+ ui->splitter->setSizes(sizes);\r
+}\r
+\r
void MainWindow::swapView()\r
{\r
qDebug() << "MainWindow::swapView();";\r
{\r
qDebug() << "MainWindow::switchHalfMode();" << checked;\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
AnyView *pane = static_cast<AnyView*>(\r
- otherSideFolderView(view)->parent()->parent());\r
+ otherSideFolderView(m_activeView)->parent()->parent());\r
Q_CHECK_PTR(pane);\r
\r
if (checked) {\r
// ハーフモードへ移行する\r
setViewMode(ModeHalfView);\r
- pane->setViewItem(view->currentItem());\r
+ pane->setViewItem(m_activeView->currentItem());\r
}\r
else {\r
// ハーフモードを解除する\r
updateActions();\r
}\r
\r
-void MainWindow::searchItem(const QString &text)\r
-{\r
- qDebug() << "MainWindow::searchItem" << text;\r
-\r
- SearchBox *box = qobject_cast<SearchBox*>(qApp->focusWidget());\r
- Q_CHECK_PTR(box);\r
-\r
- if (text.right(1) == "/") {\r
- // '/'が入力されたら、検索終了\r
- box->setText(text.left(text.length() - 1));\r
- ui->action_Search->setChecked(false);\r
- }\r
- else {\r
- FolderPanel *fp = qobject_cast<FolderPanel*>(box->parent());\r
- Q_CHECK_PTR(fp);\r
-\r
- fp->folderView()->searchItem(box->text());\r
- }\r
-}\r
-\r
void MainWindow::searchNext()\r
{\r
qDebug() << "MainWindow::searchNext";\r
SearchBox *box = qobject_cast<SearchBox*>(qApp->focusWidget());\r
Q_CHECK_PTR(box);\r
\r
- FolderPanel *fp = qobject_cast<FolderPanel*>(box->parent());\r
- Q_CHECK_PTR(fp);\r
-\r
- fp->folderView()->searchNext(box->text());\r
+ m_activeView->searchNext(box->text());\r
}\r
\r
void MainWindow::searchPrev()\r
SearchBox *box = qobject_cast<SearchBox*>(qApp->focusWidget());\r
Q_CHECK_PTR(box);\r
\r
- FolderPanel *fp = qobject_cast<FolderPanel*>(box->parent());\r
- Q_CHECK_PTR(fp);\r
-\r
- fp->folderView()->searchPrev(box->text());\r
+ m_activeView->searchPrev(box->text());\r
}\r
\r
void MainWindow::setCursorToBegin()\r
{\r
qDebug() << "MainWindow::setCursorToBegin();";\r
\r
- QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Home, Qt::ControlModifier);\r
- QApplication::sendEvent(QApplication::focusWidget(), &event);\r
+ QKeyEvent event1 = QKeyEvent(QEvent::KeyPress, Qt::Key_Home, Qt::NoModifier);\r
+ QApplication::sendEvent(QApplication::focusWidget(), &event1);\r
+\r
+ QKeyEvent event2 = QKeyEvent(QEvent::KeyPress, Qt::Key_Home, Qt::ControlModifier);\r
+ QApplication::sendEvent(QApplication::focusWidget(), &event2);\r
}\r
\r
void MainWindow::cursorDown()\r
{\r
qDebug() << "MainWindow::setCursorToEnd();";\r
\r
- QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_End, Qt::ControlModifier);\r
- QApplication::sendEvent(QApplication::focusWidget(), &event);\r
+ QKeyEvent event1 = QKeyEvent(QEvent::KeyPress, Qt::Key_End, Qt::NoModifier);\r
+ QApplication::sendEvent(QApplication::focusWidget(), &event1);\r
+\r
+ QKeyEvent event2 = QKeyEvent(QEvent::KeyPress, Qt::Key_End, Qt::ControlModifier);\r
+ QApplication::sendEvent(QApplication::focusWidget(), &event2);\r
+}\r
+\r
+void MainWindow::setCursorToBeginOther()\r
+{\r
+ qDebug() << "MainWindow::setCursorToBeginOther();";\r
+\r
+ QKeyEvent event1 = QKeyEvent(QEvent::KeyPress, Qt::Key_Home, Qt::NoModifier);\r
+ sendEventOther(&event1);\r
+\r
+ QKeyEvent event2 = QKeyEvent(QEvent::KeyPress, Qt::Key_Home, Qt::ControlModifier);\r
+ sendEventOther(&event2);\r
+}\r
+\r
+void MainWindow::cursorDownOther()\r
+{\r
+ qDebug() << "MainWindow::cursorDownOther();";\r
+\r
+ QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier);\r
+ sendEventOther(&event);\r
+}\r
+\r
+void MainWindow::cursorUpOther()\r
+{\r
+ qDebug() << "MainWindow::cursorUpOther();";\r
+\r
+ QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier);\r
+ sendEventOther(&event);\r
+}\r
+\r
+void MainWindow::setCursorToEndOther()\r
+{\r
+ qDebug() << "MainWindow::setCursorToEndOther();";\r
+\r
+ QKeyEvent event1 = QKeyEvent(QEvent::KeyPress, Qt::Key_End, Qt::NoModifier);\r
+ sendEventOther(&event1);\r
+\r
+ QKeyEvent event2 = QKeyEvent(QEvent::KeyPress, Qt::Key_End, Qt::ControlModifier);\r
+ sendEventOther(&event2);\r
}\r
\r
void MainWindow::setFontSizeDown()\r
\r
void MainWindow::changeFontSize(int diff)\r
{\r
+ qDebug() << "MainWindow::changeFontSize(;";\r
+\r
QSettings settings;\r
QFont font;\r
\r
font.setPointSize(font.pointSize() + diff);\r
settings.setValue(IniKey_ViewFont, font);\r
\r
- ui->pane1->folderPanel()->folderView()->updateAppearance();\r
- ui->pane2->folderPanel()->folderView()->updateAppearance();\r
+ ui->pane1->folderPanel()->updateAppearance();\r
+ ui->pane2->folderPanel()->updateAppearance();\r
}\r
\r
// テキストビューのフォントサイズ変更\r
ui->pane2->textView()->updateAppearance();\r
ui->pane3->textView()->updateAppearance();\r
}\r
+\r
+ if (ui->pane1->imageView()->hasFocus() ||\r
+ ui->pane2->imageView()->hasFocus() ||\r
+ ui->pane3->imageView()->hasFocus())\r
+ {\r
+ ui->pane1->imageView()->changeScale(diff > 0);\r
+ ui->pane2->imageView()->changeScale(diff > 0);\r
+ ui->pane3->imageView()->changeScale(diff > 0);\r
+ }\r
+}\r
+\r
+void MainWindow::initBookmark()\r
+{\r
+ QSettings settings;\r
+ QFileIconProvider iconProvider;\r
+\r
+ ui->menu_Bookmark->clear();\r
+ ui->menu_Bookmark->addAction(ui->bookmark_Edit);\r
+ ui->menu_Bookmark->addSeparator();\r
+ int i = 0;\r
+ while (!settings.value(IniKey_BookmarkEntryName(i), "").toString().isEmpty()) {\r
+ QString path = settings.value(IniKey_BookmarkEntryPath(i)).toString();\r
+ QAction *action = new QAction(this);\r
+ action->setText(settings.value(IniKey_BookmarkEntryName(i)).toString());\r
+ action->setData(i);\r
+ action->setIcon(iconProvider.icon(QFileInfo(path)));\r
+ ui->menu_Bookmark->addAction(action);\r
+ connect(action, SIGNAL(triggered()), this, SLOT(openBookmark()));\r
+ i++;\r
+ }\r
+}\r
+\r
+void MainWindow::sendEventOther(QEvent *event)\r
+{\r
+ qDebug() << "MainWindow::sendEventOther();";\r
+\r
+ QWidget *widget = NULL;\r
+\r
+ if (m_viewMode & ModeBasic) {\r
+ // 検索ボックスにフォーカスがある場合も考慮して、\r
+ // FolderPanalを介してViewを取得する\r
+ FolderPanel *fp = qobject_cast<FolderPanel*>(qApp->focusWidget()->parentWidget());\r
+ Q_CHECK_PTR(fp);\r
+\r
+ widget = otherSideFolderView(fp->folderView());\r
+ }\r
+ else if (m_viewMode & ModeHalfView) {\r
+ AnyView *focusedView = qobject_cast<AnyView*>(qApp->focusWidget()->parentWidget());\r
+ if (!focusedView) {\r
+ focusedView = qobject_cast<AnyView*>(qApp->focusWidget()->parentWidget()->parentWidget());\r
+ }\r
+ Q_CHECK_PTR(focusedView);\r
+\r
+ if (focusedView == ui->pane1) {\r
+ widget = ui->pane2->visibleView();\r
+ }\r
+ else {\r
+ Q_ASSERT(focusedView == ui->pane2);\r
+ widget = ui->pane1->visibleView();\r
+ }\r
+ }\r
+ else {\r
+ return;\r
+ }\r
+\r
+ Q_CHECK_PTR(widget);\r
+ QApplication::sendEvent(widget, event);\r
}\r
\r
void MainWindow::setPathFromOther()\r
{\r
qDebug() << "MainWindow::setPathFromOther();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
+ FolderView *other = otherSideFolderView(m_activeView);\r
\r
- FolderView *other = otherSideFolderView(view);\r
-\r
- view->setPath(other->dir(), true);\r
+ m_activeView->setPath(other->dir(), true);\r
}\r
\r
void MainWindow::setPathToHome()\r
{\r
qDebug() << "MainWindow::setPathToHome();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->setPath(QDir::homePath(), true);\r
+ m_activeView->setPath(QDir::homePath(), true);\r
}\r
\r
void MainWindow::setPathToOther()\r
{\r
qDebug() << "MainWindow::setPathToOther();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- FolderView *other = otherSideFolderView(view);\r
+ FolderView *other = otherSideFolderView(m_activeView);\r
\r
- other->setPath(view->dir(), true);\r
+ other->setPath(m_activeView->dir(), true);\r
}\r
\r
void MainWindow::setPathToParent()\r
{\r
qDebug() << "MainWindow::setPathToParent();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- QDir dir(view->dir());\r
+ QDir dir(m_activeView->dir());\r
if (!dir.isRoot()) {\r
dir.cdUp();\r
- view->setPath(dir.absolutePath(), true);\r
+ m_activeView->setPath(dir.absolutePath(), true);\r
}\r
}\r
\r
{\r
qDebug() << "MainWindow::setPathToRoot();";\r
\r
- FolderView *view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
-\r
- view->setPath(QDir::rootPath(), true);\r
+ m_activeView->setPath(QDir::rootPath(), true);\r
}\r
\r
void MainWindow::toggleSearchBox(bool checked)\r
\r
if (checked) {\r
setViewMode(m_viewMode | ModeSearch);\r
- view = static_cast<FolderView*>(qApp->focusWidget());\r
- Q_CHECK_PTR(view);\r
\r
- box = view->parent()->findChild<SearchBox*>("searchBox");\r
+ box = m_activeView->parent()->findChild<SearchBox*>("searchBox");\r
Q_CHECK_PTR(box);\r
\r
box->setVisible(true);\r
}\r
}\r
\r
-//void MainWindow::openRequest(const QFileInfo &info)\r
-//{\r
-// m_focusedView = QApplication::focusWidget();\r
-\r
-// QFile file(info.absoluteFilePath());\r
-// if (file.open(QIODevice::ReadOnly)) {\r
-// ui->splitter->setVisible(false);\r
-// ui->textView->setVisible(true);\r
-// ui->textView->setFocus();\r
-// ui->textView->setSource(file.readAll());\r
-// file.close();\r
-// }\r
-// else {\r
-// QMessageBox::critical(\r
-// this, tr("エラー"),\r
-// tr("ファイルの読み込みに失敗しました。"));\r
-// }\r
-//}\r
-\r
void MainWindow::showPreferenceDialog()\r
{\r
qDebug() << "MainWindow::showPreferenceDialog";\r
\r
PreferenceDialog dlg(this);\r
if (dlg.exec() == QDialog::Accepted) {\r
- ui->pane1->folderPanel()->locationBox()->updateAppearance();\r
- ui->pane2->folderPanel()->locationBox()->updateAppearance();\r
- ui->pane1->folderPanel()->folderView()->updateAppearance();\r
- ui->pane2->folderPanel()->folderView()->updateAppearance();\r
+ bool dark1 = m_activeView != ui->pane1->folderPanel()->folderView();\r
+ bool dark2 = m_activeView != ui->pane2->folderPanel()->folderView();\r
+\r
+ ui->pane1->folderPanel()->updateAppearance(dark1);\r
+ ui->pane2->folderPanel()->updateAppearance(dark2);\r
ui->pane1->textView()->updateAppearance();\r
ui->pane2->textView()->updateAppearance();\r
ui->pane3->textView()->updateAppearance();\r
menu.addAction(ui->action_Exec);\r
menu.addAction(ui->action_OpenEditor);\r
menu.addAction(ui->action_OpenTerminal);\r
+ menu.addAction(ui->action_OpenArchiver);\r
+ menu.addSeparator();\r
+ menu.addAction(ui->cmd_Copy);\r
+ menu.addAction(ui->cmd_Move);\r
+ menu.addSeparator();\r
+ menu.addAction(ui->cmd_Delete);\r
menu.addSeparator();\r
menu.addAction(ui->copy_Filename);\r
menu.addAction(ui->copy_Fullpath);\r
+ menu.addSeparator();\r
+ menu.addAction(ui->cmd_Rename);\r
}\r
else {\r
menu.addAction(ui->move_Back);\r
menu.addAction(ui->move_Home);\r
menu.addAction(ui->move_Root);\r
menu.addAction(ui->move_Jump);\r
+ menu.addSeparator();\r
+ menu.addAction(ui->cmd_NewFile);\r
+ menu.addAction(ui->cmd_NewFolder);\r
}\r
\r
menu.exec(event->globalPos());\r
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(checkUpdateFinished(QNetworkReply*)));\r
}\r
#ifdef Q_OS_WIN\r
- manager->get(QNetworkRequest(QUrl("http://miyabi.rakusaba.jp/wp-content/uploads/gefu_latest_win.html")));\r
+ manager->get(QNetworkRequest(QUrl("http://gefu.sourceforge.jp/gefu_latest_win.html")));\r
#elif defined(Q_OS_MAC)\r
- manager->get(QNetworkRequest(QUrl("http://miyabi.rakusaba.jp/wp-content/uploads/gefu_latest_mac.html")));\r
+ manager->get(QNetworkRequest(QUrl("http://gefu.sourceforge.jp/gefu_latest_mac.html")));\r
#endif\r
}\r
\r
ui->statusBar->findChild<QLabel*>("Right")->setText("");\r
ui->pane3->setVisible(false);\r
ui->splitter->setVisible(true);\r
- m_focusedView->setFocus();\r
+ m_activeView->setFocus();\r
}\r
\r
void MainWindow::initActionConnections()\r
connect(ui->action_Open, SIGNAL(triggered()), this, SLOT(open()));\r
connect(ui->action_OpenEditor, SIGNAL(triggered()), this, SLOT(openEditor()));\r
connect(ui->action_OpenTerminal, SIGNAL(triggered()), this, SLOT(openTerminal()));\r
+ connect(ui->action_OpenArchiver, SIGNAL(triggered()), this, SLOT(openArchiver()));\r
connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(close()));\r
connect(ui->action_Search, SIGNAL(toggled(bool)), this, SLOT(toggleSearchBox(bool)));\r
connect(ui->action_SearchNext, SIGNAL(triggered()), this, SLOT(searchNext()));\r
connect(ui->move_Begin, SIGNAL(triggered()), this, SLOT(setCursorToBegin()));\r
connect(ui->move_Down, SIGNAL(triggered()), this, SLOT(cursorDown()));\r
connect(ui->move_End, SIGNAL(triggered()), this, SLOT(setCursorToEnd()));\r
+ connect(ui->move_Up, SIGNAL(triggered()), this, SLOT(cursorUp()));\r
+ connect(ui->move_BeginOther, SIGNAL(triggered()), this, SLOT(setCursorToBeginOther()));\r
+ connect(ui->move_DownOther, SIGNAL(triggered()), this, SLOT(cursorDownOther()));\r
+ connect(ui->move_EndOther, SIGNAL(triggered()), this, SLOT(setCursorToEndOther()));\r
+ connect(ui->move_UpOther, SIGNAL(triggered()), this, SLOT(cursorUpOther()));\r
connect(ui->move_Forward, SIGNAL(triggered()), this, SLOT(historyForward()));\r
connect(ui->move_History, SIGNAL(triggered()), this, SLOT(showHistoryDialog()));\r
connect(ui->move_Home, SIGNAL(triggered()), this, SLOT(setPathToHome()));\r
connect(ui->move_Jump, SIGNAL(triggered()), this, SLOT(chooseFolder()));\r
connect(ui->move_Parent, SIGNAL(triggered()), this, SLOT(setPathToParent()));\r
connect(ui->move_Root, SIGNAL(triggered()), this, SLOT(setPathToRoot()));\r
- connect(ui->move_Up, SIGNAL(triggered()), this, SLOT(cursorUp()));\r
connect(ui->view_Filter, SIGNAL(triggered()), this, SLOT(showFilterDialog()));\r
connect(ui->view_FontSizeDown, SIGNAL(triggered()), this, SLOT(setFontSizeDown()));\r
connect(ui->view_FontSizeUp, SIGNAL(triggered()), this, SLOT(setFontSizeUp()));\r
connect(ui->view_HalfMode, SIGNAL(toggled(bool)), this, SLOT(switchHalfMode(bool)));\r
connect(ui->view_Hidden, SIGNAL(toggled(bool)), this, SLOT(toggleShowHiddenFiles(bool)));\r
connect(ui->view_Refresh, SIGNAL(triggered()), this, SLOT(refresh()));\r
+\r
connect(ui->view_Sort, SIGNAL(triggered()), this, SLOT(showSortDialog()));\r
connect(ui->view_Swap, SIGNAL(triggered()), this, SLOT(swapView()));\r
connect(ui->view_System, SIGNAL(toggled(bool)), this, SLOT(toggleShowSystemFiles(bool)));\r
connect(ui->view_ToOther, SIGNAL(triggered()), this, SLOT(setPathToOther()));\r
+ connect(ui->bookmark_Edit, SIGNAL(triggered()), this, SLOT(editBookmark()));\r
+ connect(ui->bookmark_Show, SIGNAL(triggered()), this, SLOT(showBookmarkDialog()));\r
+ connect(ui->split_Center, SIGNAL(triggered()), this, SLOT(splitCenter()));\r
+ connect(ui->expand_Left, SIGNAL(triggered()), this, SLOT(expandLeft()));\r
+ connect(ui->expand_Right, SIGNAL(triggered()), this, SLOT(expandRight()));\r
}\r
\r
void MainWindow::replaceVars(QString &str, const QFileInfo info)\r
FolderView *view;\r
if ((view = qobject_cast<FolderView*>(w))) {\r
setEnabledAllActions(true);\r
+ qDebug() << ">>>>> フォルダビューの共通メニュー設定 <<<<<";\r
ui->action_SearchNext->setEnabled(false);\r
ui->action_SearchPrev->setEnabled(false);\r
\r
}\r
}\r
\r
+ if (info.fileName() == ".." && view->checkedItems().isEmpty()) {\r
+ // ファイル操作を抑止\r
+ ui->cmd_Copy->setEnabled(false);\r
+ ui->cmd_Delete->setEnabled(false);\r
+ ui->cmd_Move->setEnabled(false);\r
+ ui->cmd_Rename->setEnabled(false);\r
+ }\r
+\r
if (m_viewMode & ModeBasic) {\r
qDebug() << ">>>>> 通常モードのメニュー設定 <<<<<";\r
ui->action_SearchNext->setEnabled(false);\r
ui->move_Forward->setEnabled(!view->history()->isEnd());\r
\r
QSettings settings;\r
- ui->action_OpenEditor->setEnabled(!settings.value(IniKey_EditorPath).toString().isEmpty());\r
- ui->action_OpenTerminal->setEnabled(!settings.value(IniKey_TerminalPath).toString().isEmpty());\r
+ ui->action_OpenEditor->setEnabled(!settings.value(IniKey_PathEditor).toString().isEmpty());\r
+ ui->action_OpenTerminal->setEnabled(!settings.value(IniKey_PathTerminal).toString().isEmpty());\r
\r
}\r
else if (!otherSideFolderView(view)->isVisible()) {\r
\r
void MainWindow::keyPressEvent(QKeyEvent *event)\r
{\r
+\r
QString ksq = KeyEventToSequence(event);\r
\r
- qDebug() << ">>>>> キーイベントを受信" << ksq << "<<<<<";\r
+ qDebug() << ">>>>> キーイベントを受信(MainWindow)" << ksq << "<<<<<";\r
+ qDebug() << qApp->keyboardModifiers().testFlag(Qt::ShiftModifier);\r
\r
if (ProcessShortcut(ksq, this)) {\r
event->accept();\r