OSDN Git Service

Ver0.07
authorMasayuki Satoh <miyabi.satoh@gmail.com>
Fri, 22 Aug 2014 17:05:58 +0000 (02:05 +0900)
committerMasayuki Satoh <miyabi.satoh@gmail.com>
Fri, 22 Aug 2014 17:05:58 +0000 (02:05 +0900)
16 files changed:
README.md
common.h
filetablemodel.cpp
filetableview.cpp
filetableview.h
folderpanel.cpp
folderpanel.ui
main.cpp
mainwindow.cpp
mainwindow.ui
operationdialog.cpp
operationdialog.h
preferencedialog.cpp
preferencedialog.h
preferencedialog.ui
sortdialog.cpp

index 01b2f66..1e1ebca 100644 (file)
--- a/README.md
+++ b/README.md
@@ -4,14 +4,11 @@ Gefu
 Gefu is an Experimental File Utility.
 
 ### TODO
-- 初期表示時にカーソルがハイライトされないorz
-- ファイルはダブルクリックで開くようにする
+- 現在のフォルダを端末で開く
 - コンテキストメニュー
 - オプション
     - ファンクションキー
-    - 各処理時の確認・完了ダイアログ表示有無
-    - 上書き時の規定の動作
-    - フォルダ作ったら、そこに移動
+    - キーバインドカスタマイズ
 - ファイル検索
 - 簡易テキストビューア
 - 簡易画像ビューア
@@ -19,6 +16,13 @@ Gefu is an Experimental File Utility.
 - 最新版チェック、ダウンロード
 - SNS連携(タイムライン表示とか) ← ファイラーの機能か?
 
+#### 2014/08/23 Ver0.07
+- ダブルクリック時、ファイルは標準の関連付けで実行するようにした。
+- 設定項目追加。
+- 「外部エディタで開く」を実装。
+- 不具合修正
+    - 初期表示時にカーソルがハイライトされない問題を修正。
+
 #### 2014/08/22 Ver0.06 公開
 - 外部および内部のドラッグ&ドロップ処理を実装。
 - 一部ダイアログのレイアウト、初期サイズを調整。
index 62e79bb..f85b885 100644 (file)
--- a/common.h
+++ b/common.h
@@ -8,41 +8,55 @@ class MainWindow;
 extern MainWindow* getMainWnd();\r
 extern QString FilesizeToString(quint64 size);\r
 \r
-#define VERSION_VALUE   0.06\r
+#define VERSION_VALUE   0.07\r
 \r
 #define slash   QString("/")\r
-#define QQ(x)   ("\"" + (x) + "\"")\r
+#define QQ(x)   ("\"" + QString(x) + "\"")\r
 \r
-#define IniKey_ShowHidden       "Common/ShowHidden"\r
-#define IniKey_ShowSystem       "Common/ShowSystem"\r
-#define IniKey_ConfirmExit      "BootAndExit/ConfirmExit"\r
-#define IniKey_BootSizeSpec     "BootAndExit/SizeSpec"\r
-#define IniKey_BootSizeRel      "BootAndExit/SizeRel"\r
-#define IniKey_BootSizeAbs      "BootAndExit/SizeAbs"\r
-#define IniKey_BootPosSpec      "BootAndExit/PosSpec"\r
-#define IniKey_BootPosRel       "BootAndExit/PosRel"\r
-#define IniKey_BootPosAbs       "BootAndExit/PosAbs"\r
-#define IniKey_ResetOnBoot      "BootAndExit/Reset"\r
-#define IniKey_BoxColorFg       "Appearance/BoxColorFg"\r
-#define IniKey_BoxColorBg       "Appearance/BoxColorBg"\r
-#define IniKey_BoxFont          "Appearance/BoxFont"\r
-#define IniKey_ViewFont         "Appearance/ViewFont"\r
-#define IniKey_ViewColorBgNormal    "Appearance/ViewColorBgNormal"\r
-#define IniKey_ViewColorBgMark      "Appearance/ViewColorBgMark"\r
-#define IniKey_ViewColorFgNormal    "Appearance/ViewColorFgNormal"\r
-#define IniKey_ViewColorFgMark      "Appearance/ViewColorFgMark"\r
-#define IniKey_ViewColorFgSystem    "Appearance/ViewColorFgSystem"\r
-#define IniKey_ViewColorFgHidden    "Appearance/ViewColorFgHidden"\r
-#define IniKey_ViewColorFgReadonly  "Appearance/ViewColorFgReadonly"\r
-#define IniKey_WindowGeometry   "Window/Geometry"\r
-#define iniKey_WindowState      "Window/State"\r
-#define IniSec_Left             "Left"\r
-#define IniSec_Right            "Right"\r
-#define IniKey_Dir              "dir"\r
-#define IniKey_SortBy           "SortBy"\r
-#define IniKey_OrderBy          "OrderBy"\r
-#define IniKey_PutDirs          "PutDirs"\r
-#define IniKey_IgnoreCase       "IgnoreCase"\r
+#define IniKey_ShowHidden               "Common/ShowHidden"\r
+#define IniKey_ShowSystem               "Common/ShowSystem"\r
+#define IniKey_DefaultOnCopy            "Common/DefaultCopyMode"\r
+#define IniKey_MoveAfterCreateFolder    "Common/MoveAfterFolderCreation"\r
+#define IniKey_OpenAfterCreateFile      "Common/OpenAfterFileCreation"\r
+#define IniKey_BootSizeSpec             "BootAndExit/SizeSpec"\r
+#define IniKey_BootSizeRel              "BootAndExit/SizeRel"\r
+#define IniKey_BootSizeAbs              "BootAndExit/SizeAbs"\r
+#define IniKey_BootPosSpec              "BootAndExit/PosSpec"\r
+#define IniKey_BootPosRel               "BootAndExit/PosRel"\r
+#define IniKey_BootPosAbs               "BootAndExit/PosAbs"\r
+#define IniKey_ResetOnBoot              "BootAndExit/Reset"\r
+#define IniKey_BoxColorFg               "Appearance/BoxColorFg"\r
+#define IniKey_BoxColorBg               "Appearance/BoxColorBg"\r
+#define IniKey_BoxFont                  "Appearance/BoxFont"\r
+#define IniKey_ViewFont                 "Appearance/ViewFont"\r
+#define IniKey_ViewColorBgNormal        "Appearance/ViewColorBgNormal"\r
+#define IniKey_ViewColorBgMark          "Appearance/ViewColorBgMark"\r
+#define IniKey_ViewColorFgNormal        "Appearance/ViewColorFgNormal"\r
+#define IniKey_ViewColorFgMark          "Appearance/ViewColorFgMark"\r
+#define IniKey_ViewColorFgSystem        "Appearance/ViewColorFgSystem"\r
+#define IniKey_ViewColorFgHidden        "Appearance/ViewColorFgHidden"\r
+#define IniKey_ViewColorFgReadonly      "Appearance/ViewColorFgReadonly"\r
+#define IniKey_ConfirmExit              "Confirm/Exit"\r
+#define IniKey_ConfirmCopy              "Confirm/Copy"\r
+#define IniKey_ConfirmMove              "Confirm/Move"\r
+#define IniKey_ConfirmDelete            "Confirm/Delete"\r
+#define IniKey_ConfirmRename            "Confirm/Rename"\r
+#define IniKey_AutoCloseCopy            "AutoClose/Copy"\r
+#define IniKey_AutoCloseMove            "AutoClose/Move"\r
+#define IniKey_AutoCloseDelete          "AutoClose/Delete"\r
+#define IniKey_AutoCloseRename          "AutoClose/Rename"\r
+#define IniKey_EditorPath               "Editor/Path"\r
+#define IniKey_EditorOption             "Editor/Option"\r
+#define IniKey_TerminalPath             "Terminal/Path"\r
+#define IniKey_TerminalOption           "TerminalOption"\r
+#define IniKey_WindowGeometry           "Window/Geometry"\r
+#define iniKey_WindowState              "Window/State"\r
+// 以下は[Left/Right]セクションのキー\r
+#define IniKey_Dir                  "dir"\r
+#define IniKey_SortBy               "SortBy"\r
+#define IniKey_OrderBy              "OrderBy"\r
+#define IniKey_PutDirs              "PutDirs"\r
+#define IniKey_IgnoreCase           "IgnoreCase"\r
 \r
 #define SortByName  QDir::Name\r
 #define SortByDate  QDir::Time\r
@@ -56,10 +70,4 @@ extern QString FilesizeToString(quint64 size);
 #define PutDirsLast     QDir::DirsLast\r
 #define PutDirsDefault  0\r
 \r
-#define DefaultMarkBgColor      QColor(0, 192, 0)\r
-#define DefaultMarkFgColor      QColor(128, 0, 0)\r
-#define DefaultSystemColor      QColor(128, 0, 128)\r
-#define DefaultHiddenColor      QColor(128, 128, 128)\r
-#define DefaultReadonlyColor    QColor(0, 128, 0)\r
-\r
 #endif // COMMON_H\r
index 0ba7816..a8526e7 100644 (file)
@@ -149,6 +149,10 @@ bool FileTableModel::isDir(const QModelIndex &index) const
 \r
 const QString FileTableModel::absoluteFilePath(const QModelIndex &index) const\r
 {\r
+    if (!index.isValid()) {\r
+        qDebug() << "index is invalid.";\r
+        return QString();\r
+    }\r
     return m_dir.absoluteFilePath(m_fileInfoList[index.row()].fileName());\r
 }\r
 \r
@@ -157,22 +161,20 @@ QFileInfo FileTableModel::fileInfo(const QModelIndex &index) const
     return m_fileInfoList[index.row()];\r
 }\r
 \r
-#define Brush(x, y, z)  QBrush((x).value((y), (z)).value<QColor>());\r
-\r
-\r
 void FileTableModel::updateAppearance()\r
 {\r
     QSettings settings;\r
     QPalette palette(QApplication::palette("QTableView"));\r
 \r
-    m_font = settings.value(IniKey_ViewFont, QApplication::font()).value<QFont>();\r
-    m_NormalBrush = Brush(settings, IniKey_ViewColorBgNormal, palette.base());\r
-    m_NormalTextBrush = Brush(settings, IniKey_ViewColorFgNormal, palette.text());\r
-    m_MarkBrush = Brush(settings, IniKey_ViewColorBgMark, DefaultMarkBgColor);\r
-    m_MarkTextBrush = Brush(settings, IniKey_ViewColorFgMark, DefaultMarkFgColor);\r
-    m_SystemBrush = Brush(settings, IniKey_ViewColorFgSystem, DefaultSystemColor);\r
-    m_HiddenBrush = Brush(settings, IniKey_ViewColorFgHidden, DefaultHiddenColor);\r
-    m_ReadonlyBrush = Brush(settings, IniKey_ViewColorFgReadonly, DefaultReadonlyColor);\r
+    m_font = settings.value(IniKey_ViewFont).value<QFont>();\r
+    m_NormalBrush = QBrush(settings.value(IniKey_ViewColorBgNormal).value<QColor>());\r
+    m_NormalTextBrush = QBrush(settings.value(IniKey_ViewColorFgNormal).value<QColor>());\r
+    m_MarkBrush = QBrush(settings.value(IniKey_ViewColorBgMark).value<QColor>());\r
+    m_MarkTextBrush = QBrush(settings.value(IniKey_ViewColorFgMark).value<QColor>());\r
+    m_SystemBrush = QBrush(settings.value(IniKey_ViewColorFgSystem).value<QColor>());\r
+    m_HiddenBrush = QBrush(settings.value(IniKey_ViewColorFgHidden).value<QColor>());\r
+    m_ReadonlyBrush = QBrush(settings.value(IniKey_ViewColorFgReadonly).value<QColor>());\r
+    m_ReadonlyBrush = QBrush(settings.value(IniKey_ViewColorFgReadonly).value<QColor>());\r
 \r
     beginResetModel();\r
     endResetModel();\r
index 52d2e3d..1a1fa1a 100644 (file)
@@ -46,7 +46,7 @@ FileTableView::FileTableView(QWidget *parent) :
     // シグナル/スロットを設定する\r
     connect(MENU_TRRIGGERED(action_Open), this, SLOT(setPath()));\r
     connect(MENU_TRRIGGERED(action_Exec), this, SLOT(openUrl()));\r
-    connect(MENU_TRRIGGERED(action_OpenEditor), this, SLOT(XXX()));\r
+    connect(MENU_TRRIGGERED(action_OpenEditor), this, SLOT(openEditor()));\r
     connect(MENU_TRRIGGERED(action_Command), this, SLOT(kickProcess()));\r
 \r
     connect(MENU_TRRIGGERED(mark_Toggle), this, SLOT(toggleChecked()));\r
@@ -86,7 +86,7 @@ FileTableView::FileTableView(QWidget *parent) :
             this, SLOT(showSystemFiles(bool)));\r
 \r
     connect(this, SIGNAL(doubleClicked(QModelIndex)),\r
-            this, SLOT(setRootIndex(QModelIndex)));\r
+            this, SLOT(onDoubleClick(QModelIndex)));\r
 \r
     // Drag & Drop\r
     setDragEnabled(true);\r
@@ -134,6 +134,7 @@ void FileTableView::setRootPath(const QString &path, bool addHistory)
         }\r
         updateMenu();\r
 \r
+        selectRow(0);\r
         getMainWnd()->statusBar()->showMessage(tr("レディ"), 5000);\r
     }\r
 }\r
@@ -174,15 +175,67 @@ void FileTableView::setPath()
     setRootIndex(currentIndex());\r
 }\r
 \r
-void FileTableView::openUrl()\r
+void FileTableView::openUrl(const QModelIndex &index)\r
 {\r
     CHECK_FOCUS;\r
 \r
-    QFileInfoList list = selectedItems();\r
-    foreach (const QFileInfo &info, list) {\r
-        QString path = QDir::toNativeSeparators(info.absoluteFilePath());\r
+    if (index.isValid()) {\r
+        FileTableModel *m = static_cast<FileTableModel*>(model());\r
+        QString path = QDir::toNativeSeparators(m->absoluteFilePath(index));\r
         QDesktopServices::openUrl(QUrl("file:///" + path));\r
     }\r
+    else {\r
+        QFileInfoList list = selectedItems();\r
+        foreach (const QFileInfo &info, list) {\r
+            QString path = QDir::toNativeSeparators(info.absoluteFilePath());\r
+            QDesktopServices::openUrl(QUrl("file:///" + path));\r
+        }\r
+    }\r
+}\r
+\r
+void FileTableView::openEditor(const QString &path)\r
+{\r
+    CHECK_FOCUS;\r
+\r
+    QSettings settings;\r
+    if (settings.value(IniKey_EditorPath).toString().isEmpty()) {\r
+        QMessageBox::critical(\r
+                    this, tr("エラー"),\r
+                    tr("外部エディタのパスが未定義です。"));\r
+        return;\r
+    }\r
+\r
+    QFileInfo info;\r
+    if (path.isEmpty()) {\r
+        FileTableModel *m = static_cast<FileTableModel*>(model());\r
+        info.setFile(m->absoluteFilePath(currentIndex()));\r
+    }\r
+    else {\r
+        info.setFile(path);\r
+    }\r
+    QString exe = settings.value(IniKey_EditorPath).toString();\r
+    QString opt = settings.value(IniKey_EditorOption).toString();\r
+    opt.replace("$B", info.completeBaseName());\r
+    opt.replace("$E", info.suffix());\r
+    opt.replace("$F", info.fileName());\r
+    opt.replace("$D", info.absolutePath());\r
+    opt.replace("$P", info.absoluteFilePath());\r
+\r
+    QString command;\r
+#ifdef Q_OS_MAC\r
+    command = "open " + exe + " " + opt;\r
+#else\r
+    command = QQ(exe) + " " + opt;\r
+#endif\r
+    qDebug() << command;\r
+    QProcess process(this);\r
+    process.setWorkingDirectory(info.absolutePath());\r
+    if (!process.startDetached(command)) {\r
+        QMessageBox::critical(\r
+                    this, tr("エラー"),\r
+                    tr("外部エディタの起動に失敗しました。<br/>")\r
+                    + command);\r
+    }\r
 }\r
 \r
 void FileTableView::kickProcess()\r
@@ -402,7 +455,7 @@ void FileTableView::setSort()
         FileTableModel *m = static_cast<FileTableModel*>(model());\r
         m->setSorting(QDir::Name);  // 0\r
 \r
-        int sortBy = settings.value(side() + slash + IniKey_SortBy, 0).toInt();\r
+        int sortBy = settings.value(side() + slash + IniKey_SortBy).toInt();\r
         switch (sortBy) {\r
         case SortByDate:    m->setSorting(m->sorting() | QDir::Time); break;\r
         case SortBySize:    m->setSorting(m->sorting() | QDir::Size); break;\r
@@ -411,19 +464,19 @@ void FileTableView::setSort()
         }\r
 \r
         // デフォルトだと文字列は昇順で、数値は降順…orz\r
-        int orderBy = settings.value(side() + slash + IniKey_OrderBy, 0).toInt();\r
+        int orderBy = settings.value(side() + slash + IniKey_OrderBy).toInt();\r
         if (((sortBy == SortByName || sortBy == SortByType) && orderBy == OrderByDesc) ||\r
             ((sortBy == SortByDate || sortBy == SortBySize) && orderBy == OrderByAsc))\r
         {\r
             m->setSorting(m->sorting() | QDir::Reversed);\r
         }\r
 \r
-        switch (settings.value(side() + slash + IniKey_PutDirs, 0).toInt()) {\r
+        switch (settings.value(side() + slash + IniKey_PutDirs).toInt()) {\r
         case PutDirsFirst:  m->setSorting(m->sorting() | QDir::DirsFirst); break;\r
         case PutDirsLast:   m->setSorting(m->sorting() | QDir::DirsLast); break;\r
         }\r
 \r
-        if (settings.value(side() + slash + IniKey_IgnoreCase, true).toBool()) {\r
+        if (settings.value(side() + slash + IniKey_IgnoreCase).toBool()) {\r
             m->setSorting(m->sorting() | QDir::IgnoreCase);\r
         }\r
 \r
@@ -577,6 +630,15 @@ void FileTableView::cmdCopy()
         return;\r
     }\r
 \r
+    QSettings settings;\r
+    if (settings.value(IniKey_ConfirmCopy).toBool()) {\r
+        int ret = QMessageBox::question(this, tr("確認"),\r
+                                        tr("コピーを実行しますか?"));\r
+        if (ret != QMessageBox::Yes) {\r
+            return;\r
+        }\r
+    }\r
+\r
     FileTableView *other = getMainWnd()->otherSideView(this);\r
     FileTableModel *mOther = static_cast<FileTableModel*>(other->model());\r
     CopyMoveWorker *worker = new CopyMoveWorker();\r
@@ -589,8 +651,11 @@ void FileTableView::cmdCopy()
     OperationDialog opDlg(this);\r
     opDlg.setWindowTitle(tr("コピー"));\r
     opDlg.setWorker(worker);\r
+    opDlg.setAutoClose(settings.value(IniKey_AutoCloseCopy).toBool());\r
 \r
     opDlg.exec();\r
+\r
+    settings.setValue(IniKey_AutoCloseCopy, opDlg.autoClose());\r
 }\r
 \r
 void FileTableView::cmdMove()\r
@@ -602,6 +667,15 @@ void FileTableView::cmdMove()
         return;\r
     }\r
 \r
+    QSettings settings;\r
+    if (settings.value(IniKey_ConfirmMove).toBool()) {\r
+        int ret = QMessageBox::question(this, tr("確認"),\r
+                                        tr("移動を実行しますか?"));\r
+        if (ret != QMessageBox::Yes) {\r
+            return;\r
+        }\r
+    }\r
+\r
     FileTableView *other = getMainWnd()->otherSideView(this);\r
     FileTableModel *mOther = static_cast<FileTableModel*>(other->model());\r
     CopyMoveWorker *worker = new CopyMoveWorker();\r
@@ -614,8 +688,11 @@ void FileTableView::cmdMove()
     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 FileTableView::cmdDelete()\r
@@ -627,25 +704,33 @@ void FileTableView::cmdDelete()
         return;\r
     }\r
 \r
-    QString msg;\r
-    if (list.size() == 1) {\r
-        msg = list[0].fileName();\r
-    }\r
-    else {\r
-        msg = tr("%1個のアイテム").arg(list.size());\r
+    QSettings settings;\r
+    if (settings.value(IniKey_ConfirmDelete).toBool()) {\r
+        QString msg;\r
+        if (list.size() == 1) {\r
+            msg = list[0].fileName();\r
+        }\r
+        else {\r
+            msg = tr("%1個のアイテム").arg(list.size());\r
+        }\r
+        int ret = QMessageBox::question(\r
+                    this, tr("確認"),\r
+                    msg + tr("を削除しますか?"));\r
+        if (ret != QMessageBox::Yes) {\r
+            return;\r
+        }\r
     }\r
-    int ret = QMessageBox::question(\r
-                this, tr("確認"),\r
-                msg + tr("を削除します<br/>よろしいですか?"));\r
-    if (ret == QMessageBox::Yes) {\r
-        DeleteWorker *worker = new DeleteWorker();\r
-        worker->setDeleteList(&list);\r
+    DeleteWorker *worker = new DeleteWorker();\r
+    worker->setDeleteList(&list);\r
 \r
-        OperationDialog opDlg(this);\r
-        opDlg.setWindowTitle(tr("削除"));\r
-        opDlg.setWorker(worker);\r
-        opDlg.exec();\r
-    }\r
+    OperationDialog opDlg(this);\r
+    opDlg.setWindowTitle(tr("削除"));\r
+    opDlg.setWorker(worker);\r
+    opDlg.setAutoClose(settings.value(IniKey_AutoCloseDelete).toBool());\r
+\r
+    opDlg.exec();\r
+\r
+    settings.setValue(IniKey_AutoCloseDelete, opDlg.autoClose());\r
 }\r
 \r
 void FileTableView::cmdRename()\r
@@ -669,13 +754,26 @@ void FileTableView::cmdRename()
     dlg->setNames(list);\r
     int dlgResult = dlg->exec();\r
     if (dlgResult == QDialog::Accepted && !dlg->renameMap().isEmpty()) {\r
+        QSettings settings;\r
+        if (settings.value(IniKey_ConfirmRename).toBool()) {\r
+            int ret = QMessageBox::question(this, tr("確認"),\r
+                                            tr("名前の変更を実行しますか?"));\r
+            if (ret != QMessageBox::Yes) {\r
+                return;\r
+            }\r
+        }\r
+\r
         RenameWorker *worker = new RenameWorker();\r
         worker->setRenameMap(&dlg->renameMap());\r
 \r
         OperationDialog opDlg(this);\r
         opDlg.setWindowTitle(tr("名前を変更"));\r
         opDlg.setWorker(worker);\r
+        opDlg.setAutoClose(settings.value(IniKey_AutoCloseRename).toBool());\r
+\r
         opDlg.exec();\r
+\r
+        settings.setValue(IniKey_AutoCloseRename, opDlg.autoClose());\r
     }\r
 }\r
 \r
@@ -698,6 +796,11 @@ void FileTableView::newFile()
         }\r
         else {\r
             file.close();\r
+\r
+            QSettings settings;\r
+            if (settings.value(IniKey_OpenAfterCreateFile).toBool()) {\r
+                openEditor(dir.absoluteFilePath(name));\r
+            }\r
         }\r
     }\r
 }\r
@@ -718,6 +821,12 @@ void FileTableView::newFolder()
                         this, tr("エラー"),\r
                         tr("フォルダの作成に失敗しました。"));\r
         }\r
+        else {\r
+            QSettings settings;\r
+            if (settings.value(IniKey_MoveAfterCreateFolder).toBool()) {\r
+                setRootPath(dir.absoluteFilePath(name), true);\r
+            }\r
+        }\r
     }\r
 }\r
 \r
@@ -733,6 +842,25 @@ void FileTableView::askOverWrite(bool *bOk, int *prevCopyMethod, int *copyMethod
                                  const QString &tgtPath)\r
  {\r
      OverWriteDialog dlg;\r
+     if (*prevCopyMethod == OverWriteDialog::Undefined) {\r
+         QSettings settings;\r
+         QString method = settings.value(IniKey_DefaultOnCopy).toString();\r
+         if (method == "owDefOverWrite") {\r
+             *prevCopyMethod = OverWriteDialog::OverWrite;\r
+         }\r
+         else if (method == "owDefSkip") {\r
+             *prevCopyMethod = OverWriteDialog::Skip;\r
+         }\r
+         else if (method == "owDefAppendNumber") {\r
+             *prevCopyMethod = OverWriteDialog::AppendNumber;\r
+         }\r
+         else if (method == "owDefRename") {\r
+             *prevCopyMethod = OverWriteDialog::Rename;\r
+         }\r
+         else {\r
+             *prevCopyMethod = OverWriteDialog::OverWriteIfNew;\r
+         }\r
+     }\r
      dlg.setCopyMethod(*prevCopyMethod);\r
      dlg.setSameMethodChecked(*copyMethod != OverWriteDialog::Undefined);\r
      dlg.setFileInfo(srcPath, tgtPath);\r
@@ -751,6 +879,23 @@ void FileTableView::askOverWrite(bool *bOk, int *prevCopyMethod, int *copyMethod
      worker->endAsking();\r
 }\r
 \r
+void FileTableView::onDoubleClick(const QModelIndex &index)\r
+{\r
+    if (!index.isValid()) {\r
+        return;\r
+    }\r
+\r
+    FileTableModel *m = static_cast<FileTableModel*>(model());\r
+\r
+    if (m->isDir(index)) {\r
+        setRootPath(m->absoluteFilePath(index), true);\r
+    }\r
+    else {\r
+        openUrl(index);\r
+    }\r
+\r
+}\r
+\r
 void FileTableView::setRootIndex(const QModelIndex &index)\r
 {\r
     if (!index.isValid()) {\r
@@ -801,6 +946,14 @@ void FileTableView::keyPressEvent(QKeyEvent *event)
 \r
 void FileTableView::focusInEvent(QFocusEvent *event)\r
 {\r
+    qDebug() << "focusInEvent();";\r
+    if (!currentIndex().isValid()) {\r
+        FileTableModel *m = static_cast<FileTableModel*>(model());\r
+        if (m) {\r
+            setCurrentIndex(m->index(0, 0));\r
+        }\r
+    }\r
+\r
     updateMenu();\r
 \r
     QTableView::focusInEvent(event);\r
index c95ca6a..c173704 100644 (file)
@@ -32,9 +32,10 @@ private:
 signals:\r
     void indexChanged(const QString &text);\r
 \r
-public slots:\r
+private slots:\r
     void setPath();\r
-    void openUrl();\r
+    void openUrl(const QModelIndex &index = QModelIndex());\r
+    void openEditor(const QString &path = QString());\r
     void kickProcess();\r
 \r
     void toggleChecked();\r
@@ -76,6 +77,7 @@ private slots:
     void askOverWrite(bool *bOk, int *prevCopyMethod, int *copyMethod,\r
                       QString *alias, const QString &srcPath,\r
                       const QString &tgtPath);\r
+    void onDoubleClick(const QModelIndex &index);\r
 \r
     // QAbstractItemView interface\r
 public slots:\r
index fac54e5..85db85b 100644 (file)
@@ -64,15 +64,15 @@ void FolderPanel::setSide(const QString &side)
 \r
     //>>>>> フィルタ初期化\r
     model->setFilter(QDir::NoDot | QDir::AllDirs | QDir::Files);\r
-    if (settings.value(IniKey_ShowHidden, false).toBool()) {\r
+    if (settings.value(IniKey_ShowHidden).toBool()) {\r
         model->setFilter(model->filter() | QDir::Hidden);\r
     }\r
-    if (settings.value(IniKey_ShowSystem, false).toBool()) {\r
+    if (settings.value(IniKey_ShowSystem).toBool()) {\r
         model->setFilter(model->filter() | QDir::System);\r
     }\r
     //>>>>> ソート順初期化\r
     model->setSorting(QDir::Name);  // 0\r
-    int sortBy = settings.value(side + slash + IniKey_SortBy, SortByName).toInt();\r
+    int sortBy = settings.value(side + slash + IniKey_SortBy).toInt();\r
     switch (sortBy) {\r
     case SortByDate:    model->setSorting(model->sorting() | QDir::Time); break;\r
     case SortBySize:    model->setSorting(model->sorting() | QDir::Size); break;\r
@@ -80,24 +80,23 @@ void FolderPanel::setSide(const QString &side)
     default:            model->setSorting(model->sorting() | QDir::Name); break;\r
     }\r
     // デフォルトだと文字列は昇順で、数値は降順…orz\r
-    int orderBy = settings.value(side + slash + IniKey_OrderBy, OrderByAsc).toInt();\r
+    int orderBy = settings.value(side + slash + IniKey_OrderBy).toInt();\r
     if (((sortBy == SortByName || sortBy == SortByType) && orderBy == OrderByDesc) ||\r
         ((sortBy == SortByDate || sortBy == SortBySize) && orderBy == OrderByAsc))\r
     {\r
         model->setSorting(model->sorting() | QDir::Reversed);\r
     }\r
     // フォルダの位置\r
-    switch (settings.value(side + slash + IniKey_PutDirs, PutDirsFirst).toInt()) {\r
+    switch (settings.value(side + slash + IniKey_PutDirs).toInt()) {\r
     case PutDirsFirst:  model->setSorting(model->sorting() | QDir::DirsFirst); break;\r
     case PutDirsLast:   model->setSorting(model->sorting() | QDir::DirsLast); break;\r
     }\r
     // 大文字小文字の区別\r
-    if (settings.value(side + slash + IniKey_IgnoreCase, true).toBool()) {\r
+    if (settings.value(side + slash + IniKey_IgnoreCase).toBool()) {\r
         model->setSorting(model->sorting() | QDir::IgnoreCase);\r
     }\r
     //>>>>> 監視フォルダ初期化\r
-    QString key = side + slash + IniKey_Dir;\r
-    QString path = settings.value(key, QDir::homePath()).toString();\r
+    QString path = settings.value(side + slash + IniKey_Dir).toString();\r
 \r
     model->updateAppearance();\r
     ui->fileTable->setModel(model);\r
@@ -110,22 +109,18 @@ void FolderPanel::updateAppearance()
     QPalette palette;\r
     QFont font;\r
 \r
-    font = ui->locationField->font();\r
-    font = settings.value(IniKey_BoxFont, font).value<QFont>();\r
+    font = settings.value(IniKey_BoxFont).value<QFont>();\r
     palette = ui->locationField->palette();\r
-    palette.setColor(\r
-                QPalette::Base,\r
-                settings.value(IniKey_BoxColorBg, palette.base()).value<QColor>());\r
-    palette.setColor(\r
-                QPalette::Text,\r
-                settings.value(IniKey_BoxColorFg, palette.text()).value<QColor>());\r
+    palette.setColor(QPalette::Base,\r
+                     settings.value(IniKey_BoxColorBg).value<QColor>());\r
+    palette.setColor(QPalette::Text,\r
+                     settings.value(IniKey_BoxColorFg).value<QColor>());\r
     ui->locationField->setFont(font);\r
     ui->locationField->setPalette(palette);\r
 \r
     palette = ui->fileTable->palette();\r
-    palette.setColor(\r
-                QPalette::Base,\r
-                settings.value(IniKey_ViewColorBgNormal, palette.base()).value<QColor>());\r
+    palette.setColor(QPalette::Base,\r
+                     settings.value(IniKey_ViewColorBgNormal).value<QColor>());\r
     ui->fileTable->setPalette(palette);\r
 \r
     FileTableModel *model = static_cast<FileTableModel*>(ui->fileTable->model());\r
index fc653b8..0c6772b 100644 (file)
@@ -48,6 +48,9 @@
    </item>\r
    <item>\r
     <widget class="FileTableView" name="fileTable">\r
+     <property name="focusPolicy">\r
+      <enum>Qt::StrongFocus</enum>\r
+     </property>\r
      <property name="verticalScrollBarPolicy">\r
       <enum>Qt::ScrollBarAlwaysOn</enum>\r
      </property>\r
index c2049bb..9357b5a 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -1,7 +1,9 @@
 #include "common.h"\r
 #include "mainwindow.h"\r
+\r
 #include <QApplication>\r
 #include <QSettings>\r
+#include <QDir>\r
 \r
 int main(int argc, char *argv[])\r
 {\r
@@ -20,6 +22,102 @@ int main(int argc, char *argv[])
         settings.clear();\r
     }\r
 \r
+    // 各オプションのデフォルト値を設定する\r
+    //>>>>> 起動と終了\r
+    if (settings.value(IniKey_ConfirmExit, "").toString().isEmpty())\r
+        settings.setValue(IniKey_ConfirmExit, true);\r
+    if (settings.value(IniKey_BootSizeSpec, "").toString().isEmpty()) {\r
+        settings.setValue(IniKey_BootSizeSpec, "sizeLast");\r
+        settings.setValue(IniKey_BootSizeAbs, QSize(800,600));\r
+        settings.setValue(IniKey_BootSizeRel, QSize(50,50));\r
+    }\r
+    if (settings.value(IniKey_BootPosSpec, "").toString().isEmpty()) {\r
+        settings.setValue(IniKey_BootPosSpec, "posLast");\r
+        settings.setValue(IniKey_BootPosAbs, QPoint(0, 0));\r
+        settings.setValue(IniKey_BootPosRel, QPoint(0, 0));\r
+    }\r
+    //>>>>> 色とフォント\r
+    if (settings.value(IniKey_BoxFont, "").toString().isEmpty()) {\r
+        settings.setValue(IniKey_BoxFont, a.font());\r
+        settings.setValue(IniKey_BoxColorBg, QPalette().base().color());\r
+        settings.setValue(IniKey_BoxColorFg, QPalette().text().color());\r
+    }\r
+    if (settings.value(IniKey_ViewFont, "").toString().isEmpty()) {\r
+        settings.setValue(IniKey_ViewFont, a.font());\r
+        settings.setValue(IniKey_ViewColorBgMark, QColor(0,192,0));\r
+        settings.setValue(IniKey_ViewColorBgNormal, QPalette().base().color());\r
+        settings.setValue(IniKey_ViewColorFgHidden, QColor(128,128,128));\r
+        settings.setValue(IniKey_ViewColorFgMark, QColor(128,0,0));\r
+        settings.setValue(IniKey_ViewColorFgNormal, QPalette().text().color());\r
+        settings.setValue(IniKey_ViewColorFgReadonly, QColor(0,128,0));\r
+        settings.setValue(IniKey_ViewColorFgSystem, QColor(128,0,128));\r
+    }\r
+    //>>>>>\r
+    if (settings.value(IniKey_AutoCloseCopy, "").toString().isEmpty()) {\r
+        settings.setValue(IniKey_AutoCloseCopy, false);\r
+        settings.setValue(IniKey_AutoCloseDelete, false);\r
+        settings.setValue(IniKey_AutoCloseMove, false);\r
+        settings.setValue(IniKey_AutoCloseRename, false);\r
+    }\r
+    if (settings.value(IniKey_ConfirmCopy, "").toString().isEmpty()) {\r
+        settings.setValue(IniKey_ConfirmCopy, true);\r
+        settings.setValue(IniKey_ConfirmDelete, true);\r
+        settings.setValue(IniKey_ConfirmMove, true);\r
+        settings.setValue(IniKey_ConfirmRename, true);\r
+    }\r
+    if (settings.value(IniKey_DefaultOnCopy, "").toString().isEmpty())\r
+        settings.setValue(IniKey_DefaultOnCopy, "owDefIfNew");\r
+    if (settings.value(IniKey_MoveAfterCreateFolder, "").toString().isEmpty())\r
+        settings.setValue(IniKey_MoveAfterCreateFolder, false);\r
+    if (settings.value(IniKey_OpenAfterCreateFile, "").toString().isEmpty())\r
+        settings.setValue(IniKey_OpenAfterCreateFile, false);\r
+    //>>>>>\r
+    if (settings.value(IniKey_EditorPath, "").toString().isEmpty()) {\r
+#if defined(Q_OS_WIN)\r
+        settings.setValue(IniKey_EditorPath, "notepad.exe");\r
+#elif defined(Q_OS_MAC)\r
+        settings.setValue(IniKey_EditorPath, "-t");\r
+#else\r
+        settings.setValue(IniKey_EditorPath, "gedit");\r
+#endif\r
+        settings.setValue(IniKey_EditorOption, QQ("$P"));\r
+    }\r
+    if (settings.value(IniKey_TerminalPath, "").toString().isEmpty()) {\r
+#if defined(Q_OS_WIN)\r
+        settings.setValue(IniKey_TerminalPath, "cmd.exe");\r
+        settings.setValue(IniKey_TerminalOption, "/k cd " + QQ("$D"));\r
+#elif defined(Q_OS_MAC)\r
+        settings.setValue(IniKey_TerminalPath, "/Applications/Utilities/Terminal.app");\r
+        settings.setValue(IniKey_TerminalOption, "-c cd " + QQ("$D"));\r
+#else\r
+        settings.setValue(IniKey_TerminalPath, "gnome-terminal");\r
+        settings.setValue(IniKey_TerminalOption, "-c cd " + QQ("$D"));\r
+#endif\r
+    }\r
+    //>>>>> 隠しファイルの表示\r
+    if (settings.value(IniKey_ShowHidden, "").toString().isEmpty())\r
+        settings.setValue(IniKey_ShowHidden, false);\r
+    //>>>>> システムファイルの表示\r
+    if (settings.value(IniKey_ShowSystem, "").toString().isEmpty())\r
+        settings.setValue(IniKey_ShowSystem, false);\r
+    //>>>>> 最後のフォルダとソート方法\r
+    QString side = "Left/";\r
+    if (settings.value(side + IniKey_Dir, "").toString().isEmpty()) {\r
+        settings.setValue(side + IniKey_Dir, QDir::homePath());\r
+        settings.setValue(side + IniKey_SortBy, SortByName);\r
+        settings.setValue(side + IniKey_OrderBy, OrderByAsc);\r
+        settings.setValue(side + IniKey_PutDirs, PutDirsFirst);\r
+        settings.setValue(side + IniKey_IgnoreCase, true);\r
+    }\r
+    side = "Right/";\r
+    if (settings.value(side + IniKey_Dir, "").toString().isEmpty()) {\r
+        settings.setValue(side + IniKey_Dir, QDir::homePath());\r
+        settings.setValue(side + IniKey_SortBy, SortByName);\r
+        settings.setValue(side + IniKey_OrderBy, OrderByAsc);\r
+        settings.setValue(side + IniKey_PutDirs, PutDirsFirst);\r
+        settings.setValue(side + IniKey_IgnoreCase, true);\r
+    }\r
+\r
     MainWindow w;\r
     w.show();\r
 \r
index d5343ad..741a032 100644 (file)
@@ -22,13 +22,20 @@ MainWindow::MainWindow(QWidget *parent) :
     ui->RPanel->updateAppearance();\r
 \r
     QSettings settings;\r
-    // メニュー項目のチェック状態を初期化する\r
-    if (settings.value(IniKey_ShowHidden, false).toBool()) {\r
+    // メニュー項目の状態を初期化する\r
+    if (settings.value(IniKey_ShowHidden).toBool()) {\r
         ui->view_Hidden->setChecked(true);\r
     }\r
-    if (settings.value(IniKey_ShowSystem, false).toBool()) {\r
+    if (settings.value(IniKey_ShowSystem).toBool()) {\r
         ui->view_System->setChecked(true);\r
     }\r
+    bool enabled;\r
+    enabled = !settings.value(IniKey_EditorPath).toString().isEmpty();\r
+    ui->action_OpenEditor->setEnabled(enabled);\r
+\r
+    enabled = settings.value(IniKey_TerminalPath).toString().isEmpty();\r
+    ui->action_OpenTerminal->setEnabled(enabled);\r
+\r
     // 追加のショートカットキーを設定する\r
     QList<QKeySequence> shortcuts;\r
     shortcuts = ui->action_Open->shortcuts();\r
@@ -63,11 +70,13 @@ MainWindow::MainWindow(QWidget *parent) :
     QPoint point = this->geometry().topLeft();\r
     QSize size = this->geometry().size();\r
     //>>>> 前回の位置・サイズ・状態を復元する\r
-    restoreGeometry(settings.value(IniKey_WindowGeometry).toByteArray());\r
-    restoreState(settings.value(iniKey_WindowState).toByteArray());\r
+    if (!settings.value(IniKey_WindowGeometry, "").toString().isEmpty()) {\r
+        restoreGeometry(settings.value(IniKey_WindowGeometry).toByteArray());\r
+        restoreState(settings.value(iniKey_WindowState).toByteArray());\r
+    }\r
     //>>>> INIファイルの設定から復元する\r
     //>>> サイズ\r
-    strValue = settings.value(IniKey_BootSizeSpec, "").toString();\r
+    strValue = settings.value(IniKey_BootSizeSpec).toString();\r
     if (strValue == "sizeAbsolute") {\r
         size = settings.value(IniKey_BootSizeAbs).toSize();\r
     }\r
@@ -80,7 +89,7 @@ MainWindow::MainWindow(QWidget *parent) :
         size = this->geometry().size();\r
     }\r
     //>>> 位置\r
-    strValue = settings.value(IniKey_BootPosSpec, "").toString();\r
+    strValue = settings.value(IniKey_BootPosSpec).toString();\r
     if (strValue == "posAbsolute") {\r
         point = settings.value(IniKey_BootPosAbs).toPoint();\r
     }\r
@@ -125,6 +134,14 @@ void MainWindow::onActionSetting()
     if (dlg.exec() == QDialog::Accepted) {\r
         ui->LPanel->updateAppearance();\r
         ui->RPanel->updateAppearance();\r
+\r
+        QSettings settings;\r
+        bool enabled;\r
+        enabled = !settings.value(IniKey_EditorPath).toString().isEmpty();\r
+        ui->action_OpenEditor->setEnabled(enabled);\r
+\r
+        enabled = settings.value(IniKey_TerminalPath).toString().isEmpty();\r
+        ui->action_OpenTerminal->setEnabled(enabled);\r
     }\r
 }\r
 \r
@@ -133,7 +150,7 @@ void MainWindow::toggleShowHiddenFiles()
     // キーボードがトリガーの場合、メニュー項目のチェック状態は\r
     // 変わらない(Mac)ので、QSettingsを使う\r
     QSettings settings;\r
-    bool show = !settings.value(IniKey_ShowHidden, false).toBool();\r
+    bool show = !settings.value(IniKey_ShowHidden).toBool();\r
     settings.setValue(IniKey_ShowHidden, show);\r
 \r
     ui->view_Hidden->setChecked(show);\r
@@ -146,7 +163,7 @@ void MainWindow::toggleShowSystemFiles()
     // キーボードがトリガーの場合、メニュー項目のチェック状態は\r
     // 変わらない(Mac)ので、QSettingsを使う\r
     QSettings settings;\r
-    bool show = !settings.value(IniKey_ShowSystem, false).toBool();\r
+    bool show = !settings.value(IniKey_ShowSystem).toBool();\r
     settings.setValue(IniKey_ShowSystem, show);\r
 \r
     ui->view_System->setChecked(show);\r
@@ -182,7 +199,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
 {\r
     QSettings settings;\r
 \r
-    if (settings.value(IniKey_ConfirmExit, true).toBool()) {\r
+    if (settings.value(IniKey_ConfirmExit).toBool()) {\r
         QMessageBox msgBox;\r
         QCheckBox *checkBox = new QCheckBox();\r
         checkBox->setText(tr("次回以降は確認しない"));\r
index 5975556..ba7020a 100644 (file)
     <addaction name="action_Open"/>\r
     <addaction name="action_Exec"/>\r
     <addaction name="action_OpenEditor"/>\r
+    <addaction name="action_OpenTerminal"/>\r
     <addaction name="action_Command"/>\r
     <addaction name="separator"/>\r
     <addaction name="action_Setting"/>\r
     <string>L</string>\r
    </property>\r
   </action>\r
+  <action name="action_OpenTerminal">\r
+   <property name="text">\r
+    <string>ターミナルで開く</string>\r
+   </property>\r
+   <property name="toolTip">\r
+    <string>ターミナルで開く</string>\r
+   </property>\r
+   <property name="shortcut">\r
+    <string>&gt;</string>\r
+   </property>\r
+  </action>\r
  </widget>\r
  <layoutdefault spacing="6" margin="11"/>\r
  <customwidgets>\r
index 75268ba..6c2d60b 100644 (file)
@@ -20,6 +20,16 @@ OperationDialog::~OperationDialog()
     delete ui;\r
 }\r
 \r
+void OperationDialog::setAutoClose(bool yes)\r
+{\r
+    ui->chkAutoClose->setChecked(yes);\r
+}\r
+\r
+bool OperationDialog::autoClose() const\r
+{\r
+    return ui->chkAutoClose->isChecked();\r
+}\r
+\r
 void OperationDialog::showEvent(QShowEvent *)\r
 {\r
     ui->textEdit->setVisible(false);\r
index 7d4d0bf..5821c77 100644 (file)
@@ -19,6 +19,8 @@ public:
     void setWorker(IWorker *worker) {\r
         m_worker = worker;\r
     }\r
+    void setAutoClose(bool yes);\r
+    bool autoClose() const;\r
 \r
 protected:\r
     void showEvent(QShowEvent *);\r
index 6eba542..3ac0073 100644 (file)
@@ -8,8 +8,7 @@
 #include <QSettings>
 #include <QDebug>
 #include <QDir>
-
-
+#include <QFileDialog>
 
 PreferenceDialog::PreferenceDialog(QWidget *parent) :
     QDialog(parent),
@@ -21,8 +20,6 @@ PreferenceDialog::PreferenceDialog(QWidget *parent) :
 
     ui->setupUi(this);
     ui->tabWidget->setCurrentIndex(0);
-    ui->tabWidget->setTabText(0, "起動と終了");
-    ui->tabWidget->setTabText(1, "色とフォント");
     ui->sampleEdit->setText(QDir::homePath());
     ui->sampleTable->setModel(&m_model);
     ui->sampleTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
@@ -54,6 +51,9 @@ PreferenceDialog::PreferenceDialog(QWidget *parent) :
     connect(ui->viewFontBold, SIGNAL(clicked()), this, SLOT(changeFont()));
     connect(ui->viewFontSize, SIGNAL(valueChanged(int)), this, SLOT(changeFont()));
 
+    connect(ui->termBrowse, SIGNAL(clicked()), this, SLOT(browseApp()));
+    connect(ui->editorBrowse, SIGNAL(clicked()), this, SLOT(browseApp()));
+
     QSettings settings;
     QString strValue;
     QSize size;
@@ -65,9 +65,9 @@ PreferenceDialog::PreferenceDialog(QWidget *parent) :
 
     //>>>>> 起動と終了
     // 終了時の確認ダイアログ
-    ui->confirmExit->setChecked(settings.value(IniKey_ConfirmExit, true).toBool());
+    ui->confirmExit->setChecked(settings.value(IniKey_ConfirmExit).toBool());
     // 起動時のサイズ
-    strValue = settings.value(IniKey_BootSizeSpec, "sizeLast").toString();
+    strValue = settings.value(IniKey_BootSizeSpec).toString();
     if (strValue.isEmpty()) {
         ui->bootSize->setChecked(false);
     }
@@ -79,14 +79,14 @@ PreferenceDialog::PreferenceDialog(QWidget *parent) :
         }
         radioBtn->setChecked(true);
     }
-    size = settings.value(IniKey_BootSizeAbs, QSize(800, 600)).toSize();
+    size = settings.value(IniKey_BootSizeAbs).toSize();
     ui->absoluteWidth->setValue(size.width());
     ui->absoluteHeight->setValue(size.height());
-    size = settings.value(IniKey_BootSizeRel, QSize(50, 50)).toSize();
+    size = settings.value(IniKey_BootSizeRel).toSize();
     ui->relativeWidth->setValue(size.width());
     ui->relativeHeight->setValue(size.height());
     // 起動時の位置
-    strValue = settings.value(IniKey_BootPosSpec, "posLast").toString();
+    strValue = settings.value(IniKey_BootPosSpec).toString();
     if (strValue.isEmpty()) {
         ui->bootPos->setChecked(false);
     }
@@ -98,27 +98,26 @@ PreferenceDialog::PreferenceDialog(QWidget *parent) :
         }
         radioBtn->setChecked(true);
     }
-    point = settings.value(IniKey_BootPosAbs, QPoint(0, 0)).toPoint();
+    point = settings.value(IniKey_BootPosAbs).toPoint();
     ui->absoluteLeft->setValue(point.x());
     ui->absoluteTop->setValue(point.y());
-    point = settings.value(IniKey_BootPosRel, QPoint(0, 0)).toPoint();
+    point = settings.value(IniKey_BootPosRel).toPoint();
     ui->relativeLeft->setValue(point.x());
     ui->relativeTop->setValue(point.y());
     // 起動時の設定削除
-    ui->resetOnBoot->setChecked(settings.value(IniKey_ResetOnBoot, false).toBool());
+    ui->resetOnBoot->setChecked(settings.value(IniKey_ResetOnBoot).toBool());
 
     //>>>>> 色とフォント
     //>>>> アドレスボックス
     palette = QPalette();
     // 背景色
-    color = settings.value(IniKey_BoxColorBg, QPalette().base().color()).value<QColor>();
+    color = settings.value(IniKey_BoxColorBg).value<QColor>();
     palette.setColor(QPalette::Base, color);
     // 文字色
-    color = settings.value(IniKey_BoxColorFg, QPalette().text().color()).value<QColor>();
+    color = settings.value(IniKey_BoxColorFg).value<QColor>();
     palette.setColor(QPalette::Text, color);
     // フォント
-    QFont defaultFont = ui->sampleEdit->font();
-    font = settings.value(IniKey_BoxFont, defaultFont).value<QFont>();
+    font = settings.value(IniKey_BoxFont).value<QFont>();
     ui->boxFont->setCurrentText(font.family());
     ui->boxFontBold->setChecked(font.bold());
     ui->boxFontSize->setValue(font.pointSize());
@@ -127,30 +126,61 @@ PreferenceDialog::PreferenceDialog(QWidget *parent) :
     ui->sampleEdit->setFont(font);
     //>>>> ファイルビュー
     // 背景色
-    color = settings.value(IniKey_ViewColorBgMark, DefaultMarkBgColor).value<QColor>();
+    color = settings.value(IniKey_ViewColorBgMark).value<QColor>();
     m_colorMap["clrBgMark"] = color;
-    color = settings.value(IniKey_ViewColorBgNormal, QPalette().base().color()).value<QColor>();
+    color = settings.value(IniKey_ViewColorBgNormal).value<QColor>();
     m_colorMap["clrBgNormal"] = color;
     // 文字色
-    color = settings.value(IniKey_ViewColorFgHidden, DefaultHiddenColor).value<QColor>();
+    color = settings.value(IniKey_ViewColorFgHidden).value<QColor>();
     m_colorMap["clrFgHidden"] = color;
-    color = settings.value(IniKey_ViewColorFgMark, DefaultMarkFgColor).value<QColor>();
+    color = settings.value(IniKey_ViewColorFgMark).value<QColor>();
     m_colorMap["clrFgMark"] = color;
-    color = settings.value(IniKey_ViewColorFgNormal, QPalette().text().color()).value<QColor>();
+    color = settings.value(IniKey_ViewColorFgNormal).value<QColor>();
     m_colorMap["clrFgNormal"] = color;
-    color = settings.value(IniKey_ViewColorFgReadonly, DefaultReadonlyColor).value<QColor>();
+    color = settings.value(IniKey_ViewColorFgReadonly).value<QColor>();
     m_colorMap["clrFgReadonly"] = color;
-    color = settings.value(IniKey_ViewColorFgSystem, DefaultSystemColor).value<QColor>();
+    color = settings.value(IniKey_ViewColorFgSystem).value<QColor>();
     m_colorMap["clrFgSystem"] = color;
     // フォント
-    defaultFont = ui->sampleTable->font();
-    font = settings.value(IniKey_ViewFont, defaultFont).value<QFont>();
+    font = settings.value(IniKey_ViewFont).value<QFont>();
     ui->viewFont->setCurrentText(font.family());
     ui->viewFontBold->setChecked(font.bold());
     ui->viewFontSize->setValue(font.pointSize());
     // サンプル表示
     m_model.setFont(font);
     m_model.update();
+
+    //>>>>> ファイル操作
+    // 確認ダイアログの表示
+    ui->confirmCopy->setChecked(settings.value(IniKey_ConfirmCopy).toBool());
+    ui->confirmDelete->setChecked(settings.value(IniKey_ConfirmDelete).toBool());
+    ui->confirmMove->setChecked(settings.value(IniKey_ConfirmMove).toBool());
+    ui->confirmRename->setChecked(settings.value(IniKey_ConfirmRename).toBool());
+    // 完了ダイアログの自動クローズ
+    ui->autoCloseCopy->setChecked(settings.value(IniKey_AutoCloseCopy).toBool());
+    ui->autoCloseDelete->setChecked(settings.value(IniKey_AutoCloseDelete).toBool());
+    ui->autoCloseMove->setChecked(settings.value(IniKey_AutoCloseMove).toBool());
+    ui->autoCloseRename->setChecked(settings.value(IniKey_AutoCloseRename).toBool());
+    // 上書き時の既定動作
+    strValue = settings.value(IniKey_DefaultOnCopy).toString();
+    if (strValue.isEmpty()) {
+        strValue = "owDefIfNew";
+    }
+    radioBtn = findChild<QRadioButton*>(strValue);
+    if (radioBtn == NULL) {
+        radioBtn = ui->owDefIfNew;
+    }
+    radioBtn->setChecked(true);
+    ui->moveAfterCreate->setChecked(settings.value(IniKey_MoveAfterCreateFolder).toBool());
+    ui->openAfterCreate->setChecked(settings.value(IniKey_OpenAfterCreateFile).toBool());
+
+    //>>>>> パス設定
+    // エディタ
+    ui->editorOpt->setText(settings.value(IniKey_EditorOption).toString());
+    ui->editorPath->setText(settings.value(IniKey_EditorPath).toString());
+    // ターミナル
+    ui->termOpt->setText(settings.value(IniKey_TerminalOption).toString());
+    ui->termPath->setText(settings.value(IniKey_TerminalPath).toString());
 }
 
 PreferenceDialog::~PreferenceDialog()
@@ -267,6 +297,21 @@ void PreferenceDialog::selectViewColor()
     m_model.update();
 }
 
+void PreferenceDialog::browseApp()
+{
+    QString path = QFileDialog::getOpenFileName(
+                this, tr("アプリケーションを選択"), "",
+                tr("実行ファイル (*.exe *.com *.bat *.pif);;すべてのファイル (*)"));
+    if (!path.isEmpty()) {
+        if (sender() == ui->editorBrowse) {
+            ui->editorPath->setText(path);
+        }
+        else if (sender() == ui->termBrowse) {
+            ui->termPath->setText(path);
+        }
+    }
+}
+
 void PreferenceDialog::accept()
 {
     QSettings settings;
@@ -324,5 +369,30 @@ void PreferenceDialog::accept()
     settings.setValue(IniKey_ViewColorFgSystem, m_colorMap["clrFgSystem"]);
     settings.setValue(IniKey_ViewFont, m_model.font());
 
+    //>>>>> ファイル操作
+    settings.setValue(IniKey_ConfirmCopy, ui->confirmCopy->isChecked());
+    settings.setValue(IniKey_ConfirmDelete, ui->confirmDelete->isChecked());
+    settings.setValue(IniKey_ConfirmMove, ui->confirmMove->isChecked());
+    settings.setValue(IniKey_ConfirmRename, ui->confirmRename->isChecked());
+
+    settings.setValue(IniKey_AutoCloseCopy, ui->autoCloseCopy->isChecked());
+    settings.setValue(IniKey_AutoCloseDelete, ui->autoCloseDelete->isChecked());
+    settings.setValue(IniKey_AutoCloseMove, ui->autoCloseMove->isChecked());
+    settings.setValue(IniKey_AutoCloseRename, ui->autoCloseRename->isChecked());
+
+    selected = ui->overwriteOptions->checkedButton();
+    settings.setValue(IniKey_DefaultOnCopy, selected->objectName());
+
+    settings.setValue(IniKey_MoveAfterCreateFolder, ui->moveAfterCreate->isChecked());
+    settings.setValue(IniKey_OpenAfterCreateFile, ui->openAfterCreate->isChecked());
+
+    //>>>>> パス設定
+    settings.setValue(IniKey_EditorOption, ui->editorOpt->text().trimmed());
+    settings.setValue(IniKey_EditorPath, ui->editorPath->text().trimmed());
+
+    settings.setValue(IniKey_TerminalOption, ui->termOpt->text().trimmed());
+    settings.setValue(IniKey_TerminalPath, ui->termPath->text().trimmed());
+
+
     QDialog::accept();
 }
index 867abaf..3a7a191 100644 (file)
@@ -28,6 +28,7 @@ private slots:
     void setControlsEnabled(bool enabled);
     void selectBoxColor();
     void selectViewColor();
+    void browseApp();
 
     // QDialog interface
 public slots:
index d6f515e..480e4c9 100644 (file)
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>589</width>
+    <width>631</width>
     <height>527</height>
    </rect>
   </property>
       <enum>Qt::StrongFocus</enum>
      </property>
      <property name="currentIndex">
-      <number>1</number>
+      <number>2</number>
      </property>
      <widget class="QWidget" name="tabBoot_Exit">
       <attribute name="title">
-       <string>Tab 1</string>
+       <string>起動と終了</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout">
        <item>
      </widget>
      <widget class="QWidget" name="tabAppearance">
       <attribute name="title">
-       <string>Tab 2</string>
+       <string>色とフォント</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_6">
        <item>
               </property>
               <property name="minimumSize">
                <size>
-                <width>100</width>
+                <width>200</width>
                 <height>0</height>
                </size>
               </property>
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>ファイル操作</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_8">
+       <item>
+        <widget class="QGroupBox" name="groupBox_5">
+         <property name="title">
+          <string>操作の開始時、確認ダイアログを表示する</string>
+         </property>
+         <layout class="QHBoxLayout" name="horizontalLayout_24">
+          <item>
+           <widget class="QCheckBox" name="confirmCopy">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>コピー</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="confirmMove">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>移動</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="confirmDelete">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>削除</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="confirmRename">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>名前変更</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer name="horizontalSpacer_14">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="groupBox_6">
+         <property name="title">
+          <string>操作の成功時、進捗ダイアログを自動で閉じる</string>
+         </property>
+         <layout class="QHBoxLayout" name="horizontalLayout_25">
+          <item>
+           <widget class="QCheckBox" name="autoCloseCopy">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>コピー</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="autoCloseMove">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>移動</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="autoCloseDelete">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>削除</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="autoCloseRename">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>名前変更</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer name="horizontalSpacer_15">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="groupBox_7">
+         <property name="title">
+          <string>同名ファイル存在時の既定の動作</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout">
+          <item row="0" column="0">
+           <widget class="QRadioButton" name="owDefOverWrite">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>上書き</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">overwriteOptions</string>
+            </attribute>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="QRadioButton" name="owDefIfNew">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>新しければ上書き</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">overwriteOptions</string>
+            </attribute>
+           </widget>
+          </item>
+          <item row="0" column="2">
+           <widget class="QRadioButton" name="owDefSkip">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>スキップ</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">overwriteOptions</string>
+            </attribute>
+           </widget>
+          </item>
+          <item row="1" column="0" colspan="2">
+           <widget class="QRadioButton" name="owDefAppendNumber">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>ファイル名末尾に数字を付与</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">overwriteOptions</string>
+            </attribute>
+           </widget>
+          </item>
+          <item row="1" column="2">
+           <widget class="QRadioButton" name="owDefRename">
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="text">
+             <string>名前を変更</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">overwriteOptions</string>
+            </attribute>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="moveAfterCreate">
+         <property name="focusPolicy">
+          <enum>Qt::StrongFocus</enum>
+         </property>
+         <property name="text">
+          <string>フォルダ作成後は、そのフォルダに移動する</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="openAfterCreate">
+         <property name="focusPolicy">
+          <enum>Qt::StrongFocus</enum>
+         </property>
+         <property name="text">
+          <string>ファイル作成後は、そのファイルをエディタで開く</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>102</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>パス設定</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_20">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_9">
+         <property name="spacing">
+          <number>0</number>
+         </property>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_27">
+           <property name="spacing">
+            <number>-1</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="label_19">
+             <property name="text">
+              <string>外部エディタ:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="editorPath"/>
+           </item>
+           <item>
+            <widget class="QPushButton" name="editorBrowse">
+             <property name="text">
+              <string>参照</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_26">
+           <item>
+            <spacer name="horizontalSpacer_16">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_20">
+             <property name="text">
+              <string>オプション引数:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="editorOpt"/>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_10">
+         <property name="spacing">
+          <number>0</number>
+         </property>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_55">
+           <property name="spacing">
+            <number>-1</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="label_45">
+             <property name="text">
+              <string>コマンドライン端末:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="termPath"/>
+           </item>
+           <item>
+            <widget class="QPushButton" name="termBrowse">
+             <property name="text">
+              <string>参照</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_56">
+           <item>
+            <spacer name="horizontalSpacer_33">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_46">
+             <property name="text">
+              <string>オプション引数:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="termOpt"/>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QTextEdit" name="optExplain">
+         <property name="font">
+          <font>
+           <family>Courier</family>
+          </font>
+         </property>
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+         <property name="html">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Courier'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.Lucida Grande UI';&quot;&gt;オプション引数に使える文字&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.Lucida Grande UI';&quot;&gt;$B ... ファイル名から拡張子を除いた部分&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.Lucida Grande UI';&quot;&gt;$E ... 拡張子&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.Lucida Grande UI';&quot;&gt;$F ... ファイル名($B.$Eと同じ)&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.Lucida Grande UI';&quot;&gt;$D ... フォルダ名&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.Lucida Grande UI';&quot;&gt;$P ... フルパス($D/$Fと同じ)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_4">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>121</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+      <zorder>verticalSpacer_4</zorder>
+      <zorder></zorder>
+      <zorder>optExplain</zorder>
+     </widget>
     </widget>
    </item>
    <item>
   </layout>
  </widget>
  <tabstops>
-  <tabstop>tabWidget</tabstop>
   <tabstop>confirmExit</tabstop>
   <tabstop>bootSize</tabstop>
   <tabstop>sizeAbsolute</tabstop>
  </connections>
  <buttongroups>
   <buttongroup name="posOptions"/>
+  <buttongroup name="overwriteOptions"/>
   <buttongroup name="sizeOptions"/>
  </buttongroups>
 </ui>
index e2b1a2b..fd3b967 100644 (file)
@@ -22,9 +22,7 @@ void SortDialog::setRightOrLeft(const QString &s)
     QSettings settings;\r
 \r
     m_RightOrLeft = s;\r
-    int sortBy = settings.value(\r
-                m_RightOrLeft + slash + IniKey_SortBy,\r
-                SortByName).toInt();\r
+    int sortBy = settings.value(m_RightOrLeft + slash + IniKey_SortBy).toInt();\r
     if (sortBy == SortByType) {\r
         ui->sortByType->setChecked(true);\r
     }\r
@@ -38,9 +36,7 @@ void SortDialog::setRightOrLeft(const QString &s)
         ui->sortByName->setChecked(true);\r
     }\r
 \r
-    int orderBy = settings.value(\r
-                m_RightOrLeft + slash + IniKey_OrderBy,\r
-                OrderByAsc).toInt();\r
+    int orderBy = settings.value(m_RightOrLeft + slash + IniKey_OrderBy).toInt();\r
     if (orderBy == OrderByDesc) {\r
         ui->orderDesc->setChecked(true);\r
     }\r
@@ -48,9 +44,7 @@ void SortDialog::setRightOrLeft(const QString &s)
         ui->orderAsc->setChecked(true);\r
     }\r
 \r
-    int putDirs = settings.value(\r
-                m_RightOrLeft + slash + IniKey_PutDirs,\r
-                PutDirsFirst).toInt();\r
+    int putDirs = settings.value(m_RightOrLeft + slash + IniKey_PutDirs).toInt();\r
     if (putDirs == PutDirsDefault) {\r
         ui->dirsDefault->setChecked(true);\r
     }\r
@@ -61,8 +55,7 @@ void SortDialog::setRightOrLeft(const QString &s)
         ui->dirsFirst->setChecked(true);\r
     }\r
 \r
-    bool ignoreCase = settings.value(\r
-                m_RightOrLeft + slash + IniKey_IgnoreCase, true).toBool();\r
+    bool ignoreCase = settings.value(m_RightOrLeft + slash + IniKey_IgnoreCase).toBool();\r
     ui->ignoreCase->setChecked(ignoreCase);\r
 }\r
 \r