summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/lnkproperties.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index 50cf5af..8dca4ab 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -54,24 +54,29 @@
#include <stdlib.h>
LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
: QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 )
{
setCaption( tr("Properties") );
QVBoxLayout *vbox = new QVBoxLayout( this );
d = new LnkPropertiesBase( this );
vbox->add( d );
+ // hide custom rotation feature for now, need a new implementation to fit quicklauch,
+ // is confusing for the user and doubtable useful since life rotation
+ d->rotate->hide();
+ d->rotateButtons->hide();
+
d->docname->setText(l->name());
QString inf;
if ( l->type().isEmpty() ) {
d->type->hide();
d->typeLabel->hide();
} else {
d->type->setText( l->type() );
}
if ( l->comment().isEmpty() ) {
d->comment->hide();
d->commentLabel->hide();
@@ -106,25 +111,26 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
d->locationCombo->hide();
// Can't edit categories, since the app .desktop files are global,
// possibly read-only.
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((l->rotation().toInt()%360)/90);
+ //don't use rotate buttons for now (see comment above)
+ //d->rotateButtons->setButton((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()) )
d->preload->hide(); // builtins are always fast
@@ -159,28 +165,29 @@ void LnkProperties::setupLocations()
QString homeDir = getenv("HOME");
QString hardDiskHome;
QString hardDiskPath;
int index = 0;
currentLocation = -1;
for ( ; it.current(); ++it ) {
// we add 10k to the file size so we are sure we can also save the desktop file
if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) {
if ( (*it)->isRemovable() ||
(*it)->disk() == "/dev/mtdblock1" ||
(*it)->disk() == "/dev/mtdblock/1" ||
(*it)->disk().left(13) == "/dev/mtdblock" ||
- (*it)->disk() == "/dev/mtdblock6" ||
+ (*it)->disk() == "/dev/mtdblock6" ||
+ (*it )->disk() == "/dev/root" ||
(*it)->disk() == "tmpfs" ) {
d->locationCombo->insertItem( (*it)->name(), index );
- locations.append( ( ((*it)->isRemovable() ||
+ locations.append( ( ((*it)->isRemovable() ||
(*it)->disk() == "/dev/mtdblock6" ||
(*it)->disk() == "tmpfs" )
? (*it)->path() : homeDir) );
if ( lnk->file().contains( (*it)->path() ) ) {
d->locationCombo->setCurrentItem( index );
currentLocation = index;
}
index++;
} else if ( (*it)->name().contains( tr("Hard Disk") ) &&
homeDir.contains( (*it)->path() ) &&
(*it)->path().length() > hardDiskHome.length() ) {
hardDiskHome = (*it)->name();
@@ -266,59 +273,59 @@ bool LnkProperties::copyFile( DocLnk &newdoc )
// Copy file
FileManager fm;
if ( !fm.copyFile( *lnk, newdoc ) )
return FALSE;
return TRUE;
}
void LnkProperties::done(int ok)
{
if ( ok ) {
bool changed=FALSE;
bool reloadMime=FALSE;
-
+
if ( lnk->name() != d->docname->text() ) {
lnk->setName(d->docname->text());
changed=TRUE;
}
if ( d->categoryEdit->isVisible() ) {
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((rot*90)%360);
}
if ( newrot != lnk->rotation() ) {
lnk-> setRotation(newrot);
changed = TRUE;
reloadMime = 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");
QStringList apps = cfg.readListEntry("Apps",',');
QString exe = lnk->exec();
if ( apps.contains(exe) != d->preload->isChecked() ) {
if ( d->preload->isChecked() ) {
apps.append(exe);
#ifndef QT_NO_COP
QCopEnvelope e("QPE/Application/"+exe.local8Bit(),
"enablePreload()");
#endif