mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-02-03 09:44:24 -05:00
Add and implement menu item "File | Copy main text window to WSJT-X.txt".
This commit is contained in:
parent
aea5184a6d
commit
036c612d41
@ -10000,3 +10000,28 @@ void MainWindow::on_jt65Button_clicked()
|
||||
}
|
||||
on_actionJT65_triggered();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionCopy_to_WSJTX_txt_triggered()
|
||||
{
|
||||
qDebug() << ui->decodedTextBrowser->toPlainText();
|
||||
|
||||
static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("WSJT-X.txt")};
|
||||
if(!f.open(QIODevice::Text | QIODevice::WriteOnly)) {
|
||||
MessageBox::warning_message (this, tr ("WSJT-X.txt file error"),
|
||||
tr ("Cannot open \"%1\" for writing").arg (f.fileName ()),
|
||||
tr ("Error: %1").arg (f.errorString ()));
|
||||
} else {
|
||||
QString t=ui->decodedTextBrowser->toPlainText();
|
||||
|
||||
QTextStream out(&f);
|
||||
out << t <<
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
endl
|
||||
#else
|
||||
Qt::endl
|
||||
#endif
|
||||
;
|
||||
f.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,6 +173,7 @@ private slots:
|
||||
void on_actionOpen_next_in_directory_triggered();
|
||||
void on_actionDecode_remaining_files_in_directory_triggered();
|
||||
void on_actionDelete_all_wav_files_in_SaveDir_triggered();
|
||||
void on_actionCopy_to_WSJTX_txt_triggered();
|
||||
void on_actionOpen_log_directory_triggered ();
|
||||
void on_actionNone_triggered();
|
||||
void on_actionSave_all_triggered();
|
||||
|
@ -3026,6 +3026,8 @@ QLabel[oob="true"] {
|
||||
<addaction name="actionOpen_next_in_directory"/>
|
||||
<addaction name="actionDecode_remaining_files_in_directory"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCopy_to_WSJTX_txt"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDelete_all_wav_files_in_SaveDir"/>
|
||||
<addaction name="actionErase_ALL_TXT"/>
|
||||
<addaction name="actionErase_wsjtx_log_adi"/>
|
||||
@ -3036,7 +3038,6 @@ QLabel[oob="true"] {
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSettings"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView">
|
||||
@ -3669,6 +3670,11 @@ QLabel[oob="true"] {
|
||||
<string>Active Stations</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy_to_WSJTX_txt">
|
||||
<property name="text">
|
||||
<string>Copy main text window to WSJT-X.txt</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
Loading…
Reference in New Issue
Block a user