summaryrefslogtreecommitdiff
path: root/library/lnkproperties.cpp
Side-by-side diff
Diffstat (limited to 'library/lnkproperties.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/lnkproperties.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index 983c677..0b30a9a 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -23,12 +23,13 @@
#define QTOPIA_INTERNAL_FSLP
#include "lnkproperties.h"
#include "lnkproperties.h"
#include "lnkpropertiesbase_p.h"
#include "ir.h"
+#include <qpe/qpeapplication.h>
#include <qpe/applnk.h>
#include <qpe/global.h>
#include <qpe/categorywidget.h>
#ifdef QWS
#include <qpe/qcopenvelope_qws.h>
#endif
@@ -47,12 +48,13 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qsize.h>
#include <qcombobox.h>
#include <qregexp.h>
+#include <qbuttongroup.h>
#include <stdlib.h>
LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
: QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 )
{
@@ -82,13 +84,15 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed)
connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk()));
connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk()));
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();
d->categoryEdit->setCategories( lnk->categories(),
"Document View",
@@ -107,12 +111,19 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
d->categoryEdit->hide();
d->docname->setReadOnly( TRUE );
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");
QStringList apps = cfg.readListEntry("Apps",',');
d->preload->setChecked( apps.contains(l->exec()) );
if ( Global::isBuiltinCommand(lnk->exec()) )
@@ -272,12 +283,28 @@ void LnkProperties::done(int ok)
QArray<int> tmp = d->categoryEdit->newCategories();
if ( lnk->categories() != tmp ) {
lnk->setCategories( tmp );
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();
}