/***************************************************************************
                          myprojectdlg.cpp  -  description
                             -------------------
    begin                : Thu Jan 22 2004
    copyright            : (C) 2004 by Harald Krippel
    email                : neuro.harald@surfeu.at
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 <myprojectdlg.h>

#include <iostream>

#include <qvariant.h>
//#include <kcolorbutton.h>
#include <qcheckbox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qdir.h>
#include <qfiledialog.h>

//#include <kfiledialog.h>
//#include <klocale.h>
//#include <kio/job.h>
//#include <kio/netaccess.h>

MyProjectEditDlg::MyProjectEditDlg( QWidget* parent,  const char* name, bool modal, WFlags fl )
    : ProjectEditDlg( parent, name, modal, fl )
{
     tmppath = QDir::homeDirPath () + '/';
     path->setText( tmppath ) ;
     state=0;
}

/*
 *  Destroys the object and frees any allocated resources
 */
MyProjectEditDlg::~MyProjectEditDlg()
{
    // no need to delete child widgets, Qt does it all for us
}

void MyProjectEditDlg::slotGetData(FolderListItem *i)
{

    qWarning( "MyProjectEditDlg::slotGetData(): Geht !" );
}

void MyProjectEditDlg::slotEditData()
{

     qWarning( "MyProjectEditDlg::slotEditData(): Geht !" );
     accept();
}
void MyProjectEditDlg::slotEditText()
{
     
     qWarning( "MyProjectEditDlg::slotEditText(): Geht !" );
     if(state == 0)
     {
        path->setText( tmppath + text->text()) ;
     }
}
void MyProjectEditDlg::slotEditPath()
{

     qWarning( "MyProjectEditDlg::slotEditPath(): Geht !" );
     state=1;
}

void MyProjectEditDlg::slotEditPathDir()
{
    QString url=QFileDialog::getExistingDirectory();
//    KURL url=KFileDialog::getExistingURL();
    if(!url.isEmpty())
    {
      tmppath =  url ;
//      path->setText( tmppath + text->text()) ;
//      path->setText( url + '/' + text->text()) ;
      path->setText( url  + text->text()) ;
    }
     qWarning( "MyProjectEditDlg::slotEditPathDir(): Geht !" );
}

QString MyProjectEditDlg::getfile()
{
     return text->text();
}

QString MyProjectEditDlg::getpath()
{
     return path->text();
}
