/**********************************************************************

	--- Dlgedit generated file ---

	File: PrinterData.cpp
	Last generated: Tue Jun 24 22:14:32 1997

	DO NOT EDIT!!!  This file will be automatically
	regenerated by dlgedit.  All changes will be lost.

 *********************************************************************/

#include "PrinterData.h"

#define Inherited QDialog

#include <qbttngrp.h>
#include <qframe.h>
#include <qlabel.h>
#include <kapp.h>
#include <klocale.h>


PrinterData::PrinterData
(
	QWidget* parent,
	const char* name
)
	:
	Inherited( parent, name )
{
	QFrame* tmpQFrame;
	tmpQFrame = new QFrame( this, "Frame_2" );
	tmpQFrame->setGeometry( 10, 10, 320, 235 );
	tmpQFrame->setFrameStyle( 49 );


	EconomyButtonGroup = new QButtonGroup( this, "ButtonGroup_3" );
	EconomyButtonGroup->setGeometry( 20, 20, 145, 95 );
	EconomyButtonGroup->setFrameStyle( 49 );
	EconomyButtonGroup->setTitle(i18n( "Mode") );
	EconomyButtonGroup->setAlignment( 1 );

	EconomyButton = new QRadioButton( EconomyButtonGroup, "RadioButton_3" );
	EconomyButton->move(15,25);
	connect( EconomyButton, SIGNAL(clicked()), SLOT(EconomyButtonClicked()) );
	EconomyButton->setText(i18n( "Economy") );
	EconomyButton->setAutoRepeat( FALSE );
	EconomyButton->setAutoResize( TRUE );

	PresentationButton = new QRadioButton( EconomyButtonGroup, "RadioButton_4" );
	PresentationButton->move(15,55);
	connect( PresentationButton, SIGNAL(clicked()), 
		 SLOT(PresentationButtonClicked()) );

	PresentationButton->setText( i18n("Presentation") );
	PresentationButton->setAutoRepeat( FALSE );
	PresentationButton->setAutoResize( TRUE );
	PresentationButton->setChecked( TRUE );


	DpiButtonGroup = new QButtonGroup( this, "ButtonGroup_4" );
	DpiButtonGroup->setGeometry( 180, 20, 140, 95 );
	DpiButtonGroup->setFrameStyle( 49 );
	DpiButtonGroup->setTitle(i18n( "Resolution" ));
	DpiButtonGroup->setAlignment( 1 );


	Dpi300Button = new QRadioButton( DpiButtonGroup, "RadioButton_5" );
	Dpi300Button->move(15,25);
	connect( Dpi300Button, SIGNAL(clicked()), SLOT(Dpi300ButtonClicked()) );
	Dpi300Button->setText( "300 dpi" );
	Dpi300Button->setAutoRepeat( FALSE );
	Dpi300Button->setAutoResize( TRUE );

	Dpi600Button = new QRadioButton( DpiButtonGroup, "RadioButton_6" );
	Dpi600Button->move(15,55);
	connect( Dpi600Button, SIGNAL(clicked()), SLOT(Dpi600ButtonClicked()) );
	Dpi600Button->setText( "600 dpi" );
	Dpi600Button->setAutoRepeat( FALSE );
	Dpi600Button->setAutoResize( TRUE );
	Dpi600Button->setChecked( TRUE );

	QLabel* tmpQLabel;
	tmpQLabel = new QLabel( this, "Label_11" );
	tmpQLabel->setGeometry( 180, 125, 100, 20 );
	tmpQLabel->setText(i18n( "Density") );
	tmpQLabel->setAlignment( 289 );
	tmpQLabel->setMargin( -1 );

	tmpQLabel = new QLabel( this, "Label_12" );
	tmpQLabel->setGeometry( 35, 125, 100, 20 );
	tmpQLabel->setText( i18n("Printer") );
	tmpQLabel->setAlignment( 289 );
	tmpQLabel->setMargin( -1 );

	tmpQLabel = new QLabel( this, "Label_12" );
	tmpQLabel->setGeometry( 180, 185, 115, 20 );
	tmpQLabel->setText(i18n( "Resolution Enh.") );
	tmpQLabel->setAlignment( 289 );
	tmpQLabel->setMargin( -1 );


	PrinterComboBox = new QComboBox( FALSE, this, "ComboBox_4" );
	PrinterComboBox->setGeometry( 35, 150, 105, 25 );
	connect( PrinterComboBox, SIGNAL(activated(const char*)), 
		 SLOT(PrinterComboClicked(const char*)) );

	PrinterComboBox->setSizeLimit( 10 );
	PrinterComboBox->setAutoResize( FALSE );

	DensityComboBox = new QComboBox( FALSE, this, "ComboBox_4" );
	DensityComboBox->setGeometry( 180, 150, 105, 25 );
	connect( DensityComboBox, SIGNAL(activated(const char*)), 
		 SLOT(DensityComboClicked(const char*)) );

	DensityComboBox->setSizeLimit( 10 );
	DensityComboBox->setAutoResize( FALSE );
	DensityComboBox->insertItem( "very light" );
	DensityComboBox->insertItem( "light" );
	DensityComboBox->insertItem( "medium" );
	DensityComboBox->insertItem( "dark" );
	DensityComboBox->insertItem( "very dark" );

	ResolutionComboBox = new QComboBox( FALSE, this, "ComboBox_5" );
	ResolutionComboBox->setGeometry( 180, 210, 105, 25 );
	connect( ResolutionComboBox, SIGNAL(activated(const char*)), 
		 SLOT(ResolutionComboBoxClicked(const char*)) );

	ResolutionComboBox->setSizeLimit( 10 );
	ResolutionComboBox->setAutoResize( FALSE );
	ResolutionComboBox->insertItem( "off" );
	ResolutionComboBox->insertItem( "light" );
	ResolutionComboBox->insertItem( "medium" );
	ResolutionComboBox->insertItem( "dark" );

	resize( 330, 255 );

}


PrinterData::~PrinterData()
{
}

void PrinterData::EconomyButtonClicked()
{
  if(!data)
    return;
  if(EconomyButton->isChecked()){
    data->Economode = "on";

  }
  else{

    data->Economode = "off";
  }


}


void PrinterData::PresentationButtonClicked()
{

  if(!data)
    return;

  if(PresentationButton->isChecked()){
    data->Economode = "off";
  }
  else{

    data->Economode = "on";
  }


}

void PrinterData::Dpi300ButtonClicked()
{
  if(!data)
    return;

  if(Dpi300Button->isChecked()){
    data->Resolution = "300";
  }
  else{

    data->Resolution  = "600";
  }

}

void PrinterData::Dpi600ButtonClicked()
{
  if(!data)
    return;

  if(Dpi600Button->isChecked()){
    data->Resolution = "600";
  }
  else{

    data->Resolution  = "300";
  }
}

void PrinterData::DensityComboClicked(const char* den)
{
  if(!data)
    return;
  
  data->Density = den;

}

void PrinterData::PrinterComboClicked(const char* printer)
{
  if(!data)
    return;
  
  data->Printer = printer;

}
void PrinterData::ResolutionComboBoxClicked(const char* res)
{

  if(!data)
    return;
  
  data->RET = res;

}
