bool DolphinSearchInformation::isPathIndexed(const KUrl& url) const
{
#ifdef HAVE_NEPOMUK
    const KConfig strigiConfig("nepomukstrigirc");
    const QStringList indexedFolders = strigiConfig.group("General").readPathEntry("folders", QStringList());

    // Check whether the path is part of an indexed folder
    bool isIndexed = false;
    foreach (const QString& indexedFolder, indexedFolders) {
        const KUrl indexedPath(indexedFolder);
        if (indexedPath.isParentOf(url)) {
            isIndexed = true;
            break;
        }
    }

    if (isIndexed) {
        // The path is part of an indexed folder. Check whether no
        // excluded folder is part of the path.
        const QStringList excludedFolders = strigiConfig.group("General").readPathEntry("exclude folders", QStringList());
        foreach (const QString& excludedFolder, excludedFolders) {
            const KUrl excludedPath(excludedFolder);
            if (excludedPath.isParentOf(url)) {
                isIndexed = false;
                break;
            }
        }
    }

    return isIndexed;
#else
    Q_UNUSED(url);
    return false;
#endif
}
KCMKTECollaborative::KCMKTECollaborative(QWidget* parent, const QVariantList& args)
    : KCModule(KteCollaborativePluginFactory::componentData(), parent, args)
{
    kDebug() << "creating kte_collaborative kcmodule";
    // Set up config groups
    KConfig* config = new KConfig("ktecollaborative");
    m_colorsGroup = config->group("colors");
    m_notifyGroup = config->group("notifications");
    m_applicationsGroup = config->group("applications");

    // Create notifications group box
    QGroupBox* notificationsGroupBox = new QGroupBox();
    notificationsGroupBox->setTitle(i18n("Highlights and Notifications"));
    QVBoxLayout* notificationsLayout = new QVBoxLayout();
    notificationsGroupBox->setLayout(notificationsLayout);
    m_highlightBackground = new QCheckBox(i18n("Display popup widgets"));
    m_displayWidgets = new QCheckBox(i18n("Colorize text background"));
    m_displayTextHints = new QCheckBox(i18n("Display text tooltips"));
    notificationsLayout->addWidget(m_displayWidgets);
    notificationsLayout->addWidget(m_highlightBackground);
    notificationsLayout->addWidget(m_displayTextHints);

    // Create colors group box
    QGroupBox* colorsGroupBox = new QGroupBox();
    colorsGroupBox->setTitle(i18n("Colors"));
    QFormLayout* colorsLayout = new QFormLayout();
    colorsGroupBox->setLayout(colorsLayout);
    m_saturationSilder = new QSlider(Qt::Horizontal);
    m_saturationSilder->setRange(30, 255);
    colorsLayout->addRow(i18n("Highlight saturation"), m_saturationSilder);

    // Create default application group box
    QGroupBox* defaultApplicationBox = new QGroupBox();
    defaultApplicationBox->setTitle(i18n("Default application"));
    defaultApplicationBox->setLayout(new QHBoxLayout);
    m_selectEditorWidget = new SelectEditorWidget(m_applicationsGroup.readEntry("editor"));
    defaultApplicationBox->layout()->addWidget(m_selectEditorWidget);

    // Assemble the UI
    setLayout(new QVBoxLayout());
    KMessageWidget* message = new KMessageWidget(i18n("Some changes might only be applied for newly opened documents."));
    message->setMessageType(KMessageWidget::Information);
    message->setCloseButtonVisible(false);
    layout()->addWidget(message);
    layout()->addWidget(notificationsGroupBox);
    layout()->addWidget(colorsGroupBox);
    layout()->addWidget(defaultApplicationBox);
    // Add a spacer to top-align the widgets
    layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding));

    // Set up connections for changed signals
    connect(m_saturationSilder, SIGNAL(sliderMoved(int)), SLOT(changed()));
    connect(m_highlightBackground, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(m_displayWidgets, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(m_displayTextHints, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(m_selectEditorWidget, SIGNAL(selectionChanged()), SLOT(changed()));
}
Ejemplo n.º 3
0
void KSSH::saveLists()
{
    KConfig config;
    KConfigGroup host_list = config.group("Host List");
    host_list.writeEntry("Host", compHost->items());
    KConfigGroup group_host_list = config.group(hostCB->currentText() % QString("-User List"));
    group_host_list.writeEntry("User", compUser->items());
    config.sync();
}
Ejemplo n.º 4
0
void TextLabel::init() {
	Q_D(TextLabel);

	KConfig config;
	KConfigGroup group;
	if (m_type == AxisTitle)
		group = config.group("AxisTitle");
	else if (m_type == PlotTitle)
		group = config.group("PlotTitle");
	else if (m_type == PlotLegendTitle)
		group = config.group("PlotLegendTitle");
	else
		group = config.group("TextLabel");

	//properties common to all types
	d->textWrapper.teXUsed = group.readEntry("TeXUsed", false);
	d->teXFontSize = group.readEntry("TeXFontSize", 12);
	d->teXFontColor = group.readEntry("TeXFontColor", QColor(Qt::black));
	d->rotationAngle = group.readEntry("Rotation", 0.0);

	d->staticText.setTextFormat(Qt::RichText);
	// explicitly set no wrap mode for text label to avoid unnecessary line breaks
	QTextOption textOption;
	textOption.setWrapMode(QTextOption::NoWrap);
	d->staticText.setTextOption(textOption);

	//position and alignment relevant properties, dependent on the actual type
	if (m_type == PlotTitle || m_type == PlotLegendTitle) {
		d->position.horizontalPosition = (HorizontalPosition) group.readEntry("PositionX", (int)TextLabel::hPositionCenter);
		d->position.verticalPosition = (VerticalPosition) group.readEntry("PositionY", (int) TextLabel::vPositionTop);
		d->position.point.setX( group.readEntry("PositionXValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
		d->position.point.setY( group.readEntry("PositionYValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
		d->horizontalAlignment= (TextLabel::HorizontalAlignment) group.readEntry("HorizontalAlignment", (int)TextLabel::hAlignCenter);
		d->verticalAlignment= (TextLabel::VerticalAlignment) group.readEntry("VerticalAlignment", (int)TextLabel::vAlignBottom);
	} else {
		d->position.horizontalPosition = (HorizontalPosition) group.readEntry("PositionX", (int)TextLabel::hPositionCustom);
		d->position.verticalPosition = (VerticalPosition) group.readEntry("PositionY", (int) TextLabel::vPositionCustom);
		d->position.point.setX( group.readEntry("PositionXValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
		d->position.point.setY( group.readEntry("PositionYValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
		d->horizontalAlignment= (TextLabel::HorizontalAlignment) group.readEntry("HorizontalAlignment", (int)TextLabel::hAlignCenter);
		d->verticalAlignment= (TextLabel::VerticalAlignment) group.readEntry("VerticalAlignment", (int)TextLabel::vAlignCenter);
	}

	//scaling:
	//we need to scale from the font size specified in points to scene units.
	//furhermore, we create the tex-image in a higher resolution then usual desktop resolution
	// -> take this into account
	d->scaleFactor = Worksheet::convertToSceneUnits(1, Worksheet::Point);
	d->teXImageResolution = QApplication::desktop()->physicalDpiX();
	d->teXImageScaleFactor = Worksheet::convertToSceneUnits(2.54/QApplication::desktop()->physicalDpiX(), Worksheet::Centimeter);

	connect(&d->teXImageFutureWatcher, SIGNAL(finished()), this, SLOT(updateTeXImage()));

	this->initActions();
}
Ejemplo n.º 5
0
void ExpoBlendingDlg::saveSettings()
{
    KConfig config;
    KConfigGroup group = config.group("ExpoBlending Settings");

    d->enfuseSettingsBox->writeSettings(group);
    d->saveSettingsBox->writeSettings(group);

    group.writeEntry("Template File Name", d->templateFileName->text());

    KConfigGroup group2 = config.group("ExpoBlending Dialog");
    KWindowConfig::saveWindowSize(windowHandle(), group2);
    config.sync();
}
Ejemplo n.º 6
0
void ExpoBlendingDlg::readSettings()
{
    KConfig config;
    KConfigGroup group = config.group("ExpoBlending Settings");

    d->enfuseSettingsBox->readSettings(group);
    d->saveSettingsBox->readSettings(group);

    d->templateFileName->setText(group.readEntry("Template File Name", QString::fromLatin1("enfuse")));

    winId();
    KConfigGroup group2 = config.group("ExpoBlending Dialog");
    KWindowConfig::restoreWindowSize(windowHandle(), group2);
    resize(windowHandle()->size());
}
Ejemplo n.º 7
0
void KSaveIOConfig::setProxyFor( const QString& protocol,
                                 const QString& _proxy )
{
  KConfig* cfg = config();
  cfg->group("Proxy Settings").writeEntry( protocol.toLower() + "Proxy", _proxy );
  cfg->sync();
}
Ejemplo n.º 8
0
void KSaveIOConfig::setCacheControl(KIO::CacheControl policy)
{
  KConfig* cfg = http_config();
  QString tmp = KIO::getCacheControlString(policy);
  cfg->group("").writeEntry("cache", tmp);
  cfg->sync();
}
Ejemplo n.º 9
0
KTextEditor::Editor *EditorChooser::createEditor(QWidget *parentWidget, QObject *parent, const char *widgetName, const char *name,
                                                 const QString &postfix, bool fallBackToKatePart)
{

    KTextEditor::Editor *tmpEd = 0;

    KConfig *cfg = kapp->config();
    QString previousGroup = cfg->group();
    cfg->setGroup("KTEXTEDITOR:" + postfix);
    QString editor = cfg->readPathEntry("editor");
    cfg->setGroup(previousGroup);
    if(editor.isEmpty())
    {
        KConfig *config = new KConfig("default_components");
        config->setGroup("KTextEditor");
        editor = config->readPathEntry("embeddedEditor", "katepart");
        delete config;
    }

    KService::Ptr serv = KService::serviceByDesktopName(editor);
    if(serv)
    {
        tmpEd = KTextEditor::createEditor(serv->library().latin1(), parentWidget, widgetName, parent, name);
        if(tmpEd)
            return tmpEd;
    }
    if(fallBackToKatePart)
        return KTextEditor::createEditor("libkatepart", parentWidget, widgetName, parent, name);

    return 0;
}
Ejemplo n.º 10
0
void DatapickerImage::init() {
	KConfig config;
	KConfigGroup group = config.group( "DatapickerImage" );
	d->fileName = group.readEntry("FileName", QString());
	d->rotationAngle = group.readEntry("RotationAngle", 0.0);
	d->minSegmentLength = group.readEntry("MinSegmentLength", 30);
	d->pointSeparation = group.readEntry("PointSeparation", 30);
	d->axisPoints.type = (DatapickerImage::GraphType) group.readEntry("GraphType", (int) DatapickerImage::Cartesian);
	d->axisPoints.ternaryScale = group.readEntry("TernaryScale", 1);
	d->settings.foregroundThresholdHigh = group.readEntry("ForegroundThresholdHigh", 90);
	d->settings.foregroundThresholdLow = group.readEntry("ForegroundThresholdLow", 30);
	d->settings.hueThresholdHigh = group.readEntry("HueThresholdHigh", 360);
	d->settings.hueThresholdLow = group.readEntry("HueThresholdLow", 0);
	d->settings.intensityThresholdHigh = group.readEntry("IntensityThresholdHigh", 100);
	d->settings.intensityThresholdLow = group.readEntry("IntensityThresholdLow", 20);
	d->settings.saturationThresholdHigh = group.readEntry("SaturationThresholdHigh", 100);
	d->settings.saturationThresholdLow = group.readEntry("SaturationThresholdLow", 30);
	d->settings.valueThresholdHigh = group.readEntry("ValueThresholdHigh", 90);
	d->settings.valueThresholdLow = group.readEntry("ValueThresholdLow", 30);
	d->plotPointsType = (DatapickerImage::PointsType) group.readEntry("PlotPointsType", (int) DatapickerImage::AxisPoints);
	d->plotImageType = DatapickerImage::OriginalImage;
	// point properties
	d->pointStyle = (Symbol::Style)group.readEntry("PointStyle", (int)Symbol::Cross);
	d->pointSize = group.readEntry("Size", Worksheet::convertToSceneUnits(7, Worksheet::Point));
	d->pointRotationAngle = group.readEntry("Rotation", 0.0);
	d->pointOpacity = group.readEntry("Opacity", 1.0);
	d->pointBrush.setStyle( (Qt::BrushStyle)group.readEntry("FillingStyle", (int)Qt::NoBrush) );
	d->pointBrush.setColor( group.readEntry("FillingColor", QColor(Qt::black)) );
	d->pointPen.setStyle( (Qt::PenStyle)group.readEntry("BorderStyle", (int)Qt::SolidLine) );
	d->pointPen.setColor( group.readEntry("BorderColor", QColor(Qt::red)) );
	d->pointPen.setWidthF( group.readEntry("BorderWidth", Worksheet::convertToSceneUnits(1, Worksheet::Point)) );
	d->pointVisibility = group.readEntry("PointVisibility", true);
}
Ejemplo n.º 11
0
void DPluginDialog::saveDialogSize()
{
    KConfig config;
    KConfigGroup group = config.group(objectName());
    DXmlGuiWindow::saveWindowSize(windowHandle(), group);
    config.sync();
}
Ejemplo n.º 12
0
void Worksheet::init() {
	KConfig config;
	KConfigGroup group = config.group( "Worksheet" );

	//size
	d->scaleContent = group.readEntry("ScaleContent", false);
	d->useViewSize = group.readEntry("UseViewSize", false);
	d->pageRect.setX(0);
	d->pageRect.setY(0);
	d->pageRect.setWidth(group.readEntry("Width", 1500));
	d->pageRect.setHeight(group.readEntry("Height",1500));

	//background
	d->backgroundType = (PlotArea::BackgroundType) group.readEntry("BackgroundType", (int) PlotArea::Color);
	d->backgroundColorStyle = (PlotArea::BackgroundColorStyle) group.readEntry("BackgroundColorStyle", (int) PlotArea::SingleColor);
	d->backgroundImageStyle = (PlotArea::BackgroundImageStyle) group.readEntry("BackgroundImageStyle", (int) PlotArea::Scaled);
	d->backgroundBrushStyle = (Qt::BrushStyle) group.readEntry("BackgroundBrushStyle", (int) Qt::SolidPattern);
	d->backgroundFileName = group.readEntry("BackgroundFileName", QString());
	d->backgroundFirstColor = group.readEntry("BackgroundFirstColor", QColor(Qt::white));
	d->backgroundSecondColor = group.readEntry("BackgroundSecondColor", QColor(Qt::black));
	d->backgroundOpacity = group.readEntry("BackgroundOpacity", 1.0);

	//layout
	d->layout = (Worksheet::Layout) group.readEntry("Layout", (int) Worksheet::VerticalLayout);
	d->layoutTopMargin =  group.readEntry("LayoutTopMargin", convertToSceneUnits(1, Centimeter));
	d->layoutBottomMargin = group.readEntry("LayoutBottomMargin", convertToSceneUnits(1, Centimeter));
	d->layoutLeftMargin = group.readEntry("LayoutLeftMargin", convertToSceneUnits(1, Centimeter));
	d->layoutRightMargin = group.readEntry("LayoutRightMargin", convertToSceneUnits(1, Centimeter));
	d->layoutVerticalSpacing = group.readEntry("LayoutVerticalSpacing", convertToSceneUnits(1, Centimeter));
	d->layoutHorizontalSpacing = group.readEntry("LayoutHorizontalSpacing", convertToSceneUnits(1, Centimeter));
	d->layoutRowCount = group.readEntry("LayoutRowCount", 2);
	d->layoutColumnCount = group.readEntry("LayoutColumnCount", 2);
}
Ejemplo n.º 13
0
void NoteDock::saveConfigAsTemplate(KConfig& config) {
	KConfigGroup group = config.group("Notes");

	group.writeEntry("BackgroundColor", ui.kcbBgColor->color());
	group.writeEntry("TextColor", ui.kcbTextColor->color());
	group.writeEntry("TextFont", ui.kfrTextFont->font());
}
Ejemplo n.º 14
0
/*!
	saves spreadsheet properties to \c config.
 */
void SpreadsheetDock::saveConfigAsTemplate(KConfig& config) {
	KConfigGroup group = config.group( "Spreadsheet" );
	group.writeEntry("ColumnCount", ui.sbColumnCount->value());
	group.writeEntry("RowCount", ui.sbRowCount->value());
	group.writeEntry("ShowComments",ui.cbShowComments->isChecked());
	config.sync();
}
Ejemplo n.º 15
0
Archivo: sprite.cpp Proyecto: KDE/ktux
void KSpriteSaver::readSettings()
{
    QString str;

    KSharedConfigPtr config = KSharedConfig::openConfig();
    KConfigGroup group( config, QStringLiteral("Settings") );

    mSpeed = group.readEntry(QStringLiteral("Speed"), 50);

    QString path = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("sprites/"), QStandardPaths::LocateDirectory);

    SpritePixmapManager::manager()->setPixmapDir(path);

    path += QStringLiteral( "spriterc" );

    KConfig *pConfig = new KConfig(path);
    KConfigGroup mConfig(pConfig, QStringLiteral("Config"));
    QStringList list;
    list = mConfig.readEntry(QStringLiteral("Groups"),list);
    mTimerIds.resize(list.count());
    for (int i = 0; i < list.count(); i++)
    {
        qDebug() << QStringLiteral("Group: ") << list.at(i);
        KConfigGroup grp = pConfig->group(list.at(i));
        SpriteGroup *obj = new SpriteGroup(mScene, grp);
        mTimerIds[i] = startTimer(obj->refreshTime());
        mGroups.append(obj);
    }
    delete pConfig;
}
void KSimPackageFileWidget::acceptPressed()
{
	if ( (m_dirList != m_directories->getFileList())
		|| (m_fileList != m_files->getFileList()))
	{
		KConfig * config = kapp->config();
	
		QString group(config->group());
	
		config->setGroup("Packages");
	
		config->writeEntry("Directories", m_directories->getFileList());
		config->writeEntry("Files", m_files->getFileList());

		config->setGroup(group);
		config->sync();
		
		KMessageBox::information(parentWidget() ,
		                         i18n("KSimus packages are configured only during the application start."
		                              "You have to restart ksimus if you want to apply the changes.\n"
		                              "This will be changed in a future version. Sorry!"),
		                         i18n("Restart required"),
		                         QString::fromLatin1("Package changed - Restart Application"));
	}
}
Ejemplo n.º 17
0
void KSSH::ssh()
{
    KConfig config;
    KConfigGroup conf_group = config.group("General");
    conf_group.writeEntry("LastHost", hostCB->currentText());
    conf_group.writeEntry("HostCompletionMode", (int) compHost->completionMode());
    conf_group.writeEntry("UserCompletionMode", (int) compUser->completionMode());

    config.sync();

    compUser->addItem(userCB->currentText());
    compHost->addItem(hostCB->currentText());

    if (saveCB->isChecked())
        saveOptions(hostCB->currentText() % QString("-Options"));

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    if (args->isSet("die")) {
        qApp->exit(1);
    }
    else {
        QString caption = "KSSH: %1" ;

        QString terminal = conf_group.readEntry("TerminalApplication", "konsole");

        QString ex(terminal % QString(" -e ") % cmd());
        KRun::runCommand(ex, this);
        if (!args->isSet("keepalive"))
            qApp->quit();
    }
}
Ejemplo n.º 18
0
void ColorScheme::writeColorEntry(KConfig& config , int index) const
{
    KConfigGroup configGroup = config.group(colorNameForIndex(index));

    const ColorEntry& entry = colorTable()[index];

    configGroup.writeEntry("Color", entry.color);
    if (configGroup.hasKey("Transparent")) {
        configGroup.deleteEntry("Transparent");
    }
    if (configGroup.hasKey("Transparency")) {
        configGroup.deleteEntry("Transparency");
    }
    if (entry.fontWeight != ColorEntry::UseCurrentFormat) {
        configGroup.writeEntry("Bold", entry.fontWeight == ColorEntry::Bold);
    }

    RandomizationRange random = _randomTable != 0 ? _randomTable[index] : RandomizationRange();

    // record randomization if this color has randomization or
    // if one of the keys already exists
    if (!random.isNull() || configGroup.hasKey("MaxRandomHue")) {
        configGroup.writeEntry("MaxRandomHue", static_cast<int>(random.hue));
        configGroup.writeEntry("MaxRandomValue", static_cast<int>(random.value));
        configGroup.writeEntry("MaxRandomSaturation", static_cast<int>(random.saturation));
    }
}
Ejemplo n.º 19
0
void ColorScheme::readColorEntry(const KConfig& config , int index)
{
    KConfigGroup configGroup = config.group(colorNameForIndex(index));

    ColorEntry entry;

    entry.color = configGroup.readEntry("Color", QColor());

    // Deprecated key from KDE 4.0 which set 'Bold' to true to force
    // a color to be bold or false to use the current format
    //
    // TODO - Add a new tri-state key which allows for bold, normal or
    // current format
    if (configGroup.hasKey("Bold"))
        entry.fontWeight = configGroup.readEntry("Bold", false) ? ColorEntry::Bold :
                           ColorEntry::UseCurrentFormat;

    setColorTableEntry(index , entry);

    const quint16 hue = configGroup.readEntry("MaxRandomHue", 0);
    const quint8 value = configGroup.readEntry("MaxRandomValue", 0);
    const quint8 saturation = configGroup.readEntry("MaxRandomSaturation", 0);

    if (hue != 0 || value != 0 || saturation != 0)
        setRandomizationRange(index , hue , saturation , value);
}
KSimPackageFileWidget::KSimPackageFileWidget(QWidget *parent, const char *name )
	:	PropertyWidget(1, parent,name)
{
	setMargin(0);
	
	m_directories = new KSimDirectorySelector(this, "Package directories");
	m_directories->setTitle(i18n("Package directories:"));
	m_directories->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));
	
	m_files = new KSimFileListSelector(this, "Package files");
	m_files->setTitle(i18n("Package files:"));
	m_files->setFilter(i18n("*.so|Package files (*.so)\n*|All files (*)"));
	m_files->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));

	// Setup data
	
	KConfig * config = kapp->config();
	
	QString group(config->group());
	
	config->setGroup("Packages");
	
	QStringList dirList;
	
	m_dirList = config->readListEntry("Directories");
	m_fileList = config->readListEntry("Files");

	config->setGroup(group);
	
	m_directories->setFileList(m_dirList);
	m_files->setFileList(m_fileList);

}
Ejemplo n.º 21
0
void KSSH::userFor(const QString& host)
{
    userCB->clear();
    compUser->clear();

    KConfig config;
    KConfigGroup user_config = config.group(host % QString("-User List"));

    QStringList data = user_config.readEntry("User", QStringList());
    compUser->setItems(data);
    userCB->setHistoryItems(data);

    userCB->setEditText(user_config.readEntry("LastUsed", ""));

    loadOptions("DefaultConfig");

    if (loadOptions(host % QString("-Options"))) {
        QFont tmpFont = optionsPB->font();
        tmpFont.setItalic(true);
        optionsPB->setFont(tmpFont);
    }
    else {
        QFont tmpFont = optionsPB->font();
        tmpFont.setItalic(false);
        optionsPB->setFont(tmpFont);
    }
}
Ejemplo n.º 22
0
int main ( int argc, char *argv[] )
{

     KAboutData aboutData ( "SUSEgreeter", 0, ki18n ( "SUSEgreeter" ), "0.1",
                            ki18n ( "SUSEgreeter" ), KAboutData::License_GPL, ki18n ( "(c) 2001, Adrian Schroeter" ) );
     aboutData.addAuthor ( ki18n ( "Adrian Schroeter" ), KLocalizedString(), "*****@*****.**" );

     KCmdLineArgs::init ( argc, argv, &aboutData );

     KLocale::setMainCatalog ( "SUSEgreeter" );

     KApplication a;

     KGlobal::locale()->insertCatalog ( QString::fromLatin1 ( "kpersonalizer" ) );

     // first, reset the startup from true (see desktop file in share/autostart) to false
     KConfig SUSEgreeterrc ( "SUSEgreeterrc" );
     KConfigGroup grp = SUSEgreeterrc.group ( "General" );
     bool ktip = ( grp.readEntry ( "FirstLogin113", true ) );
     grp.writeEntry ( "FirstLogin113", false );
     grp.sync();

     SUSEgreetings greeter;
     a.setTopWidget ( &greeter );
     greeter.adjustSize();

     QDesktopWidget *dsk = kapp->desktop();
     QRect scr = dsk->screenGeometry ( dsk->screenNumber ( QPoint ( 0, 0 ) ) );
     QRect grt ( 0, 0, greeter.width(), greeter.height() );
     grt.moveCenter ( scr.center() );
     greeter.setGeometry ( grt );
     greeter.show();

     int ret = a.exec();
     if ( ktip ) { // only run if we set this to true in the constructor. then SUSEgreeter didn't run before
          // set the ktiprc file entry to true. The global one is set to false for starting SUSEgreeter
#if 0
          KConfig ktiprc ( "ktiprc" );
          KConfigGroup group = ktiprc.group ( "TipOfDay" );
          group.writeEntry ( "RunOnStart", true );
          ktiprc.sync();
#endif

//      kapp->dcopClient()->send("kicker", "kicker", "showKMenu()", "");
     }
     return ret;
}
Ejemplo n.º 23
0
void CartesianPlotLegend::init(){
	Q_D(CartesianPlotLegend);

	KConfig config;
	KConfigGroup group = config.group( "CartesianPlotLegend" );

	d->labelFont = group.readEntry("LabelsFont", QFont());
	d->labelFont.setPixelSize( Worksheet::convertToSceneUnits( 10, Worksheet::Point ) );

	d->labelColor = Qt::black;
	d->labelColumnMajor = true;
	d->lineSymbolWidth = group.readEntry("LineSymbolWidth", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter));
	d->rowCount = 0;
	d->columnCount = 0;

	d->position.horizontalPosition = CartesianPlotLegend::hPositionRight;
	d->position.verticalPosition = CartesianPlotLegend::vPositionBottom;

	//Title
 	d->title = new TextLabel(this->name(), TextLabel::PlotLegendTitle);
	d->title->setText(this->name());
	addChild(d->title);
	d->title->setHidden(true);
	d->title->setParentGraphicsItem(graphicsItem());
	d->title->graphicsItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
	connect(d->title, SIGNAL(changed()), this, SLOT(retransform()));

	//Background
	d->backgroundType = (PlotArea::BackgroundType) group.readEntry("BackgroundType", (int) PlotArea::Color);
	d->backgroundColorStyle = (PlotArea::BackgroundColorStyle) group.readEntry("BackgroundColorStyle", (int) PlotArea::SingleColor);
	d->backgroundImageStyle = (PlotArea::BackgroundImageStyle) group.readEntry("BackgroundImageStyle", (int) PlotArea::Scaled);
	d->backgroundBrushStyle = (Qt::BrushStyle) group.readEntry("BackgroundBrushStyle", (int) Qt::SolidPattern);
	d->backgroundFileName = group.readEntry("BackgroundFileName", QString());
	d->backgroundFirstColor = group.readEntry("BackgroundFirstColor", QColor(Qt::white));
	d->backgroundSecondColor = group.readEntry("BackgroundSecondColor", QColor(Qt::black));
	d->backgroundOpacity = group.readEntry("BackgroundOpacity", 1.0);

	//Border
	d->borderPen = QPen(group.readEntry("BorderColor", QColor(Qt::black)),
										 group.readEntry("BorderWidth", Worksheet::convertToSceneUnits(1.0, Worksheet::Point)),
										 (Qt::PenStyle) group.readEntry("BorderStyle", (int)Qt::SolidLine));
	d->borderCornerRadius = group.readEntry("BorderCornerRadius", 0.0);
	d->borderOpacity = group.readEntry("BorderOpacity", 1.0);

	//Layout
	d->layoutTopMargin =  group.readEntry("LayoutTopMargin", Worksheet::convertToSceneUnits(0.2, Worksheet::Centimeter));
	d->layoutBottomMargin = group.readEntry("LayoutBottomMargin", Worksheet::convertToSceneUnits(0.2, Worksheet::Centimeter));
	d->layoutLeftMargin = group.readEntry("LayoutLeftMargin", Worksheet::convertToSceneUnits(0.2, Worksheet::Centimeter));
	d->layoutRightMargin = group.readEntry("LayoutRightMargin", Worksheet::convertToSceneUnits(0.2, Worksheet::Centimeter));
	d->layoutVerticalSpacing = group.readEntry("LayoutVerticalSpacing", Worksheet::convertToSceneUnits(0.1, Worksheet::Centimeter));
	d->layoutHorizontalSpacing = group.readEntry("LayoutHorizontalSpacing", Worksheet::convertToSceneUnits(0.1, Worksheet::Centimeter));
	d->layoutColumnCount = group.readEntry("LayoutColumnCount", 1);

	graphicsItem()->setFlag(QGraphicsItem::ItemIsSelectable, true);
	graphicsItem()->setFlag(QGraphicsItem::ItemIsMovable);
	graphicsItem()->setFlag(QGraphicsItem::ItemSendsGeometryChanges);

	this->initActions();
}
Ejemplo n.º 24
0
void KSSH::exitHandler()
{
    KConfig config;
    KConfigGroup def_config = config.group("DefaultConfig");
//     def_config.writeEntry("Size", size());
//     def_config.writeEntry("Position", pos());
    qApp->quit();
}
Ejemplo n.º 25
0
void CSSConfig::load()
{
    const bool signalsBlocked = customDialog->blockSignals(true);

    KConfig *c = new KConfig(QStringLiteral("kcmcssrc"), KConfig::NoGlobals);
    KConfigGroup group = c->group("Stylesheet");
    QString u = group.readEntry("Use", "default");
    configWidget->useDefault->setChecked(u == QLatin1String("default"));
    configWidget->useUser->setChecked(u == QLatin1String("user"));
    configWidget->useAccess->setChecked(u == QLatin1String("access"));
    configWidget->urlRequester->setUrl(QUrl::fromUserInput(group.readEntry("SheetName")));

    group = c->group("Font");
    customDialog->basefontsize->setEditText(QString::number(group.readEntry("BaseSize", 12)));
    customDialog->dontScale->setChecked(group.readEntry("DontScale", false));

    const QString fname(group.readEntry("Family", "Arial"));
    for (int i = 0; i < customDialog->fontFamily->count(); ++i) {
        if (customDialog->fontFamily->itemText(i) == fname) {
            customDialog->fontFamily->setCurrentIndex(i);
            break;
        }
    }

    customDialog->sameFamily->setChecked(group.readEntry("SameFamily", false));

    group = c->group("Colors");
    QString m = group.readEntry("Mode", "black-on-white");
    customDialog->blackOnWhite->setChecked(m == QLatin1String("black-on-white"));
    customDialog->whiteOnBlack->setChecked(m == QLatin1String("white-on-black"));
    customDialog->customColor->setChecked(m == QLatin1String("custom"));

    QColor white(Qt::white);
    QColor black(Qt::black);
    customDialog->backgroundColorButton->setColor(group.readEntry("BackColor", white));
    customDialog->foregroundColorButton->setColor(group.readEntry("ForeColor", black));
    customDialog->sameColor->setChecked(group.readEntry("SameColor", false));

    // Images
    group = c->group("Images");
    customDialog->hideImages->setChecked(group.readEntry("Hide", false));
    customDialog->hideBackground->setChecked(group.readEntry("HideBackground", true));

    customDialog->blockSignals(signalsBlocked);
    delete c;
}
Ejemplo n.º 26
0
/*!
	loads saved spreadsheet properties from \c config.
 */
void SpreadsheetDock::loadConfig(KConfig& config){
	KConfigGroup group = config.group( "Spreadsheet" );

	ui.sbColumnCount->setValue(group.readEntry("ColumnCount", m_spreadsheet->columnCount()));
	ui.sbRowCount->setValue(group.readEntry("RowCount", m_spreadsheet->rowCount()));

	SpreadsheetView* view= qobject_cast<SpreadsheetView*>(m_spreadsheet->view());
	ui.cbShowComments->setChecked(group.readEntry("ShowComments", view->areCommentsShown()));
}
void SessionManager::saveSettings()
{
  KConfig cfg ("dirfilterrc", KConfig::NoGlobals);
  KConfigGroup group = cfg.group ("General");

  group.writeEntry ("ShowCount", showCount);
  group.writeEntry ("UseMultipleFilters", useMultipleFilters);
  cfg.sync();
}
Ejemplo n.º 28
0
PanoLastPage::~PanoLastPage()
{
    KConfig config;
    KConfigGroup group = config.group("Panorama Settings");
    group.writeEntry("Save PTO", d->savePtoCheckBox->isChecked());
    config.sync();

    delete d;
}
Ejemplo n.º 29
0
void KSSH::loadHosts()
{
    KConfig config;
    KConfigGroup g = config.group("Host List");

    QStringList data = g.readEntry("Host", QStringList());
    compHost->setItems(data);
    hostCB->insertItems(hostCB->count(), data);
}
Ejemplo n.º 30
0
void KAccount::readConfig( KConfig &config, const QString &group )
{
  QString oldGroup = config.group();
  if (!group.isEmpty())
    config.setGroup(group);
  mId = config.readUnsignedNumEntry("Id", 0);
  mName = config.readEntry("Name");
  if (!group.isEmpty()) // restore
    config.setGroup(oldGroup);
}