author | mickeyl <mickeyl> | 2004-03-08 16:35:56 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-08 16:35:56 (UTC) |
commit | 82fb70f4e5d8582185da89264e1a1e3b2517f459 (patch) (side-by-side diff) | |
tree | 12dfcfee4c95d3c96809397197c2b09e6e09cea6 | |
parent | 15a9a86fbec54292a82663e1b01c93450f3fbbf8 (diff) | |
download | opie-82fb70f4e5d8582185da89264e1a1e3b2517f459.zip opie-82fb70f4e5d8582185da89264e1a1e3b2517f459.tar.gz opie-82fb70f4e5d8582185da89264e1a1e3b2517f459.tar.bz2 |
add a line where the user can insert command line arguments for the AppLnk
-rw-r--r-- | library/lnkproperties.cpp | 3 | ||||
-rw-r--r-- | library/lnkpropertiesbase_p.ui | 94 |
2 files changed, 59 insertions, 38 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp index 0661423..865f590 100644 --- a/library/lnkproperties.cpp +++ b/library/lnkproperties.cpp @@ -65,128 +65,131 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) // 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(); } else { d->comment->setText( l->comment() ); } connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk())); 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->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", tr("Document View") ); setupLocations(); } else { d->unlink->hide(); d->duplicate->hide(); d->beam->hide(); d->hline->hide(); d->locationLabel->hide(); 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 ); //don't use rotate buttons for now (see comment above) //d->rotateButtons->setButton((l->rotation().toInt()%360)/90); } else { d->rotateButtons->setEnabled(false); } + if ( !l->property( "Arguments" ).isEmpty() ) + d->arguments->setText( l->property( "Arguments" ) ); + 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 currentLocation = 0; // apps not movable (yet) } } LnkProperties::~LnkProperties() { } void LnkProperties::unlinkLnk() { if ( QPEMessageBox::confirmDelete( this, tr("Delete"), lnk->name() ) ) { lnk->removeFiles(); if ( QFile::exists(lnk->file()) ) { QMessageBox::warning( this, tr("Delete"), tr("File deletion failed.") ); } else { reject(); } } } void LnkProperties::setupLocations() { QFileInfo fi( lnk->file() ); fileSize = fi.size(); StorageInfo storage; const QList<FileSystem> &fs = storage.fileSystems(); QListIterator<FileSystem> it ( fs ); QString s; 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/root" || (*it)->disk() == "tmpfs" ) { d->locationCombo->insertItem( (*it)->name(), index ); 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(); diff --git a/library/lnkpropertiesbase_p.ui b/library/lnkpropertiesbase_p.ui index 1bafab6..dcbd4d7 100644 --- a/library/lnkpropertiesbase_p.ui +++ b/library/lnkpropertiesbase_p.ui @@ -1,315 +1,312 @@ <!DOCTYPE UI><UI> <class>LnkPropertiesBase</class> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> <cstring>Form1</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>263</width> + <width>259</width> <height>450</height> </rect> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>5</vsizetype> </sizepolicy> </property> <property stdset="1"> <name>font</name> <font> </font> </property> <property stdset="1"> <name>caption</name> <string>Details</string> </property> <property stdset="1"> <name>icon</name> <pixmap>image0</pixmap> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <vbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>0</number> </property> <widget> <class>QFrame</class> <property stdset="1"> <name>name</name> <cstring>Frame8</cstring> </property> <property stdset="1"> <name>focusPolicy</name> <enum>NoFocus</enum> </property> <property stdset="1"> <name>frameShape</name> <enum>NoFrame</enum> </property> <property stdset="1"> <name>frameShadow</name> <enum>Plain</enum> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <grid> <property stdset="1"> <name>margin</name> - <number>3</number> + <number>2</number> </property> <property stdset="1"> <name>spacing</name> - <number>3</number> + <number>4</number> </property> - <widget row="8" column="0" rowspan="1" colspan="2" > - <class>CategoryWidget</class> + <widget row="1" column="0" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>categoryEdit</cstring> + <cstring>TextLabel1_2</cstring> </property> <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>7</vsizetype> - </sizepolicy> + <name>text</name> + <string>Arguments:</string> </property> </widget> - <widget row="5" column="0" rowspan="1" colspan="2" > + <widget row="6" column="0" rowspan="1" colspan="2" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>rotate</cstring> </property> <property stdset="1"> <name>text</name> <string>Use custom rotation</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <property> <name>whatsThis</name> <string>Preload this application so that it is available instantly.</string> </property> </widget> <widget row="0" column="1" > <class>QLineEdit</class> <property stdset="1"> <name>name</name> <cstring>docname</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>0</vsizetype> </sizepolicy> </property> <property stdset="1"> <name>text</name> <string></string> </property> <property> <name>whatsThis</name> <string>The name of this document.</string> </property> </widget> - <widget row="1" column="1" > + <widget row="2" column="1" > <class>QComboBox</class> <property stdset="1"> <name>name</name> <cstring>locationCombo</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>0</vsizetype> </sizepolicy> </property> <property> <name>whatsThis</name> <string>The media the document resides on.</string> </property> </widget> - <widget row="2" column="0" > + <widget row="3" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>typeLabel</cstring> </property> <property stdset="1"> <name>focusPolicy</name> <enum>NoFocus</enum> </property> <property stdset="1"> <name>text</name> <string>Type:</string> </property> <property stdset="1"> <name>textFormat</name> <enum>RichText</enum> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> </widget> - <widget row="2" column="1" > + <widget row="3" column="1" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>type</cstring> </property> <property stdset="1"> <name>text</name> <string></string> </property> </widget> - <widget row="1" column="0" > + <widget row="2" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>locationLabel</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>1</hsizetype> <vsizetype>1</vsizetype> </sizepolicy> </property> <property stdset="1"> <name>caption</name> <string></string> </property> <property stdset="1"> <name>text</name> <string>Location:</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> </widget> <widget row="0" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1</cstring> </property> <property stdset="1"> <name>frameShadow</name> <enum>MShadow</enum> </property> <property stdset="1"> <name>text</name> <string>Name:</string> </property> </widget> - <widget row="3" column="1" > + <widget row="4" column="1" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>comment</cstring> </property> <property stdset="1"> <name>text</name> <string></string> </property> </widget> - <widget row="6" column="0" rowspan="1" colspan="2" > + <widget row="7" column="0" rowspan="1" colspan="2" > <class>QButtonGroup</class> <property stdset="1"> <name>name</name> <cstring>rotateButtons</cstring> </property> <property stdset="1"> <name>frameShape</name> <enum>NoFrame</enum> </property> <property stdset="1"> <name>title</name> <string></string> </property> <property stdset="1"> <name>exclusive</name> <bool>true</bool> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>3</number> </property> <spacer> <property> <name>name</name> <cstring>s1</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Fixed</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>28</height> </size> </property> </spacer> <widget> <class>QToolButton</class> <property stdset="1"> <name>name</name> <cstring>ToolButton1</cstring> </property> <property stdset="1"> <name>text</name> <string></string> </property> <property stdset="1"> @@ -396,182 +393,203 @@ </property> <property stdset="1"> <name>toggleButton</name> <bool>true</bool> </property> <property stdset="1"> <name>buttonGroupId</name> <number>2</number> </property> </widget> <widget> <class>QToolButton</class> <property stdset="1"> <name>name</name> <cstring>ToolButton4</cstring> </property> <property stdset="1"> <name>text</name> <string></string> </property> <property stdset="1"> <name>pixmap</name> <pixmap>image3</pixmap> </property> <property stdset="1"> <name>toggleButton</name> <bool>true</bool> </property> <property stdset="1"> <name>usesBigPixmap</name> <bool>true</bool> </property> <property stdset="1"> <name>toggleButton</name> <bool>true</bool> </property> <property stdset="1"> <name>buttonGroupId</name> <number>3</number> </property> </widget> <spacer> <property> <name>name</name> <cstring>s4</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>MinimumExpanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> </hbox> </widget> - <widget row="7" column="0" rowspan="1" colspan="2" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>labelspacer</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>7</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>text</name> - <string></string> - </property> - </widget> - <widget row="4" column="0" rowspan="1" colspan="2" > + <widget row="5" column="0" rowspan="1" colspan="2" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>preload</cstring> </property> <property stdset="1"> <name>text</name> <string>Fast load (consumes memory)</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <property> <name>whatsThis</name> <string>Preload this application so that it is available instantly.</string> </property> </widget> - <widget row="3" column="0" > + <widget row="4" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>commentLabel</cstring> </property> <property stdset="1"> <name>text</name> <string>Comment:</string> </property> <property stdset="1"> <name>textFormat</name> <enum>RichText</enum> </property> </widget> + <widget row="1" column="1" > + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>arguments</cstring> + </property> + </widget> + <widget row="9" column="0" rowspan="1" colspan="2" > + <class>CategoryWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>categoryEdit</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>7</vsizetype> + </sizepolicy> + </property> + </widget> + <widget row="8" column="0" rowspan="1" colspan="2" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>labelspacer</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>7</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> + <name>text</name> + <string></string> + </property> + </widget> </grid> </widget> <widget> <class>Line</class> <property stdset="1"> <name>name</name> <cstring>hline</cstring> </property> <property stdset="1"> <name>frameShadow</name> <enum>Sunken</enum> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> </widget> <widget> <class>QFrame</class> <property stdset="1"> <name>name</name> <cstring>Frame9</cstring> </property> <property stdset="1"> <name>frameShape</name> <enum>NoFrame</enum> </property> <property stdset="1"> <name>frameShadow</name> <enum>Plain</enum> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <hbox> <property stdset="1"> <name>margin</name> <number>3</number> </property> <property stdset="1"> <name>spacing</name> <number>5</number> </property> <widget> <class>QPushButton</class> <property stdset="1"> <name>name</name> <cstring>unlink</cstring> </property> <property stdset="1"> <name>focusPolicy</name> <enum>TabFocus</enum> </property> <property stdset="1"> <name>text</name> |