mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-29 07:28:54 -04:00
Fix issue with non-modal window lifetimes.
Some non-modal help windows were not being automatically closed on application exit. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4143 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
5b3e35537f
commit
a9e1a70092
146
mainwindow.cpp
146
mainwindow.cpp
@ -38,15 +38,12 @@ int rc;
|
|||||||
qint32 g_iptt;
|
qint32 g_iptt;
|
||||||
wchar_t buffer[256];
|
wchar_t buffer[256];
|
||||||
|
|
||||||
QTextEdit* pShortcuts;
|
|
||||||
QTextEdit* pPrefixes;
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
Radio::Frequency constexpr default_frequency {14076000};
|
Radio::Frequency constexpr default_frequency {14076000};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class BandAndFrequencyItemDelegate final
|
class BandAndFrequencyItemDelegate final
|
||||||
: public QStyledItemDelegate
|
: public QStyledItemDelegate
|
||||||
{
|
{
|
||||||
@ -957,10 +954,11 @@ void MainWindow::createStatusBar() //createStatusBar
|
|||||||
void MainWindow::closeEvent(QCloseEvent * e)
|
void MainWindow::closeEvent(QCloseEvent * e)
|
||||||
{
|
{
|
||||||
m_config.transceiver_offline ();
|
m_config.transceiver_offline ();
|
||||||
|
|
||||||
writeSettings ();
|
writeSettings ();
|
||||||
|
|
||||||
m_guiTimer.stop ();
|
m_guiTimer.stop ();
|
||||||
|
m_prefixes.reset ();
|
||||||
|
m_shortcuts.reset ();
|
||||||
|
m_mouseCmnds.reset ();
|
||||||
|
|
||||||
if(m_fname != "") killFile();
|
if(m_fname != "") killFile();
|
||||||
m_killAll=true;
|
m_killAll=true;
|
||||||
@ -1011,7 +1009,7 @@ void MainWindow::on_actionAstronomical_data_triggered()
|
|||||||
// hook up termination signal
|
// hook up termination signal
|
||||||
connect (this, &MainWindow::finished, m_astroWidget.data (), &Astro::close);
|
connect (this, &MainWindow::finished, m_astroWidget.data (), &Astro::close);
|
||||||
}
|
}
|
||||||
m_astroWidget->show();
|
m_astroWidget->showNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionOpen_triggered() //Open File
|
void MainWindow::on_actionOpen_triggered() //Open File
|
||||||
@ -1132,53 +1130,58 @@ void MainWindow::on_actionSave_all_triggered() //Save All
|
|||||||
|
|
||||||
void MainWindow::on_actionKeyboard_shortcuts_triggered()
|
void MainWindow::on_actionKeyboard_shortcuts_triggered()
|
||||||
{
|
{
|
||||||
pShortcuts = new QTextEdit(0);
|
if (!m_shortcuts)
|
||||||
pShortcuts->setReadOnly(true);
|
{
|
||||||
pShortcuts->setFontPointSize(10);
|
QFile f(":/shortcuts.txt");
|
||||||
pShortcuts->setWindowTitle(QApplication::applicationName () + " - " + tr ("Keyboard Shortcuts"));
|
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
pShortcuts->setGeometry(QRect(45,50,430,460));
|
msgBox("Cannot open \"" + f.fileName () + "\".");
|
||||||
Qt::WindowFlags flags = Qt::WindowCloseButtonHint |
|
return;
|
||||||
Qt::WindowMinimizeButtonHint;
|
}
|
||||||
pShortcuts->setWindowFlags(flags);
|
m_shortcuts.reset (new QTextEdit);
|
||||||
QFile f(":/shortcuts.txt");
|
m_shortcuts->setReadOnly(true);
|
||||||
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
m_shortcuts->setFontPointSize(10);
|
||||||
msgBox("Cannot open \"" + f.fileName () + "\".");
|
m_shortcuts->setWindowTitle(QApplication::applicationName () + " - " + tr ("Keyboard Shortcuts"));
|
||||||
return;
|
m_shortcuts->setGeometry(QRect(45,50,430,460));
|
||||||
}
|
Qt::WindowFlags flags = Qt::WindowCloseButtonHint |
|
||||||
QTextStream s(&f);
|
Qt::WindowMinimizeButtonHint;
|
||||||
QString t;
|
m_shortcuts->setWindowFlags(flags);
|
||||||
for(int i=0; i<100; i++) {
|
QTextStream s(&f);
|
||||||
t=s.readLine();
|
QString t;
|
||||||
pShortcuts->append(t);
|
for(int i=0; i<100; i++) {
|
||||||
if(s.atEnd()) break;
|
t=s.readLine();
|
||||||
}
|
m_shortcuts->append(t);
|
||||||
pShortcuts->show();
|
if(s.atEnd()) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_shortcuts->showNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionSpecial_mouse_commands_triggered()
|
void MainWindow::on_actionSpecial_mouse_commands_triggered()
|
||||||
{
|
{
|
||||||
QTextEdit* pMouseCmnds;
|
if (!m_mouseCmnds)
|
||||||
pMouseCmnds = new QTextEdit(0);
|
{
|
||||||
pMouseCmnds->setReadOnly(true);
|
QFile f(":/mouse_commands.txt");
|
||||||
pMouseCmnds->setFontPointSize(10);
|
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
pMouseCmnds->setWindowTitle(QApplication::applicationName () + " - " + tr ("Special Mouse Commands"));
|
msgBox("Cannot open \"" + f.fileName () + "\".");
|
||||||
pMouseCmnds->setGeometry(QRect(45,50,440,300));
|
return;
|
||||||
Qt::WindowFlags flags = Qt::WindowCloseButtonHint |
|
}
|
||||||
Qt::WindowMinimizeButtonHint;
|
m_mouseCmnds.reset (new QTextEdit);
|
||||||
pMouseCmnds->setWindowFlags(flags);
|
m_mouseCmnds->setReadOnly(true);
|
||||||
QFile f(":/mouse_commands.txt");
|
m_mouseCmnds->setFontPointSize(10);
|
||||||
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
m_mouseCmnds->setWindowTitle(QApplication::applicationName () + " - " + tr ("Special Mouse Commands"));
|
||||||
msgBox("Cannot open \"" + f.fileName () + "\".");
|
m_mouseCmnds->setGeometry(QRect(45,50,440,300));
|
||||||
return;
|
Qt::WindowFlags flags = Qt::WindowCloseButtonHint |
|
||||||
}
|
Qt::WindowMinimizeButtonHint;
|
||||||
QTextStream s(&f);
|
m_mouseCmnds->setWindowFlags(flags);
|
||||||
QString t;
|
QTextStream s(&f);
|
||||||
for(int i=0; i<100; i++) {
|
QString t;
|
||||||
t=s.readLine();
|
for(int i=0; i<100; i++) {
|
||||||
pMouseCmnds->append(t);
|
t=s.readLine();
|
||||||
if(s.atEnd()) break;
|
m_mouseCmnds->append(t);
|
||||||
}
|
if(s.atEnd()) break;
|
||||||
pMouseCmnds->show();
|
}
|
||||||
|
}
|
||||||
|
m_mouseCmnds->showNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_DecodeButton_clicked (bool /* checked */) //Decode request
|
void MainWindow::on_DecodeButton_clicked (bool /* checked */) //Decode request
|
||||||
@ -2832,27 +2835,30 @@ void MainWindow::on_outAttenuation_valueChanged (int a)
|
|||||||
|
|
||||||
void MainWindow::on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered()
|
void MainWindow::on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered()
|
||||||
{
|
{
|
||||||
pPrefixes = new QTextEdit(0);
|
if (!m_prefixes)
|
||||||
pPrefixes->setReadOnly(true);
|
{
|
||||||
pPrefixes->setFontPointSize(10);
|
QFile f(":/prefixes.txt");
|
||||||
pPrefixes->setWindowTitle(QApplication::applicationName () + " - " + tr ("Prefixes"));
|
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
pPrefixes->setGeometry(QRect(45,50,565,450));
|
msgBox("Cannot open \"" + f.fileName () + "\".");
|
||||||
Qt::WindowFlags flags = Qt::WindowCloseButtonHint |
|
return;
|
||||||
Qt::WindowMinimizeButtonHint;
|
}
|
||||||
pPrefixes->setWindowFlags(flags);
|
m_prefixes.reset (new QTextEdit);
|
||||||
QFile f(":/prefixes.txt");
|
m_prefixes->setReadOnly(true);
|
||||||
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
m_prefixes->setFontPointSize(10);
|
||||||
msgBox("Cannot open \"" + f.fileName () + "\".");
|
m_prefixes->setWindowTitle(QApplication::applicationName () + " - " + tr ("Prefixes"));
|
||||||
return;
|
m_prefixes->setGeometry(QRect(45,50,565,450));
|
||||||
}
|
Qt::WindowFlags flags = Qt::WindowCloseButtonHint |
|
||||||
QTextStream s(&f);
|
Qt::WindowMinimizeButtonHint;
|
||||||
QString t;
|
m_prefixes->setWindowFlags(flags);
|
||||||
for(int i=0; i<100; i++) {
|
QTextStream s(&f);
|
||||||
t=s.readLine();
|
QString t;
|
||||||
pPrefixes->append(t);
|
for(int i=0; i<100; i++) {
|
||||||
if(s.atEnd()) break;
|
t=s.readLine();
|
||||||
}
|
m_prefixes->append(t);
|
||||||
pPrefixes->show();
|
if(s.atEnd()) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_prefixes->showNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::getpfx()
|
void MainWindow::getpfx()
|
||||||
|
@ -208,6 +208,9 @@ private:
|
|||||||
QScopedPointer<WideGraph> m_wideGraph;
|
QScopedPointer<WideGraph> m_wideGraph;
|
||||||
QScopedPointer<LogQSO> m_logDlg;
|
QScopedPointer<LogQSO> m_logDlg;
|
||||||
QScopedPointer<Astro> m_astroWidget;
|
QScopedPointer<Astro> m_astroWidget;
|
||||||
|
QScopedPointer<QTextEdit> m_shortcuts;
|
||||||
|
QScopedPointer<QTextEdit> m_prefixes;
|
||||||
|
QScopedPointer<QTextEdit> m_mouseCmnds;
|
||||||
|
|
||||||
Frequency m_dialFreq;
|
Frequency m_dialFreq;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user