コード例 #1
0
ファイル: mainwindow.cpp プロジェクト: sandroKa/SE
GUI::MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->date_from->setDate(QDate::currentDate().addMonths(-1));
    ui->date_to->setDate(QDate::currentDate());
    household = new logic::Household();
    QString ColumnName[] = {"Reason", "Comment", "Date", "Category", "Payment_Method", "Value"};
    ui->tbl_Overview->setColumnCount(6);
    ui->tbl_Overview->setRowCount(0);
    ui->tbl_Overview->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    for(int i = 0; i < 6; i++)
        {
            ui->tbl_Overview->setHorizontalHeaderItem(i, new QTableWidgetItem(ColumnName[i]));
        }

    QStringList list=(QStringList()<<"10"<<"20"<<"50");
    ui->cmb_DataCount->addItems(list);
    refreshui();

    connect(ui->cmb_Cat, SIGNAL(currentIndexChanged(int)), this, SLOT(slotFilter()));
    connect(ui->cmb_DataCount, SIGNAL(currentIndexChanged(int)), this, SLOT(slotFilter()));
    connect(ui->date_from, SIGNAL(dateChanged(QDate)), this, SLOT(slotFilter()));
    connect(ui->date_to, SIGNAL(dateChanged(QDate)), this, SLOT(slotFilter()));
}
コード例 #2
0
void CMainWindow::restoreSettings()
{
    // restore radio saved values
    for (int i=0; i<MAX_RADIO; i++) {

        CCommand::radio_t radio = backend->getRadioSettings(i);
        radioList[i]->frequency = radio.frequency;
        radioList[i]->step = radio.step;
        radioList[i]->ifshift = radio.ifshift;
        radioList[i]->squelch = radio.squelch;
        radioList[i]->mode = radio.mode;
        radioList[i]->filter = radio.filter;
        radioList[i]->nb = radio.nb;
        radioList[i]->agc = radio.agc;
        radioList[i]->vsc = radio.vsc;

        // Set it on UI
        // Display only
        display->setRadio(i);
        display->setStepFromValue(radio.step);
        // other device
        slotFrequency(QString("%1").arg(radio.frequency));
        slotIF(radio.ifshift);
        slotSquelch(radio.squelch);
        slotFilter(radio.filter);
        slotModulation(radio.mode);
        slotNoiseBlanker(radio.nb);
        slotVSC(radio.vsc);
        slotAGC(radio.agc);
        slotVolume1(radio.volume);
        backend->setRadio(radio);
    }
}
コード例 #3
0
ファイル: mainwindow.cpp プロジェクト: sandroKa/SE
void GUI::MainWindow::on_btn_addTrans_clicked()
{
    GUI::gui_addTransaction gui_addTransaction(categorysset,household, this);
    if(gui_addTransaction.exec() == QDialog::Accepted){
        slotFilter();
    }
}
コード例 #4
0
SingleCollectionTreeItemModel::SingleCollectionTreeItemModel( Collections::Collection *collection,
                                                              const QList<CategoryId::CatMenuId> &levelType )
    :CollectionTreeItemModelBase( )
{
    m_collection = collection;
    //we only have one collection that, by its very nature, is always expanded
    m_expandedCollections.insert( m_collection );
    setLevels( levelType );

    connect( collection, SIGNAL( updated() ), this, SLOT( slotFilter() ) ) ;
}
コード例 #5
0
ファイル: mainwindow.cpp プロジェクト: opieproject/opie
void MainWindow::slotFilterChange()
{
    FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus,
                   m_filterCategory );
    if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted )
    {
        m_filterName = dlg.name();
        m_filterServer = dlg.server();
        m_filterDest = dlg.destination();
        m_filterStatus = dlg.status();
        m_filterCategory = dlg.category();
        m_actionFilter->setOn( true );
        slotFilter( true );
    }
    else
    {
        m_actionFilter->setOn( false );
        slotFilter( false );
    }
}
コード例 #6
0
CollectionTreeItemModel::CollectionTreeItemModel( const QList<CategoryId::CatMenuId> &levelType )
    : CollectionTreeItemModelBase()
{
    m_rootItem = new CollectionTreeItem( this );
    CollectionManager *collMgr = CollectionManager::instance();
    connect( collMgr, SIGNAL(collectionAdded(Collections::Collection*)), this, SLOT(collectionAdded(Collections::Collection*)), Qt::QueuedConnection );
    connect( collMgr, SIGNAL(collectionRemoved(QString)), this, SLOT(collectionRemoved(QString)) );

    QList<Collections::Collection *> collections = CollectionManager::instance()->viewableCollections();
    foreach( Collections::Collection *coll, collections )
    {
        connect( coll, SIGNAL(updated()), this, SLOT(slotFilter()) ) ;
        m_collections.insert( coll->collectionId(), CollectionRoot( coll, new CollectionTreeItem( coll, m_rootItem, this ) ) );
    }
コード例 #7
0
CollectionTreeItemModel::CollectionTreeItemModel( const QList<int> &levelType )
    : CollectionTreeItemModelBase()
{
    CollectionManager* collMgr = CollectionManager::instance();
    connect( collMgr, SIGNAL( collectionAdded( Collections::Collection* ) ), this, SLOT( collectionAdded( Collections::Collection* ) ), Qt::QueuedConnection );
    connect( collMgr, SIGNAL( collectionRemoved( QString ) ), this, SLOT( collectionRemoved( QString ) ) );
    //delete m_rootItem; //clears the whole tree!
    m_rootItem = new CollectionTreeItem( this );
    d->collections.clear();
    QList<Collections::Collection*> collections = CollectionManager::instance()->viewableCollections();
    foreach( Collections::Collection *coll, collections )
    {
        connect( coll, SIGNAL( updated() ), this, SLOT( slotFilter() ) ) ;
        d->collections.insert( coll->collectionId(), CollectionRoot( coll, new CollectionTreeItem( coll, m_rootItem, this ) ) );
    }
コード例 #8
0
ファイル: mainwindow.cpp プロジェクト: sandroKa/SE
int GUI::MainWindow::start(QApplication *qApplication)
{
    GUI::Login Login(household, this);
    int exec = Login.exec();
    if(exec == QDialog::Accepted)
    {
        show();
        slotFilter();
        return qApplication->exec();
    }
    else
    {
        return exec;
    }
}
コード例 #9
0
ファイル: mainwindow.cpp プロジェクト: sandroKa/SE
void GUI::MainWindow::on_btn_delete_clicked()
{
    int i = selected();


    //std::cerr << dataset.at(i).getReason().toStdString();

    if (i != -1){
        GUI::gui_addTransaction gui_addTransaction(dataset.at(i),categorysset, household, this);
        if(gui_addTransaction.exec() == QDialog::Accepted){
            slotFilter();
        }
    }

    //std::cerr << i;
}
コード例 #10
0
ファイル: mainwindow.cpp プロジェクト: opieproject/opie
void MainWindow::slotCloseDlg()
{
    // Close install dialog
    delete m_widgetStack.visibleWidget();

    // Reload package list
    initPackageInfo();

    // Update Opie launcher links
    QCopEnvelope e("QPE/System", "linkChanged(QString)");
    QString lf = QString::null;
    e << lf;

    // Reapply any filters previously set
    if ( m_actionShowNotInstalled->isOn() )
        slotShowNotInstalled();
    else if ( m_actionShowInstalled->isOn() )
        slotShowInstalled();
    else if ( m_actionShowUpdated->isOn() )
        slotShowUpdated();
    else if ( m_actionFilter->isOn() )
        slotFilter( true );
}
コード例 #11
0
ファイル: capture_wgt.cpp プロジェクト: z80/chassis
CaptureWgt::CaptureWgt( QWidget * parent )
: QMainWindow( parent )
{
    pd = new PD();
    pd->ui.setupUi( this );
    pd->crossFname = "./video.ini";
    pd->modifyLaserPos = false;
    pd->devMenu = 0;
    pd->resMenu = 0;
    pd->imgScale = 1.0;
    pd->drawArrow = false;
    pd->flipX = false;
    pd->flipY = false;
    pd->resolutionAcquired = false;
    pd->cap = new Capture( this );
    pd->ui.brightnessDw->setVisible( false );
    pd->brightness = new BrightnessWgt( this );
    pd->ui.brightnessDw->setWidget( pd->brightness );
    pd->cap->setBrightnessRange( pd->brightness->range() );
    connect( pd->brightness, SIGNAL(rangeChanged(const QPointF &)), 
             this,           SLOT(slotBrightnessChanged(const QPointF &)) );
    connect( pd->ui.brightnessRange, SIGNAL(triggered()), 
             this,                   SLOT(slotBrightness()) );

    Ui_CaptureWgt & ui = pd->ui;
    connect( ui.capture,  SIGNAL(triggered()), this, SLOT(slotCapture()) );
    connect( ui.settings, SIGNAL(triggered()), this, SLOT(slotSettings()) );
    connect( ui.cross,    SIGNAL(triggered()), this, SLOT(slotCrossEmphasis()) );

    pd->scene = new QGraphicsScene( pd->ui.view );
    pd->scene->setBackgroundBrush( QBrush( Qt::gray ) );
    pd->ui.view->setScene( pd->scene );

    pd->image = new QGraphicsPixmapItem( 0, pd->scene );
    pd->image->setPos( 0.0, 0.0 );
    pd->lineX1 = new QGraphicsLineItem( pd->image, pd->scene );
    pd->lineY1 = new QGraphicsLineItem( pd->image, pd->scene );
    pd->lineX2 = new QGraphicsLineItem( pd->image, pd->scene );
    pd->lineY2 = new QGraphicsLineItem( pd->image, pd->scene );
    pd->arrow = new QGraphicsPolygonItem( pd->image, pd->scene );
    // This is for laser spot position.
    pd->laserPosImage = new QGraphicsPixmapItem( 0, pd->scene );
    pd->laserPosImage->setPixmap( QPixmap( ":/images/laser.png" ) );
    pd->laserPosImage->setPos( -pd->laserPosImage->pixmap().width()/2, -pd->laserPosImage->pixmap().height()/2 );
    pd->laserPosImage->setVisible( false );

    connect( pd->ui.flipX, SIGNAL(triggered()), this, SLOT(slotFlipX()) );
    connect( pd->ui.flipY, SIGNAL(triggered()), this, SLOT(slotFlipY()) );

    pd->cap = new Capture( this );
    listDevices();
    connect( pd->cap, SIGNAL(frame(const QImage &)), this, SLOT(slotFrame(const QImage &)) );

    ui.view->installEventFilter( this );

    pd->inMenu = new QMenu( this );
    ui.input->setMenu( pd->inMenu );
    QAction * a = new QAction( "Default", this );
    a->setCheckable( true );
    a->setChecked( true );
    pd->inMenu->addAction( a );
    pd->inList << a;

    a = new QAction( "Usb", this );
    a->setCheckable( true );
    pd->inMenu->addAction( a );
    pd->inList << a;

    a = new QAction( "S-Video", this );
    a->setCheckable( true );
    pd->inMenu->addAction( a );
    pd->inList << a;

    a = new QAction( "Composite", this );
    a->setCheckable( true );
    pd->inMenu->addAction( a );
    pd->inList << a;

    for ( int i=0; i<pd->inList.size(); i++ )
    {
        QAction * a = pd->inList[i];
        connect( a, SIGNAL(triggered()), this, SLOT(slotInput()) );
    }

    // ƒействи¤ соответствующие фильтрам.
    pd->filterList << ui.equalizeHist;
    pd->filterList << ui.fullContrast;
    pd->filterList << ui.sobel;
    pd->filterList << ui.median;
    pd->filterList << ui.timeSmooth;
    pd->filterList << ui.highPass;
    pd->filterList << ui.surface;
    pd->filterList << ui.brightnessRange;
    for ( int i=0; i<pd->filterList.size(); i++ )
    {
        QAction * a = pd->filterList[i];
        connect( a, SIGNAL(triggered()), this, SLOT(slotFilter()) );
    }

    connect( ui.pixmap, SIGNAL(triggered()), this, SLOT(slotPixmap()) );


	QToolButton * btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.input));
	if ( btn )
		btn->setPopupMode(QToolButton::InstantPopup);

	btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.device));
	if ( btn )
		btn->setPopupMode(QToolButton::InstantPopup);
	
	btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.resolution));
	if ( btn )
		btn->setPopupMode(QToolButton::InstantPopup);

    //pd->usbLight = new LightIcon( this );
    //ui.toolBar->addWidget( pd->usbLight );

    // Laser spot handling.
    QMenu * m = new QMenu( this );
    a = m->addAction( "Set laser spot position" );
    connect( a, SIGNAL(triggered()), this, SLOT(slotSetLaserSpot()) );
    btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.laser));
    btn->setPopupMode( QToolButton::MenuButtonPopup );
    ui.laser->setMenu( m );

    updateCrossPos();
}