summaryrefslogtreecommitdiff
path: root/library/lnkproperties.cpp
authorsandman <sandman>2002-10-06 03:26:59 (UTC)
committer sandman <sandman>2002-10-06 03:26:59 (UTC)
commita1ebad08d462e682554d39a9beabce125a374452 (patch) (side-by-side diff)
tree254d7ddc5b257b278172af4952b2bec27b5df3b5 /library/lnkproperties.cpp
parent2c16c8767fa5c16c0eeebc7008202a68a61a5308 (diff)
downloadopie-a1ebad08d462e682554d39a9beabce125a374452.zip
opie-a1ebad08d462e682554d39a9beabce125a374452.tar.gz
opie-a1ebad08d462e682554d39a9beabce125a374452.tar.bz2
- 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 ;)
Diffstat (limited to 'library/lnkproperties.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/lnkproperties.cpp31
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
@@ -26,6 +26,7 @@
#include "lnkpropertiesbase_p.h"
#include "ir.h"
+#include <qpe/qpeapplication.h>
#include <qpe/applnk.h>
#include <qpe/global.h>
#include <qpe/categorywidget.h>
@@ -50,6 +51,7 @@
#include <qsize.h>
#include <qcombobox.h>
#include <qregexp.h>
+#include <qbuttongroup.h>
#include <stdlib.h>
@@ -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");