FlowVis 1.0

FlowVis/transfersettingswidget.cpp

00001 #include "transfersettingswidget.h"
00002 #include <QtGui>
00003 
00004 TransferSettingsWidget::TransferSettingsWidget(QWidget *parent)
00005         : QWidget(parent)
00006 {
00007         QHBoxLayout* box = new QHBoxLayout();
00008 
00009         this->setFixedSize(255,50);
00010         transfer = new TransferWidget();
00011         triangle = new QtColorTriangle();
00012         box->setMargin(0);
00013         box->addWidget(transfer,0,Qt::AlignLeft);
00014         box->addWidget(triangle,0);
00015 
00016         this->setLayout(box);
00017 
00018         QObject::connect(triangle,SIGNAL(colorChanged(const QColor)),transfer,SLOT(ChangeSelectedColor(const QColor)));
00019         QObject::connect(transfer,SIGNAL(InvokeUpdateColorSelector(const QColor)),triangle,SLOT(setColor(const QColor)));
00020         QObject::connect(transfer,SIGNAL(TransferImageUpdated(const QImage)),this,SIGNAL(TransferImageUpdated(const QImage)));
00021         QObject::connect(this,SIGNAL(SaveConfig()),transfer,SLOT(SaveConfig()));
00022 }
00023 
00024 TransferSettingsWidget::~TransferSettingsWidget()
00025 {
00026 
00027 }
00028 
00029 void TransferSettingsWidget::Load()
00030 {
00031         QString fileName = QFileDialog::getOpenFileName(this,tr("Load Config File"), ".", tr("Config Files (*.cfg)"));
00032         transfer->LoadConfig(fileName);
00033 }
00034 
00035 void TransferSettingsWidget::Save()
00036 {
00037         QString fileName = QFileDialog::getSaveFileName(this, tr("Save Config File"), ".", tr("Config Files (*.cfg)"));
00038 
00039         transfer->SaveConfig(fileName);
00040 }
00041 
00042 QDataStream &operator<<(QDataStream &out, const TransferSettingsWidget *item)
00043 {
00044         out << item->transfer;
00045         return out;
00046 }
00047 QDataStream &operator>>(QDataStream &in, TransferSettingsWidget *item)
00048 {
00049         
00050         in >> item->transfer;
00051         return in;
00052 }
 All Classes Functions Variables Friends