~ubuntu-branches/ubuntu/oneiric/v4l-utils/oneiric-proposed

« back to all changes in this revision

Viewing changes to utils/qv4l2/ctrl-tab.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-07-22 13:58:48 UTC
  • mfrom: (11.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110722135848-tju3x5jlpa4e9by5
Tags: 0.8.5-1ubuntu1
debian/control: Drop ia32-libs-dev build dependency; we don't have this in
Ubuntu, and ia32-libs is in universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        case V4L2_CTRL_TYPE_MENU:
49
49
        case V4L2_CTRL_TYPE_BUTTON:
50
50
        case V4L2_CTRL_TYPE_INTEGER64:
 
51
        case V4L2_CTRL_TYPE_BITMASK:
51
52
        case V4L2_CTRL_TYPE_CTRL_CLASS:
52
53
        case V4L2_CTRL_TYPE_STRING:
53
54
                return true;
260
261
                                m_sigMapper, SLOT(map()));
261
262
                break;
262
263
 
 
264
        case V4L2_CTRL_TYPE_BITMASK:
 
265
                addLabel(grid, name);
 
266
                edit = new QLineEdit(p);
 
267
                edit->setInputMask("HHHHHHHH");
 
268
                addWidget(grid, edit);
 
269
                m_widgetMap[qctrl.id] = edit;
 
270
                connect(m_widgetMap[qctrl.id], SIGNAL(lostFocus()),
 
271
                                m_sigMapper, SLOT(map()));
 
272
                connect(m_widgetMap[qctrl.id], SIGNAL(returnPressed()),
 
273
                                m_sigMapper, SLOT(map()));
 
274
                break;
 
275
 
263
276
        case V4L2_CTRL_TYPE_STRING:
264
277
                addLabel(grid, name);
265
278
                edit = new QLineEdit(p);
455
468
                v = static_cast<QCheckBox *>(w)->isChecked();
456
469
                break;
457
470
 
 
471
        case V4L2_CTRL_TYPE_BITMASK:
 
472
                v = (int)static_cast<QLineEdit *>(w)->text().toUInt(0, 16);
 
473
                break;
458
474
        case V4L2_CTRL_TYPE_MENU:
459
475
                idx = static_cast<QComboBox *>(w)->currentIndex();
460
476
                for (i = qctrl.minimum; i <= qctrl.maximum; i++) {
647
663
                w->setStatusTip(w->whatsThis());
648
664
                break;
649
665
 
 
666
        case V4L2_CTRL_TYPE_BITMASK:
 
667
                w->setWhatsThis(QString("Type: Bitmask\n"
 
668
                                        "Maximum: %1\n"
 
669
                                        "Current: %2\n"
 
670
                                        "Default: %3")
 
671
                        .arg((unsigned)qctrl.maximum, 0, 16).arg((unsigned)v, 0, 16)
 
672
                        .arg((unsigned)qctrl.default_value, 0, 16) + flags);
 
673
                w->setStatusTip(w->whatsThis());
 
674
                break;
 
675
 
650
676
        case V4L2_CTRL_TYPE_BUTTON:
651
677
                w->setWhatsThis(QString("Type: Button") + flags);
652
678
                w->setStatusTip(w->whatsThis());
691
717
                        static_cast<QLineEdit *>(w)->setText(QString::number(v));
692
718
                break;
693
719
 
 
720
        case V4L2_CTRL_TYPE_BITMASK:
 
721
                static_cast<QLineEdit *>(w)->setText(QString("%1").arg((unsigned)v, 8, 16, QChar('0')));
 
722
                break;
 
723
 
694
724
        case V4L2_CTRL_TYPE_BOOLEAN:
695
725
                static_cast<QCheckBox *>(w)->setChecked(v);
696
726
                break;