Files
fmviewer3/project/fm_viewer/ui/rm_popup_select_disk.cpp
2026-02-21 17:11:31 +09:00

104 lines
3.7 KiB
C++

#include "rm_popup_select_disk.h"
//#if !(REMOVE_OLD_C)
#include <QVBoxLayout>
#include <QComboBox>
#include "rm_button.h"
#include "rm_popup_content_background.h"
#include "title_widget.h"
#include "../core/fm_strings.h"
// 設定ファイル作成
RMPopupSelectDisk::RMPopupSelectDisk(QWidget *parent) : RMPopup(parent,MKU8("\xe8\xa8\xad\xe5\xae\x9a\xe3\x83\x95\xe3\x82\xa1\xe3\x82\xa4\xe3\x83\xab\xe4\xbd\x9c\xe6\x88\x90"),"")
{
#if (LIVE_LANGUAGE_CHANGE)
#if (FORCE_FM_STRING)
_title->titleLabel->setText(FMS::txt("Create settings file"));
#else // FORCE_FM_STRING
bool bJP = RMLanguage::isJP();
if(bJP == false)
{
_title->titleLabel->setText("Create settings file");
}
#endif // FORCE_FM_STRING
#endif // LIVE_LANGUAGE_CHANGE
this->setFixedSize(362,266);
QVBoxLayout* layout = new QVBoxLayout(_contentWidget);
layout->setContentsMargins(10,13,10,12);
RMPopupContentBackground* bg = new RMPopupContentBackground(_contentWidget);
layout->addWidget(bg);
QVBoxLayout* contentLayout = new QVBoxLayout(bg);
contentLayout->setAlignment(Qt::AlignTop);
contentLayout->setSpacing(18);
contentLayout->setMargin(10);
// 設定ファイルを生成しますか?
QString msg1 = MKU8("\xe8\xa8\xad\xe5\xae\x9a\xe3\x83\x95\xe3\x82\xa1\xe3\x82\xa4\xe3\x83\xab\xe3\x82\x92\xe7\x94\x9f\xe6\x88\x90\xe3\x81\x97\xe3\x81\xbe\xe3\x81\x99\xe3\x81\x8b\x3f");
#if (LIVE_LANGUAGE_CHANGE)
#if (FORCE_FM_STRING)
msg1 = FMS::txt("Create a new settings file?");
#else // FORCE_FM_STRING
if(bJP == false) {
msg1 = "Create a new settings file?";
}
#endif // FORCE_FM_STRING
#endif //LIVE_LANGUAGE_CHANGE
RMLayout::addLabel(bg,
contentLayout,
msg1,
"text_header_label");
// ドライブを選択してください。
QString msg2 = MKU8("\xe3\x83\x89\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\x96\xe3\x82\x92\xe9\x81\xb8\xe6\x8a\x9e\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x8f\xe3\x81\xa0\xe3\x81\x95\xe3\x81\x84\xe3\x80\x82");
#if (LIVE_LANGUAGE_CHANGE)
#if (FORCE_FM_STRING)
msg2 = FMS::txt("Please select a disk.");
#else // FORCE_FM_STRING
if(bJP == false) {
msg2 = "Please select a disk.";
}
#endif // FORCE_FM_STRING
#endif // LIVE_LANGUAGE_CHANGE
RMLayout::addLabel(bg,
contentLayout,
msg2,
"text_header_label");
RMLayout::addSpacer(contentLayout,0,15);
QStringList disks = RMApp::getRemovableDisks();
selectedDisk = disks[0];
QComboBox* combo = new QComboBox(bg);
combo->setFixedWidth(300);
foreach (QString disk, disks) {
combo->addItem(disk);
}
connect(combo,SIGNAL(currentIndexChanged(QString)),SLOT(onDiskChanged(QString)));
contentLayout->addWidget(combo);
#if (LIVE_LANGUAGE2)
RMButton* okButton = RMButton::create2(_buttonWidget,_buttonLayout,"button","ok",QSize(120,30));
#else // LIVE_LANGUAGE2
RMButton* okButton = RMButton::create(_buttonWidget,_buttonLayout,"button",FMS::txt("ok"),QSize(120,30));
#endif // LIVE_LANGUAGE2
okButton->setText(FMS::txt("ok"));
connect(okButton,SIGNAL(clicked()),this,SLOT(accept()));
#if (LIVE_LANGUAGE2)
RMButton* cancelButton = RMButton::create2(_buttonWidget,_buttonLayout,"button","cancel",QSize(120,30));
#else
RMButton* cancelButton = RMButton::create(_buttonWidget,_buttonLayout,"button",FMS::txt("cancel"),QSize(120,30));
#endif // #if (LIVE_LANGUAGE2)
cancelButton->setText(FMS::txt("cancel"));
connect(cancelButton,SIGNAL(clicked()),this,SLOT(reject()));
}
void RMPopupSelectDisk::onDiskChanged(QString disk)
{
selectedDisk = disk;
}
//#endif // #if !(REMOVE_OLD_C)