Add configuration for printer filename.
This commit is contained in:
parent
75b64a019d
commit
d3e25773dc
7 changed files with 64 additions and 7 deletions
|
@ -13,7 +13,9 @@
|
|||
#include "Video.h"
|
||||
#include "Speaker.h"
|
||||
#include "Mockingboard.h"
|
||||
#include "ParallelPrinter.h"
|
||||
#include "Configuration/IPropertySheet.h"
|
||||
#include "qtframe.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QGamepad>
|
||||
|
@ -229,9 +231,16 @@ void getAppleWinPreferences(PreferenceData & data)
|
|||
data.verticalBlend = video.IsVideoStyle(VS_COLOR_VERTICAL_BLEND);
|
||||
data.hz50 = video.GetVideoRefreshRate() == VR_50HZ;
|
||||
data.monochromeColor.setRgb(video.GetMonochromeRGB());
|
||||
|
||||
const std::string & printerFilename = Printer_GetFilename();
|
||||
if (!printerFilename.empty())
|
||||
{
|
||||
data.printerFilename = QString::fromStdString(printerFilename);
|
||||
}
|
||||
|
||||
void setAppleWinPreferences(const PreferenceData & currentData, const PreferenceData & newData)
|
||||
}
|
||||
|
||||
void setAppleWinPreferences(const std::shared_ptr<QtFrame> & frame, const PreferenceData & currentData, const PreferenceData & newData)
|
||||
{
|
||||
CardManager & cardManager = GetCardMgr();
|
||||
Disk2InterfaceCard* pDisk2Card = dynamic_cast<Disk2InterfaceCard*>(cardManager.GetObj(SLOT6));
|
||||
|
@ -299,6 +308,13 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference
|
|||
RegSaveString(TEXT(REG_CONFIG), REGVALUE_SAVESTATE_FILENAME, 1, name);
|
||||
}
|
||||
|
||||
if (currentData.printerFilename != newData.printerFilename)
|
||||
{
|
||||
const std::string name = newData.printerFilename.toStdString();
|
||||
Printer_SetFilename(name);
|
||||
RegSaveString(TEXT(REG_CONFIG), REGVALUE_PRINTER_FILENAME, 1, name);
|
||||
}
|
||||
|
||||
if (currentData.videoType != newData.videoType || currentData.scanLines != newData.scanLines || currentData.verticalBlend != newData.verticalBlend
|
||||
|| currentData.hz50 != newData.hz50 || currentData.monochromeColor != newData.monochromeColor)
|
||||
{
|
||||
|
@ -321,8 +337,7 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference
|
|||
// be careful QRgb is opposite way round to COLORREF
|
||||
video.SetMonochromeRGB(RGB(color.red(), color.green(), color.blue()));
|
||||
|
||||
video.VideoReinitialize(false);
|
||||
video.Config_Save_Video();
|
||||
frame->ApplyVideoModeChange();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,9 +51,11 @@ struct PreferenceData
|
|||
QColor monochromeColor;
|
||||
|
||||
QString saveState;
|
||||
QString printerFilename;
|
||||
};
|
||||
|
||||
class QtFrame;
|
||||
void getAppleWinPreferences(PreferenceData & data);
|
||||
void setAppleWinPreferences(const PreferenceData & currentData, const PreferenceData & newData);
|
||||
void setAppleWinPreferences(const std::shared_ptr<QtFrame> & frame, const PreferenceData & currentData, const PreferenceData & newData);
|
||||
|
||||
#endif // CONFIGURATION_H
|
||||
|
|
|
@ -231,6 +231,7 @@ void Preferences::setData(const PreferenceData & data)
|
|||
on_hd_7_clicked(data.hdInSlot7);
|
||||
|
||||
ui->save_state->setText(data.saveState);
|
||||
ui->printer_filename->setText(data.printerFilename);
|
||||
ui->video_type->setCurrentIndex(data.videoType);
|
||||
ui->scan_lines->setChecked(data.scanLines);
|
||||
ui->vertical_blend->setChecked(data.verticalBlend);
|
||||
|
@ -270,6 +271,7 @@ PreferenceData Preferences::getData() const
|
|||
data.hdInSlot7 = ui->hd_7->isChecked();
|
||||
|
||||
data.saveState = ui->save_state->text();
|
||||
data.printerFilename = ui->printer_filename->text();
|
||||
|
||||
data.videoType = ui->video_type->currentIndex();
|
||||
data.scanLines = ui->scan_lines->isChecked();
|
||||
|
@ -405,3 +407,13 @@ void Preferences::on_slot5_combo_activated(int index)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Preferences::on_browse_pf_clicked()
|
||||
{
|
||||
const QString name = QFileDialog::getSaveFileName(this, QString(), ui->printer_filename->text());
|
||||
if (!name.isEmpty())
|
||||
{
|
||||
ui->printer_filename->setText(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,6 +46,8 @@ private slots:
|
|||
|
||||
void on_slot5_combo_activated(int index);
|
||||
|
||||
void on_browse_pf_clicked();
|
||||
|
||||
private:
|
||||
std::vector<QComboBox *> myDisks;
|
||||
std::vector<QComboBox *> myHDs;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>648</width>
|
||||
<height>316</height>
|
||||
<height>319</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -468,6 +468,32 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Printer</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>Filename</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="printer_filename"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="browse_pf">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="video">
|
||||
|
|
|
@ -439,7 +439,7 @@ void QApple::on_actionOptions_triggered()
|
|||
if (myPreferences->exec())
|
||||
{
|
||||
const PreferenceData newData = myPreferences->getData();
|
||||
setAppleWinPreferences(currentData, newData);
|
||||
setAppleWinPreferences(myFrame, currentData, newData);
|
||||
myOptions.setData(newData.options);
|
||||
reloadOptions();
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ public:
|
|||
void CycleVideoType();
|
||||
void Cycle50ScanLines();
|
||||
|
||||
protected:
|
||||
void ApplyVideoModeChange();
|
||||
|
||||
protected:
|
||||
std::vector<uint8_t> myFramebuffer;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue