Skip to content
Permalink
Browse files

implemented to show "Select Storage or Favorite folder" dialog. (refs #…

  • Loading branch information...
haraki committed Jun 7, 2019
1 parent 68e958a commit bbefac55c6cef5e092129000456892c88949e567
Showing with 366 additions and 203 deletions.
  1. +55 −40 doublefolderpanel.cpp
  2. +1 −0 doublefolderpanel.h
  3. +3 −0 farman.pro
  4. +168 −157 mainwindow.cpp
  5. +7 −6 mainwindow.h
  6. +16 −0 mainwindow.ui
  7. +20 −0 selectstoragefavoritedialog.cpp
  8. +29 −0 selectstoragefavoritedialog.h
  9. +67 −0 selectstoragefavoritedialog.ui
@@ -14,6 +14,7 @@
#include "settings.h"
#include "fileoperationdialog.h"
#include "fileattributesdialog.h"
#include "selectstoragefavoritedialog.h"
#include "file.h"

namespace Farman
@@ -316,6 +317,16 @@ bool DoubleFolderPanel::eventFilter(QObject *watched, QEvent *e)
return ret;
}

void DoubleFolderPanel::onSelectStorageFavorite()
{
SelectStorageFavoriteDialog dialog(parentWidget());
if(dialog.exec() != QDialog::Accepted)
{
return;
}

}

void DoubleFolderPanel::onSetPaneMode(PaneMode paneMode)
{
Settings::getInstance()->setPaneMode(paneMode);
@@ -340,34 +351,36 @@ void DoubleFolderPanel::onChangeSortSettings()
Qt::SortOrder order = activeForm->getSortOrder();

SortDialog dialog(sectionType, dirsType, dotFirst, caseSensitivity, order, parentWidget());
if(dialog.exec())
if(dialog.exec() != QDialog::Accepted)
{
sectionType = dialog.getSortSectionType();
dirsType = dialog.getSortDirsType();
dotFirst = dialog.getSortDotFirst();
caseSensitivity = dialog.getSortCaseSensitivity();
order = dialog.getSortOrder();
return;
}

activeForm->setSortSettings(sectionType, dirsType, dotFirst, caseSensitivity, order);
if(activeForm->objectName() == "l_folderForm")
{
Settings::getInstance()->setLeftSortSectionType(sectionType);
Settings::getInstance()->setLeftSortDirsType(dirsType);
Settings::getInstance()->setLeftSortDotFirst(dotFirst);
Settings::getInstance()->setLeftSortCaseSensitivity(caseSensitivity);
Settings::getInstance()->setLeftSortOrder(order);
}
else
{
Settings::getInstance()->setRightSortSectionType(sectionType);
Settings::getInstance()->setRightSortDirsType(dirsType);
Settings::getInstance()->setRightSortDotFirst(dotFirst);
Settings::getInstance()->setRightSortCaseSensitivity(caseSensitivity);
Settings::getInstance()->setRightSortOrder(order);
}
sectionType = dialog.getSortSectionType();
dirsType = dialog.getSortDirsType();
dotFirst = dialog.getSortDotFirst();
caseSensitivity = dialog.getSortCaseSensitivity();
order = dialog.getSortOrder();

activeForm->refresh();
activeForm->setSortSettings(sectionType, dirsType, dotFirst, caseSensitivity, order);
if(activeForm->objectName() == "l_folderForm")
{
Settings::getInstance()->setLeftSortSectionType(sectionType);
Settings::getInstance()->setLeftSortDirsType(dirsType);
Settings::getInstance()->setLeftSortDotFirst(dotFirst);
Settings::getInstance()->setLeftSortCaseSensitivity(caseSensitivity);
Settings::getInstance()->setLeftSortOrder(order);
}
else
{
Settings::getInstance()->setRightSortSectionType(sectionType);
Settings::getInstance()->setRightSortDirsType(dirsType);
Settings::getInstance()->setRightSortDotFirst(dotFirst);
Settings::getInstance()->setRightSortCaseSensitivity(caseSensitivity);
Settings::getInstance()->setRightSortOrder(order);
}

activeForm->refresh();
}

void DoubleFolderPanel::onChangeFilterSettings()
@@ -382,25 +395,27 @@ void DoubleFolderPanel::onChangeFilterSettings()
QStringList nameMaskFilters = activeForm->getNameMaskFilters();

FilterDialog dialog(filterFlags, nameMaskFilters, parentWidget());
if(dialog.exec())
if(dialog.exec() != QDialog::Accepted)
{
filterFlags = dialog.getFilterFlags();
nameMaskFilters = dialog.getNameMaskFilters();
activeForm->setFilterFlags(filterFlags);
activeForm->setNameMaskFilters(nameMaskFilters);
if(activeForm->objectName() == "l_folderForm")
{
Settings::getInstance()->setLeftFilterSettings(filterFlags);
Settings::getInstance()->setLeftNameMaskFilterSettings(nameMaskFilters);
}
else
{
Settings::getInstance()->setRightFilterSettings(filterFlags);
Settings::getInstance()->setRightNameMaskFilterSettings(nameMaskFilters);
}
return;
}

activeForm->refresh(true); // 選択状態のファイルがあると refresh でクラッシュするので選択状態を解除する
filterFlags = dialog.getFilterFlags();
nameMaskFilters = dialog.getNameMaskFilters();
activeForm->setFilterFlags(filterFlags);
activeForm->setNameMaskFilters(nameMaskFilters);
if(activeForm->objectName() == "l_folderForm")
{
Settings::getInstance()->setLeftFilterSettings(filterFlags);
Settings::getInstance()->setLeftNameMaskFilterSettings(nameMaskFilters);
}
else
{
Settings::getInstance()->setRightFilterSettings(filterFlags);
Settings::getInstance()->setRightNameMaskFilterSettings(nameMaskFilters);
}

activeForm->refresh(true); // 選択状態のファイルがあると refresh でクラッシュするので選択状態を解除する
}

void DoubleFolderPanel::onCopy()
@@ -36,6 +36,7 @@ class DoubleFolderPanel : public QWidget
FolderForm* getLeftFolderForm();
FolderForm* getRightFolderForm();

void onSelectStorageFavorite();
void onSetPaneMode(PaneMode paneMode);
void onChangeSortSettings();
void onChangeFilterSettings();
@@ -28,6 +28,7 @@ SOURCES += main.cpp\
folderviewstyleditemdelegate.cpp \
foldermodel.cpp \
doublefolderpanel.cpp \
selectstoragefavoritedialog.cpp \
sortdialog.cpp \
filterdialog.cpp \
workingdialog.cpp \
@@ -57,6 +58,7 @@ HEADERS += mainwindow.h \
foldermodel.h \
folderview.h \
doublefolderpanel.h \
selectstoragefavoritedialog.h \
types.h \
sortdialog.h \
filterdialog.h \
@@ -84,6 +86,7 @@ HEADERS += mainwindow.h \
FORMS += mainwindow.ui \
folderform.ui \
doublefolderpanel.ui \
selectstoragefavoritedialog.ui \
sortdialog.ui \
filterdialog.ui \
workingdialog.ui \

0 comments on commit bbefac5

Please sign in to comment.
You can’t perform that action at this time.