- 初期表示時にカーソルがハイライトされないorz
- オプション
- ファンクションキー
+ - 各処理時の確認・完了ダイアログ表示有無
+ - 上書き時の規定の動作
- ドラッグ&ドロップ
- ファイル検索
- 簡易テキストビューア
- 簡易画像ビューア
- 簡易アーカイバ
-- SNS連携(タイムライン表示とか)
+- SNS連携(タイムライン表示とか) ← ファイラーの機能か?
+
+#### 2014/08/22 Ver0.05
+- 外部アプリケーションからのドロップ処理を実装。
#### 2014/08/22 Ver0.04 公開
- 不具合修正
extern MainWindow* getMainWnd();\r
extern QString FilesizeToString(quint64 size);\r
\r
-#define VERSION_VALUE 0.04\r
+#define VERSION_VALUE 0.05\r
\r
#define slash QString("/")\r
#define QQ(x) ("\"" + (x) + "\"")\r
QDir tgtDir(tgtPath);\r
\r
m_CopyMap.insert(srcPath, tgtDir.absoluteFilePath(info.fileName()));\r
-// qDebug() << srcPath << " -> " << tgtDir.absoluteFilePath(info.fileName());\r
+ qDebug() << srcPath << " -> " << tgtDir.absoluteFilePath(info.fileName());\r
if (info.isDir()) {\r
QDir srcDir(srcPath);\r
foreach (QFileInfo info2, srcDir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst)) {\r
\r
qDebug() << action << row << column;\r
\r
- if (action == Qt::IgnoreAction)\r
+ if (action == Qt::IgnoreAction) {\r
return true;\r
+ }\r
\r
- if (!data->hasFormat("text/uri-list"))\r
+ if (!data->hasFormat("text/uri-list")) {\r
return false;\r
+ }\r
\r
- if (column > 0)\r
+ if (column > 0) {\r
return false;\r
+ }\r
\r
- QString msg;\r
- msg = "ドロップを検知しました。<br/>";\r
+ QFileInfoList list;\r
foreach (const QUrl &url, data->urls()) {\r
- msg += url.toLocalFile() + "<br/>";\r
- qDebug() << url.toLocalFile();\r
+ QFileInfo info(url.toLocalFile());\r
+ QString path = info.canonicalFilePath();\r
+ if (!path.isEmpty()) {\r
+ qDebug() << path;\r
+ list << path;\r
+ }\r
+ else {\r
+ qDebug() << "path is empty.";\r
+ qDebug() << url;\r
+ }\r
}\r
- QMessageBox::information(NULL, "info", msg);\r
+\r
+ if (list.isEmpty()) {\r
+ return false;\r
+ }\r
+\r
+ emit filesDropped(list);\r
\r
return true;\r
}\r
void rootChanged(const QString &root);\r
void stateChanged(int checkedFoldrs, int checkedFiles, quint64 totalSize);\r
void listUpdated();\r
+ void filesDropped(const QFileInfoList &list);\r
\r
public slots:\r
// void refresh();\r
}\r
CopyMoveWorker *worker = static_cast<CopyMoveWorker*>(sender());\r
worker->endAsking();\r
- }\r
+}\r
+\r
+void FileTableView::acceptDrops(const QFileInfoList &list)\r
+{\r
+ if (list.isEmpty()) {\r
+ return;\r
+ }\r
+\r
+ FileTableModel *m = static_cast<FileTableModel*>(model());\r
+ CopyMoveWorker *worker = new CopyMoveWorker();\r
+ connect(worker, SIGNAL(askOverWrite(bool*,int*,int*,QString*,QString,QString)),\r
+ this, SLOT(askOverWrite(bool*,int*,int*,QString*,QString,QString)));\r
+ worker->setCopyList(&list);\r
+ worker->setTargetDir(m->absolutePath());\r
+ worker->setMoveMode(false);\r
+\r
+ OperationDialog opDlg(this);\r
+ opDlg.setWindowTitle(tr("コピー"));\r
+ opDlg.setWorker(worker);\r
+\r
+ opDlg.exec();\r
+}\r
\r
void FileTableView::setRootIndex(const QModelIndex &index)\r
{\r
\r
QTableView::currentChanged(current, previous);\r
}\r
-\r
-\r
-//void FileTableView::dropEvent(QDropEvent *event)\r
-//{\r
-// foreach (const QString &str, event->mimeData()->formats()) {\r
-// qDebug() << str;\r
-// }\r
-//}\r
-\r
-//void FileTableView::dragEnterEvent(QDragEnterEvent *event)\r
-//{\r
-// event->acceptProposedAction();\r
-//}\r
void askOverWrite(bool *bOk, int *prevCopyMethod, int *copyMethod,\r
QString *alias, const QString &srcPath,\r
const QString &tgtPath);\r
+ void acceptDrops(const QFileInfoList &list);\r
\r
// QAbstractItemView interface\r
public slots:\r
protected:\r
void keyPressEvent(QKeyEvent *event);\r
void focusInEvent(QFocusEvent *event);\r
-// void dropEvent(QDropEvent *event);\r
-// void dragEnterEvent(QDragEnterEvent *event);\r
\r
// QAbstractItemView interface\r
protected slots:\r
#include "folderpanel.h"\r
#include "mainwindow.h"\r
#include "ui_folderpanel.h"\r
-#include <QCheckBox>\r
-#include <QMessageBox>\r
-#include <QKeyEvent>\r
-#include <QDebug>\r
-#include <QDateTime>\r
-#include <QDesktopServices>\r
+\r
#include <QSettings>\r
-#ifdef Q_OS_WIN32\r
- #include <windows.h>\r
-#endif\r
\r
QString FilesizeToString(quint64 size)\r
{\r
this, SLOT(onStateChanged(int,int,quint64)));\r
connect(model, SIGNAL(listUpdated()),\r
ui->fileTable, SLOT(refresh()));\r
+ connect(model, SIGNAL(filesDropped(QFileInfoList)),\r
+ ui->fileTable, SLOT(acceptDrops(QFileInfoList)));\r
+\r
\r
//>>>>> フィルタ初期化\r
model->setFilter(QDir::NoDot | QDir::AllDirs | QDir::Files);\r
}
// 現在位置と異なるパスであれば追加する
if (isEmpty() || (m_list[m_pos] != path)) {
- m_list.push_back(path);
+ m_list << path;
}
m_pos = m_list.size() - 1;
}
#include "sortdialog.h"\r
#include "preferencedialog.h"\r
#include "ui_mainwindow.h"\r
-#include <QFileSystemModel>\r
-#include <QDebug>\r
-#include <QKeyEvent>\r
-#include <QDesktopServices>\r
-#include <QSettings>\r
-#include <QFileDialog>\r
-#include <QMessageBox>\r
-#include <QProcess>\r
-#include <QThread>\r
-#include <QInputDialog>\r
+\r
#include <QCheckBox>\r
+#include <QCloseEvent>\r
+#include <QDebug>\r
#include <QDesktopWidget>\r
+#include <QMessageBox>\r
+#include <QSettings>\r
\r
MainWindow::MainWindow(QWidget *parent) :\r
QMainWindow(parent),\r
void MainWindow::toggleShowSystemFiles()\r
{\r
// キーボードがトリガーの場合、メニュー項目のチェック状態は\r
- // 変わらないので、QSettingsを使う\r
+ // 変わらない(Mac)ので、QSettingsを使う\r
QSettings settings;\r
bool show = !settings.value(IniKey_ShowSystem, false).toBool();\r
settings.setValue(IniKey_ShowSystem, show);\r
tr("<h3>Gefu Ver%1</h3>").arg(VERSION_VALUE) +\r
tr("<center>Gefu is an Experimental File Utility.<br/>"\r
"<small>(げふぅは実験的なファイルユーティリティです)</small></center>"\r
- "<p>最新版の情報は<a href='http://miyabi.rakusaba.jp'>喫茶・雅</a>で公開しています。</p>"\r
+ "<p>最新版の情報は<a href='http://miyabi.rakusaba.jp'>喫茶[雅]</a>で公開しています。</p>"\r
"<p><small>Copyright 2014 @miyabi_satoh All rights reserved.</small></p>"));\r
}\r
\r