[hamradio-commits] [linpsk] 13/25: Imported Upstream version 1.2

Iain R. Learmonth irl at moszumanska.debian.org
Fri Apr 15 14:02:37 UTC 2016


This is an automated email from the git hooks/post-receive script.

irl pushed a commit to branch master
in repository linpsk.

commit cd0aec9fb509dcdea1423b412b2a7c504f4b0633
Author: Iain R. Learmonth <irl at debian.org>
Date:   Thu Apr 14 11:43:40 2016 +0100

    Imported Upstream version 1.2
---
 ChangeLog                                |    9 +-
 README                                   |   10 +-
 gui/.directory                           |    3 -
 gui/addmacro.cpp                         |   83 +-
 gui/addmacro.h                           |   33 +-
 gui/addmacro.ui                          |  446 ++--
 gui/controlpanel.cpp                     |   98 +
 gui/controlpanel.h                       |   50 +
 gui/controlpanel.ui                      |  122 +
 {src => gui}/crxdisplay.cpp              |  218 +-
 {src => gui}/crxdisplay.h                |   89 +-
 gui/crxdisplay.ui                        |  336 +++
 src/crecording.cpp => gui/ctxdisplay.cpp |   61 +-
 src/crecording.h => gui/ctxdisplay.h     |   37 +-
 gui/ctxdisplay.ui                        |  119 +
 gui/deletemacro.cpp                      |   85 +-
 gui/deletemacro.h                        |   27 +-
 gui/deletemacro.ui                       |  325 +--
 gui/editmacro.cpp                        |   91 +-
 gui/editmacro.h                          |   27 +-
 gui/editmacro.ui                         |   89 +-
 gui/generalsettings.cpp                  |  105 +-
 gui/generalsettings.h                    |    2 +
 gui/generalsettings.ui                   |  315 ++-
 gui/gui.pro                              |   50 +-
 {src => gui}/linpsk.cpp                  |  590 ++---
 {src => gui}/linpsk.h                    |   57 +-
 gui/linpsk.ui                            |  658 +++++
 gui/macrocontrol.cpp                     |  105 +
 gui/{editmacro.h => macrocontrol.h}      |   47 +-
 gui/macrocontrol.ui                      |  130 +
 gui/qsodata.cpp                          |  117 +-
 gui/qsodata.h                            |   54 +-
 gui/qsodata.ui                           | 3929 ++++++++++++++++--------------
 gui/renamemacro.cpp                      |   40 +-
 gui/renamemacro.h                        |   23 +-
 gui/spectrumdisplay.cpp                  |  159 ++
 {src => gui}/spectrumdisplay.h           |   46 +-
 gui/spectrumdisplay.ui                   |  211 ++
 gui/txwindow.cpp                         |  194 ++
 gui/{editmacro.h => txwindow.h}          |   54 +-
 gui/txwindow.ui                          |  110 +
 linpsk.pro                               |   21 +-
 src/cdemodulator.cpp                     |    5 -
 src/cdemodulator.h                       |    7 +-
 src/cledbutton.cpp                       |    2 -
 src/constants.h                          |  286 ++-
 src/controlpanel.cpp                     |   76 -
 src/controlpanel.h                       |   43 -
 src/cpskdemodulator.cpp                  |  271 +--
 src/crxchannel.cpp                       |    4 +
 src/crxchannel.h                         |    5 +-
 src/crxwindow.cpp                        |   48 +-
 src/crxwindow.h                          |    9 +-
 src/csound.cpp                           |   96 +-
 src/csound.h                             |    1 +
 src/csquelch.cpp                         |   40 +-
 src/csquelch.h                           |    2 +-
 src/ctrigger.cpp                         |   68 -
 src/ctxbuffer.cpp                        |   20 +-
 src/ctxbuffer.h                          |    1 +
 src/ctxwindow.cpp                        |  292 ---
 src/ctxwindow.h                          |   71 -
 src/frequencyselect.cpp                  |    2 +-
 src/frequencyselect.h                    |    1 -
 src/macros.cpp                           |  259 --
 src/macros.h                             |   61 -
 src/macrowindow.cpp                      |  135 -
 src/macrowindow.h                        |   53 -
 src/mfskdemodulator.cpp                  |    3 -
 src/parameter.cpp                        |   14 +-
 src/parameter.h                          |   12 +-
 src/processlogdata.cpp                   |   23 +-
 src/pskmodulator.cpp                     |    4 +-
 src/pskmodulator.h                       |    1 -
 src/rttydemodulator.cpp                  |    0
 src/rttydemodulator.h                    |    0
 src/spectrumdisplay.cpp                  |  354 ---
 src/spectrumwindow.cpp                   |  194 ++
 src/spectrumwindow.h                     |   57 +
 src/src.pro                              |   58 +-
 src/tabwidget.cpp                        |   11 +
 src/tabwidget.h                          |   19 +
 src/waterfallwindow.cpp                  |   89 +
 src/{ctrigger.h => waterfallwindow.h}    |   56 +-
 src/waveinput.cpp                        |   19 +-
 gui/editmacro.h => templates/cpp         |   36 -
 gui/editmacro.h => templates/h           |   36 -
 88 files changed, 7030 insertions(+), 5189 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fca8c3b..9f1afc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,19 @@
 LinPsk ChangeLog
 
+1.2
+
+Modified gui to fit on small screens.
+Improved soundcard detection.
+Introduced Dok field to qsodata.
+Predefined frequency values for use with linlogbook.
+Introduced language parameter for use with macros.
+
 1.1
 
 Fixed wrong code for 'LF' in rttymodulator.cpp, Thanks to kf9a
 'Home key' mapped to 'cr'
 Possibility introduced to send 'CR' 'LF' on enter key. Selectable by setup.
 Reintroduced squelch for rtty .
-Expand auto CR LF to sendfile
 
 1.0
 
diff --git a/README b/README
index da8ec9b..0bcf951 100644
--- a/README
+++ b/README
@@ -1,12 +1,16 @@
 To build linpsk, untar the tar archiv and switch to the linpsk directory.
 
 run:
-qmake -unix -o Makefile linpsk.pro
+qmake -o Makefile linpsk.pro
 make
 
 The executable linpsk is build in the bin subdirectory. Move the binary into prefered location , probably /usr/local/bin
 
 LinPSK now uses the alsa sound system.
-The names of the used alsa devices are LinPSK_Record and LinPSK_Play.
+The names of the used alsa devices are LinPSK_Record and LinPSK_Play as default.
 To map these names to your soundcard edit the file asoundrc in the linpsk directory appropriately and append it to .asoundrc in your homedirectory.
-If no .asoundrc exists copy the edited asoundrc to .asoundrc in your homedirectory instead of appending.
\ No newline at end of file
+If no .asoundrc exists copy the edited asoundrc to .asoundrc in your homedirectory instead of appending.
+
+Instead of using LinPSK_Record/ LinPSK_Play now you can use valid alsa devices like plughw:1 in the settings dialog
+Also using the card name can be used. In this case LinPSK searches the cardnumber and opens
+plughw:[cardnumber]
diff --git a/gui/.directory b/gui/.directory
deleted file mode 100644
index 09ee32e..0000000
--- a/gui/.directory
+++ /dev/null
@@ -1,3 +0,0 @@
-[Dolphin]
-Timestamp=2009,11,14,11,57,46
-ViewMode=1
diff --git a/gui/addmacro.cpp b/gui/addmacro.cpp
index 14dfbae..50716cf 100644
--- a/gui/addmacro.cpp
+++ b/gui/addmacro.cpp
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -21,71 +20,77 @@
 
 #include "addmacro.h"
 #include "readonlystringlistmodel.h"
+#include "ui_addmacro.h"
+
 #include <QMessageBox>
-AddMacro::AddMacro(Macros *k,QWidget* parent, Qt::WFlags fl)
-: QDialog( parent, fl ), Ui::AddMacro()
+#include <QButtonGroup>
+
+AddMacro::AddMacro(QVector<Macro> *macroList,QStringList tokenList, QWidget* parent, Qt::WFlags fl)
+: QDialog( parent, fl ),  ui(new Ui::AddMacro)
 {
-	setupUi(this);
-ReadOnlyStringListModel *model= new ReadOnlyStringListModel();
-model->setStringList(k->getKeyWordList());
-KeywordDisplay->setModel(model);
-connect(KeywordDisplay,SIGNAL(clicked(const QModelIndex &)),this,SLOT(insertKeyword(const QModelIndex &)));
-model= new ReadOnlyStringListModel();
-model->setStringList(k->getMacroList());
-MacroDisplay->setModel(model);
-Position->setMaximum(k->getMacroList().size()+1);
-Position->setValue(k->getMacroList().size()+1);
+  ui->setupUi(this);
+  ui->bG->setId(ui->lang0,0);
+  ui->bG->setId(ui->lang1,1);
+  ui->bG->setId(ui->lang2,2);
+  mL=macroList;
+  ReadOnlyStringListModel *model= new ReadOnlyStringListModel();
+  model->setStringList(tokenList);
+  ui->KeywordDisplay->setModel(model);
+  model= new ReadOnlyStringListModel();
+  QStringList macroName;
+  int numberofMacros=macroList->size();
+  if (numberofMacros > 0 )
+  for(int i=0; i < numberofMacros;i++)
+    macroName.append((*macroList).at(i).name);
+  model->setStringList(macroName);
+  ui->MacroDisplay->setModel(model);
+  ui->Position->setMaximum(numberofMacros);
+  ui->Position->setValue(numberofMacros);
 
 }
 
 AddMacro::~AddMacro()
 {
+  delete ui;
 }
 void AddMacro::accept()
 {
-if (MacroName->text().length()== 0)
+  int anzahl;
+  if (ui->MacroName->text().length()== 0)
   {
     QMessageBox::warning(this,"Incomplete Macro Definition","Name of Macro is missing \n Enter Name of Macro",
       QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
-    return;  
+    return;
   }
-if (MacroDefinition->toPlainText().length()== 0)
+  if (ui->MacroDefinition->toPlainText().length()== 0)
   {
     QMessageBox::warning(this,"Incomplete Macro Definition","Macrodefinition is missing \n Enter  Macrodefinition",
       QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
     return;
   }
-int anzahl=MacroDefinition->toPlainText().count(QLatin1Char('@'));
+  anzahl=ui->MacroDefinition->toPlainText().count(QLatin1Char('@'));
 
- if (( anzahl > 0) && ((anzahl/2)*2 != anzahl) )
-	{
+  if (( anzahl > 0) && ((anzahl/2)*2 != anzahl) )
+        {
     QMessageBox::warning(this,"Error in Macro Definition","Error in Macrodefinition. Incorrect number of @  \n Enter  Macrodefinition",
       QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
     return;
   }
+  Macro macro;
+  macro.name=ui->MacroName->text();
+  macro.text=ui->MacroDefinition->toPlainText();
+  macro.accelerator=ui->Accelerator->text();
+  macro.languageType=ui-> bG->checkedId();
+//  mL->append(macro);
+  mL->insert(ui->Position->value(),macro);
+
   QDialog::accept();
 }
 
-void AddMacro::insertKeyword(const QModelIndex &index)
+void AddMacro::insertKeyword(QModelIndex index)
 {
  QString s=index.data().toString();
- MacroDefinition->insertPlainText(s);
- MacroDefinition->setFocus();
+ ui->MacroDefinition->insertPlainText(s);
+ ui->MacroDefinition->setFocus();
 }
 
-QString AddMacro::macroName()
-{
- return MacroName->text();
-}
-QString AddMacro::macroDefinition()
-{
- return MacroDefinition->toPlainText();
-}
-int AddMacro::position()
-{
- return Position->value();
-}
-QString AddMacro::accelerator()
-{
- return Accelerator->text();
-}
diff --git a/gui/addmacro.h b/gui/addmacro.h
index 3b704a4..593e588 100644
--- a/gui/addmacro.h
+++ b/gui/addmacro.h
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -23,37 +22,33 @@
 
 #include <QDialog>
 #include <QString>
+#include <QModelIndex>
 
-#include "macros.h"
+#include "constants.h"
 
-#include "ui_addmacro.h"
+namespace Ui {
+  class AddMacro;
+}
 
-class Macros;
-class QModelIndex;
-class AddMacro : public QDialog, private Ui::AddMacro
+class AddMacro : public QDialog
 {
   Q_OBJECT
 
 public:
-  AddMacro(Macros *,QWidget* parent = 0, Qt::WFlags fl = 0 );
+  AddMacro(QVector<Macro> *macroList,QStringList tokenList,QWidget* parent = 0, Qt::WFlags fl = 0 );
   ~AddMacro();
-  /*$PUBLIC_FUNCTIONS$*/
-//void setKeywords( Macros *k );
-QString macroName();
-QString macroDefinition();
-int position();
-QString accelerator();
 
 public slots:
-  /*$PUBLIC_SLOTS$*/
 
 protected:
-  /*$PROTECTED_FUNCTIONS$*/
 
 protected slots:
-  /*$PROTECTED_SLOTS$*/
-  virtual void          accept();
-void insertKeyword(const QModelIndex &);
+  virtual void  accept();
+  void insertKeyword(QModelIndex);
+private:
+  Ui::AddMacro *ui;
+  QVector<Macro> *mL;
+
 };
 
 #endif
diff --git a/gui/addmacro.ui b/gui/addmacro.ui
index 33d10ea..d241c8e 100644
--- a/gui/addmacro.ui
+++ b/gui/addmacro.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>676</width>
-    <height>531</height>
+    <width>673</width>
+    <height>550</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -36,83 +36,133 @@
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0" colspan="2">
-    <widget class="QLabel" name="textLabel1">
-     <property name="minimumSize">
-      <size>
-       <width>90</width>
-       <height>20</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Macro Name</string>
-     </property>
-     <property name="textFormat">
-      <enum>Qt::PlainText</enum>
-     </property>
-     <property name="wordWrap">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="2">
-    <widget class="QLineEdit" name="MacroName">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>210</width>
-       <height>20</height>
-      </size>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="3" colspan="2">
-    <widget class="QLabel" name="textLabel2">
-     <property name="minimumSize">
-      <size>
-       <width>145</width>
-       <height>20</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Position in Macro List</string>
-     </property>
-     <property name="wordWrap">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="5">
-    <spacer name="horizontalSpacer_5">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>72</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="textLabel1">
+       <property name="minimumSize">
+        <size>
+         <width>90</width>
+         <height>20</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Macro Name</string>
+       </property>
+       <property name="textFormat">
+        <enum>Qt::PlainText</enum>
+       </property>
+       <property name="wordWrap">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="MacroName">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>150</width>
+         <height>20</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
-   <item row="0" column="6">
-    <widget class="QSpinBox" name="Position">
-     <property name="minimumSize">
-      <size>
-       <width>45</width>
-       <height>20</height>
-      </size>
-     </property>
-     <property name="minimum">
-      <number>1</number>
-     </property>
+   <item row="0" column="2" rowspan="3">
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Language selection</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_3">
+      <item>
+       <widget class="QRadioButton" name="lang0">
+        <property name="text">
+         <string>both</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">bG</string>
+        </attribute>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="lang1">
+        <property name="text">
+         <string>english</string>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">bG</string>
+        </attribute>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="lang2">
+        <property name="text">
+         <string>german</string>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">bG</string>
+        </attribute>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
    <item row="1" column="0" colspan="2">
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QLabel" name="textLabel2">
+       <property name="minimumSize">
+        <size>
+         <width>145</width>
+         <height>20</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Position in Macro List</string>
+       </property>
+       <property name="wordWrap">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_5">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>31</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QSpinBox" name="Position">
+       <property name="minimumSize">
+        <size>
+         <width>45</width>
+         <height>20</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>1</number>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="2" column="0">
     <widget class="QLabel" name="textLabel1_3">
      <property name="minimumSize">
       <size>
@@ -128,7 +178,7 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="2">
+   <item row="2" column="1">
     <widget class="QLineEdit" name="Accelerator">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -138,26 +188,13 @@
      </property>
      <property name="minimumSize">
       <size>
-       <width>210</width>
+       <width>50</width>
        <height>20</height>
       </size>
      </property>
     </widget>
    </item>
-   <item row="1" column="4">
-    <spacer name="horizontalSpacer_4">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>72</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="0">
+   <item row="3" column="0">
     <widget class="QLabel" name="textLabel3">
      <property name="minimumSize">
       <size>
@@ -176,7 +213,7 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="3">
+   <item row="3" column="2">
     <widget class="QLabel" name="textLabel4">
      <property name="minimumSize">
       <size>
@@ -185,14 +222,14 @@
       </size>
      </property>
      <property name="text">
-      <string>List of macros</string>
+      <string>List of allready existing macros</string>
      </property>
      <property name="wordWrap">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="3" column="0" colspan="3">
+   <item row="4" column="0" colspan="2">
     <widget class="QTextEdit" name="MacroDefinition">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -202,10 +239,20 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="3" colspan="4">
+   <item row="4" column="2">
     <widget class="QListView" name="MacroDisplay"/>
    </item>
-   <item row="4" column="0" rowspan="2" colspan="3">
+   <item row="5" column="0">
+    <widget class="QLabel" name="textLabel1_2">
+     <property name="text">
+      <string>Keywords</string>
+     </property>
+     <property name="wordWrap">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="0" colspan="2">
     <widget class="QListView" name="KeywordDisplay">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -215,131 +262,92 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="3">
-    <widget class="QPushButton" name="buttonOk">
-     <property name="text">
-      <string>&OK</string>
-     </property>
-     <property name="shortcut">
-      <string/>
-     </property>
-     <property name="autoDefault">
-      <bool>true</bool>
-     </property>
-     <property name="default">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="4">
-    <spacer name="horizontalSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>72</width>
-       <height>22</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="5" column="5">
-    <widget class="QPushButton" name="buttonCancel">
-     <property name="text">
-      <string>&Cancel</string>
-     </property>
-     <property name="shortcut">
-      <string/>
-     </property>
-     <property name="autoDefault">
-      <bool>true</bool>
+   <item row="6" column="2">
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Example</string>
      </property>
+     <layout class="QFormLayout" name="formLayout">
+      <item row="0" column="0">
+       <widget class="QLabel" name="textLabel6">
+        <property name="frameShape">
+         <enum>QFrame::NoFrame</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Plain</enum>
+        </property>
+        <property name="text">
+         <string>@TX@ cq cq de @CALLSIGN@ pse k @RX@</string>
+        </property>
+        <property name="textFormat">
+         <enum>Qt::PlainText</enum>
+        </property>
+        <property name="wordWrap">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="5" column="6">
+   <item row="7" column="0" colspan="2">
     <spacer name="horizontalSpacer_2">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
-       <width>71</width>
-       <height>22</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="6" column="0">
-    <widget class="QLabel" name="textLabel1_2">
-     <property name="text">
-      <string>Keywords</string>
-     </property>
-     <property name="wordWrap">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="1" colspan="2">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>237</width>
-       <height>21</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="6" column="3" colspan="5">
-    <spacer name="horizontalSpacer_3">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>338</width>
-       <height>21</height>
+       <width>356</width>
+       <height>20</height>
       </size>
      </property>
     </spacer>
    </item>
-   <item row="4" column="3" colspan="5">
-    <widget class="QGroupBox" name="groupBox">
-     <property name="title">
-      <string>Example</string>
-     </property>
-     <widget class="QLabel" name="textLabel6">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>20</y>
-        <width>281</width>
-        <height>41</height>
-       </rect>
-      </property>
-      <property name="frameShape">
-       <enum>QFrame::NoFrame</enum>
-      </property>
-      <property name="frameShadow">
-       <enum>QFrame::Plain</enum>
-      </property>
-      <property name="text">
-       <string>@TX@ cq cq de @CALLSIGN@ pse k @RX@</string>
-      </property>
-      <property name="textFormat">
-       <enum>Qt::PlainText</enum>
-      </property>
-      <property name="wordWrap">
-       <bool>false</bool>
-      </property>
-     </widget>
-    </widget>
+   <item row="7" column="2">
+    <layout class="QHBoxLayout" name="horizontalLayout_4">
+     <item>
+      <widget class="QPushButton" name="buttonOk">
+       <property name="text">
+        <string>&OK</string>
+       </property>
+       <property name="shortcut">
+        <string/>
+       </property>
+       <property name="autoDefault">
+        <bool>true</bool>
+       </property>
+       <property name="default">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>72</width>
+         <height>22</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="buttonCancel">
+       <property name="text">
+        <string>&Cancel</string>
+       </property>
+       <property name="shortcut">
+        <string/>
+       </property>
+       <property name="autoDefault">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
   </layout>
  </widget>
@@ -379,5 +387,27 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>KeywordDisplay</sender>
+   <signal>clicked(QModelIndex)</signal>
+   <receiver>AddMacro</receiver>
+   <slot>insertKeyword(QModelIndex)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>162</x>
+     <y>382</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>367</x>
+     <y>256</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
+ <slots>
+  <slot>insertKeyword(QModelIndex)</slot>
+ </slots>
+ <buttongroups>
+  <buttongroup name="bG"/>
+ </buttongroups>
 </ui>
diff --git a/gui/controlpanel.cpp b/gui/controlpanel.cpp
new file mode 100644
index 0000000..ba9be32
--- /dev/null
+++ b/gui/controlpanel.cpp
@@ -0,0 +1,98 @@
+
+#include "controlpanel.h"
+
+#include <qvariant.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qimage.h>
+#include <qpixmap.h>
+
+#include "spectrumdisplay.h"
+#include "qsodata.h"
+
+/* 
+ *  Constructs a ControlPanel which is a child of 'parent', with the 
+ *  name 'name'.' 
+ */
+ControlPanel::ControlPanel( QWidget* parent)
+  : QFrame( parent ), Ui::ControlPanel()
+{
+  setupUi(this);
+  connect(Display,SIGNAL(FrequencyChanged(double)),this,SIGNAL(FrequencyChanged(double)));
+  connect(macroControl,SIGNAL(executeMacro(int)),this,SIGNAL(executeMacro(int)));
+}
+
+/*
+ *  Destroys the object and frees any allocated resources
+ */
+ControlPanel::~ControlPanel()
+{
+ if(QSO)
+  delete QSO;
+ QSO=0;
+    // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ *  Sets the strings of the subwidgets using the current
+ *  language.
+ */
+
+
+void ControlPanel::setQsoData(QsoData value,QString s)
+{
+  QSO->setQsoData(value,s);
+}
+
+void ControlPanel::setPhasePointer(std::complex<float> *p)
+{
+  Display->setPhasePointer(p);
+}
+void ControlPanel::setColorList(QList<QColor> *c)
+{
+  Display->setColorList(c);
+}
+void ControlPanel::startPlot ( double *d, bool b)
+{
+  Display->startPlot(d,b);
+}
+void ControlPanel::display()
+{
+  Display->show();
+}
+
+void ControlPanel::undisplay()
+{
+  Display->hide();
+}
+void ControlPanel::newChannel()
+{
+  QSO->newChannel();
+}
+void ControlPanel::updateMacroWindow(int macroNumber)
+{
+  macroControl->updateMacroWindow(macroNumber);
+}
+
+void ControlPanel::insertMacros(QVector<Macro> *macroList)
+{
+  macroControl->insertMacros(macroList);
+}
+void ControlPanel::enableSaveData()
+{
+  QSO->enableSaveData();
+}
+void ControlPanel::restoreSplitterStates(const QByteArray & controlState,const QByteArray & spectrumState)
+{
+  controlSplitter->restoreState(controlState);
+  Display->restoreSplitterState(spectrumState);
+}
+QByteArray ControlPanel::controlSplitterState() const
+{
+  return controlSplitter->saveState();
+}
+QByteArray ControlPanel::spectrumSplitterState() const
+{
+  return Display->spectrumSplitterState();
+}
diff --git a/gui/controlpanel.h b/gui/controlpanel.h
new file mode 100644
index 0000000..08d33f0
--- /dev/null
+++ b/gui/controlpanel.h
@@ -0,0 +1,50 @@
+
+#ifndef CONTROLPANEL_H
+#define CONTROLPANEL_H
+
+#include <qvariant.h>
+#include <qpixmap.h>
+#include <qframe.h>
+#include <vector>
+#include "ui_controlpanel.h"
+#include <complex>
+#include "constants.h"
+
+class Macros;
+
+class ControlPanel : public QFrame, private Ui::ControlPanel
+{
+    Q_OBJECT
+
+public:
+    ControlPanel(QWidget* parent = 0);
+    void insertMacros(Macros *);
+    void setPhasePointer(std::complex<float> *);
+    void setColorList(QList<QColor> *c);
+    void display();
+    void undisplay();
+    void newChannel();
+    void updateMacroWindow(int macroNumber);
+    void insertMacros(QVector<Macro> *macroList);
+    void enableSaveData();
+    void restoreSplitterStates(const QByteArray & controlState,const QByteArray & spectrumState);
+    QByteArray controlSplitterState() const;
+    QByteArray spectrumSplitterState() const;
+    ~ControlPanel();
+
+
+ 
+protected:
+public slots:
+    void startPlot ( double *, bool );
+    void setQsoData(QsoData,QString);
+protected slots:
+
+private:
+
+signals:
+    void FrequencyChanged ( double );
+    void executeMacro ( int );
+};
+
+#endif // CONTROLPANEL_H
diff --git a/gui/controlpanel.ui b/gui/controlpanel.ui
new file mode 100644
index 0000000..25ab051
--- /dev/null
+++ b/gui/controlpanel.ui
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ControlPanel</class>
+ <widget class="QFrame" name="ControlPanel">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>604</width>
+    <height>190</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Frame</string>
+  </property>
+  <property name="frameShape">
+   <enum>QFrame::StyledPanel</enum>
+  </property>
+  <property name="frameShadow">
+   <enum>QFrame::Sunken</enum>
+  </property>
+  <property name="lineWidth">
+   <number>1</number>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QSplitter" name="controlSplitter">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="childrenCollapsible">
+      <bool>false</bool>
+     </property>
+     <widget class="SpectrumDisplay" name="Display">
+      <property name="minimumSize">
+       <size>
+        <width>240</width>
+        <height>0</height>
+       </size>
+      </property>
+      <property name="frameShape">
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow">
+       <enum>QFrame::Raised</enum>
+      </property>
+      <property name="lineWidth">
+       <number>2</number>
+      </property>
+      <property name="midLineWidth">
+       <number>-1</number>
+      </property>
+     </widget>
+     <widget class="QWidget" name="layoutWidget">
+      <layout class="QHBoxLayout" name="horizontalLayout" stretch="2,1">
+       <property name="spacing">
+        <number>1</number>
+       </property>
+       <item>
+        <widget class="QSOData" name="QSO">
+         <property name="minimumSize">
+          <size>
+           <width>273</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="sizeIncrement">
+          <size>
+           <width>10</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="title">
+          <string>Qso Infos</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="MacroControl" name="macroControl">
+         <property name="title">
+          <string>Macro</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>SpectrumDisplay</class>
+   <extends>QFrame</extends>
+   <header>spectrumdisplay.h</header>
+   <container>1</container>
+   <slots>
+    <signal>FrequencyChanged(double)</signal>
+   </slots>
+  </customwidget>
+  <customwidget>
+   <class>QSOData</class>
+   <extends>QGroupBox</extends>
+   <header>qsodata.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>MacroControl</class>
+   <extends>QGroupBox</extends>
+   <header>macrocontrol.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+ <slots>
+  <signal>FrequencyChanged(double)</signal>
+ </slots>
+</ui>
diff --git a/src/crxdisplay.cpp b/gui/crxdisplay.cpp
similarity index 53%
rename from src/crxdisplay.cpp
rename to gui/crxdisplay.cpp
index 0f3dbec..5cc94c4 100644
--- a/src/crxdisplay.cpp
+++ b/gui/crxdisplay.cpp
@@ -14,20 +14,14 @@
  *   (at your option) any later version.                                   *
  ***************************************************************************/
 
-#include "crxdisplay.h"
-
-
-
 #include <QTimer>
 #include <QMessageBox>
 #include <QRadioButton>
 #include <QLineEdit>
-
-#include "crecording.h"
+#include "crxdisplay.h"
 #include "crxchannel.h"
 #include "crxwindow.h"
 #include "csquelch.h"
-#include "ctrigger.h"
 #include "frequencyselect.h"
 #include "input.h"
 #include "textinput.h"
@@ -36,7 +30,6 @@
 #include "fircoeffs.h"
 #include "parameter.h"
 
-
 extern Parameter settings;
 /*
  *  Constructs a CRxDisplay which is a child of 'parent', with the
@@ -46,60 +39,31 @@ extern Parameter settings;
 
 
 CRxDisplay::CRxDisplay ( QWidget* parent )
-    : QFrame ( parent )
+  : QFrame ( parent ), Ui::CRxDisplay()
 {
-  setFrameShape ( QFrame::WinPanel );
-  setFrameShadow ( QFrame::Sunken );
-
-  RxFreq = new FrequencySelect ( this, Wide );
-  RxFreq->setTitle ( "Rx Freq / AFC" );
-  RxFreq->setFunctionText ( "Narrow" );
-
-  Recording = new CRecording ( this );
-
-  Trigger = new CTrigger ( "Trigger", this );
-
-  Squelch = new CSquelch ( "Squelch", this );
+  setupUi(this);
 
-  RxHeader = new QTabBar ( this );
-  RxHeader->setShape ( QTabBar::RoundedNorth );
-
-  Clear = new QPushButton ( this );
-  Clear->setText ( "Clear" );
-
-//    QTab *Tab = new QTab("Rx 1");
-  RxHeader->insertTab ( 0, "Rx 1" );
   Sound = 0;
 
   dec2fir = new double[DEC2_LPFIR_LENGTH];
 
   RxChannel = new CRxChannel ( 0, this );
-  connect ( RxChannel->RxWindow, SIGNAL ( copyCallSign ( QString ) ), this, SIGNAL ( copyCallSign ( QString ) ) );
-  connect ( RxChannel->RxWindow, SIGNAL ( copyQTH ( QString ) ), this, SIGNAL ( copyQTH ( QString ) ) );
-  connect ( RxChannel->RxWindow, SIGNAL ( copyName ( QString ) ), this, SIGNAL ( copyName ( QString ) ) );
-  connect ( RxChannel->RxWindow, SIGNAL ( copyLocator ( QString ) ), this, SIGNAL ( copyLocator ( QString ) ) );
-  connect ( RxChannel->RxWindow, SIGNAL ( copyRST ( QString ) ), this, SIGNAL ( copyRST ( QString ) ) );
+  RxHeader->insertTab ( 0, RxChannel->getWindow(),QString("Rx 1") );
+  RxFreq->setFunctionText("Narrow");
+
 
   settings.ChannelChain = RxChannel;
   settings.ActChannel = RxChannel;
-  Squelch->setSquelchState ( RxChannel->getSquelchState() );
+
   languageChange();
 // Connect Signals and Slots
-//  RxTimer = new QTimer ( this );
-//  connect ( RxTimer, SIGNAL ( timeout() ), this, SLOT ( process_rxdata() ) );
-  connect ( RxFreq, SIGNAL ( FrequencyChanged ( double ) ), this, SLOT ( setRxFrequency ( double ) ) );
-  connect ( RxHeader, SIGNAL ( currentChanged ( int ) ), this, SLOT ( changeActiveRxWindow ( int ) ) );
-// connect(RxFreq,SIGNAL(toggleAFC(bool)),this,SLOT(setAFC(bool)));
-  connect ( Trigger->Activate, SIGNAL ( clicked() ), this, SLOT ( trigger() ) );
-  connect ( Trigger->TriggerText, SIGNAL ( returnPressed() ), this, SLOT ( trigger() ) );
-  connect ( RxChannel, SIGNAL ( Triggered ( int ) ), RxHeader, SLOT ( setCurrentTab ( int ) ) );
-
-  connect ( Clear, SIGNAL ( clicked() ), this, SLOT ( clearRxWindow() ) );
+  connect ( RxChannel->RxWindow, SIGNAL ( setQsoData(QsoData,QString)),this, SIGNAL (setQsoData(QsoData,QString)));
+  connect ( RxChannel, SIGNAL ( Triggered ( int ) ), RxHeader, SLOT ( setCurrentIndex ( int ) ) );
+
   trigger(); // We should ensure that the triggertext is stored;
+  Squelch->setSquelchState ( RxChannel->getSquelchState() );
 
 // Creating Variables for the fft
-
-// plan=rfftw_create_plan(BUF_SIZE/2,FFTW_REAL_TO_COMPLEX,FFTW_ESTIMATE);
   plan = fftw_plan_r2r_1d ( BUF_SIZE / 2, outbuf, output, FFTW_R2HC , FFTW_PATIENT );
 }
 
@@ -120,82 +84,9 @@ void CRxDisplay::languageChange()
 //    setCaption( tr( "RxDisplay" ) );
 }
 
-void CRxDisplay::calculateSizeofComponents()
-{
-  /** in percent of whole widget **/
-  /** RX Part **/
-#define RXPARTWIDTH 64
-  /**  Squelch **/
-#define SQUELCHWIDTH 10
-  /** General Width **/
-#define GENERALWIDTH 18
-  /** Recording **/
-#define RECORDHEIGHT 25
-  /** Trigger **/
-#define TRIGGERHEIGHT 33
-  /** RxFrequency (Height) **/
-#define RXFREQHEIGHT 70
-  /** Left and Right Margin **/
-#define LEFTANDRIGHTMARGIN 1
-  /** Top and Bottom Margin **/
-#define TOPANDBOTTOMMARGIN 5
-  /** Inner distance **/
-#define DISTANCE 1
-  /** Tab height **/
-#define TABHEIGHT 10
-#define TABWIDTH 30
-  int xpos, ypos, width, height, innerheight, innerwidth;
-  width = this->width();
-  height = this->height();
-  xpos = width * LEFTANDRIGHTMARGIN / 100;
-
-  /**Recording **/
-
-  ypos = height * TOPANDBOTTOMMARGIN / 100;
-  innerwidth = width * GENERALWIDTH / 100;
-  innerheight = height * RECORDHEIGHT / 100;
-  Recording->setGeometry ( xpos, ypos, innerwidth, innerheight );
-  ypos = ypos + innerheight + height * DISTANCE / 100;
-
-  /** Trigger **/
-
-  innerheight = height * TRIGGERHEIGHT / 100;
-  Trigger->setGeometry ( xpos, ypos, innerwidth, innerheight );
-  /** RXFrequency **/
-  ypos = ypos + innerheight + height * DISTANCE / 100;
-  RxFreq->setGeometry ( xpos, ypos, innerwidth, innerheight );
-
-  /**SQuelch **/
-  xpos = xpos + innerwidth + width * DISTANCE / 100;
-  ypos = height * TOPANDBOTTOMMARGIN / 100;;
-  innerheight = height - 2 * ypos;
-  innerwidth = width * SQUELCHWIDTH / 100;
-  Squelch->setGeometry ( xpos, ypos, innerwidth, innerheight );
-
-  /** RxWindowTabBar **/
-  xpos = xpos + innerwidth + width * DISTANCE / 100;
-  innerwidth = ( width - xpos - width * LEFTANDRIGHTMARGIN / 100 ) * TABWIDTH / 100;;
-  innerheight = height * TABHEIGHT / 100;
-  RxHeader->setGeometry ( xpos, ypos, innerwidth, innerheight );
-
-  Clear->setGeometry ( width - width*LEFTANDRIGHTMARGIN / 100 - 100, ypos, 100, innerheight );
-
-  ypos = ypos + innerheight;
-  innerheight = height - innerheight - height * TOPANDBOTTOMMARGIN / 100;
-  innerwidth = width - xpos - width * LEFTANDRIGHTMARGIN / 100;
-  settings.ActChannel->setGeometry ( xpos, ypos, innerwidth, innerheight );
-}
-
-void CRxDisplay::resizeEvent ( QResizeEvent * )
-{
-  calculateSizeofComponents();
-}
-
 bool CRxDisplay::start_process_loop()
 {
   QString errorstring;
-
-
   if ( Sound == 0 )
   {
     if ( settings.DemoMode )
@@ -207,7 +98,7 @@ bool CRxDisplay::start_process_loop()
     }
     else
       Sound = new CSound ( settings.serial );
-    if ( Sound <= 0 )
+    if ( Sound <= NULL )
       return false;
 
     connect ( Sound, SIGNAL ( samplesAvailable() ), this, SLOT ( process_rxdata() ) );
@@ -276,9 +167,9 @@ void CRxDisplay::process_rxdata()
 
 {
   bool overload;
+  Mode modtype;
   if ( Sound->getSamples ( inbuf, BUF_SIZE ) == 0 )
     return; // No sample available, try later
-
   overload = false;
   ProcDec2Fir ( inbuf, outbuf , BUF_SIZE ); // 2uS per sample
 
@@ -290,14 +181,16 @@ void CRxDisplay::process_rxdata()
   settings.ActChannel->setAfcMode ( RxFreq->getAfcMode() );
 
   for ( CRxChannel * p = RxChannel;p != 0;p = p->getNextChannel() )
-    if ( ( p->getModulationType() != RTTY ) && ( p->getModulationType() != MFSK16 ) )
+  {
+    modtype=p->getModulationType();
+    if ( ( modtype != RTTY ) && ( modtype != MFSK16 ) /* RIP && (modtype != RTTY2) */ )
     {
 
       p->processInput ( outbuf, output );
     }
     else
       p->processInput ( inbuf, output );
-
+  }
   /** Update RxFreq for the active Channel **/
   emit new_IMD ( settings.ActChannel->getIMD() );
 
@@ -308,8 +201,8 @@ void CRxDisplay::process_rxdata()
   int N = BUF_SIZE / 2;
   for ( int i = 0; i < N;i++ )
   {
-    if ( outbuf[i] > 0.77 )
-      overload = true;
+    if ( inbuf[i] > 0.9 )
+        overload = true;
 // Apply Hamming to Data
     outbuf[i] *= ( 0.54 - 0.46 * cos ( ( i * PI2 ) / N ) );
   }
@@ -328,18 +221,13 @@ void CRxDisplay::addRxWindow ( int Frequency, Mode Modulation, QString Heading )
 {
   CRxChannel *p;
   int ID = RxHeader->count();
-  RxHeader->insertTab ( ID, Heading );
   p = new CRxChannel ( ID, this, Modulation, Frequency );
+  RxHeader->insertTab ( ID, p->getWindow(),Heading );
   connect ( p, SIGNAL ( Triggered ( int ) ), this, SLOT ( changeActiveRxWindow ( int ) ) );
-  connect ( p->RxWindow, SIGNAL ( copyCallSign ( QString ) ), this, SIGNAL ( copyCallSign ( QString ) ) );
-  connect ( p->RxWindow, SIGNAL ( copyQTH ( QString ) ), this, SIGNAL ( copyQTH ( QString ) ) );
-  connect ( p->RxWindow, SIGNAL ( copyName ( QString ) ), this, SIGNAL ( copyName ( QString ) ) );
-  connect ( p->RxWindow, SIGNAL ( copyLocator ( QString ) ), this, SIGNAL ( copyLocator ( QString ) ) );
-  connect ( p->RxWindow, SIGNAL ( copyRST ( QString ) ), this, SIGNAL ( copyRST ( QString ) ) );
+  connect ( p->RxWindow, SIGNAL ( setQsoData(QsoData,QString) ), this, SIGNAL ( setQsoData(QsoData,QString) ) );
 
   RxChannel->insertChannel ( p );
   RxHeader->setCurrentIndex ( ID );
-//RxHeader->repaint();
   trigger(); // We should ensure that the triggertext is stored;
   RxHeader->setTabTextColor ( ID, Farbe->at ( ID ) );
 }
@@ -352,24 +240,26 @@ void CRxDisplay::setRxFrequency ( double freq )
 void CRxDisplay::changeActiveRxWindow ( int ID )
 {
 setFocus();
-  if ( settings.ActChannel != 0 )
+CRxChannel *p;
+  p=settings.ActChannel;
+  if ( p != 0 )
   {
-    settings.ActChannel->hide();
-    settings.ActChannel->setQsoData ( settings.QslData ); // Save actual Data to  Channel
-    settings.ActChannel->setAfcMode ( RxFreq->getAfcMode() );
-    if ( settings.ActChannel->getChannel ( ID ) != 0 )
-      settings.ActChannel = settings.ActChannel->getChannel ( ID );
-    settings.QslData = settings.ActChannel->getQsoData();
-    RxFreq->setAfcDisplayMode ( settings.ActChannel->AfcProperties() );
-    RxFreq->setAfcMode ( settings.ActChannel->getAfcMode() );
-    RxFreq->setFrequency ( ( unsigned int ) settings.ActChannel->getRxFrequency() );
-    Squelch->setSquelchState ( settings.ActChannel->getSquelchState() );
-    Squelch->setThreshold ( settings.ActChannel->getThreshold() );
-    Trigger->Activate->setChecked ( settings.ActChannel->RxWindow->getTriggerStatus() );
-    Trigger->TriggerText->setText ( settings.ActChannel->RxWindow->getTriggerText() );
-    Recording->Record->setChecked ( settings.ActChannel->RxWindow->getRecordingState() );
-    calculateSizeofComponents();
-    settings.ActChannel->show();
+    p->hide();
+    p->setQsoData ( settings.QslData ); // Save actual Data to  Channel
+    p->setAfcMode ( RxFreq->getAfcMode() );
+    if ( p->getChannel ( ID ) != 0 )
+      settings.ActChannel = p->getChannel ( ID );
+    p=settings.ActChannel;
+    settings.QslData = p->getQsoData();
+    RxFreq->setAfcDisplayMode ( p->AfcProperties() );
+    RxFreq->setAfcMode ( p->getAfcMode() );
+    RxFreq->setFrequency ( ( unsigned int ) p->getRxFrequency() );
+    Squelch->setSquelchState ( p->getSquelchState() );
+    Squelch->setThreshold ( p->getThreshold() );
+    TriggerText->setText ( p->RxWindow->getTriggerText() );
+    triggerActivate->setChecked(p->RxWindow->getTriggerStatus());
+    recordActivate->setChecked ( p->RxWindow->getRecordingState() );
+    p->show();
     emit newActiveChannel();
     RxHeader->setCurrentIndex ( ID );
   }
@@ -380,6 +270,7 @@ void CRxDisplay::stop_process_loop()
 {
   if ( Sound != 0 )
   {
+    disconnect(Sound,0,0,0);
     Sound->stop();
     Sound->wait();
     Sound->close_Device();
@@ -389,9 +280,8 @@ void CRxDisplay::stop_process_loop()
 }
 void CRxDisplay::trigger()
 {
-
-  settings.ActChannel->RxWindow->activateTrigger ( Trigger->TriggerText->text() );
-  if ( !Trigger->Activate->isChecked() )
+  settings.ActChannel->RxWindow->activateTrigger ( TriggerText->text() );
+  if ( !triggerActivate->isChecked() )
     settings.ActChannel->RxWindow->deactivateTrigger();
 }
 
@@ -413,4 +303,26 @@ void CRxDisplay::newColor()
   for ( int i = 0; i < anzahl; i++ )
     RxHeader->setTabTextColor ( i, Farbe->at ( i ) );
 }
+void CRxDisplay::setAfc(AfcMode mode)
+{
+ RxFreq->setAfcMode ( mode );
+}
+void CRxDisplay::setAfcProperties(AfcMode mode)
+{
+  RxFreq->setAfcDisplayMode ( mode );
+}
 
+AfcMode CRxDisplay::getAfcMode()
+{
+  return RxFreq->getAfcMode();
+}
+void CRxDisplay::record(bool b)
+{
+  settings.ActChannel->record(b);
+}
+void CRxDisplay::stopRecording()
+{
+  //Stop recording for each channel if activated and close file.
+  for ( CRxChannel * p = RxChannel;p != 0;p = p->getNextChannel() )
+    p->record(false);
+}
diff --git a/src/crxdisplay.h b/gui/crxdisplay.h
similarity index 58%
rename from src/crxdisplay.h
rename to gui/crxdisplay.h
index 1e46479..03da03f 100644
--- a/src/crxdisplay.h
+++ b/gui/crxdisplay.h
@@ -21,25 +21,20 @@
 #include "constants.h"
 #include <QList>
 #include <QFrame>
-
 #include <fftw3.h>
 #include "constants.h"
-class QTabBar;
-class CRecording;
-class CRxChannel;
-class CSquelch;
-class CTrigger;
-class FrequencySelect;
-class CRxWindow;
+#include "ui_crxdisplay.h"
+
 class Input;
 class QTimer;
 class QPushButton;
+class CRxChannel;
 
-class CRxDisplay : public QFrame
+class CRxDisplay : public QFrame , private Ui::CRxDisplay
 {
-		Q_OBJECT
+  Q_OBJECT
 
-	public:
+  public:
 		CRxDisplay ( QWidget* parent = 0 );
 		~CRxDisplay();
 		/** Returns the pointer to the values for Calculating the Spectrum **/
@@ -47,65 +42,49 @@ class CRxDisplay : public QFrame
 		bool start_process_loop();
 		void stop_process_loop();
 		void newColor();
-
-		FrequencySelect* RxFreq;
-		CRecording* Recording;
-		CTrigger* Trigger;
-		CSquelch* Squelch;
-		void setColorList ( QList<QColor> * );
-		QTabBar* RxHeader;
-
-	public slots:
+        void setColorList ( QList<QColor> *c );
+        AfcMode getAfcMode();
+        void stopRecording();
+  public slots:
 		/** Starting receiving/transmitting */
 		void addRxWindow ( int Frequency, Mode Modulation, QString Heading );
 		void setRxFrequency ( double );
+        void setAfc(AfcMode mode);
+        void setAfcProperties(AfcMode mode);
 
+  protected:
 
-	protected:
-		virtual void resizeEvent ( QResizeEvent * );
-
-
-	protected slots:
+  protected slots:
 		virtual void languageChange();
 		void process_rxdata();
 		void changeActiveRxWindow ( int );
-		void trigger();
+        void trigger();
 		void clearRxWindow();
-	private:
-		void calculateSizeofComponents();
-		QList<QColor> *Farbe;
+        void record(bool);
+  private:
+    QList<QColor> *Farbe;
 		/**
 		Sound is a pointer to the Input Source, may be a File with
-		Demo Samples (text or wav), or the soundcard ( /dev/audio )
+        Demo Samples (text or wav), or the soundcard
 		**/
-		Input *Sound;
-		QPushButton *Clear;
-		/** Pointer to input Buffer **/
-//  double *inbuf;
-		double inbuf[BUF_SIZE];
-		CRxChannel *RxChannel;
-		/** Decimation Filter to reduce samplerate */
-		void ProcDec2Fir ( double *pIn, double *pOut, int BlockSize );
-		double *dec2fir; // queue for decimation by 2 filter
-//   double *outbuf; // outputbuffer
-		double outbuf[BUF_SIZE];
-		double *m_pDec2InPtr;
-		/** Timer ** for polling the soundcard **/
-		//QTimer *RxTimer;
-//fftw_real* output;
-		double output[BUF_SIZE/2];
-		fftw_plan plan;
+        Input *Sound;
+	/** Pointer to input Buffer **/
+	double inbuf[BUF_SIZE];
+	CRxChannel *RxChannel;
+	/** Decimation Filter to reduce samplerate */
+	void ProcDec2Fir ( double *pIn, double *pOut, int BlockSize );
+	double *dec2fir; // queue for decimation by 2 filter
+	double outbuf[BUF_SIZE];
+	double *m_pDec2InPtr;
+	double output[BUF_SIZE/2];
+	fftw_plan plan;
 
 	signals:
 
-		void startPlotting ( double *, bool );
-		void newActiveChannel();
-		void new_IMD ( float );
-void copyCallSign(QString);
-void copyQTH(QString);
-void copyName(QString);
-void copyLocator(QString);
-void copyRST(QString);
+      void startPlotting ( double *, bool );
+      void newActiveChannel();
+      void new_IMD ( float );
+      void setQsoData(QsoData,QString);
 
 };
 
diff --git a/gui/crxdisplay.ui b/gui/crxdisplay.ui
new file mode 100644
index 0000000..d0b860d
--- /dev/null
+++ b/gui/crxdisplay.ui
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CRxDisplay</class>
+ <widget class="QFrame" name="CRxDisplay">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>636</width>
+    <height>186</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string/>
+  </property>
+  <property name="frameShape">
+   <enum>QFrame::NoFrame</enum>
+  </property>
+  <property name="frameShadow">
+   <enum>QFrame::Plain</enum>
+  </property>
+  <property name="lineWidth">
+   <number>0</number>
+  </property>
+  <layout class="QGridLayout" name="gridLayout" columnstretch="0,0,1" columnminimumwidth="150,0,0">
+   <property name="margin">
+    <number>2</number>
+   </property>
+   <property name="spacing">
+    <number>2</number>
+   </property>
+   <item row="0" column="2">
+    <layout class="QVBoxLayout" name="verticalLayout_2">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="TabWidget" name="RxHeader">
+       <property name="focusPolicy">
+        <enum>Qt::NoFocus</enum>
+       </property>
+       <property name="currentIndex">
+        <number>-1</number>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>546</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="Clear">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>13</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>17</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="text">
+          <string>Clear</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="0">
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <property name="spacing">
+      <number>1</number>
+     </property>
+     <property name="sizeConstraint">
+      <enum>QLayout::SetDefaultConstraint</enum>
+     </property>
+     <item>
+      <widget class="QGroupBox" name="RecordBox">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>30</height>
+        </size>
+       </property>
+       <property name="title">
+        <string/>
+       </property>
+       <layout class="QGridLayout" name="gridLayout_2">
+        <property name="leftMargin">
+         <number>9</number>
+        </property>
+        <property name="topMargin">
+         <number>2</number>
+        </property>
+        <property name="rightMargin">
+         <number>2</number>
+        </property>
+        <property name="bottomMargin">
+         <number>2</number>
+        </property>
+        <item row="0" column="0">
+         <widget class="QRadioButton" name="recordActivate">
+          <property name="text">
+           <string>RecordQso</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+     <item>
+      <widget class="QGroupBox" name="TriggerBox">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>70</height>
+        </size>
+       </property>
+       <property name="title">
+        <string>Trigger</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+       <layout class="QVBoxLayout" name="verticalLayout_3">
+        <property name="spacing">
+         <number>2</number>
+        </property>
+        <property name="topMargin">
+         <number>2</number>
+        </property>
+        <property name="bottomMargin">
+         <number>2</number>
+        </property>
+        <item>
+         <widget class="QLineEdit" name="TriggerText">
+          <property name="minimumSize">
+           <size>
+            <width>0</width>
+            <height>18</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>CQ CQ</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="triggerActivate">
+          <property name="text">
+           <string>Activate</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+     <item>
+      <widget class="FrequencySelect" name="RxFreq">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>70</height>
+        </size>
+       </property>
+       <property name="title">
+        <string>Rx Frequency / AFC</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="1">
+    <widget class="CSquelch" name="Squelch">
+     <property name="minimumSize">
+      <size>
+       <width>80</width>
+       <height>0</height>
+      </size>
+     </property>
+     <property name="title">
+      <string>Squelch</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>FrequencySelect</class>
+   <extends>QGroupBox</extends>
+   <header>frequencyselect.h</header>
+   <container>1</container>
+   <slots>
+    <signal>FrequencyChanged(double)</signal>
+   </slots>
+  </customwidget>
+  <customwidget>
+   <class>CSquelch</class>
+   <extends>QGroupBox</extends>
+   <header>csquelch.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>TabWidget</class>
+   <extends>QTabWidget</extends>
+   <header>tabwidget.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>RxFreq</sender>
+   <signal>FrequencyChanged(double)</signal>
+   <receiver>CRxDisplay</receiver>
+   <slot>setRxFrequency(double)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>79</x>
+     <y>230</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>441</x>
+     <y>140</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>RxHeader</sender>
+   <signal>currentChanged(int)</signal>
+   <receiver>CRxDisplay</receiver>
+   <slot>changeActiveRxWindow(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>561</x>
+     <y>129</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>441</x>
+     <y>140</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>Clear</sender>
+   <signal>clicked()</signal>
+   <receiver>CRxDisplay</receiver>
+   <slot>clearRxWindow()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>833</x>
+     <y>258</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>441</x>
+     <y>140</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>triggerActivate</sender>
+   <signal>clicked()</signal>
+   <receiver>CRxDisplay</receiver>
+   <slot>trigger()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>86</x>
+     <y>161</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>441</x>
+     <y>140</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>TriggerText</sender>
+   <signal>returnPressed()</signal>
+   <receiver>CRxDisplay</receiver>
+   <slot>trigger()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>86</x>
+     <y>133</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>441</x>
+     <y>140</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>recordActivate</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>CRxDisplay</receiver>
+   <slot>record(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>86</x>
+     <y>54</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>441</x>
+     <y>140</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>setRxFrequency(double)</slot>
+  <slot>changeActiveRxWindow(int)</slot>
+  <slot>clearRxWindow()</slot>
+  <slot>trigger()</slot>
+  <slot>record(bool)</slot>
+ </slots>
+</ui>
diff --git a/src/crecording.cpp b/gui/ctxdisplay.cpp
similarity index 58%
rename from src/crecording.cpp
rename to gui/ctxdisplay.cpp
index b433daf..f9dffc5 100644
--- a/src/crecording.cpp
+++ b/gui/ctxdisplay.cpp
@@ -14,31 +14,34 @@
  *   (at your option) any later version.                                   *
  ***************************************************************************/
 
-#include "crecording.h"
-
-#include <qvariant.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include "ctxdisplay.h"
 
 
+#include "cledbutton.h"
+#include "txwindow.h"
+#include "frequencyselect.h"
 /* 
- *  Constructs a CRecording which is a child of 'parent', with the 
+ *  Constructs a CTxDisplay which is a child of 'parent', with the 
  *  name 'name'.' 
  */
-CRecording::CRecording( QWidget* parent )
-    : QGroupBox( parent )
+CTxDisplay::CTxDisplay( QWidget* parent )
+    : QFrame( parent), Ui::CTxDisplay()
 {
+  setupUi(this);
+
+    TxFreq->setFunctionText("Net");
+    TxFreq->setAfcDisplayMode(Narrow);
+    TxFreq->setAfcMode(Narrow);
+    connect(TxFunctions,SIGNAL(startRx()),this,SIGNAL(startRx()));
+    connect(TxFunctions,SIGNAL(startTx()),this,SIGNAL(startTx()));
 
-    Record = new QRadioButton( this);
     languageChange();
 }
 
 /*
  *  Destroys the object and frees any allocated resources
  */
-CRecording::~CRecording()
+CTxDisplay::~CTxDisplay()
 {
     // no need to delete child widgets, Qt does it all for us
 }
@@ -47,30 +50,22 @@ CRecording::~CRecording()
  *  Sets the strings of the subwidgets using the current
  *  language.
  */
-void CRecording::languageChange()
+void CTxDisplay::languageChange()
 {
-
-    Record->setText( tr( "Record QSO" ) );
 }
-void CRecording::resizeEvent( QResizeEvent * )
+void CTxDisplay::resizeEvent( QResizeEvent * )
 {
-calculateSizeofComponents();
-
+TxFunctions->setFixedSize(QSize(height()-20,height()-20));
 }
-
-void CRecording::calculateSizeofComponents()
+void CTxDisplay::abbruch()
 {
-/** Margins **/
-#define LEFTMARGIN 5
-#define TOPMARGIN 30
-int innerwidth,innerheight,xpos,ypos,width,height;
-
-width=this->width();
-height=this->height();
-xpos=width*LEFTMARGIN/100;
-ypos=height*TOPMARGIN/100;
-
-innerwidth=width-2*xpos;
-innerheight=height-3*ypos/2;
-Record->setGeometry(xpos,ypos,innerwidth,innerheight);
+TxFunctions->setStatus(UNDEF);
+}
+void CTxDisplay::insert(QString s)
+{
+ txWindow->insertString(s);
+}
+void CTxDisplay::setTxFocus()
+{
+ txWindow->setFocus();
 }
diff --git a/src/crecording.h b/gui/ctxdisplay.h
similarity index 74%
rename from src/crecording.h
rename to gui/ctxdisplay.h
index 640b640..89f6dfa 100644
--- a/src/crecording.h
+++ b/gui/ctxdisplay.h
@@ -15,32 +15,37 @@
  *   The PSK part is based on WinPSK 1.0 by Moe Wheatley, AE4JY            *
  ***************************************************************************/
 
-#ifndef CRECORDING_H
-#define CRECORDING_H
+#ifndef CTXDISPLAY_H
+#define CTXDISPLAY_H
 
-#include <QGroupBox>
-class QRadioButton;
-class CRecording : public QGroupBox
-{
-    Q_OBJECT
 
-public:
-    CRecording( QWidget* parent = 0);
-    ~CRecording();
+#include <QFrame>
+#include "ui_ctxdisplay.h"
 
-    QRadioButton* Record;
+class CTxDisplay : public QFrame, public Ui::CTxDisplay
 
-public slots:
+{
+    Q_OBJECT
 
-protected:
+public:
+    CTxDisplay( QWidget* parent = 0);
+    ~CTxDisplay();
+    void insert(QString s);
+    void setTxFocus();
+
+  public slots:
+    void abbruch();
+  protected:
     void resizeEvent( QResizeEvent * );
 
 
 protected slots:
     virtual void languageChange();
-private:
-    void calculateSizeofComponents();
+  private:
+  signals:
+    void startRx();
+    void startTx();
 
 };
 
-#endif // CRECORDING_H
+#endif // CTXDISPLAY_H
diff --git a/gui/ctxdisplay.ui b/gui/ctxdisplay.ui
new file mode 100644
index 0000000..8aa8d0c
--- /dev/null
+++ b/gui/ctxdisplay.ui
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CTxDisplay</class>
+ <widget class="QFrame" name="CTxDisplay">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>636</width>
+    <height>100</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Frame</string>
+  </property>
+  <property name="frameShape">
+   <enum>QFrame::StyledPanel</enum>
+  </property>
+  <property name="frameShadow">
+   <enum>QFrame::Raised</enum>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>1</number>
+   </property>
+   <property name="spacing">
+    <number>2</number>
+   </property>
+   <item row="0" column="0">
+    <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
+     <property name="spacing">
+      <number>6</number>
+     </property>
+     <property name="sizeConstraint">
+      <enum>QLayout::SetMinimumSize</enum>
+     </property>
+     <property name="bottomMargin">
+      <number>2</number>
+     </property>
+     <item>
+      <widget class="FrequencySelect" name="TxFreq">
+       <property name="minimumSize">
+        <size>
+         <width>150</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>150</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="title">
+        <string>Tx Freq</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="CLedButton" name="TxFunctions">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>40</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Rx</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="TxWindow" name="txWindow">
+       <property name="frameShape">
+        <enum>QFrame::StyledPanel</enum>
+       </property>
+       <property name="frameShadow">
+        <enum>QFrame::Raised</enum>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>FrequencySelect</class>
+   <extends>QGroupBox</extends>
+   <header>frequencyselect.h</header>
+   <container>1</container>
+   <slots>
+    <signal>FrequencyChanged(double)</signal>
+   </slots>
+  </customwidget>
+  <customwidget>
+   <class>CLedButton</class>
+   <extends>QPushButton</extends>
+   <header>cledbutton.h</header>
+  </customwidget>
+  <customwidget>
+   <class>TxWindow</class>
+   <extends>QFrame</extends>
+   <header>txwindow.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/deletemacro.cpp b/gui/deletemacro.cpp
index 5296127..e9c682a 100644
--- a/gui/deletemacro.cpp
+++ b/gui/deletemacro.cpp
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -18,70 +17,70 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-
 #include "deletemacro.h"
-#include "macros.h"
-//#include <QStringListModel>
+#include "ui_deletemacro.h"
+
 #include "readonlystringlistmodel.h"
-DeleteMacro::DeleteMacro ( Macros *M, QWidget* parent, Qt::WFlags fl )
-		: QDialog ( parent, fl ), Ui::DeleteMacro()
+DeleteMacro::DeleteMacro (QVector<Macro> *macroList, QWidget* parent, Qt::WFlags fl )
+                : QDialog ( parent, fl ),  ui(new Ui::DeleteMacro)
 {
-	setupUi ( this );
-	AllMacros = M;
-//	model = new QStringListModel ( AllMacros->getMacroList() );
-	model = new ReadOnlyStringListModel ( AllMacros->getMacroList() );
-//	deleteList = new QStringListModel ( this );
-	deleteList = new ReadOnlyStringListModel ( this );
-	MacroBox->setModel ( model );
-	Macrostodelete->setModel ( deleteList );
-	connect ( Add, SIGNAL ( clicked ( bool ) ), this, SLOT ( addtoList() ) );
-	connect ( Remove, SIGNAL ( clicked ( bool ) ), this, SLOT ( removefromList() ) );
+  ui->setupUi ( this );
+  mL = macroList;
+  model = new ReadOnlyStringListModel ( );
+  QStringList macroName;
+  int numberofMacros=macroList->size();
+  if (numberofMacros > 0 )
+  for(int i=0; i < numberofMacros;i++)
+    macroName.append((*macroList).at(i).name);
+  model->setStringList(macroName);
+  deleteList = new ReadOnlyStringListModel ( this );
+  ui->MacroBox->setModel ( model );
+  ui->Macrostodelete->setModel ( deleteList );
 }
 
 DeleteMacro::~DeleteMacro()
 {
-	if ( model != 0 )
-		delete model;
-	delete deleteList;
+  if ( model != 0 )
+    delete model;
+  delete deleteList;
+  delete ui;
 }
 
 
 void DeleteMacro::accept()
 {
 
-	QStringList d = deleteList->stringList();
-
-	if ( !d.isEmpty() )
-	{
-		QString s;
-		for ( int i = 0; i < d.size(); i++ )
-		{
-			s = d.at ( i );
-			for ( int k = 0;k < AllMacros->count();k++ )
-			{
-				if ( AllMacros->getMacroName ( k ) == s )
-				{
-					AllMacros->deleteMacro ( k );
-					break;
-				}
-			}
+  QStringList d = deleteList->stringList();
 
-		}
-// Store list to macros ??
+  if ( !d.isEmpty() )
+  {
+    QString s;
+    for ( int i = 0; i < d.size(); i++ )
+    {
+        s = d.at ( i );
+        for ( int k = 0;k < mL->size();k++ )
+        {
+          if ( mL->at ( k ).name == s )
+          {
+            mL->remove ( k ,1);
+            break;
+          }
+        }
+    }
 	}
-	QDialog::accept();
+  QDialog::accept();
 }
 
 void DeleteMacro::addtoList()
 {
-	QStringList l = deleteList->stringList();
-	l << MacroBox->currentIndex().data().toString();
-	deleteList->setStringList ( l );
+  QStringList l = deleteList->stringList();
+  l << ui->MacroBox->currentIndex().data().toString();
+  deleteList->setStringList ( l );
 }
 
 void DeleteMacro::removefromList()
 {
-	deleteList->removeRows ( Macrostodelete->currentIndex().row(), 1 );
+  deleteList->removeRows ( ui->Macrostodelete->currentIndex().row(), 1 );
 }
 
 
diff --git a/gui/deletemacro.h b/gui/deletemacro.h
index c0e6a9b..a35c4ec 100644
--- a/gui/deletemacro.h
+++ b/gui/deletemacro.h
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -22,31 +21,37 @@
 #define DELETEMACRO_H
 
 #include <QDialog>
-#include "ui_deletemacro.h"
-class Macros;
+
+#include "constants.h"
+
+namespace Ui {
+  class DeleteMacro;
+}
 class ReadOnlyStringListModel;
-class DeleteMacro : public QDialog, private Ui::DeleteMacro
+class DeleteMacro : public QDialog
 {
   Q_OBJECT
 
 public:
-  DeleteMacro(Macros *M,QWidget* parent = 0, Qt::WFlags fl = 0 );
+  DeleteMacro(QVector<Macro> *macroList,QWidget* parent = 0, Qt::WFlags fl = 0 );
   ~DeleteMacro();
-  /*$PUBLIC_FUNCTIONS$*/
 
 public slots:
   /*$PUBLIC_SLOTS$*/
 
 protected:
-Macros *AllMacros;
+
 ReadOnlyStringListModel *model;
 ReadOnlyStringListModel *deleteList;
 
 protected slots:
-  /*$PROTECTED_SLOTS$*/
   virtual void          accept();
-void removefromList();
-void addtoList();
+  void removefromList();
+  void addtoList();
+
+private:
+  Ui::DeleteMacro *ui;
+  QVector<Macro> *mL;
 };
 
 #endif
diff --git a/gui/deletemacro.ui b/gui/deletemacro.ui
index d305cb1..9979154 100644
--- a/gui/deletemacro.ui
+++ b/gui/deletemacro.ui
@@ -6,13 +6,13 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>600</width>
-    <height>291</height>
+    <width>415</width>
+    <height>279</height>
    </rect>
   </property>
   <property name="minimumSize">
    <size>
-    <width>300</width>
+    <width>250</width>
     <height>200</height>
    </size>
   </property>
@@ -32,26 +32,71 @@
    <string>Delete Macro</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" colspan="2">
-    <widget class="QLabel" name="MLabel">
-     <property name="minimumSize">
-      <size>
-       <width>80</width>
-       <height>30</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Available Macros</string>
-     </property>
-     <property name="textFormat">
-      <enum>Qt::PlainText</enum>
-     </property>
-     <property name="wordWrap">
-      <bool>false</bool>
-     </property>
-    </widget>
+   <item row="0" column="0" rowspan="5">
+    <layout class="QVBoxLayout" name="verticalLayout_2">
+     <item>
+      <widget class="QLabel" name="MLabel">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>25</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>200</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Available Macros</string>
+       </property>
+       <property name="textFormat">
+        <enum>Qt::PlainText</enum>
+       </property>
+       <property name="wordWrap">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QListView" name="MacroBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>300</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="baseSize">
+        <size>
+         <width>130</width>
+         <height>100</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="verticalSpacer_3">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>88</width>
+         <height>21</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
    </item>
-   <item row="0" column="3">
+   <item row="0" column="1">
     <spacer name="horizontalSpacer_2">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
@@ -64,39 +109,89 @@
      </property>
     </spacer>
    </item>
-   <item row="0" column="4">
-    <widget class="QLabel" name="DMacros">
-     <property name="minimumSize">
-      <size>
-       <width>80</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Macros to be deleted</string>
-     </property>
-     <property name="wordWrap">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0" rowspan="4" colspan="3">
-    <widget class="QListView" name="MacroBox">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="baseSize">
-      <size>
-       <width>130</width>
-       <height>100</height>
-      </size>
-     </property>
-    </widget>
+   <item row="0" column="3" rowspan="5">
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <property name="spacing">
+      <number>6</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="DMacros">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>25</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Macros to be deleted</string>
+       </property>
+       <property name="textFormat">
+        <enum>Qt::PlainText</enum>
+       </property>
+       <property name="wordWrap">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QListView" name="Macrostodelete">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <widget class="QPushButton" name="Ok">
+         <property name="minimumSize">
+          <size>
+           <width>60</width>
+           <height>25</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Delete</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="spacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>13</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="Cancel">
+         <property name="minimumSize">
+          <size>
+           <width>60</width>
+           <height>25</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Cancel</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
    </item>
-   <item row="1" column="3">
+   <item row="1" column="2">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -109,17 +204,7 @@
      </property>
     </spacer>
    </item>
-   <item row="1" column="4" rowspan="4">
-    <widget class="QListView" name="Macrostodelete">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="3">
+   <item row="2" column="1" colspan="2">
     <widget class="QPushButton" name="Add">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -144,7 +229,7 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="3">
+   <item row="3" column="1" colspan="2">
     <widget class="QPushButton" name="Remove">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -154,7 +239,7 @@
      </property>
      <property name="minimumSize">
       <size>
-       <width>120</width>
+       <width>130</width>
        <height>15</height>
       </size>
      </property>
@@ -169,7 +254,7 @@
      </property>
     </widget>
    </item>
-   <item row="4" column="3">
+   <item row="4" column="2">
     <spacer name="verticalSpacer_2">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -182,74 +267,6 @@
      </property>
     </spacer>
    </item>
-   <item row="5" column="0">
-    <widget class="QPushButton" name="Ok">
-     <property name="minimumSize">
-      <size>
-       <width>60</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Ok</string>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="1">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>140</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="5" column="2">
-    <widget class="QPushButton" name="Cancel">
-     <property name="minimumSize">
-      <size>
-       <width>60</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Cancel</string>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="3">
-    <spacer name="horizontalSpacer_3">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>117</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="5" column="4">
-    <spacer name="horizontalSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>208</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
@@ -288,5 +305,41 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>Add</sender>
+   <signal>clicked()</signal>
+   <receiver>DeleteMacro</receiver>
+   <slot>addtoList()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>307</x>
+     <y>134</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>299</x>
+     <y>145</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>Remove</sender>
+   <signal>clicked()</signal>
+   <receiver>DeleteMacro</receiver>
+   <slot>removefromList()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>307</x>
+     <y>160</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>299</x>
+     <y>145</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
+ <slots>
+  <slot>addtoList()</slot>
+  <slot>removefromList()</slot>
+ </slots>
 </ui>
diff --git a/gui/editmacro.cpp b/gui/editmacro.cpp
index 5b478ff..6ee638a 100644
--- a/gui/editmacro.cpp
+++ b/gui/editmacro.cpp
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -18,55 +17,87 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-
 #include "editmacro.h"
-#include "macros.h"
+#include "ui_editmacro.h"
+
 #include "readonlystringlistmodel.h"
+#include <QMessageBox>
 
-EditMacro::EditMacro(Macros *M,QWidget* parent, Qt::WFlags fl)
-: QDialog( parent, fl ), Ui::EditMacro()
+EditMacro::EditMacro(QVector<Macro> *macroList,QStringList tokenList, QWidget* parent, Qt::WFlags fl)
+  : QDialog( parent, fl ), ui(new Ui::EditMacro)
 {
-	setupUi(this);
-AllMacros=M;
-model=new ReadOnlyStringListModel();
-model->setStringList(M->getKeyWordList());
-Keywords->setModel(model);
-int anzahl=AllMacros->count();
+  ui->setupUi(this);
+  mL=macroList;
+  int anzahl=macroList->size();
+  model=new ReadOnlyStringListModel();
+  model->setStringList(tokenList);
+  ui->Keywords->setModel(model);
+
+  ui->Position->setMaximum(anzahl);
+  ui->SelectMacro->insertItem(0,"Choose macro");
+
+  for(int i=0; i < anzahl; i++)
+    ui->SelectMacro->insertItem(i+1,(*macroList).at(i).name);
 
-Position->setMaximum(anzahl);
-SelectMacro->insertItem(0," ");
-connect(SelectMacro,SIGNAL(activated(int)),this,SLOT(setText(int)));
-connect(Keywords,SIGNAL(activated(const QModelIndex &)),this,SLOT(insertKeyword(const QModelIndex &)));
- for(int i=0; i < anzahl; i++)
-  SelectMacro->insertItem(i+1,AllMacros->getMacroName(i));
+  ui->bG->setId(ui->lang0,0);
+  ui->bG->setId(ui->lang1,1);
+  ui->bG->setId(ui->lang2,2);
 }
 
 EditMacro::~EditMacro()
 {
+  delete ui;
 }
 
 void EditMacro::accept()
 {
-int AktPosition;
-AktPosition=SelectMacro->currentIndex()-1;
-AllMacros->setDefinition(Definition->toPlainText(),AktPosition);
-AllMacros->setAccelerator(Accelerator->text(),AktPosition);
+  int aktPosition,newPosition;
+  aktPosition=ui->SelectMacro->currentIndex()-1;
+  if (aktPosition < 0)
+    {
+      QMessageBox::warning(this,"Edit macro","No macro selected \n Select correct macro",
+        QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
+      return;
+    }
+  Macro macro;
+  newPosition=ui->Position->value();
+  macro=(*mL).at(aktPosition);
+  macro.text=ui->Definition->toPlainText();
+  macro.accelerator=ui->Accelerator->text();
+  macro.languageType=ui->bG->checkedId();
+  if(aktPosition < newPosition) // Macro shoul be moved behind
+    {
+      mL->insert(newPosition,macro); //First insert then remove
+      mL->remove(aktPosition);
+    }
+  else if (aktPosition > newPosition) // Macro should be moved forward
+    {
+      mL->remove(aktPosition); // First remove, then insert
+      mL->insert(newPosition,macro);
+    }
+    else
+      mL->replace(aktPosition, macro);
   QDialog::accept();
 }
 
 void EditMacro::setText( int Number)
 {
+  int langType;
 if( Number > 0)
-    { 
+    {
       Number--;
-      Position->setValue(Number);
-      Definition->setText(AllMacros->getDefinition(Number));
-      Accelerator->setText(AllMacros->getAccelerator(Number));
-  } 
+      ui->Position->setValue(Number);
+      ui->Definition->setText((*mL).at(Number).text);
+      ui->Accelerator->setText((*mL).at(Number).accelerator);
+      langType=(*mL).at(Number).languageType;
+      if(langType <0 || langType > 2 ) //Chek range if config file was wrongly modified
+        langType=0;
+      ui->bG->button(langType)->setChecked(true);
+  }
 }
-void EditMacro::insertKeyword(const QModelIndex &index)
+void EditMacro::insertKeyword(QModelIndex index)
 {
  QString s=index.data().toString();
- Definition->insertPlainText(s);
- Definition->setFocus();
+ ui->Definition->insertPlainText(s);
+ ui->Definition->setFocus();
 }
diff --git a/gui/editmacro.h b/gui/editmacro.h
index fdad2b0..8b0a6e3 100644
--- a/gui/editmacro.h
+++ b/gui/editmacro.h
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -22,33 +21,39 @@
 #define EDITMACRO_H
 
 #include <QDialog>
-#include "ui_editmacro.h"
+#include <QModelIndex>
+#include <QStringList>
 
-class Macros;
-class ReadOnlyStringListModel;
+#include "constants.h"
 
+namespace Ui {
+  class EditMacro;
+}
+class ReadOnlyStringListModel;
 
-class EditMacro : public QDialog, private Ui::EditMacro
+class EditMacro : public QDialog
 {
   Q_OBJECT
 
 public:
-  EditMacro(Macros *M,QWidget* parent = 0, Qt::WFlags fl = 0 );
+  EditMacro(QVector<Macro> *macroList,QStringList tokenList,QWidget* parent = 0, Qt::WFlags fl = 0 );
   ~EditMacro();
 
 
 public slots:
-  /*$PUBLIC_SLOTS$*/
 
 protected:
-Macros *AllMacros;
+
 ReadOnlyStringListModel *model;
 
 protected slots:
-  /*$PROTECTED_SLOTS$*/
   virtual void accept();
 void setText( int Number);
-void insertKeyword(const QModelIndex &);
+void insertKeyword(QModelIndex);
+
+private:
+  Ui::EditMacro *ui;
+  QVector<Macro> *mL;
 };
 
 #endif
diff --git a/gui/editmacro.ui b/gui/editmacro.ui
index c5122ed..9098029 100644
--- a/gui/editmacro.ui
+++ b/gui/editmacro.ui
@@ -24,9 +24,20 @@
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0" colspan="2">
-    <widget class="QComboBox" name="SelectMacro"/>
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>Select from list</string>
+     </property>
+    </widget>
    </item>
    <item row="0" column="2">
+    <widget class="QComboBox" name="SelectMacro">
+     <property name="currentIndex">
+      <number>-1</number>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
     <widget class="QLabel" name="textLabel1_3">
      <property name="text">
       <string>Accelerator</string>
@@ -36,10 +47,10 @@
      </property>
     </widget>
    </item>
-   <item row="0" column="3">
+   <item row="0" column="4" colspan="2">
     <widget class="QLineEdit" name="Accelerator"/>
    </item>
-   <item row="0" column="4">
+   <item row="0" column="6">
     <widget class="QLabel" name="textLabel1">
      <property name="text">
       <string>Position</string>
@@ -49,10 +60,10 @@
      </property>
     </widget>
    </item>
-   <item row="0" column="5">
+   <item row="0" column="7">
     <widget class="QSpinBox" name="Position"/>
    </item>
-   <item row="1" column="0" colspan="2">
+   <item row="1" column="0">
     <widget class="QLabel" name="textLabel2">
      <property name="text">
       <string>Definition</string>
@@ -62,7 +73,7 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="4">
+   <item row="1" column="3">
     <widget class="QLabel" name="textLabel1_2">
      <property name="text">
       <string>Keywords</string>
@@ -72,13 +83,68 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="0" colspan="4">
+   <item row="2" column="0" rowspan="2" colspan="3">
     <widget class="QTextEdit" name="Definition"/>
    </item>
-   <item row="2" column="4" colspan="2">
+   <item row="2" column="3" rowspan="2" colspan="2">
     <widget class="QListView" name="Keywords"/>
    </item>
-   <item row="3" column="0">
+   <item row="2" column="5" colspan="3">
+    <widget class="QGroupBox" name="languageSelection">
+     <property name="title">
+      <string>Language selection</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QRadioButton" name="lang0">
+        <property name="text">
+         <string>both</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">bG</string>
+        </attribute>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="lang1">
+        <property name="text">
+         <string>english</string>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">bG</string>
+        </attribute>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="lang2">
+        <property name="text">
+         <string>german</string>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">bG</string>
+        </attribute>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="3" column="6">
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>77</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="4" column="0">
     <widget class="QPushButton" name="buttonOk">
      <property name="text">
       <string>&OK</string>
@@ -94,7 +160,7 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="1" colspan="2">
+   <item row="4" column="1" colspan="2">
     <widget class="QPushButton" name="buttonCancel">
      <property name="text">
       <string>&Cancel</string>
@@ -162,4 +228,7 @@
    </hints>
   </connection>
  </connections>
+ <buttongroups>
+  <buttongroup name="bG"/>
+ </buttongroups>
 </ui>
diff --git a/gui/generalsettings.cpp b/gui/generalsettings.cpp
index 84ecf76..f836772 100644
--- a/gui/generalsettings.cpp
+++ b/gui/generalsettings.cpp
@@ -30,53 +30,52 @@ extern Parameter settings;
 GeneralSettings::GeneralSettings ( QWidget* parent, Qt::WFlags fl )
 		: QDialog ( parent, fl ), Ui::GeneralSettings()
 {
-	setupUi ( this );
-	QString DirectoryName;
-	QDir dir;
-
-	LocalSettings = settings;
-	FileFormat = new QButtonGroup ( FileFormatLayout );
-	FileFormat->setExclusive ( true );
-	FileFormat->addButton ( Wav, 0 );
-	FileFormat->addButton ( Text, 1 );
-
-	if ( LocalSettings.DemoTypeNumber == 0 )
-		Wav->setChecked ( true );
-	else
-		Text->setChecked ( true );
-	Callsign->setText ( LocalSettings.callsign );
-	myLocator->setText ( LocalSettings.myLocator );
-	UTC->setValue ( LocalSettings.timeoffset );
+  setupUi ( this );
+  QString DirectoryName;
+  QDir dir;
+  QString s;
+  LocalSettings = settings;
+  FileFormat = new QButtonGroup ( FileFormatLayout );
+  FileFormat->setExclusive ( true );
+  FileFormat->addButton ( Wav, 0 );
+  FileFormat->addButton ( Text, 1 );
+  if ( LocalSettings.DemoTypeNumber == 0 )
+    Wav->setChecked ( true );
+  else
+    Text->setChecked ( true );
+  Callsign->setText ( LocalSettings.callsign );
+  myLocator->setText ( LocalSettings.myLocator );
+  UTC->setValue ( LocalSettings.timeoffset );
   SlashedZero->setAutoExclusive(false);
-	SlashedZero->setChecked ( LocalSettings.slashed0 );
+  SlashedZero->setChecked ( LocalSettings.slashed0 );
   autoCrLf->setAutoExclusive(false);
   autoCrLf->setChecked(LocalSettings.autoCrLf);
-	QRegExp rx ( "^[A-R][A-R][0-9][0-9][A-X][A-X]$" );
-	QValidator *validator = new QRegExpValidator ( rx, this );
-	myLocator->setValidator ( validator );
-	myLocator->setText ( LocalSettings.myLocator );
-	Demomode->setChecked ( LocalSettings.DemoMode );
-	connect ( Demomode, SIGNAL ( clicked ( bool ) ), this, SLOT ( selectDemomode ( bool ) ) );
-	connect ( AvailableDevices, SIGNAL ( clicked ( const QModelIndex & ) ), this, SLOT ( setPTTDevice ( const QModelIndex & ) ) );
-
-	if ( Demomode->isChecked() )
-		FileFormatLayout->show();
-	else
-		FileFormatLayout->hide();
+  QRegExp rx ( "^[A-R][A-R][0-9][0-9][A-X][A-X]$" );
+  QValidator *validator = new QRegExpValidator ( rx, this );
+  myLocator->setValidator ( validator );
+  myLocator->setText ( LocalSettings.myLocator );
+  Demomode->setChecked ( LocalSettings.DemoMode );
+  connect ( Demomode, SIGNAL ( clicked ( bool ) ), this, SLOT ( selectDemomode ( bool ) ) );
+  connect ( AvailableDevices, SIGNAL ( clicked ( const QModelIndex & ) ), this, SLOT ( setPTTDevice ( const QModelIndex & ) ) );
+
+  if ( Demomode->isChecked() )
+    selectDemomode(true);
+  else
+    selectDemomode(false);
 
 //PTT
-	SelectedDevice->setText ( LocalSettings.SerialDevice );
+  SelectedDevice->setText ( LocalSettings.SerialDevice );
 // First look in the /dev Directory
-	DirectoryName = "/dev/";
+  DirectoryName = "/dev/";
 
-	dir.setPath ( DirectoryName );
-	QStringList filenames;
-	filenames << "ttyS*";
-	QStringList Files = dir.entryList ( filenames, QDir::System | QDir::CaseSensitive, QDir::Name );
+  dir.setPath ( DirectoryName );
+  QStringList filenames;
+  filenames << "ttyS*";
+  QStringList Files = dir.entryList ( filenames, QDir::System | QDir::CaseSensitive, QDir::Name );
 
-	for ( int kk = 0; kk < Files.size(); kk++ )
-		Files.replace ( kk, DirectoryName + Files.at ( kk ) );
-	ReadOnlyStringListModel *m = new ReadOnlyStringListModel ( this );
+  for ( int kk = 0; kk < Files.size(); kk++ )
+    Files.replace ( kk, DirectoryName + Files.at ( kk ) );
+  ReadOnlyStringListModel *m = new ReadOnlyStringListModel ( this );
 	m->setStringList ( Files );
 	AvailableDevices->setModel ( m );
 	AvailableDevices->show();
@@ -89,7 +88,10 @@ GeneralSettings::GeneralSettings ( QWidget* parent, Qt::WFlags fl )
 	for(QStringList::iterator Name=Files.begin();Name !=Files.end(); Name++)
 	 AvailableDevices->insertItem(Directory + *Name);
 	**/
-//Logging
+// Sound Devices
+  soundInputDeviceName->setText(LocalSettings.InputDeviceName);
+  soundOutputDeviceName->setText(LocalSettings.OutputDeviceName);
+ //Logging
 	Directory->setText ( LocalSettings.Directory );
 	QsoFile->setText ( LocalSettings.QSOFileName );
 	fileLog->setChecked ( LocalSettings.fileLog );
@@ -121,7 +123,11 @@ Parameter GeneralSettings::getSettings()
 		LocalSettings.inputFilename = "";
 	}
 	else
+    {
 		LocalSettings.DemoMode = false;
+        LocalSettings.InputDeviceName=soundInputDeviceName->text();
+        LocalSettings.OutputDeviceName=soundOutputDeviceName->text();
+    }
 
 	LocalSettings.timeoffset = UTC->value();
 	if ( SlashedZero->isChecked() )
@@ -153,9 +159,15 @@ LocalSettings.dateFormat=dateFormat->currentText();
 void GeneralSettings::selectDemomode ( bool mode )
 {
 	if ( mode )
-		FileFormatLayout->show();
+    {
+      FileFormatLayout->show();
+      SoundDeviceBox->hide();
+    }
 	else
-		FileFormatLayout->hide();
+    {
+      FileFormatLayout->hide();
+      SoundDeviceBox->show();
+    }
 }
 
 void GeneralSettings::setPTTDevice ( const QModelIndex &index )
@@ -177,4 +189,11 @@ void GeneralSettings::selectLinLogLogging ( bool b )
 	Port->setDisabled ( !b );
 	Host->setDisabled ( !b );
 }
-
+void GeneralSettings::setSampleRate(QString s)
+{
+  LocalSettings.sampleRate=s.toInt();
+}
+void GeneralSettings::setComplexFormat(bool b)
+{
+  LocalSettings.complexFormat=b;
+}
diff --git a/gui/generalsettings.h b/gui/generalsettings.h
index 7344c4b..59070fe 100644
--- a/gui/generalsettings.h
+++ b/gui/generalsettings.h
@@ -47,6 +47,8 @@ void selectDemomode(bool);
 void setPTTDevice(const QModelIndex &);
 void selectFileLogging(bool);
 void selectLinLogLogging(bool);
+void setSampleRate(QString s);
+void setComplexFormat(bool);
 };
 
 #endif
diff --git a/gui/generalsettings.ui b/gui/generalsettings.ui
index a442d09..47ea3d5 100644
--- a/gui/generalsettings.ui
+++ b/gui/generalsettings.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>650</width>
-    <height>392</height>
+    <height>383</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -37,7 +37,7 @@
   <property name="sizeGripEnabled">
    <bool>true</bool>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
+  <layout class="QGridLayout" name="gridLayout_2">
    <item row="0" column="0">
     <widget class="QLabel" name="CallsignL">
      <property name="frameShape">
@@ -137,19 +137,6 @@
      </property>
     </spacer>
    </item>
-   <item row="2" column="4" colspan="2">
-    <spacer name="horizontalSpacer_2">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>115</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item row="2" column="0" colspan="3">
     <widget class="QRadioButton" name="SlashedZero">
      <property name="font">
@@ -176,6 +163,19 @@
      </property>
     </spacer>
    </item>
+   <item row="2" column="4" colspan="2">
+    <spacer name="horizontalSpacer_2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>115</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
    <item row="3" column="0" colspan="3">
     <widget class="QRadioButton" name="autoCrLf">
      <property name="enabled">
@@ -265,130 +265,165 @@
      <property name="title">
       <string>PTT Device</string>
      </property>
-     <widget class="QListView" name="AvailableDevices">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>20</y>
-        <width>131</width>
-        <height>94</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="SelectedDevice">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>120</y>
-        <width>131</width>
-        <height>21</height>
-       </rect>
-      </property>
-     </widget>
+     <layout class="QVBoxLayout" name="verticalLayout_5">
+      <item>
+       <widget class="QListView" name="AvailableDevices"/>
+      </item>
+      <item>
+       <widget class="QLineEdit" name="SelectedDevice"/>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="4" column="4" colspan="2">
+   <item row="4" column="4" rowspan="2" colspan="2">
     <widget class="QGroupBox" name="groupBox_3">
      <property name="title">
       <string>Logging</string>
      </property>
-     <layout class="QHBoxLayout" name="horizontalLayout">
-      <item>
-       <layout class="QVBoxLayout" name="verticalLayout_3">
-        <item>
-         <widget class="QRadioButton" name="fileLog">
-          <property name="text">
-           <string>Log to File</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
-          </property>
-          <property name="autoExclusive">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="label">
-          <property name="text">
-           <string>Working Directory</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="Directory"/>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_2">
-          <property name="text">
-           <string>Filename</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="QsoFile">
-          <property name="text">
-           <string>QSO.adif</string>
-          </property>
-          <property name="cursorPosition">
-           <number>0</number>
-          </property>
-         </widget>
-        </item>
-       </layout>
+     <layout class="QGridLayout" name="gridLayout_3">
+      <item row="0" column="0">
+       <widget class="QGroupBox" name="groupBox_4">
+        <property name="title">
+         <string>File logging</string>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout_3">
+         <item>
+          <widget class="QRadioButton" name="fileLog">
+           <property name="text">
+            <string>Log to File</string>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+           <property name="autoExclusive">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Working Directory</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="Directory"/>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Filename</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="QsoFile">
+           <property name="text">
+            <string>QSO.adif</string>
+           </property>
+           <property name="cursorPosition">
+            <number>8</number>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
       </item>
-      <item>
-       <layout class="QVBoxLayout" name="verticalLayout_4">
-        <item>
-         <widget class="QRadioButton" name="LinLog">
-          <property name="text">
-           <string>Log to LinLog</string>
-          </property>
-          <property name="autoExclusive">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_4">
-          <property name="text">
-           <string>LinLog Host Name</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="Host">
-          <property name="text">
-           <string>localhost</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_5">
-          <property name="text">
-           <string>Port</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QSpinBox" name="Port">
-          <property name="minimum">
-           <number>1024</number>
-          </property>
-          <property name="maximum">
-           <number>64000</number>
-          </property>
-          <property name="value">
-           <number>8080</number>
-          </property>
-         </widget>
-        </item>
-       </layout>
+      <item row="0" column="1">
+       <widget class="QGroupBox" name="groupBox_5">
+        <property name="title">
+         <string>LinLog logging</string>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout_4">
+         <item>
+          <widget class="QRadioButton" name="LinLog">
+           <property name="text">
+            <string>Log to LinLog</string>
+           </property>
+           <property name="autoExclusive">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>LinLog Host Name</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="Host">
+           <property name="text">
+            <string>localhost</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_5">
+           <property name="text">
+            <string>Port</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QSpinBox" name="Port">
+           <property name="minimum">
+            <number>1024</number>
+           </property>
+           <property name="maximum">
+            <number>64000</number>
+           </property>
+           <property name="value">
+            <number>8080</number>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="5" column="0" colspan="4">
+    <widget class="QGroupBox" name="SoundDeviceBox">
+     <property name="title">
+      <string>Sound Device</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="1" column="1">
+       <widget class="QLineEdit" name="soundOutputDeviceName">
+        <property name="text">
+         <string>LinPSK_Play</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_7">
+        <property name="text">
+         <string>Input card or device</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QLineEdit" name="soundInputDeviceName">
+        <property name="text">
+         <string>LinPSK_Record</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_8">
+        <property name="text">
+         <string>Output card or device</string>
+        </property>
+       </widget>
       </item>
      </layout>
     </widget>
    </item>
-   <item row="5" column="0" colspan="2">
+   <item row="6" column="0" colspan="2">
     <widget class="QPushButton" name="buttonOk">
      <property name="minimumSize">
       <size>
@@ -416,7 +451,20 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="2" colspan="2">
+   <item row="6" column="4" colspan="2">
+    <spacer name="horizontalSpacer_3">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>115</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="6" column="2">
     <widget class="QPushButton" name="buttonCancel">
      <property name="minimumSize">
       <size>
@@ -447,14 +495,14 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="4" colspan="2">
-    <spacer name="horizontalSpacer_3">
+   <item row="6" column="3">
+    <spacer name="horizontalSpacer_8">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
-       <width>115</width>
+       <width>40</width>
        <height>20</height>
       </size>
      </property>
@@ -509,4 +557,7 @@
    </hints>
   </connection>
  </connections>
+ <slots>
+  <slot>setSampleRate(QString)</slot>
+ </slots>
 </ui>
diff --git a/gui/gui.pro b/gui/gui.pro
index 3ba1598..fb68977 100644
--- a/gui/gui.pro
+++ b/gui/gui.pro
@@ -1,3 +1,15 @@
+CONFIG(debug, debug|release) {
+    QMAKE_CXXFLAGS_DEBUG += -g3 \
+    -fpermissive \
+    -O0
+CONFIG +=  debug
+} else {
+    DEFINES += QT_NO_DEBUG
+    DEFINES += QT_NO_DEBUG_OUTPUT
+    QMAKE_CXXFLAGS_DEBUG +=-fpermissive \
+    -O2
+}
+
 FORMS += addmacro.ui \
 addrxwindow.ui \
 deletemacro.ui \
@@ -5,7 +17,14 @@ editmacro.ui \
 generalsettings.ui \
 modemenu.ui \
 qsodata.ui \
-renamemacro.ui
+renamemacro.ui \
+    controlpanel.ui \
+    linpsk.ui \
+    crxdisplay.ui \
+    spectrumdisplay.ui \
+    ctxdisplay.ui \
+    macrocontrol.ui \
+    txwindow.ui
 
 CONFIG += build_all \
  staticlib \
@@ -20,7 +39,14 @@ SOURCES += generalsettings.cpp \
  modemenu.cpp \
  qsodata.cpp \
  renamemacro.cpp \
- editmacro.cpp
+ editmacro.cpp \
+    controlpanel.cpp \
+    linpsk.cpp \
+    crxdisplay.cpp \
+    spectrumdisplay.cpp \
+    ctxdisplay.cpp \
+    macrocontrol.cpp \
+    txwindow.cpp
 
 HEADERS += generalsettings.h \
  addmacro.h \
@@ -29,20 +55,22 @@ HEADERS += generalsettings.h \
  modemenu.h \
  qsodata.h \
  renamemacro.h \
- editmacro.h
+ editmacro.h \
+    controlpanel.h \
+    linpsk.h \
+    crxdisplay.h \
+    spectrumdisplay.h \
+    ctxdisplay.h \
+    macrocontrol.h \
+    txwindow.h
 
 
 TEMPLATE = lib
 
-QMAKE_CXXFLAGS_DEBUG += -g3 \
--O0
-QMAKE_CXXFLAGS_RELEASE += -O2
-
-
-CONFIG -= debug
-
-
 QT += network
 
 INCLUDEPATH += ../src
 
+RESOURCES += \
+    ../src/application.qrc
+
diff --git a/src/linpsk.cpp b/gui/linpsk.cpp
similarity index 59%
rename from src/linpsk.cpp
rename to gui/linpsk.cpp
index 53344e0..4e54eab 100644
--- a/src/linpsk.cpp
+++ b/gui/linpsk.cpp
@@ -40,16 +40,13 @@
 #include "csound.h"
 #include "generalsettings.h"
 #include "modemenu.h"
-#include "macrowindow.h"
 #include "addmacro.h"
 #include "deletemacro.h"
-#include "macros.h"
 #include "qsodata.h"
 #include "editmacro.h"
 #include "deletemacro.h"
 #include "renamemacro.h"
 #include "color.h"
-#include "crecording.h"
 
 
 #include <QtGui>
@@ -58,7 +55,7 @@
 #ifdef HAVE_CONFIG
 #include "config.h"
 #else
-#define VERSION "1.1"
+#define VERSION "1.2"
 #endif
 
 
@@ -71,17 +68,16 @@ extern Parameter settings;
  *
  */
 LinPSK::LinPSK ( QWidget* parent, Qt::WFlags fl )
-    : QMainWindow ( parent, fl )
+  : QMainWindow ( parent, fl ), Ui::LinPSK()
 {
-  RxDisplay = 0;
-  TxDisplay = 0;
-  Control = 0;
   Sound = 0;
+  Modulator = 0;
+  inAction=false;
   SaveParameters = new Parameter();
 
-  Macro = new Macros(); // Macros will be used in read_config
+  setupUi(this);
   read_config();
-
+  Control->enableSaveData();
   if ( settings.ApplicationFont == 0 )
   {
     settings.ApplicationFont = new QFont ( qApp->font().family() );
@@ -96,33 +92,29 @@ LinPSK::LinPSK ( QWidget* parent, Qt::WFlags fl )
 
   if ( WindowColors.size() == 0 )
     WindowColors << color[0] ;
-  Modulator = 0;
-  setCentralWidget ( new QWidget ( this ) );
-  centralWidget()->setMinimumSize ( settings.MinimumWindowWidth, settings.MinimumWindowHeight );
   setWindowTitle ( QString ( ProgramName ) + QString ( VERSION ) );
   setWindowIcon ( QIcon ( ":/images/linpsk.png" ) );
 // Create Statusbar
-  QStatusBar *StatusBar = this->statusBar();
-  StatusBar->setSizeGripEnabled ( true );
+  statusBar()->setFixedHeight(18);
+  statusbar->setSizeGripEnabled ( true );
 
 
 //Messages
-  msg = new QLabel ( StatusBar );
-  StatusBar->addPermanentWidget ( msg, 2 );
+  msg = new QLabel ( );
+  statusbar->addPermanentWidget ( msg, 2 );
   msg->setText ( tr ( "Ready" ) );
 
 // IMD
-  IMD = new QLabel ( StatusBar );
-  StatusBar -> addPermanentWidget ( IMD, 1 );
-
+  IMD = new QLabel ( statusbar );
+  statusbar -> addPermanentWidget ( IMD, 1 );
 
 // Time
-  zeit = new QLabel ( StatusBar );
-  StatusBar->addPermanentWidget ( zeit, 1 );
+  zeit = new QLabel ( statusbar );
+  statusbar->addPermanentWidget ( zeit, 1 );
 
 // date
-  datum = new QLabel ( StatusBar );
-  StatusBar ->addPermanentWidget ( datum, 1 );
+  datum = new QLabel ( statusbar );
+  statusbar ->addPermanentWidget ( datum, 1 );
   setclock();
 
 // Let the time pass
@@ -130,112 +122,31 @@ LinPSK::LinPSK ( QWidget* parent, Qt::WFlags fl )
   connect ( clock, SIGNAL ( timeout() ), SLOT ( setclock() ) );
   clock->start ( 60000 );
 
-  RxDisplay = new CRxDisplay ( centralWidget() );
-  TxDisplay = new CTxDisplay ( centralWidget() );
-
-  Control = new ControlPanel ( Macro, centralWidget() );
-  RxDisplay->RxFreq->setAfcDisplayMode ( settings.ActChannel->AfcProperties() );
-  RxDisplay->RxFreq->setAfcMode ( settings.ActChannel->getAfcMode() );
+  RxDisplay->setAfcProperties(settings.ActChannel->AfcProperties());
+  RxDisplay->setAfc(settings.ActChannel->getAfcMode());
   RxDisplay->setColorList ( &WindowColors );
-  connect ( RxDisplay, SIGNAL ( copyCallSign ( QString ) ), Control->QSO, SLOT ( copyCallSign ( QString ) ) );
-  connect ( RxDisplay, SIGNAL ( copyQTH ( QString ) ), Control->QSO, SLOT ( copyQTH ( QString ) ) );
-  connect ( RxDisplay, SIGNAL ( copyName ( QString ) ), Control->QSO, SLOT ( copyName ( QString ) ) );
-  connect ( RxDisplay, SIGNAL ( copyLocator ( QString ) ), Control->QSO, SLOT ( copyLocator ( QString ) ) );
-  connect ( RxDisplay, SIGNAL ( copyRST ( QString ) ), Control->QSO, SLOT ( copyRST ( QString ) ) );
 
   settings.QslData = settings.ActChannel->getQsoData();
-  Control->Display->setPhasePointer ( settings.ActChannel->getPhasePointer() );
-
-  Control->Display->setColorList ( &WindowColors );
-  //Control->MacroBox->updateMacroWindow ( Macro );
-  // menubar
-  menubar = menuBar();
-// File Menu
-  fileMenu =  menubar->addMenu ( tr ( "File" ) );
-  // Settings Menu
-
-  editMenu =  menubar->addMenu ( tr ( "Settings" ) );
-
-  menubar->addSeparator();
-//=======
-  changeRxParams =  menubar->addMenu ( tr ( "RxParams" ) );
-  helpMenu =  menubar->addMenu ( tr ( "Help" ) );
-  QAction *A;
-  // File Menu
-  // ================= File Actions ========
-  A = fileMenu->addAction ( tr ( "Open Demo File" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( fileOpen() ) );
-  A = fileMenu->addAction ( tr ( "add RxWindow" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( addRxWindow() ) );
-
-  fileMenu->addSeparator();
-  fileMenu->addSeparator();
-
-  A = fileMenu->addAction ( tr ( "Exit" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( Exit() ) );
-
-// Settings Menu
-  // ================= Settings Actions=================
-  A = editMenu->addAction ( tr ( "General_Settings" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( generalSettings() ) );
-  editMenu->addSeparator();
-  A = editMenu->addAction ( tr ( "Add Macros" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( addMacro() ) );
-  A = editMenu->addAction ( tr ( "Edit Macros" ) );
-  connect ( A , SIGNAL ( activated() ), this, SLOT ( editMacro() ) );
-  A = editMenu->addAction ( tr ( "Delete Macros" ) );
-  connect ( A  , SIGNAL ( activated() ), this, SLOT ( deleteMacro() ) );
-  A = editMenu->addAction ( tr ( "Rename Macros" ) );
-  connect ( A  , SIGNAL ( activated() ), this, SLOT ( renameMacro() ) );
-//===============================================================================
-  A = editMenu->addSeparator();
-
-  A = editMenu->addAction ( tr ( "Font Settings" ) );
-  connect ( A   , SIGNAL ( activated() ), this, SLOT ( FontSetup() ) );
-  A = editMenu->addAction ( tr ( "ColorSettings" ) );
-  connect ( A , SIGNAL ( activated() ), this, SLOT ( chooseColor() ) );
-  editMenu->addSeparator();
-
-  A = editMenu->addAction ( tr ( "Save Settings" ) );
-  connect ( A  , SIGNAL ( activated() ), this, SLOT ( saveSettings() ) );
-  // Menu Rx Settings
-  //================Actions for RX Window ===========
-  A = changeRxParams->addAction ( tr ( "Change Rx Mode" ) );
-  connect ( A , SIGNAL ( activated() ), this, SLOT ( setRxMode() ) );
-// A= changeRxParams->addAction(tr( " ???") );
-// connect ( A , SIGNAL ( activated() ), settings.ActChannel, SLOT ( clearRxWindow() ) );
-//Help Menu
-  // ================= Help Actions =========
-  A = helpMenu->addAction ( tr ( "helpContentsAction" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( helpIndex() ) );
-  A = helpMenu->addAction ( tr ( "helpIndexAction" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( helpContents() ) );
-  A = helpMenu->addAction ( tr ( "helpAboutAction" ) );
-  connect ( A, SIGNAL ( activated() ), this, SLOT ( helpAbout() ) );
-
+  Control->setPhasePointer ( settings.ActChannel->getPhasePointer() );
 
+  Control->setColorList ( &WindowColors );
   languageChange();
 
-  // signals and slots connections
-
-//================================= Rx Parames ===================
-//================================================================
-  connect ( TxDisplay, SIGNAL ( startRx() ), this, SLOT ( startRx() ) );
-  connect ( TxDisplay, SIGNAL ( startTx() ), this, SLOT ( startTx() ) );
-  connect ( Macro, SIGNAL ( StartRx() ), this, SLOT ( startRx() ) );
-  connect ( Macro, SIGNAL ( StartTx() ), this, SLOT ( startTx() ) );
-
-  connect ( RxDisplay, SIGNAL ( startPlotting ( double *, bool ) ), Control->Display, SLOT ( startPlot ( double *, bool ) ) );
-  connect ( Control->Display, SIGNAL ( FrequencyChanged ( double ) ), RxDisplay->RxFreq, SLOT ( setFrequency ( double ) ) );
-  connect ( RxDisplay, SIGNAL ( new_IMD ( float ) ), this, SLOT ( setIMD ( float ) ) );
-  connect ( Control->MacroBox, SIGNAL ( callMacro ( int ) ), this, SLOT ( executeMacro ( int ) ) );
-  connect ( RxDisplay, SIGNAL ( newActiveChannel() ), this, SLOT ( setChannelParams() ) );
-  connect ( RxDisplay->Recording->Record, SIGNAL ( toggled ( bool ) ), this, SLOT ( recording ( bool ) ) );
+// signals and slots connections
+//========== Macro Processing ======================================
+  tokenList << "@CALLSIGN@" << "@DATE@" << "@Replace by filename@" << "@RX@" << "@THEIRCALL@" << "@THEIRNAME@" << "@TIMELOCAL@" << "@TIMEUTC@" << "@TX@" << "@RSTGIVEN@" << "@RSTRCVD@";
+  Control->insertMacros( &macroList );
+//  connect(Control,SIGNAL(executeMacro(int)),this,SLOT(executeMacro(int)));
+
+  connect ( this, SIGNAL ( StartRx() ), this, SLOT ( startRx() ) );
+  connect ( this, SIGNAL ( StartTx() ), this, SLOT ( startTx() ) );
+
 //===================================================================
 
   TxBuffer = new CTxBuffer();
-  TxDisplay->TxWindow->setTxBuffer ( TxBuffer );
+
   apply_settings();
+  TxDisplay->txWindow->setTxBuffer ( TxBuffer );
 
 }
 
@@ -263,12 +174,12 @@ void LinPSK::languageChange()
       fileExitAction->setMenuText( tr( "E&xit" ) );
       fileExitAction->setAccel( QString::null );
   // Help
-      helpContentsAction->setText( tr( "Contents" ) );
-      helpContentsAction->setMenuText( tr( "&Contents..." ) );
-      helpContentsAction->setAccel( QString::null );
-      helpIndexAction->setText( tr( "Index" ) );
-      helpIndexAction->setMenuText( tr( "&Index..." ) );
-      helpIndexAction->setAccel( QString::null );
+///      helpContentsAction->setText( tr( "Contents" ) );
+///      helpContentsAction->setMenuText( tr( "&Contents..." ) );
+///      helpContentsAction->setAccel( QString::null );
+///      helpIndexAction->setText( tr( "Index" ) );
+///      helpIndexAction->setMenuText( tr( "&Index..." ) );
+///      helpIndexAction->setAccel( QString::null );
       helpAboutAction->setText( tr( "About" ) );
       helpAboutAction->setMenuText( tr( "&About" ) );
       helpAboutAction->setAccel( QString::null );
@@ -323,15 +234,14 @@ void LinPSK::Exit()
   }
 }
 
-void LinPSK::helpIndex()
-{}
-
-void LinPSK::helpContents()
-{}
-
 void LinPSK::helpAbout()
-{}
-
+{
+QMessageBox::about(this, QString(tr("About LinPsk")), QString(tr("<h3>About LinPsk</h3><p><a href=\"http://linpsk.sf.net/\">LinPsk</a> is a PSK31 program for Linux by Volker Schroer, DL1KSV. It supports some other digital modes and is developed  under GPL <br/>( Read the file COPYING contained in the distribution for more information )</p>")));
+}
+void LinPSK::helpAboutQt()
+{
+  QMessageBox::aboutQt(this);
+}
 
 void LinPSK::addRxWindow()
 {
@@ -339,7 +249,8 @@ void LinPSK::addRxWindow()
   if ( Channel->exec() != 0 )
   {
     AfcMode modus;
-    modus = RxDisplay->RxFreq->getAfcMode();
+//    modus = RxDisplay->RxFreq->getAfcMode();
+    modus = RxDisplay->getAfcMode();
     settings.ActChannel->setAfcMode ( modus );
     Mode rxmode = ( Mode ) Channel->selectedMode();
     if ( WindowColors.size() <= settings.RxChannels )
@@ -349,59 +260,11 @@ void LinPSK::addRxWindow()
 
     settings.ActChannel->setWindowColor ( WindowColors.at ( settings.RxChannels ) );
     settings.RxChannels++;
-    RxDisplay->RxFreq->setAfcDisplayMode ( settings.ActChannel->AfcProperties() );
+    RxDisplay->setAfcProperties( settings.ActChannel->AfcProperties() );
   }
 
 }
 
-
-
-void LinPSK::calculateSizeofComponents()
-{
-  /** Anteile in percent of mainwindow **/
-  /** RXDisplay **/
-#define RXPART 36
-  /** TXDisplay **/
-#define TXPART 20
-  /** Controlpanel **/
-#ifndef LINPSK_FOR_MAC
-#define CONTROLPART 37
-#else
-#define CONTROLPART 40
-#endif
-  
-  int width, height;
-  int xpos, ypos;
-  int windowsheight;
-
-  width = this->width();
-  height = this->height();
-
-  xpos = 0;
-  ypos = 0;;
-  windowsheight = height * RXPART / 100;
-  if ( RxDisplay != 0 )
-    RxDisplay->setGeometry ( xpos, ypos, width, windowsheight );
-
-  ypos = ypos + windowsheight;
-  windowsheight = height * TXPART / 100;
-  if ( TxDisplay != 0 )
-    TxDisplay->setGeometry ( xpos, ypos, width, windowsheight );
-  ypos = ypos + windowsheight;
-
-  windowsheight = height * CONTROLPART / 100;
-  if ( Control != 0 )
-    Control->setGeometry ( xpos, ypos, width, windowsheight );
-}
-
-
-
-void LinPSK::resizeEvent ( QResizeEvent * )
-{
-  calculateSizeofComponents();
-}
-
-
 void LinPSK::setclock()
 {
   QString s;
@@ -427,12 +290,18 @@ void LinPSK::setIMD ( float IMDvalue )
 }
 void LinPSK::startRx()
 {
-  if ( Modulator != 0 )
+  if(inAction)
+    return;
+  inAction=true;
+  if ( Modulator != 0 && !settings.DemoMode)
   {
     TxBuffer->insert ( TXOFF_CODE );
-    if ( Sound > 0 )  // Switch Trx to rx
-      while ( Sound->isRunning() ) // Wait for buffer to be cleared
-        qApp->processEvents ( QEventLoop::AllEvents, 100 );
+    if ( Sound != NULL )  // Switch Trx to rx
+      {
+        msg->setText ( tr ( "Switching to receive" ) );
+        while ( Sound->isRunning() ) // Wait for buffer to be cleared
+          qApp->processEvents ( QEventLoop::AllEvents, 100 );
+      }
   }
   if ( RxDisplay->start_process_loop() )
   {
@@ -466,9 +335,10 @@ void LinPSK::startRx()
   }
   else
     TxDisplay->TxFunctions->setStatus ( UNDEF );
-  Control->Display->show();
+  Control->display();
   settings.Status = TxDisplay->TxFunctions->getstatus();
-TxDisplay->TxWindow->setFocus();
+  TxDisplay->txWindow->setFocus();
+  inAction=false;
 }
 
 void LinPSK::startTx()
@@ -517,7 +387,7 @@ void LinPSK::startTx()
       Info = "BPSK";
       break;
   }
-  if ( Sound <= 0 ) // Only create Sound Device once for output
+  if ( Sound <= NULL ) // Only create Sound Device once for output
   {
     if ( settings.DemoMode )
     {
@@ -531,14 +401,14 @@ void LinPSK::startTx()
       Sound = new CSound ( settings.serial );
     connect ( Sound, SIGNAL ( samplesAvailable() ), this, SLOT ( process_txdata() ) );
   }
-  if ( Sound <= 0 )
+  if ( Sound <= NULL )
   {
     QMessageBox::critical ( 0, " Programm Error! LinPsk", "Could not create Sound Device for Output" );
     TxDisplay->TxFunctions->setStatus ( ON );
     return;
   }
 
-  if ( Sound->open_Device_write ( &errorstring ) < 0 )
+  if ( !Sound->open_Device_write ( &errorstring ) )
   {
     QMessageBox::information ( 0, ProgramName, errorstring );
     stopTx();
@@ -548,9 +418,9 @@ void LinPSK::startTx()
   connect ( Modulator, SIGNAL ( charSend ( char ) ), settings.ActChannel, SLOT ( updateRx ( char ) ) );
   TxDisplay->TxFunctions->setStatus ( ON );
   msg->setText ( tr ( "Transmitting " ) + Info );
-  TxDisplay->TxWindow->setFocus();
+  TxDisplay->txWindow->setFocus();
   settings.Status = TxDisplay->TxFunctions->getstatus();
-  Control->Display->hide();
+  Control->undisplay();
 
   Txcount = BUF_SIZE;
 //  process_txdata(); // Generate first Sample
@@ -645,8 +515,8 @@ void LinPSK::apply_settings()
 }
 void LinPSK::setChannelParams()
 {
-  Control->Display->setPhasePointer ( settings.ActChannel->getPhasePointer() );
-  Control->QSO->newChannel();
+  Control->setPhasePointer ( settings.ActChannel->getPhasePointer() );
+  Control->newChannel();
   if ( settings.ActChannel != 0 )
   {
     QString Info;
@@ -671,7 +541,7 @@ void LinPSK::setChannelParams()
       default:
         Info = "undefined";
     }
-    RxDisplay->RxFreq->setAfcDisplayMode ( settings.ActChannel->AfcProperties() );
+    RxDisplay->setAfcProperties( settings.ActChannel->AfcProperties() );
     msg->setText ( tr ( "Receiving " ) + Info );
   }
 }
@@ -680,6 +550,8 @@ void LinPSK::setRxMode()
   QString Info;
   ModeMenu Menu ;
   ExtraParameter *Param;
+  ExtraParameter parameter;
+
   Param = ( ExtraParameter * ) settings.ActChannel->getParameter ( Extra );
   if ( Param != 0 )
     Menu.setParameter ( *Param );
@@ -687,10 +559,11 @@ void LinPSK::setRxMode()
   {
     Mode rxmode = ( Mode ) Menu.selectedMode();
     settings.ActChannel->setMode ( rxmode );
-    RxDisplay->RxFreq->setAfcDisplayMode ( settings.ActChannel->AfcProperties() );
-    RxDisplay->RxFreq->setAfcMode ( settings.ActChannel->getAfcMode() );
-    Control->Display->setPhasePointer ( settings.ActChannel->getPhasePointer() );
-    settings.ActChannel->setParameter ( Extra, &Menu.getParameter() );
+    RxDisplay->setAfcProperties( settings.ActChannel->AfcProperties() );
+    RxDisplay->setAfc ( settings.ActChannel->getAfcMode() );
+    Control->setPhasePointer ( settings.ActChannel->getPhasePointer() );
+    parameter= Menu.getParameter();
+    settings.ActChannel->setParameter ( Extra, &parameter );
   }
   if ( settings.ActChannel != 0 )
     switch ( settings.ActChannel->getModulationType() )
@@ -710,7 +583,11 @@ void LinPSK::setRxMode()
       case MFSK16:
         Info = "MFSK16";
         break;
-
+/* RIP 
+    case RTTY2:
+        Info = "RTTY2";
+        break;
+*/
       default:
         Info = "undefined";
     }
@@ -720,7 +597,7 @@ void LinPSK::setRxMode()
 
 void LinPSK::save_config()
 {
-  int i;
+  int i,size;
   QSettings config ( "DL1KSV", "LinPSK" );
   /** Windows Parameter **/
   config.beginGroup ( "WindowsParameter" );
@@ -732,6 +609,8 @@ void LinPSK::save_config()
   config.setValue ( "WindowHeight", height() );
   config.setValue ( "FontName", qApp->font().family() );
   config.setValue ( "FontSize",  qApp->font().pointSize() );
+  config.setValue ("ControlSplitter",Control->controlSplitterState());
+  config.setValue ("SpectrumSplitter",Control->spectrumSplitterState());
   config.endGroup();
   /** DemoMode **/
   config.setValue ( "DemoMode", settings.DemoMode );
@@ -769,70 +648,206 @@ void LinPSK::save_config()
     }
     config.endArray();
   }
-// Macros
-  if ( ( Macro->count() > 0 ) )
+  // Macros
+   size=macroList.size();
+   if ( size > 0 )
+   {
+     config.beginWriteArray ( "Macros" );
+     for ( i = 0; i < size;i++ )
+     {
+       config.setArrayIndex ( i );
+       config.setValue ( "Name", macroList.at( i ).name );
+       config.setValue ( "Definition", macroList.at(i).text );
+       config.setValue ( "Accelerator", macroList.at (i ).accelerator );
+       config.setValue ("Language",macroList.at( i ).languageType);
+     }
+     config.endArray();
+   }
+
+  // SoundDevices
+   config .beginGroup("SoundDevices");
+   config.setValue("InputDeviceName",settings.InputDeviceName);
+   config.setValue("sampleRate",settings.sampleRate);
+   config.setValue("OutputDeviceName",settings.OutputDeviceName);
+   config.setValue("ComplexFormat",settings.complexFormat);
+   config.endGroup();
+}
+
+void LinPSK::executeMacro ( int id )
+{
+//  qDebug("Execute macro %d",id);
+  QString macro = macroList.at(id).text;
+  QString Token;
+  QFile *MacroFile;
+  int i,anzahl;
+  bool switchtoRx=false;
+  anzahl = macro.count ( '@' ) / 2;
+  if ( anzahl > 0 )
   {
-    config.beginWriteArray ( "Macros" );
-    for ( i = 0; i < Macro->count();i++ )
+    int indexbis, indexvon = 0;
+    for (  i = 0; i < anzahl; i++ )
     {
-      config.setArrayIndex ( i );
-      config.setValue ( "Name", Macro->getMacroName ( i ) );
-      QString s = Macro->getDefinition ( i );
-      config.setValue ( "Definition", s );
-      config.setValue ( "Accelerator", Macro->getAccelerator ( i ) );
-    }
-    config.endArray();
-  }
+      indexbis = macro.indexOf ( '@', indexvon );
+      indexvon = indexbis;
+      indexbis = macro.indexOf ( '@', indexvon + 1 );
+      Token = macro.mid ( indexvon, indexbis - indexvon + 1 );
+      if ( Token == tokenList.at(0) )         // callsign
+      {
+        macro.replace ( indexvon, tokenList.at(0).length(), settings.callsign );
 
-}
+      }
+      else
+        if ( Token == tokenList.at(1) )         // Date
+        {
+          QDate t = QDate::currentDate();
+          macro.replace ( indexvon, tokenList.at(1).length(), t.toString ( QString ( "d.MM.yyyy" ) ) );
+
+        }
+        else
+          if ( Token == tokenList.at(3) )         // RX
+          {
+            macro.remove ( indexvon, 4 );
+            switchtoRx=true;
+          }
+          else
+            if ( Token == tokenList.at(4) )        // Remote callsign
+            {
+             macro.replace ( indexvon, tokenList.at(4).length(), settings.QslData->RemoteCallsign );
+
+            }
+            else
+              if ( Token == tokenList.at(5) )        // Remote op's name
+                {
+                  macro.replace ( indexvon, tokenList.at(5).length(), settings.QslData->OpName );
+
+                }
+                else
+                  if ( Token == tokenList.at(6) )        // Time Local
+                  {
+                    QDateTime t;
+                    t = QDateTime::currentDateTime();
+
+                    macro.replace ( indexvon, tokenList.at(6).length(), t.toString ( "h:mm" ) );
+
+                  }
+                  else
+                    if ( Token == tokenList.at(7) )        // Time UTC
+                    {
+                      QDateTime t;
+                      t = QDateTime::currentDateTime();
+                      t = t.addSecs ( settings.timeoffset * 3600 );
+                      macro.replace ( indexvon, tokenList.at(7).length(), t.toString ( "h:mm" ) );
+                    }
+                    else
+                      if ( Token == tokenList.at(8) )        // TX
+                      {
+                          if ( settings.Status == UNDEF )
+                        {
+                          QMessageBox::warning ( 0, "Warning", "Please listen before transmitting",
+                                                 QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton );
+                          return;
+                        }
+                        macro.remove ( indexvon, 4 );
+                        if(settings.Status == OFF)
+                          emit StartTx();
+                        else //We are alredy transmitting
+                          if (!TxBuffer->isEmpty())
+                            return;
+                      }
+                      else
+                        if ( Token == tokenList.at(9) )        // RST given
+                        {
+                          macro.replace ( indexvon, tokenList.at(9).length(),settings.QslData->MyRST );
+
+                        }
+                        else
+                          if ( Token == tokenList.at(10) )        // RST received
+                          {
+                           macro.replace ( indexvon, tokenList.at(10).length(),settings.QslData->HisRST );
+
+                          }
+                          else  // Must be File
+                          {
+                            macro.remove ( indexvon, Token.length() );
+                            if ( indexvon > 0 )
+                            {
+                              TxBuffer->insert ( macro, indexvon );
+                              macro.remove ( 0, indexvon );
+                              indexvon = 0;
+                            }
+                            Token = Token.mid ( 1, Token.length() - 2 );
+                            if(Token.startsWith(QChar('/'))) // Distinguish between relative and absolute path
+                                MacroFile =new QFile( Token );
+                            else
+                               MacroFile =new QFile( settings.Directory + QString ( "/" ) + Token );
+                            if ( MacroFile->open ( QIODevice::ReadOnly ) )
+                            {
+                              QTextStream line ( MacroFile );
+                              while ( !line.atEnd() )
+                              {
+                                QString Txstring = line.readLine();
+                                if(settings.autoCrLf) // AutoCrLF ??
+                                  Txstring += '\r';
+                                Txstring += "\n";
+                                TxBuffer->insert ( Txstring, Txstring.length() );
+                                TxDisplay->insert(Txstring);
+                              }
+                              MacroFile->close();
+                              delete MacroFile;
+                            }
+                            else
+                              QMessageBox::warning ( 0, "Warning", "File " + Token + " not found ",
+                                                     QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton );
+
+                        }
+      }
+    }
+    anzahl=macro.length();
+    TxBuffer->insert(macro,anzahl);
+    TxDisplay->setTxFocus();
+    TxDisplay->insert(macro);
+    if(switchtoRx & (settings.Status == ON))
+      {
+        msg->setText ( tr ( "Switching to receive" ) );
+        emit  StartRx();
+      }
 
-void LinPSK::executeMacro ( int MacroNumber )
-{
-  Macro->executeMacro ( MacroNumber, TxBuffer );
 }
 
 void LinPSK::addMacro()
 {
 
-  AddMacro *NewMacro = new AddMacro ( Macro );
-// NewMacro->setKeywords ( Macro );
-  if ( NewMacro->exec() != 0 )
-  {
-    Macro->insert ( NewMacro->macroName(),
-                    NewMacro->macroDefinition(), NewMacro->accelerator(), NewMacro->position() );
-    Control->MacroBox->updateMacroWindow ( Macro );
-  }
+  AddMacro *nM = new AddMacro ( &macroList,tokenList);
+  if (nM->exec() != 0 )
+    Control->insertMacros( &macroList );
+  delete nM;
 }
 void LinPSK::editMacro()
 {
-  if ( Macro->count() > 0 )
-  {
-    EditMacro *Edit = new EditMacro ( Macro );
 
-    if ( Edit->exec() != 0 )
-//   Control->MacroBox->updateMacroWindow ( Macro );
-      Control->MacroBox->setMacroWindow ( Macro );
-  }
+  EditMacro * eM = new EditMacro(&macroList,tokenList);
+  if(eM->exec() != 0)
+    Control->insertMacros( &macroList );
+  delete eM;
 }
 void LinPSK::deleteMacro()
 {
-  if ( Macro->count() > 0 )
+  DeleteMacro * dL = new DeleteMacro(&macroList);
+  if ( dL->exec() !=0)
   {
-    DeleteMacro *Del = new DeleteMacro ( Macro );
-
-    if ( Del->exec() != 0 )
-      Control->MacroBox->setMacroWindow ( Macro );
+   Control->insertMacros( &macroList );
   }
+  delete dL;
 }
 void LinPSK::renameMacro()
 {
-  if ( Macro->count() > 0 )
-  {
-    RenameMacro *Ren = new RenameMacro ( Macro );
+  RenameMacro *rM = new RenameMacro(&macroList);
+  if(rM->exec() != 0)
+   {
+     Control->updateMacroWindow(rM->getMacroNumber());
+   }
+  delete rM;
 
-    if ( Ren->exec() != 0 )
-      Control->MacroBox->setMacroWindow ( Macro );
-  }
 }
 
 void LinPSK::read_config()
@@ -860,7 +875,7 @@ void LinPSK::read_config()
     if ( size < 10 )
       size = 10;
     settings.ApplicationFont->setPointSize ( size );
-
+    Control->restoreSplitterStates(config.value("ControlSplitter").toByteArray(),config.value("SpectrumSplitter").toByteArray());
   }
   config.endGroup();
   /** DemoMode **/
@@ -901,61 +916,54 @@ void LinPSK::read_config()
     }
     config.endArray();
   }
-// Macros
-  size = config.beginReadArray ( "Macros" );
-  if ( size > 0 )
-  {
-    QString name, def, acc;
-
-    for ( i = 0; i < size;i++ )
+  // Macros
+    size = config.beginReadArray ( "Macros" );
+    if ( size > 0 )
     {
-      config.setArrayIndex ( i );
-      name = config.value ( "Name" ).toString();
-      def = config.value ( "Definition" ).toString();
-      acc = config.value ( "Accelerator" ).toString();
-      Macro->insert ( name, def, acc, i + 1 );
+      Macro macro;
+      for ( i = 0; i < size;i++ )
+      {
+        config.setArrayIndex ( i );
+        macro.name = config.value ( "Name" ).toString();
+        macro.text = config.value ( "Definition" ).toString();
+        macro.accelerator = config.value ( "Accelerator" ).toString();
+        macro.languageType=config.value("Language",0).toInt();
+        macroList.append(macro);
+        }
     }
     config.endArray();
-  }
 
-  if ( ( HeighttoSet > 0 ) && ( WidthtoSet > 0 ) )
+
+ if ( ( HeighttoSet > 0 ) && ( WidthtoSet > 0 ) )
     resize ( WidthtoSet, HeighttoSet );
-  if ( ( X >= 0 ) && ( Y >= 0 ) )
+ if ( ( X >= 0 ) && ( Y >= 0 ) )
     move ( X, Y );
-
+ // SoundDevices
+  config .beginGroup("SoundDevices");
+  settings.InputDeviceName=config.value("InputDeviceName","LinPSK_Record").toString();
+  settings.sampleRate=config.value("sampleRate",11025).toInt();
+  settings.OutputDeviceName=config.value("OutputDeviceName","LinPSK_Play").toString();
+  settings.complexFormat=config.value("ComplexFormat").toBool();
+  config.endGroup();
 }
 void LinPSK::selectPTTDevice()
 {
-
-//if (settings.serial >0 )
-//  close(settings.serial);
   settings.serial = -1;
   if ( settings.SerialDevice != "None" )
-//{
-// QMessageBox::information(0,"LinPsk","Trying to open Device " + settings.SerialDevice);
+  {
+    int flags = TIOCM_RTS | TIOCM_DTR;
     settings.serial = open ( settings.SerialDevice.toAscii().data(), O_EXCL | O_WRONLY );
-// if (settings.serial > 0 )
-//  QMessageBox::information(0,"LinPsk","Opening successfull");
-// else
-//  QMessageBox::information(0,"LinPsk","Opening unsuccessfull");
-//}
-  int flags = TIOCM_RTS | TIOCM_DTR;
-  if ( settings.serial > 0 )
-    ioctl ( settings.serial, TIOCMBIC, &flags );
-  else
-    settings.SerialDevice = "None"; //Their seems to be a wrong Value in the ConfigFile
-}
-void LinPSK::recording ( bool on )
-{
-  settings.ActChannel->record ( on );
-}
-void LinPSK::HelpAbout()
-{
-  QMessageBox::about ( this, tr ( "About..." ),
-                       ProgramName + QString ( VERSION ) + "\n written by Volker Schroer, DL1KSV\n" );
-//  setActiveWindow();
+    if ( settings.serial > 0 )
+      ioctl ( settings.serial, TIOCMBIC, &flags );
+    else
+    {
+      QMessageBox::critical ( 0, "LinPsk", "Unable to open Device " + settings.SerialDevice+"\nCheck permission of device" );
+      settings.SerialDevice = "None"; //Their seems to be a wrong Value in the ConfigFile
+    }
+   }
 }
 
+
 void LinPSK::saveSettings()
 {
   *SaveParameters = settings;
@@ -968,6 +976,7 @@ void LinPSK::closeEvent ( QCloseEvent *e )
   {
     if ( RxDisplay != 0 )
       RxDisplay->stop_process_loop();
+    RxDisplay->stopRecording();
     e->accept();
     save_config();
   }
@@ -980,3 +989,8 @@ void LinPSK::closeEvent ( QCloseEvent *e )
   return;
 }
 
+
+void LinPSK::on_RxDisplay_newActiveChannel()
+{
+
+}
diff --git a/src/linpsk.h b/gui/linpsk.h
similarity index 80%
rename from src/linpsk.h
rename to gui/linpsk.h
index e039b8e..9f1f4ad 100644
--- a/src/linpsk.h
+++ b/gui/linpsk.h
@@ -21,15 +21,14 @@
 #include <QMainWindow>
 #include <QList>
 #include "constants.h"
+#include "ui_linpsk.h"
+#include <complex>
 
 class QActionGroup;
 class QToolBar;
 class QMenu;
 class QCloseEvent;
 
-class CRxDisplay;
-class CTxDisplay;
-class ControlPanel;
 class QLabel;
 class CModulator;
 class CTxBuffer;
@@ -38,7 +37,7 @@ class Macros;
 class Parameter;
 
 
-class LinPSK : public QMainWindow
+class LinPSK : public QMainWindow, private Ui::LinPSK
 {
     Q_OBJECT
 
@@ -46,30 +45,20 @@ public:
     LinPSK( QWidget* parent = 0,Qt::WFlags fl = 0);
     ~LinPSK();
 
-    CRxDisplay* RxDisplay;
-    CTxDisplay* TxDisplay;
-    ControlPanel* Control;
-    QMenuBar *menubar;
-    QMenu *fileMenu;
-    QMenu *editMenu;
-    QMenu *changeRxParams;
-    QMenu *helpMenu;
 
 public slots:
-    virtual void fileOpen();
     virtual void Exit();
-    virtual void helpIndex();
-    virtual void helpContents();
-    virtual void helpAbout();
-    virtual void addRxWindow();
-    virtual void generalSettings();
-    virtual void chooseColor();
 
 protected:
-    void resizeEvent(QResizeEvent *);
 
 protected slots:
   virtual void languageChange();
+  void fileOpen();
+  void helpAboutQt();
+  void addRxWindow();
+  void generalSettings();
+  void chooseColor();
+  void helpAbout();
   /** Show Time */
   void setclock();
   /** Set IMD */
@@ -80,8 +69,6 @@ protected slots:
   void startTx();
   /** Calculate the TX Data **/
   void process_txdata();
-  /** Font Settings **/
-  void FontSetup();
   /** Switching from TX to RX after TX- Bufefr ist empty **/
   void stopTx();
   /** apply the settings **/
@@ -90,10 +77,8 @@ protected slots:
   void setChannelParams();
   /** Changing Rx Mode ( Moulation type ) **/
   void setRxMode();
-  /** Save Settings **/
-  void saveSettings();
   /** Executing Macros **/
-  void executeMacro(int);
+  void executeMacro(int id);
   /** Add Macro **/
   void addMacro();
   /** Edit Macro **/
@@ -102,19 +87,20 @@ protected slots:
   void deleteMacro();
   /** Rename Macro **/
   void renameMacro();
-  /** Recording **/
-  void recording(bool);
-  /** About Info **/
-  void HelpAbout();
-  
+  /** Font Settings **/
+  void FontSetup();
+  /** Save Settings **/
+  void saveSettings();
   /** Closing this window **/
   void closeEvent( QCloseEvent *);
 
+private slots:
+  void on_RxDisplay_newActiveChannel();
 private:
 
-    void calculateSizeofComponents();
     void read_config();
     void save_config();
+    bool inAction;
 Parameter *SaveParameters;    
 /** Modulator **/
 CModulator *Modulator;
@@ -139,8 +125,15 @@ QLabel *zeit;
 QLabel *IMD;
 
 QLabel *clockadj;
-Macros *Macro;
 QList<QColor> WindowColors;
+/** Macros **/
+QVector<Macro> macroList;
+QStringList tokenList;
+
+signals:
+void StartRx();
+void StartTx();
+
 };
 
 #endif // LINPSK_H
diff --git a/gui/linpsk.ui b/gui/linpsk.ui
new file mode 100644
index 0000000..efe604a
--- /dev/null
+++ b/gui/linpsk.ui
@@ -0,0 +1,658 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LinPSK</class>
+ <widget class="QMainWindow" name="LinPSK">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>642</width>
+    <height>479</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="../src/application.qrc">
+    <normaloff>:/images/linpsk.png</normaloff>:/images/linpsk.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QGridLayout" name="gridLayout">
+    <property name="horizontalSpacing">
+     <number>0</number>
+    </property>
+    <property name="verticalSpacing">
+     <number>1</number>
+    </property>
+    <property name="margin">
+     <number>1</number>
+    </property>
+    <item row="1" column="0">
+     <widget class="CTxDisplay" name="TxDisplay">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+        <horstretch>1</horstretch>
+        <verstretch>1</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>86</height>
+       </size>
+      </property>
+      <property name="sizeIncrement">
+       <size>
+        <width>10</width>
+        <height>10</height>
+       </size>
+      </property>
+      <property name="frameShape">
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow">
+       <enum>QFrame::Sunken</enum>
+      </property>
+     </widget>
+    </item>
+    <item row="2" column="0">
+     <widget class="ControlPanel" name="Control">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+        <horstretch>1</horstretch>
+        <verstretch>2</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>175</height>
+       </size>
+      </property>
+      <property name="sizeIncrement">
+       <size>
+        <width>10</width>
+        <height>15</height>
+       </size>
+      </property>
+      <property name="frameShape">
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow">
+       <enum>QFrame::Sunken</enum>
+      </property>
+     </widget>
+    </item>
+    <item row="0" column="0">
+     <widget class="CRxDisplay" name="RxDisplay">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+        <horstretch>1</horstretch>
+        <verstretch>2</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>170</height>
+       </size>
+      </property>
+      <property name="sizeIncrement">
+       <size>
+        <width>10</width>
+        <height>15</height>
+       </size>
+      </property>
+      <property name="frameShape">
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow">
+       <enum>QFrame::Sunken</enum>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>642</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>File</string>
+    </property>
+    <addaction name="actionOpen_Demo_File"/>
+    <addaction name="actionAdd_Rx_Window"/>
+    <addaction name="separator"/>
+    <addaction name="actionExit"/>
+   </widget>
+   <widget class="QMenu" name="menuSettings">
+    <property name="title">
+     <string>Settings</string>
+    </property>
+    <widget class="QMenu" name="menuMacro_configuration">
+     <property name="title">
+      <string>Macro configuration</string>
+     </property>
+     <addaction name="actionAdd_macro"/>
+     <addaction name="actionEdit_macro"/>
+     <addaction name="actionDelete_macro"/>
+     <addaction name="actionRename_macro"/>
+     <addaction name="separator"/>
+    </widget>
+    <addaction name="actionGeneral_Settings"/>
+    <addaction name="separator"/>
+    <addaction name="menuMacro_configuration"/>
+    <addaction name="separator"/>
+    <addaction name="actionFont_settings"/>
+    <addaction name="actionColor_settings"/>
+    <addaction name="separator"/>
+    <addaction name="actionSave_settings"/>
+   </widget>
+   <widget class="QMenu" name="menuRxParams">
+    <property name="title">
+     <string>RxParams</string>
+    </property>
+    <addaction name="actionChange_Rx_mode"/>
+   </widget>
+   <widget class="QMenu" name="menuAbout">
+    <property name="title">
+     <string>About</string>
+    </property>
+    <addaction name="actionAbout_Linpsk"/>
+    <addaction name="actionAbout_Qt"/>
+   </widget>
+   <addaction name="menuFile"/>
+   <addaction name="menuSettings"/>
+   <addaction name="menuRxParams"/>
+   <addaction name="menuAbout"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="actionAbout_Linpsk">
+   <property name="text">
+    <string>About Linpsk</string>
+   </property>
+  </action>
+  <action name="actionAbout_Qt">
+   <property name="text">
+    <string>About Qt</string>
+   </property>
+  </action>
+  <action name="actionOpen_Demo_File">
+   <property name="text">
+    <string>Open Demo File</string>
+   </property>
+  </action>
+  <action name="actionAdd_Rx_Window">
+   <property name="text">
+    <string>Add Rx Window</string>
+   </property>
+  </action>
+  <action name="actionExit">
+   <property name="text">
+    <string>Exit</string>
+   </property>
+  </action>
+  <action name="actionGeneral_Settings">
+   <property name="text">
+    <string>General Settings</string>
+   </property>
+  </action>
+  <action name="actionAdd_macro">
+   <property name="text">
+    <string>Add macro</string>
+   </property>
+  </action>
+  <action name="actionEdit_macro">
+   <property name="text">
+    <string>Edit macro</string>
+   </property>
+  </action>
+  <action name="actionDelete_macro">
+   <property name="text">
+    <string>Delete macro</string>
+   </property>
+  </action>
+  <action name="actionRename_macro">
+   <property name="text">
+    <string>Rename macro</string>
+   </property>
+  </action>
+  <action name="actionFont_settings">
+   <property name="text">
+    <string>Font settings</string>
+   </property>
+  </action>
+  <action name="actionColor_settings">
+   <property name="text">
+    <string>Color settings</string>
+   </property>
+  </action>
+  <action name="actionSave_settings">
+   <property name="text">
+    <string>Save settings</string>
+   </property>
+  </action>
+  <action name="actionChange_Rx_mode">
+   <property name="text">
+    <string>Change Rx mode</string>
+   </property>
+  </action>
+  <action name="actionEdit_macro_language">
+   <property name="text">
+    <string>Edit macro language</string>
+   </property>
+   <property name="toolTip">
+    <string>Change used macro languages</string>
+   </property>
+  </action>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>CRxDisplay</class>
+   <extends>QFrame</extends>
+   <header>crxdisplay.h</header>
+   <container>1</container>
+   <slots>
+    <signal>startPlotting(double*,bool)</signal>
+    <signal>new_IMD(float)</signal>
+    <signal>newActiveChannel()</signal>
+    <signal>record(bool)</signal>
+    <signal>setQsoData(QsoData,QString)</signal>
+    <slot>setFrequency(double)</slot>
+   </slots>
+  </customwidget>
+  <customwidget>
+   <class>CTxDisplay</class>
+   <extends>QFrame</extends>
+   <header>ctxdisplay.h</header>
+   <container>1</container>
+   <slots>
+    <signal>startRx()</signal>
+    <signal>startTx()</signal>
+   </slots>
+  </customwidget>
+  <customwidget>
+   <class>ControlPanel</class>
+   <extends>QFrame</extends>
+   <header>controlpanel.h</header>
+   <container>1</container>
+   <slots>
+    <signal>FrequencyChanged(double)</signal>
+    <signal>executeMacro(int)</signal>
+    <slot>startPlot(double*,bool)</slot>
+    <slot>setQsoData(QsoData,QString)</slot>
+   </slots>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="../src/application.qrc"/>
+  <include location="../src/application.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>actionOpen_Demo_File</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>fileOpen()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionAdd_Rx_Window</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>addRxWindow()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionExit</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>Exit()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionGeneral_Settings</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>generalSettings()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionAdd_macro</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>addMacro()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionEdit_macro</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>editMacro()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionDelete_macro</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>deleteMacro()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionRename_macro</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>renameMacro()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionFont_settings</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>FontSetup()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionColor_settings</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>chooseColor()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionSave_settings</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>saveSettings()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionChange_Rx_mode</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>setRxMode()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionAbout_Linpsk</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>helpAbout()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>actionAbout_Qt</sender>
+   <signal>triggered()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>helpAboutQt()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>RxDisplay</sender>
+   <signal>startPlotting(double*,bool)</signal>
+   <receiver>Control</receiver>
+   <slot>startPlot(double*,bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>404</x>
+     <y>154</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>532</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>RxDisplay</sender>
+   <signal>new_IMD(float)</signal>
+   <receiver>LinPSK</receiver>
+   <slot>setIMD(float)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>404</x>
+     <y>154</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>341</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>Control</sender>
+   <signal>executeMacro(int)</signal>
+   <receiver>LinPSK</receiver>
+   <slot>executeMacro(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>404</x>
+     <y>532</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>341</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>RxDisplay</sender>
+   <signal>newActiveChannel()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>setChannelParams()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>404</x>
+     <y>154</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>341</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>RxDisplay</sender>
+   <signal>setQsoData(QsoData,QString)</signal>
+   <receiver>Control</receiver>
+   <slot>setQsoData(QsoData,QString)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>404</x>
+     <y>154</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>532</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>TxDisplay</sender>
+   <signal>startRx()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>startRx()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>404</x>
+     <y>343</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>341</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>TxDisplay</sender>
+   <signal>startTx()</signal>
+   <receiver>LinPSK</receiver>
+   <slot>startTx()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>404</x>
+     <y>343</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>341</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>fileOpen()</slot>
+  <slot>addRxWindow()</slot>
+  <slot>Exit()</slot>
+  <slot>generalSettings()</slot>
+  <slot>addMacro()</slot>
+  <slot>editMacro()</slot>
+  <slot>deleteMacro()</slot>
+  <slot>renameMacro()</slot>
+  <slot>FontSetup()</slot>
+  <slot>chooseColor()</slot>
+  <slot>saveSettings()</slot>
+  <slot>setRxMode()</slot>
+  <slot>helpAbout()</slot>
+  <slot>helpAboutQt()</slot>
+  <slot>setIMD(float)</slot>
+  <slot>executeMacro(int)</slot>
+  <slot>setChannelParams()</slot>
+  <slot>recording(bool)</slot>
+  <slot>startRx()</slot>
+  <slot>startTx()</slot>
+ </slots>
+</ui>
diff --git a/gui/macrocontrol.cpp b/gui/macrocontrol.cpp
new file mode 100644
index 0000000..e34fb59
--- /dev/null
+++ b/gui/macrocontrol.cpp
@@ -0,0 +1,105 @@
+/***************************************************************************
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "macrocontrol.h"
+#include "ui_macrocontrol.h"
+#include <QPushButton>
+#include <QButtonGroup>
+
+MacroControl::MacroControl(QWidget *parent) :
+  QGroupBox(parent),
+  ui(new Ui::MacroControl)
+{
+  ui->setupUi(this);
+  displayBox = new QButtonGroup(ui->area);
+  ui->languageBox->setId(ui->lang0,0);
+  ui->languageBox->setId(ui->lang1,1);
+  ui->languageBox->setId(ui->lang2,2);
+  macroLang=ui->languageBox->checkedId();
+  connect(displayBox,SIGNAL(buttonPressed(int)),this,SIGNAL(executeMacro(int)));
+}
+
+MacroControl::~MacroControl()
+{
+  delete displayBox;
+  delete ui;
+}
+void MacroControl::setMacroLanguage(int lang)
+{
+  macroLang=lang;
+  displayMacros();
+}
+void MacroControl::insertMacros(QVector<Macro> *macroList)
+{
+  QPushButton *pb = 0;
+  int anzahl,i;
+  /**
+    First Check, if box is empty,
+    otherwise delete all entries,as order or even number of macros
+    might have changed ( Delete or edit )
+    So we don't need extra processing for these cases.
+  **/
+  anzahl = displayBox->buttons().size();
+  if ( anzahl > 0)
+    for ( i = 0; i < anzahl; i++ ) // Clean the display box
+    {
+      pb= static_cast<QPushButton *> (displayBox->button ( i ) );
+      displayBox->removeButton (pb  );
+      delete pb;
+    }
+  mL=macroList;
+  anzahl=mL->size();
+  if ( anzahl > 0 )
+    {
+      for (i = 0; i < anzahl;i++ ) // insert macro buttons
+        {
+          pb = new QPushButton ( mL->at(i).name, ui->area );
+          pb ->setCheckable(false);
+          pb->setMaximumHeight(20);
+          ui->arrangeButtons->addWidget(pb);
+          displayBox->addButton ( pb, i );
+        }
+      displayMacros();
+    }
+}
+void MacroControl::displayMacros()
+{
+  int i, anzahl,lT;
+  anzahl=mL->size();
+  if ( anzahl > 0 )
+    {
+      ui->scrollArea->show();
+      for ( i = 0; i < anzahl;i++ ) // insert macro buttons
+      {
+         lT=mL->at(i).languageType;
+         if((macroLang == 0) || ( lT == macroLang)|| (lT == 0))
+             displayBox->button(i)->show();
+          else
+           displayBox->button(i) ->hide();
+
+      }
+    }
+  else
+    ui->scrollArea->hide();
+}
+void MacroControl::updateMacroWindow(int macroNumber)
+{
+  QPushButton *pb = static_cast<QPushButton *> (displayBox->button ( macroNumber ) );
+  pb->setText(mL->at(macroNumber).name);
+}
diff --git a/gui/editmacro.h b/gui/macrocontrol.h
similarity index 68%
copy from gui/editmacro.h
copy to gui/macrocontrol.h
index fdad2b0..7ab79ad 100644
--- a/gui/editmacro.h
+++ b/gui/macrocontrol.h
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -18,38 +17,40 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#ifndef EDITMACRO_H
-#define EDITMACRO_H
+#ifndef MACROCONTROL_H
+#define MACROCONTROL_H
 
-#include <QDialog>
-#include "ui_editmacro.h"
+#include <QGroupBox>
+#include "constants.h"
 
-class Macros;
-class ReadOnlyStringListModel;
+class QButtonGroup;
 
+namespace Ui {
+  class MacroControl;
+}
 
-class EditMacro : public QDialog, private Ui::EditMacro
+class MacroControl : public QGroupBox
 {
   Q_OBJECT
 
 public:
-  EditMacro(Macros *M,QWidget* parent = 0, Qt::WFlags fl = 0 );
-  ~EditMacro();
-
+  explicit MacroControl(QWidget *parent = 0);
+  ~MacroControl();
+  void insertMacros(QVector<Macro> *macroList);
+  void updateMacroWindow(int macroNumber);
 
 public slots:
-  /*$PUBLIC_SLOTS$*/
+  void setMacroLanguage(int lang);
+signals:
+  void executeMacro(int);
 
-protected:
-Macros *AllMacros;
-ReadOnlyStringListModel *model;
+private:
+  Ui::MacroControl *ui;
+  QVector<Macro> *mL;
+  int macroLang;
+  QButtonGroup *displayBox;
+  void displayMacros();
 
-protected slots:
-  /*$PROTECTED_SLOTS$*/
-  virtual void accept();
-void setText( int Number);
-void insertKeyword(const QModelIndex &);
 };
 
-#endif
-
+#endif // MACROCONTROL_H
diff --git a/gui/macrocontrol.ui b/gui/macrocontrol.ui
new file mode 100644
index 0000000..c043a74
--- /dev/null
+++ b/gui/macrocontrol.ui
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MacroControl</class>
+ <widget class="QGroupBox" name="MacroControl">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>106</width>
+    <height>118</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>GroupBox</string>
+  </property>
+  <property name="title">
+   <string>Macros</string>
+  </property>
+  <property name="alignment">
+   <set>Qt::AlignCenter</set>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>1</number>
+   </property>
+   <property name="spacing">
+    <number>1</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QScrollArea" name="scrollArea">
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="area">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>96</width>
+        <height>71</height>
+       </rect>
+      </property>
+      <layout class="QVBoxLayout" name="arrangeButtons">
+       <property name="spacing">
+        <number>1</number>
+       </property>
+       <property name="margin">
+        <number>1</number>
+       </property>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <property name="spacing">
+      <number>1</number>
+     </property>
+     <item>
+      <widget class="QRadioButton" name="lang0">
+       <property name="focusPolicy">
+        <enum>Qt::NoFocus</enum>
+       </property>
+       <property name="text">
+        <string>B</string>
+       </property>
+       <property name="checked">
+        <bool>true</bool>
+       </property>
+       <attribute name="buttonGroup">
+        <string notr="true">languageBox</string>
+       </attribute>
+      </widget>
+     </item>
+     <item>
+      <widget class="QRadioButton" name="lang1">
+       <property name="focusPolicy">
+        <enum>Qt::NoFocus</enum>
+       </property>
+       <property name="text">
+        <string>e</string>
+       </property>
+       <attribute name="buttonGroup">
+        <string notr="true">languageBox</string>
+       </attribute>
+      </widget>
+     </item>
+     <item>
+      <widget class="QRadioButton" name="lang2">
+       <property name="focusPolicy">
+        <enum>Qt::NoFocus</enum>
+       </property>
+       <property name="text">
+        <string>g</string>
+       </property>
+       <attribute name="buttonGroup">
+        <string notr="true">languageBox</string>
+       </attribute>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>languageBox</sender>
+   <signal>buttonClicked(int)</signal>
+   <receiver>MacroControl</receiver>
+   <slot>setMacroLanguage(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>54</x>
+     <y>79</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>setMacroLanguage(int)</slot>
+ </slots>
+ <buttongroups>
+  <buttongroup name="languageBox"/>
+ </buttongroups>
+</ui>
diff --git a/gui/qsodata.cpp b/gui/qsodata.cpp
index ae058f1..3439caa 100644
--- a/gui/qsodata.cpp
+++ b/gui/qsodata.cpp
@@ -23,6 +23,7 @@
 #include "parameter.h"
 #include "crxchannel.h"
 #include "processlogdata.h"
+#include "constants.h"
 
 #include <QDateTime>
 #include <QFile>
@@ -51,18 +52,16 @@ QSOData::QSOData ( QWidget* parent )
     OpName->setText ( settings.QslData->OpName );
     Qth->setText ( settings.QslData->Qth );
     Loc->setText ( settings.QslData->Locator );
-    QsoFrequency->setText ( settings.QslData->QsoFrequency );
+    QsoFrequency->setCurrentIndex( settings.QslData->QsoFrequency );
     HisRST->setText ( settings.QslData->HisRST );
     MyRST->setText ( settings.QslData->MyRST );
+    dokName->setText(settings.QslData->dokName);
   }
-  if ( ! ( settings.fileLog || settings.LinLog ) )
-    Save->setDisabled ( true );
   logBookCommunication = new ProcessLogData();
   connectionError = false;
   connect ( Clear, SIGNAL ( clicked() ), this, SLOT ( clear() ) );
-  connect ( Refresh, SIGNAL ( clicked() ), this, SLOT ( refreshDateTime() ) );
   connect ( Qth, SIGNAL ( editingFinished () ), this, SLOT ( QTHchanged() ) );
-  connect ( QsoFrequency, SIGNAL ( editingFinished () ), this, SLOT ( Frequencychanged() ) );
+  connect ( QsoFrequency, SIGNAL ( activated (int) ), this, SLOT ( frequencyChanged(int) ) );
   connect ( MyRST, SIGNAL ( editingFinished () ), this, SLOT ( MyRSTchanged() ) );
   connect ( OpName, SIGNAL ( editingFinished () ), this, SLOT ( Namechanged() ) );
   connect ( Save, SIGNAL ( clicked() ), this, SLOT ( save() ) );
@@ -70,7 +69,7 @@ QSOData::QSOData ( QWidget* parent )
   connect ( HisRST, SIGNAL ( editingFinished () ), this, SLOT ( HisRSTchanged() ) );
   connect ( QsoDate, SIGNAL ( dateChanged ( const QDate & ) ), this, SLOT ( Datechanged() ) );
   connect ( QsoTime, SIGNAL ( timeChanged ( const QTime & ) ), this, SLOT ( Timechanged() ) );
-
+  connect ( dokName, SIGNAL ( editingFinished()),this ,SLOT(dokChanged()));
 
   connect ( RemoteCallsign, SIGNAL ( editingFinished ( ) ), this, SLOT ( sendRequest() ) );
   connect ( logBookCommunication, SIGNAL ( unabletoConnect() ), this , SLOT ( stopTrial() ) );
@@ -79,8 +78,13 @@ QSOData::QSOData ( QWidget* parent )
 
 QSOData::~QSOData()
 {}
-
-
+void QSOData::enableSaveData()
+{
+  if ( ! ( settings.fileLog || settings.LinLog ) )
+    Save->setDisabled ( true );
+  else
+    Save->setDisabled(false);
+}
 void QSOData::clear()
 {
   RemoteCallsign->setText ( "" );
@@ -91,7 +95,7 @@ void QSOData::clear()
   settings.QslData->Qth = Qth->text();
   Loc->setText ( "" );
   settings.QslData->Locator = Loc->text();
-  QsoFrequency->setText ( "" );
+//QsoFrequency->setText ( "" );
   settings.QslData->Locator = Loc->text();
   HisRST->setText ( "" );
   settings.QslData->HisRST = HisRST->text();
@@ -111,6 +115,10 @@ void QSOData::clear()
   mainPrefix->setText ( "" );
   settings.QslData->mainPrefix = mainPrefix->text();
   refreshDateTime();
+  dokName->clear();
+  eQsl->setChecked(false);
+  bureau->setChecked(false);
+
 }
 
 void QSOData::Callsignchanged()
@@ -146,9 +154,9 @@ void QSOData::Locatorchanged()
   }
 }
 
-void QSOData::Frequencychanged()
+void QSOData::frequencyChanged(int index)
 {
-  settings.QslData->QsoFrequency = QsoFrequency->text();
+  settings.QslData->QsoFrequency = index;
 }
 
 void QSOData::HisRSTchanged()
@@ -170,6 +178,10 @@ void QSOData::Timechanged()
 {
   settings.QslData->QsoTime = QsoTime->time();
 }
+void QSOData::dokChanged()
+{
+  settings.QslData->dokName = dokName->text();
+}
 void QSOData::refreshDateTime()
 {
   QDateTime t1;
@@ -195,7 +207,6 @@ void QSOData::save()
   Namechanged(); // Later ?, not saved at the moment
   QTHchanged();
   Locatorchanged();
-  Frequencychanged();
   HisRSTchanged();
   MyRSTchanged();
   Datechanged();
@@ -225,9 +236,9 @@ void QSOData::save()
     s = QString ( "<GRIDSQUARE:%1>%2\n" ).arg ( Loc->text().length() ).arg ( Loc->text() );
     saveString.append ( s );
   }
-  if ( QsoFrequency->text() != "" )
+  if ( QsoFrequency->currentText() != "" )
   {
-    s = QString ( "<BAND:%1>%2\n" ).arg ( QsoFrequency->text().length() ).arg ( QsoFrequency->text() );
+    s = QString ( "<BAND:%1>%2\n" ).arg ( QsoFrequency->currentText().length() ).arg ( QsoFrequency->currentText() );
     saveString.append ( s );
   }
   if ( QsoDate->text() == "" )
@@ -279,7 +290,8 @@ void QSOData::save()
     }
     saveString.append ( s );
   }
-  saveString.append ( "<eor>\n" );
+  if(dokName->text() !="")
+   saveString.append(QString("<APP_LinLog_DOK:%1>%2\n").arg(dokName->text().length()).arg(dokName->text()));
   if ( settings.fileLog )
   {
     QDir d;
@@ -298,6 +310,18 @@ void QSOData::save()
   }
   if ( settings.LinLog )
   {
+
+    saveString.append("<QSL_SENT:1>");
+    if(bureau->isChecked())
+       saveString.append("R\n");
+    else
+       saveString.append("N\n");
+    saveString.append("<EQSL_QSL_SENT:1>");
+    if(eQsl->isChecked())
+       saveString.append("R\n");
+     else
+       saveString.append("N\n");
+    saveString.append ( "<eor>\n" );
     if ( !logBookCommunication->isRunning() )
       logBookCommunication->start();
     qDebug ( "Written to Logbook\n%s", qPrintable ( saveString ) );
@@ -332,31 +356,38 @@ QSOData::coordinates QSOData::loc2coordinates ( const QChar *l )
   return c;
 }
 
-void QSOData::copyCallSign ( QString s )
-{
-  RemoteCallsign->setText ( s );
-  Callsignchanged();
-}
-void QSOData::copyQTH ( QString s )
+void QSOData::setQsoData(QsoData value,QString s)
 {
-  Qth->setText ( s );
-  QTHchanged();
-}
-void QSOData::copyName ( QString s )
-{
-  OpName->setText ( s );
-  Namechanged();
-}
-void QSOData::copyLocator ( QString s )
-{
-  Loc->setText ( s.left(6).toUpper());
-  Locatorchanged();
-}
-void QSOData::copyRST ( QString s )
-{
-  HisRST->setText ( s );
-  HisRSTchanged();
-}
+
+  switch (value)
+  {
+    case CallSign :
+      RemoteCallsign->setText ( s );
+      Callsignchanged();
+      break;
+    case QTH :
+      Qth->setText ( s );
+      QTHchanged();
+      break;
+    case Name:
+      OpName->setText ( s );
+      Namechanged();
+      break;
+    case Locator:
+      Loc->setText ( s.left(6).toUpper());
+      Locatorchanged();
+      break;
+    case RST:
+      HisRST->setText ( s );
+      HisRSTchanged();
+      break;
+    case DOK :
+      dokName->setText(s);
+      dokChanged();
+      break;
+  }
+ }
+
 void QSOData::newChannel()
 {
   Distance->setText ( "" );
@@ -367,7 +398,7 @@ void QSOData::newChannel()
     Qth->setText ( settings.QslData->Qth );
     Loc->setText ( settings.QslData->Locator );
     Locatorchanged(); // Check Locator and set Color
-    QsoFrequency->setText ( settings.QslData->QsoFrequency );
+    QsoFrequency->setCurrentIndex ( settings.QslData->QsoFrequency );
     HisRST->setText ( settings.QslData->HisRST );
     MyRST->setText ( settings.QslData->MyRST );
     QsoDate->setDate ( settings.QslData->QsoDate );
@@ -394,7 +425,7 @@ void QSOData::sendRequest()
   }
   if ( !settings.LinLog || connectionError || !test ) // No request to LinLogbook if disabled in the settings
     return;
-  qDebug ( "Trying to request %s", qPrintable ( RemoteCallsign->text().toUpper() ) );
+//  qDebug ( "Trying to request %s", qPrintable ( RemoteCallsign->text().toUpper() ) );
   QLabel *results[6];
   results[0] = mainPrefix;
   results[1] = wazZone;
@@ -403,12 +434,8 @@ void QSOData::sendRequest()
   results[4] = continent;
   results[5] = worked;
   if ( !logBookCommunication->isRunning() )
-  {
     logBookCommunication->start();
-//    qApp->processEvents ( QEventLoop::AllEvents, 100 );
-  }
   logBookCommunication->requestCallSign ( results, RemoteCallsign->text().toUpper() );
-  qDebug ( "Request send" );
 }
 void QSOData::stopTrial()
 {
diff --git a/gui/qsodata.h b/gui/qsodata.h
index b01abec..7bd1af9 100644
--- a/gui/qsodata.h
+++ b/gui/qsodata.h
@@ -23,6 +23,7 @@
 
 #include <QGroupBox>
 #include "ui_qsodata.h"
+#include "constants.h"
 
 class QChar;
 class ProcessLogData;
@@ -39,41 +40,40 @@ struct coordinates
 public:
   QSOData(QWidget* parent = 0);
   ~QSOData();
-  /*$PUBLIC_FUNCTIONS$*/
+  void enableSaveData();
 
 public slots:
   /*$PUBLIC_SLOTS$*/
-void Timechanged();
-void Datechanged();
-void MyRSTchanged();
-void HisRSTchanged();
-void Frequencychanged();
-void Locatorchanged();
-void QTHchanged();
-void Namechanged();
-void Callsignchanged();
-void clear();
-void refreshDateTime();
-void save();
-void calculateDistance(QString);
+  void Timechanged();
+  void Datechanged();
+  void MyRSTchanged();
+  void HisRSTchanged();
+  void frequencyChanged(int);
+  void Locatorchanged();
+  void QTHchanged();
+  void Namechanged();
+  void Callsignchanged();
+  void clear();
+  void refreshDateTime();
+  void save();
+  void calculateDistance(QString);
+  void dokChanged();
+
+  void setQsoData(QsoData,QString);
+  void newChannel();
+
 
-void copyCallSign(QString);
-void copyQTH(QString);
-void copyName(QString);
-void copyLocator(QString);
-void copyRST(QString);
-void newChannel();
 protected:
+  coordinates loc2coordinates ( const QChar *l );
 
-coordinates loc2coordinates ( const QChar *l );
 protected slots:
-void sendRequest();
-void stopTrial();
-void copyAnswer();
+  void sendRequest();
+  void stopTrial();
+  void copyAnswer();
 private:
-ProcessLogData *logBookCommunication;
-bool connectionError;
-QValidator *validator;
+  ProcessLogData *logBookCommunication;
+  bool connectionError;
+  QValidator *validator;
 };
 
 #endif
diff --git a/gui/qsodata.ui b/gui/qsodata.ui
index 1f294e2..1ebb016 100644
--- a/gui/qsodata.ui
+++ b/gui/qsodata.ui
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>420</width>
-    <height>264</height>
+    <width>297</width>
+    <height>272</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
     <horstretch>2</horstretch>
     <verstretch>1</verstretch>
    </sizepolicy>
@@ -47,1837 +47,2202 @@
    <bool>false</bool>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <property name="leftMargin">
-    <number>7</number>
+   <property name="margin">
+    <number>1</number>
    </property>
-   <property name="topMargin">
-    <number>3</number>
+   <property name="spacing">
+    <number>1</number>
    </property>
-   <property name="rightMargin">
-    <number>7</number>
-   </property>
-   <property name="bottomMargin">
-    <number>3</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string>Callsign</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="QLineEdit" name="RemoteCallsign"/>
-   </item>
-   <item row="0" column="2">
-    <widget class="QLabel" name="label_2">
-     <property name="text">
-      <string>Frequency</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="3">
-    <widget class="QLineEdit" name="QsoFrequency"/>
-   </item>
    <item row="1" column="0">
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string>Name</string>
+    <widget class="QRadioButton" name="eQsl">
+     <property name="focusPolicy">
+      <enum>Qt::NoFocus</enum>
      </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="QLineEdit" name="OpName"/>
-   </item>
-   <item row="1" column="2">
-    <widget class="QLabel" name="label_10">
      <property name="text">
-      <string>QTH</string>
+      <string>eQsl</string>
      </property>
-    </widget>
-   </item>
-   <item row="1" column="3">
-    <widget class="QLineEdit" name="Qth"/>
-   </item>
-   <item row="2" column="0">
-    <widget class="QLabel" name="label_4">
-     <property name="text">
-      <string>RST received</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="1">
-    <widget class="QLineEdit" name="HisRST"/>
-   </item>
-   <item row="2" column="2">
-    <widget class="QLabel" name="label_11">
-     <property name="text">
-      <string>RST given</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="3">
-    <widget class="QLineEdit" name="MyRST"/>
-   </item>
-   <item row="3" column="0">
-    <widget class="QLabel" name="label_5">
-     <property name="text">
-      <string>Date</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
-    <widget class="QDateEdit" name="QsoDate"/>
-   </item>
-   <item row="3" column="2">
-    <widget class="QLabel" name="label_12">
-     <property name="text">
-      <string>Time</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="3">
-    <widget class="QTimeEdit" name="QsoTime"/>
-   </item>
-   <item row="4" column="0">
-    <widget class="QLabel" name="label_6">
-     <property name="text">
-      <string>Locator</string>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="1">
-    <widget class="QLineEdit" name="Loc">
-     <property name="sizeIncrement">
-      <size>
-       <width>0</width>
-       <height>1</height>
-      </size>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="2">
-    <widget class="QLabel" name="label_13">
-     <property name="text">
-      <string>Dist.</string>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="3">
-    <widget class="QLabel" name="Distance">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-     <property name="textInteractionFlags">
-      <set>Qt::NoTextInteraction</set>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="0">
-    <widget class="QLabel" name="label_7">
-     <property name="text">
-      <string>Main Prefix</string>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="1">
-    <widget class="QLabel" name="mainPrefix">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-     <property name="textInteractionFlags">
-      <set>Qt::NoTextInteraction</set>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="2">
-    <widget class="QLabel" name="label_14">
-     <property name="text">
-      <string>Continent</string>
+     <property name="autoExclusive">
+      <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="6" column="0">
-    <widget class="QLabel" name="label_8">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
+   <item row="1" column="1">
+    <widget class="QRadioButton" name="bureau">
+     <property name="focusPolicy">
+      <enum>Qt::NoFocus</enum>
      </property>
      <property name="text">
-      <string>Waz Zone</string>
+      <string>bureau</string>
      </property>
-    </widget>
-   </item>
-   <item row="6" column="2">
-    <widget class="QLabel" name="label_15">
-     <property name="text">
-      <string>Itu Zone</string>
+     <property name="autoExclusive">
+      <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="7" column="0">
-    <widget class="QLabel" name="label_9">
+   <item row="1" column="2">
+    <widget class="QPushButton" name="Save">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+      <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <property name="text">
-      <string>Country</string>
-     </property>
-    </widget>
-   </item>
-   <item row="7" column="2">
-    <widget class="QLabel" name="label_16">
-     <property name="text">
-      <string>Worked</string>
-     </property>
-    </widget>
-   </item>
-   <item row="8" column="0">
-    <spacer name="horizontalSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
+     <property name="maximumSize">
       <size>
-       <width>72</width>
-       <height>22</height>
+       <width>16777215</width>
+       <height>20</height>
       </size>
      </property>
-    </spacer>
-   </item>
-   <item row="8" column="1">
-    <widget class="QPushButton" name="Save">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
+     <property name="focusPolicy">
+      <enum>Qt::NoFocus</enum>
      </property>
      <property name="text">
       <string>Save</string>
      </property>
     </widget>
    </item>
-   <item row="8" column="2">
-    <widget class="QPushButton" name="Refresh">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text">
-      <string>Refresh</string>
-     </property>
-    </widget>
-   </item>
-   <item row="8" column="3">
+   <item row="1" column="3">
     <widget class="QPushButton" name="Clear">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <property name="text">
-      <string>Clear</string>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="3">
-    <widget class="QLabel" name="continent">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>233</red>
-           <green>232</green>
-           <blue>232</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-     <property name="textInteractionFlags">
-      <set>Qt::NoTextInteraction</set>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="1">
-    <widget class="QLabel" name="wazZone">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-     <property name="textInteractionFlags">
-      <set>Qt::NoTextInteraction</set>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="3">
-    <widget class="QLabel" name="ituZone">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>20</height>
+      </size>
      </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
+     <property name="focusPolicy">
+      <enum>Qt::NoFocus</enum>
      </property>
      <property name="text">
-      <string/>
-     </property>
-     <property name="textInteractionFlags">
-      <set>Qt::NoTextInteraction</set>
+      <string>Clear</string>
      </property>
     </widget>
    </item>
-   <item row="7" column="1">
-    <widget class="QLabel" name="countryName">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
+   <item row="0" column="0" colspan="4">
+    <widget class="QScrollArea" name="scrollArea">
      <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
+      <enum>QFrame::NoFrame</enum>
      </property>
      <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="text">
-      <string/>
+      <enum>QFrame::Plain</enum>
      </property>
-    </widget>
-   </item>
-   <item row="7" column="3">
-    <widget class="QLabel" name="worked">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Light">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Midlight">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Dark">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Mid">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>170</red>
-           <green>170</green>
-           <blue>170</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Text">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="BrightText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ButtonText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>127</red>
-           <green>127</green>
-           <blue>127</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Shadow">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>220</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="ToolTipText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
+     <property name="lineWidth">
+      <number>1</number>
      </property>
-     <property name="autoFillBackground">
+     <property name="widgetResizable">
       <bool>true</bool>
      </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
+     <widget class="QWidget" name="scrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>291</width>
+        <height>231</height>
+       </rect>
+      </property>
+      <layout class="QGridLayout" name="gridLayout_2">
+       <property name="margin">
+        <number>0</number>
+       </property>
+       <property name="spacing">
+        <number>1</number>
+       </property>
+       <item row="3" column="0">
+        <widget class="QLabel" name="label_5">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Date</string>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="0" colspan="2">
+        <widget class="QLabel" name="label_8">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Waz Zone</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2" colspan="2">
+        <widget class="QLineEdit" name="Qth">
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>20</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="0">
+        <widget class="QLabel" name="label_6">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Locator</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0" colspan="2">
+        <widget class="QLabel" name="label_7">
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>M. Prefix</string>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="2" colspan="2">
+        <widget class="QLabel" name="wazZone">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::StyledPanel</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Sunken</enum>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="textInteractionFlags">
+          <set>Qt::NoTextInteraction</set>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="6" colspan="2">
+        <widget class="QLabel" name="Distance">
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::StyledPanel</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Sunken</enum>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+         </property>
+         <property name="textInteractionFlags">
+          <set>Qt::NoTextInteraction</set>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="label_3">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Name</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="6" colspan="2">
+        <widget class="QLabel" name="worked">
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::StyledPanel</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Sunken</enum>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0" colspan="2">
+        <widget class="QLabel" name="label_10">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>QTH</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="6" colspan="2">
+        <widget class="QTimeEdit" name="QsoTime">
+         <property name="minimumSize">
+          <size>
+           <width>65</width>
+           <height>0</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2" colspan="2">
+        <widget class="QLineEdit" name="OpName">
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>20</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="6" colspan="2">
+        <widget class="QLineEdit" name="HisRST">
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>20</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="2" colspan="2">
+        <widget class="QLabel" name="mainPrefix">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::StyledPanel</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Sunken</enum>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="textInteractionFlags">
+          <set>Qt::NoTextInteraction</set>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="2" colspan="2">
+        <widget class="QLabel" name="countryName">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::StyledPanel</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Sunken</enum>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="textInteractionFlags">
+          <set>Qt::NoTextInteraction</set>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="0" colspan="2">
+        <widget class="QLabel" name="label">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Callsign</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="5">
+        <widget class="QLabel" name="label_16">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Worked</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="5">
+        <widget class="QLabel" name="label_2">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Frequency</string>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="5">
+        <widget class="QLabel" name="label_15">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Itu Zone</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="2" colspan="2">
+        <widget class="QDateEdit" name="QsoDate">
+         <property name="minimumSize">
+          <size>
+           <width>70</width>
+           <height>0</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="2" colspan="2">
+        <widget class="QLineEdit" name="Loc">
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="sizeIncrement">
+          <size>
+           <width>0</width>
+           <height>1</height>
+          </size>
+         </property>
+         <property name="maxLength">
+          <number>7</number>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2" colspan="2">
+        <widget class="QLineEdit" name="RemoteCallsign">
+         <property name="enabled">
+          <bool>true</bool>
+         </property>
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maxLength">
+          <number>20</number>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="0" colspan="2">
+        <widget class="QLabel" name="label_9">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Country</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="6" colspan="2">
+        <widget class="QLabel" name="continent">
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>233</red>
+               <green>232</green>
+               <blue>232</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::StyledPanel</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Sunken</enum>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="textInteractionFlags">
+          <set>Qt::NoTextInteraction</set>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="5">
+        <widget class="QLabel" name="label_12">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Time</string>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="6" colspan="2">
+        <widget class="QLabel" name="ituZone">
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::StyledPanel</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Sunken</enum>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="textInteractionFlags">
+          <set>Qt::NoTextInteraction</set>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="5">
+        <widget class="QLabel" name="label_14">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Continent</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="6" colspan="2">
+        <widget class="QLineEdit" name="MyRST">
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>20</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="5">
+        <widget class="QLabel" name="label_4">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>RST rcvd</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="5">
+        <widget class="QLabel" name="label_11">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>RST given</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="5">
+        <widget class="QLabel" name="label_13">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="lineWidth">
+          <number>0</number>
+         </property>
+         <property name="text">
+          <string>Dist.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="0">
+        <widget class="QLabel" name="label_17">
+         <property name="text">
+          <string>Dok</string>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="2">
+        <widget class="QLineEdit" name="dokName">
+         <property name="maxLength">
+          <number>10</number>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="6">
+        <widget class="QComboBox" name="QsoFrequency">
+         <property name="minimumSize">
+          <size>
+           <width>60</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="editable">
+          <bool>false</bool>
+         </property>
+         <property name="currentIndex">
+          <number>5</number>
+         </property>
+         <item>
+          <property name="text">
+           <string/>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>80m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>60m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>40m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>30m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>20m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>17m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>15m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>12m</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>10m</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>RemoteCallsign</tabstop>
+  <tabstop>OpName</tabstop>
+  <tabstop>Qth</tabstop>
+  <tabstop>MyRST</tabstop>
+  <tabstop>HisRST</tabstop>
+  <tabstop>dokName</tabstop>
+  <tabstop>Clear</tabstop>
+  <tabstop>eQsl</tabstop>
+  <tabstop>bureau</tabstop>
+  <tabstop>Save</tabstop>
+  <tabstop>scrollArea</tabstop>
+  <tabstop>QsoTime</tabstop>
+  <tabstop>Loc</tabstop>
+  <tabstop>QsoDate</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/gui/renamemacro.cpp b/gui/renamemacro.cpp
index 0dbd007..01d785f 100644
--- a/gui/renamemacro.cpp
+++ b/gui/renamemacro.cpp
@@ -20,19 +20,24 @@
 
 
 #include "renamemacro.h"
-#include "macros.h"
 #include "readonlystringlistmodel.h"
 #include <QMessageBox>
 
-RenameMacro::RenameMacro(Macros *M,QWidget* parent, Qt::WFlags fl)
-: QDialog( parent, fl ), Ui::RenameMacro()
+RenameMacro::RenameMacro(QVector<Macro> *macroList,QWidget* parent, Qt::WFlags fl)
+  : QDialog( parent, fl ), ui(new Ui:: RenameMacro())
 {
-	setupUi(this);
-model=new ReadOnlyStringListModel();
-model->setStringList(M->getMacroList());
-AllMacros=M;
-MacroBox->setModel(model);
-connect(MacroBox,SIGNAL(clicked(const QModelIndex &)),this,SLOT(selectMacro(const QModelIndex &)));
+  ui->setupUi(this);
+  mL = macroList;
+  model=new ReadOnlyStringListModel();
+  QStringList macroName;
+  int numberofMacros=macroList->size();
+  if (numberofMacros > 0 )
+  for(int i=0; i < numberofMacros;i++)
+    macroName.append((*macroList).at(i).name);
+  model->setStringList(macroName);
+  ui->MacroBox->setModel(model);
+  connect(ui->MacroBox,SIGNAL(clicked(const QModelIndex &)),this,SLOT(selectMacro(const QModelIndex &)));
+  macroNumber=-1;
 }
 
 RenameMacro::~RenameMacro()
@@ -42,20 +47,25 @@ RenameMacro::~RenameMacro()
 
 void RenameMacro::accept()
 {
-if (NewName->text().length() ==0 )
+if (ui->NewName->text().length() ==0 )
  {
   QMessageBox::warning(this,
   "Error", "New Name of Macro is missing. \n Enter new Name of  Macro",QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
     return;
  }
-else 
- AllMacros->setMacroName(NewName->text(),MacroNumber);
+  Macro macro;
+  macro=(*mL).at(macroNumber);
+  macro.name=ui->NewName->text();
+  mL->replace(macroNumber,macro);
   QDialog::accept();
 }
 
 void RenameMacro::selectMacro(const QModelIndex &index)
 {
-MacroNumber=index.row();
-OldName->setText(index.data().toString());
+  macroNumber=index.row();
+  ui->OldName->setText(index.data().toString());
+}
+int RenameMacro::getMacroNumber()
+{
+  return macroNumber;
 }
-
diff --git a/gui/renamemacro.h b/gui/renamemacro.h
index 1cbe6d3..6e83bee 100644
--- a/gui/renamemacro.h
+++ b/gui/renamemacro.h
@@ -23,30 +23,35 @@
 
 #include <QDialog>
 #include "ui_renamemacro.h"
+#include "constants.h"
 
-class Macros;
+
+namespace Ui {
+  class RenameMacro;
+}
 class ReadOnlyStringListModel;
 
-class RenameMacro : public QDialog, private Ui::RenameMacro
+class RenameMacro : public QDialog
 {
   Q_OBJECT
 
 public:
-  RenameMacro(Macros *M,QWidget* parent = 0, Qt::WFlags fl = 0 );
+  RenameMacro(QVector<Macro> *macroList,QWidget* parent = 0, Qt::WFlags fl = 0 );
   ~RenameMacro();
-  /*$PUBLIC_FUNCTIONS$*/
+  int getMacroNumber();
 
-public slots:
-  /*$PUBLIC_SLOTS$*/
 
 protected:
-ReadOnlyStringListModel *model;
-Macros *AllMacros;
-int MacroNumber;
+  ReadOnlyStringListModel *model;
+
+  int macroNumber;
 protected slots:
   /*$PROTECTED_SLOTS$*/
   virtual void          accept();
 void selectMacro(const QModelIndex &);
+private:
+  Ui::RenameMacro *ui;
+  QVector<Macro> *mL;
 };
 
 #endif
diff --git a/gui/spectrumdisplay.cpp b/gui/spectrumdisplay.cpp
new file mode 100644
index 0000000..3d148c2
--- /dev/null
+++ b/gui/spectrumdisplay.cpp
@@ -0,0 +1,159 @@
+/***************************************************************************
+                          spectrumdisplay.cpp  -  description
+                             -------------------
+    begin                : Fr March 19 2004
+    copyright            : (C) 2004 by Volker Schroer
+    email                : dl1ksv at gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ ***************************************************************************/
+
+
+#include <QRadioButton>
+#include <QSpinBox>
+#include <QPainter>
+#include <QPixmap>
+#include <QSplitter>
+#include "spectrumdisplay.h"
+#include "crxchannel.h"
+#include "parameter.h"
+#include "color.h"
+extern Parameter settings;
+
+SpectrumDisplay::SpectrumDisplay ( QWidget* parent ) : QFrame ( parent ), Ui::SpectrumDisplay()
+{
+  setupUi(this);
+  languageChange();
+  inputdata = 0;
+  for(int i=0; i< fftsize;i++)
+    smoothedfft[i]=0.;
+  displayWidth=spectrumWindow->width()-2*spectrumWindow->frameWidth();
+  connect(spectrumWindow,SIGNAL(frequencyChanged(double)),this ,SIGNAL(FrequencyChanged(double)));
+  connect(waterfallWindow,SIGNAL(frequencyChanged(double)),this ,SIGNAL(FrequencyChanged(double)));
+}
+
+/*
+ *  Destroys the object and frees any allocated resources
+ */
+SpectrumDisplay::~SpectrumDisplay()
+{
+	// no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ *  Sets the strings of the subwidgets using the current
+ *  language.
+ */
+void SpectrumDisplay::resizeEvent ( QResizeEvent * )
+{
+  if ( inputdata == 0 )
+    return;          // No data available
+  displayWidth=spectrumWindow->width()-2*spectrumWindow->frameWidth();
+  if(fftsize < displayWidth)
+  {
+    qDebug("+++ SpectrumDisplay: Spectrum array %d lower than displaywidth %d",fftsize,displayWidth);
+    return;
+  }
+  translate();
+  calcFFT();
+  spectrumWindow->plotSpectrum(false,fftdata, MinFreq->value(),MaxFreq->value());
+  waterfallWindow->plotWaterfall(fftdata);
+}
+
+void SpectrumDisplay::calcFFT()
+{
+  int i;
+  float x,gain;
+  if ( inputdata == 0 )
+     return;          // No data available
+  if( Smooth->isChecked())
+    {
+      for ( i = 0;i < displayWidth;i++ )
+      {
+        if(inputdata[xtranslate[i]]> 0.02)
+           x=log10 ( inputdata[xtranslate[i]])+2;
+          else
+           x=0.;
+        gain=(1. - exp(-(0.2 * x)));
+        smoothedfft[i]=smoothedfft[i]*(1.-gain) + gain *x;
+        fftdata[i] = smoothedfft[i];
+      }
+     }
+   else
+    {
+      for ( i = 0;i < displayWidth;i++ )
+        {
+          if(inputdata[xtranslate[i]]> 0.02)
+            fftdata[i]=log10 ( inputdata[xtranslate[i]])+2;
+          else
+            fftdata[i]=0.;
+        }
+    }
+  i=spectrumWindow->height();
+  i=0;
+}
+
+void SpectrumDisplay::translate ( void )
+{
+    int i, to, minfreq, maxfreq,tmp;
+	minfreq = MinFreq->value();
+	maxfreq = MaxFreq->value();
+    to = int ( maxfreq * fftsize *4/ settings.sampleRate );
+    for ( i = 0;i < displayWidth;i++ )
+    {
+      tmp= ( ( ( maxfreq - minfreq ) * i * to / displayWidth ) + minfreq * to ) / maxfreq;
+      if( tmp < fftsize)
+        xtranslate[i] = tmp;
+      else
+      {
+        qDebug("+++ SpectrumDisplay: translation array size %d lower than requested size %d",fftsize,tmp);
+        return;
+      }
+    }
+}
+
+void SpectrumDisplay::startPlot ( double *x, bool overload )
+{
+	inputdata = x;
+    int tmp=spectrumWindow->width()-2*spectrumWindow->frameWidth();
+    if( tmp != displayWidth)
+    {
+      displayWidth=tmp;
+      translate();
+    }
+	calcFFT();
+    spectrumWindow->plotSpectrum(overload,fftdata, MinFreq->value(),MaxFreq->value());
+    waterfallWindow->plotWaterfall(fftdata);
+}
+
+void SpectrumDisplay::setnewFrequency ( int position )
+{
+
+	double freq;
+    freq = ( position * ( MaxFreq->value() - MinFreq->value() ) ) / displayWidth + MinFreq->value();
+	settings.ActChannel->setRxFrequency ( freq );
+	emit FrequencyChanged ( freq );
+}
+
+void SpectrumDisplay::setPhasePointer ( std::complex<float> *p )
+{
+   spectrumWindow->setPhasePointer(p);
+}
+void SpectrumDisplay::setColorList(QList<QColor> *c)
+{
+  spectrumWindow->setColorList(c);
+}
+QByteArray SpectrumDisplay::spectrumSplitterState() const
+{
+   return spectrumSplitter->saveState();
+}
+void SpectrumDisplay::restoreSplitterState(const QByteArray & spectrumState)
+{
+  spectrumSplitter->restoreState(spectrumState);
+}
diff --git a/src/spectrumdisplay.h b/gui/spectrumdisplay.h
similarity index 66%
rename from src/spectrumdisplay.h
rename to gui/spectrumdisplay.h
index d79cb11..d1eba6e 100644
--- a/src/spectrumdisplay.h
+++ b/gui/spectrumdisplay.h
@@ -21,76 +21,56 @@
 
 #include <QFrame>
 #include <complex>
-#include <QColor>
-#include <QList>
-using namespace std;
+#include "ui_spectrumdisplay.h"
 
 class QRadioButton;
 class QSpinBox;
-class QPixmap;
 class QWidget;
 
 /**
   *@author Volker Schroer
   */
+const int fftsize=1024; // Check size to protect arrays
 
-class SpectrumDisplay : public QFrame  {
+class SpectrumDisplay : public QFrame , private Ui::SpectrumDisplay
+{
  Q_OBJECT
 public: 
   SpectrumDisplay( QWidget* parent = 0);
   ~SpectrumDisplay();
-  
+  void setPhasePointer(std::complex<float> *);
   void setColorList(QList<QColor> *c);
-   
-  void mousePressEvent(QMouseEvent *);
-
-
+  QByteArray spectrumSplitterState() const;
+  void restoreSplitterState(const QByteArray & spectrumState);
 
 public slots:
   void startPlot(double *,bool);
-  void setPhasePointer(std::complex<float> *);
 
 
 
 protected:
     void resizeEvent( QResizeEvent * );
-   void paintEvent(QPaintEvent *);
 
 protected slots:
-    virtual void languageChange();
   void setnewFrequency(int);
 private:
- void calculateSizeofComponents();
- QSpinBox* MaxFreq;
- QSpinBox* MinFreq;
-QRadioButton *Smooth;
-
-
- void plotspectrum(bool);
  /** Pointer to the Input for the FFT **/
  double *inputdata; 
- complex<float> *Phase;
+ int displayWidth;
  void translate(void);
- void paintLineal(QPainter* ,int,int);
  void plotVector(QPainter *p);
   /** Results of FFT */
   void calcFFT();
 
-  int fftdata[1024];    // Not all elements are used, it differs 
-	int xtranslate[1024]; // depending on the display width
-  float smoothedfft[1024];
-// Pointer to the different Colors
-QList<QColor> *Farbe;
-
-QPixmap pdisplay;   // Pixmap for Display for double buffering
-QPixmap pwaterfall; // Pixmap for Waterfall Display
-//QPixmap *pellipse;   // Pixmap for crossed ellipse in RTTY(2) Mode
+ float fftdata[fftsize];    // Not all elements are used, it differs
+ int xtranslate[fftsize]; // depending on the display width
+ float smoothedfft[fftsize];
+ int oldMinfreq;
+ int oldMaxfreq;
 
 signals:
 void FrequencyChanged(double);
 
-void frequencyChanged(int);
-
 };
 
 #endif
diff --git a/gui/spectrumdisplay.ui b/gui/spectrumdisplay.ui
new file mode 100644
index 0000000..705a1fb
--- /dev/null
+++ b/gui/spectrumdisplay.ui
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SpectrumDisplay</class>
+ <widget class="QFrame" name="SpectrumDisplay">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>330</width>
+    <height>175</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Frame</string>
+  </property>
+  <property name="frameShape">
+   <enum>QFrame::StyledPanel</enum>
+  </property>
+  <property name="frameShadow">
+   <enum>QFrame::Raised</enum>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="horizontalSpacing">
+    <number>1</number>
+   </property>
+   <property name="verticalSpacing">
+    <number>2</number>
+   </property>
+   <property name="margin">
+    <number>1</number>
+   </property>
+   <item row="1" column="0">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QSpinBox" name="MinFreq">
+       <property name="suffix">
+        <string> Hz</string>
+       </property>
+       <property name="minimum">
+        <number>100</number>
+       </property>
+       <property name="maximum">
+        <number>1300</number>
+       </property>
+       <property name="singleStep">
+        <number>100</number>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QRadioButton" name="Smooth">
+       <property name="text">
+        <string>Smooth</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QSpinBox" name="MaxFreq">
+       <property name="suffix">
+        <string> Hz</string>
+       </property>
+       <property name="minimum">
+        <number>1400</number>
+       </property>
+       <property name="maximum">
+        <number>2500</number>
+       </property>
+       <property name="singleStep">
+        <number>100</number>
+       </property>
+       <property name="value">
+        <number>2500</number>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="0">
+    <widget class="QSplitter" name="spectrumSplitter">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>1</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="frameShape">
+      <enum>QFrame::NoFrame</enum>
+     </property>
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="opaqueResize">
+      <bool>true</bool>
+     </property>
+     <property name="childrenCollapsible">
+      <bool>false</bool>
+     </property>
+     <widget class="SpectrumWindow" name="spectrumWindow">
+      <property name="minimumSize">
+       <size>
+        <width>100</width>
+        <height>80</height>
+       </size>
+      </property>
+      <property name="frameShape">
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+     </widget>
+     <widget class="WaterfallWindow" name="waterfallWindow">
+      <property name="minimumSize">
+       <size>
+        <width>100</width>
+        <height>30</height>
+       </size>
+      </property>
+      <property name="frameShape">
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow">
+       <enum>QFrame::Plain</enum>
+      </property>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>SpectrumWindow</class>
+   <extends>QFrame</extends>
+   <header>spectrumwindow.h</header>
+   <container>1</container>
+   <slots>
+    <signal>frequencyChanged(int)</signal>
+   </slots>
+  </customwidget>
+  <customwidget>
+   <class>WaterfallWindow</class>
+   <extends>QFrame</extends>
+   <header>waterfallwindow.h</header>
+   <container>1</container>
+   <slots>
+    <signal>frequencyChanged(int)</signal>
+   </slots>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>spectrumWindow</sender>
+   <signal>frequencyChanged(int)</signal>
+   <receiver>SpectrumDisplay</receiver>
+   <slot>setnewFrequency(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>204</x>
+     <y>80</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>204</x>
+     <y>131</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>waterfallWindow</sender>
+   <signal>frequencyChanged(int)</signal>
+   <receiver>SpectrumDisplay</receiver>
+   <slot>setnewFrequency(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>204</x>
+     <y>188</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>204</x>
+     <y>131</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>setnewFrequency(int)</slot>
+ </slots>
+</ui>
diff --git a/gui/txwindow.cpp b/gui/txwindow.cpp
new file mode 100644
index 0000000..324689a
--- /dev/null
+++ b/gui/txwindow.cpp
@@ -0,0 +1,194 @@
+/***************************************************************************
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "txwindow.h"
+#include "ui_txwindow.h"
+#include <QLineEdit>
+#include <QKeyEvent>
+#include "parameter.h"
+#include "ctxbuffer.h"
+#include <QFontMetrics>
+
+extern Parameter settings;
+
+TxWindow::TxWindow(QWidget *parent) :
+  QFrame(parent),
+  ui(new Ui::TxWindow)
+{
+  QFontMetrics fm ( font() );
+  int pixelwidth=82*fm.width("A");
+  ui->setupUi(this);
+  zeile=0;
+  spalte=0;
+//  ui->txLines->setFixedWidth(40*fm.maxWidth());
+  for ( int i = 0;i < TXWINDOWBUFFER;i++ )
+  {
+    scrollBuffer[i] = new QLineEdit ( ui->txLines );
+    scrollBuffer[i]->setFrame ( false );
+    scrollBuffer[i]->setFocusProxy(ui->txLines);
+    scrollBuffer[i]->setMaximumHeight(18);
+    scrollBuffer[i]->setFixedWidth(pixelwidth);
+    ui->linesLayout->addWidget(scrollBuffer[i]);
+  }
+  setFocusPolicy(Qt::ClickFocus);
+  ui->txArea->ensureWidgetVisible(scrollBuffer[zeile]);
+}
+
+TxWindow::~TxWindow()
+{
+  delete ui;
+}
+void TxWindow::insert ( unsigned char c )
+{
+  QString s = scrollBuffer[zeile]->text() + QString ( QChar ( c ) );
+  scrollBuffer[zeile]->setText ( s );
+  spalte++;
+  if(c == '\n')
+    {
+ //     Buffer->insert(c);
+      gotoNextLine();
+    }
+  else if (spalte >= 80)
+    {
+      if(settings.autoCrLf)
+        Buffer->insert('\r');
+      Buffer->insert ( '\n' );
+      gotoNextLine();
+    }
+}
+
+void TxWindow::insertString (QString string )
+{
+  for(int i=0;i < string.length();i++)
+    insert(string.at(i).toAscii());
+}
+void TxWindow::setTxBuffer ( CTxBuffer *p )
+{
+  Buffer = p;
+}
+void TxWindow::gotoNextLine()
+{
+  int i;
+  zeile++;
+  spalte=0;
+  if( zeile >= TXWINDOWBUFFER) //Scroll two lines
+    {
+      for(i=2; i< TXWINDOWBUFFER;i++)
+        scrollBuffer[i-2]->setText(scrollBuffer[i]->text());
+      zeile = TXWINDOWBUFFER-2;
+      for(i=zeile; i < TXWINDOWBUFFER;i++)
+        scrollBuffer[i]->clear();
+    }
+  scrollBuffer[zeile]->setCursorPosition(spalte);
+  ui->txArea->ensureWidgetVisible(scrollBuffer[zeile]);
+}
+void TxWindow::clearBuffers()
+{
+  for ( int i = 0;i < TXWINDOWBUFFER;i++ )
+    scrollBuffer[i]->clear();
+  Buffer->clear();
+  zeile=0;
+  spalte=0;
+  scrollBuffer[zeile]->setCursorPosition(spalte);
+  ui->txArea->ensureWidgetVisible(scrollBuffer[zeile]);
+}
+void TxWindow::keyPressEvent ( QKeyEvent *e )
+{
+  unsigned char c;
+  bool CapsLock = false; // Fixme checking CapsLock state
+  if ( Buffer->Filled() )
+  {
+    QApplication::beep();
+    e->ignore();
+    return;
+  }
+  /**
+  if ( e->state() & ControlButton )
+   {
+    if ( e->key() == Key_V )
+     pasteText( QApplication::clipboard()->text( QClipboard::Clipboard ) );
+   }
+  else
+  **/
+  switch ( e->key() )
+  {
+    case Qt::Key_Enter:
+    case Qt::Key_Return:
+      gotoNextLine();
+      if(settings.autoCrLf)
+        Buffer->insert('\r');
+      Buffer->insert ( '\n' );
+      e->accept();
+      break;
+  case Qt::Key_Home:
+    Buffer->insert('\r');
+    e->accept();
+    break;
+    case Qt::Key_CapsLock:
+      CapsLock = !CapsLock;
+      e->accept();
+      break;
+
+    case Qt::Key_Backspace:
+      c = '\b';
+      Buffer->insert ( c );
+      backspace();
+      e->accept();
+      break;
+
+    default:
+//    ButtonState cc=e->state();
+//    if ( (cc == ShiftButton) )
+      if ( ( e->modifiers() == Qt::ShiftModifier ) || CapsLock )
+      {
+        if ( !e->text().isEmpty() )
+          c = e->text().toUpper().at ( 0 ).toAscii();
+        else
+          c = 0;
+      }
+      else
+      {
+        if ( !e->text().isEmpty() )
+          c = e->text().toLower().at ( 0 ).toAscii();
+        else
+          c = 0;
+      }
+      if ( c != 0 )
+      {
+        Buffer->insert ( c );
+        insert ( c );
+        e->accept();
+      }
+  } // End Case
+
+} // keyPressEvent
+void TxWindow::backspace()
+{
+  if(spalte > 0)
+  {
+    spalte--;
+    scrollBuffer[zeile]->backspace();
+  }
+  else if (zeile > 0)
+  {
+    zeile--;
+    spalte=(scrollBuffer[zeile]->text()).length();
+    ui->txArea->ensureWidgetVisible(scrollBuffer[zeile]);
+  }
+}
diff --git a/gui/editmacro.h b/gui/txwindow.h
similarity index 62%
copy from gui/editmacro.h
copy to gui/txwindow.h
index fdad2b0..288a1a5 100644
--- a/gui/editmacro.h
+++ b/gui/txwindow.h
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by volker, DL1KSV   *
- *   schroer at tux64   *
+ *   Copyright (C) 2012 by Volker Schroer, DL1KSV                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -18,38 +17,47 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#ifndef EDITMACRO_H
-#define EDITMACRO_H
+#ifndef TXWINDOW_H
+#define TXWINDOW_H
 
-#include <QDialog>
-#include "ui_editmacro.h"
+#include <QFrame>
+#include "constants.h"
 
-class Macros;
-class ReadOnlyStringListModel;
+class CTxBuffer;
+class QString;
+class QLineEdit;
 
+namespace Ui {
+  class TxWindow;
+}
 
-class EditMacro : public QDialog, private Ui::EditMacro
+class TxWindow : public QFrame
 {
   Q_OBJECT
 
 public:
-  EditMacro(Macros *M,QWidget* parent = 0, Qt::WFlags fl = 0 );
-  ~EditMacro();
+  explicit TxWindow(QWidget *parent = 0);
+  ~TxWindow();
+  void setTxBuffer(CTxBuffer *);
+  void insertString(QString string);
+  void insert(unsigned char);
 
 
-public slots:
-  /*$PUBLIC_SLOTS$*/
+private:
+  Ui::TxWindow *ui;
 
-protected:
-Macros *AllMacros;
-ReadOnlyStringListModel *model;
+  CTxBuffer * Buffer;
+  QLineEdit* scrollBuffer[TXWINDOWBUFFER];
+  int zeile,spalte; // Position in  window buffer
 
-protected slots:
-  /*$PROTECTED_SLOTS$*/
-  virtual void accept();
-void setText( int Number);
-void insertKeyword(const QModelIndex &);
-};
+  void gotoNextLine();
+  void backspace();
 
-#endif
+  void keyPressEvent(QKeyEvent *); // Bearbeiten der Eingaben im TX Window
+  protected:
+//  virtual void mousePressEvent( QMouseEvent * );
+private slots:
+  void clearBuffers();
+};
 
+#endif // TXWINDOW_H
diff --git a/gui/txwindow.ui b/gui/txwindow.ui
new file mode 100644
index 0000000..18a6642
--- /dev/null
+++ b/gui/txwindow.ui
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TxWindow</class>
+ <widget class="QFrame" name="TxWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>494</width>
+    <height>236</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Frame</string>
+  </property>
+  <property name="frameShape">
+   <enum>QFrame::StyledPanel</enum>
+  </property>
+  <property name="frameShadow">
+   <enum>QFrame::Raised</enum>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>1</number>
+   </property>
+   <property name="spacing">
+    <number>1</number>
+   </property>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="clearWindow">
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>20</height>
+      </size>
+     </property>
+     <property name="text">
+      <string>Clear</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <spacer name="horizontalSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>383</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="0" column="0" colspan="2">
+    <widget class="QScrollArea" name="txArea">
+     <property name="horizontalScrollBarPolicy">
+      <enum>Qt::ScrollBarAsNeeded</enum>
+     </property>
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="txLines">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>484</width>
+        <height>205</height>
+       </rect>
+      </property>
+      <layout class="QVBoxLayout" name="linesLayout">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <property name="sizeConstraint">
+        <enum>QLayout::SetNoConstraint</enum>
+       </property>
+       <property name="margin">
+        <number>0</number>
+       </property>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>clearWindow</sender>
+   <signal>clicked()</signal>
+   <receiver>TxWindow</receiver>
+   <slot>clearBuffers()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>450</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>246</x>
+     <y>117</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>clearBuffers()</slot>
+ </slots>
+</ui>
diff --git a/linpsk.pro b/linpsk.pro
index 067e769..cb3dca8 100644
--- a/linpsk.pro
+++ b/linpsk.pro
@@ -1,17 +1,24 @@
+CONFIG(debug, debug|release) {
+    QMAKE_CXXFLAGS_DEBUG += -g3 \
+    -fpermissive \
+    -O0
+CONFIG +=  debug
+} else {
+    DEFINES += QT_NO_DEBUG
+    DEFINES += QT_NO_DEBUG_OUTPUT
+    QMAKE_CXXFLAGS_DEBUG +=-fpermissive \
+    -O2
+}
+
 CONFIG += warn_on \
           qt \
           thread  \
- ordered \
- debug
+ ordered
 DESTDIR = .
 
 SUBDIRS += gui \
   src
 
-
-
-CONFIG -= debug
-
 QT += network
 
 
@@ -19,5 +26,5 @@ TEMPLATE = subdirs
 
 LIBS += gui/libgui.a
 
-TARGETDEPS += gui/libgui.a \
+POST_TARGETDEPS += gui/libgui.a \
 src/../bin/linpsk
diff --git a/src/cdemodulator.cpp b/src/cdemodulator.cpp
index ecafe91..f3c9af7 100644
--- a/src/cdemodulator.cpp
+++ b/src/cdemodulator.cpp
@@ -33,11 +33,6 @@ void CDemodulator::setRxFrequency(double freq)
 {
  if ( (freq > 200 ) && (freq < 3000 ) ) 
   RxFrequency = freq;
- else
-  {
-   printf("Invalid Frequency %f\n",freq);
-   return;
-  }
 }
 
 double CDemodulator::getRxFrequency(void)
diff --git a/src/cdemodulator.h b/src/cdemodulator.h
index fdc38ab..6375d6f 100644
--- a/src/cdemodulator.h
+++ b/src/cdemodulator.h
@@ -17,13 +17,14 @@
 #ifndef CDEMODULATOR_H
 #define CDEMODULATOR_H
 
-#include <qobject.h>
 #include <complex>
-#include <cstdio>
+#include <qobject.h>
+//#include <cstdio>
 #include "constants.h"
 /**Base class for all possible types of demodulators
   *@author Volker Schroer
   */
+
 class CDemodulator : public QObject
  {
  Q_OBJECT
@@ -39,7 +40,7 @@ public:
  virtual double get2RxFrequency(void);
  /** Initialises something */
  virtual bool Init(double,int) = 0;
- virtual std::complex<float> *getPhasePointer();
+ virtual std::complex<float> * getPhasePointer();
  virtual int getSquelchValue() = 0;
  virtual AfcMode getAfcMode();
  virtual AfcMode AfcProperties() = 0;
diff --git a/src/cledbutton.cpp b/src/cledbutton.cpp
index ce1f816..de736c5 100644
--- a/src/cledbutton.cpp
+++ b/src/cledbutton.cpp
@@ -33,8 +33,6 @@ void CLedButton::paintEvent(QPaintEvent *e)
 QPushButton::paintEvent(e);
 QPainter paint(this);
 
-
-//drawButton(&paint);
 switch (status)
 	{
 	case ON:
diff --git a/src/constants.h b/src/constants.h
index 7a5d87e..6b0cc3f 100644
--- a/src/constants.h
+++ b/src/constants.h
@@ -34,7 +34,7 @@
 #define BUF_SIZE 4096	//size of data chunks to process at a time from
                         // the soundcard
 #define RXWINDOWBUFFER 50 // Max Number of Lines in the RX ScrollBuffer
-
+#define TXWINDOWBUFFER 6  // Mux Number of Lines in TX Scrollbuffer
 // define some constants
 #define PI2 ( M_PI + M_PI )		// 2 Pi
 
@@ -54,6 +54,7 @@ enum StopBits {One,Onepoint5,Two};
 enum RxTxParameterType{Reverse,Offset,Parity,Extra,Standard};
 enum StateOfReception { WaitingForMark,WaitingForSpace, CheckingStartBit,SkipRestOfStartBit,CollectingByte,
                         CheckingParity, WaitingForStopBits,ThrowHalfBit};
+enum QsoData{CallSign,QTH,Name,Locator,RST,DOK};
 
 
 typedef struct
@@ -78,19 +79,286 @@ typedef struct
  QString OpName;
  QString Qth;
  QString Locator;
- QString QsoFrequency;
+ int QsoFrequency; // Number of item in QCombobox
  QString HisRST;
  QString MyRST;
  QDate QsoDate;
  QTime QsoTime;
-QString mainPrefix;
-QString continent;
-QString wazZone;
-QString ituZone;
-QString countryName;
-QString worked;
+ QString mainPrefix;
+ QString continent;
+ QString wazZone;
+ QString ituZone;
+ QString countryName;
+ QString worked;
+ QString dokName;
 } QsoInfo;
 
-#define HilbertFilterLength 37
+//enum LangType{0,1,2};
+struct Macro {
+  QString name;
+  QString text;
+  QString accelerator;
+  int languageType; // 0,1,2
+};
+
+static const unsigned short int VARICODE_TABLE[] = {
+    0xAAC0,	// ASCII =   0	1010101011
+    0xB6C0,	// ASCII =   1	1011011011
+    0xBB40,	// ASCII =   2	1011101101
+    0xDDC0,	// ASCII =   3	1101110111
+    0xBAC0,	// ASCII =   4	1011101011
+    0xD7C0,	// ASCII =   5	1101011111
+    0xBBC0,	// ASCII =   6	1011101111
+    0xBF40,	// ASCII =   7	1011111101
+    0xBFC0,	// ASCII =   8	1011111111
+    0xEF00,	// ASCII =   9	11101111
+    0xE800,	// ASCII =  10	11101
+    0xDBC0,	// ASCII =  11	1101101111
+    0xB740,	// ASCII =  12	1011011101
+    0xF800,	// ASCII =  13	11111
+    0xDD40,	// ASCII =  14	1101110101
+    0xEAC0,	// ASCII =  15	1110101011
+    0xBDC0,	// ASCII =  16	1011110111
+    0xBD40,	// ASCII =  17	1011110101
+    0xEB40,	// ASCII =  18	1110101101
+    0xEBC0,	// ASCII =  19	1110101111
+    0xD6C0,	// ASCII =  20	1101011011
+    0xDAC0,	// ASCII =  21	1101101011
+    0xDB40,	// ASCII =  22	1101101101
+    0xD5C0,	// ASCII =  23	1101010111
+    0xDEC0,	// ASCII =  24	1101111011
+    0xDF40,	// ASCII =  25	1101111101
+    0xEDC0,	// ASCII =  26	1110110111
+    0xD540,	// ASCII =  27	1101010101
+    0xD740,	// ASCII =  28	1101011101
+    0xEEC0,	// ASCII =  29	1110111011
+    0xBEC0,	// ASCII =  30	1011111011
+    0xDFC0,	// ASCII =  31	1101111111
+    0x8000,	// ASCII = ' '	1
+    0xFF80,	// ASCII = '!'	111111111
+    0xAF80,	// ASCII = '"'	101011111
+    0xFA80,	// ASCII = '#'	111110101
+    0xED80,	// ASCII = '$'	111011011
+    0xB540,	// ASCII = '%'	1011010101
+    0xAEC0,	// ASCII = '&'	1010111011
+    0xBF80,	// ASCII = '''	101111111
+    0xFB00,	// ASCII = '('	11111011
+    0xF700,	// ASCII = ')'	11110111
+    0xB780,	// ASCII = '*'	101101111
+    0xEF80,	// ASCII = '+'	111011111
+    0xEA00,	// ASCII = ','	1110101
+    0xD400,	// ASCII = '-'	110101
+    0xAE00,	// ASCII = '.'	1010111
+    0xD780,	// ASCII = '/'	110101111
+    0xB700,	// ASCII = '0'	10110111
+    0xBD00,	// ASCII = '1'	10111101
+    0xED00,	// ASCII = '2'	11101101
+    0xFF00,	// ASCII = '3'	11111111
+    0xBB80,	// ASCII = '4'	101110111
+    0xAD80,	// ASCII = '5'	101011011
+    0xB580,	// ASCII = '6'	101101011
+    0xD680,	// ASCII = '7'	110101101
+    0xD580,	// ASCII = '8'	110101011
+    0xDB80,	// ASCII = '9'	110110111
+    0xF500,	// ASCII = ':'	11110101
+    0xDE80,	// ASCII = ';'	110111101
+    0xF680,	// ASCII = '<'	111101101
+    0xAA00,	// ASCII = '='	1010101
+    0xEB80,	// ASCII = '>'	111010111
+    0xABC0,	// ASCII = '?'	1010101111
+    0xAF40,	// ASCII = '@'	1010111101
+    0xFA00,	// ASCII = 'A'	1111101
+    0xEB00,	// ASCII = 'B'	11101011
+    0xAD00,	// ASCII = 'C'	10101101
+    0xB500,	// ASCII = 'D'	10110101
+    0xEE00,	// ASCII = 'E'	1110111
+    0xDB00,	// ASCII = 'F'	11011011
+    0xFD00,	// ASCII = 'G'	11111101
+    0xAA80,	// ASCII = 'H'	101010101
+    0xFE00,	// ASCII = 'I'	1111111
+    0xFE80,	// ASCII = 'J'	111111101
+    0xBE80,	// ASCII = 'K'	101111101
+    0xD700,	// ASCII = 'L'	11010111
+    0xBB00,	// ASCII = 'M'	10111011
+    0xDD00,	// ASCII = 'N'	11011101
+    0xAB00,	// ASCII = 'O'	10101011
+    0xD500,	// ASCII = 'P'	11010101
+    0xEE80,	// ASCII = 'Q'	111011101
+    0xAF00,	// ASCII = 'R'	10101111
+    0xDE00,	// ASCII = 'S'	1101111
+    0xDA00,	// ASCII = 'T'	1101101
+    0xAB80,	// ASCII = 'U'	101010111
+    0xDA80,	// ASCII = 'V'	110110101
+    0xAE80,	// ASCII = 'W'	101011101
+    0xBA80,	// ASCII = 'X'	101110101
+    0xBD80,	// ASCII = 'Y'	101111011
+    0xAB40,	// ASCII = 'Z'	1010101101
+    0xFB80,	// ASCII = '['	111110111
+    0xF780,	// ASCII = '\'	111101111
+    0xFD80,	// ASCII = ']'	111111011
+    0xAFC0,	// ASCII = '^'	1010111111
+    0xB680,	// ASCII = '_'	101101101
+    0xB7C0,	// ASCII = '`'	1011011111
+    0xB000,	// ASCII = 'a'	1011
+    0xBE00,	// ASCII = 'b'	1011111
+    0xBC00,	// ASCII = 'c'	101111
+    0xB400,	// ASCII = 'd'	101101
+    0xC000,	// ASCII = 'e'	11
+    0xF400,	// ASCII = 'f'	111101
+    0xB600,	// ASCII = 'g'	1011011
+    0xAC00,	// ASCII = 'h'	101011
+    0xD000,	// ASCII = 'i'	1101
+    0xF580,	// ASCII = 'j'	111101011
+    0xBF00,	// ASCII = 'k'	10111111
+    0xD800,	// ASCII = 'l'	11011
+    0xEC00,	// ASCII = 'm'	111011
+    0xF000,	// ASCII = 'n'	1111
+    0xE000,	// ASCII = 'o'	111
+    0xFC00,	// ASCII = 'p'	111111
+    0xDF80,	// ASCII = 'q'	110111111
+    0xA800,	// ASCII = 'r'	10101
+    0xB800,	// ASCII = 's'	10111
+    0xA000,	// ASCII = 't'	101
+    0xDC00,	// ASCII = 'u'	110111
+    0xF600,	// ASCII = 'v'	1111011
+    0xD600,	// ASCII = 'w'	1101011
+    0xDF00,	// ASCII = 'x'	11011111
+    0xBA00,	// ASCII = 'y'	1011101
+    0xEA80,	// ASCII = 'z'	111010101
+    0xADC0,	// ASCII = '{'	1010110111
+    0xDD80,	// ASCII = '|'	110111011
+    0xAD40,	// ASCII = '}'	1010110101
+    0xB5C0,	// ASCII = '~'	1011010111
+    0xED40,	// ASCII = 127	1110110101
+    0xEF40,	// ASCII = 128	1110111101
+    0xEFC0,	// ASCII = 129	1110111111
+    0xF540,	// ASCII = 130	1111010101
+    0xF5C0,	// ASCII = 131	1111010111
+    0xF6C0,	// ASCII = 132	1111011011
+    0xF740,	// ASCII = 133	1111011101
+    0xF7C0,	// ASCII = 134	1111011111
+    0xFAC0,	// ASCII = 135	1111101011
+    0xFB40,	// ASCII = 136	1111101101
+    0xFBC0,	// ASCII = 137	1111101111
+    0xFD40,	// ASCII = 138	1111110101
+    0xFDC0,	// ASCII = 139	1111110111
+    0xFEC0,	// ASCII = 140	1111111011
+    0xFF40,	// ASCII = 141	1111111101
+    0xFFC0,	// ASCII = 142	1111111111
+    0xAAA0,	// ASCII = 143	10101010101
+    0xAAE0,	// ASCII = 144	10101010111
+    0xAB60,	// ASCII = 145	10101011011
+    0xABA0,	// ASCII = 146	10101011101
+    0xABE0,	// ASCII = 147	10101011111
+    0xAD60,	// ASCII = 148	10101101011
+    0xADA0,	// ASCII = 149	10101101101
+    0xADE0,	// ASCII = 150	10101101111
+    0xAEA0,	// ASCII = 151	10101110101
+    0xAEE0,	// ASCII = 152	10101110111
+    0xAF60,	// ASCII = 153	10101111011
+    0xAFA0,	// ASCII = 154	10101111101
+    0xAFE0,	// ASCII = 155	10101111111
+    0xB560,	// ASCII = 156	10110101011
+    0xB5A0,	// ASCII = 157	10110101101
+    0xB5E0,	// ASCII = 158	10110101111
+    0xB6A0,	// ASCII = 159	10110110101
+    0xB6E0,	// ASCII = 160	10110110111
+    0xB760,	// ASCII = 161	10110111011
+    0xB7A0,	// ASCII = 162	10110111101
+    0xB7E0,	// ASCII = 163	10110111111
+    0xBAA0,	// ASCII = 164	10111010101
+    0xBAE0,	// ASCII = 165	10111010111
+    0xBB60,	// ASCII = 166	10111011011
+    0xBBA0,	// ASCII = 167	10111011101
+    0xBBE0,	// ASCII = 168	10111011111
+    0xBD60,	// ASCII = 169	10111101011
+    0xBDA0,	// ASCII = 170	10111101101
+    0xBDE0,	// ASCII = 171	10111101111
+    0xBEA0,	// ASCII = 172	10111110101
+    0xBEE0,	// ASCII = 173	10111110111
+    0xBF60,	// ASCII = 174	10111111011
+    0xBFA0,	// ASCII = 175	10111111101
+    0xBFE0,	// ASCII = 176	10111111111
+    0xD560,	// ASCII = 177	11010101011
+    0xD5A0,	// ASCII = 178	11010101101
+    0xD5E0,	// ASCII = 179	11010101111
+    0xD6A0,	// ASCII = 180	11010110101
+    0xD6E0,	// ASCII = 181	11010110111
+    0xD760,	// ASCII = 182	11010111011
+    0xD7A0,	// ASCII = 183	11010111101
+    0xD7E0,	// ASCII = 184	11010111111
+    0xDAA0,	// ASCII = 185	11011010101
+    0xDAE0,	// ASCII = 186	11011010111
+    0xDB60,	// ASCII = 187	11011011011
+    0xDBA0,	// ASCII = 188	11011011101
+    0xDBE0,	// ASCII = 189	11011011111
+    0xDD60,	// ASCII = 190	11011101011
+    0xDDA0,	// ASCII = 191	11011101101
+    0xDDE0,	// ASCII = 192	11011101111
+    0xDEA0,	// ASCII = 193	11011110101
+    0xDEE0,	// ASCII = 194	11011110111
+    0xDF60,	// ASCII = 195	11011111011
+    0xDFA0,	// ASCII = 196	11011111101
+    0xDFE0,	// ASCII = 197	11011111111
+    0xEAA0,	// ASCII = 198	11101010101
+    0xEAE0,	// ASCII = 199	11101010111
+    0xEB60,	// ASCII = 200	11101011011
+    0xEBA0,	// ASCII = 201	11101011101
+    0xEBE0,	// ASCII = 202	11101011111
+    0xED60,	// ASCII = 203	11101101011
+    0xEDA0,	// ASCII = 204	11101101101
+    0xEDE0,	// ASCII = 205	11101101111
+    0xEEA0,	// ASCII = 206	11101110101
+    0xEEE0,	// ASCII = 207	11101110111
+    0xEF60,	// ASCII = 208	11101111011
+    0xEFA0,	// ASCII = 209	11101111101
+    0xEFE0,	// ASCII = 210	11101111111
+    0xF560,	// ASCII = 211	11110101011
+    0xF5A0,	// ASCII = 212	11110101101
+    0xF5E0,	// ASCII = 213	11110101111
+    0xF6A0,	// ASCII = 214	11110110101
+    0xF6E0,	// ASCII = 215	11110110111
+    0xF760,	// ASCII = 216	11110111011
+    0xF7A0,	// ASCII = 217	11110111101
+    0xF7E0,	// ASCII = 218	11110111111
+    0xFAA0,	// ASCII = 219	11111010101
+    0xFAE0,	// ASCII = 220	11111010111
+    0xFB60,	// ASCII = 221	11111011011
+    0xFBA0,	// ASCII = 222	11111011101
+    0xFBE0,	// ASCII = 223	11111011111
+    0xFD60,	// ASCII = 224	11111101011
+    0xFDA0,	// ASCII = 225	11111101101
+    0xFDE0,	// ASCII = 226	11111101111
+    0xFEA0,	// ASCII = 227	11111110101
+    0xFEE0,	// ASCII = 228	11111110111
+    0xFF60,	// ASCII = 229	11111111011
+    0xFFA0,	// ASCII = 230	11111111101
+    0xFFE0,	// ASCII = 231	11111111111
+    0xAAB0,	// ASCII = 232	101010101011
+    0xAAD0,	// ASCII = 233	101010101101
+    0xAAF0,	// ASCII = 234	101010101111
+    0xAB50,	// ASCII = 235	101010110101
+    0xAB70,	// ASCII = 236	101010110111
+    0xABB0,	// ASCII = 237	101010111011
+    0xABD0,	// ASCII = 238	101010111101
+    0xABF0,	// ASCII = 239	101010111111
+    0xAD50,	// ASCII = 240	101011010101
+    0xAD70,	// ASCII = 241	101011010111
+    0xADB0,	// ASCII = 242	101011011011
+    0xADD0,	// ASCII = 243	101011011101
+    0xADF0,	// ASCII = 244	101011011111
+    0xAEB0,	// ASCII = 245	101011101011
+    0xAED0,	// ASCII = 246	101011101101
+    0xAEF0,	// ASCII = 247	101011101111
+    0xAF50,	// ASCII = 248	101011110101
+    0xAF70,	// ASCII = 249	101011110111
+    0xAFB0,	// ASCII = 250	101011111011
+    0xAFD0,	// ASCII = 251	101011111101
+    0xAFF0,	// ASCII = 252	101011111111
+    0xB550,	// ASCII = 253	101101010101
+    0xB570,	// ASCII = 254	101101010111
+    0xB5B0	// ASCII = 255	101101011011
+};
+
 
 #endif
diff --git a/src/controlpanel.cpp b/src/controlpanel.cpp
deleted file mode 100644
index 0c60e26..0000000
--- a/src/controlpanel.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-
-#include "controlpanel.h"
-
-#include <qvariant.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
-
-#include "spectrumdisplay.h"
-#include "qsodata.h"
-#include "macrowindow.h"
-
-/* 
- *  Constructs a ControlPanel which is a child of 'parent', with the 
- *  name 'name'.' 
- */
-ControlPanel::ControlPanel(Macros *Macro, QWidget* parent)
-    : QFrame( parent )
-{
-    setFrameShape( QFrame::StyledPanel );
-    setFrameShadow( QFrame::Sunken );
-
-    Display = new SpectrumDisplay( this );
-    QSO = new QSOData(this);
-    MacroBox = new MacroWindow(Macro,this);
-
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-ControlPanel::~ControlPanel()
-{
- if(QSO)
-  delete QSO;
- QSO=0;
-    // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
-
-void ControlPanel::calculateSizeofComponents()
-{
-#define TOPMARGIN 2
-#define LEFTMARGIN 1
-#define SPECTRUMWIDTH 35
-#define SPECTRUMHEIGHT 85
-#define QSODATAWIDTH 45
-#define MACROBOXWIDTH 17
-int xpos,ypos,width,height,innerheight,innerwidth,innerwidthqso,innerwidthmacros;
-width=this->width();
-height=this->height();
-xpos=width*LEFTMARGIN/100;
-ypos=height*TOPMARGIN/100;
-innerwidth=(width-xpos)*SPECTRUMWIDTH/100;
-innerwidthqso=(width-xpos)*QSODATAWIDTH/100;
-innerwidthmacros=(width-xpos)*MACROBOXWIDTH/100;
-innerheight=((height-2*ypos)*SPECTRUMHEIGHT)/100;
-Display->setGeometry(xpos,ypos,innerwidth,innerheight);
-xpos=xpos+innerwidth+10;
-innerheight=(height*(100-2*TOPMARGIN))/100;
-QSO->setGeometry(xpos,ypos,innerwidthqso,innerheight);
-xpos = xpos+innerwidthqso+10;
-MacroBox->setGeometry(xpos,ypos,innerwidthmacros,innerheight);
-MacroBox->show();
-}
-
-void ControlPanel::resizeEvent( QResizeEvent * )
-{
-calculateSizeofComponents();
-}
diff --git a/src/controlpanel.h b/src/controlpanel.h
deleted file mode 100644
index f0f50f0..0000000
--- a/src/controlpanel.h
+++ /dev/null
@@ -1,43 +0,0 @@
-
-#ifndef CONTROLPANEL_H
-#define CONTROLPANEL_H
-
-#include <qvariant.h>
-#include <qpixmap.h>
-#include <qframe.h>
-#include <vector>
-
-using namespace std;
-
-
-class SpectrumDisplay;
-class QSOData;
-class MacroWindow;
-class Macros;
-
-class ControlPanel : public QFrame
-{
-    Q_OBJECT
-
-public:
-    ControlPanel(Macros *M, QWidget* parent = 0);
-    ~ControlPanel();
-
-    SpectrumDisplay* Display;
-    QSOData *QSO;
-    MacroWindow  *MacroBox;
-
- 
-protected:
-    void resizeEvent( QResizeEvent * );
-public slots:
- 
-protected slots:
-
-private:
- 
-    void calculateSizeofComponents();
-
-};
-
-#endif // CONTROLPANEL_H
diff --git a/src/cpskdemodulator.cpp b/src/cpskdemodulator.cpp
index 34cfb14..48246a8 100644
--- a/src/cpskdemodulator.cpp
+++ b/src/cpskdemodulator.cpp
@@ -15,277 +15,12 @@
  *    based on the work of  Moe Wheatly, AE4JY                             *  
  ***************************************************************************/
 
-
-
-
 #include "cpskdemodulator.h"
 #include "fircoeffs.h"
 #include "parameter.h"
-
+#include <cstdio>
 extern Parameter settings;
 
-
-static const unsigned short int VARICODE_TABLE[] = {
-	0xAAC0,	// ASCII =   0	1010101011
-	0xB6C0,	// ASCII =   1	1011011011
-	0xBB40,	// ASCII =   2	1011101101
-	0xDDC0,	// ASCII =   3	1101110111
-	0xBAC0,	// ASCII =   4	1011101011
-	0xD7C0,	// ASCII =   5	1101011111
-	0xBBC0,	// ASCII =   6	1011101111
-	0xBF40,	// ASCII =   7	1011111101
-	0xBFC0,	// ASCII =   8	1011111111
-	0xEF00,	// ASCII =   9	11101111
-	0xE800,	// ASCII =  10	11101
-	0xDBC0,	// ASCII =  11	1101101111
-	0xB740,	// ASCII =  12	1011011101
-	0xF800,	// ASCII =  13	11111
-	0xDD40,	// ASCII =  14	1101110101
-	0xEAC0,	// ASCII =  15	1110101011
-	0xBDC0,	// ASCII =  16	1011110111
-	0xBD40,	// ASCII =  17	1011110101
-	0xEB40,	// ASCII =  18	1110101101
-	0xEBC0,	// ASCII =  19	1110101111
-	0xD6C0,	// ASCII =  20	1101011011
-	0xDAC0,	// ASCII =  21	1101101011
-	0xDB40,	// ASCII =  22	1101101101
-	0xD5C0,	// ASCII =  23	1101010111
-	0xDEC0,	// ASCII =  24	1101111011
-	0xDF40,	// ASCII =  25	1101111101
-	0xEDC0,	// ASCII =  26	1110110111
-	0xD540,	// ASCII =  27	1101010101
-	0xD740,	// ASCII =  28	1101011101
-	0xEEC0,	// ASCII =  29	1110111011
-	0xBEC0,	// ASCII =  30	1011111011
-	0xDFC0,	// ASCII =  31	1101111111
-	0x8000,	// ASCII = ' '	1
-	0xFF80,	// ASCII = '!'	111111111
-	0xAF80,	// ASCII = '"'	101011111
-	0xFA80,	// ASCII = '#'	111110101
-	0xED80,	// ASCII = '$'	111011011
-	0xB540,	// ASCII = '%'	1011010101
-	0xAEC0,	// ASCII = '&'	1010111011
-	0xBF80,	// ASCII = '''	101111111
-	0xFB00,	// ASCII = '('	11111011
-	0xF700,	// ASCII = ')'	11110111
-	0xB780,	// ASCII = '*'	101101111
-	0xEF80,	// ASCII = '+'	111011111
-	0xEA00,	// ASCII = ','	1110101
-	0xD400,	// ASCII = '-'	110101
-	0xAE00,	// ASCII = '.'	1010111
-	0xD780,	// ASCII = '/'	110101111
-	0xB700,	// ASCII = '0'	10110111
-	0xBD00,	// ASCII = '1'	10111101
-	0xED00,	// ASCII = '2'	11101101
-	0xFF00,	// ASCII = '3'	11111111
-	0xBB80,	// ASCII = '4'	101110111
-	0xAD80,	// ASCII = '5'	101011011
-	0xB580,	// ASCII = '6'	101101011
-	0xD680,	// ASCII = '7'	110101101
-	0xD580,	// ASCII = '8'	110101011
-	0xDB80,	// ASCII = '9'	110110111
-	0xF500,	// ASCII = ':'	11110101
-	0xDE80,	// ASCII = ';'	110111101
-	0xF680,	// ASCII = '<'	111101101
-	0xAA00,	// ASCII = '='	1010101
-	0xEB80,	// ASCII = '>'	111010111
-	0xABC0,	// ASCII = '?'	1010101111
-	0xAF40,	// ASCII = '@'	1010111101
-	0xFA00,	// ASCII = 'A'	1111101
-	0xEB00,	// ASCII = 'B'	11101011
-	0xAD00,	// ASCII = 'C'	10101101
-	0xB500,	// ASCII = 'D'	10110101
-	0xEE00,	// ASCII = 'E'	1110111
-	0xDB00,	// ASCII = 'F'	11011011
-	0xFD00,	// ASCII = 'G'	11111101
-	0xAA80,	// ASCII = 'H'	101010101
-	0xFE00,	// ASCII = 'I'	1111111
-	0xFE80,	// ASCII = 'J'	111111101
-	0xBE80,	// ASCII = 'K'	101111101
-	0xD700,	// ASCII = 'L'	11010111
-	0xBB00,	// ASCII = 'M'	10111011
-	0xDD00,	// ASCII = 'N'	11011101
-	0xAB00,	// ASCII = 'O'	10101011
-	0xD500,	// ASCII = 'P'	11010101
-	0xEE80,	// ASCII = 'Q'	111011101
-	0xAF00,	// ASCII = 'R'	10101111
-	0xDE00,	// ASCII = 'S'	1101111
-	0xDA00,	// ASCII = 'T'	1101101
-	0xAB80,	// ASCII = 'U'	101010111
-	0xDA80,	// ASCII = 'V'	110110101
-	0xAE80,	// ASCII = 'W'	101011101
-	0xBA80,	// ASCII = 'X'	101110101
-	0xBD80,	// ASCII = 'Y'	101111011
-	0xAB40,	// ASCII = 'Z'	1010101101
-	0xFB80,	// ASCII = '['	111110111
-	0xF780,	// ASCII = '\'	111101111
-	0xFD80,	// ASCII = ']'	111111011
-	0xAFC0,	// ASCII = '^'	1010111111
-	0xB680,	// ASCII = '_'	101101101
-	0xB7C0,	// ASCII = '`'	1011011111
-	0xB000,	// ASCII = 'a'	1011
-	0xBE00,	// ASCII = 'b'	1011111
-	0xBC00,	// ASCII = 'c'	101111
-	0xB400,	// ASCII = 'd'	101101
-	0xC000,	// ASCII = 'e'	11
-	0xF400,	// ASCII = 'f'	111101
-	0xB600,	// ASCII = 'g'	1011011
-	0xAC00,	// ASCII = 'h'	101011
-	0xD000,	// ASCII = 'i'	1101
-	0xF580,	// ASCII = 'j'	111101011
-	0xBF00,	// ASCII = 'k'	10111111
-	0xD800,	// ASCII = 'l'	11011
-	0xEC00,	// ASCII = 'm'	111011
-	0xF000,	// ASCII = 'n'	1111
-	0xE000,	// ASCII = 'o'	111
-	0xFC00,	// ASCII = 'p'	111111
-	0xDF80,	// ASCII = 'q'	110111111
-	0xA800,	// ASCII = 'r'	10101
-	0xB800,	// ASCII = 's'	10111
-	0xA000,	// ASCII = 't'	101
-	0xDC00,	// ASCII = 'u'	110111
-	0xF600,	// ASCII = 'v'	1111011
-	0xD600,	// ASCII = 'w'	1101011
-	0xDF00,	// ASCII = 'x'	11011111
-	0xBA00,	// ASCII = 'y'	1011101
-	0xEA80,	// ASCII = 'z'	111010101
-	0xADC0,	// ASCII = '{'	1010110111
-	0xDD80,	// ASCII = '|'	110111011
-	0xAD40,	// ASCII = '}'	1010110101
-	0xB5C0,	// ASCII = '~'	1011010111
-	0xED40,	// ASCII = 127	1110110101
-	0xEF40,	// ASCII = 128	1110111101
-	0xEFC0,	// ASCII = 129	1110111111
-	0xF540,	// ASCII = 130	1111010101
-	0xF5C0,	// ASCII = 131	1111010111
-	0xF6C0,	// ASCII = 132	1111011011
-	0xF740,	// ASCII = 133	1111011101
-	0xF7C0,	// ASCII = 134	1111011111
-	0xFAC0,	// ASCII = 135	1111101011
-	0xFB40,	// ASCII = 136	1111101101
-	0xFBC0,	// ASCII = 137	1111101111
-	0xFD40,	// ASCII = 138	1111110101
-	0xFDC0,	// ASCII = 139	1111110111
-	0xFEC0,	// ASCII = 140	1111111011
-	0xFF40,	// ASCII = 141	1111111101
-	0xFFC0,	// ASCII = 142	1111111111
-	0xAAA0,	// ASCII = 143	10101010101
-	0xAAE0,	// ASCII = 144	10101010111
-	0xAB60,	// ASCII = 145	10101011011
-	0xABA0,	// ASCII = 146	10101011101
-	0xABE0,	// ASCII = 147	10101011111
-	0xAD60,	// ASCII = 148	10101101011
-	0xADA0,	// ASCII = 149	10101101101
-	0xADE0,	// ASCII = 150	10101101111
-	0xAEA0,	// ASCII = 151	10101110101
-	0xAEE0,	// ASCII = 152	10101110111
-	0xAF60,	// ASCII = 153	10101111011
-	0xAFA0,	// ASCII = 154	10101111101
-	0xAFE0,	// ASCII = 155	10101111111
-	0xB560,	// ASCII = 156	10110101011
-	0xB5A0,	// ASCII = 157	10110101101
-	0xB5E0,	// ASCII = 158	10110101111
-	0xB6A0,	// ASCII = 159	10110110101
-	0xB6E0,	// ASCII = 160	10110110111
-	0xB760,	// ASCII = 161	10110111011
-	0xB7A0,	// ASCII = 162	10110111101
-	0xB7E0,	// ASCII = 163	10110111111
-	0xBAA0,	// ASCII = 164	10111010101
-	0xBAE0,	// ASCII = 165	10111010111
-	0xBB60,	// ASCII = 166	10111011011
-	0xBBA0,	// ASCII = 167	10111011101
-	0xBBE0,	// ASCII = 168	10111011111
-	0xBD60,	// ASCII = 169	10111101011
-	0xBDA0,	// ASCII = 170	10111101101
-	0xBDE0,	// ASCII = 171	10111101111
-	0xBEA0,	// ASCII = 172	10111110101
-	0xBEE0,	// ASCII = 173	10111110111
-	0xBF60,	// ASCII = 174	10111111011
-	0xBFA0,	// ASCII = 175	10111111101
-	0xBFE0,	// ASCII = 176	10111111111
-	0xD560,	// ASCII = 177	11010101011
-	0xD5A0,	// ASCII = 178	11010101101
-	0xD5E0,	// ASCII = 179	11010101111
-	0xD6A0,	// ASCII = 180	11010110101
-	0xD6E0,	// ASCII = 181	11010110111
-	0xD760,	// ASCII = 182	11010111011
-	0xD7A0,	// ASCII = 183	11010111101
-	0xD7E0,	// ASCII = 184	11010111111
-	0xDAA0,	// ASCII = 185	11011010101
-	0xDAE0,	// ASCII = 186	11011010111
-	0xDB60,	// ASCII = 187	11011011011
-	0xDBA0,	// ASCII = 188	11011011101
-	0xDBE0,	// ASCII = 189	11011011111
-	0xDD60,	// ASCII = 190	11011101011
-	0xDDA0,	// ASCII = 191	11011101101
-	0xDDE0,	// ASCII = 192	11011101111
-	0xDEA0,	// ASCII = 193	11011110101
-	0xDEE0,	// ASCII = 194	11011110111
-	0xDF60,	// ASCII = 195	11011111011
-	0xDFA0,	// ASCII = 196	11011111101
-	0xDFE0,	// ASCII = 197	11011111111
-	0xEAA0,	// ASCII = 198	11101010101
-	0xEAE0,	// ASCII = 199	11101010111
-	0xEB60,	// ASCII = 200	11101011011
-	0xEBA0,	// ASCII = 201	11101011101
-	0xEBE0,	// ASCII = 202	11101011111
-	0xED60,	// ASCII = 203	11101101011
-	0xEDA0,	// ASCII = 204	11101101101
-	0xEDE0,	// ASCII = 205	11101101111
-	0xEEA0,	// ASCII = 206	11101110101
-	0xEEE0,	// ASCII = 207	11101110111
-	0xEF60,	// ASCII = 208	11101111011
-	0xEFA0,	// ASCII = 209	11101111101
-	0xEFE0,	// ASCII = 210	11101111111
-	0xF560,	// ASCII = 211	11110101011
-	0xF5A0,	// ASCII = 212	11110101101
-	0xF5E0,	// ASCII = 213	11110101111
-	0xF6A0,	// ASCII = 214	11110110101
-	0xF6E0,	// ASCII = 215	11110110111
-	0xF760,	// ASCII = 216	11110111011
-	0xF7A0,	// ASCII = 217	11110111101
-	0xF7E0,	// ASCII = 218	11110111111
-	0xFAA0,	// ASCII = 219	11111010101
-	0xFAE0,	// ASCII = 220	11111010111
-	0xFB60,	// ASCII = 221	11111011011
-	0xFBA0,	// ASCII = 222	11111011101
-	0xFBE0,	// ASCII = 223	11111011111
-	0xFD60,	// ASCII = 224	11111101011
-	0xFDA0,	// ASCII = 225	11111101101
-	0xFDE0,	// ASCII = 226	11111101111
-	0xFEA0,	// ASCII = 227	11111110101
-	0xFEE0,	// ASCII = 228	11111110111
-	0xFF60,	// ASCII = 229	11111111011
-	0xFFA0,	// ASCII = 230	11111111101
-	0xFFE0,	// ASCII = 231	11111111111
-	0xAAB0,	// ASCII = 232	101010101011
-	0xAAD0,	// ASCII = 233	101010101101
-	0xAAF0,	// ASCII = 234	101010101111
-	0xAB50,	// ASCII = 235	101010110101
-	0xAB70,	// ASCII = 236	101010110111
-	0xABB0,	// ASCII = 237	101010111011
-	0xABD0,	// ASCII = 238	101010111101
-	0xABF0,	// ASCII = 239	101010111111
-	0xAD50,	// ASCII = 240	101011010101
-	0xAD70,	// ASCII = 241	101011010111
-	0xADB0,	// ASCII = 242	101011011011
-	0xADD0,	// ASCII = 243	101011011101
-	0xADF0,	// ASCII = 244	101011011111
-	0xAEB0,	// ASCII = 245	101011101011
-	0xAED0,	// ASCII = 246	101011101101
-	0xAEF0,	// ASCII = 247	101011101111
-	0xAF50,	// ASCII = 248	101011110101
-	0xAF70,	// ASCII = 249	101011110111
-	0xAFB0,	// ASCII = 250	101011111011
-	0xAFD0,	// ASCII = 251	101011111101
-	0xAFF0,	// ASCII = 252	101011111111
-	0xB550,	// ASCII = 253	101101010101
-	0xB570,	// ASCII = 254	101101010111
-	0xB5B0	// ASCII = 255	101101011011
-};
-
-
-
 //////////////////////////////////////////////////////////////////////
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
@@ -409,7 +144,7 @@ fe2=0.0;
 // FastSquelch
 fastSquelch=false;
 // IMD
-IMD=0.0; // Means Unkonown
+IMD=0.0; // Means Unknown
  x_loop_1=0;
  y_loop_1=0;
 return true;
@@ -524,7 +259,7 @@ if ( UseAfc == Wide )
     DecodeSymbol( angle);
     if ( (unsigned int) m_DevAve  > Threshold)
     {
-    if (m_OffCount > 10)
+  //  if (m_OffCount > 10)
      calcIMD(Spectrum); // We got enough Idles to calc the IMD
     }
     else
diff --git a/src/crxchannel.cpp b/src/crxchannel.cpp
index fb5e009..f525e97 100644
--- a/src/crxchannel.cpp
+++ b/src/crxchannel.cpp
@@ -320,3 +320,7 @@ AfcMode CRxChannel::AfcProperties()
 {
   return Demodulator->AfcProperties();
 }
+CRxWindow *CRxChannel::getWindow()
+{
+ return RxWindow;
+}
diff --git a/src/crxchannel.h b/src/crxchannel.h
index 4f8e292..4408c94 100644
--- a/src/crxchannel.h
+++ b/src/crxchannel.h
@@ -17,9 +17,9 @@
 #ifndef CRXCHANNEL_H
 #define CRXCHANNEL_H
 
+#include <complex>
 #include "constants.h"
 #include <QObject>
-#include <complex>
 
 #include "cdemodulator.h"
 /**Class to administrate the different RX Channels
@@ -47,6 +47,7 @@ virtual ~CRxChannel();
   int get2RxFrequency();
   Mode getModulationType();
   int getID();
+  CRxWindow *getWindow();
   bool getSquelchState();
   int getSquelchValue();
   void setThreshold(int);
@@ -58,13 +59,13 @@ virtual ~CRxChannel();
   CRxWindow *RxWindow;
   float getIMD();
   virtual void *getBuffer();
+  std::complex<float>* getPhasePointer();
 public slots:
   void setRxFrequency(double);
   void hide();
   void show();
   class CRxChannel *getChannel(int);
   void setAfcMode(AfcMode);
-  std::complex<float>* getPhasePointer();
   void setSquelch(bool);
   void updateRx(char);
   void clearRxWindow();
diff --git a/src/crxwindow.cpp b/src/crxwindow.cpp
index 68a70b9..ee21956 100644
--- a/src/crxwindow.cpp
+++ b/src/crxwindow.cpp
@@ -29,15 +29,19 @@ extern Parameter settings;
 CRxWindow::CRxWindow ( QWidget* parent )
     : QScrollArea ( parent )
 {
+
   QFontMetrics fm ( font() );
-  rowHeight = fm.height();
+  rowHeight = fm.height()+3;
+  int pixelwidth=82*fm.width("A");
   DisplayBox = new QWidget ( this );
+  DisplayBox-> setFocusPolicy( Qt::NoFocus);
   DisplayBox->setFixedSize ( 642, RXWINDOWBUFFER*rowHeight );
   DisplayBox->setContextMenuPolicy ( Qt::CustomContextMenu );
   connect ( DisplayBox, SIGNAL ( customContextMenuRequested ( QPoint ) ), this, SLOT ( contextMenu ( QPoint ) ) );
 
   setWidget ( DisplayBox );
 
+//  setHorizontalScrollBarPolicy ( Qt::ScrollBarAsNeeded );
   setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
   setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
 
@@ -49,12 +53,13 @@ CRxWindow::CRxWindow ( QWidget* parent )
   Row = 0;
   Column = 0;
   AutoScroll = true;
-  DisplayLineHeight = rowHeight - 2;
+  DisplayLineHeight = rowHeight - 1;
   for ( int i = 0;i < RXWINDOWBUFFER;i++ )
   {
 
     ScrollBuffer[i] = new QLineEdit ( DisplayBox );
-    ScrollBuffer[i]->move ( 1, 1 + DisplayLineHeight*i );
+    ScrollBuffer[i]->setFixedWidth(pixelwidth);
+    ScrollBuffer[i]->move ( 1, 1+ DisplayLineHeight*i );
 
     ScrollBuffer[i]->setFrame ( false );
     ScrollBuffer[i]->setReadOnly ( true );
@@ -74,6 +79,8 @@ CRxWindow::CRxWindow ( QWidget* parent )
   connect ( A, SIGNAL ( triggered() ), this, SLOT ( copyLocator() ) );
   A = menu->addAction ( "Raport" );
   connect ( A, SIGNAL ( triggered() ), this, SLOT ( copyRST() ) );
+  A = menu->addAction ("Dok");
+  connect ( A, SIGNAL ( triggered() ), this, SLOT ( copyDok() ) );
 
   selectedString.clear();
 
@@ -172,15 +179,15 @@ void CRxWindow::NeueZeile()
   Row++;
   if ( Row >= RXWINDOWBUFFER )
   {
-    if ( save && stream != 0 )
-      for ( int i = 0;i < 10; i++ )
-        *stream << ScrollBuffer[i]->text() << "\n";
+   if ( save && stream != 0 )
+     for ( int i = 0;i < 10; i++ )
+       *stream << ScrollBuffer[i]->text() << "\n";
     removeLines ( 10 );
     Row -= 10;
   }
   if ( ! AutoScroll )
     return;
-//  ensureVisible ( 0, Row*rowHeight, 20, 15 );
+
   ensureWidgetVisible ( ( QWidget* ) ScrollBuffer[Row] );
 }
 void CRxWindow::setColor ( QColor color )
@@ -255,10 +262,22 @@ void CRxWindow::contextMenu ( QPoint p )
   char c = 0xF8;
   QPoint p1 = QCursor::pos();
   selectedLine = p.y() / DisplayLineHeight;
+  if(selectedLine >= RXWINDOWBUFFER)
+    selectedLine=RXWINDOWBUFFER-1;
   selectedColumn = ScrollBuffer[selectedLine]->cursorPositionAt ( QPoint ( p.x(), 2 ) );
   ScrollBuffer[selectedLine]->setCursorPosition ( selectedColumn );
   ScrollBuffer[selectedLine]->cursorWordForward ( true );
   selectedString = ScrollBuffer[selectedLine]->selectedText();
+  if(!selectedString.endsWith(QChar(' ')))
+  {
+    ScrollBuffer[selectedLine]->cursorWordForward ( true );
+    selectedString = ScrollBuffer[selectedLine]->selectedText();
+    if(!selectedString.endsWith(QChar(' ')))  // / + extension might belong to the text (callsign)
+    {
+      ScrollBuffer[selectedLine]->cursorWordForward ( true );
+      selectedString = ScrollBuffer[selectedLine]->selectedText();
+    }
+  }
   selectedString = selectedString.replace ( QChar ( c ), QLatin1String ( "0" ) ); // Replace Slashed zero by zero
   if ( selectedString == QString ( " " ) )
   {
@@ -266,26 +285,29 @@ void CRxWindow::contextMenu ( QPoint p )
     ScrollBuffer[selectedLine]->cursorWordForward ( true );
     selectedString = ScrollBuffer[selectedLine]->selectedText();
   }
-  qDebug ( "Copy %s", qPrintable ( selectedString ) );
   menu->exec ( p1 );
 }
 void CRxWindow::copyCallSign()
 {
-  emit copyCallSign ( selectedString );
+  emit setQsoData(CallSign,  selectedString );
 }
 void CRxWindow::copyQTH()
 {
-  emit copyQTH ( selectedString );
+  emit setQsoData( QTH, selectedString );
 }
 void CRxWindow::copyName()
 {
-  emit copyName ( selectedString );
+  emit setQsoData( Name, selectedString );
 }
 void CRxWindow::copyLocator()
 {
-  emit copyLocator ( selectedString );
+  emit setQsoData( Locator, selectedString );
 }
 void CRxWindow::copyRST()
 {
-  emit copyRST ( selectedString );
+  emit setQsoData( RST, selectedString );
+}
+void CRxWindow::copyDok()
+{
+  emit setQsoData( DOK, selectedString );
 }
diff --git a/src/crxwindow.h b/src/crxwindow.h
index e174453..a1dea74 100644
--- a/src/crxwindow.h
+++ b/src/crxwindow.h
@@ -56,7 +56,7 @@ class CRxWindow : public QScrollArea
     void copyName();
     void copyLocator();
     void copyRST();
-
+    void copyDok();
   private:
 
 
@@ -79,12 +79,7 @@ class CRxWindow : public QScrollArea
     int DisplayLineHeight;
   signals:
     void Triggered();
-    void copyCallSign ( QString );
-    void copyQTH ( QString );
-    void copyName ( QString );
-    void copyLocator ( QString );
-    void copyRST ( QString );
-
+    void setQsoData(QsoData,QString);
 };
 
 #endif // CRXWINDOW_H
diff --git a/src/csound.cpp b/src/csound.cpp
index fe43d8e..f4996fc 100644
--- a/src/csound.cpp
+++ b/src/csound.cpp
@@ -16,7 +16,8 @@
 
 #include "csound.h"
 #include "parameter.h"
-#include <cstdlib>
+#include <sstream>
+#include <fstream>
 
 using namespace std;
 extern Parameter settings;
@@ -63,12 +64,23 @@ bool CSound::open_Device_read ( QString *errorstring )
   available = 0;
   readPointer = 0;
   free = 2 * BUF_SIZE;
-
-  err = snd_pcm_open ( &handle, "LinPSK_Record", SND_PCM_STREAM_CAPTURE, SND_PCM_ASYNC );
+  QString device("");
+  // Could InputDeviceName contain a card name ?
+  if(!settings.InputDeviceName.contains(':')) // Could be card name, so check /proc/asound/cards
+  {
+      int card_number=getDeviceNumber(settings.InputDeviceName);
+      if(card_number < 0)
+        device=settings.InputDeviceName;
+      else
+        device = QString("plughw:%1").arg(card_number);
+  }
+  else
+   device=settings.InputDeviceName;
+  err = snd_pcm_open ( &handle, device.toAscii(), SND_PCM_STREAM_CAPTURE, SND_PCM_ASYNC );
 
   if ( err < 0 )
   {
-    *errorstring = QString ( "Unable to open Device LinPSK_Record: " ) + QString ( snd_strerror ( err ) ) + QString ( "\nPlease read the README for configuration hints\n" );
+      *errorstring = QString ( "Unable to open Device: " )+ settings.InputDeviceName + QString(" ") + QString ( snd_strerror ( err ) ) + QString ( "\nPlease read the README for configuration hints\n" );
     return false;
   }
   snd_pcm_hw_params_malloc ( &hwparams );
@@ -177,11 +189,22 @@ bool CSound::open_Device_write ( QString *errorstring )
   snd_pcm_uframes_t period_size = 1024;
   unsigned int SampleRate = 11025;
   output = true;
-  qDebug ( "Open Device write" );
-  err = snd_pcm_open ( &handle, "LinPSK_Play", SND_PCM_STREAM_PLAYBACK, 0 );
+  QString device("");
+  // Could OutputDeviceName contain a card name ?
+  if(!settings.OutputDeviceName.contains(':')) // Could be card name, so check /proc/asound/cards
+  {
+      int card_number=getDeviceNumber(settings.OutputDeviceName);
+      if(card_number < 0)
+        device=settings.OutputDeviceName;
+      else
+        device = QString("plughw:%1").arg(card_number);
+  }
+  else
+   device=settings.OutputDeviceName;
+  err = snd_pcm_open ( &handle, device.toAscii(), SND_PCM_STREAM_PLAYBACK, 0 );
   if ( err < 0 )
   {
-    *errorstring = QString ( "Unable to open Device LinPSK_Play: " ) + QString ( snd_strerror ( err ) );
+      *errorstring = QString ( "Unable to open Device: " )+settings.OutputDeviceName+ QString(" ") + QString ( snd_strerror ( err ) );
     return false;
   }
 // Set blocking mode
@@ -240,8 +263,8 @@ bool CSound::open_Device_write ( QString *errorstring )
     *errorstring = QString ( "Unable to set buffer size %i for play: " ).arg ( buffer_size ) + QString ( snd_strerror ( err ) );
     return false;
   }
-  else
-    qDebug("Buffersize set to %i",buffer_size);
+//  else
+//    qDebug("Buffersize set to %i",(int) buffer_size);
   err = snd_pcm_hw_params ( handle, hwparams );
   if ( err < 0 )
   {
@@ -265,8 +288,8 @@ bool CSound::open_Device_write ( QString *errorstring )
     *errorstring = QString ( "Unable to set start threshold mode : " ) + QString ( snd_strerror ( err ) );
     return false;
   }
-  else
-    qDebug("Setting start threshold to %i", threshold);
+ // else
+ //   qDebug("Setting start threshold to %i", (int) threshold);
   /* Write the parameters to the record/playback device */
   err = snd_pcm_sw_params ( handle, swparams );
   if ( err < 0 )
@@ -286,8 +309,8 @@ int CSound::putSamples ( double *sample, int anzahl )
     LockPointers.lock();
     toBePlayed += anzahl;
     free -= anzahl;
-    if ( toBePlayed > 2*BUF_SIZE )
-      qDebug ( "putSamples: Bufferoverrun" );
+ //   if ( toBePlayed > 2*BUF_SIZE )
+ //     qDebug ( "putSamples: Bufferoverrun" );
     WakeUp.wakeAll();
     LockPointers.unlock();
 
@@ -298,7 +321,7 @@ int CSound::putSamples ( double *sample, int anzahl )
   else
   {
     anzahl=0;
-    qDebug ( "++++++free too low %d", free );
+//    qDebug ( "++++++free too low %d", free );
   }
   return anzahl;
 }
@@ -343,6 +366,8 @@ void CSound::PTT ( bool mode )
     }
     ii = ioctl ( serial, TIOCMBIC, &flags );
   }
+  if (ii < 0)
+    qDebug("Error using serial port");
   return;
 }
 
@@ -380,13 +405,13 @@ void CSound::record()
     if ( !started )
       break;
     toBeRead = min ( free, 128 );
-    if ( toBeRead > BUF_SIZE )
-    {
-      qDebug ( "Error toBeRead zu gross" );
-      return;
-    }
-    if ( ( freePointer + toBeRead ) > 2*BUF_SIZE )
-      qDebug ( "Out of Bounds \n" );
+//    if ( toBeRead > BUF_SIZE )
+//    {
+//      qDebug ( "Error toBeRead zu gross" );
+//      return;
+//    }
+//    if ( ( freePointer + toBeRead ) > 2*BUF_SIZE )
+//      qDebug ( "Out of Bounds \n" );
     err = snd_pcm_readi ( handle,  SampleBuffer, toBeRead );
     if ( err == toBeRead )
     {
@@ -407,7 +432,7 @@ void CSound::record()
         // Overrun
         snd_pcm_prepare ( handle );
         snd_pcm_start ( handle );
-        qDebug ( "Record: Overrun" );
+ //       qDebug ( "Record: Overrun" );
       }
       else
       {
@@ -441,14 +466,14 @@ void CSound::play()
       emit samplesAvailable();
       signaled = true;
     }
-    if ( free > ( 2* BUF_SIZE ) )
-      qDebug ( "Out of bounds" );
+//    if ( free > ( 2* BUF_SIZE ) )
+//      qDebug ( "Out of bounds" );
     while ( toBePlayed < laenge && started )
       WakeUp.wait ( &LockPointers );
     LockPointers.unlock();
     if ( !started )
     {
-      qDebug ( "Stop received" );
+ //     qDebug ( "Stop received" );
       break;
     }
     if ( toBePlayed >= BUF_SIZE )
@@ -473,7 +498,7 @@ void CSound::play()
       if ( err == -EPIPE )
       {
         /* under-run */
-        qDebug ( "Underun in Play position 2 laenge %d Pointer %d available %d\n", laenge, readPointer,  toBePlayed );
+   //     qDebug ( "Underun in Play position 2 laenge %d Pointer %d available %d\n", laenge, readPointer,  toBePlayed );
         err = snd_pcm_prepare ( handle );
         if ( err < 0 )
         {
@@ -485,14 +510,29 @@ void CSound::play()
         qDebug ( "Play ???? \n" );
       else
       {
-        qDebug("Errorcode %i",err);
         qDebug ( " %s\nStopping Play Thread", snd_strerror ( err ) );
         break;
       }
 
     }
   }
-  qDebug ( "Now dropping" );
   snd_pcm_drop ( handle );
   qDebug ( "Play Thread terminated" );
 }
+int CSound::getDeviceNumber(QString device)
+{
+  std::string line;
+  std::ifstream cards( "/proc/asound/cards" );
+  int id;
+  id=-1;
+  if ( cards.is_open() )  {
+      while ( cards.good() )  {
+          getline (cards, line);
+          if ( line.find( device.toStdString() ) != std::string::npos )  {
+              std::istringstream( line ) >>id;
+              return id;
+          }
+      }
+  }
+  return id;
+}
diff --git a/src/csound.h b/src/csound.h
index 3dc696c..cca3f37 100644
--- a/src/csound.h
+++ b/src/csound.h
@@ -54,6 +54,7 @@ class CSound : public Input
     QWaitCondition WakeUp;
     void record();
     void play();
+    int getDeviceNumber(QString device);
   protected:
     void run();
     int free, freePointer, available, readPointer,toBePlayed;
diff --git a/src/csquelch.cpp b/src/csquelch.cpp
index acbbb01..a7e8dc9 100644
--- a/src/csquelch.cpp
+++ b/src/csquelch.cpp
@@ -26,6 +26,8 @@
 #include <QStyleOptionSlider>
 #include <QStylePainter>
 #include <QStyle>
+#include <QCleanlooksStyle>
+
 
 #define Cyan  color[127]
 #define Yellow color[192]
@@ -33,6 +35,8 @@
 mySlider::mySlider ( QWidget *parent ) :
     QSlider ( Qt::Vertical, parent )
 {
+  setStyle(new QCleanlooksStyle); // Has each style handles the drawing different,
+                                  // I fix the slder style
   setTickInterval ( 10 );
   setTickPosition ( QSlider::NoTicks );
   setMinimum ( 0 );
@@ -50,36 +54,25 @@ mySlider::~mySlider()
 
 void mySlider::paintEvent ( QPaintEvent * )
 {
-
   QStylePainter p;
-
-  int scale;
+  int pos;
   p.begin ( this );
 // Get Parameters of the Slider
   initStyleOption ( &option );
+  pos=option.sliderPosition;
+  option.sliderPosition=SquelchLevel;
   option.type = QStyleOption::SO_Slider;
   option.subControls = QStyle::SC_SliderGroove;
-  const QColor c0 = option.palette.color ( QPalette::Window );
-  QRect groove = option.rect;
-  if ( SquelchLevel > 0 )
-  {
-    // Draw the two parts of the slider groove, if we have a signal
-    int height = option.rect.height();
-    scale = ( height * ( 100 - SquelchLevel ) ) / 100;
-    // Set Color depending on signal strength
-
-    if ( SquelchLevel < option.sliderValue )  // Too low
-      option.palette.setColor ( QPalette::Window, Yellow );
-    else
-      option.palette.setColor ( QPalette::Window, Cyan );
-    p.drawComplexControl ( QStyle::CC_Slider, option );
-    option.rect.setHeight ( scale );
-  }
-  option.palette.setColor ( QPalette::Window, c0 );
+  if ( SquelchLevel < pos )
+    option.palette.setColor( QPalette::Normal,QPalette::Highlight,Qt::yellow);
+  else
+    option.palette.setColor( QPalette::Normal,QPalette::Highlight,Qt::cyan);
   p.drawComplexControl ( QStyle::CC_Slider, option );
-  option.rect = groove;
+  option.sliderPosition=pos;
   option.subControls = QStyle::SC_SliderHandle;
+  option.palette.setColor ( QPalette::Button, Qt::red );
   p.drawComplexControl ( QStyle::CC_Slider, option );
+  p.end();
 
 }
 
@@ -98,8 +91,8 @@ int mySlider::getThreshold()
  *  Constructs a CSquelch which is a child of 'parent', with the
  *  name 'name'.'
  */
-CSquelch::CSquelch ( const QString name, QWidget* parent )
-    : QGroupBox ( name, parent )
+CSquelch::CSquelch (QWidget* parent )
+    : QGroupBox ( parent )
 {
   setAlignment ( int ( Qt::AlignHCenter ) );
 
@@ -162,7 +155,6 @@ void CSquelch::calculateSizeofComponents()
   resize ( width, height );
 }
 
-
 void CSquelch::setSquelchLevel ( int level )
 {
   Squelch->setSquelchLevel ( level );
diff --git a/src/csquelch.h b/src/csquelch.h
index 5aab3aa..51d4789 100644
--- a/src/csquelch.h
+++ b/src/csquelch.h
@@ -47,7 +47,7 @@ class CSquelch : public QGroupBox
     Q_OBJECT
 
 public:
-    CSquelch(const QString, QWidget* parent = 0);
+    CSquelch(QWidget* parent = 0);
     ~CSquelch();
     void setSquelchLevel(int);
     int getThreshold();
diff --git a/src/ctrigger.cpp b/src/ctrigger.cpp
deleted file mode 100644
index b699a71..0000000
--- a/src/ctrigger.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-
-#include "ctrigger.h"
-
-#include <QLineEdit>
-#include <QRadioButton>
-
-
-
-/* 
- *  Constructs a CTrigger which is a child of 'parent', with the 
- *  name 'name'.' 
- */
-CTrigger::CTrigger(const  QString name, QWidget* parent )
-    : QGroupBox(name, parent)
-{
-//    setFrameShape( QGroupBox::WinPanel );
-//    setFrameShadow( QGroupBox::Raised );
-    setAlignment(  Qt::AlignHCenter  );
-
-    TriggerText = new QLineEdit( this );
-//    TriggerText->setMaxLength( 80 );
-
-    Activate = new QRadioButton( "Activate", this );
-    languageChange();
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-CTrigger::~CTrigger()
-{
-    // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
-void CTrigger::languageChange()
-{
-    setTitle( tr( "Trigger" ) );
-    TriggerText->setText( tr( "CQ CQ" ) );
-    Activate->setText( tr( "Activate" ) );
-}
-
-void CTrigger::resizeEvent( QResizeEvent * )
-{
-calculateSizeofComponents();
-}
-
-void CTrigger::calculateSizeofComponents()
-{
-#define LEFTANDRIGHTMARGIN 5
-#define TOP 30
-#define LABELHEIGHT 30
-int xpos,ypos,width,height,innerwidth,innerheight;
-width=this->width();
-height=this->height();
-xpos=width*LEFTANDRIGHTMARGIN/100;
-ypos=height*TOP/100;
-innerwidth=width-2*xpos;
-innerheight=height*LABELHEIGHT/100;
-TriggerText->setGeometry(xpos,ypos,innerwidth,innerheight);
-ypos=ypos+innerheight;
-Activate->setGeometry(xpos+1,ypos,innerwidth-2,innerheight);
-//this->setFrameRect(QRect(0,0,width,height));
-resize(width,height);
-}
diff --git a/src/ctxbuffer.cpp b/src/ctxbuffer.cpp
index e146af0..e347608 100644
--- a/src/ctxbuffer.cpp
+++ b/src/ctxbuffer.cpp
@@ -72,7 +72,11 @@ else
  {
   inpos=0;
   outpos=0;
-  filled=0;
+  if( filled < 0)
+  {
+    filled=1;
+    txbuffer[inpos++]=c;
+  }
  }
  else
  {
@@ -84,6 +88,16 @@ else
 }
 void CTxBuffer::clear()
 {
+  if(filled > 0)
+  {
+   if(txbuffer[(outpos+filled-1) %  TXBUFFER_LENGTH] == TXOFF_CODE) // We have to keep switching to rx
+   {
+     outpos = (outpos+filled-1) %  TXBUFFER_LENGTH;
+     inpos = (inpos+filled-1) %  TXBUFFER_LENGTH;
+     filled=1;
+     return;
+   }
+  }
 filled=0;
 inpos=0;
 outpos=0;
@@ -109,3 +123,7 @@ for (int i=0;i <length; i++)
     }   
   } 
 }
+bool CTxBuffer::isEmpty()
+{
+  return (filled== 0);
+}
diff --git a/src/ctxbuffer.h b/src/ctxbuffer.h
index df9a4e1..a461041 100644
--- a/src/ctxbuffer.h
+++ b/src/ctxbuffer.h
@@ -33,6 +33,7 @@ int getTxChar();
 void insert(int);
 void insert(QString,int);
 void clear();
+bool isEmpty();
 
 private:
 int txbuffer[TXBUFFER_LENGTH];
diff --git a/src/ctxwindow.cpp b/src/ctxwindow.cpp
deleted file mode 100644
index 05d5aa9..0000000
--- a/src/ctxwindow.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-/***************************************************************************
-                          |FILENAME|  -  description
-                             -------------------
-    begin                : |DATE|
-    copyright            : (C) |YEAR| by |AUTHOR|
-    email                : |EMAIL|
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *   The PSK part is based on WinPSK 1.0 by Moe Wheatly, AE4JY             *
- ***************************************************************************/
-
-
-
-#include "ctxbuffer.h"
-#include "ctxwindow.h"
-
-#include <QPushButton>
-#include <QLineEdit>
-#include <QApplication>
-#include <QKeyEvent>
-#include "parameter.h"
-
-extern Parameter settings;
-/*
- *  Constructs a CTxWindow which is a child of 'parent', with the
- *  name 'name'.'
- */
-
-
-CTxWindow::CTxWindow ( QWidget* parent )
-    : QFrame ( parent )
-{
-  setFrameShape ( QFrame::Panel );
-  setFrameShadow ( QFrame::Sunken );
-//    setLineWidth( 2 );
-//    setMargin( 2 );
-//    setMidLineWidth( 1 );
-
-  Clear = new QPushButton ( "TXClear", this );
-
-
-  Zeile1 = new QLineEdit ( this );
-  Zeile1->setFrame ( false );
-
-  Zeile2 = new QLineEdit ( this );
-  Zeile2->setFrame ( false );
-//    Zeile2->setFrameShadow( QLineEdit::Plain );
-//    Zeile2->setLineWidth( 0 );
-
-
-  Zeile3 = new QLineEdit ( this );
-  Zeile3->setFrame ( false );
-  languageChange();
-  Zeile = 0;
-  Spalte = 0;
-  Zeile1->setFocusProxy ( this );
-  Zeile2->setFocusProxy ( this );
-  Zeile3->setFocusProxy ( this );
-  setFocusPolicy(Qt::ClickFocus);
-
-  // signals and slots connections
-  connect ( Clear , SIGNAL ( clicked() ), this, SLOT ( clear() ) );
-  connect ( Zeile1, SIGNAL ( returnPressed() ), this, SLOT ( gotoNextLine() ) );
-  connect ( Zeile2, SIGNAL ( returnPressed() ), this, SLOT ( gotoNextLine() ) );
-  connect ( Zeile3, SIGNAL ( returnPressed() ), this, SLOT ( gotoNextLine() ) );
-  /**
-      connect( Zeile1, SIGNAL( textChanged(const QString &)) , this, SLOT(transmitText(const QString &)));
-      connect( Zeile2, SIGNAL( textChanged(const QString &)) , this, SLOT(transmitText(const QString &)));
-      connect( Zeile3, SIGNAL( textChanged(const QString &)) , this, SLOT(transmitText(const QString &)));
-  **/
-  setEnabled ( true );
-}
-
-void CTxWindow::clear()
-{
-  Zeile1->clear();
-  Zeile2->clear();
-  Zeile3->clear();
-  Zeile = 0;
-  Spalte = 0;
-  Zeile1->setCursorPosition ( Spalte );
-  Buffer->clear();
-}
-
-
-void CTxWindow::resizeEvent ( QResizeEvent * )
-{
-  calculateSizeofComponents();
-}
-
-void CTxWindow::gotoNextLine()
-{
-  if ( Zeile == 2 ) // Reached last Line
-  {
-    Zeile1->setText ( Zeile2->text() );
-    Zeile2->setText ( Zeile3->text() );
-    Zeile3->clear();
-    Spalte = 0;
-    Zeile3->setCursorPosition ( Spalte );
-  }
-  else
-  {
-    Zeile++;
-    Spalte = 0;
-    if ( Zeile == 1 )
-      Zeile2->setCursorPosition ( Spalte );
-    else
-      Zeile3->setCursorPosition ( Spalte );
-  }
-}
-
-void CTxWindow::calculateSizeofComponents()
-{
-#define MARGINS 3
-#define DISTANCE 2
-#define BUTTOMWIDTH 20
-  int xpos, ypos, width, height, innerheight, innerwidth;
-  width = this->width();
-  height = this->height();
-  xpos = DISTANCE;
-  ypos = height * MARGINS / 100;
-  innerheight = ( height - 2 * ypos - height * DISTANCE / 100 ) / 4;
-  Zeile1->setGeometry ( xpos, ypos, width - 2*xpos, innerheight );
-  ypos = ypos + innerheight - 2;
-  Zeile2->setGeometry ( xpos, ypos, width - 2*xpos, innerheight );
-  ypos = ypos + innerheight - 2;
-  Zeile3->setGeometry ( xpos, ypos, width - 2*xpos, innerheight );
-  ypos = ypos + innerheight + height * DISTANCE / 100;
-  innerwidth = 100;
-  xpos = width - innerwidth - 2 * xpos;
-  Clear->setGeometry ( xpos, ypos, innerwidth, innerheight );
-}
-
-void CTxWindow::mousePressEvent ( QMouseEvent * )
-{
-  if ( Zeile == 0 ) Zeile1->setCursorPosition ( Spalte );
-  if ( Zeile == 1 ) Zeile2->setCursorPosition ( Spalte );
-  if ( Zeile == 2 ) Zeile3->setCursorPosition ( Spalte );
-}
-
-
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-CTxWindow::~CTxWindow()
-{
-  // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
-void CTxWindow::languageChange()
-{
-  Clear->setText ( tr ( "Clear" ) );
-}
-
-
-void CTxWindow::keyPressEvent ( QKeyEvent *e ) // Bearbeiten der Eingaben im
-// TX Window
-{
-  unsigned char c;
-  static bool CapsLock = false;
-  if ( Buffer->Filled() )
-  {
-    QApplication::beep();
-    e->ignore();
-    return;
-  }
-  /**
-  if ( e->state() & ControlButton )
-   {
-    if ( e->key() == Key_V )
-     pasteText( QApplication::clipboard()->text( QClipboard::Clipboard ) );
-   }
-  else
-  **/
-  switch ( e->key() )
-  {
-    case Qt::Key_Enter:
-    case Qt::Key_Return:
-      gotoNextLine();
-      if(settings.autoCrLf)
-        Buffer->insert('\r');
-      Buffer->insert ( '\n' );
-      e->accept();
-      break;
-  case Qt::Key_Home:
-    Buffer->insert('\r');
-    e->accept();
-    break;
-    case Qt::Key_CapsLock:
-      CapsLock = !CapsLock;
-      e->accept();
-      break;
-
-    case Qt::Key_Backspace:
-      c = '\b';
-      backspace();
-      e->accept();
-      Buffer->insert ( c );
-      break;
-
-    default:
-//    ButtonState cc=e->state();
-//    if ( (cc == ShiftButton) )
-      if ( ( e->modifiers() == Qt::ShiftModifier ) || CapsLock )
-      {
-        if ( !e->text().isEmpty() )
-          c = e->text().toUpper().at ( 0 ).toAscii();
-        else
-          c = 0;
-      }
-      else
-      {
-        if ( !e->text().isEmpty() )
-          c = e->text().toLower().at ( 0 ).toAscii();
-        else
-          c = 0;
-      }
-      if ( c != 0 )
-      {
-        Spalte++;
-        if ( Spalte > 80 )
-        {
-          Buffer->insert ( '\n' ); //This newline Char will  be Transmitted
-          gotoNextLine();
-        }
-        Buffer->insert ( c );
-        insert ( c );
-        e->accept();
-      }
-  } // End Case
-
-} // keyPressEvent
-
-
-void CTxWindow::backspace()
-{
-
-  QLineEdit * line;
-  if ( Zeile == 0 )
-    line = Zeile1;
-  if ( Zeile == 1 )
-    line = Zeile2;
-  if ( Zeile == 2 )
-    line = Zeile3;
-  line->backspace();
-
-}
-void CTxWindow::insert ( unsigned char c )
-{
-  QLineEdit *line;
-  if ( Zeile == 0 )
-    line = Zeile1;
-  if ( Zeile == 1 )
-    line = Zeile2;
-  if ( Zeile == 2 )
-    line = Zeile3;
-  QString s = line->text() + QString ( QChar ( c ) );
-  line->setText ( s );
-}
-void CTxWindow::setTxBuffer ( CTxBuffer *p )
-{
-  Buffer = p;
-}
-
-void CTxWindow::pasteText ( const QString &Text )
-{
-  int length;
-  length = Text.length();
-  for ( int i = 0; i < length; i++ )
-  {
-    Spalte++;
-    if ( Spalte > 80 )
-    {
-      Buffer->insert ( '\n' ); //This newline Char will  be Transmitted
-      gotoNextLine();
-    }
-    char c = Text.at ( i ).toAscii();
-    Buffer->insert ( c );
-    insert ( c );
-  }
-}
diff --git a/src/ctxwindow.h b/src/ctxwindow.h
deleted file mode 100644
index 69f8039..0000000
--- a/src/ctxwindow.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
-                          |FILENAME|  -  description
-                             -------------------
-    begin                : |DATE|
-    copyright            : (C) |YEAR| by |AUTHOR|
-    email                : |EMAIL|
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *   The PSK part is based on WinPSK 1.0 by Moe Wheatley, AE4JY            *
- ***************************************************************************/
-
-#ifndef CTXWINDOW_H
-#define CTXWINDOW_H
-
-#include <QFrame>
-class QLineEdit;
-class QPushButton;
-class CTxBuffer;
-class QString;
-
-class CTxWindow : public QFrame
-{
-    Q_OBJECT
-
-public:
-    CTxWindow( QWidget* parent = 0);
-    ~CTxWindow();
-
-    QPushButton* Clear;
-    void setTxBuffer(CTxBuffer *);
-
-public slots:
-
-signals:
-
-
-protected:
-    virtual void resizeEvent( QResizeEvent * e );
-    virtual void mousePressEvent( QMouseEvent * );
-
-
-
-protected slots:
-    virtual void languageChange();
-    void pasteText(const QString &);
-private:
-    unsigned int Zeile;
-    unsigned int Spalte;
-    QLineEdit* Zeile2;
-    QLineEdit* Zeile1;
-    QLineEdit* Zeile3;
-
-    void calculateSizeofComponents();
-    void keyPressEvent(QKeyEvent *);
-    CTxBuffer * Buffer;
-    void backspace();
-    void insert(unsigned char);
-
-private slots:
-    virtual void clear();
-    void gotoNextLine();
-
-};
-
-#endif // CTXWINDOW_H
diff --git a/src/frequencyselect.cpp b/src/frequencyselect.cpp
index 09ad4f4..14f10ac 100644
--- a/src/frequencyselect.cpp
+++ b/src/frequencyselect.cpp
@@ -53,7 +53,7 @@ AfcWide->setAutoExclusive(false);
     }
     Frequency = new QSpinBox( this );
     Frequency->setMaximum( 2500 );
-    Frequency->setMinimum( 300 );
+    Frequency->setMinimum( 100 );
     frequency = 1000;
     Frequency->setValue( (int) frequency );
     languageChange();
diff --git a/src/frequencyselect.h b/src/frequencyselect.h
index 63e8fc0..232876c 100644
--- a/src/frequencyselect.h
+++ b/src/frequencyselect.h
@@ -60,7 +60,6 @@ private:
     AfcMode modus;
 signals:
  void FrequencyChanged(double);
-// void toggleAFC(bool);
 
 };
 
diff --git a/src/macros.cpp b/src/macros.cpp
deleted file mode 100644
index f7f771d..0000000
--- a/src/macros.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/***************************************************************************
-                          Macros.cpp  -  description
-                             -------------------
-    begin                : Sam Mai 10 2003
-    copyright            : (C) 2003 by Volker Schroer
-    email                : dl1ksv at gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
-
-#include "macros.h"
-#include "parameter.h"
-#include "ctxbuffer.h"
-#include <QDateTime>
-#include <QMessageBox>
-#include "constants.h"
-#include <QFile>
-#include <QTextStream>
-extern Parameter settings;
-
-Macros::Macros()
-{
-
-  Words << "@CALLSIGN@" << "@DATE@" << "@Replace by filename@" << "@RX@" << "@THEIRCALL@" << "@THEIRNAME@" << "@TIMELOCAL@" << "@TIMEUTC@" << "@TX@" << "@RSTGIVEN@" << "@RSTRCVD@";
-  NumberofMacros = 0;
-}
-Macros::~Macros()
-{
-}
-void Macros::insert ( QString Name, QString Definition, QString Acc, int position )
-{
-  if ( position <= NumberofMacros )
-  {
-    MacroNames.replace ( position - 1, Name );
-    MacroText.replace ( position - 1, Definition );
-    Accelerator.replace ( position - 1, Acc );
-  }
-  else
-  {
-    MacroNames << Name;
-    MacroText << Definition;
-    Accelerator << Acc;
-  }
-  NumberofMacros++;
-
-}
-void Macros::executeMacro ( int MacroNumber, CTxBuffer *TxBuffer )
-{
-  QString Macro = MacroText[MacroNumber];
-  QString Token;
-
-  int anzahl = Macro.count ( '@' ) / 2;
-  if ( anzahl > 0 )
-  {
-    int indexbis, indexvon = 0;
-    for ( int i = 0; i < anzahl; i++ )
-    {
-      indexbis = Macro.indexOf ( '@', indexvon );
-      indexvon = indexbis;
-      indexbis = Macro.indexOf ( '@', indexvon + 1 );
-      Token = Macro.mid ( indexvon, indexbis - indexvon + 1 );
-      if ( Token == Words[0] )         // callsign
-      {
-        Macro.replace ( indexvon, Words[0].length(), settings.callsign );
-
-      }
-      else
-        if ( Token == Words[1] )         // Date
-        {
-          QDate t = QDate::currentDate();
-          Macro.replace ( indexvon, Words[1].length(), t.toString ( QString ( "d.MM.yyyy" ) ) );
-
-        }
-        else
-          if ( Token == Words[3] )         // RX
-          {
-            Macro.remove ( indexvon, 4 );
-            if ( settings.Status == ON )
-            {
-              TxBuffer->insert ( Macro, indexvon );
-              emit StartRx();
-            }
-            return;
-          }
-          else
-            if ( Token == Words[4] )        // Remote callsign
-            {
-              Macro.replace ( indexvon, Words[4].length(), settings.QslData->RemoteCallsign );
-
-            }
-            else
-              if ( Token == Words[5] )        // Remote op's name
-              {
-                Macro.replace ( indexvon, Words[5].length(), settings.QslData->OpName );
-
-              }
-              else
-                if ( Token == Words[6] )        // Time Local
-                {
-                  QDateTime t;
-                  t = QDateTime::currentDateTime();
-
-                  Macro.replace ( indexvon, Words[6].length(), t.toString ( "h:mm" ) );
-
-                }
-                else
-                  if ( Token == Words[7] )        // Time UTC
-                  {
-                    QDateTime t;
-                    t = QDateTime::currentDateTime();
-                    t = t.addSecs ( settings.timeoffset * 3600 );
-                    Macro.replace ( indexvon, Words[7].length(), t.toString ( "h:mm" ) );
-                  }
-                  else
-                    if ( Token == Words[8] )        // TX
-                    {
-                      if ( settings.Status == UNDEF )
-                      {
-                        QMessageBox::warning ( 0, "Warning", "Please listen before transmitting",
-                                               QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton );
-
-                        return;
-                      }
-                      Macro.remove ( indexvon, 4 );
-                      if ( settings.Status == OFF )
-                        emit StartTx();
-                    }
-                    else
-                      if ( Token == Words[9] )        // RST given
-                      {
-                        Macro.replace ( indexvon, Words[9].length(), settings.QslData->MyRST );
-
-                      }
-                      else
-                        if ( Token == Words[10] )        // RST received
-                        {
-                          Macro.replace ( indexvon, Words[10].length(), settings.QslData->HisRST );
-
-                        }
-                        else  // Must be File
-                        {
-                          Macro.remove ( indexvon, Token.length() );
-                          if ( indexvon > 0 )
-                          {
-                            TxBuffer->insert ( Macro, indexvon );
-                            Macro.remove ( 0, indexvon );
-                            indexvon = 0;
-                          }
-                          Token = Token.mid ( 1, Token.length() - 2 );
-                          QFile MacroFile ( settings.Directory + QString ( "/" ) + Token );
-                          if ( MacroFile.open ( QIODevice::ReadOnly ) )
-                          {
-                            QTextStream line ( &MacroFile );
-                            while ( !line.atEnd() )
-                            {
-                              QString Txstring = line.readLine();
-                              if(settings.autoCrLf) // AutoCrLF ??
-                                Txstring += '\r';
-                              Txstring += "\n";
-                              TxBuffer->insert ( Txstring, Txstring.length() );
-                            }
-                            MacroFile.close();
-                          }
-                          else
-                            QMessageBox::warning ( 0, "Warning", "File " + Token + " not found ",
-                                                   QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton );
-
-                        }
-    }
-
-
-  }
-  TxBuffer->insert ( Macro, Macro.length() );
-
-}
-
-void Macros::deleteMacro ( int number )
-{
-  if ( number < 0 || number >= NumberofMacros )
-    return;
-
-  MacroNames.erase ( MacroNames.begin() + number );
-  MacroText.erase ( MacroText.begin() + number );
-  Accelerator.erase ( Accelerator.begin() + number );
-
-  if ( NumberofMacros > 0 )
-    NumberofMacros--;
-}
-
-QString Macros::getMacroName ( int number )
-{
-
-  if ( number < 0 || number >= NumberofMacros )
-    return QString ( "" );
-  QString s = MacroNames.at ( number );
-  return  s;
-}
-int Macros::count()
-{
-  return NumberofMacros;
-}
-QString Macros::getDefinition ( int number )
-{
-
-  if ( number < 0 || number >= NumberofMacros )
-    return QString ( "" );
-  return MacroText[number];
-}
-QString Macros::getAccelerator ( int number )
-{
-  if ( number < 0 || number >= NumberofMacros )
-    return QString ( "" );
-  return Accelerator[number];
-}
-int Macros::Keywordcount()
-{
-  return Words.size();;
-}
-QString Macros::getKeyword ( int number )
-{
-  if ( number < 0 || number >= Keywordcount() )
-    return QString ( "" );
-  return Words[number];
-}
-void Macros::setDefinition ( QString s, int position )
-{
-  if ( position < MacroText.size() )
-    MacroText.replace ( position, s );
-  else
-    MacroText << s;
-}
-void Macros::setAccelerator ( QString s, int position )
-{
-  if ( position < Accelerator.size() )
-    Accelerator.replace ( position, s );
-  else
-    Accelerator << s;
-}
-void Macros::setMacroName ( QString s, int MacroNumber )
-{
-  if ( MacroNumber < MacroNames.size() )
-    MacroNames.replace ( MacroNumber, s );
-  else
-    MacroNames << s;
-}
-QStringList Macros::getKeyWordList()
-{
-  return Words;
-}
-QStringList Macros::getMacroList()
-{
-  return MacroNames;
-}
diff --git a/src/macros.h b/src/macros.h
deleted file mode 100644
index c105d09..0000000
--- a/src/macros.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/***************************************************************************
-                          keywords.h  -  description
-                             -------------------
-    begin                : Sam Mai 10 2003
-    copyright            : (C) 2003 by Volker Schroer
-    email                : dl1ksv at gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *   The PSK part is based on WinPSK 1.0 by Moe Wheatley, AE4JY            *              
- ***************************************************************************/
-
-#ifndef MACROS_H
-#define MACROS_H
-#include <QObject>
-
-#include <QStringList>
-
-/**Contains the Keywords for Macro Processing 
-Offers the methods for processing the Keywords
-  *@author Volker Schroer
-  */
-class CTxBuffer;
-class Macros : public QObject
- {
-  Q_OBJECT
-public: 
-	Macros();
-	~Macros();
-void executeMacro(int,CTxBuffer *);
-void insert(QString ,QString , QString,int);
-void deleteMacro(int);
-QString getMacroName(int);
-QString getDefinition(int);
-void setDefinition(QString,int);
-void setAccelerator(QString,int);
-void setMacroName(QString,int);
-QString getAccelerator(int);
-QString getKeyword(int);
-QStringList getKeyWordList();
-QStringList getMacroList();
-int count();
-int Keywordcount();
-private:	
-QStringList Words;
-QStringList MacroNames ;
-QStringList MacroText;
-QStringList Accelerator;
-int NumberofMacros;
-signals:
-void StartRx();
-void StartTx();
-  
-};
-
-#endif
diff --git a/src/macrowindow.cpp b/src/macrowindow.cpp
deleted file mode 100644
index 2a78c06..0000000
--- a/src/macrowindow.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/***************************************************************************
-                          macros.cpp  -  description
-                             -------------------
-    begin                : Sam Mai 3 2003
-    copyright            : (C) 2003 by Volker Schroer
-    email                : dl1ksv at gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
-
-#include "macrowindow.h"
-#include <QPushButton>
-#include <QGroupBox>
-#include <QButtonGroup>
-#include <QScrollBar>
-#include "parameter.h"
-
-#include "macros.h"
-
-extern Parameter settings;
-
-MacroWindow::MacroWindow ( Macros *Macro, QWidget *parent ) : QScrollArea ( parent )
-{
-	QPushButton *pb;
-	Area = new QGroupBox ( this );
-	Area->setAlignment ( Qt::AlignHCenter );
-	DisplayBox = new QButtonGroup ( Area );
-	setWidget ( Area );
-	setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
-	setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
-	NumberOfMacros = Macro->count();
-	if ( NumberOfMacros > 0 )
-		for ( int i = 0; i < NumberOfMacros;i++ )
-		{
-
-			pb = new QPushButton ( Macro->getMacroName ( i ), Area );
-			DisplayBox->addButton ( pb, i );
-		}
-	else
-		Area->hide();
-	connect ( DisplayBox, SIGNAL ( buttonClicked ( int ) ), this, SIGNAL ( callMacro ( int ) ) );
-}
-MacroWindow::~MacroWindow()
-{}
-
-
-void MacroWindow::resizeEvent ( QResizeEvent * )
-{
-	if ( NumberOfMacros == 0 )
-		return; // Nothing to do
-
-
-	int width, height, y;
-
-	width = this->width();
-	width = width - verticalScrollBar()->width();
-	y = 5;
-	if ( settings.ApplicationFont != 0 )
-		height = QFontMetrics ( *settings.ApplicationFont ).height();
-	else
-		height = QFontMetrics ( this->font() ).height();
-if(NumberOfMacros > 0)
-	for ( int i = 0; i < NumberOfMacros; i++ )
-	{
-		QPushButton *pb;
-		pb = static_cast<QPushButton *> ( DisplayBox->button ( i ) );
-//  if (settings.ApplicationFont != 0)
-//   pb->setFont(*settings.ApplicationFont);
-
-		pb->setFixedSize ( width - 20, height );
-		pb->move ( 8, y );
-		y = y + height + 5;
-	}
-	Area->setFixedSize ( width-5, y );
-	Area->show();
-}
-
-void MacroWindow::updateMacroWindow ( Macros *Macro )
-{
-	QPushButton *pb;
-
-	NumberOfMacros = Macro->count();
-	pb = new QPushButton ( Macro->getMacroName ( NumberOfMacros - 1 ), Area );
-	DisplayBox->addButton ( pb, NumberOfMacros - 1 );
-
-	pb->show();
-	resizeEvent ( 0 );
-}
-void MacroWindow::fontChange ( const QFont & )
-{
-	/**
-	 if (settings.ApplicationFont != 0)
-	 {
-	  DisplayBox->setFont(*settings.ApplicationFont);
-	  int anzahl = DisplayBox->count();
-	  for(int i=0; i < anzahl; i++)
-	  {
-	   QButton *pb;
-	   pb=DisplayBox->find(i);
-	   pb->setFont(*settings.ApplicationFont);
-	  }
-	 }
-	 **/
-}
-void MacroWindow::setMacroWindow ( Macros *M )
-{
-	int i, anzahl;
-	QPushButton *pb;
-	anzahl = DisplayBox->buttons().size();
-if ( anzahl > 0)
-	for ( i = 0; i < anzahl; i++ )
-{
- pb= static_cast<QPushButton *> ( DisplayBox->button ( i ) );
-		DisplayBox->removeButton (pb  );
-delete pb;
-}
-	NumberOfMacros = M->count();
-
-	if ( NumberOfMacros > 0 )
-		for ( i = 0; i < NumberOfMacros;i++ )
-		{
-			pb = new QPushButton ( M->getMacroName ( i ), Area );
-			DisplayBox->addButton ( pb, i );
-pb->show();
-		}
-	else
-		Area->hide();
-	resizeEvent ( 0 );
-}
diff --git a/src/macrowindow.h b/src/macrowindow.h
deleted file mode 100644
index 1e4ee6b..0000000
--- a/src/macrowindow.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
-                          macros.h  -  description
-                             -------------------
-    begin                : Sam Mai 3 2003
-    copyright            : (C) 2003 by Volker Schroer
-    email                : dl1ksv at gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
-
-#ifndef MACROWINDOW_H
-#define MACROWINDOW_H
-
-#include <QScrollArea>
-
-
-class Macros;
-class QGroupBox;
-class QButtonGroup;
-/**This class implements simple text and file macros.
-The macros are startet by a pushbutton and the pushbuttons are arranged in a scrollview.
-  *@author Volker Schroer
-  */
-
-
-class MacroWindow : public QScrollArea  {
-   Q_OBJECT
-public: 
-	MacroWindow(Macros *M,QWidget *parent=0);
-	~MacroWindow();
-void setMacroWindow ( Macros *M);
-private:  
-QButtonGroup* DisplayBox;
-QGroupBox* Area;
-int NumberOfMacros;
-protected:
-void fontChange(const QFont &);
-
-public slots:
-virtual void resizeEvent( QResizeEvent * );
-void updateMacroWindow(Macros *);
-
-signals:
-void callMacro(int);  
-};
-
-#endif
diff --git a/src/mfskdemodulator.cpp b/src/mfskdemodulator.cpp
index 432f097..edaab12 100644
--- a/src/mfskdemodulator.cpp
+++ b/src/mfskdemodulator.cpp
@@ -105,7 +105,6 @@ void MFSKDemodulator::afc ( int freq,double energy )
 void MFSKDemodulator::recvbit ( int bit )
 {
 	int c;
-	char zeichen;
 	datashreg = ( datashreg << 1 );
 	c = !! bit;
 	datashreg = datashreg | c;
@@ -116,8 +115,6 @@ void MFSKDemodulator::recvbit ( int bit )
 	{
 		/* the "1" belongs to the next symbol */
 		c = Decoder->decode ( datashreg >> 1 );
-
-		zeichen = c;
 		if ( c != -1 )
 			emit newSymbol ( ( char ) c );
 		/* we already received this */
diff --git a/src/parameter.cpp b/src/parameter.cpp
index b33e92b..9040257 100644
--- a/src/parameter.cpp
+++ b/src/parameter.cpp
@@ -24,8 +24,8 @@ Status = UNDEF;
 
 // Defaultsettings
 
-MinimumWindowWidth=640;
-MinimumWindowHeight=555;
+//MinimumWindowWidth=640;
+//MinimumWindowHeight=480;
 
 
 callsign="";
@@ -47,7 +47,15 @@ ActChannel = 0;   // Pointer to the active Channel
 ChannelChain = 0; // Pointer to the Start of the Rx - ChannelChain
 ApplicationFont =0;
 autoCrLf=true;
-
+dateFormat="dd.MM.yyyy";
+
+InputDeviceName="LinPSK_Record";
+OutputDeviceName="LinPSK_Play";
+sampleRate=11025;
+complexFormat=false;
+LangName[0]="B";
+LangName[1]="E";
+LangName[2]="G";
 }
 Parameter::~Parameter()
 {
diff --git a/src/parameter.h b/src/parameter.h
index e7d7239..e824e24 100644
--- a/src/parameter.h
+++ b/src/parameter.h
@@ -45,11 +45,6 @@ public:
 void setupDevices();
 // Variables
 
-/** MinimumWindowWidth */
-int MinimumWindowWidth;
-/** MinimumWindowHeight */
-int MinimumWindowHeight;
-
 
 QString callsign;                    // Callsign
 QString myLocator;
@@ -67,16 +62,21 @@ QString Host;
 int Port;
 bool DemoMode;                      // DemoMode ?
 
+QString LangName[3];		    //Contains the used language names for button labeling
 
 int timeoffset;                     // offset to UTC
 
 /** DeviceSection */
+QString InputDeviceName;
+QString OutputDeviceName;
 
+int sampleRate;
+bool complexFormat;
 
 bool slashed0; 				// True if to print 0 slashed
 bool autoCrLf;              // True if sending cr lf on enter
 
-unsigned int  RxChannels;
+int  RxChannels;
 CRxChannel * ChannelChain;
 CRxChannel * ActChannel;
 QsoInfo *QslData;
diff --git a/src/processlogdata.cpp b/src/processlogdata.cpp
index 78a2b1c..8a123ef 100644
--- a/src/processlogdata.cpp
+++ b/src/processlogdata.cpp
@@ -74,9 +74,11 @@ void ProcessLogData::doAction()
 {
   if ( !connectionEstablished )
     usleep ( 6000 );
+  while (tcpSocket == 0) // On heavy loaded systems it might last some times until socket is created
+    usleep(6000);
   if ( !connectionEstablished && tcpSocket->state() != 3)
   {
-    qDebug ( "Waiting for Socket timed out: %d",tcpSocket->state() );
+ //   qDebug ( "Waiting for Socket timed out: %d",tcpSocket->state() );
     QMessageBox::StandardButton reply;
     reply = QMessageBox::question ( 0, "LinPSK", tr ( "Cannot connect to LinLogBook\nTry again later ?" ), QMessageBox::Yes | QMessageBox::No );
     if ( reply == QMessageBox::No )
@@ -88,24 +90,23 @@ void ProcessLogData::doAction()
     exit();
     return;
   }
-// if ( tcpSocket->state() != QAbstractSocket::ConnectedState )
-//  usleep ( 500 );
 
-  qDebug ( "SocketError %d", tcpSocket->state() );
+//  qDebug ( "SocketError %d", tcpSocket->state() );
   if ( tcpSocket->state() == QAbstractSocket::UnconnectedState )
   {
     QMessageBox::information ( 0, "LinPSK", tr ( "Cannot connect to LinLogBook" ) );
     return;
   }
   int n = tcpSocket->write ( actionString.toLatin1(), actionString.length() );
-  qDebug ( "Written %d, to be written %d", n, actionString.length() );
+//  qDebug ( "Written %d, to be written %d", n, actionString.length() );
   if ( n < 0 ) // Retry
   {
     usleep ( 100 );
     n = tcpSocket->write ( actionString.toLatin1(), actionString.length() );
-    qDebug ( "Written %d, to be written %d", n, actionString.length() );
+//    qDebug ( "Written %d, to be written %d", n, actionString.length() );
   }
-  tcpSocket->flush();
+ /** qt 4.7 lets flush write data again*/
+//  tcpSocket->flush();
 }
 void ProcessLogData::connectionClosedbyHost()
 {
@@ -119,7 +120,7 @@ void ProcessLogData::connectionClosedbyHost()
 
 void ProcessLogData::readAnswer()
 {
-  qDebug ( "Read Answer" );
+//  qDebug ( "Read Answer" );
 //Has to be improved, to get safer
   QString s;
   int i;
@@ -132,7 +133,7 @@ void ProcessLogData::readAnswer()
     results[i]->setText ( s );
     results[i]->show();
   }
-  qDebug ( "%d Zeilen gelesen", i );
+//  qDebug ( "%d Zeilen gelesen", i );
 emit answerAvailable();
 }
 void ProcessLogData::setConnected()
@@ -143,8 +144,8 @@ void ProcessLogData::setError ( QAbstractSocket::SocketError  )
 {
   connectionEstablished = false;
   connectionError = true;
-  if ( tcpSocket != 0 )
-    qDebug ( "SocketError %d", tcpSocket->state() );
+//  if ( tcpSocket != 0 )
+//    qDebug ( "SocketError %d", tcpSocket->state() );
 }
 
 
diff --git a/src/pskmodulator.cpp b/src/pskmodulator.cpp
index d5714fa..b089bd3 100644
--- a/src/pskmodulator.cpp
+++ b/src/pskmodulator.cpp
@@ -573,7 +573,7 @@ char PSKModulator::GetNextCWSymbol(void) {
 
 int PSKModulator::GetChar() {
   int ch;
-  static int last = 0;
+//  static int last = 0;
   switch (status) {
     case TX_OFF_STATE: //is receiving
       ch = TXOFF_CODE; //else turn off
@@ -626,7 +626,7 @@ int PSKModulator::GetChar() {
     case TX_END_STATE:
       break;
   }
-  last = ch;
+//  last = ch;
   return ( ch);
 }
 
diff --git a/src/pskmodulator.h b/src/pskmodulator.h
index 4a2e477..b3e2454 100644
--- a/src/pskmodulator.h
+++ b/src/pskmodulator.h
@@ -30,7 +30,6 @@
 #include <ctype.h>
 
 #include "ctxdisplay.h"
-#include "ctxwindow.h"
 #include "cmodulator.h"
 
 
diff --git a/src/rttydemodulator.cpp b/src/rttydemodulator.cpp
old mode 100644
new mode 100755
diff --git a/src/rttydemodulator.h b/src/rttydemodulator.h
old mode 100644
new mode 100755
diff --git a/src/spectrumdisplay.cpp b/src/spectrumdisplay.cpp
deleted file mode 100644
index 00a39f7..0000000
--- a/src/spectrumdisplay.cpp
+++ /dev/null
@@ -1,354 +0,0 @@
-/***************************************************************************
-                          spectrumdisplay.cpp  -  description
-                             -------------------
-    begin                : Fr March 19 2004
-    copyright            : (C) 2004 by Volker Schroer
-    email                : dl1ksv at gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
-
-
-#include <QRadioButton>
-#include <QSpinBox>
-#include <QPainter>
-#include <QPixmap>
-#include <QMouseEvent>
-#include <QSplitter>
-#include "spectrumdisplay.h"
-#include "crxchannel.h"
-#include "parameter.h"
-#include "color.h"
-
-#define SPECTRUMHEIGHT 70
-#define WATERFALLHEIGHT 20
-#define LABELHEIGHT 10
-#define DISTANCE 3
-
-extern Parameter settings;
-
-SpectrumDisplay::SpectrumDisplay ( QWidget* parent ) : QFrame ( parent )
-{
-    setFrameShape( QFrame::StyledPanel);
-setFrameShadow(QFrame::Sunken );
-
-
-	MaxFreq = new QSpinBox ( parent );
-	MaxFreq->setMaximum ( 2500 );
-	MaxFreq->setMinimum ( 1300 );
-	MaxFreq->setValue ( 2500 );
-	MaxFreq->setSingleStep ( 100 );
-
-	MinFreq = new QSpinBox ( parent );
-	MinFreq->setButtonSymbols ( QSpinBox::UpDownArrows );
-	MinFreq->setMaximum ( 1200 );
-	MinFreq->setMinimum ( 100 );
-	MinFreq->setSingleStep ( 100 );
-
-Smooth=new QRadioButton(tr("Smooth"),parent);
-	languageChange();
-
-
-	inputdata = 0;
-
-
-	Phase = 0;
- Farbe=0;
-// Connections
-	connect ( this, SIGNAL ( frequencyChanged ( int ) ), this, SLOT ( setnewFrequency ( int ) ) );
-for(int i=0; i< 1024;i++)
- smoothedfft[i]=0.;
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-SpectrumDisplay::~SpectrumDisplay()
-{
-	// no need to delete child widgets, Qt does it all for us
-}
-
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
-void SpectrumDisplay::languageChange()
-{
-
-	MaxFreq->setSuffix ( " Hz" );
-	MinFreq->setSuffix ( " Hz" );
-}
-void SpectrumDisplay::resizeEvent ( QResizeEvent * )
-{
-
-	calculateSizeofComponents();
-	translate();
-	calcFFT();
-	plotspectrum ( false );
-
-}
-
-void SpectrumDisplay::calculateSizeofComponents()
-{
-	int xpos, ypos, width, height, innerheight, innerwidth;
-	width = this->width();
-	height =this->height();
-	/** Display **/
-	xpos = 0;
-	ypos = height * DISTANCE / 100;
-  innerwidth=width-2*this->frameWidth();
-
-	innerheight = height * SPECTRUMHEIGHT / 100;
-pdisplay =QPixmap ( innerwidth,innerheight);
-pwaterfall=QPixmap(innerwidth,height-innerheight);
-pwaterfall.fill(Qt::black);
-	/** Controlelements of the display **/
-	ypos = ypos + height + DISTANCE * height / 100;
-	innerheight = height * LABELHEIGHT / 100;
-	innerwidth = ( width - 2 * xpos ) / 4;
-	xpos = x();
-	MinFreq->setGeometry ( xpos, ypos, innerwidth, innerheight );
-//xpos=this->width()-innerwidth;
-Smooth->setGeometry(xpos+width/2-innerwidth/2,ypos,innerwidth, innerheight );
-	xpos = xpos + width - innerwidth;
-	MaxFreq->setGeometry ( xpos, ypos, innerwidth, innerheight );
-
-}
-
-// Plot Spectrum of decimated Input
-void SpectrumDisplay::plotspectrum ( bool overload )
-{
-
-
-	QPainter p;
-
-
-	int dist, y1, y2, z, ymax, xmax;
-	int minfreq, maxfreq;
-
-	double scale;
-	
-	scale = ( pdisplay.height() - 15 ) / 100.;
-	minfreq = MinFreq->value();
-	maxfreq = MaxFreq->value();
-	ymax = pdisplay.height()-4; // Subtract Frame
-	dist = ymax / 10;
-	xmax = pdisplay.width();
-
-	pdisplay.fill();
-	p.begin ( &pdisplay );
-	p.setBrush ( Qt::white );
-
-//Plot Frequencylines for the different Rx- Windows
-
-	  for (CRxChannel *pRx=settings.ChannelChain;pRx != 0;pRx= pRx->getNextChannel())
-	  {
-	
-    if ( Farbe->size() > 0)
-	     {
-	       int ID = pRx->getID();
-	       if ( ID >= 0 && ID < Farbe->size() )
-	         p.setPen(Farbe->at(ID));
-	     }
-
-	    // Calculate Centerfrequency Coordinates
-	    z=(int)(((  pRx->getRxFrequency()-minfreq)*xmax)/(maxfreq-minfreq)+0.5);
-	    p.drawLine(z,0,z,ymax);
-
-	    if ( (z =  pRx->get2RxFrequency()) != 0 ) // RTTY demands to lines
-	      {
-	        z=(( z-minfreq)*xmax)/(maxfreq-minfreq);
-	        p.drawLine(z,0,z,ymax);
-	      }
-	 }
-	
-
-	if ( overload )
-		p.setPen ( Qt::red );
-	else
-		p.setPen ( Qt::blue );
-// Plot Lineal and grid
-	p.setPen ( Qt::black );
-	paintLineal ( &p, xmax, ymax );
-
-	if ( inputdata != 0 )
-	{
-		for ( int i = 1;i < xmax;i++ )
-		{
-
-			y1 = ymax - ( int ) ( scale * fftdata[i-1] ) - 15;
-			y2 = ymax - ( int ) ( scale * fftdata[i] ) - 15;
-
-			p.drawLine ( i - 1, y1, i, y2 );
-		}
-
-		if ( Phase != 0 )
-			plotVector ( &p );
-	}
-
-p.end();
-	 if ( inputdata != 0 )
-	 {
-	xmax = pwaterfall.width();
-
-	  p.begin(&pwaterfall);
- p.drawPixmap(0,2,pwaterfall,0,0,pwaterfall.width(),pwaterfall.height()-2);
-	  for (int i=0;i<xmax;i++)
-	  {
-	   y1=4*fftdata[i];
-	   if ( y1 > 255)
-	    y1 = 255;
-	   else if  ( y1 < 0 )
-	    y1= 0;
-	   p.setPen(color[y1]);
-	   p.drawPoint(i,0);
-	   p.drawPoint(i,1);
-	  }
-
-	p.end();
-}
-update();
-}
-void SpectrumDisplay::calcFFT()
-{
-
-	if ( inputdata == 0 )
-		return;          // No data available
-	for ( int i = 0;i < pdisplay.width();i++ )
-  if( Smooth->isChecked())
- {
-float x=( log10 ( inputdata[xtranslate[i]] + 100. ) - 2. );
- float gain=(1. - exp(-(0.2 * x)));
-  smoothedfft[i]=smoothedfft[i]*(1.-gain) + gain *x;
- fftdata[i] = ( int ) (20.*smoothedfft[i]);
- }
-else
-//18.4 scales to a range from 0 - 100, as max(inputdata ) =  fft_length/4 ^ 2
-		fftdata[i] = ( int ) ( 18.4 * ( log10 ( inputdata[xtranslate[i]] + 100. ) - 2. ) );
-// For Color scale should be 18.4 *2.55
-}
-
-void SpectrumDisplay::translate ( void )
-{
-	int i, to, minfreq, maxfreq, displaywidth;
-	minfreq = MinFreq->value();
-	maxfreq = MaxFreq->value();
-	to = int ( maxfreq * 1024 / 2756.25 );
-	displaywidth = pdisplay.width();
-	for ( i = 0;i < displaywidth;i++ )
-		xtranslate[i] = ( ( ( maxfreq - minfreq ) * i * to / displaywidth ) + minfreq * to ) / maxfreq;
-}
-
-void SpectrumDisplay::startPlot ( double *x, bool overload )
-{
-	inputdata = x;
-	translate();
-	calcFFT();
-	plotspectrum ( overload );
-}
-
-void SpectrumDisplay::setnewFrequency ( int position )
-{
-
-	double freq;
-	int ii;
-	ii = pdisplay.width();
-	freq = ( position * ( MaxFreq->value() - MinFreq->value() ) ) / ii + MinFreq->value();
-	settings.ActChannel->setRxFrequency ( freq );
-	emit FrequencyChanged ( freq );
-}
-
-void SpectrumDisplay::paintLineal ( QPainter* p, int xmax, int ymax )
-{
-
-	int stepfrequency;
-	float stepwidth;
-	int i, ix, NumberofFreqs, diff;
-	int y;
-	QString frequency;
-	QFontMetrics fm ( this->font() );
-	int minfreq = MinFreq->value();
-// Calcalute Frequency- Steps
-	diff = ( MaxFreq->value() - minfreq );
-	NumberofFreqs = 7;
-	while ( NumberofFreqs > 4 )
-	{
-		stepfrequency = diff / NumberofFreqs;
-		if ( (stepfrequency * NumberofFreqs) != diff )
-			NumberofFreqs--;
-		else
-			break;
-	}
-	stepwidth = float ( xmax ) / NumberofFreqs;
-
-	diff = ymax / 10;
-	y = ymax - diff;
-
-
-	for ( i = 1; i < NumberofFreqs; i++ )
-	{
-		ix = ( int ) ( i * stepwidth + 0.5 );
-		p->drawLine ( ix, y, ix, y - 3 );
-		frequency.setNum ( minfreq + stepfrequency*i );
-		ix = ix - fm.width ( frequency ) / 2;
-		p->drawText ( ix, ymax, frequency );
-
-	}
-
-// Plot Grid
-	for ( i = 1;i < 10; i++ )
-	{
-
-		p->drawLine ( 0, y, xmax, y );
-		y -= diff;
-	}
-}
-
-void SpectrumDisplay::plotVector ( QPainter *p )
-{
-	int xc, yc;
-	double mag;
-
-	xc = pdisplay.width() / 8;
-	yc = pdisplay.height() / 8;
-	p->drawEllipse ( xc, yc, 40, 40 );
-	xc = xc + 20;
-	yc = yc + 20;
-	p->setPen ( Qt::green );
-
-	for(int i=0; i< 11; i++)
-	 {
-	   mag=abs(Phase[i]);
-	   if ( mag > 0.001)
-	     p->drawLine(xc,yc,xc - (int)(20.*Phase[i].imag()/mag), yc - (int)(20.*Phase[i].real()/mag) );
-	 }
-
-}
-
-void SpectrumDisplay::setPhasePointer ( std::complex<float> *p )
-{
-	Phase = p;
-}
-void SpectrumDisplay::setColorList ( QList<QColor> *c )
-{
-  Farbe=c;
-}
-void SpectrumDisplay::mousePressEvent ( QMouseEvent *e )
-
-{
-	emit frequencyChanged ( e->x() - lineWidth() );
-}
-void SpectrumDisplay::paintEvent(QPaintEvent *e)
-{
-QFrame::paintEvent(e);
-QPainter p(this);
-p.drawPixmap(frameWidth(),frameWidth(),pdisplay);
-p.drawPixmap(frameWidth(),frameWidth()+pdisplay.height()-4,pwaterfall);
-}
-
diff --git a/src/spectrumwindow.cpp b/src/spectrumwindow.cpp
new file mode 100644
index 0000000..ab8b95a
--- /dev/null
+++ b/src/spectrumwindow.cpp
@@ -0,0 +1,194 @@
+/***************************************************************************
+                          spectrumwindow.cpp -  description
+                             -------------------
+    begin                : Sat Aug 25 2012
+    copyright            : (C) 2012 by Volker Schroer
+    email                : DL1KSV at gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ ***************************************************************************/
+
+#include "spectrumwindow.h"
+#include "parameter.h"
+
+#include <QPixmap>
+#include <QPainter>
+#include <QMouseEvent>
+#include "crxchannel.h"
+#include <cmath>
+
+extern Parameter settings;
+
+SpectrumWindow::SpectrumWindow(QWidget *parent) :
+  QFrame(parent)
+{
+  int x=2*frameWidth();
+  pdisplay=new QPixmap (width()-x,height()-x);
+  pdisplay->fill();
+  Farbe=0;
+}
+void SpectrumWindow::resizeEvent(QResizeEvent *)
+{
+  int x=2*frameWidth();
+  if(pdisplay != 0)
+    delete pdisplay;
+  pdisplay =new QPixmap (this->width()-x,this->height()-x);
+  pdisplay->fill();
+  QPainter p(pdisplay);
+  paintLineal(&p,pdisplay->width(),pdisplay->height(),100,2500);
+  p.end();
+}
+
+void SpectrumWindow::paintLineal ( QPainter* p, int xmax, int ymax,int minfreq,int maxfreq )
+{
+
+    int stepfrequency;
+    float stepwidth;
+    int i, ix, NumberofFreqs, diff;
+    int y;
+    QString frequency;
+    QFontMetrics fm ( this->font() );
+// Calcalute Frequency- Steps
+    diff = ( maxfreq - minfreq );
+    NumberofFreqs = 7;
+    while ( NumberofFreqs > 4 )
+    {
+        stepfrequency = diff / NumberofFreqs;
+        if ( (stepfrequency * NumberofFreqs) != diff )
+            NumberofFreqs--;
+        else
+            break;
+    }
+    stepwidth = float ( xmax ) / NumberofFreqs;
+
+    diff = ymax / 10;
+    if( diff < 12)
+        diff = 12;
+    y = ymax -3* diff/2;
+    y=(y/diff)*diff;
+    for ( i = 1; i < NumberofFreqs; i++ )
+    {
+        ix = ( int ) ( i * stepwidth + 0.5 );
+        p->drawLine ( ix, y, ix, y + 3 );
+        frequency.setNum ( minfreq + stepfrequency*i );
+        ix = ix - fm.width ( frequency ) / 2;
+        p->drawText ( ix, y+diff+diff/2, frequency );
+
+    }
+
+// Plot Grid
+
+    for ( i = diff;i <=y; i +=diff )
+    {
+        p->drawLine ( 0, i, xmax, i );
+    }
+  baseline=y;
+}
+void SpectrumWindow::plotSpectrum(bool overload,float *fftdata,int minfreq,int maxfreq)
+{
+  float scale;
+  int y1,y2,z;
+  int ymax = pdisplay->height();
+  int xmax = pdisplay-> width();
+ // scale = ymax / 100.;
+  scale=baseline/8.03;
+  pdisplay->fill();
+  QPainter p(pdisplay);
+  p.setBrush ( Qt::white );
+
+//Plot Frequencylines for the different Rx- Windows
+
+    for (CRxChannel *pRx=settings.ChannelChain;pRx != 0;pRx= pRx->getNextChannel())
+    {
+
+  if ( Farbe->size() > 0)
+       {
+         int ID = pRx->getID();
+         if ( ID >= 0 && ID < Farbe->size() )
+           p.setPen(Farbe->at(ID));
+       }
+      // Calculate Centerfrequency Coordinates
+      z=(int)(((  pRx->getRxFrequency()-minfreq)*xmax)/(maxfreq-minfreq)+0.5);
+      p.drawLine(z,0,z,ymax);
+
+      if ( (z =  pRx->get2RxFrequency()) != 0 ) // RTTY demands to lines
+        {
+          z=(( z-minfreq)*xmax)/(maxfreq-minfreq);
+          p.drawLine(z,0,z,ymax);
+        }
+   }
+    if ( overload )
+            p.setPen ( Qt::red );
+    for ( int i = 1;i < xmax;i++ )
+    {
+
+        y1 = baseline - ( int ) ( scale * fftdata[i-1] );
+        y2 = baseline - ( int ) ( scale * fftdata[i] );
+
+        p.drawLine ( i - 1, y1, i, y2 );
+    }
+
+  p.setPen ( Qt::black );
+  paintLineal ( &p, xmax, ymax,minfreq,maxfreq );
+  if ( Phase != 0 )
+    plotVector ( &p );
+  p.end();
+  update();
+}
+
+void SpectrumWindow::paintEvent(QPaintEvent *e)
+{
+  int x=frameWidth();
+  QFrame::paintEvent(e);
+  QPainter p(this);
+  p.drawPixmap(x,x,pdisplay->copy(0,0,pdisplay->width(),pdisplay->height()));
+  p.end();
+ }
+
+void SpectrumWindow::setColorList ( QList<QColor> *c )
+{
+  Farbe=c;
+}
+void SpectrumWindow::setPhasePointer ( std::complex<float> *p )
+{
+  Phase = p;
+}
+void SpectrumWindow::plotVector ( QPainter *p )
+{
+  int xc, yc;
+  double mag;
+  xc = pdisplay->width() / 8;
+  yc = pdisplay->height() / 8;
+  p->drawEllipse ( xc, yc, 40, 40 );
+  xc = xc + 20;
+  yc = yc + 20;
+  p->setPen ( Qt::green );
+  for(int i=0; i< 11; i++)
+  {
+    mag=abs(Phase[i]);
+    if ( mag > 0.001)
+    p->drawLine(xc,yc,xc - (int)(20.*Phase[i].imag()/mag), yc - (int)(20.*Phase[i].real()/mag) );
+   }
+}
+
+void SpectrumWindow::mousePressEvent ( QMouseEvent *e )
+{
+  emit frequencyChanged ( e->x() - lineWidth() );
+}
+void SpectrumWindow::wheelEvent ( QWheelEvent * e )
+{
+  double freq=settings.ActChannel->getRxFrequency();
+  if(e->delta() >0 )
+    freq =freq+1;
+  else
+    freq = freq -1;
+  emit frequencyChanged(freq);
+  settings.ActChannel->setRxFrequency(freq);
+    e->accept();
+}
diff --git a/src/spectrumwindow.h b/src/spectrumwindow.h
new file mode 100644
index 0000000..e2e3dd6
--- /dev/null
+++ b/src/spectrumwindow.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+                          spectrumwindow.h -  description
+                             -------------------
+    begin                : Sat Aug 25 2012
+    copyright            : (C) 2012 by Volker Schroer
+    email                : DL1KSV at gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ ***************************************************************************/
+
+#ifndef SPECTRUMWINDOW_H
+#define SPECTRUMWINDOW_H
+
+#include <QFrame>
+#include <QColor>
+#include <QList>
+#include <complex>
+
+class QPixmap;
+
+class SpectrumWindow : public QFrame
+{
+  Q_OBJECT
+public:
+  explicit SpectrumWindow(QWidget *parent = 0);
+  void plotSpectrum(bool overload, float *fftdata, int minfreq, int maxfreq);
+  void setColorList(QList<QColor> *c);
+  void mousePressEvent ( QMouseEvent *e );
+  void setPhasePointer(std::complex<float> *);
+
+private:
+  void paintLineal(QPainter* ,int,int,int,int);
+  void plotVector ( QPainter *p );
+  QPixmap *pdisplay;   // Display for double buffering
+  int baseline; // Y Position of X- Axis in window
+  std::complex<float> *Phase;
+
+protected:
+    void resizeEvent( QResizeEvent * );
+    void paintEvent(QPaintEvent *);
+    void wheelEvent ( QWheelEvent * e );
+  
+    QList<QColor> *Farbe;
+signals:
+  void frequencyChanged(int);
+  void frequencyChanged(double);
+public slots:
+  
+};
+
+#endif // SPECTRUMWINDOW_H
diff --git a/src/src.pro b/src/src.pro
index 7a284b8..70338ef 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,24 +1,27 @@
-SOURCES += linpsk.cpp \
-           main.cpp \
- macros.cpp \
- macrowindow.cpp \
+CONFIG(debug, debug|release) {
+    QMAKE_CXXFLAGS_DEBUG += -g3 \
+    -fpermissive \
+    -O0
+CONFIG +=  debug
+} else {
+    DEFINES += QT_NO_DEBUG
+    DEFINES += QT_NO_DEBUG_OUTPUT
+    QMAKE_CXXFLAGS_DEBUG +=-fpermissive \
+    -O2
+}
+
+SOURCES += main.cpp \
  bpskdemodulator.cpp \
  bpskmodulator.cpp \
  cdemodulator.cpp \
  cledbutton.cpp \
  cmodulator.cpp \
- controlpanel.cpp \
  cpskdemodulator.cpp \
- crecording.cpp \
  crxchannel.cpp \
- crxdisplay.cpp \
  crxwindow.cpp \
  csound.cpp \
  csquelch.cpp \
- ctrigger.cpp \
  ctxbuffer.cpp \
- ctxdisplay.cpp \
- ctxwindow.cpp \
  deinterleaver.cpp \
  feccoder.cpp \
  firfilter.cpp \
@@ -38,29 +41,24 @@ SOURCES += linpsk.cpp \
  textinput.cpp \
  viterbi.cpp \
  waveinput.cpp \
- spectrumdisplay.cpp \
  readonlystringlistmodel.cpp \
- processlogdata.cpp
-HEADERS += linpsk.h \
- bpskdemodulator.h \
+ processlogdata.cpp \
+    tabwidget.cpp \
+    spectrumwindow.cpp \
+    waterfallwindow.cpp
+HEADERS += bpskdemodulator.h \
  bpskmodulator.h \
  cdemodulator.h \
  cledbutton.h \
  cmodulator.h \
  color.h \
  constants.h \
- controlpanel.h \
  cpskdemodulator.h \
- crecording.h \
  crxchannel.h \
- crxdisplay.h \
  crxwindow.h \
  csound.h \
  csquelch.h \
- ctrigger.h \
  ctxbuffer.h \
- ctxdisplay.h \
- ctxwindow.h \
  deinterleaver.h \
  feccoder.h \
  fircoeffs.h \
@@ -68,8 +66,6 @@ HEADERS += linpsk.h \
  frequencyselect.h \
  input.h \
  interleaver.h \
- macros.h \
- macrowindow.h \
  mfskdemodulator.h \
  mfskmodulator.h \
  mfskvaricode.h \
@@ -83,10 +79,12 @@ HEADERS += linpsk.h \
  textinput.h \
  viterbi.h \
  waveinput.h \
- spectrumdisplay.h \
  readonlystringlistmodel.h \
  fskmodulator.h \
- processlogdata.h
+ processlogdata.h \
+    tabwidget.h \
+    spectrumwindow.h \
+    waterfallwindow.h
 TEMPLATE = app
 CONFIG += warn_on \
 	  thread \
@@ -96,14 +94,6 @@ TARGET = ../bin/linpsk
 RESOURCES = application.qrc
 DESTDIR = .
 
-
-
-QMAKE_CXXFLAGS_DEBUG += -g3 \
--O0
-QMAKE_CXXFLAGS_RELEASE += -O2
-
-
-
 QT += network
 
 INCLUDEPATH += ../gui
@@ -113,7 +103,7 @@ LIBS += ../gui/libgui.a \
 -L/usr/lib \
 -lasound \
 -lfftw3
-TARGETDEPS += ../gui/libgui.a
+POST_TARGETDEPS += ../gui/libgui.a
 
 DISTFILES += ../README ../COPYING \
  ../ChangeLog \
@@ -126,5 +116,5 @@ INSTALLS += target
 
 target.path = /usr/local/bin
 
-CONFIG -= debug
+FORMS +=
 
diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp
new file mode 100644
index 0000000..0c9ae4d
--- /dev/null
+++ b/src/tabwidget.cpp
@@ -0,0 +1,11 @@
+#include "tabwidget.h"
+#include <QTabBar>
+
+TabWidget::TabWidget(QWidget *parent) :
+  QTabWidget(parent)
+{
+}
+void TabWidget::setTabTextColor(int index, const QColor &color)
+{
+  tabBar()->setTabTextColor(index, color);
+}
diff --git a/src/tabwidget.h b/src/tabwidget.h
new file mode 100644
index 0000000..e388f9a
--- /dev/null
+++ b/src/tabwidget.h
@@ -0,0 +1,19 @@
+#ifndef TABWIDGET_H
+#define TABWIDGET_H
+
+#include <QTabWidget>
+
+class TabWidget : public QTabWidget
+{
+  Q_OBJECT
+public:
+  explicit TabWidget(QWidget *parent = 0);
+  void setTabTextColor(int index, const QColor &color);
+  
+signals:
+  
+public slots:
+  
+};
+
+#endif // TABWIDGET_H
diff --git a/src/waterfallwindow.cpp b/src/waterfallwindow.cpp
new file mode 100644
index 0000000..93f3b02
--- /dev/null
+++ b/src/waterfallwindow.cpp
@@ -0,0 +1,89 @@
+/***************************************************************************
+                          waterfallwindow.h -  description
+                             -------------------
+    begin                : Sat Aug 26 2012
+    copyright            : (C) 2012 by Volker Schroer
+    email                : DL1KSV at gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ ***************************************************************************/
+
+#include <QPixmap>
+#include <QPainter>
+#include <QMouseEvent>
+#include "waterfallwindow.h"
+#include "color.h"
+#include "parameter.h"
+#include "crxchannel.h"
+
+extern Parameter settings;
+
+WaterfallWindow::WaterfallWindow(QWidget *parent) :
+  QFrame(parent)
+{
+  int x=2*frameWidth();
+  pwaterfall=new QPixmap (width()-x,height()-x);
+  pwaterfall->fill(Qt::black);
+}
+
+void WaterfallWindow::plotWaterfall(float *fftdata)
+{
+  int xmax = pwaterfall->width();
+  int y1;
+  QPainter p(pwaterfall);
+  p.drawPixmap(0,2,pwaterfall->copy(0,0,pwaterfall->width(),pwaterfall->height()-2));
+  for (int i=0;i<xmax;i++)
+  {
+   y1=31*fftdata[i]; // Scale is 256/8.1
+   if ( y1 > 255)
+     {
+  //     qDebug("y1: %i, fft: %f",y1,fftdata[i]);
+    y1 = 255;
+     }
+   else if  ( y1 < 0 )
+    y1= 0;
+   p.setPen(color[y1]);
+   p.drawPoint(i,0);
+   p.drawPoint(i,1);
+  }
+
+  p.end();
+  update();
+}
+void WaterfallWindow::paintEvent(QPaintEvent *e)
+{
+  int x=frameWidth();
+  QFrame::paintEvent(e);
+  QPainter p(this);
+  p.drawPixmap(x,x,pwaterfall->copy(0,0,pwaterfall->width(),pwaterfall->height()));
+  p.end();
+}
+void WaterfallWindow::resizeEvent(QResizeEvent *)
+{
+  int x=2*frameWidth();
+  if(pwaterfall != 0)
+    delete pwaterfall;
+  pwaterfall =new QPixmap (this->width()-x,this->height()-x);
+  pwaterfall->fill(Qt::black);
+}
+void WaterfallWindow::mousePressEvent ( QMouseEvent *e )
+{
+  emit frequencyChanged ( e->x() - lineWidth() );
+}
+void WaterfallWindow::wheelEvent ( QWheelEvent * e )
+{
+  double freq=settings.ActChannel->getRxFrequency();
+  if(e->delta() >0 )
+    freq =freq+1;
+  else
+    freq = freq -1;
+  emit frequencyChanged(freq);
+  settings.ActChannel->setRxFrequency(freq);
+    e->accept();
+}
diff --git a/src/ctrigger.h b/src/waterfallwindow.h
similarity index 52%
rename from src/ctrigger.h
rename to src/waterfallwindow.h
index 146ad54..ca79dd3 100644
--- a/src/ctrigger.h
+++ b/src/waterfallwindow.h
@@ -1,9 +1,9 @@
 /***************************************************************************
-                          |FILENAME|  -  description
+                          waterfallwindow.h -  description
                              -------------------
-    begin                : |DATE|
-    copyright            : (C) |YEAR| by |AUTHOR|
-    email                : |EMAIL|
+    begin                : Sat Aug 26 2012
+    copyright            : (C) 2012 by Volker Schroer
+    email                : DL1KSV at gmx.de
  ***************************************************************************/
 
 /***************************************************************************
@@ -12,43 +12,35 @@
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
- *   The PSK part is based on WinPSK 1.0 by Moe Wheatley, AE4JY            *
  ***************************************************************************/
 
-#ifndef CTRIGGER_H
-#define CTRIGGER_H
+#ifndef WATERFALLWINDOW_H
+#define WATERFALLWINDOW_H
 
+#include <QFrame>
 
-#include <QGroupBox>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QLineEdit;
-class QRadioButton;
-
-class CTrigger : public QGroupBox
+class QPixmap;
+class WaterfallWindow : public QFrame
 {
-    Q_OBJECT
-
+  Q_OBJECT
 public:
-    CTrigger(const QString, QWidget* parent = 0  );
-    ~CTrigger();
-
-    QLineEdit* TriggerText;
-    QRadioButton* Activate;
-
-public slots:
-
+  explicit WaterfallWindow(QWidget *parent = 0);
+  void plotWaterfall(float *fftdata);
+  void mousePressEvent ( QMouseEvent *e );
 
 protected:
-    void resizeEvent( QResizeEvent * );
-
+  void resizeEvent( QResizeEvent * );
+  void paintEvent(QPaintEvent *);
+  void wheelEvent ( QWheelEvent * e );
 
-protected slots:
-    virtual void languageChange();
 private:
-    void calculateSizeofComponents();
-
+  QPixmap *pwaterfall;
+  
+signals:
+ void frequencyChanged(double);
+ void frequencyChanged(int);
+public slots:
+  
 };
 
-#endif // CTRIGGER_H
+#endif // WATERFALLWINDOW_H
diff --git a/src/waveinput.cpp b/src/waveinput.cpp
index bc9beb1..30e8fc9 100644
--- a/src/waveinput.cpp
+++ b/src/waveinput.cpp
@@ -48,7 +48,8 @@ void WaveInput::PTT(bool )
 bool WaveInput::open_Device_read(QString *errorstring)
 {
  char header[5];
- unsigned char header1[3]; 
+ unsigned char header1[4]; // Only 3 are used, but lead to buffer 
+                           // overflow while reading, when compiled with -O2
  char c;
  QString s;
  int i;
@@ -103,7 +104,6 @@ if  ( s != "WAVE")
   return false;
  }
 //Check for fmt
-
 i =read(fd,&header[0],4*sizeof(header[0]));
 header[4]=0;
 if ( i != 4)
@@ -212,7 +212,6 @@ if ( (i != 4) || s != "data" )
  *errorstring= QString(QObject::tr("No data found\n"));
 	return false;
 }
-
 // got it
 // Read 4 byte Length info
 i=read(fd,&header1[0],4*sizeof(header1[0]));
@@ -254,8 +253,11 @@ while (j<anzahl)
       Bytesread +=2;
      }		
    else		
-   // lseek(fd,offset,SEEK_SET);
-    printf("Error reading data chunk\n"); 
+   {
+    printf("Error reading data chunk\nRetry from the beginning");
+    lseek(fd,offset,SEEK_SET);
+    Length=Bytesread;
+    }
    }
   else
   {
@@ -271,8 +273,11 @@ while (j<anzahl)
     Bytesread++;
     }
    else		
-   // lseek(fd,offset,SEEK_SET);
-    printf("Error reading data chunk\n");        
+   {
+    printf("Error reading data chunk\nRetry from the beginning");
+    lseek(fd,offset,SEEK_SET);
+    Length=Bytesread;
+    }
   }
  if (Bytesread >= Length )
  {
diff --git a/gui/editmacro.h b/templates/cpp
similarity index 71%
copy from gui/editmacro.h
copy to templates/cpp
index fdad2b0..84ca3ea 100644
--- a/gui/editmacro.h
+++ b/templates/cpp
@@ -17,39 +17,3 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-
-#ifndef EDITMACRO_H
-#define EDITMACRO_H
-
-#include <QDialog>
-#include "ui_editmacro.h"
-
-class Macros;
-class ReadOnlyStringListModel;
-
-
-class EditMacro : public QDialog, private Ui::EditMacro
-{
-  Q_OBJECT
-
-public:
-  EditMacro(Macros *M,QWidget* parent = 0, Qt::WFlags fl = 0 );
-  ~EditMacro();
-
-
-public slots:
-  /*$PUBLIC_SLOTS$*/
-
-protected:
-Macros *AllMacros;
-ReadOnlyStringListModel *model;
-
-protected slots:
-  /*$PROTECTED_SLOTS$*/
-  virtual void accept();
-void setText( int Number);
-void insertKeyword(const QModelIndex &);
-};
-
-#endif
-
diff --git a/gui/editmacro.h b/templates/h
similarity index 71%
copy from gui/editmacro.h
copy to templates/h
index fdad2b0..84ca3ea 100644
--- a/gui/editmacro.h
+++ b/templates/h
@@ -17,39 +17,3 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-
-#ifndef EDITMACRO_H
-#define EDITMACRO_H
-
-#include <QDialog>
-#include "ui_editmacro.h"
-
-class Macros;
-class ReadOnlyStringListModel;
-
-
-class EditMacro : public QDialog, private Ui::EditMacro
-{
-  Q_OBJECT
-
-public:
-  EditMacro(Macros *M,QWidget* parent = 0, Qt::WFlags fl = 0 );
-  ~EditMacro();
-
-
-public slots:
-  /*$PUBLIC_SLOTS$*/
-
-protected:
-Macros *AllMacros;
-ReadOnlyStringListModel *model;
-
-protected slots:
-  /*$PROTECTED_SLOTS$*/
-  virtual void accept();
-void setText( int Number);
-void insertKeyword(const QModelIndex &);
-};
-
-#endif
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/linpsk.git



More information about the pkg-hamradio-commits mailing list