OSDN Git Service

履歴機能を実装
authorMasayuki Satoh <miyabi.satoh@gmail.com>
Wed, 20 Aug 2014 09:06:13 +0000 (18:06 +0900)
committerMasayuki Satoh <miyabi.satoh@gmail.com>
Wed, 20 Aug 2014 09:06:13 +0000 (18:06 +0900)
14 files changed:
Gefu.pro
common.h
filetablemodel.cpp
filetableview.cpp
filetableview.h
folderpanel.cpp
history.cpp [new file with mode: 0644]
history.h [new file with mode: 0644]
historydialog.cpp [new file with mode: 0644]
historydialog.h [new file with mode: 0644]
historydialog.ui [new file with mode: 0644]
mainwindow.cpp
mainwindow.h
mainwindow.ui

index 1c109cd..ef2c85e 100644 (file)
--- a/Gefu.pro
+++ b/Gefu.pro
@@ -1,69 +1,74 @@
-#-------------------------------------------------\r
-#\r
-# Project created by QtCreator 2014-08-14T11:25:36\r
-#\r
-#-------------------------------------------------\r
-\r
-QT       += core gui\r
-\r
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets\r
-\r
-TARGET = Gefu\r
-TEMPLATE = app\r
-\r
-\r
-SOURCES += main.cpp\\r
-        mainwindow.cpp \\r
-    folderpanel.cpp \\r
-    renamesingledialog.cpp \\r
-    renamemultidialog.cpp \\r
-    operationdialog.cpp \\r
-    irenamedialog.cpp \\r
-    iworker.cpp \\r
-    renameworker.cpp \\r
-    deleteworker.cpp \\r
-    overwritedialog.cpp \\r
-    copymoveworker.cpp \\r
-    sortdialog.cpp \\r
-    filetablemodel.cpp \\r
-    filetableview.cpp\r
-\r
-HEADERS  += mainwindow.h \\r
-    folderpanel.h \\r
-    singleton.hpp \\r
-    renamesingledialog.h \\r
-    renamemultidialog.h \\r
-    operationdialog.h \\r
-    common.h \\r
-    irenamedialog.h \\r
-    iworker.h \\r
-    renameworker.h \\r
-    deleteworker.h \\r
-    overwritedialog.h \\r
-    copymoveworker.h \\r
-    sortdialog.h \\r
-    filetablemodel.h \\r
-    filetableview.h\r
-\r
-FORMS    += mainwindow.ui \\r
-    folderpanel.ui \\r
-    renamesingledialog.ui \\r
-    renamemultidialog.ui \\r
-    operationdialog.ui \\r
-    overwritedialog.ui \\r
-    sortdialog.ui\r
-\r
-RESOURCES += \\r
-    resource.qrc\r
-\r
-OTHER_FILES += \\r
-    Gefu.rc \\r
-    README.md\r
-\r
-mac {\r
-    ICON = ./images/Gefu.icns\r
-}\r
-\r
-win32 {\r
-    RC_FILE = Gefu.rc\r
-}\r
+#-------------------------------------------------
+#
+# Project created by QtCreator 2014-08-14T11:25:36
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = Gefu
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+        mainwindow.cpp \
+    folderpanel.cpp \
+    renamesingledialog.cpp \
+    renamemultidialog.cpp \
+    operationdialog.cpp \
+    irenamedialog.cpp \
+    iworker.cpp \
+    renameworker.cpp \
+    deleteworker.cpp \
+    overwritedialog.cpp \
+    copymoveworker.cpp \
+    sortdialog.cpp \
+    filetablemodel.cpp \
+    filetableview.cpp \
+    history.cpp \
+    historydialog.cpp
+
+HEADERS  += mainwindow.h \
+    folderpanel.h \
+    singleton.hpp \
+    renamesingledialog.h \
+    renamemultidialog.h \
+    operationdialog.h \
+    common.h \
+    irenamedialog.h \
+    iworker.h \
+    renameworker.h \
+    deleteworker.h \
+    overwritedialog.h \
+    copymoveworker.h \
+    sortdialog.h \
+    filetablemodel.h \
+    filetableview.h \
+    history.h \
+    historydialog.h
+
+FORMS    += mainwindow.ui \
+    folderpanel.ui \
+    renamesingledialog.ui \
+    renamemultidialog.ui \
+    operationdialog.ui \
+    overwritedialog.ui \
+    sortdialog.ui \
+    historydialog.ui
+
+RESOURCES += \
+    resource.qrc
+
+OTHER_FILES += \
+    Gefu.rc \
+    README.md
+
+mac {
+    ICON = ./images/Gefu.icns
+}
+
+win32 {
+    RC_FILE = Gefu.rc
+}
index 6c75f95..f29be3d 100644 (file)
--- a/common.h
+++ b/common.h
@@ -15,6 +15,10 @@ extern QString FilesizeToString(quint64 size);
 \r
 #define IniKey_ShowHidden       "Common/ShowHidden"\r
 #define IniKey_ShowSystem       "Common/ShowSystem"\r
+#define IniKey_WindowX          "Window/X"\r
+#define IniKey_WindowY          "Window/Y"\r
+#define IniKey_WindowCX         "Window/CX"\r
+#define IniKey_WindowCY         "Window/CY"\r
 #define IniSec_Left             "Left"\r
 #define IniSec_Right            "Right"\r
 #define IniKey_Dir              "dir"\r
index 3ccfa68..bfa3eec 100644 (file)
@@ -42,24 +42,29 @@ bool FileTableModel::setPath(const QString &path)
         qDebug() << "ファイルリストを取得できません";\r
         qDebug() << path;\r
     }\r
-#ifdef Q_OS_WIN32\r
-    else if (!(filter() & QDir::System)){\r
+    else {\r
         QFileInfoList::iterator it;\r
         for (it = m_fileInfoList.begin(); it != m_fileInfoList.end(); ) {\r
-            DWORD dwFlags = ::GetFileAttributes(\r
-                        it->absoluteFilePath().toStdWString().c_str());\r
-            if (dwFlags != DWORD(-1) && it->fileName() != ".." &&\r
-                ((dwFlags & FILE_ATTRIBUTE_SYSTEM) == FILE_ATTRIBUTE_SYSTEM))\r
-            {\r
-                qDebug() << it->fileName() << " is system file.";\r
+            if (QFileInfo(it->canonicalFilePath()).isRoot()) {\r
                 it = m_fileInfoList.erase(it);\r
+                continue;\r
             }\r
-            else {\r
-                it++;\r
+#ifdef Q_OS_WIN32\r
+            if (!(filter() & QDir::System)){\r
+                DWORD dwFlags = ::GetFileAttributes(\r
+                            it->absoluteFilePath().toStdWString().c_str());\r
+                if (dwFlags != DWORD(-1) && it->fileName() != ".." &&\r
+                    ((dwFlags & FILE_ATTRIBUTE_SYSTEM) == FILE_ATTRIBUTE_SYSTEM))\r
+                {\r
+                    qDebug() << it->fileName() << " is system file.";\r
+                    it = m_fileInfoList.erase(it);\r
+                    continue;\r
+                }\r
             }\r
+#endif\r
+            it++;\r
         }\r
     }\r
-#endif\r
     m_checkStates.resize(m_fileInfoList.size());\r
     m_checkStates.fill(Qt::Unchecked);\r
 \r
index 24b5170..755b2ef 100644 (file)
@@ -3,6 +3,7 @@
 #include "deleteworker.h"\r
 #include "filetablemodel.h"\r
 #include "filetableview.h"\r
+#include "historydialog.h"\r
 #include "mainwindow.h"\r
 #include "operationdialog.h"\r
 #include "overwritedialog.h"\r
@@ -21,6 +22,7 @@
 #include <QSettings>\r
 #include <QFileDialog>\r
 #include <QKeyEvent>\r
+#include <QStatusBar>\r
 \r
 #define CHECK_FOCUS {                   \\r
         if (!hasFocus()) { return; }    \\r
@@ -32,7 +34,9 @@
     getMainWnd()->findChild<QAction*>(#x), SIGNAL(toggled(bool))\r
 \r
 FileTableView::FileTableView(QWidget *parent) :\r
-    QTableView(parent)\r
+    QTableView(parent),\r
+    m_side(),\r
+    m_history()\r
 {\r
     // シグナル/スロットを設定する\r
     connect(MENU_TRRIGGERED(action_Open), this, SLOT(setPath()));\r
@@ -77,9 +81,6 @@ FileTableView::FileTableView(QWidget *parent) :
 \r
     connect(this, SIGNAL(doubleClicked(QModelIndex)),\r
             this, SLOT(setRootIndex(QModelIndex)));\r
-\r
-    connect(this, SIGNAL(indexChanged(QString)),\r
-            getMainWnd(), SLOT(setStatusText(QString)));\r
 }\r
 \r
 FileTableView::~FileTableView()\r
@@ -98,9 +99,14 @@ QString FileTableView::side() const
 void FileTableView::setSide(const QString &side)\r
 {\r
     m_side = side;\r
+\r
+    // コンストラクタではステータスバーが生成されていないため\r
+    // このタイミングでconnectする\r
+    connect(this, SIGNAL(indexChanged(QString)),\r
+            getMainWnd()->statusBar(), SLOT(showMessage(QString)));\r
 }\r
 \r
-void FileTableView::setRootPath(const QString &path)\r
+void FileTableView::setRootPath(const QString &path, bool addHistory)\r
 {\r
     FileTableModel *m = static_cast<FileTableModel*>(model());\r
     QFileInfo info(path);\r
@@ -109,6 +115,11 @@ void FileTableView::setRootPath(const QString &path)
         m->setPath(info.absoluteFilePath());\r
         setUpdatesEnabled(true);\r
 \r
+        if (addHistory) {\r
+            m_history.add(info.absoluteFilePath());\r
+        }\r
+        updateMenu();\r
+\r
         setCurrentIndex(m->index(0, 0));\r
     }\r
 }\r
@@ -127,6 +138,21 @@ QFileInfoList FileTableView::selectedItems() const
     return list;\r
 }\r
 \r
+void FileTableView::updateMenu()\r
+{\r
+    if (m_history.isEmpty()) {\r
+        getMainWnd()->findChild<QAction*>("move_Back")->setEnabled(false);\r
+        getMainWnd()->findChild<QAction*>("move_Forward")->setEnabled(false);\r
+\r
+    }\r
+    else {\r
+        getMainWnd()->findChild<QAction*>("move_Back")\r
+                ->setEnabled(!m_history.isBegin());\r
+        getMainWnd()->findChild<QAction*>("move_Forward")\r
+                ->setEnabled(!m_history.isEnd());\r
+    }\r
+}\r
+\r
 void FileTableView::setPath()\r
 {\r
     CHECK_FOCUS;\r
@@ -188,11 +214,6 @@ void FileTableView::toggleChecked()
 \r
     QModelIndex index = currentIndex();\r
 \r
-    qDebug() << "row = " << index.row();\r
-    qDebug() << "rowCount = " << m->rowCount();\r
-\r
-\r
-\r
     QFileInfo info = m->fileInfo(index);\r
     if (info.fileName() != "..") {\r
         if (m->checkState(index) == Qt::Checked) {\r
@@ -290,7 +311,7 @@ void FileTableView::setPathFromOther()
 \r
     FileTableModel *mOther = static_cast<FileTableModel*>(other->model());\r
 \r
-    setRootPath(mOther->absolutePath());\r
+    setRootPath(mOther->absolutePath(), true);\r
 }\r
 \r
 void FileTableView::setPathToOther()\r
@@ -304,7 +325,7 @@ void FileTableView::setPathToOther()
 \r
     FileTableModel *m = static_cast<FileTableModel*>(model());\r
 \r
-    other->setRootPath(m->absolutePath());\r
+    other->setRootPath(m->absolutePath(), true);\r
 }\r
 \r
 void FileTableView::swapPath()\r
@@ -322,8 +343,8 @@ void FileTableView::swapPath()
     QString path = m->absolutePath();\r
     QString pathOther = mOther->absolutePath();\r
 \r
-    setRootPath(pathOther);\r
-    other->setRootPath(path);\r
+    setRootPath(pathOther, true);\r
+    other->setRootPath(path, true);\r
 }\r
 \r
 void FileTableView::showHiddenFiles(bool show)\r
@@ -401,23 +422,65 @@ void FileTableView::setSort()
 void FileTableView::back()\r
 {\r
     CHECK_FOCUS;\r
+\r
+    if (!m_history.isBegin()) {\r
+        const QString &path = m_history.back();\r
+        setRootPath(path, false);\r
+\r
+        updateMenu();\r
+    }\r
 }\r
 \r
 void FileTableView::forward()\r
 {\r
     CHECK_FOCUS;\r
+\r
+    if (!m_history.isEnd()) {\r
+        const QString &path = m_history.forward();\r
+        setRootPath(path, false);\r
+\r
+        updateMenu();\r
+    }\r
 }\r
 \r
 void FileTableView::showHidtory()\r
 {\r
     CHECK_FOCUS;\r
+\r
+    FileTableView *other = getMainWnd()->otherSideView(this);\r
+\r
+    HistoryDialog dlg(this);\r
+    if (side() == "Left") {\r
+        dlg.setDefaultLeft(true);\r
+        dlg.setHistory(&m_history, other->history());\r
+    }\r
+    else {\r
+        dlg.setDefaultLeft(false);\r
+        dlg.setHistory(other->history(), &m_history);\r
+    }\r
+\r
+    QSize szMainWnd = getMainWnd()->size();\r
+    QSize szDialog = dlg.size();\r
+    szDialog.setWidth(szMainWnd.width() * 0.8);\r
+    dlg.resize(szDialog);\r
+    if (dlg.exec() == QDialog::Accepted) {\r
+        if (side() == dlg.selectedSide()) {\r
+            m_history.setAt(dlg.selectedIndex());\r
+            setRootPath(m_history.current(), false);\r
+        }\r
+        else {\r
+            setRootPath(other->history()->at(dlg.selectedIndex()), true);\r
+        }\r
+        updateMenu();\r
+        qDebug() << dlg.selectedIndex();\r
+    }\r
 }\r
 \r
 void FileTableView::jumpToHome()\r
 {\r
     CHECK_FOCUS;\r
 \r
-    setRootPath(QDir::homePath());\r
+    setRootPath(QDir::homePath(), true);\r
 }\r
 \r
 void FileTableView::jumpToParent()\r
@@ -428,14 +491,14 @@ void FileTableView::jumpToParent()
     QDir dir(m->absolutePath());\r
     dir.cdUp();\r
 \r
-    setRootPath(dir.absolutePath());\r
+    setRootPath(dir.absolutePath(), true);\r
 }\r
 \r
 void FileTableView::jumpToRoot()\r
 {\r
     CHECK_FOCUS;\r
 \r
-    setRootPath(QDir::rootPath());\r
+    setRootPath(QDir::rootPath(), true);\r
 }\r
 \r
 void FileTableView::jumpTo()\r
@@ -446,7 +509,7 @@ void FileTableView::jumpTo()
     QString path = QFileDialog::getExistingDirectory(\r
                 this, tr("フォルダを選択"), m->absolutePath());\r
     if (!path.isEmpty()) {\r
-        setRootPath(path);\r
+        setRootPath(path, true);\r
     }\r
 }\r
 \r
@@ -676,7 +739,7 @@ void FileTableView::setRootIndex(const QModelIndex &index)
     FileTableModel *m = static_cast<FileTableModel*>(model());\r
 \r
     if (m->isDir(index)) {\r
-        setRootPath(m->absoluteFilePath(index));\r
+        setRootPath(m->absoluteFilePath(index), true);\r
     }\r
 }\r
 \r
@@ -715,6 +778,13 @@ void FileTableView::keyPressEvent(QKeyEvent *event)
     QTableView::keyPressEvent(event);\r
 }\r
 \r
+void FileTableView::focusInEvent(QFocusEvent *event)\r
+{\r
+    updateMenu();\r
+\r
+    QTableView::focusInEvent(event);\r
+}\r
+\r
 void FileTableView::currentChanged(const QModelIndex &current, const QModelIndex &previous)\r
 {\r
     Q_UNUSED(previous);\r
@@ -724,3 +794,5 @@ void FileTableView::currentChanged(const QModelIndex &current, const QModelIndex
     const FileTableModel *m = static_cast<const FileTableModel*>(current.model());\r
     emit indexChanged(m->fileInfo(current).absoluteFilePath());\r
 }\r
+\r
+\r
index 6033078..e9aad03 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef FILETABLEVIEW_H\r
 #define FILETABLEVIEW_H\r
 \r
+#include "history.h"\r
+\r
 #include <QFileInfoList>\r
 #include <QTableView>\r
 \r
@@ -13,12 +15,17 @@ public:
 \r
     QString side() const;\r
     void setSide(const QString &side);\r
-    void setRootPath(const QString &path);\r
+\r
+    History* history() { return &m_history; }\r
+\r
+    void setRootPath(const QString &path, bool addHistory);\r
 \r
 private:\r
     QString m_side;\r
+    History m_history;\r
 \r
     QFileInfoList selectedItems() const;\r
+    void updateMenu();\r
 \r
 signals:\r
     void indexChanged(const QString &text);\r
@@ -74,6 +81,7 @@ public slots:
     // QWidget interface\r
 protected:\r
     void keyPressEvent(QKeyEvent *event);\r
+    void focusInEvent(QFocusEvent *event);\r
 \r
     // QAbstractItemView interface\r
 protected slots:\r
index 1c8eb90..cc6494a 100644 (file)
@@ -41,8 +41,10 @@ FolderPanel::FolderPanel(QWidget *parent) :
     header->setSectionResizeMode(1, QHeaderView::Stretch);\r
     header->setSectionResizeMode(2, QHeaderView::ResizeToContents);\r
     header->setSectionResizeMode(3, QHeaderView::ResizeToContents);\r
-\r
     header->setDefaultSectionSize(header->minimumSectionSize());\r
+\r
+    QHeaderView *vHeader = ui->fileTable->verticalHeader();\r
+    vHeader->setDefaultSectionSize(vHeader->minimumSectionSize());\r
 }\r
 \r
 FolderPanel::~FolderPanel()\r
@@ -112,12 +114,10 @@ void FolderPanel::setSide(const QString &side)
     //>>>>> 監視フォルダ初期化\r
     QString key = side + slash + IniKey_Dir;\r
     QString path = settings.value(key, QDir::homePath()).toString();\r
-    model->setPath(path);\r
 \r
     ui->fileTable->setModel(model);\r
+    ui->fileTable->setRootPath(path, true);\r
     ui->fileTable->selectRow(0);\r
-    ui->fileTable->resizeColumnsToContents();\r
-    ui->fileTable->resizeRowsToContents();\r
 }\r
 \r
 void FolderPanel::onStateChanged(int checkedFolders, int checkedFiles, quint64 totalSize)\r
@@ -143,7 +143,7 @@ void FolderPanel::on_locationField_editingFinished()
     ui->locationField->blockSignals(true);\r
 \r
     QString path = ui->locationField->text();\r
-    ui->fileTable->setRootPath(path);\r
+    ui->fileTable->setRootPath(path, true);\r
 \r
     ui->locationField->blockSignals(false);\r
 }\r
diff --git a/history.cpp b/history.cpp
new file mode 100644 (file)
index 0000000..83cd5b1
--- /dev/null
@@ -0,0 +1,36 @@
+#include "history.h"
+
+History::History() :
+    m_list(),
+    m_pos(0)
+{
+}
+
+void History::add(const QString &path)
+{
+    // 現在位置より後ろのデータは削除する
+    if (!isEmpty() && !isEnd()) {
+        m_list.resize(m_pos + 1);
+    }
+    // 現在位置と異なるパスであれば追加する
+    if (isEmpty() || (m_list[m_pos] != path)) {
+        m_list.push_back(path);
+    }
+    m_pos = m_list.size() - 1;
+}
+
+const QString &History::back()
+{
+    if (!isBegin()) {
+        m_pos--;
+    }
+    return m_list[m_pos];
+}
+
+const QString &History::forward()
+{
+    if (!isEnd()) {
+        m_pos++;
+    }
+    return m_list[m_pos];
+}
diff --git a/history.h b/history.h
new file mode 100644 (file)
index 0000000..0d86e4d
--- /dev/null
+++ b/history.h
@@ -0,0 +1,34 @@
+#include <QStringList>
+
+#ifndef HISTORY_H
+#define HISTORY_H
+
+#include <QVector>
+
+class History
+{
+    typedef QVector<QString> Container;
+
+public:
+    History();
+
+    void add(const QString &path);
+
+    const QString& back();
+    const QString& forward();
+    const QString& current() const { return m_list[m_pos]; }
+
+    bool isBegin() const    { return m_pos == 0; }
+    bool isEnd() const      { return m_pos == m_list.size() - 1; }
+    bool isEmpty() const    { return m_list.isEmpty(); }
+
+    int size() const { return m_list.size(); }
+    const QString& at(int n) const { return m_list.at(n); }
+    void setAt(int n) { m_pos = n; }
+
+private:
+    Container m_list;
+    int m_pos;
+};
+
+#endif // HISTORY_H
diff --git a/historydialog.cpp b/historydialog.cpp
new file mode 100644 (file)
index 0000000..597a2b4
--- /dev/null
@@ -0,0 +1,92 @@
+#include "historydialog.h"
+#include "ui_historydialog.h"
+
+HistoryDialog::HistoryDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::HistoryDialog),
+    m_leftHistory(NULL),
+    m_rightHistory(NULL),
+    m_displaying(NULL)
+{
+    ui->setupUi(this);
+
+}
+
+HistoryDialog::~HistoryDialog()
+{
+    delete ui;
+}
+
+void HistoryDialog::setHistory(History *left, History *right)
+{
+    m_leftHistory = left;
+    m_rightHistory = right;
+}
+
+void HistoryDialog::setDefaultLeft(bool bLeft)
+{
+    if (bLeft) {
+        ui->leftPane->setChecked(true);
+    }
+    else {
+        ui->rightPane->setChecked(true);
+    }
+}
+
+int HistoryDialog::selectedIndex() const
+{
+    int row = ui->listWidget->currentIndex().row();
+    return m_displaying->size() - row - 1;
+}
+
+const QString HistoryDialog::selectedSide() const
+{
+    if (ui->leftPane->isChecked()) {
+        return QString("Left");
+    }
+    else {
+        return QString("Right");
+    }
+}
+
+void HistoryDialog::showLeftHistory()
+{
+    if (m_displaying != m_leftHistory) {
+        m_displaying = m_leftHistory;
+        showHistory();
+    }
+
+}
+
+void HistoryDialog::showRightHistory()
+{
+    if (m_displaying != m_rightHistory) {
+        m_displaying = m_rightHistory;
+        showHistory();
+    }
+}
+
+void HistoryDialog::showHistory()
+{
+    ui->listWidget->clear();
+    for (int n = 0; n < m_displaying->size(); n++) {
+        ui->listWidget->insertItem(0, m_displaying->at(n));
+    }
+    ui->listWidget->setCurrentRow(0);
+}
+
+void HistoryDialog::showEvent(QShowEvent *event)
+{
+    Q_UNUSED(event);
+
+    if (ui->leftPane->isChecked()) {
+        showLeftHistory();
+    }
+    else {
+        showRightHistory();
+    }
+
+    connect(ui->leftPane, SIGNAL(clicked()), this, SLOT(showLeftHistory()));
+    connect(ui->rightPane, SIGNAL(clicked()), this, SLOT(showRightHistory()));
+    connect(ui->listWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept()));
+}
diff --git a/historydialog.h b/historydialog.h
new file mode 100644 (file)
index 0000000..821c0f6
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef HISTORYDIALOG_H
+#define HISTORYDIALOG_H
+
+#include "history.h"
+
+#include <QDialog>
+
+namespace Ui {
+class HistoryDialog;
+}
+
+class HistoryDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit HistoryDialog(QWidget *parent = 0);
+    ~HistoryDialog();
+
+    void setHistory(History *left, History *right);
+    void setDefaultLeft(bool bLeft);
+
+    int selectedIndex() const;
+    const QString selectedSide() const;
+
+private:
+    Ui::HistoryDialog *ui;
+    History *m_leftHistory;
+    History *m_rightHistory;
+    History *m_displaying;
+
+private slots:
+    void showLeftHistory();
+    void showRightHistory();
+    void showHistory();
+
+    // QWidget interface
+protected:
+    void showEvent(QShowEvent *event);
+};
+
+#endif // HISTORYDIALOG_H
diff --git a/historydialog.ui b/historydialog.ui
new file mode 100644 (file)
index 0000000..668ade0
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>HistoryDialog</class>
+ <widget class="QDialog" name="HistoryDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>280</width>
+    <height>286</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>履歴を選択</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QRadioButton" name="leftPane">
+       <property name="focusPolicy">
+        <enum>Qt::TabFocus</enum>
+       </property>
+       <property name="text">
+        <string>左ペイン</string>
+       </property>
+       <attribute name="buttonGroup">
+        <string notr="true">buttonGroup</string>
+       </attribute>
+      </widget>
+     </item>
+     <item>
+      <widget class="QRadioButton" name="rightPane">
+       <property name="focusPolicy">
+        <enum>Qt::TabFocus</enum>
+       </property>
+       <property name="text">
+        <string>右ペイン</string>
+       </property>
+       <attribute name="buttonGroup">
+        <string notr="true">buttonGroup</string>
+       </attribute>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QListWidget" name="listWidget">
+     <property name="focusPolicy">
+      <enum>Qt::TabFocus</enum>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="focusPolicy">
+      <enum>Qt::TabFocus</enum>
+     </property>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <tabstops>
+  <tabstop>listWidget</tabstop>
+  <tabstop>leftPane</tabstop>
+  <tabstop>rightPane</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>HistoryDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>HistoryDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <buttongroups>
+  <buttongroup name="buttonGroup"/>
+ </buttongroups>
+</ui>
index 559bfde..dc4338a 100644 (file)
@@ -64,12 +64,8 @@ MainWindow::MainWindow(QWidget *parent) :
 \r
 MainWindow::~MainWindow()\r
 {\r
-    delete ui;\r
-}\r
 \r
-void MainWindow::setStatusText(const QString &str)\r
-{\r
-    ui->statusBar->showMessage(str);\r
+    delete ui;\r
 }\r
 \r
 FileTableView *MainWindow::otherSideView(const FileTableView *view) const\r
index a072187..d4e6710 100644 (file)
@@ -25,7 +25,6 @@ signals:
     void showSystemFiles(bool show);\r
 \r
 public slots:\r
-    void setStatusText(const QString &str);\r
     void onActionSetting();\r
     void onHelpAbout();\r
 \r
index ef58a63..7db02ee 100644 (file)
      <x>0</x>\r
      <y>0</y>\r
      <width>662</width>\r
-     <height>24</height>\r
+     <height>22</height>\r
     </rect>\r
    </property>\r
    <widget class="QMenu" name="menu_File">\r
     <string>戻る</string>\r
    </property>\r
    <property name="shortcut">\r
-    <string>Alt+Left</string>\r
+    <string>[</string>\r
    </property>\r
   </action>\r
   <action name="move_Forward">\r
     <string>進む</string>\r
    </property>\r
    <property name="shortcut">\r
-    <string>Alt+Right</string>\r
+    <string>]</string>\r
    </property>\r
   </action>\r
   <action name="move_History">\r