Implement log editing.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@2591 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-09-18 16:28:01 +00:00
parent b6dd46f280
commit d249e27cbd
6 changed files with 64 additions and 11 deletions

View File

@ -86,6 +86,7 @@ void DevSetup::initDlg()
ui.rbAntennaX->setChecked(m_xpolx);
ui.saveDirEntry->setText(m_saveDir);
ui.azelDirEntry->setText(m_azelDir);
ui.editorEntry->setText(m_editorCommand);
ui.dxccEntry->setText(m_dxccPfx);
ui.timeoutSpinBox->setValue(m_timeout);
ui.dPhiSpinBox->setValue(m_dPhi);
@ -153,6 +154,7 @@ void DevSetup::accept()
m_xpolx=ui.rbAntennaX->isChecked();
m_saveDir=ui.saveDirEntry->text();
m_azelDir=ui.azelDirEntry->text();
m_editorCommand=ui.editorEntry->text();
m_dxccPfx=ui.dxccEntry->text();
m_timeout=ui.timeoutSpinBox->value();
m_dPhi=ui.dPhiSpinBox->value();

View File

@ -46,6 +46,7 @@ public:
QString m_azelDir;
QString m_dxccPfx;
QString m_colors;
QString m_editorCommand;
QColor m_colorBackground;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>379</height>
<width>463</width>
<height>390</height>
</rect>
</property>
<property name="windowTitle">
@ -23,13 +23,13 @@
<attribute name="title">
<string>Station</string>
</attribute>
<widget class="QWidget" name="layoutWidget">
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>12</x>
<y>33</y>
<width>348</width>
<height>267</height>
<x>10</x>
<y>34</y>
<width>421</width>
<height>275</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
@ -535,7 +535,7 @@
<widget class="QLabel" name="label_10">
<property name="minimumSize">
<size>
<width>75</width>
<width>80</width>
<height>20</height>
</size>
</property>
@ -559,7 +559,7 @@
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>75</width>
<width>80</width>
<height>20</height>
</size>
</property>
@ -577,6 +577,36 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<widget class="QLabel" name="label_23">
<property name="minimumSize">
<size>
<width>80</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Editor command:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editorEntry">
<property name="maximumSize">
<size>
<width>328</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>notepad</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>

View File

@ -99,6 +99,9 @@ MainWindow::MainWindow(QWidget *parent) :
connect(&proc_m65, SIGNAL(readyReadStandardError()),
this, SLOT(readFromStderr()));
connect(&proc_editor, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(editor_error()));
QTimer *guiTimer = new QTimer(this);
connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate()));
guiTimer->start(100); //Don't change the 100 ms!
@ -119,6 +122,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_appDir = QApplication::applicationDirPath();
m_saveDir="/users/joe/map65/install/save";
m_azelDir="/users/joe/map65/install/";
m_editorCommand="notepad";
m_txFreq=125;
m_setftx=0;
m_loopall=false;
@ -321,6 +325,7 @@ void MainWindow::writeSettings()
settings.setValue("XpolX",m_xpolx);
settings.setValue("SaveDir",m_saveDir);
settings.setValue("AzElDir",m_azelDir);
settings.setValue("Editor",m_editorCommand);
settings.setValue("DXCCpfx",m_dxccPfx);
settings.setValue("Timeout",m_timeout);
settings.setValue("IQamp",m_IQamp);
@ -395,6 +400,7 @@ void MainWindow::readSettings()
m_xpolx=settings.value("XpolX",false).toBool();
m_saveDir=settings.value("SaveDir",m_appDir + "/save").toString();
m_azelDir=settings.value("AzElDir",m_appDir).toString();
m_editorCommand=settings.value("Editor","notepad").toString();
m_dxccPfx=settings.value("DXCCpfx","").toString();
m_timeout=settings.value("Timeout",20).toInt();
m_IQamp=settings.value("IQamp",1.0000).toDouble();
@ -592,6 +598,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
dlg.m_xpolx=m_xpolx;
dlg.m_saveDir=m_saveDir;
dlg.m_azelDir=m_azelDir;
dlg.m_editorCommand=m_editorCommand;
dlg.m_dxccPfx=m_dxccPfx;
dlg.m_timeout=m_timeout;
dlg.m_dPhi=m_dPhi;
@ -622,6 +629,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
m_xpolx=dlg.m_xpolx;
m_saveDir=dlg.m_saveDir;
m_azelDir=dlg.m_azelDir;
m_editorCommand=dlg.m_editorCommand;
m_dxccPfx=dlg.m_dxccPfx;
m_timeout=dlg.m_timeout;
m_dPhi=dlg.m_dPhi;
@ -1264,6 +1272,13 @@ void MainWindow::m65_error() //m65_error
}
}
void MainWindow::editor_error() //editor_error
{
if(!m_killAll) {
msgBox("Error starting or running\n" + m_appDir + "/" + m_editorCommand);
}
}
void MainWindow::readFromStderr() //readFromStderr
{
QByteArray t=proc_m65.readAllStandardError();
@ -1925,7 +1940,7 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button
QDateTime t = QDateTime::currentDateTimeUtc();
QString logEntry=t.date().toString("yyyy-MMM-dd,") +
t.time().toString("hh:mm,") + m_hisCall + "," + m_hisGrid + "," +
QString::number(nMHz) + "," + m_mode + "\n";
QString::number(nMHz) + "," + m_mode + "\r\n";
int ret = QMessageBox::warning(this, "Log Entry",
"Please confirm log entry:\n\n" + logEntry + "\n",
@ -2066,6 +2081,6 @@ void MainWindow::on_actionFUNcube_Dongle_triggered()
void MainWindow::on_actionEdit_wsjt_log_triggered()
{
QString cmnd="notepad " + m_appDir + "/wsjt.log";
QString cmnd=m_editorCommand + " " + m_appDir + "/wsjt.log";
proc_editor.start(QDir::toNativeSeparators(cmnd));
}

View File

@ -38,6 +38,7 @@ public slots:
void readFromStdout();
void readFromStderr();
void m65_error();
void editor_error();
void guiUpdate();
void doubleClickOnCall(QString hiscall, bool ctrl);
void doubleClickOnMessages(QString hiscall, QString t2);
@ -243,6 +244,7 @@ private:
QString m_dateTime;
QString m_mode;
QString m_colors;
QString m_editorCommand;
QHash<QString,bool> m_worked;

View File

@ -1592,6 +1592,9 @@ p, li { white-space: pre-wrap; }
<property name="text">
<string>Edit wsjt.log</string>
</property>
<property name="shortcut">
<string>Alt+Shift+E</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>