Ejemplo n.º 1
0
void TDMAppearanceWidget::iconLoaderDropEvent(TQDropEvent *e)
{
    KURL pixurl;
    bool istmp;

    KURL *url = decodeImgDrop(e, this);
    if (url) {

	// we gotta check if it is a non-local file and make a tmp copy at the hd.
	if(!url->isLocalFile()) {
	    pixurl.setPath(TDEGlobal::dirs()->resourceDirs("data").last() +
		     "tdm/pics/" + url->fileName());
	    TDEIO::NetAccess::copy(*url, pixurl, parentWidget());
	    istmp = true;
	} else {
	    pixurl = *url;
	    istmp = false;
	}

	// By now url should be "file:/..."
	if (!setLogo(pixurl.path())) {
	    TDEIO::NetAccess::del(pixurl, parentWidget());
	    TQString msg = i18n("There was an error loading the image:\n"
			       "%1\n"
			       "It will not be saved.")
			       .arg(pixurl.path());
	    KMessageBox::sorry(this, msg);
	}

	delete url;
    }
}
Ejemplo n.º 2
0
void KDMDialogWidget::load()
{
    KConfigGroup configGrp = config->group("X-*-Greeter");

    // Read the greeting string
    greetstr_lined->setText(configGrp.readEntry("GreetString",
                                                i18n("Welcome to %s at %n")));

    // Regular logo or clock
    QString logoArea = configGrp.readEntry("LogoArea", "Logo");
    if (logoArea == "Clock") {
        clockRadio->setChecked(true);
        slotAreaRadioClicked(KdmClock);
    } else if (logoArea == "Logo") {
        logoRadio->setChecked(true);
        slotAreaRadioClicked(KdmLogo);
    } else {
        noneRadio->setChecked(true);
        slotAreaRadioClicked(KdmNone);
    }

    // See if we use alternate logo
    setLogo(configGrp.readEntry("LogoPixmap"));

    QStringList sl = configGrp.readEntry("GreeterPos", QStringList());
    if (sl.count() != 2)
        positioner->setPosition(50, 50);
    else
        positioner->setPosition(sl.first().toInt(), sl.last().toInt());
}
Ejemplo n.º 3
0
void SettingsOwnerView::setInterfaceController()
{
    connect(linePostCode, SIGNAL(editingFinished()), controller, SLOT(autoPostalCode()));
    connect(pushSetLogo,SIGNAL(clicked()),controller,SLOT(setLogo()));
    connect(pushRemoveLogo,SIGNAL(clicked()),controller,SLOT(removeLogo()));
    connect(pushSave,SIGNAL(clicked()),controller,SLOT(saveData()));
}
Ejemplo n.º 4
0
void KDMDialogWidget::defaults()
{
    greetstr_lined->setText(i18n("Welcome to %s at %n"));
    logoRadio->setChecked(true);
    slotAreaRadioClicked(KdmLogo);
    setLogo("");
    positioner->setPosition(50, 50);
}
Ejemplo n.º 5
0
void GxsGroupDialog::addGroupLogo() 
{
	QPixmap img = misc::getOpenThumbnailedPicture(this, tr("Load Group Logo"), 64, 64);
	
	if (img.isNull())
		return;

	setLogo(img);
}
Ejemplo n.º 6
0
void KDMAppearanceWidget::load()
{
    config->setGroup("X-*-Greeter");

    // Read the greeting string
    greetstr_lined->setText(config->readEntry("GreetString", i18n("Welcome to %s at %n")));

    // Regular logo or clock
    QString logoArea = config->readEntry("LogoArea", "Logo");
    if(logoArea == "Clock")
    {
        clockRadio->setChecked(true);
        slotAreaRadioClicked(KdmClock);
    }
    else if(logoArea == "Logo")
    {
        logoRadio->setChecked(true);
        slotAreaRadioClicked(KdmLogo);
    }
    else
    {
        noneRadio->setChecked(true);
        slotAreaRadioClicked(KdmNone);
    }

    // See if we use alternate logo
    setLogo(config->readEntry("LogoPixmap"));

    // Check the GUI type
    guicombo->setCurrentId(config->readEntry("GUIStyle"));

    // Check the Color Scheme
    colcombo->setCurrentId(config->readEntry("ColorScheme"));

    // Check the echo mode
    echocombo->setCurrentId(config->readEntry("EchoMode", "OneStar"));

    QStringList sl = config->readListEntry("GreeterPos");
    if(sl.count() != 2)
    {
        xLineEdit->setText("50");
        yLineEdit->setText("50");
    }
    else
    {
        xLineEdit->setText(sl.first());
        yLineEdit->setText(sl.last());
    }

    // get the language
    langcombo->setCurrentItem(config->readEntry("Language", "C"));
}
Ejemplo n.º 7
0
void KDMDialogWidget::slotLogoButtonClicked()
{
    KFileDialog dialog(KStandardDirs::locate("data", QLatin1String("kdm/pics/")),
                       KImageIO::pattern(KImageIO::Reading),
                       this);
    dialog.setOperationMode(KFileDialog::Opening);
    dialog.setMode(KFile::File | KFile::LocalOnly);

    KImageFilePreview *imagePreview = new KImageFilePreview(&dialog);
    dialog.setPreviewWidget(imagePreview);
    if (dialog.exec() == QDialog::Accepted &&
            setLogo(dialog.selectedFile()))
        changed();
}
Ejemplo n.º 8
0
void KDMAppearanceWidget::defaults()
{
  greetstr_lined->setText( i18n("Welcome to %s at %n") );
  logoRadio->setChecked( true );
  slotAreaRadioClicked( KdmLogo );
  setLogo( "" );
  guicombo->setCurrentId( "" );
  colcombo->setCurrentId( "" );
  echocombo->setCurrentItem( "OneStar" );

  xLineEdit->setText( "50" );
  yLineEdit->setText( "50" );

  langcombo->setCurrentItem( "en_US" );
}
Ejemplo n.º 9
0
void TDMAppearanceWidget::slotLogoButtonClicked()
{
    KImageIO::registerFormats();
    KFileDialog dialogue(locate("data", TQString::fromLatin1("tdm/pics/")),
			 KImageIO::pattern( KImageIO::Reading ),
			 this, 0, true);
    dialogue.setOperationMode( KFileDialog::Opening );
    dialogue.setMode( KFile::File | KFile::LocalOnly );

    KImageFilePreview* imagePreview = new KImageFilePreview( &dialogue );
    dialogue.setPreviewWidget( imagePreview );
    if (dialogue.exec() == TQDialog::Accepted) {
	if ( setLogo(dialogue.selectedFile()) ) {
	    changed();
	}
    }
}
Ejemplo n.º 10
0
void KDMDialogWidget::iconLoaderDropEvent(QDropEvent *e)
{
    // Installation of a logo from a non-local file is not
    // such a prominent feature to introduce a new KAuth action
    // for it. So let us just ignore these drops.

    KUrl *url = decodeImgDrop(e, this);
    if (url && url->isLocalFile()) {
        if (!setLogo(url->toLocalFile())) {
            QString msg = i18n("There was an error loading the image:\n"
                               "%1\n"
                               "It will not be saved.",
                               url->toLocalFile());
            KMessageBox::sorry(this, msg);
        } else {
            changed();
        }
    }
    delete url;
}
Ejemplo n.º 11
0
void OsdWidget::setLogo(QFile *file)
{
    setLogo(file->fileName());
    delete file;
}