795 lines
27 KiB
C++
795 lines
27 KiB
C++
#include "rm_frame_list.h"
|
|
|
|
#include <QComboBox>
|
|
|
|
#include "fm_layer.h"
|
|
#include "fm_button.h"
|
|
#include "../fm_dimensions.h"
|
|
|
|
#include "../core/rm_player.h"
|
|
#include "../data/rm_video_list.h"
|
|
#include "../data/rm_video_list_loader.h"
|
|
#include "rm_button.h"
|
|
#include "rm_widget_video_list.h"
|
|
#include "rm_dialog_progress.h"
|
|
#include "rm_dialog_overwrite.h"
|
|
#include "../data/rm_overwrite.h"
|
|
//#include "../cfg/window_settings_91fh.h"
|
|
#include <QMainWindow>
|
|
#include <Windows.h>
|
|
#include <ShlObj.h>
|
|
#include <QDir>
|
|
#include "../core/rm_key_event.h"
|
|
#include "../core/fm_strings.h"
|
|
#include "fm_colors.h"
|
|
#include "../fm_app_colors.h"
|
|
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
#include "fm_datepicker.h"
|
|
#include "fm_thumbnail_dialog.h"
|
|
#endif
|
|
|
|
#if (USE_VERSION_CHECK)
|
|
#include "../module/fm_version_checker.h"
|
|
#endif // USE_VERSION_CHECK
|
|
|
|
#if (DETECT_USB_CHANGE)
|
|
#include "window_main.h"
|
|
#include "../core/rm_usb.h"
|
|
#endif // DETECT_USB_CHANGE
|
|
//int normal;
|
|
//int pressed;
|
|
//int hover;
|
|
//int disabled;
|
|
//int checked;
|
|
FM_COLOR_SET g_type_button_colors[5] = {
|
|
0x595959, // normal
|
|
0x2e2e2e, // pressed
|
|
0x343434, // hover
|
|
0x595959, // disabled
|
|
0x3a3a3a, // checked
|
|
};
|
|
|
|
FM_COLOR_SET g_type_button_colors2[5] = {
|
|
0x595959, // normal
|
|
0x2e2e2e, // pressed
|
|
0x343434, // hover
|
|
0x595959, // disabled
|
|
FM_SILDER_COLOR, // checked
|
|
};
|
|
|
|
//const int FRAME_LIST_WIDTH = 352;
|
|
RMFrameList* RMFrameList::_instance = NULL;
|
|
RMFrameList* RMFrameList::instance(QWidget* parent)
|
|
{
|
|
if ( _instance == NULL )
|
|
{
|
|
_instance = new RMFrameList(parent);
|
|
}
|
|
return _instance;
|
|
}
|
|
// RMWidgetStyleBase
|
|
RMFrameList::RMFrameList(QWidget *parent) : RMWidgetBase(parent,false)
|
|
{
|
|
#if (RM_MODEL != RM_MODEL_TYPE_EMT_KR)
|
|
FMWidgetBorder(this,"border_frame",0x666666);
|
|
#endif
|
|
|
|
layout = new QVBoxLayout(this);
|
|
ZERO_LAYOUT(layout);
|
|
layout->setMargin(1);
|
|
layout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
|
|
|
#if !(RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
createTitle();
|
|
#endif //
|
|
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
createDatePicker();
|
|
#elif (RM_MODEL != RM_MODEL_TYPE_AN6000) // AN6000 은 타입없음
|
|
createTypeButtons();
|
|
#endif // RM_MODEL_TYPE_TB4000
|
|
|
|
|
|
listWidget = new RMWidgetVideoList(this);
|
|
listWidget->setFixedWidth(RIGHT_FRAME_WIDTH-2);
|
|
listWidget->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
|
|
layout->addWidget(listWidget);
|
|
|
|
|
|
RMVideoFileList* list = RMVideoFileList::instance();
|
|
// 리스트 업데이트 완료 후 TOGGLE BUTTON ENABLE
|
|
connect(list,SIGNAL(listUpdateEnd(bool,RMVideoItem*)),SLOT(onListUpdate(bool,RMVideoItem*)));
|
|
|
|
#if !(SINGLE_SAVE_FILE)
|
|
connect(listWidget,SIGNAL(itemChecked(bool)),SLOT(onItemChecked(bool)));
|
|
#endif
|
|
|
|
connect(list,SIGNAL(backupPaused(bool)),SLOT(onBackupPaused(bool)));
|
|
|
|
connect(list,SIGNAL(backupStarted()),SLOT(onBackupStarted()));
|
|
connect(list,SIGNAL(backupEnd()),SLOT(onBackupEnded()));
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
connect(listWidget,SIGNAL(allList()),this,SLOT(onAllList()));
|
|
#endif
|
|
|
|
#if(LIVE_LANGUAGE2)
|
|
refreshLanguage();
|
|
connect(RMLanguage::instance(),SIGNAL(languageChange(RMLanguage::LANGUAGE_TYPE)),SLOT(onLanguageChange(RMLanguage::LANGUAGE_TYPE)));
|
|
#endif // #if(LIVE_LANGUAGE_CHANGE)
|
|
|
|
}
|
|
void RMFrameList::createTitle()
|
|
{
|
|
QWidget* w = new QWidget(this);
|
|
#if (RM_MODEL_EMT_KR)
|
|
const int title_height = 33;
|
|
FMWidgetBottomBorderBackground(w,"list_title",FM_COLOR_BORDER,0x00);
|
|
#else RM_MODEL_EMT_KR
|
|
const int title_height = 26;
|
|
#endif // RM_MODEL_EMT_KR
|
|
layout->addWidget(w);
|
|
w->setFixedHeight(title_height);
|
|
QHBoxLayout* l = new QHBoxLayout(w);
|
|
ZERO_LAYOUT(l);
|
|
|
|
_titleLabel = new QLabel(w);
|
|
_titleLabel->setPixmap( QPixmap(":/image/title_list.png") );
|
|
//_titleLabel->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
|
//_titleLabel->setFixedHeight(41);
|
|
l->addWidget(_titleLabel);
|
|
|
|
#if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
// AVI 保存 = \x41\x56\x49 \xe4\xbf\x9d\xe5\xad\x98
|
|
#if (LIVE_LANGUAGE2)
|
|
backupButton = FMButton::btn2(w,l,"backup","backup",QSize(44,24));
|
|
#else // LIVE_LANGUAGE2
|
|
backupButton = FMButton::btn(w,l,"backup",FMS::txt("backup"),QSize(44,24));
|
|
#endif // LIVE_LANGUAGE2
|
|
#if !(SINGLE_SAVE_FILE)
|
|
backupButton->setEnabled(false);
|
|
#endif
|
|
connect(backupButton,SIGNAL(clicked()),this,SLOT(onBackup()));
|
|
l->setAlignment(backupButton,Qt::AlignRight);
|
|
#if !(REMOVE_ALL_SHORT_CUTS)
|
|
backupShortCut = new QShortcut(QKeySequence(Qt::Key_F4), RMApp::instance()->pMainWindow);
|
|
backupShortCut->setContext(Qt::ApplicationShortcut);
|
|
connect(backupShortCut,SIGNAL(activated()),SLOT(onBackup()));
|
|
backupShortCut->setEnabled(false);
|
|
#endif
|
|
#endif // #if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000 && USE_DATE_FILTER)
|
|
// DATE PICKER 사용하지 않고 이전 타이틀 ..
|
|
thumbNailButton = FMButton::btn(w,l,"thumbnail",FMS::txt("thumbnail"),QSize(44,24));
|
|
thumbNailButton->setEnabled(false);
|
|
connect(thumbNailButton,SIGNAL(clicked()),this,SLOT(onThumbnail()));
|
|
#endif
|
|
|
|
LAYOUT_SPACE(l,6,0);
|
|
}
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
void RMFrameList::createDatePicker()
|
|
{
|
|
#if (USE_DATE_FILTER)
|
|
datePicker = new FMDatePicker(this);
|
|
layout->addWidget(datePicker);
|
|
#else
|
|
|
|
QWidget* top = new QWidget(this);
|
|
QVBoxLayout* topL = new QVBoxLayout(top);
|
|
topL->setMargin(1);
|
|
topL->setSpacing(1);
|
|
layout->addWidget(top);
|
|
|
|
// 1.썸네일 보기
|
|
QWidget* thumbnailW = new QWidget(top);
|
|
topL->addWidget(thumbnailW);
|
|
QHBoxLayout* thumbnailL = new QHBoxLayout(thumbnailW);
|
|
thumbnailL->setSpacing(1);
|
|
thumbnailL->setContentsMargins(0,0,0,0);
|
|
//ZERO_LAYOUT(thumbnailL);
|
|
|
|
QLabel* thumbnailTitle = new QLabel(thumbnailW);
|
|
thumbnailTitle->setPixmap(QPixmap(":/image/title_show_thumbnail.png"));
|
|
thumbnailL->addWidget(thumbnailTitle);
|
|
|
|
const int bw = RIGHT_FRAME_WIDTH / 3;
|
|
|
|
thumbNailButton1 = FMButton::btnType0(thumbnailW,thumbnailL,"title_thumbnail_1hour",FM_WSTR(L"1시간 섬네일 보기"),QSize(bw,24),g_type_button_colors);
|
|
connect(thumbNailButton1,SIGNAL(clicked()),this,SLOT(onThumbnail()));
|
|
thumbNailButton1->setEnabled(false);
|
|
|
|
thumbNailButton2 = FMButton::btnType0(thumbnailW,thumbnailL,"title_thumbnail_detail",FM_WSTR(L"세부 섬네일 보기"),QSize(bw,24),g_type_button_colors);
|
|
connect(thumbNailButton2,SIGNAL(clicked()),this,SLOT(onThumbnail()));
|
|
thumbNailButton2->setEnabled(false);
|
|
|
|
// 2. 정렬
|
|
QWidget* sortW = new QWidget(top);
|
|
topL->addWidget(sortW);
|
|
QHBoxLayout* sortL = new QHBoxLayout(sortW);
|
|
sortL->setSpacing(5);
|
|
sortL->setContentsMargins(0,0,0,0);
|
|
|
|
QLabel* sortTitle = new QLabel(sortW);
|
|
sortTitle->setPixmap(QPixmap(":/image/title_sort.png"));
|
|
sortL->addWidget(sortTitle);
|
|
|
|
sortButton1 = FMButton::btnCheck(sortW,sortL,"sort_dsc",FM_WSTR(L"최신순으로 정렬"),QSize(bw,24));
|
|
connect(sortButton1,SIGNAL(clicked()),this,SLOT(onTypeOrSort()));
|
|
sortButton1->setCheckable(true);
|
|
sortButton1->setChecked(true);
|
|
|
|
sortButton2 = FMButton::btnCheck(sortW,sortL,"sort_asc",FM_WSTR(L"시간순으로 정렬"),QSize(bw,24));
|
|
sortButton2->setCheckable(true);
|
|
connect(sortButton2,SIGNAL(clicked()),this,SLOT(onTypeOrSort()));
|
|
|
|
//connect(thumbNailButton,SIGNAL(clicked()),this,SLOT(onThumbnail()));
|
|
|
|
QWidget* topType = new QWidget(top);
|
|
topL->addWidget(topType);
|
|
QHBoxLayout* topTypeL = new QHBoxLayout(topType);
|
|
ZERO_LAYOUT(topTypeL);
|
|
topTypeL->setSpacing(1);
|
|
|
|
listSimpleButton = FMButton::btnEmpty(topType,topTypeL,"",QSize(-1,24),g_type_button_colors2);
|
|
//listSimpleButton = FMButton::btnType0(topType,topTypeL,"list_1hour_title","",QSize(-1,24),g_type_button_colors2);
|
|
listSimpleButton->setCheckable(true);
|
|
listSimpleButton->setChecked(true);
|
|
connect(listSimpleButton,SIGNAL(clicked()),this,SLOT(onTypeOrSort()));
|
|
|
|
const int rmargin = 4;
|
|
QHBoxLayout* sl = new QHBoxLayout(listSimpleButton);
|
|
ZERO_LAYOUT(sl);
|
|
|
|
//sl->setContentsMargins(0,0,rmargin,0);
|
|
sl->setAlignment(Qt::AlignCenter);
|
|
|
|
QLabel* sT = new QLabel(listSimpleButton);
|
|
sT->setPixmap(QPixmap(":/image/list_1hour_title.png"));
|
|
sl->addWidget(sT);
|
|
|
|
countSimple = new QLabel(listSimpleButton);
|
|
sl->addWidget(countSimple);
|
|
countSimple->setStyleSheet("font-family: Fixedsys;font-size: 13px;color : #FFFFFF;");
|
|
|
|
//countSimple->setText("000");
|
|
|
|
listAllButton = FMButton::btnEmpty(topType,topTypeL,"",QSize(-1,24),g_type_button_colors2); // "list_all_title",
|
|
listAllButton->setCheckable(true);
|
|
listAllButton->setChecked(false);
|
|
|
|
QHBoxLayout* al = new QHBoxLayout(listAllButton);
|
|
ZERO_LAYOUT(al);
|
|
//al->setContentsMargins(0,0,rmargin,0);
|
|
//al->setAlignment(Qt::AlignRight);
|
|
al->setAlignment(Qt::AlignCenter);
|
|
QLabel* sA = new QLabel(listAllButton);
|
|
sA->setPixmap(QPixmap(":/image/list_all_title.png"));
|
|
al->addWidget(sA);
|
|
|
|
|
|
countAll = new QLabel(listAllButton);
|
|
al->addWidget(countAll);
|
|
countAll->setStyleSheet("font-family: Fixedsys;font-size: 13px;color : #FFFFFF;");
|
|
|
|
connect(listAllButton,SIGNAL(clicked()),this,SLOT(onTypeOrSort()));
|
|
|
|
// 썸네일 표시
|
|
#endif // USE_DATE_FILTER
|
|
}
|
|
#elif (RM_MODEL_EMT_KR)
|
|
void RMFrameList::createTypeButtons()
|
|
{
|
|
QWidget* w = new QWidget(this);
|
|
w->setFixedHeight(28);
|
|
FMWidgetBackground(w,"list_type",FM_COLOR_BORDER);
|
|
layout->addWidget(w);
|
|
|
|
QHBoxLayout* l = new QHBoxLayout(w);
|
|
l->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
|
|
ZERO_LAYOUT(l);
|
|
typeCombo = new QComboBox(w);
|
|
typeCombo->setEditable(false);
|
|
|
|
QStringList lst = QStringList() << FM_WSTR(L"주행") << FM_WSTR(L"주행 이벤트") << FM_WSTR(L"주차") << FM_WSTR(L"주차 충격") << FM_WSTR(L"수동 녹화") << FM_WSTR(L"보관함");
|
|
typeCombo->addItems(lst);
|
|
QString style = "QComboBox {\
|
|
font-family: Arial;\
|
|
color: #7BACFF;\
|
|
background-color: transparent;\
|
|
font-size: 13px;\
|
|
selection-background-color:transparent;\
|
|
selection-color:#4085FF;\
|
|
}";
|
|
|
|
typeCombo->setStyleSheet(style);
|
|
connect(typeCombo,SIGNAL(currentIndexChanged(int)),SLOT(onToggleGroup(int)));
|
|
|
|
//RMVideoFileList::FILTER_ALL;
|
|
// 주행 / 주행 이벤트 / 주차 / 주차 충격 / 수동 녹화( / 보관함???)
|
|
typeCombo->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
|
|
typeCombo->setFixedWidth(100);
|
|
l->addWidget(typeCombo);
|
|
}
|
|
#elif (RM_MODEL != RM_MODEL_TYPE_AN6000)
|
|
void RMFrameList::createTypeButtons()
|
|
{
|
|
QWidget* w = new QWidget(this);
|
|
|
|
w->setFixedHeight(28);
|
|
layout->addWidget(w);
|
|
#if !(RECORD_TYPE_COMBO_UI)
|
|
QHBoxLayout* l = new QHBoxLayout(w);
|
|
ZERO_LAYOUT(l);
|
|
#if (SUB_MODEL_KEIYO_360)
|
|
const int count = 3;
|
|
#else // SUB_MODEL_KEIYO_360
|
|
#if (RM_MODEL == RM_MODEL_TYPE_KEIYO1 || RM_MODEL == RM_MODEL_TYPE_MBJ5010 || RM_MODEL == RM_MODEL_TYPE_FC_DR232W || RM_MODEL == RM_MODEL_TYPE_BV2000 || RM_MODEL == RM_MODEL_TYPE_MH9000)
|
|
const int count = 5;
|
|
#elif (RM_MODEL == RM_MODEL_TYPE_XLDR_88 )
|
|
const int count = 4;
|
|
#elif (RM_MODEL == RM_MODEL_TYPE_EMT_KR)
|
|
const int count = 5;
|
|
#else
|
|
const int count = 3;
|
|
#endif
|
|
#endif // SUB_MODEL_KEIYO_360
|
|
|
|
QSize sz = QSize((RIGHT_FRAME_WIDTH-2)/count,28);
|
|
|
|
//qInfo() << "BUTTON SIZE:" << sz;
|
|
|
|
#if (RM_MODEL == RM_MODEL_TYPE_XLDR_88 || RM_MODEL == RM_MODEL_TYPE_TBD360)
|
|
|
|
#if (RM_MODEL == RM_MODEL_TYPE_XLDR_88)
|
|
allButton = FMButton::btnColor(w,l,"type_all2",QString(),sz,g_type_button_colors);
|
|
allButton->valueTag = RMVideoFileList::FILTER_ALL;
|
|
buttons.append(allButton);
|
|
#endif // RM_MODEL_TYPE_XLDR_88
|
|
|
|
normalButton = FMButton::btnColor(w,l,"type_all",QString(),sz,g_type_button_colors);
|
|
normalButton->valueTag = RMVideoFileList::FILTER_NORMAL;
|
|
buttons.append(normalButton);
|
|
|
|
eventButton = FMButton::btnColor(w,l,"type_normal",QString(),sz,g_type_button_colors);
|
|
eventButton->valueTag = RMVideoFileList::FILTER_EVENT;
|
|
buttons.append(eventButton);
|
|
|
|
parkButton = FMButton::btnColor(w,l,"type_event",QString(),sz,g_type_button_colors);
|
|
parkButton->valueTag = RMVideoFileList::FILTER_PARK;
|
|
buttons.append(parkButton);
|
|
#else
|
|
#if (LIVE_LANGUAGE2)
|
|
allButton = FMButton::btnColor2(w,l,"type_all",NULL,sz,g_type_button_colors);
|
|
normalButton = FMButton::btnColor2(w,l,"type_normal",NULL,sz,g_type_button_colors);
|
|
eventButton = FMButton::btnColor2(w,l,"type_event",NULL,sz,g_type_button_colors);
|
|
#else // LIVE_LANGUAGE2
|
|
allButton = FMButton::btnColor(w,l,"type_all",QString(),sz,g_type_button_colors);
|
|
normalButton = FMButton::btnColor(w,l,"type_normal",QString(),sz,g_type_button_colors);
|
|
eventButton = FMButton::btnColor(w,l,"type_event",QString(),sz,g_type_button_colors);
|
|
#endif // LIVE_LANGUAGE2
|
|
allButton->valueTag = RMVideoFileList::FILTER_ALL;
|
|
buttons.append(allButton);
|
|
|
|
normalButton->valueTag = RMVideoFileList::FILTER_NORMAL;
|
|
buttons.append(normalButton);
|
|
|
|
eventButton->valueTag = RMVideoFileList::FILTER_EVENT;
|
|
buttons.append(eventButton);
|
|
#endif
|
|
|
|
#if !(SUB_MODEL_KEIYO_360)
|
|
#if (RM_MODEL == RM_MODEL_TYPE_KEIYO1 || RM_MODEL == RM_MODEL_TYPE_MBJ5010 || RM_MODEL == RM_MODEL_TYPE_FC_DR232W || RM_MODEL == RM_MODEL_TYPE_BV2000 || RM_MODEL == RM_MODEL_TYPE_MH9000)
|
|
#if (LIVE_LANGUAGE2)
|
|
//#if(RM_MODEL != RM_MODEL_TYPE_MH9000)
|
|
manualButton = FMButton::btnColor2(w,l,"type_manual",NULL,sz,g_type_button_colors);
|
|
//#endif // RM_MODEL == RM_MODEL_TYPE_MH9000
|
|
parkButton = FMButton::btnColor2(w,l,"type_park",NULL,sz,g_type_button_colors);
|
|
#else
|
|
manualButton = FMButton::btnColor(w,l,"type_manual",QString(),sz,g_type_button_colors);
|
|
parkButton = FMButton::btnColor(w,l,"type_park",QString(),sz,g_type_button_colors);
|
|
#endif
|
|
//#if(RM_MODEL != RM_MODEL_TYPE_MH9000)
|
|
manualButton->valueTag = RMVideoFileList::FILTER_MANUAL;
|
|
buttons.append(manualButton);
|
|
//#endif // #if(RM_MODEL != RM_MODEL_TYPE_MH9000)
|
|
|
|
parkButton->valueTag = RMVideoFileList::FILTER_PARK;
|
|
buttons.append(parkButton);
|
|
#elif (RM_MODEL == RM_MODEL_TYPE_EMT_KR)
|
|
manualButton = FMButton::btnColor2(w,l,"type_manual",NULL,sz,g_type_button_colors);
|
|
parkButton = FMButton::btnColor2(w,l,"type_park",NULL,sz,g_type_button_colors);
|
|
#endif
|
|
#endif // #if !(SUB_MODEL_KEIYO_360)
|
|
|
|
foreach (FMButton* btn, buttons) {
|
|
btn->setCheckable(true);
|
|
btn->setEnabled(false);
|
|
connect(btn,SIGNAL(clicked()),this,SLOT(onToggleGroup()));
|
|
}
|
|
#endif // #if !(RECORD_TYPE_COMBO_UI)
|
|
}
|
|
#endif // #if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
|
|
#if !(SINGLE_SAVE_FILE)
|
|
void RMFrameList::onItemChecked(bool bSelected)
|
|
{
|
|
if(backupButton != NULL)
|
|
{
|
|
#if !(LIVE_LANGUAGE_CHANGE)
|
|
// 2019/09/16:#150 에서 다시 표시 요청
|
|
backupButton->setToolTip(bSelected ? MKU8("\x41\x56\x49 \xe4\xbf\x9d\xe5\xad\x98") : QString());
|
|
#endif
|
|
|
|
backupButton->setEnabled(bSelected);
|
|
#if !(REMOVE_ALL_SHORT_CUTS)
|
|
backupShortCut->setEnabled(bSelected);
|
|
#endif
|
|
}
|
|
}
|
|
#endif // SINGLE_SAVE_FILE
|
|
#if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
#if (RECORD_TYPE_COMBO_UI)
|
|
void RMFrameList::onToggleGroup(int selected)
|
|
{
|
|
RMVideoFileList::FILTER filters[] = {RMVideoFileList::FILTER_NORMAL,RMVideoFileList::FILTER_EVENT,RMVideoFileList::FILTER_PARK,RMVideoFileList::FILTER_PARK_EVENT,RMVideoFileList::FILTER_MANUAL,RMVideoFileList::FILTER_MYBOX};
|
|
RMVideoFileList* list = RMVideoFileList::instance();
|
|
list->setFilterSingle(filters[selected]);
|
|
}
|
|
#else // !RECORD_TYPE_COMBO_UI
|
|
void RMFrameList::onToggleGroup()
|
|
{
|
|
FMButton* btn = qobject_cast<FMButton*>(QObject::sender());
|
|
RMVideoFileList* list = RMVideoFileList::instance();
|
|
list->setFilterSingle((RMVideoFileList::FILTER)btn->valueTag);
|
|
foreach (FMButton* each, buttons) {
|
|
each->setChecked(each == btn);
|
|
}
|
|
}
|
|
#endif // #if !(RECORD_TYPE_COMBO_UI)
|
|
#endif // #if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
void RMFrameList::onOpen()
|
|
{
|
|
// Pressed focus 문제 발생하니 무시
|
|
if(RMKeyEvent::instance()->exist())
|
|
{
|
|
return;
|
|
}
|
|
|
|
QString title = FMS::txt("open_message");
|
|
//QString title = MKU8("\xe9\x8c\xb2\xe7\x94\xbb\xe3\x83\x95\xe3\x82\xa1\xe3\x82\xa4\xe3\x83\xab\xe3\x81\x8c\xe3\x81\x82\xe3\x82\x8b\xe3\x83\x95\xe3\x82\xa9\xe3\x83\xab\xe3\x83\x80\xe9\x81\xb8\xe6\x8a\x9e");
|
|
#if(!REMOVE_OLD_C)
|
|
#if (LIVE_LANGUAGE_CHANGE)
|
|
if(RMLanguage::isJP() == false) { title = "Open Folder";}
|
|
#endif
|
|
#endif // #if(REMOVE_OLD_C)
|
|
// 録画ファイルがあるフォルダ選択
|
|
QString dir = RMApp::openFolder(RMSettings::instance()->lastMoviePath(),
|
|
false,
|
|
title);
|
|
|
|
if(dir.isEmpty() == false)
|
|
{
|
|
openFolder(dir);
|
|
} else {
|
|
#if (USE_VERSION_CHECK)
|
|
// 열기 취소시에도 처리
|
|
FMVersionChecker::instance()->start();
|
|
#endif // USE_VERSION_CHECK
|
|
}
|
|
}
|
|
void RMFrameList::onBackup()
|
|
{
|
|
#if (SINGLE_SAVE_FILE && !SINGLE_SAVE_CHECK_FILE)
|
|
if(RMVideoFileList::instance()->getPlayItem() == NULL)
|
|
{
|
|
return;
|
|
}
|
|
#endif
|
|
// Pressed focus 문제 발생하니 무시
|
|
if(RMKeyEvent::instance()->exist())
|
|
{
|
|
return;
|
|
}
|
|
|
|
RMPlayer::instance()->prepareForCapture();
|
|
// 保存
|
|
#if (FORCE_FM_STRING)
|
|
QString title = FMS::txt("backup_title");
|
|
#else
|
|
QString title = MKU8("\xe4\xbf\x9d\xe5\xad\x98");
|
|
#if (LIVE_LANGUAGE_CHANGE)
|
|
if(RMLanguage::isJP() == false) { title = "Backup AVI files";}
|
|
#endif
|
|
#endif
|
|
QString dir = RMApp::openFolder(RMApp::appPath(RMApp::CAPTURE),true,title);
|
|
if(dir.isEmpty() == false)
|
|
{
|
|
RMVideoFileListBackup* backup = new RMVideoFileListBackup(dir);
|
|
QThreadPool::globalInstance()->start(backup,5);
|
|
}
|
|
}
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
bool RMFrameList::isRootFolder(QString folderPath)
|
|
{
|
|
QString vpath = folderPath + QDir::separator() + "Video";
|
|
QString ppath = folderPath + QDir::separator() + "Photo";
|
|
return QDir(vpath).exists() && QDir(ppath).exists();
|
|
}
|
|
#endif // #if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
void RMFrameList::openFolder(QString folderPath)
|
|
{
|
|
#if (USER_LOGER)
|
|
if(RMApp::userLog) {
|
|
RMApp::instance()->appendLog("INFO","OPEN FOLDER:" + QDir::cleanPath(folderPath));
|
|
}
|
|
#endif //
|
|
// 년/월/일만 로딩함
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000 && USE_DATE_FILTER)
|
|
if(isRootFolder(folderPath)) {
|
|
thumbNailButton->setEnabled(true);
|
|
RMApp::currentRoot = folderPath;
|
|
RMSettings::instance()->setLastMoviePath(folderPath);
|
|
//emit RMApp::instance()->appEvent(RMApp::ROOT_FOLDER_OPEN,0);
|
|
//qInfo() << "EMIT RMApp::ROOT_FOLDER_OPEN" << __FUNCTION__;
|
|
} else {
|
|
thumbNailButton->setEnabled(false);
|
|
//emit RMApp::instance()->appEvent(RMApp::NO_ROOT_FOLDER_OPEN,0);
|
|
#endif // RM_MODEL_TYPE_TB4000
|
|
|
|
QList<QUrl> list;
|
|
// 기타 폴더 가능, 전후방 동일 폴더 가능
|
|
RMVideoFileList::appendFolderToList(folderPath,list);
|
|
if(list.isEmpty() == false) {
|
|
RMApp::currentRoot = folderPath; // USB 와 비교하기 위해 지정
|
|
RMSettings::instance()->setLastMoviePath(folderPath);
|
|
|
|
RMVideoFileListLoader* loader = NULL;
|
|
#if (PLAY_FIRST_LOADED)
|
|
loader = new RMVideoFileListLoader(list,true);
|
|
#else
|
|
loader = new RMVideoFileListLoader(list);
|
|
#endif
|
|
QThreadPool::globalInstance()->start(loader,5);
|
|
}
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000 && USE_DATE_FILTER)
|
|
} // else
|
|
#endif
|
|
|
|
}
|
|
#if (USE_VERSION_CHECK)
|
|
void RMFrameList::onStartVersionCheck() {
|
|
FMVersionChecker::instance()->start();
|
|
}
|
|
#endif // #if (USE_VERSION_CHECK)
|
|
|
|
void RMFrameList::onListUpdate(bool bLoading,RMVideoItem* item)
|
|
{
|
|
Q_UNUSED(item)
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
Q_UNUSED(item)
|
|
if(bLoading) {
|
|
countSimple->setText("[" + QString::number(RMVideoFileList::instance()->count1Hour) + "]");
|
|
int ac = RMVideoFileList::instance()->allItems().count();
|
|
countAll->setText("[" +QString::number(ac) + "]");
|
|
#if (USE_VERSION_CHECK)
|
|
QTimer::singleShot(200, Qt::PreciseTimer,this, SLOT(onStartVersionCheck()));
|
|
#endif // USE_VERSION_CHECK
|
|
|
|
bool exist = !RMVideoFileList::instance()->allItems().isEmpty();
|
|
thumbNailButton1->setEnabled(exist);
|
|
thumbNailButton2->setEnabled(exist);
|
|
}
|
|
|
|
#else // TELEBIT
|
|
if(bLoading) {
|
|
|
|
#if !(RECORD_TYPE_COMBO_UI)
|
|
bool bEnabled = RMVideoFileList::instance()->allItems().count() > 0;
|
|
foreach (FMButton* btn, buttons) {
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TBD360)
|
|
btn->setChecked(btn == normalButton);
|
|
#else
|
|
btn->setChecked(btn == allButton); // RM_MODEL == RM_MODEL_TYPE_XLDR_88
|
|
#endif
|
|
btn->setEnabled(bEnabled);
|
|
}
|
|
#else // RECORD_TYPE_COMBO_UI
|
|
typeCombo->setCurrentIndex(RMVideoFileList::instance()->currentFilterIndex());
|
|
#endif // #if !(RECORD_TYPE_COMBO_UI)
|
|
}
|
|
#endif // #if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
}
|
|
void RMFrameList::onBackupStarted()
|
|
{
|
|
// バックアップ中
|
|
#if (FORCE_FM_STRING)
|
|
RMDialogProgress::start(FMS::txt("backup_title"),true);
|
|
#else
|
|
#if (LIVE_LANGUAGE_CHANGE)
|
|
QString msg = RMLanguage::isJP() ? MKU8("\xe3\x83\x90\xe3\x83\x83\xe3\x82\xaf\xe3\x82\xa2\xe3\x83\x83\xe3\x83\x97\xe4\xb8\xad") : "Backup files...";
|
|
RMDialogProgress::start(msg,true);
|
|
#else
|
|
RMDialogProgress::start(MKU8("\xe3\x83\x90\xe3\x83\x83\xe3\x82\xaf\xe3\x82\xa2\xe3\x83\x83\xe3\x83\x97\xe4\xb8\xad"),true);
|
|
#endif
|
|
#endif
|
|
}
|
|
void RMFrameList::onBackupEnded()
|
|
{
|
|
// 체크 해제 -> 리스트에는 반영됨
|
|
#if !(USE_1HOUR_FILTER)
|
|
RMVideoFileList::instance()->clearChecked();
|
|
#endif// #if !(USE_1HOUR_FILTER)
|
|
|
|
#if!(REMOVE_ALL_FILE_CHECK || SINGLE_SAVE_FILE)
|
|
// ALL 도 UNCHECK 해야함
|
|
listWidget->uncheckAll();
|
|
#endif // REMOVE_ALL_FILE_CHECK
|
|
|
|
#if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
backupButton->setEnabled(false);
|
|
#endif // RM_MODEL_TYPE_TB4000
|
|
QApplication::restoreOverrideCursor();
|
|
RMDialogProgress::stop();
|
|
}
|
|
void RMFrameList::onBackupPaused(bool bPaused)
|
|
{
|
|
if(bPaused) {
|
|
RMDialogProgress::pause();
|
|
RMDialogOverwrite* dialog = new RMDialogOverwrite(RMApp::instance()->pMainWindow);
|
|
|
|
if( dialog->exec() == 0) {
|
|
RMOverwrite::gCurrent = OVERWRITE_OPTION_CANCEL;
|
|
}
|
|
|
|
delete dialog;
|
|
RMOverwrite::unwait();
|
|
}
|
|
else {
|
|
RMDialogProgress::resume();
|
|
}
|
|
}
|
|
#if (LIVE_LANGUAGE_CHANGE && MODEL_STANDARD)
|
|
void RMFrameList::refreshLanguage()
|
|
{
|
|
QString tag = RMLanguage::languageTag();
|
|
_titleLabel->setPixmap( QPixmap(":/image/title_list" + tag + ".png") );
|
|
#if !(RECORD_TYPE_COMBO_UI)
|
|
#if (LIVE_LANGUAGE2)
|
|
allButton->setIcon("type_all" + tag);
|
|
normalButton->setIcon("type_normal" + tag);
|
|
eventButton->setIcon("type_event" + tag);
|
|
//#if (RM_MODEL != RM_MODEL_TYPE_MH9000)
|
|
manualButton->setIcon("type_manual" + tag);
|
|
//#endif // #if (RM_MODEL != RM_MODEL_TYPE_MH9000)
|
|
parkButton->setIcon("type_park" + tag);
|
|
#else
|
|
#if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
|
normalButton->updateObject("group_normal" + tag);
|
|
eventButton->updateObject("group_event" + tag);
|
|
//openButton->updateObject("open" + tag);
|
|
backupButton->updateObject("backup" + tag);
|
|
#endif // RM_MODEL_TYPE_TB4000
|
|
#endif // LIVE_LANGUAGE2
|
|
#endif // #if !(RECORD_TYPE_COMBO_UI)
|
|
listWidget->onLanguageChange(RMLanguage::instance()->language());
|
|
}
|
|
void RMFrameList::onLanguageChange(RMLanguage::LANGUAGE_TYPE language)
|
|
{
|
|
Q_UNUSED(language);
|
|
refreshLanguage();
|
|
}
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
void RMFrameList::onAllList()
|
|
{
|
|
listSimpleButton->setChecked(false);
|
|
listAllButton->setChecked(true);
|
|
}
|
|
void RMFrameList::onTypeChanged()
|
|
{
|
|
// 현재 상태 확인
|
|
bool b1Hour = RMVideoFileList::instance()->get1HourList();
|
|
listSimpleButton->setChecked(b1Hour);
|
|
listAllButton->setChecked(!b1Hour);
|
|
}
|
|
void RMFrameList::onTypeOrSort()
|
|
{
|
|
//qInfo() << __FUNCTION__;
|
|
RMVideoItem* selected = listWidget->getSelectedItem();
|
|
|
|
// 현재 상태 확인
|
|
bool b1Hour = RMVideoFileList::instance()->get1HourList();
|
|
bool bDsc = RMVideoFileList::instance()->getSortList();
|
|
|
|
FMButton* btn = qobject_cast<FMButton*>(sender());
|
|
if(btn == listSimpleButton || btn == listAllButton) {
|
|
b1Hour = (btn == listSimpleButton);
|
|
|
|
listWidget->getSelectedItem();
|
|
|
|
listSimpleButton->setChecked(b1Hour);
|
|
listAllButton->setChecked(!b1Hour);
|
|
|
|
// 선택된 1시간 파일내에 포함된 파일 색상 처리는 listWidget 의 setSelected 에서 처리
|
|
//listWidget->setSimpleDate(b1Hour ? QDateTime() : RMVideoFileList::instance()->simpleFromDateTime2(selected->startTime()));
|
|
|
|
} else if (btn == sortButton1) {
|
|
bDsc = true; //!sortButton->isChecked();
|
|
sortButton1->setChecked(true);
|
|
sortButton2->setChecked(false);
|
|
} else if (btn == sortButton2) {
|
|
bDsc = false; //!sortButton->isChecked();
|
|
sortButton1->setChecked(false);
|
|
sortButton2->setChecked(true);
|
|
}
|
|
RMVideoFileList::instance()->setSortList(bDsc);
|
|
RMVideoFileList::instance()->set1HourList(b1Hour,true,selected);
|
|
}
|
|
|
|
void RMFrameList::onThumbnail()
|
|
{
|
|
#if (USE_DATE_FILTER)
|
|
QString folder = datePicker->_videoDayFolder(true);
|
|
FMThumbnailDialog* d = new FMThumbnailDialog(this, folder);
|
|
QString title = datePicker->_yearListCombo->currentText() + FM_WSTR(L"년 ") + datePicker->_monthListCombo->currentText() + FM_WSTR(L"월 ") + datePicker->_dayListCombo->currentText() + FM_WSTR(L"일");
|
|
d->setWindowTitle(title);
|
|
if(d->exec() == 1 && !d->selectedFile.isEmpty()) { // ACCEPT
|
|
|
|
QString prefix = QFileInfo(d->selectedFile).baseName().left(20);
|
|
|
|
RMVideoItem* item = RMVideoFileList::instance()->searchPlayItem(prefix);
|
|
qInfo() << "RET:" << d->selectedFile << item << __FUNCTION__;
|
|
if(item != NULL) {
|
|
listWidget->selectItem(item);
|
|
listWidget->playItem(item);
|
|
|
|
}
|
|
// 20231007-040556_PSR0_0017
|
|
// 20231007-040556_PSR0_0017_0.jpg
|
|
}
|
|
delete d;
|
|
#else // USE_DATE_FILTER
|
|
|
|
// 재생 종료
|
|
RMPlayer::instance()->onUserStop();
|
|
|
|
bool bDetail = false;
|
|
if(sender() != NULL && sender() == thumbNailButton2) {
|
|
bDetail = true;
|
|
}
|
|
qInfo() << bDetail << __FUNCTION__;
|
|
|
|
|
|
FMThumbnailDialog* d = new FMThumbnailDialog(RMApp::instance()->pMainWindow,bDetail);
|
|
|
|
QString title = "";//datePicker->_yearListCombo->currentText() + FM_WSTR(L"년 ") + datePicker->_monthListCombo->currentText() + FM_WSTR(L"월 ") + datePicker->_dayListCombo->currentText() + FM_WSTR(L"일");
|
|
d->setWindowTitle(title);
|
|
if(d->exec() == 1 && !d->selectedFile.isEmpty()) { // ACCEPT
|
|
|
|
QString prefix = QFileInfo(d->selectedFile).baseName().left(20);
|
|
|
|
// 상세 항목으로 변경
|
|
if(RMVideoFileList::instance()->get1HourList()) {
|
|
|
|
listSimpleButton->setChecked(false);
|
|
listAllButton->setChecked(true);
|
|
|
|
RMVideoFileList::instance()->setSortList(RMVideoFileList::instance()->getSortList());
|
|
RMVideoFileList::instance()->set1HourList(false,true,NULL);
|
|
}
|
|
|
|
RMVideoItem* item = RMVideoFileList::instance()->searchPlayItem(prefix);
|
|
if(item != NULL) {
|
|
listWidget->selectItem(item);
|
|
listWidget->playItem(item);
|
|
}
|
|
// 20231007-040556_PSR0_0017
|
|
// 20231007-040556_PSR0_0017_0.jpg
|
|
}
|
|
delete d;
|
|
#endif // #if (USE_DATE_FILTER)
|
|
}
|
|
#endif // RM_MODEL_TYPE_TB4000
|
|
#endif
|