Example #1
0
joystick::joystick(QWidget *parent, const char *name, const QStringList &) : KCModule(JoystickFactory::instance(), parent, name)
{
    setAboutData(new KAboutData("kcmjoystick", I18N_NOOP("KDE Joystick Control Module"), "1.0",
                                I18N_NOOP("KDE Control Center Module to test Joysticks"), KAboutData::License_GPL, "(c) 2004, Martin Koller", 0,
                                "*****@*****.**"));

    setQuickHelp(
        i18n("<h1>Joystick</h1>"
             "This module helps to check if your joystick is working correctly.<br>"
             "If it delivers wrong values for the axes, you can try to solve this with "
             "the calibration.<br>"
             "This module tries to find all available joystick devices "
             "by checking /dev/js[0-4] and /dev/input/js[0-4]<br>"
             "If you have another device file, enter it in the combobox.<br>"
             "The Buttons list shows the state of the buttons on your joystick, the Axes list "
             "shows the current value for all axes.<br>"
             "NOTE: the current Linux device driver (Kernel 2.4, 2.6) can only autodetect"
             "<ul>"
             "<li>2-axis, 4-button joystick</li>"
             "<li>3-axis, 4-button joystick</li>"
             "<li>4-axis, 4-button joystick</li>"
             "<li>Saitek Cyborg 'digital' joysticks</li>"
             "</ul>"
             "(For details you can check your Linux source/Documentation/input/joystick.txt)"));

    joyWidget = new JoyWidget(this);

    setMinimumSize(joyWidget->minimumSize());

    setButtons(KCModule::Default);
}
Example #2
0
TaskbarConfig::TaskbarConfig(QWidget *parent, const char *name, const QStringList &) : KCModule(TaskBarFactory::instance(), parent, name)
{
    QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
    m_widget = new TaskbarConfigUI(this);
    layout->addWidget(m_widget);

    // TODO: Load these from .desktop files?
    m_appearances.append(TaskbarAppearance(i18n("Elegant"), false, false, true));
    m_appearances.append(TaskbarAppearance(i18n("Classic"), true, false, true));
    m_appearances.append(TaskbarAppearance(i18n("For Transparency"), false, true, true));

    for(TaskbarAppearance::List::const_iterator it = m_appearances.constBegin(); it != m_appearances.constEnd(); ++it)
    {
        m_widget->appearance->insertItem((*it).name());
    }

    connect(m_widget->appearance, SIGNAL(activated(int)), this, SLOT(appearanceChanged(int)));
    addConfig(TaskBarSettings::self(), m_widget);

    setQuickHelp(
        i18n("<h1>Taskbar</h1> You can configure the taskbar here."
             " This includes options such as whether or not the taskbar should show all"
             " windows at once or only those on the current desktop."
             " You can also configure whether or not the Window List button will be displayed."));

    QStringList list = i18nActionList();
    m_widget->kcfg_LeftButtonAction->insertStringList(list);
    m_widget->kcfg_MiddleButtonAction->insertStringList(list);
    m_widget->kcfg_RightButtonAction->insertStringList(list);
    m_widget->kcfg_GroupTasks->insertStringList(i18nGroupModeList());

    connect(m_widget->kcfg_GroupTasks, SIGNAL(activated(int)), this, SLOT(slotUpdateComboBox()));
    connect(m_widget->kcfg_UseCustomColors, SIGNAL(stateChanged(int)), this, SLOT(slotUpdateCustomColors()));

    slotUpdateCustomColors();
    updateAppearanceCombo();

    if(KWin::numberOfDesktops() < 2)
    {
        m_widget->kcfg_ShowAllWindows->hide();
        m_widget->kcfg_SortByDesktop->hide();
        m_widget->spacer2->changeSize(0, 0);
    }

    if(!QApplication::desktop()->isVirtualDesktop() || QApplication::desktop()->numScreens() == 1) // No Ximerama
    {
        m_widget->showAllScreens->hide();
    }
    connect(m_widget->showAllScreens, SIGNAL(stateChanged(int)), SLOT(changed()));

    KAboutData *about = new KAboutData(I18N_NOOP("kcmtaskbar"), I18N_NOOP("KDE Taskbar Control Module"), 0, 0, KAboutData::License_GPL,
                                       I18N_NOOP("(c) 2000 - 2001 Matthias Elter"));

    about->addAuthor("Matthias Elter", 0, "*****@*****.**");
    about->addCredit("Stefan Nikolaus", I18N_NOOP("KConfigXT conversion"), "*****@*****.**");
    setAboutData(about);

    load();
    QTimer::singleShot(0, this, SLOT(notChanged()));
}
Example #3
0
KclockModule::KclockModule(QWidget *parent, const char *name, const QStringList &) : KCModule(KlockModuleFactory::instance(), parent, name)
{
    KAboutData *about = new KAboutData(I18N_NOOP("kcmclock"), I18N_NOOP("KDE Clock Control Module"), 0, 0, KAboutData::License_GPL,
                                       "(c) 1996 - 2001 Luca Montecchiani");

    about->addAuthor("Luca Montecchiani", I18N_NOOP("Original author"), "*****@*****.**");
    about->addAuthor("Paul Campbell", I18N_NOOP("Current Maintainer"), "*****@*****.**");
    about->addAuthor("Benjamin Meyer", I18N_NOOP("Added NTP support"), "*****@*****.**");
    setAboutData(about);
    setQuickHelp(
        i18n("<h1>Date & Time</h1> This control module can be used to set the system date and"
             " time. As these settings do not only affect you as a user, but rather the whole system, you"
             " can only change these settings when you start the Control Center as root. If you do not have"
             " the root password, but feel the system time should be corrected, please contact your system"
             " administrator."));

    KGlobal::locale()->insertCatalogue("timezones"); // For time zone translations

    QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());

    dtime = new Dtime(this);
    layout->addWidget(dtime);
    connect(dtime, SIGNAL(timeChanged(bool)), this, SIGNAL(changed(bool)));

    tzone = new Tzone(this);
    layout->addWidget(tzone);
    connect(tzone, SIGNAL(zoneChanged(bool)), this, SIGNAL(changed(bool)));

    layout->addStretch();

    if(getuid() == 0)
        setButtons(Help | Apply);
    else
        setButtons(Help);
}
Example #4
0
kthememanager::kthememanager( QWidget *parent, const char *name )
    : KCModule( parent, name ), m_theme( 0 ), m_origTheme( 0 )
{

    KAboutData *about = new KAboutData("kthememanager", I18N_NOOP("KDE Theme Manager"),
                                       "0.4", I18N_NOOP("This control module handles installing, removing and "
                                                        "creating visual KDE themes."),
                                       KAboutData::License_GPL, "(c) 2003, 2004, 2006 Lukáš Tinkl", 0,
                                       "http://developer.kde.org/~lukas/kthememanager");
    setAboutData( about );

    setQuickHelp( i18n("This control module handles installing, removing and "
                "creating visual KDE themes."));

    setButtons( KCModule::Default|KCModule::Apply|KCModule::Help );

    setAcceptDrops( true );
    init();

    QBoxLayout *top = new QVBoxLayout(this, 0, KDialog::spacingHint());

    dlg = new KThemeDlg(this);
    top->addWidget( dlg );

    dlg->lvThemes->setColumnWidthMode( 0, QListView::Maximum );

    connect( ( QObject * )dlg->btnInstall, SIGNAL( clicked() ),
             this, SLOT( slotInstallTheme() ) );

    connect( ( QObject * )dlg->btnRemove, SIGNAL( clicked() ),
             this, SLOT( slotRemoveTheme() ) );

    connect( ( QObject * )dlg->btnCreate, SIGNAL( clicked() ),
             this, SLOT( slotCreateTheme() ) );

    connect( ( QObject * )dlg->lvThemes, SIGNAL( clicked( QListViewItem * ) ),
             this, SLOT( slotThemeChanged( QListViewItem * ) ) );

    connect( ( QObject * )dlg->lvThemes, SIGNAL( currentChanged( QListViewItem * ) ),
             this, SLOT( slotThemeChanged( QListViewItem * ) ) );

    connect( this, SIGNAL( filesDropped( const KURL::List& ) ),
             this, SLOT( updateButton() ) );

    connect( ( QObject * )dlg->lvThemes, SIGNAL( clicked( QListViewItem * ) ),
             this, SLOT( updateButton() ) );

    m_origTheme = new KTheme( this, true ); // stores the defaults to get back to
    m_origTheme->setName( ORIGINAL_THEME );
    m_origTheme->createYourself();

    load();
    queryLNFModules();
    updateButton();
}
Example #5
0
KonquerorConfig::KonquerorConfig( QWidget* parent_P, const char* )
    : KCModule( parent_P, "kcmperformance" )
    {
    setQuickHelp( i18n( "<h1>Konqueror Performance</h1>"
        " You can configure several settings that improve Konqueror performance here."
        " These include options for reusing already running instances"
        " and for keeping instances preloaded." ));

    QVBoxLayout *topLayout = new QVBoxLayout( this );
    widget = new Konqueror( this );
    connect( widget, SIGNAL( changed()), SLOT( changed()));
    topLayout->add( widget );
    load();
    }
Example #6
0
USBViewer::USBViewer(QWidget *parent, const char *name, const QStringList &) : KCModule(USBFactory::instance(), parent, name)
{
    setButtons(Help);

    setQuickHelp(
        i18n("<h1>USB Devices</h1> This module allows you to see"
             " the devices attached to your USB bus(es)."));

    QVBoxLayout *vbox = new QVBoxLayout(this, 0, KDialog::spacingHint());
    QGroupBox *gbox = new QGroupBox(i18n("USB Devices"), this);
    gbox->setColumnLayout(0, Qt::Horizontal);
    vbox->addWidget(gbox);

    QVBoxLayout *vvbox = new QVBoxLayout(gbox->layout(), KDialog::spacingHint());

    QSplitter *splitter = new QSplitter(gbox);
    vvbox->addWidget(splitter);

    _devices = new QListView(splitter);
    _devices->addColumn(i18n("Device"));
    _devices->setRootIsDecorated(true);
    _devices->header()->hide();
    _devices->setMinimumWidth(200);
    _devices->setColumnWidthMode(0, QListView::Maximum);

    QValueList< int > sizes;
    sizes.append(200);
    splitter->setSizes(sizes);

    _details = new QTextView(splitter);

    splitter->setResizeMode(_devices, QSplitter::KeepSize);

    QTimer *refreshTimer = new QTimer(this);
    // 1 sec seems to be a good compromise between latency and polling load.
    refreshTimer->start(1000);

    connect(refreshTimer, SIGNAL(timeout()), SLOT(refresh()));
    connect(_devices, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(selectionChanged(QListViewItem *)));

    KAboutData *about = new KAboutData(I18N_NOOP("kcmusb"), I18N_NOOP("KDE USB Viewer"), 0, 0, KAboutData::License_GPL,
                                       I18N_NOOP("(c) 2001 Matthias Hoelzer-Kluepfel"));

    about->addAuthor("Matthias Hoelzer-Kluepfel", 0, "*****@*****.**");
    about->addCredit("Leo Savernik", "Live Monitoring of USB Bus", "*****@*****.**");
    setAboutData(about);

    load();
}
Example #7
0
KSpellCheckingConfig::KSpellCheckingConfig(TQWidget *parent, const char *name, const TQStringList &):
    TDECModule(SpellFactory::instance(), parent, name)
{
  TQBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint());
  TQGroupBox *box = new TQVGroupBox( i18n("Spell Checking Settings"), this );
  box->layout()->setSpacing( KDialog::spacingHint() );
  layout->addWidget(box);

  spellConfig = new KSpellConfig(box, 0L ,0L, false );
  layout->addStretch(1);
  connect(spellConfig,TQT_SIGNAL(configChanged()), TQT_SLOT( changed() ));

  setQuickHelp( i18n("<h1>Spell Checker</h1><p>This control module allows you to configure the TDE spell checking system. You can configure:<ul><li> which spell checking program to use<li> which types of spelling errors are identified<li> which dictionary is used by default.</ul><br>The TDE spell checking system (KSpell) provides support for two common spell checking utilities: ASpell and ISpell. This allows you to share dictionaries between TDE applications and non-TDE applications.</p>"));

}
Example #8
0
KCMDesktopTheme::KCMDesktopTheme( QWidget* parent, const QVariantList& )
    : KCModule( parent )
    , m_dialog(0)
    , m_installProcess(0)
    , m_defaultTheme(new Plasma::Theme(this))
{
    setQuickHelp( i18n("<h1>Desktop Theme</h1>"
            "This module allows you to modify the visual appearance "
            "of the desktop."));

    setupUi(this);

    m_bDesktopThemeDirty = false;
    m_bDetailsDirty = false;

    KAutostart plasmaNetbookAutoStart("plasma-netbook");
    m_isNetbook = plasmaNetbookAutoStart.autostarts();

    KGlobal::dirs()->addResourceType("themes", "data", "kstyle/themes");

    KAboutData *about =
        new KAboutData( I18N_NOOP("KCMDesktopTheme"), 0,
                        i18n("KDE Desktop Theme Module"),
                        0, QString(), KAboutData::License_GPL,
                        i18n("(c) 2002 Karol Szwed, Daniel Molkentin"));

    about->addAuthor(i18n("Karol Szwed"), QString(), QStringLiteral("*****@*****.**"));
    about->addAuthor(i18n("Daniel Molkentin"), QString(), QStringLiteral("*****@*****.**"));
    about->addAuthor(i18n("Ralf Nolden"), QString(), QStringLiteral("*****@*****.**"));
    setAboutData( about );

    m_newThemeButton->setIcon(QIcon::fromTheme("get-hot-new-stuff"));

    m_themeModel = new ThemeModel(this);
    m_theme->setModel(m_themeModel);
    m_theme->setItemDelegate(new ThemeDelegate(m_theme));
    m_theme->setVerticalScrollMode(QAbstractItemView::ScrollPerItem);

    connect(m_detailsWidget, SIGNAL(changed()), this, SLOT(detailChanged()));

    connect(m_theme->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            this, SLOT(setDesktopThemeDirty()));
    connect(m_newThemeButton, SIGNAL(clicked()), this, SLOT(getNewThemes()));
    connect(m_fileInstallButton, &QPushButton::clicked, this, &KCMDesktopTheme::showFileDialog);
}
Example #9
0
HidingConfig::HidingConfig(QWidget *parent, const char *name) : KCModule(parent, name)
{
    QVBoxLayout *layout = new QVBoxLayout(this);
    m_widget = new HidingTab(this);
    layout->addWidget(m_widget);
    layout->addStretch();

    setQuickHelp(KickerConfig::the()->quickHelp());
    setAboutData(KickerConfig::the()->aboutData());

    // addConfig(KickerSettings::self(), m_widget);

    connect(m_widget, SIGNAL(changed()), this, SLOT(changed()));
    connect(KickerConfig::the(), SIGNAL(aboutToNotifyKicker()), this, SLOT(aboutToNotifyKicker()));

    load();
    QTimer::singleShot(0, this, SLOT(notChanged()));
}
Example #10
0
Config::Config( QWidget* parent_P, const char* )
    : KCModule( parent_P, "kcmperformance" )
    {
    setQuickHelp( i18n( "<h1>KDE Performance</h1>"
        " You can configure settings that improve KDE performance here." ));
    
    QVBoxLayout *topLayout = new QVBoxLayout( this );
    QTabWidget* tabs = new QTabWidget( this );
    konqueror_widget = new Konqueror( tabs );
    konqueror_widget->layout()->setMargin( KDialog::marginHint() );
    connect( konqueror_widget, SIGNAL( changed()), SLOT( changed()));
    tabs->addTab( konqueror_widget, i18n( "Konqueror" ));
    system_widget = new SystemWidget( tabs );
    system_widget->layout()->setMargin( KDialog::marginHint() );
    connect( system_widget, SIGNAL( changed()), SLOT( changed()));
    tabs->addTab( system_widget, i18n( "System" ));
    topLayout->add( tabs );
    load();
    }
Example #11
0
KCMKonsole::KCMKonsole(QWidget *parent, const char *name, const QStringList &) : KCModule(ModuleFactory::instance(), parent, name)
{

    setQuickHelp(
        i18n("<h1>Konsole</h1> With this module you can configure Konsole, the KDE terminal"
             " application. You can configure the generic Konsole options (which can also be "
             "configured using the RMB) and you can edit the schemas and sessions "
             "available to Konsole."));

    QVBoxLayout *topLayout = new QVBoxLayout(this);
    dialog = new KCMKonsoleDialog(this);
    dialog->line_spacingSB->setRange(0, 8, 1, false);
    dialog->line_spacingSB->setSpecialValueText(i18n("normal line spacing", "Normal"));
    dialog->show();
    topLayout->add(dialog);
    load();

    KAboutData *ab = new KAboutData("kcmkonsole", I18N_NOOP("KCM Konsole"), "0.2", I18N_NOOP("KControl module for Konsole configuration"),
                                    KAboutData::License_GPL, "(c) 2001, Andrea Rizzi", 0, 0, "*****@*****.**");

    ab->addAuthor("Andrea Rizzi", 0, "*****@*****.**");
    setAboutData(ab);

    connect(dialog->terminalSizeHintCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->warnCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->ctrldragCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->cutToBeginningOfLineCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->allowResizeCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->bidiCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->xonXoffCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->blinkingCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->frameCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->line_spacingSB, SIGNAL(valueChanged(int)), SLOT(changed()));
    connect(dialog->matchTabWinTitleCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->silence_secondsSB, SIGNAL(valueChanged(int)), SLOT(changed()));
    connect(dialog->word_connectorLE, SIGNAL(textChanged(const QString &)), SLOT(changed()));
    connect(dialog->SchemaEditor1, SIGNAL(changed()), SLOT(changed()));
    connect(dialog->SessionEditor1, SIGNAL(changed()), SLOT(changed()));
    connect(dialog->SchemaEditor1, SIGNAL(schemaListChanged(const QStringList &, const QStringList &)), dialog->SessionEditor1,
            SLOT(schemaListChanged(const QStringList &, const QStringList &)));
    connect(dialog->SessionEditor1, SIGNAL(getList()), dialog->SchemaEditor1, SLOT(getList()));
}
Example #12
0
CDDBModule::CDDBModule(QWidget *parent, const char *name, const QStringList &)
  : KCModule(parent, name)
{
  KGlobal::locale()->insertCatalogue("libkcddb");
  setButtons(Default | Apply);

  widget_ = new CDDBConfigWidget(this);

  KCDDB::Config* cfg = new KCDDB::Config();
  cfg->readConfig();

  addConfig(cfg, widget_);

  QVBoxLayout * layout = new QVBoxLayout(this, 0);

  layout->addWidget(widget_);
  layout->addStretch();

  setQuickHelp(i18n("CDDB is used to get information like artist, title and song-names in CD's"));

  load();
}
Example #13
0
KCMDesktopTheme::KCMDesktopTheme( QWidget* parent, const QVariantList& )
    : KCModule( parent )
    , m_dialog(0)
    , m_defaultTheme(new Plasma::Theme(this))
{
    setQuickHelp( i18n("<h1>Desktop Theme</h1>"
                       "This module allows you to modify the visual appearance "
                       "of the desktop."));

    setupUi(this);

    m_bDesktopThemeDirty = false;
    m_bDetailsDirty = false;

    KAboutData *about =
        new KAboutData( QStringLiteral("KCMDesktopTheme"), i18n("KDE Desktop Theme Module"),
                        QStringLiteral("1.0"), QString(), KAboutLicense::GPL,
                        i18n("(c) 2002 Karol Szwed, Daniel Molkentin"));

    about->addAuthor(QStringLiteral("Karol Szwed"), QString(), QStringLiteral("*****@*****.**"));
    about->addAuthor(QStringLiteral("Daniel Molkentin"), QString(), QStringLiteral("*****@*****.**"));
    about->addAuthor(QStringLiteral("Ralf Nolden"), QString(), QStringLiteral("*****@*****.**"));
    setAboutData( about );

    m_newThemeButton->setIcon(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")));

    m_themeModel = new ThemeModel(this);
    m_theme->setModel(m_themeModel);
    m_theme->setItemDelegate(new ThemeDelegate(m_theme));
    m_theme->setVerticalScrollMode(QAbstractItemView::ScrollPerItem);

    connect(m_detailsWidget, &DesktopThemeDetails::changed, this, &KCMDesktopTheme::detailChanged);

    connect(m_theme->selectionModel(), &QItemSelectionModel::currentChanged,
            this, &KCMDesktopTheme::setDesktopThemeDirty);
    connect(m_newThemeButton, &QAbstractButton::clicked, this, &KCMDesktopTheme::getNewThemes);
    connect(m_fileInstallButton, &QPushButton::clicked, this, &KCMDesktopTheme::showFileDialog);
}
Example #14
0
KArtsModule::KArtsModule(QWidget *parent, const char *name)
  : KCModule(parent, name), configChanged(false)
{
	setButtons(Default|Apply);

	setQuickHelp( i18n("<h1>Sound System</h1> Here you can configure aRts, KDE's sound server."
		    " This program not only allows you to hear your system sounds while simultaneously"
		    " listening to an MP3 file or playing a game with background music. It also allows you"
		    " to apply different effects to your system sounds and provides programmers with"
		    " an easy way to achieve sound support."));

	initAudioIOList();

	QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
	QTabWidget *tab = new QTabWidget(this);
	layout->addWidget(tab);

	general = new generalTab(tab);
	hardware = new hardwareTab(tab);
	//mixer = KCModuleLoader::loadModule("kmixcfg", tab);
	//midi = new KMidConfig(tab, "kmidconfig");

	general->layout()->setMargin( KDialog::marginHint() );
	hardware->layout()->setMargin( KDialog::marginHint() );
	general->latencyLabel->setFixedHeight(general->latencyLabel->fontMetrics().lineSpacing());

	tab->addTab(general, i18n("&General"));
	tab->addTab(hardware, i18n("&Hardware"));

	startServer = general->startServer;
	networkTransparent = general->networkTransparent;
	startRealtime = general->startRealtime;
	autoSuspend = general->autoSuspend;
	suspendTime = general->suspendTime;

	fullDuplex = hardware->fullDuplex;
	customDevice = hardware->customDevice;
	deviceName = hardware->deviceName;
	customRate = hardware->customRate;
	samplingRate = hardware->samplingRate;

   	QString deviceHint = i18n("Normally, the sound server defaults to using the device called <b>/dev/dsp</b> for sound output. That should work in most cases. On some systems where devfs is used, however, you may need to use <b>/dev/sound/dsp</b> instead. Other alternatives are things like <b>/dev/dsp0</b> or <b>/dev/dsp1</b>, if you have a soundcard that supports multiple outputs, or you have multiple soundcards.");

	QString rateHint = i18n("Normally, the sound server defaults to using a sampling rate of 44100 Hz (CD quality), which is supported on almost any hardware. If you are using certain <b>Yamaha soundcards</b>, you might need to configure this to 48000 Hz here, if you are using <b>old SoundBlaster cards</b>, like SoundBlaster Pro, you might need to change this to 22050 Hz. All other values are possible, too, and may make sense in certain contexts (i.e. professional studio equipment).");

	QString optionsHint = i18n("This configuration module is intended to cover almost every aspect of the aRts sound server that you can configure. However, there are some things which may not be available here, so you can add <b>command line options</b> here which will be passed directly to <b>artsd</b>. The command line options will override the choices made in the GUI. To see the possible choices, open a Konsole window, and type <b>artsd -h</b>.");

	QWhatsThis::add(customDevice, deviceHint);
	QWhatsThis::add(deviceName, deviceHint);
	QWhatsThis::add(customRate, rateHint);
	QWhatsThis::add(samplingRate, rateHint);
	QWhatsThis::add(hardware->customOptions, optionsHint);
	QWhatsThis::add(hardware->addOptions, optionsHint);

	hardware->audioIO->insertItem( i18n( "Autodetect" ) );
	for (AudioIOElement *a = audioIOList.first(); a != 0; a = audioIOList.next())
		hardware->audioIO->insertItem(i18n(a->fullName.utf8()));

	deviceManager = new DeviceManager();
	deviceManager->initManager();

	QString s;
	for ( int i = 0; i < deviceManager->midiPorts()+deviceManager->synthDevices(); i++)
	{
		if ( strcmp( deviceManager->type( i ), "" ) != 0 )
			s.sprintf( "%s - %s", deviceManager->name( i ), deviceManager->type( i ) );
		else
			s.sprintf( "%s", deviceManager->name( i ) );

		hardware->midiDevice->insertItem( s, i );

	};

	config = new KConfig("kcmartsrc");
	load();

	suspendTime->setRange( 1, 999, 1, true );

	connect(startServer,SIGNAL(clicked()),this,SLOT(slotChanged()));
	connect(networkTransparent,SIGNAL(clicked()),this,SLOT(slotChanged()));
	connect(startRealtime,SIGNAL(clicked()),this,SLOT(slotChanged()));
	connect(fullDuplex,SIGNAL(clicked()),this,SLOT(slotChanged()));
	connect(customDevice, SIGNAL(clicked()), SLOT(slotChanged()));
	connect(deviceName, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
	connect(customRate, SIGNAL(clicked()), SLOT(slotChanged()));
	connect(samplingRate, SIGNAL(valueChanged(const QString&)), SLOT(slotChanged()));
//	connect(general->volumeSystray, SIGNAL(clicked()), this, SLOT(slotChanged()) );

	connect(hardware->audioIO,SIGNAL(highlighted(int)),SLOT(slotChanged()));
	connect(hardware->audioIO,SIGNAL(activated(int)),SLOT(slotChanged()));
	connect(hardware->customOptions,SIGNAL(clicked()),SLOT(slotChanged()));
	connect(hardware->addOptions,SIGNAL(textChanged(const QString&)),SLOT(slotChanged()));
	connect(hardware->soundQuality,SIGNAL(highlighted(int)),SLOT(slotChanged()));
	connect(hardware->soundQuality,SIGNAL(activated(int)),SLOT(slotChanged()));
	connect(general->latencySlider,SIGNAL(valueChanged(int)),SLOT(slotChanged()));
	connect(autoSuspend,SIGNAL(clicked()),SLOT(slotChanged()));
	connect(suspendTime,SIGNAL(valueChanged(int)),SLOT(slotChanged()));
	connect(general->testSound,SIGNAL(clicked()),SLOT(slotTestSound()));
	connect(hardware->midiDevice, SIGNAL( highlighted(int) ), this, SLOT( slotChanged() ) );
	connect(hardware->midiDevice, SIGNAL( activated(int) ), this, SLOT( slotChanged() ) );
	connect(hardware->midiUseMapper, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
	connect(hardware->midiMapper, SIGNAL( textChanged( const QString& ) ),
			this, SLOT( slotChanged() ) );

	KAboutData *about =  new KAboutData(I18N_NOOP("kcmarts"),
                  I18N_NOOP("The Sound Server Control Module"),
                  0, 0, KAboutData::License_GPL,
                  I18N_NOOP("(c) 1999 - 2001, Stefan Westerfeld"));
	about->addAuthor("Stefan Westerfeld",I18N_NOOP("aRts Author") , "*****@*****.**");
	setAboutData(about);
}
Example #15
0
KCMStyle::KCMStyle( TQWidget* parent, const char* name )
	: TDECModule( parent, name ), appliedStyle(NULL)
{
    setQuickHelp( i18n("<h1>Style</h1>"
			"This module allows you to modify the visual appearance "
			"of user interface elements, such as the widget style "
			"and effects."));

	m_bEffectsDirty = false;
	m_bStyleDirty= false;
	m_bToolbarsDirty = false;

	TDEGlobal::dirs()->addResourceType("themes",
		TDEStandardDirs::kde_default("data") + "tdestyle/themes");

	TDEAboutData *about =
		new TDEAboutData( I18N_NOOP("kcmstyle"),
						I18N_NOOP("TDE Style Module"),
						0, 0, TDEAboutData::License_GPL,
						I18N_NOOP("(c) 2002 Karol Szwed, Daniel Molkentin"));

	about->addAuthor("Karol Szwed", 0, "*****@*****.**");
	about->addAuthor("Daniel Molkentin", 0, "*****@*****.**");
	about->addAuthor("Ralf Nolden", 0, "*****@*****.**");
	setAboutData( about );

	// Setup pages and mainLayout
	mainLayout = new TQVBoxLayout( this );
	tabWidget  = new TQTabWidget( this );
	mainLayout->addWidget( tabWidget );

	page1 = new TQWidget( tabWidget );
	page1Layout = new TQVBoxLayout( page1, KDialog::marginHint(), KDialog::spacingHint() );
	page2 = new TQWidget( tabWidget );
	page2Layout = new TQVBoxLayout( page2, KDialog::marginHint(), KDialog::spacingHint() );
	page3 = new TQWidget( tabWidget );
	page3Layout = new TQVBoxLayout( page3, KDialog::marginHint(), KDialog::spacingHint() );

	// Add Page1 (Style)
	// -----------------
	gbWidgetStyle = new TQGroupBox( i18n("Widget Style"), page1, "gbWidgetStyle" );
	gbWidgetStyle->setColumnLayout( 0, Qt::Vertical );
	gbWidgetStyle->layout()->setMargin( KDialog::marginHint() );
	gbWidgetStyle->layout()->setSpacing( KDialog::spacingHint() );

	gbWidgetStyleLayout = new TQVBoxLayout( gbWidgetStyle->layout() );
	gbWidgetStyleLayout->setAlignment( Qt::AlignTop );
	hbLayout = new TQHBoxLayout( KDialog::spacingHint(), "hbLayout" );

	cbStyle = new KComboBox( gbWidgetStyle, "cbStyle" );
	cbStyle->setEditable( FALSE );
	hbLayout->addWidget( cbStyle );

	pbConfigStyle = new TQPushButton( i18n("Con&figure..."), gbWidgetStyle );
	pbConfigStyle->setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Minimum );
	pbConfigStyle->setEnabled( FALSE );
	hbLayout->addWidget( pbConfigStyle );

	gbWidgetStyleLayout->addLayout( hbLayout );

	lblStyleDesc = new TQLabel( gbWidgetStyle );
	lblStyleDesc->setTextFormat(TQt::RichText);
	gbWidgetStyleLayout->addWidget( lblStyleDesc );

	cbIconsOnButtons = new TQCheckBox( i18n("Sho&w icons on buttons"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbIconsOnButtons );
	cbScrollablePopupMenus = new TQCheckBox( i18n("Enable &scrolling in popup menus"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbScrollablePopupMenus );
	cbAutoHideAccelerators = new TQCheckBox( i18n("Hide &underlined characters in the menu bar when not in use"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbAutoHideAccelerators );
	cbMenuAltKeyNavigation = new TQCheckBox( i18n("&Pressing only the menu bar activator key selects the menu bar"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbMenuAltKeyNavigation );
	cbEnableTooltips = new TQCheckBox( i18n("E&nable tooltips"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbEnableTooltips );
	cbTearOffHandles = new TQCheckBox( i18n("Show tear-off handles in &popup menus"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbTearOffHandles );
	cbTearOffHandles->hide(); // reenable when the corresponding Qt method is virtual and properly reimplemented

	gbWidgetStyleLayout->addSpacing(10);

	m_popupMenuDelay = new KIntNumInput(250, gbWidgetStyle);
	m_popupMenuDelay->setLabel(i18n("Menu popup delay:"));
	m_popupMenuDelay->setRange(0, 5000, 50);
	m_popupMenuDelay->setSuffix(i18n(" msec"));
	m_popupMenuDelay->setSteps(50, 50);
	gbWidgetStyleLayout->addWidget(m_popupMenuDelay);

	gbWidgetStyleLayout->addSpacing(10);

	TQGroupBox *gbPreview = new TQGroupBox( i18n( "Preview" ), page1 );
	gbPreview->setColumnLayout( 0, Qt::Vertical );
	gbPreview->layout()->setMargin( 0 );
	gbPreview->layout()->setSpacing( KDialog::spacingHint() );
	gbPreview->setFlat( true );
	stylePreview = new StylePreview( gbPreview );
	gbPreview->layout()->add( stylePreview );

	page1Layout->addWidget( gbWidgetStyle );
	page1Layout->addWidget( gbPreview );

	// Connect all required stuff
	connect( cbStyle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(styleChanged()) );
	connect( cbStyle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateConfigButton()));
	connect( pbConfigStyle, TQT_SIGNAL(clicked()), this, TQT_SLOT(styleSpecificConfig()));

	// Add Page2 (Effects)
	// -------------------
	cbEnableEffects = new TQCheckBox( i18n("&Enable GUI effects"), page2 );
	containerFrame = new TQFrame( page2 );
	containerFrame->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain );
	containerFrame->setMargin(0);
	containerLayout = new TQGridLayout( containerFrame, 1, 1,	// rows, columns
		KDialog::marginHint(), KDialog::spacingHint() );

	comboComboEffect = new TQComboBox( FALSE, containerFrame );
	comboComboEffect->insertItem( i18n("Disable") );
	comboComboEffect->insertItem( i18n("Animate") );
	lblComboEffect = new TQLabel( i18n("Combobo&x effect:"), containerFrame );
	lblComboEffect->setBuddy( comboComboEffect );
	containerLayout->addWidget( lblComboEffect, 0, 0 );
	containerLayout->addWidget( comboComboEffect, 0, 1 );

	comboTooltipEffect = new TQComboBox( FALSE, containerFrame );
	comboTooltipEffect->insertItem( i18n("Disable") );
	comboTooltipEffect->insertItem( i18n("Animate") );
	comboTooltipEffect->insertItem( i18n("Fade") );
	lblTooltipEffect = new TQLabel( i18n("&Tool tip effect:"), containerFrame );
	lblTooltipEffect->setBuddy( comboTooltipEffect );
	containerLayout->addWidget( lblTooltipEffect, 1, 0 );
	containerLayout->addWidget( comboTooltipEffect, 1, 1 );

	comboRubberbandEffect = new TQComboBox( FALSE, containerFrame );
	comboRubberbandEffect->insertItem( i18n("Disable") );
	comboRubberbandEffect->insertItem( i18n("Make translucent") );
	lblRubberbandEffect = new TQLabel( i18n("&Rubberband effect:"), containerFrame );
	lblRubberbandEffect->setBuddy( comboRubberbandEffect );
	containerLayout->addWidget( lblRubberbandEffect, 2, 0 );
	containerLayout->addWidget( comboRubberbandEffect, 2, 1 );
	
	comboMenuEffect = new TQComboBox( FALSE, containerFrame );
	comboMenuEffect->insertItem( i18n("Disable") );
	comboMenuEffect->insertItem( i18n("Animate") );
	comboMenuEffect->insertItem( i18n("Fade") );
	comboMenuEffect->insertItem( i18n("Make Translucent") );
	lblMenuEffect = new TQLabel( i18n("&Menu effect:"), containerFrame );
	lblMenuEffect->setBuddy( comboMenuEffect );
	containerLayout->addWidget( lblMenuEffect, 3, 0 );
	containerLayout->addWidget( comboMenuEffect, 3, 1 );

	comboMenuHandle = new TQComboBox( FALSE, containerFrame );
	comboMenuHandle->insertItem( i18n("Disable") );
	comboMenuHandle->insertItem( i18n("Application Level") );
//	comboMenuHandle->insertItem( i18n("Enable") );
	lblMenuHandle = new TQLabel( i18n("Me&nu tear-off handles:"), containerFrame );
	lblMenuHandle->setBuddy( comboMenuHandle );
	containerLayout->addWidget( lblMenuHandle, 4, 0 );
	containerLayout->addWidget( comboMenuHandle, 4, 1 );

	cbMenuShadow = new TQCheckBox( i18n("Menu &drop shadow"), containerFrame );
	containerLayout->addWidget( cbMenuShadow, 5, 0 );

	// Push the [label combo] to the left.
	comboSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
	containerLayout->addItem( comboSpacer, 1, 2 );

	// Separator.
	TQFrame* hline = new TQFrame ( page2 );
	hline->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );

	// Now implement the Menu Transparency container.
	menuContainer = new TQFrame( page2 );
	menuContainer->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain );
	menuContainer->setMargin(0);
	menuContainerLayout = new TQGridLayout( menuContainer, 1, 1,    // rows, columns
		KDialog::marginHint(), KDialog::spacingHint() );

	menuPreview = new MenuPreview( menuContainer, /* opacity */ 90, MenuPreview::Blend );

	comboMenuEffectType = new TQComboBox( FALSE, menuContainer );
	comboMenuEffectType->insertItem( i18n("Software Tint") );
	comboMenuEffectType->insertItem( i18n("Software Blend") );
#ifdef HAVE_XRENDER
	comboMenuEffectType->insertItem( i18n("XRender Blend") );
#endif

	// So much stuffing around for a simple slider..
	sliderBox = new TQVBox( menuContainer );
	sliderBox->setSpacing( KDialog::spacingHint() );
	sliderBox->setMargin( 0 );
	slOpacity = new TQSlider( 0, 100, 5, /*opacity*/ 90, Qt::Horizontal, sliderBox );
	slOpacity->setTickmarks( TQSlider::Below );
	slOpacity->setTickInterval( 10 );
	TQHBox* box1 = new TQHBox( sliderBox );
	box1->setSpacing( KDialog::spacingHint() );
	box1->setMargin( 0 );
	TQLabel* lbl = new TQLabel( i18n("0%"), box1 );
	lbl->setAlignment( AlignLeft );
	lbl = new TQLabel( i18n("50%"), box1 );
	lbl->setAlignment( AlignHCenter );
	lbl = new TQLabel( i18n("100%"), box1 );
	lbl->setAlignment( AlignRight );

	lblMenuEffectType = new TQLabel( comboMenuEffectType, i18n("Menu trans&lucency type:"), menuContainer );
	lblMenuEffectType->setAlignment( AlignBottom | AlignLeft );
	lblMenuOpacity    = new TQLabel( slOpacity, i18n("Menu &opacity:"), menuContainer );
	lblMenuOpacity->setAlignment( AlignBottom | AlignLeft );

	menuContainerLayout->addWidget( lblMenuEffectType, 0, 0 );
	menuContainerLayout->addWidget( comboMenuEffectType, 1, 0 );
	menuContainerLayout->addWidget( lblMenuOpacity, 2, 0 );
	menuContainerLayout->addWidget( sliderBox, 3, 0 );
	menuContainerLayout->addMultiCellWidget( menuPreview, 0, 3, 1, 1 );

	// Layout page2.
	page2Layout->addWidget( cbEnableEffects );
	page2Layout->addWidget( containerFrame );
	page2Layout->addWidget( hline );
	page2Layout->addWidget( menuContainer );

	TQSpacerItem* sp1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
	page2Layout->addItem( sp1 );

	// Data flow stuff.
	connect( cbEnableEffects,     TQT_SIGNAL(toggled(bool)), containerFrame, TQT_SLOT(setEnabled(bool)) );
	connect( cbEnableEffects,     TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(menuEffectChanged(bool)) );
	connect( slOpacity,           TQT_SIGNAL(valueChanged(int)),menuPreview, TQT_SLOT(setOpacity(int)) );
	connect( comboMenuEffect,     TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuEffectChanged()) );
	connect( comboMenuEffect,     TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(menuEffectChanged()) );
	connect( comboMenuEffectType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuEffectTypeChanged()) );
	connect( comboMenuEffectType, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(menuEffectTypeChanged()) );

	// Add Page3 (Miscellaneous)
	// -------------------------
	cbHoverButtons = new TQCheckBox( i18n("High&light buttons under mouse"), page3 );
	cbTransparentToolbars = new TQCheckBox( i18n("Transparent tool&bars when moving"), page3 );

	TQWidget * dummy = new TQWidget( page3 );
	
	TQHBoxLayout* box2 = new TQHBoxLayout( dummy, 0, KDialog::spacingHint() );
	lbl = new TQLabel( i18n("Text pos&ition:"), dummy );
	comboToolbarIcons = new TQComboBox( FALSE, dummy );
	comboToolbarIcons->insertItem( i18n("Icons Only") );
	comboToolbarIcons->insertItem( i18n("Text Only") );
	comboToolbarIcons->insertItem( i18n("Text Alongside Icons") );
	comboToolbarIcons->insertItem( i18n("Text Under Icons") );
	lbl->setBuddy( comboToolbarIcons );

	box2->addWidget( lbl );
	box2->addWidget( comboToolbarIcons );
	TQSpacerItem* sp2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
	box2->addItem( sp2 );
	
	page3Layout->addWidget( cbHoverButtons );
	page3Layout->addWidget( cbTransparentToolbars );
	page3Layout->addWidget( dummy );
	
	// Layout page3.
	TQSpacerItem* sp3 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
	page3Layout->addItem( sp3 );

	// Load settings
	load();

	// Do all the setDirty connections.
	connect(cbStyle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty()));
	// Page2
	connect( cbEnableEffects,     TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setEffectsDirty()));
	connect( cbEnableEffects,     TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setStyleDirty()));
	connect( comboTooltipEffect,  TQT_SIGNAL(activated(int)), this, TQT_SLOT(setEffectsDirty()));
	connect( comboRubberbandEffect, TQT_SIGNAL(activated(int)),   this, TQT_SLOT(setStyleDirty()));
	connect( comboComboEffect,    TQT_SIGNAL(activated(int)), this, TQT_SLOT(setEffectsDirty()));
	connect( comboMenuEffect,     TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty()));
	connect( comboMenuHandle,     TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty()));
	connect( comboMenuEffectType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty()));
	connect( slOpacity,           TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(setStyleDirty()));
	connect( cbMenuShadow,        TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setStyleDirty()));
	// Page1 & Page3
	connect( cbHoverButtons,        TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setToolbarsDirty()));
	connect( cbTransparentToolbars, TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setToolbarsDirty()));
	connect( cbEnableTooltips,      TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setEffectsDirty()));
	connect( cbIconsOnButtons,      TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setEffectsDirty()));
	connect( cbScrollablePopupMenus,TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setEffectsDirty()));
	connect( cbAutoHideAccelerators,TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setEffectsDirty()));
	connect( cbMenuAltKeyNavigation,TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setEffectsDirty()));
	connect( cbTearOffHandles,      TQT_SIGNAL(toggled(bool)),    this, TQT_SLOT(setEffectsDirty()));
	connect( comboToolbarIcons,     TQT_SIGNAL(activated(int)), this, TQT_SLOT(setToolbarsDirty()));
	connect( m_popupMenuDelay,      TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(setStyleDirty()));

	addWhatsThis();

	// Insert the pages into the tabWidget
	tabWidget->insertTab( page1, i18n("&Style"));
	tabWidget->insertTab( page2, i18n("&Effects"));
	tabWidget->insertTab( page3, i18n("&Toolbar"));

	//Enable/disable the button for the initial style
	updateConfigButton();
}
Example #16
0
CSSConfig::CSSConfig(QWidget *parent, const char *name, const QStringList &)
  : KCModule(CSSFactory::instance(), parent, name)
{
  customDialogBase = new KDialogBase(this, "customCSSDialog", true, QString::null, 
        KDialogBase::Close, KDialogBase::Close, true );
  customDialog = new CSSCustomDialog(customDialogBase);
  customDialogBase->setMainWidget(customDialog);
  configDialog = new CSSConfigDialog(this);

  setQuickHelp( i18n("<h1>Konqueror Stylesheets</h1> This module allows you to apply your own color"
              " and font settings to Konqueror by using"
              " stylesheets (CSS). You can either specify"
              " options or apply your own self-written"
              " stylesheet by pointing to its location.<br>"
              " Note that these settings will always have"
              " precedence before all other settings made"
              " by the site author. This can be useful to"
              " visually impaired people or for web pages"
              " that are unreadable due to bad design."));


  QStringList fonts;
  KFontChooser::getFontList(fonts, 0);
  customDialog->fontFamily->insertStringList(fonts);

  connect(configDialog->useDefault, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(configDialog->useAccess, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(configDialog->useUser, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(configDialog->urlRequester, SIGNAL(textChanged(const QString&)),
	  SLOT(changed()));
  connect(configDialog->customize, SIGNAL(clicked()),
          SLOT(slotCustomize()));
  connect(customDialog->basefontsize, SIGNAL(highlighted(int)),
	  SLOT(changed()));
  connect(customDialog->basefontsize, SIGNAL(textChanged(const QString&)),
	  SLOT(changed()));
  connect(customDialog->dontScale, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->blackOnWhite, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->whiteOnBlack, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->customColor, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->foregroundColor, SIGNAL(changed(const QColor &)),
	  SLOT(changed()));
  connect(customDialog->backgroundColor, SIGNAL(changed(const QColor &)),
	  SLOT(changed()));
  connect(customDialog->fontFamily, SIGNAL(highlighted(int)),
	  SLOT(changed()));
  connect(customDialog->fontFamily, SIGNAL(textChanged(const QString&)),
	  SLOT(changed()));
  connect(customDialog->sameFamily, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->preview, SIGNAL(clicked()),
          SLOT(slotPreview()));
  connect(customDialog->sameColor, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->hideImages, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->hideBackground, SIGNAL(clicked()),
	  SLOT(changed()));

  QVBoxLayout *vbox = new QVBoxLayout(this, 0, 0);
  vbox->addWidget(configDialog);

  load();
}
Example #17
0
KDesktopConfig::KDesktopConfig(QWidget *parent, const char * /*name*/)
  : KCModule(parent, "kcmkonq")
{

  setQuickHelp( i18n("<h1>Multiple Desktops</h1>In this module, you can configure how many virtual desktops you want and how these should be labeled."));

  Q_ASSERT(maxDesktops % 2 == 0);

  QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());

  // number group
  QGroupBox *number_group = new QGroupBox(this);

  QHBoxLayout *lay = new QHBoxLayout(number_group,
                     KDialog::marginHint(),
                     KDialog::spacingHint());

  QLabel *label = new QLabel(i18n("N&umber of desktops: "), number_group);
  _numInput = new KIntNumInput(4, number_group);
  _numInput->setRange(1, maxDesktops, 1, true);
  connect(_numInput, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
  connect(_numInput, SIGNAL(valueChanged(int)),  SLOT( changed() ));
  label->setBuddy( _numInput );
  QString wtstr = i18n( "Here you can set how many virtual desktops you want on your KDE desktop. Move the slider to change the value." );
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( _numInput, wtstr );

  lay->addWidget(label);
  lay->addWidget(_numInput);
  lay->setStretchFactor( _numInput, 2 );

  layout->addWidget(number_group);

  // name group
  QGroupBox *name_group = new QGroupBox(i18n("Desktop &Names"), this);

  name_group->setColumnLayout(4, Horizontal);

  for(int i = 0; i < (maxDesktops/2); i++)
    {
      _nameLabel[i] = new QLabel(i18n("Desktop %1:").arg(i+1), name_group);
      _nameInput[i] = new KLineEdit(name_group);
      _nameLabel[i+(maxDesktops/2)] = new QLabel(i18n("Desktop %1:").arg(i+(maxDesktops/2)+1), name_group);
      _nameInput[i+(maxDesktops/2)] = new KLineEdit(name_group);
      QWhatsThis::add( _nameLabel[i], i18n( "Here you can enter the name for desktop %1" ).arg( i+1 ) );
      QWhatsThis::add( _nameInput[i], i18n( "Here you can enter the name for desktop %1" ).arg( i+1 ) );
      QWhatsThis::add( _nameLabel[i+(maxDesktops/2)], i18n( "Here you can enter the name for desktop %1" ).arg( i+(maxDesktops/2)+1 ) );
      QWhatsThis::add( _nameInput[i+(maxDesktops/2)], i18n( "Here you can enter the name for desktop %1" ).arg( i+(maxDesktops/2)+1 ) );

      connect(_nameInput[i], SIGNAL(textChanged(const QString&)),
           SLOT( changed() ));
      connect(_nameInput[i+(maxDesktops/2)], SIGNAL(textChanged(const QString&)),
           SLOT( changed() ));
    }

  for(int i = 1; i < maxDesktops; i++)
      setTabOrder( _nameInput[i-1], _nameInput[i] );

  layout->addWidget(name_group);

  _wheelOption = new QCheckBox(i18n("Mouse wheel over desktop background switches desktop"), this);
  connect(_wheelOption,SIGNAL(toggled(bool)), SLOT( changed() ));

  layout->addWidget(_wheelOption);
  layout->addStretch(1);

  load();
}
Example #18
0
KDModule::KDModule(QWidget *parent, const char *name, const QStringList &)
  : KCModule(KDMFactory::instance(), parent, name)
  , minshowuid(0)
  , maxshowuid(0)
  , updateOK(false)
{
  KAboutData *about =
    new KAboutData(I18N_NOOP("kcmkdm"), I18N_NOOP("KDE Login Manager Config Module"),
                0, 0, KAboutData::License_GPL,
                I18N_NOOP("(c) 1996 - 2005 The KDM Authors"));

  about->addAuthor("Thomas Tanghus", I18N_NOOP("Original author"), "*****@*****.**");
	about->addAuthor("Steffen Hansen", 0, "*****@*****.**");
	about->addAuthor("Oswald Buddenhagen", I18N_NOOP("Current maintainer"), "*****@*****.**");

  setQuickHelp( i18n(    "<h1>Login Manager</h1> In this module you can configure the "
                    "various aspects of the KDE Login Manager. This includes "
                    "the look and feel as well as the users that can be "
                    "selected for login. Note that you can only make changes "
                    "if you run the module with superuser rights. If you have not started the KDE "
                    "Control Center with superuser rights (which is absolutely the right thing to "
                    "do, by the way), click on the <em>Modify</em> button to acquire "
                    "superuser rights. You will be asked for the superuser password."
                    "<h2>Appearance</h2> On this tab page, you can configure how "
                    "the Login Manager should look, which language it should use, and which "
                    "GUI style it should use. The language settings made here have no influence on "
                    "the user's language settings."
                    "<h2>Font</h2>Here you can choose the fonts that the Login Manager should use "
                    "for various purposes like greetings and user names. "
                    "<h2>Background</h2>If you want to set a special background for the login "
                    "screen, this is where to do it."
                    "<h2>Shutdown</h2> Here you can specify who is allowed to shutdown/reboot the machine "
                    "and whether a boot manager should be used."
                    "<h2>Users</h2>On this tab page, you can select which users the Login Manager "
                    "will offer you for logging in."
                    "<h2>Convenience</h2> Here you can specify a user to be logged in automatically, "
		    "users not needing to provide a password to log in, and other convenience features.<br>"
		    "Note, that these settings are security holes by their nature, so use them very carefully."));

  setAboutData( about );

  setlocale( LC_COLLATE, "C" );

  KGlobal::locale()->insertCatalogue("kcmbackground");

  QStringList sl;
  QMap<gid_t,QStringList> tgmap;
  QMap<gid_t,QStringList>::Iterator tgmapi;
  QMap<gid_t,QStringList>::ConstIterator tgmapci;
  QMap<QString, QPair<int,QStringList> >::Iterator umapi;

  struct passwd *ps;
  for (setpwent(); (ps = getpwent()); ) {
    QString un( QFile::decodeName( ps->pw_name ) );
    if (usermap.find( un ) == usermap.end()) {
      usermap.insert( un, QPair<int,QStringList>( ps->pw_uid, sl ) );
      if ((tgmapi = tgmap.find( ps->pw_gid )) != tgmap.end())
        (*tgmapi).append( un );
      else
	tgmap[ps->pw_gid] = un;
    }
  }
  endpwent();

  struct group *grp;
  for (setgrent(); (grp = getgrent()); ) {
    QString gn( QFile::decodeName( grp->gr_name ) );
    bool delme = false;
    if ((tgmapi = tgmap.find( grp->gr_gid )) != tgmap.end()) {
      if ((*tgmapi).count() == 1 && (*tgmapi).first() == gn)
        delme = true;
      else
        for (QStringList::ConstIterator it = (*tgmapi).begin();
             it != (*tgmapi).end(); ++it)
          usermap[*it].second.append( gn );
      tgmap.remove( tgmapi );
    }
    if (!*grp->gr_mem ||
        (delme && !grp->gr_mem[1] && gn == QFile::decodeName( *grp->gr_mem )))
      continue;
    do {
      QString un( QFile::decodeName( *grp->gr_mem ) );
      if ((umapi = usermap.find( un )) != usermap.end()) {
        if ((*umapi).second.find( gn ) == (*umapi).second.end())
	  (*umapi).second.append( gn );
      } else
        kdWarning() << "group '" << gn << "' contains unknown user '" << un << "'" << endl;
    } while (*++grp->gr_mem);
  }
  endgrent();

  for (tgmapci = tgmap.begin(); tgmapci != tgmap.end(); ++tgmapci)
    kdWarning() << "user(s) '" << tgmapci.data().join(",")
	<< "' have unknown GID " << tgmapci.key() << endl;

  config = new KSimpleConfig( QString::fromLatin1( KDE_CONFDIR "/kdm/kdmrc" ));

  QVBoxLayout *top = new QVBoxLayout(this);
  tab = new QTabWidget(this);

  // *****
  // _don't_ add a theme configurator until the theming engine is _really_ done!!
  // *****

  appearance = new KDMAppearanceWidget(this);
  tab->addTab(appearance, i18n("A&ppearance"));
  connect(appearance, SIGNAL(changed(bool)), SIGNAL( changed(bool)));

  font = new KDMFontWidget(this);
  tab->addTab(font, i18n("&Font"));
  connect(font, SIGNAL(changed(bool)), SIGNAL(changed(bool)));

  background = new KBackground(this);
  tab->addTab(background, i18n("&Background"));
  connect(background, SIGNAL(changed(bool)), SIGNAL(changed(bool)));

  sessions = new KDMSessionsWidget(this);
  tab->addTab(sessions, i18n("&Shutdown"));
  connect(sessions, SIGNAL(changed(bool)), SIGNAL(changed(bool)));

  users = new KDMUsersWidget(this, 0);
  tab->addTab(users, i18n("&Users"));
  connect(users, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
  connect(users, SIGNAL(setMinMaxUID(int,int)), SLOT(slotMinMaxUID(int,int)));
  connect(this, SIGNAL(addUsers(const QMap<QString,int> &)), users, SLOT(slotAddUsers(const QMap<QString,int> &)));
  connect(this, SIGNAL(delUsers(const QMap<QString,int> &)), users, SLOT(slotDelUsers(const QMap<QString,int> &)));
  connect(this, SIGNAL(clearUsers()), users, SLOT(slotClearUsers()));

  convenience = new KDMConvenienceWidget(this, 0);
  tab->addTab(convenience, i18n("Con&venience"));
  connect(convenience, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
  connect(this, SIGNAL(addUsers(const QMap<QString,int> &)), convenience, SLOT(slotAddUsers(const QMap<QString,int> &)));
  connect(this, SIGNAL(delUsers(const QMap<QString,int> &)), convenience, SLOT(slotDelUsers(const QMap<QString,int> &)));
  connect(this, SIGNAL(clearUsers()), convenience, SLOT(slotClearUsers()));

  load();
  if (getuid() != 0 || !config->checkConfigFilesWritable( true )) {
    appearance->makeReadOnly();
    font->makeReadOnly();
    background->makeReadOnly();
    users->makeReadOnly();
    sessions->makeReadOnly();
    convenience->makeReadOnly();
  }
  top->addWidget(tab);
}
Example #19
0
KBellConfig::KBellConfig(QWidget *parent, const char *name):
    KCModule(parent, name)
{
  QBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());

  int row = 0;
  QGroupBox *box = new QGroupBox( i18n("Bell Settings"), this );
  box->setColumnLayout( 0, Qt::Horizontal );
  layout->addWidget(box);
  layout->addStretch();
  QGridLayout *grid = new QGridLayout(box->layout(), KDialog::spacingHint());
  grid->setColStretch(0, 0);
  grid->setColStretch(1, 1);
  grid->addColSpacing(0, 30);

  m_useBell = new QCheckBox( i18n("&Use system bell instead of system notification" ), box );
  QWhatsThis::add(m_useBell, i18n("You can use the standard system bell (PC speaker) or a "
				  "more sophisticated system notification, see the "
				  "\"System Notifications\" control module for the "
				  "\"Something Special Happened in the Program\" event."));
  connect(m_useBell, SIGNAL( toggled( bool )), SLOT( useBell( bool )));
  row++;
  grid->addMultiCellWidget(m_useBell, row, row, 0, 1);

  setQuickHelp( i18n("<h1>System Bell</h1> Here you can customize the sound of the standard system bell,"
    " i.e. the \"beep\" you always hear when there is something wrong. Note that you can further"
    " customize this sound using the \"Accessibility\" control module; for example, you can choose"
    " a sound file to be played instead of the standard bell."));

  m_volume = new KIntNumInput(50, box);
  m_volume->setLabel(i18n("&Volume:"));
  m_volume->setRange(0, 100, 5);
  m_volume->setSuffix("%");
  m_volume->setSteps(5,25);
  grid->addWidget(m_volume, ++row, 1);
  QWhatsThis::add( m_volume, i18n("Here you can customize the volume of the system bell. For further"
    " customization of the bell, see the \"Accessibility\" control module.") );

  m_pitch = new KIntNumInput(m_volume, 800, box);
  m_pitch->setLabel(i18n("&Pitch:"));
  m_pitch->setRange(20, 2000, 20);
  m_pitch->setSuffix(i18n(" Hz"));
  m_pitch->setSteps(40,200);
  grid->addWidget(m_pitch, ++row, 1);
  QWhatsThis::add( m_pitch, i18n("Here you can customize the pitch of the system bell. For further"
    " customization of the bell, see the \"Accessibility\" control module.") );

  m_duration = new KIntNumInput(m_pitch, 100, box);
  m_duration->setLabel(i18n("&Duration:"));
  m_duration->setRange(1, 1000, 50);
  m_duration->setSuffix(i18n(" msec"));
  m_duration->setSteps(20,100);
  grid->addWidget(m_duration, ++row, 1);
  QWhatsThis::add( m_duration, i18n("Here you can customize the duration of the system bell. For further"
    " customization of the bell, see the \"Accessibility\" control module.") );

  QBoxLayout *boxLayout = new QHBoxLayout();
  m_testButton = new QPushButton(i18n("&Test"), box, "test");
  boxLayout->addWidget(m_testButton, 0, AlignRight);
  grid->addLayout( boxLayout, ++row, 1 );
  connect( m_testButton, SIGNAL(clicked()), SLOT(ringBell()));
  QWhatsThis::add( m_testButton, i18n("Click \"Test\" to hear how the system bell will sound using your changed settings.") );

  // watch for changes
  connect(m_volume, SIGNAL(valueChanged(int)), SLOT(changed()));
  connect(m_pitch, SIGNAL(valueChanged(int)), SLOT(changed()));
  connect(m_duration, SIGNAL(valueChanged(int)), SLOT(changed()));
  
  KAboutData *about =
    new KAboutData(I18N_NOOP("kcmbell"), I18N_NOOP("KDE Bell Control Module"),
                  0, 0, KAboutData::License_GPL,
                  I18N_NOOP("(c) 1997 - 2001 Christian Czezatke, Matthias Elter"));

  about->addAuthor("Christian Czezatke", I18N_NOOP("Original author"), "*****@*****.**");
  about->addAuthor("Bernd Wuebben", 0, "*****@*****.**");
  about->addAuthor("Matthias Elter", I18N_NOOP("Current maintainer"), "*****@*****.**");
  about->addAuthor("Carsten Pfeiffer", 0, "*****@*****.**");
  setAboutData(about);

  load();
}
Example #20
0
KPreviewOptions::KPreviewOptions(QWidget *parent, const char * /*name*/) : KCModule(parent, "kcmkonq")
{
    QVBoxLayout *lay = new QVBoxLayout(this, 0, KDialog::spacingHint());

    lay->addWidget(new QLabel(i18n("<p>Allow previews, \"Folder Icons Reflect Contents\", and "
                                   "retrieval of meta-data on protocols:</p>"),
                              this));

    setQuickHelp(
        i18n("<h1>Preview Options</h1> Here you can modify the behavior "
             "of Konqueror when it shows the files in a folder."
             "<h2>The list of protocols:</h2> check the protocols over which "
             "previews should be shown; uncheck those over which they should not. "
             "For instance, you might want to show previews over SMB if the local "
             "network is fast enough, but you might disable it for FTP if you often "
             "visit very slow FTP sites with large images."
             "<h2>Maximum File Size:</h2> select the maximum file size for which "
             "previews should be generated. For instance, if set to 1 MB (the default), "
             "no preview will be generated for files bigger than 1 MB, for speed reasons."));

    // Listview containing checkboxes for all protocols that support listing
    KListView *listView = new KListView(this, "listView");
    listView->addColumn(i18n("Select Protocols"));
    listView->setFullWidth(true);

    QHBoxLayout *hbox = new QHBoxLayout(lay);
    hbox->addWidget(listView);
    hbox->addStretch();

    PreviewCheckListItem *localItems = new PreviewCheckListItem(listView, i18n("Local Protocols"));
    PreviewCheckListItem *inetItems = new PreviewCheckListItem(listView, i18n("Internet Protocols"));

    QStringList protocolList = KProtocolInfo::protocols();
    protocolList.sort();
    QStringList::Iterator it = protocolList.begin();

    KURL url;
    url.setPath("/");

    for(; it != protocolList.end(); ++it)
    {
        url.setProtocol(*it);
        if(KProtocolInfo::supportsListing(url))
        {
            QCheckListItem *item;
            if(KProtocolInfo::protocolClass(*it) == ":local")
                item = new PreviewCheckListItem(localItems, (*it));
            else
                item = new PreviewCheckListItem(inetItems, (*it));

            m_items.append(item);
        }
    }

    listView->setOpen(localItems, true);
    listView->setOpen(inetItems, true);

    QWhatsThis::add(listView, i18n("This option makes it possible to choose when the file previews, "
                                   "smart folder icons, and meta-data in the File Manager should be activated.\n"
                                   "In the list of protocols that appear, select which ones are fast "
                                   "enough for you to allow previews to be generated."));

    QLabel *label = new QLabel(i18n("&Maximum file size:"), this);
    lay->addWidget(label);

    m_maxSize = new KDoubleNumInput(this);
    m_maxSize->setSuffix(i18n(" MB"));
    m_maxSize->setRange(0.02, 10, 0.02, true);
    m_maxSize->setPrecision(1);
    label->setBuddy(m_maxSize);
    lay->addWidget(m_maxSize);
    connect(m_maxSize, SIGNAL(valueChanged(double)), SLOT(changed()));

    m_boostSize = new QCheckBox(i18n("&Increase size of previews relative to icons"), this);
    connect(m_boostSize, SIGNAL(toggled(bool)), SLOT(changed()));
    lay->addWidget(m_boostSize);

    m_useFileThumbnails = new QCheckBox(i18n("&Use thumbnails embedded in files"), this);
    connect(m_useFileThumbnails, SIGNAL(toggled(bool)), SLOT(changed()));

    lay->addWidget(m_useFileThumbnails);

    QWhatsThis::add(m_useFileThumbnails, i18n("Select this to use thumbnails that are found inside some "
                                              "file types (e.g. JPEG). This will increase speed and reduce "
                                              "disk usage. Deselect it if you have files that have been processed "
                                              "by programs which create inaccurate thumbnails, such as ImageMagick."));

    lay->addWidget(new QWidget(this), 10);

    load();
}