コード例 #1
0
ファイル: dlgpreflibrary.cpp プロジェクト: midzer/mixxx
DlgPrefLibrary::DlgPrefLibrary(
        QWidget* pParent,
        UserSettingsPointer pConfig,
        Library* pLibrary)
        : DlgPreferencePage(pParent),
          m_dirListModel(),
          m_pConfig(pConfig),
          m_pLibrary(pLibrary),
          m_bAddedDirectory(false),
          m_iOriginalTrackTableRowHeight(Library::kDefaultRowHeightPx) {
    setupUi(this);

    connect(this, SIGNAL(requestAddDir(QString)),
            m_pLibrary, SLOT(slotRequestAddDir(QString)));
    connect(this, SIGNAL(requestRemoveDir(QString, Library::RemovalType)),
            m_pLibrary, SLOT(slotRequestRemoveDir(QString, Library::RemovalType)));
    connect(this, SIGNAL(requestRelocateDir(QString,QString)),
            m_pLibrary, SLOT(slotRequestRelocateDir(QString,QString)));
    connect(PushButtonAddDir, SIGNAL(clicked()),
            this, SLOT(slotAddDir()));
    connect(PushButtonRemoveDir, SIGNAL(clicked()),
            this, SLOT(slotRemoveDir()));
    connect(PushButtonRelocateDir, SIGNAL(clicked()),
            this, SLOT(slotRelocateDir()));

    // Set default direction as stored in config file
    int rowHeight = m_pLibrary->getTrackTableRowHeight();
    spinBoxRowHeight->setValue(rowHeight);
    connect(spinBoxRowHeight, SIGNAL(valueChanged(int)),
            this, SLOT(slotRowHeightValueChanged(int)));

    connect(libraryFontButton, SIGNAL(clicked()),
            this, SLOT(slotSelectFont()));

    // TODO(XXX) this string should be extracted from the soundsources
    QString builtInFormatsStr = "Ogg Vorbis, FLAC, WAVE, AIFF";
#if defined(__MAD__) || defined(__COREAUDIO__)
    builtInFormatsStr += ", MP3";
#endif
#if defined(__MEDIAFOUNDATION__) || defined(__COREAUDIO__) || defined(__FAAD__)
    builtInFormatsStr += ", M4A/MP4";
#endif
#ifdef __OPUS__
    builtInFormatsStr += ", Opus";
#endif
#ifdef __MODPLUG__
    builtInFormatsStr += ", ModPlug";
#endif
#ifdef __WV__
    builtInFormatsStr += ", WavPack";
#endif
    builtInFormats->setText(builtInFormatsStr);

    connect(checkBox_SyncTrackMetadataExport, SIGNAL(toggled(bool)),
            this, SLOT(slotSyncTrackMetadataExportToggled()));

    // Initialize the controls after all slots have been connected
    slotUpdate();
}
コード例 #2
0
ファイル: qt4.cpp プロジェクト: TheSLinux-forks/uim
void KUimCharDict::setupWidgets()
{
    QVBoxLayout * layout = new QVBoxLayout( this );
    layout->setMargin( 4 );
    layout->setSpacing( 6 );

    QWidget *upperHWidget = new QWidget( this );
    upperHWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum );

    QLabel *modeLabel = new QLabel( _( "Mode:" ), upperHWidget );
    m_modeCombo = new QComboBox( upperHWidget );
    m_modeCombo->addItem( _( "Bushu Search" ) );
    m_modeCombo->addItem( _( "Unicode Search" ) );
    modeLabel->setBuddy( m_modeCombo );

    m_fontselButton = new QPushButton( upperHWidget );
    m_fontselButton->setText( _( "Select Font" ) );
    connect( m_fontselButton, SIGNAL( clicked() ),
                      this, SLOT( slotSelectFont() ) );

    QLabel *charLabel = new QLabel( _( "Chars:" ), upperHWidget );
    m_charLineEdit = new QLineEdit( upperHWidget );
    charLabel->setBuddy( m_charLineEdit );

    QPushButton *clearButton = new QPushButton( _( "Clear" ), upperHWidget );
    connect( clearButton, SIGNAL( clicked() ),
        m_charLineEdit, SLOT( clear() ) );

    QHBoxLayout *upperHLayout = new QHBoxLayout( upperHWidget );
    upperHLayout->setSpacing( 4 );
    upperHLayout->addWidget( modeLabel );
    upperHLayout->addWidget( m_modeCombo );
    upperHLayout->addWidget( m_fontselButton );
    upperHLayout->addSpacing( 11 );
    upperHLayout->addWidget( charLabel );
    upperHLayout->addWidget( m_charLineEdit );
    upperHLayout->addWidget( clearButton );

    m_widgetStack = new QStackedWidget( this );
    m_widgetStack->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );

    m_bushuView = new BushuViewWidget( this );
    connect( m_bushuView, SIGNAL( charSelected( const QString & ) ),
                      this, SLOT( slotCharSelected( const QString & ) ) );
    m_bushuView->hide();
    m_widgetStack->addWidget( m_bushuView );

    m_unicodeView = new UnicodeViewWidget( this );
    connect( m_unicodeView, SIGNAL( charSelected( const QString & ) ),
                      this, SLOT( slotCharSelected( const QString & ) ) );
    m_unicodeView->hide();
    m_widgetStack->addWidget( m_unicodeView );

    connect( m_modeCombo, SIGNAL( activated( int ) ),
                      m_widgetStack, SLOT( setCurrentIndex( int ) ) );

    QFrame *separator = new QFrame( this );
    separator->setFrameShape( QFrame::HLine );
    separator->setFrameShadow( QFrame::Sunken );
    layout->setMargin( 0 );
    layout->addWidget( upperHWidget );
    layout->addWidget( separator );
    layout->addWidget( m_widgetStack );
}
コード例 #3
0
ファイル: dlgpreflibrary.cpp プロジェクト: Alppasa/mixxx
DlgPrefLibrary::DlgPrefLibrary(QWidget * parent,
                               UserSettingsPointer  config, Library *pLibrary)
        : DlgPreferencePage(parent),
          m_dirListModel(),
          m_pconfig(config),
          m_pLibrary(pLibrary),
          m_baddedDirectory(false),
          m_iOriginalTrackTableRowHeight(Library::kDefaultRowHeightPx) {
    setupUi(this);
    slotUpdate();
    checkbox_ID3_sync->setVisible(false);

    connect(this, SIGNAL(requestAddDir(QString)),
            m_pLibrary, SLOT(slotRequestAddDir(QString)));
    connect(this, SIGNAL(requestRemoveDir(QString, Library::RemovalType)),
            m_pLibrary, SLOT(slotRequestRemoveDir(QString, Library::RemovalType)));
    connect(this, SIGNAL(requestRelocateDir(QString,QString)),
            m_pLibrary, SLOT(slotRequestRelocateDir(QString,QString)));
    connect(PushButtonAddDir, SIGNAL(clicked()),
            this, SLOT(slotAddDir()));
    connect(PushButtonRemoveDir, SIGNAL(clicked()),
            this, SLOT(slotRemoveDir()));
    connect(PushButtonRelocateDir, SIGNAL(clicked()),
            this, SLOT(slotRelocateDir()));
    //connect(pushButtonM4A, SIGNAL(clicked()), this, SLOT(slotM4ACheck()));
    connect(pushButtonExtraPlugins, SIGNAL(clicked()),
            this, SLOT(slotExtraPlugins()));

    // plugins are loaded in src/main.cpp way early in boot so this is safe
    // here, doesn't need done at every slotUpdate
    QStringList plugins(SoundSourceProxy::getSupportedFileExtensionsByPlugins());
    if (plugins.length() > 0) {
        pluginsLabel->setText(plugins.join(", "));
    }

    // Set default direction as stored in config file
    int rowHeight = m_pLibrary->getTrackTableRowHeight();
    spinBoxRowHeight->setValue(rowHeight);
    connect(spinBoxRowHeight, SIGNAL(valueChanged(int)),
            this, SLOT(slotRowHeightValueChanged(int)));

    connect(libraryFontButton, SIGNAL(clicked()),
            this, SLOT(slotSelectFont()));
    connect(this, SIGNAL(setTrackTableFont(QFont)),
            m_pLibrary, SLOT(slotSetTrackTableFont(QFont)));
    connect(this, SIGNAL(setTrackTableRowHeight(int)),
            m_pLibrary, SLOT(slotSetTrackTableRowHeight(int)));

    // TODO(XXX) this string should be extracted from the soundsources
    QString builtInFormatsStr = "Ogg Vorbis, FLAC, WAVe, AIFF";
#if defined(__MAD__) || defined(__APPLE__)
    builtInFormatsStr += ", MP3";
#endif
#ifdef __OPUS__
    builtInFormatsStr += ", Opus";
#endif
#ifdef _MODPLUG_
    builtInFormatsStr += ", ModPlug";
#endif
    builtInFormats->setText(builtInFormatsStr);
}
コード例 #4
0
ファイル: videotextdlg.cpp プロジェクト: CowPanda/TeamTalk5
VideoTextDlg::VideoTextDlg(QWidget* parent/* = 0*/)
: QDialog(parent, QT_DEFAULT_DIALOG_HINTS)
{
    ui.setupUi(this);
    setWindowIcon(QIcon(APPICON));

    quint32 videotext = ttSettings->value(SETTINGS_DISPLAY_VIDEOTEXT,
                                          SETTINGS_DISPLAY_VIDEOTEXT_DEFAULT).toUInt();
    switch(videotext & VIDTEXT_SHOW_MASK)
    {
    case VIDTEXT_SHOW_USERNAME :
        ui.usernameRadioButton->setChecked(true);
        break;
    case VIDTEXT_SHOW_STATUSTEXT :
        ui.statusRadioButton->setChecked(true);
        break;
    case VIDTEXT_SHOW_NICKNAME :
    default :
        ui.nicknameRadioButton->setChecked(true);
        break;
    }

    switch(videotext & VIDTEXT_POSITION_MASK)
    {
    case VIDTEXT_POSITION_TOPLEFT :
        ui.pos_tlBtn->setChecked(true);
        break;
    case VIDTEXT_POSITION_TOPRIGHT :
        ui.pos_trBtn->setChecked(true);
        break;
    case VIDTEXT_POSITION_BOTTOMLEFT :
        ui.pos_blBtn->setChecked(true);
        break;
    case VIDTEXT_POSITION_BOTTOMRIGHT :
        ui.pos_brBtn->setChecked(true);
        break;
    }

    ui.widthSpinBox->setValue(ttSettings->value(SETTINGS_DISPLAY_VIDEOTEXT_WIDTH,
                              SETTINGS_DISPLAY_VIDEOTEXT_WIDTH_DEFAULT).toInt());
    ui.heightSpinBox->setValue(ttSettings->value(SETTINGS_DISPLAY_VIDEOTEXT_HEIGHT,
                              SETTINGS_DISPLAY_VIDEOTEXT_HEIGHT_DEFAULT).toInt());

    m_bgColor = ttSettings->value(SETTINGS_DISPLAY_VIDEOTEXT_BGCOLOR,
                                  SETTINGS_DISPLAY_VIDEOTEXT_BGCOLOR_DEFAULT)
                                  .value<QColor>();
    m_fgColor = ttSettings->value(SETTINGS_DISPLAY_VIDEOTEXT_FGCOLOR,
                                  SETTINGS_DISPLAY_VIDEOTEXT_FGCOLOR_DEFAULT)
                                  .value<QColor>();

    connect(ui.fontBtn, SIGNAL(clicked()),
            SLOT(slotSelectFont()));
    connect(ui.bgBtn, SIGNAL(clicked()),
            SLOT(slotSelectBackground()));
    connect(ui.nicknameRadioButton, SIGNAL(clicked()),
            SLOT(slotUpdateExample()));
    connect(ui.usernameRadioButton, SIGNAL(clicked()),
            SLOT(slotUpdateExample()));
    connect(ui.statusRadioButton, SIGNAL(clicked()),
            SLOT(slotUpdateExample()));
    connect(ui.pos_tlBtn, SIGNAL(clicked()),
            SLOT(slotUpdateExample()));
    connect(ui.pos_trBtn, SIGNAL(clicked()),
            SLOT(slotUpdateExample()));
    connect(ui.pos_blBtn, SIGNAL(clicked()),
            SLOT(slotUpdateExample()));
    connect(ui.pos_brBtn, SIGNAL(clicked()),
            SLOT(slotUpdateExample()));
    connect(ui.widthSpinBox, SIGNAL(valueChanged(int)),
            SLOT(slotUpdateExample()));
    connect(ui.heightSpinBox, SIGNAL(valueChanged(int)),
            SLOT(slotUpdateExample()));

    QTimer::singleShot(0, this, SLOT(slotUpdateExample()));
}