summaryrefslogtreecommitdiff
path: root/library/lnkproperties.cpp
Unidiff
Diffstat (limited to 'library/lnkproperties.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/lnkproperties.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index 0b50bae..50cf5af 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -1,131 +1,129 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT 21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT
22// have this class. 22// have this class.
23#define QTOPIA_INTERNAL_FSLP 23#define QTOPIA_INTERNAL_FSLP
24#include "lnkproperties.h" 24#include "lnkproperties.h"
25#include "lnkproperties.h" 25#include "lnkproperties.h"
26#include "lnkpropertiesbase_p.h" 26#include "lnkpropertiesbase_p.h"
27#include "ir.h" 27#include "ir.h"
28 28
29#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
30#include <qpe/applnk.h> 30#include <qpe/applnk.h>
31#include <qpe/global.h> 31#include <qpe/global.h>
32#include <qpe/categorywidget.h> 32#include <qpe/categorywidget.h>
33#ifdef QWS
34#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
35#endif
36#include <qpe/filemanager.h> 34#include <qpe/filemanager.h>
37#include <qpe/config.h> 35#include <qpe/config.h>
38#include <qpe/storage.h> 36#include <qpe/storage.h>
39#include <qpe/qpemessagebox.h> 37#include <qpe/qpemessagebox.h>
40#include <qpe/mimetype.h> 38#include <qpe/mimetype.h>
41 39
42#include <qlineedit.h> 40#include <qlineedit.h>
43#include <qtoolbutton.h> 41#include <qtoolbutton.h>
44#include <qpushbutton.h> 42#include <qpushbutton.h>
45#include <qgroupbox.h> 43#include <qgroupbox.h>
46#include <qcheckbox.h> 44#include <qcheckbox.h>
47#include <qlabel.h> 45#include <qlabel.h>
48#include <qlayout.h> 46#include <qlayout.h>
49#include <qfile.h> 47#include <qfile.h>
50#include <qfileinfo.h> 48#include <qfileinfo.h>
51#include <qmessagebox.h> 49#include <qmessagebox.h>
52#include <qsize.h> 50#include <qsize.h>
53#include <qcombobox.h> 51#include <qcombobox.h>
54#include <qregexp.h> 52#include <qregexp.h>
55#include <qbuttongroup.h> 53#include <qbuttongroup.h>
56 54
57#include <stdlib.h> 55#include <stdlib.h>
58 56
59LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) 57LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
60 : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 ) 58 : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 )
61{ 59{
62 setCaption( tr("Properties") ); 60 setCaption( tr("Properties") );
63 61
64 QVBoxLayout *vbox = new QVBoxLayout( this ); 62 QVBoxLayout *vbox = new QVBoxLayout( this );
65 d = new LnkPropertiesBase( this ); 63 d = new LnkPropertiesBase( this );
66 vbox->add( d ); 64 vbox->add( d );
67 65
68 d->docname->setText(l->name()); 66 d->docname->setText(l->name());
69 QString inf; 67 QString inf;
70 if ( l->type().isEmpty() ) { 68 if ( l->type().isEmpty() ) {
71 d->type->hide(); 69 d->type->hide();
72 d->typeLabel->hide(); 70 d->typeLabel->hide();
73 } else { 71 } else {
74 d->type->setText( l->type() ); 72 d->type->setText( l->type() );
75 } 73 }
76 74
77 if ( l->comment().isEmpty() ) { 75 if ( l->comment().isEmpty() ) {
78 d->comment->hide(); 76 d->comment->hide();
79 d->commentLabel->hide(); 77 d->commentLabel->hide();
80 } else { 78 } else {
81 d->comment->setText( l->comment() ); 79 d->comment->setText( l->comment() );
82 } 80 }
83 81
84 connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk())); 82 connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk()));
85 if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed) 83 if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed)
86 connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk())); 84 connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk()));
87 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk())); 85 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk()));
88 86
89 d->docname->setReadOnly( FALSE ); 87 d->docname->setReadOnly( FALSE );
90 d->preload->hide(); 88 d->preload->hide();
91 d->rotate->hide(); 89 d->rotate->hide();
92 d->rotateButtons->hide(); 90 d->rotateButtons->hide();
93 d->labelspacer->hide(); 91 d->labelspacer->hide();
94 92
95 // ### THIS MUST GO, FIX WIERD BUG in QLAYOUT 93 // ### THIS MUST GO, FIX WIERD BUG in QLAYOUT
96 d->categoryEdit->kludge(); 94 d->categoryEdit->kludge();
97 95
98 d->categoryEdit->setCategories( lnk->categories(), 96 d->categoryEdit->setCategories( lnk->categories(),
99 "Document View", 97 "Document View",
100 tr("Document View") ); 98 tr("Document View") );
101 setupLocations(); 99 setupLocations();
102 } else { 100 } else {
103 d->unlink->hide(); 101 d->unlink->hide();
104 d->duplicate->hide(); 102 d->duplicate->hide();
105 d->beam->hide(); 103 d->beam->hide();
106 d->hline->hide(); 104 d->hline->hide();
107 d->locationLabel->hide(); 105 d->locationLabel->hide();
108 d->locationCombo->hide(); 106 d->locationCombo->hide();
109 107
110 // Can't edit categories, since the app .desktop files are global, 108 // Can't edit categories, since the app .desktop files are global,
111 // possibly read-only. 109 // possibly read-only.
112 d->categoryEdit->hide(); 110 d->categoryEdit->hide();
113 111
114 d->docname->setReadOnly( TRUE ); 112 d->docname->setReadOnly( TRUE );
115 113
116 if ( l->property("CanFastload") == "0" ) 114 if ( l->property("CanFastload") == "0" )
117 d->preload->hide(); 115 d->preload->hide();
118 if ( !l->property("Rotation"). isEmpty ()) { 116 if ( !l->property("Rotation"). isEmpty ()) {
119 d->rotate->setChecked ( true ); 117 d->rotate->setChecked ( true );
120 d->rotateButtons->setButton((l->rotation().toInt()%360)/90); 118 d->rotateButtons->setButton((l->rotation().toInt()%360)/90);
121 } 119 }
122 else { 120 else {
123 d->rotateButtons->setEnabled(false); 121 d->rotateButtons->setEnabled(false);
124 } 122 }
125 123
126 Config cfg("Launcher"); 124 Config cfg("Launcher");
127 cfg.setGroup("Preload"); 125 cfg.setGroup("Preload");
128 QStringList apps = cfg.readListEntry("Apps",','); 126 QStringList apps = cfg.readListEntry("Apps",',');
129 d->preload->setChecked( apps.contains(l->exec()) ); 127 d->preload->setChecked( apps.contains(l->exec()) );
130 if ( Global::isBuiltinCommand(lnk->exec()) ) 128 if ( Global::isBuiltinCommand(lnk->exec()) )
131 d->preload->hide(); // builtins are always fast 129 d->preload->hide(); // builtins are always fast