コード例 #1
0
ファイル: settings.cpp プロジェクト: flavio/qtwitter
Settings::Settings( Core *coreSettings, QWidget *parent ) :
        QDialog( parent ),
        updateAccountsOnExit( false ),
        core( coreSettings ),
        pluginManagerTab(0)
{
    // Sorry, but this has to be here and not in Qtwitter::Qtwitter() for the core to be aware
    // of the signal emitted in Settings::Settings()
    connect( this, SIGNAL(createAccounts(QWidget*)), core, SLOT(createAccounts(QWidget*)) );

    ui.setupUi( this );

    themes.insert( Themes::STYLESHEET_COCOA.first,   Themes::STYLESHEET_COCOA.second);
    themes.insert( Themes::STYLESHEET_GRAY.first,    Themes::STYLESHEET_GRAY.second);
    themes.insert( Themes::STYLESHEET_GREEN.first,   Themes::STYLESHEET_GREEN.second);
    themes.insert( Themes::STYLESHEET_PURPLE.first,  Themes::STYLESHEET_PURPLE.second);
    themes.insert( Themes::STYLESHEET_SKY.first,     Themes::STYLESHEET_SKY.second);

    for (int i = 0; i < themes.keys().size(); ++i ) {
        ui.colorBox->addItem( themes.keys()[i] );
    }

    createLanguageMenu();

#ifdef Q_WS_X11
    QHBoxLayout *hlayout = new QHBoxLayout;

    useCustomBrowserCheckBox = new QCheckBox( tr( "Use custom web browser" ), ui.networkTab );
    selectBrowserEdit = new QLineEdit( ui.networkTab );
    selectBrowserButton = new QPushButton( tr( "Browse" ), ui.networkTab );

    hlayout->addWidget(selectBrowserEdit);
    hlayout->addWidget(selectBrowserButton);
    ui.verticalLayout_2->addWidget(useCustomBrowserCheckBox);
    ui.verticalLayout_2->addLayout(hlayout);

    selectBrowserEdit->setEnabled( false );
    selectBrowserButton->setEnabled( false );


    connect( useCustomBrowserCheckBox, SIGNAL(toggled(bool)), selectBrowserEdit, SLOT(setEnabled(bool)) );
    connect( useCustomBrowserCheckBox, SIGNAL(toggled(bool)), selectBrowserButton, SLOT(setEnabled(bool)) );
    connect( selectBrowserButton, SIGNAL(clicked()), this, SLOT(setBrowser()) );
#endif

    connect( ui.languageCombo, SIGNAL( currentIndexChanged( int )), this, SLOT( switchLanguage( int ) ) );
    connect( ui.colorBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeTheme(QString)) );
    connect( ui.checkNowButton, SIGNAL(clicked()), this, SLOT(checkForUpdate()) );
    ui.portEdit->setValidator( new QIntValidator( 1, 65535, this ) );

    emit createAccounts( ui.widget );
    //  loadConfig();
}
コード例 #2
0
void JabberAdd::radioToggled(bool)
{
	setBrowser(false);
	emit setAdd(m_btnJID->isChecked());
}
コード例 #3
0
void JabberAdd::browserClick()
{
	setBrowser(!m_bBrowser);
}
コード例 #4
0
void JabberAdd::radioToggled(bool)
{
    setBrowser(false);
    if (isVisible())
        emit setAdd(grpJID->isChecked());
}