--- a/libgui/Dialog.cpp
+++ b/libgui/Dialog.cpp
@@ -1,42 +1,47 @@
+
 #include "Dialog.h"
-#include <libkwave/MessagePort.h>
-#include <libkwave/Global.h>
-#include <stdio.h>
 
-extern struct Global globals;
+Dialog::Dialog(bool modal)
+    :QDialog(0, 0, modal)
+{
+    this->modal = modal;
+}
 
-Dialog::Dialog (bool modal):QDialog (0,0,modal)
+//**********************************************************************
+Dialog::Dialog(const char *name, bool modal)
+    :QDialog(0, name, modal)
 {
-  this->modal=modal;
+    if (name) setCaption (name);
+    this->modal = modal;
 }
+
 //**********************************************************************
-Dialog::Dialog (const char *name,bool modal):QDialog (0,name,modal)
+void Dialog::accept()
 {
-  if (name) setCaption (name);
-  this->modal=modal;
+    hide();
+
+//    if (!modal) {
+	//call virtual function getcommand()
+	const char *c = getCommand();
+	if (c) emit command(c);
+//	delete this;
+//    }
+
+    setResult(true);
 }
+
 //**********************************************************************
-void Dialog::accept ()
+void Dialog::reject()
 {
-  hide ();
+    hide();
+//    if (!modal) delete this;
+    setResult (false);
+}
 
-  if (!modal)
-    {
-      const char *c=getCommand(); //call virtual function getcommand
-      if (globals.port) globals.port->putMessage (c);
-      else printf ("Error:Port is missing\n");
-      delete this;
-    }
-  setResult (true);
-}
 //**********************************************************************
-void Dialog::reject ()
-{
-  hide ();
-  if (!modal) delete this;
-  setResult (false);
-}
-//**********************************************************************
-Dialog::~Dialog ()
+Dialog::~Dialog()
 {
 }
+
+//**********************************************************************
+//**********************************************************************