-rw-r--r-- | library/lnkproperties.cpp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp index 983c677..0b30a9a 100644 --- a/library/lnkproperties.cpp +++ b/library/lnkproperties.cpp @@ -28,2 +28,3 @@ +#include <qpe/qpeapplication.h> #include <qpe/applnk.h> @@ -52,2 +53,3 @@ #include <qregexp.h> +#include <qbuttongroup.h> @@ -87,3 +89,5 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) d->preload->hide(); - d->spacer->hide(); + d->rotate->hide(); + d->rotateButtons->hide(); + d->labelspacer->hide(); @@ -112,2 +116,9 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) 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); + } @@ -277,2 +288,18 @@ void LnkProperties::done(int ok) } + 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 ) { @@ -282,3 +309,3 @@ void LnkProperties::done(int ok) } - + if ( !d->preload->isHidden() ) { |