-rw-r--r-- | library/lnkproperties.cpp | 19 |
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 | |||
@@ -58,16 +58,21 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) | |||
58 | : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 ) | 58 | : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 ) |
59 | { | 59 | { |
60 | setCaption( tr("Properties") ); | 60 | setCaption( tr("Properties") ); |
61 | 61 | ||
62 | QVBoxLayout *vbox = new QVBoxLayout( this ); | 62 | QVBoxLayout *vbox = new QVBoxLayout( this ); |
63 | d = new LnkPropertiesBase( this ); | 63 | d = new LnkPropertiesBase( this ); |
64 | vbox->add( d ); | 64 | vbox->add( d ); |
65 | 65 | ||
66 | // hide custom rotation feature for now, need a new implementation to fit quicklauch, | ||
67 | // is confusing for the user and doubtable useful since life rotation | ||
68 | d->rotate->hide(); | ||
69 | d->rotateButtons->hide(); | ||
70 | |||
66 | d->docname->setText(l->name()); | 71 | d->docname->setText(l->name()); |
67 | QString inf; | 72 | QString inf; |
68 | if ( l->type().isEmpty() ) { | 73 | if ( l->type().isEmpty() ) { |
69 | d->type->hide(); | 74 | d->type->hide(); |
70 | d->typeLabel->hide(); | 75 | d->typeLabel->hide(); |
71 | } else { | 76 | } else { |
72 | d->type->setText( l->type() ); | 77 | d->type->setText( l->type() ); |
73 | } | 78 | } |
@@ -110,17 +115,18 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) | |||
110 | d->categoryEdit->hide(); | 115 | d->categoryEdit->hide(); |
111 | 116 | ||
112 | d->docname->setReadOnly( TRUE ); | 117 | d->docname->setReadOnly( TRUE ); |
113 | 118 | ||
114 | if ( l->property("CanFastload") == "0" ) | 119 | if ( l->property("CanFastload") == "0" ) |
115 | d->preload->hide(); | 120 | d->preload->hide(); |
116 | if ( !l->property("Rotation"). isEmpty ()) { | 121 | if ( !l->property("Rotation"). isEmpty ()) { |
117 | d->rotate->setChecked ( true ); | 122 | d->rotate->setChecked ( true ); |
118 | d->rotateButtons->setButton((l->rotation().toInt()%360)/90); | 123 | //don't use rotate buttons for now (see comment above) |
124 | //d->rotateButtons->setButton((l->rotation().toInt()%360)/90); | ||
119 | } | 125 | } |
120 | else { | 126 | else { |
121 | d->rotateButtons->setEnabled(false); | 127 | d->rotateButtons->setEnabled(false); |
122 | } | 128 | } |
123 | 129 | ||
124 | Config cfg("Launcher"); | 130 | Config cfg("Launcher"); |
125 | cfg.setGroup("Preload"); | 131 | cfg.setGroup("Preload"); |
126 | QStringList apps = cfg.readListEntry("Apps",','); | 132 | QStringList apps = cfg.readListEntry("Apps",','); |
@@ -163,20 +169,21 @@ void LnkProperties::setupLocations() | |||
163 | currentLocation = -1; | 169 | currentLocation = -1; |
164 | for ( ; it.current(); ++it ) { | 170 | for ( ; it.current(); ++it ) { |
165 | // we add 10k to the file size so we are sure we can also save the desktop file | 171 | // we add 10k to the file size so we are sure we can also save the desktop file |
166 | if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) { | 172 | if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) { |
167 | if ( (*it)->isRemovable() || | 173 | if ( (*it)->isRemovable() || |
168 | (*it)->disk() == "/dev/mtdblock1" || | 174 | (*it)->disk() == "/dev/mtdblock1" || |
169 | (*it)->disk() == "/dev/mtdblock/1" || | 175 | (*it)->disk() == "/dev/mtdblock/1" || |
170 | (*it)->disk().left(13) == "/dev/mtdblock" || | 176 | (*it)->disk().left(13) == "/dev/mtdblock" || |
171 | (*it)->disk() == "/dev/mtdblock6" || | 177 | (*it)->disk() == "/dev/mtdblock6" || |
178 | (*it )->disk() == "/dev/root" || | ||
172 | (*it)->disk() == "tmpfs" ) { | 179 | (*it)->disk() == "tmpfs" ) { |
173 | d->locationCombo->insertItem( (*it)->name(), index ); | 180 | d->locationCombo->insertItem( (*it)->name(), index ); |
174 | locations.append( ( ((*it)->isRemovable() || | 181 | locations.append( ( ((*it)->isRemovable() || |
175 | (*it)->disk() == "/dev/mtdblock6" || | 182 | (*it)->disk() == "/dev/mtdblock6" || |
176 | (*it)->disk() == "tmpfs" ) | 183 | (*it)->disk() == "tmpfs" ) |
177 | ? (*it)->path() : homeDir) ); | 184 | ? (*it)->path() : homeDir) ); |
178 | if ( lnk->file().contains( (*it)->path() ) ) { | 185 | if ( lnk->file().contains( (*it)->path() ) ) { |
179 | d->locationCombo->setCurrentItem( index ); | 186 | d->locationCombo->setCurrentItem( index ); |
180 | currentLocation = index; | 187 | currentLocation = index; |
181 | } | 188 | } |
182 | index++; | 189 | index++; |
@@ -270,31 +277,31 @@ bool LnkProperties::copyFile( DocLnk &newdoc ) | |||
270 | return TRUE; | 277 | return TRUE; |
271 | } | 278 | } |
272 | 279 | ||
273 | void LnkProperties::done(int ok) | 280 | void LnkProperties::done(int ok) |
274 | { | 281 | { |
275 | if ( ok ) { | 282 | if ( ok ) { |
276 | bool changed=FALSE; | 283 | bool changed=FALSE; |
277 | bool reloadMime=FALSE; | 284 | bool reloadMime=FALSE; |
278 | 285 | ||
279 | if ( lnk->name() != d->docname->text() ) { | 286 | if ( lnk->name() != d->docname->text() ) { |
280 | lnk->setName(d->docname->text()); | 287 | lnk->setName(d->docname->text()); |
281 | changed=TRUE; | 288 | changed=TRUE; |
282 | } | 289 | } |
283 | if ( d->categoryEdit->isVisible() ) { | 290 | if ( d->categoryEdit->isVisible() ) { |
284 | QArray<int> tmp = d->categoryEdit->newCategories(); | 291 | QArray<int> tmp = d->categoryEdit->newCategories(); |
285 | if ( lnk->categories() != tmp ) { | 292 | if ( lnk->categories() != tmp ) { |
286 | lnk->setCategories( tmp ); | 293 | lnk->setCategories( tmp ); |
287 | changed = TRUE; | 294 | changed = TRUE; |
288 | } | 295 | } |
289 | } | 296 | } |
290 | if ( !d->rotate->isHidden()) { | 297 | if ( !d->rotate->isHidden()) { |
291 | QString newrot; | 298 | QString newrot; |
292 | 299 | ||
293 | if ( d->rotate->isChecked() ) { | 300 | if ( d->rotate->isChecked() ) { |
294 | int rot=0; | 301 | int rot=0; |
295 | for(; rot<4; rot++) { | 302 | for(; rot<4; rot++) { |
296 | if (d->rotateButtons->find(rot)->isOn()) | 303 | if (d->rotateButtons->find(rot)->isOn()) |
297 | break; | 304 | break; |
298 | } | 305 | } |
299 | newrot = QString::number((rot*90)%360); | 306 | newrot = QString::number((rot*90)%360); |
300 | } | 307 | } |
@@ -304,17 +311,17 @@ void LnkProperties::done(int ok) | |||
304 | reloadMime = TRUE; | 311 | reloadMime = TRUE; |
305 | } | 312 | } |
306 | } | 313 | } |
307 | if ( d->preload->isHidden() && d->locationCombo->currentItem() != currentLocation ) { | 314 | if ( d->preload->isHidden() && d->locationCombo->currentItem() != currentLocation ) { |
308 | moveLnk(); | 315 | moveLnk(); |
309 | } else if ( changed ) { | 316 | } else if ( changed ) { |
310 | lnk->writeLink(); | 317 | lnk->writeLink(); |
311 | } | 318 | } |
312 | 319 | ||
313 | if ( !d->preload->isHidden() ) { | 320 | if ( !d->preload->isHidden() ) { |
314 | Config cfg("Launcher"); | 321 | Config cfg("Launcher"); |
315 | cfg.setGroup("Preload"); | 322 | cfg.setGroup("Preload"); |
316 | QStringList apps = cfg.readListEntry("Apps",','); | 323 | QStringList apps = cfg.readListEntry("Apps",','); |
317 | QString exe = lnk->exec(); | 324 | QString exe = lnk->exec(); |
318 | if ( apps.contains(exe) != d->preload->isChecked() ) { | 325 | if ( apps.contains(exe) != d->preload->isChecked() ) { |
319 | if ( d->preload->isChecked() ) { | 326 | if ( d->preload->isChecked() ) { |
320 | apps.append(exe); | 327 | apps.append(exe); |