From a1ebad08d462e682554d39a9beabce125a374452 Mon Sep 17 00:00:00 2001 From: sandman Date: Sun, 06 Oct 2002 03:26:59 +0000 Subject: - support "Rotation" setting in .desktop applnk file - changed properties dialog to make Rotation editable - fixed a long-standing QPE bug: launcher expects AppLnk::file() to return QString::null for *all real* applnks (as opposed to doclnks) -- but AppLnk itself initializes this field to the name of the dir, where the applnk is stored. This is why qcop "QPE/System" "linkChanged(QString)" xyz.desktop cleared a whole launcher tab I hope I didn't break anything with this change ;) --- (limited to 'library/lnkproperties.cpp') diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp index 983c677..0b30a9a 100644 --- a/library/lnkproperties.cpp +++ b/library/lnkproperties.cpp @@ -26,6 +26,7 @@ #include "lnkpropertiesbase_p.h" #include "ir.h" +#include #include #include #include @@ -50,6 +51,7 @@ #include #include #include +#include #include @@ -85,7 +87,9 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) d->docname->setReadOnly( FALSE ); d->preload->hide(); - d->spacer->hide(); + d->rotate->hide(); + d->rotateButtons->hide(); + d->labelspacer->hide(); // ### THIS MUST GO, FIX WIERD BUG in QLAYOUT d->categoryEdit->kludge(); @@ -110,6 +114,13 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) if ( l->property("CanFastload") == "0" ) d->preload->hide(); + if ( !l->property("Rotation"). isEmpty ()) { + d->rotate->setChecked ( true ); + d->rotateButtons->setButton(((QPEApplication::defaultRotation()+l->rotation().toInt())%360)/90); + } + else { + d->rotateButtons->setEnabled(false); + } Config cfg("Launcher"); cfg.setGroup("Preload"); @@ -275,12 +286,28 @@ void LnkProperties::done(int ok) changed = TRUE; } } + if ( !d->rotate->isHidden()) { + QString newrot; + + if (d->rotate->isChecked()) { + int rot=0; + for(; rot<4; rot++) { + if (d->rotateButtons->find(rot)->isOn()) + break; + } + newrot = QString::number((QPEApplication::defaultRotation()+rot*90)%360); + } + if (newrot !=lnk->rotation()) { + lnk->setRotation(newrot); + changed = TRUE; + } + } if ( d->preload->isHidden() && d->locationCombo->currentItem() != currentLocation ) { moveLnk(); } else if ( changed ) { lnk->writeLink(); } - + if ( !d->preload->isHidden() ) { Config cfg("Launcher"); cfg.setGroup("Preload"); -- cgit v0.9.0.2