author | zecke <zecke> | 2002-03-22 23:09:26 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-03-22 23:09:26 (UTC) |
commit | 5c17e8b168cf27ac2922e7c118cb886b116eab42 (patch) (unidiff) | |
tree | 5ba4ad0f08f9e93c62b95545d97a462f6924e45c | |
parent | 232a5bed633ba2aa96fcab73ff991ab3a796ad76 (diff) | |
download | opie-5c17e8b168cf27ac2922e7c118cb886b116eab42.zip opie-5c17e8b168cf27ac2922e7c118cb886b116eab42.tar.gz opie-5c17e8b168cf27ac2922e7c118cb886b116eab42.tar.bz2 |
make some people happy update
-rw-r--r-- | core/launcher/launcher.cpp | 1 | ||||
-rw-r--r-- | core/launcher/mediummountgui.cpp | 1 | ||||
-rw-r--r-- | libopie/oconfig.h | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index dcc3ba1..1c38a05 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -1,901 +1,902 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (c) 2002 Holger zecke Freyther | 2 | ** Copyright (c) 2002 Holger zecke Freyther |
3 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 3 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
4 | ** | 4 | ** |
5 | ** This file is part of Qtopia Environment. | 5 | ** This file is part of Qtopia Environment. |
6 | ** | 6 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 10 | ** packaging of this file. |
11 | ** | 11 | ** |
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | // WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT | 22 | // WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT |
23 | // have this class. | 23 | // have this class. |
24 | #define QTOPIA_INTERNAL_FSLP | 24 | #define QTOPIA_INTERNAL_FSLP |
25 | 25 | ||
26 | #include <opie/oconfig.h> | 26 | #include <opie/oconfig.h> |
27 | #include <qpe/qcopenvelope_qws.h> | 27 | #include <qpe/qcopenvelope_qws.h> |
28 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
29 | #include <qpe/applnk.h> | 29 | #include <qpe/applnk.h> |
30 | #include <qpe/config.h> | 30 | #include <qpe/config.h> |
31 | #include <qpe/global.h> | 31 | #include <qpe/global.h> |
32 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
33 | #include <qpe/mimetype.h> | 33 | #include <qpe/mimetype.h> |
34 | #include <qpe/storage.h> | 34 | #include <qpe/storage.h> |
35 | #include <qpe/palmtoprecord.h> | 35 | #include <qpe/palmtoprecord.h> |
36 | 36 | ||
37 | #include <qdatetime.h> | 37 | #include <qdatetime.h> |
38 | #include <qdir.h> | 38 | #include <qdir.h> |
39 | #include <qwindowsystem_qws.h> | 39 | #include <qwindowsystem_qws.h> |
40 | #include <qtimer.h> | 40 | #include <qtimer.h> |
41 | #include <qcombobox.h> | 41 | #include <qcombobox.h> |
42 | #include <qvbox.h> | 42 | #include <qvbox.h> |
43 | #include <qlayout.h> | 43 | #include <qlayout.h> |
44 | #include <qstyle.h> | 44 | #include <qstyle.h> |
45 | #include <qpushbutton.h> | 45 | #include <qpushbutton.h> |
46 | #include <qtabbar.h> | 46 | #include <qtabbar.h> |
47 | #include <qwidgetstack.h> | 47 | #include <qwidgetstack.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qregexp.h> | 49 | #include <qregexp.h> |
50 | #include <qmessagebox.h> | 50 | #include <qmessagebox.h> |
51 | #include <qframe.h> | 51 | #include <qframe.h> |
52 | #include <qpainter.h> | 52 | #include <qpainter.h> |
53 | #include <qlabel.h> | 53 | #include <qlabel.h> |
54 | #include <qtextstream.h> | 54 | #include <qtextstream.h> |
55 | 55 | ||
56 | #include "launcherview.h" | 56 | #include "launcherview.h" |
57 | #include "launcher.h" | 57 | #include "launcher.h" |
58 | #include "syncdialog.h" | 58 | #include "syncdialog.h" |
59 | #include "desktop.h" | 59 | #include "desktop.h" |
60 | #include <qpe/lnkproperties.h> | 60 | #include <qpe/lnkproperties.h> |
61 | #include "mrulist.h" | 61 | #include "mrulist.h" |
62 | #include "qrsync.h" | 62 | #include "qrsync.h" |
63 | #include <stdlib.h> | 63 | #include <stdlib.h> |
64 | #include <unistd.h> | 64 | #include <unistd.h> |
65 | 65 | ||
66 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 66 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
67 | #include <stdio.h> | 67 | #include <stdio.h> |
68 | #include <sys/vfs.h> | 68 | #include <sys/vfs.h> |
69 | #include <mntent.h> | 69 | #include <mntent.h> |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #include <qpe/storage.h> | 72 | #include <qpe/storage.h> |
73 | #include "mediummountgui.h" | 73 | #include "mediummountgui.h" |
74 | //#define SHOW_ALL | 74 | //#define SHOW_ALL |
75 | 75 | ||
76 | // uidGen | 76 | // uidGen |
77 | 77 | ||
78 | // uidGen | 78 | // uidGen |
79 | 79 | ||
80 | CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : | 80 | CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : |
81 | QVBox( parent ) | 81 | QVBox( parent ) |
82 | { | 82 | { |
83 | categoryBar = 0; | 83 | categoryBar = 0; |
84 | stack = 0; | 84 | stack = 0; |
85 | } | 85 | } |
86 | 86 | ||
87 | void CategoryTabWidget::prevTab() | 87 | void CategoryTabWidget::prevTab() |
88 | { | 88 | { |
89 | if ( categoryBar ) { | 89 | if ( categoryBar ) { |
90 | int n = categoryBar->count(); | 90 | int n = categoryBar->count(); |
91 | int tab = categoryBar->currentTab(); | 91 | int tab = categoryBar->currentTab(); |
92 | if ( tab >= 0 ) | 92 | if ( tab >= 0 ) |
93 | categoryBar->setCurrentTab( (tab - 1 + n)%n ); | 93 | categoryBar->setCurrentTab( (tab - 1 + n)%n ); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | void CategoryTabWidget::nextTab() | 97 | void CategoryTabWidget::nextTab() |
98 | { | 98 | { |
99 | if ( categoryBar ) { | 99 | if ( categoryBar ) { |
100 | int n = categoryBar->count(); | 100 | int n = categoryBar->count(); |
101 | int tab = categoryBar->currentTab(); | 101 | int tab = categoryBar->currentTab(); |
102 | categoryBar->setCurrentTab( (tab + 1)%n ); | 102 | categoryBar->setCurrentTab( (tab + 1)%n ); |
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | void CategoryTabWidget::addItem( const QString& linkfile ) | 106 | void CategoryTabWidget::addItem( const QString& linkfile ) |
107 | { | 107 | { |
108 | int i=0; | 108 | int i=0; |
109 | AppLnk *app = new AppLnk(linkfile); | 109 | AppLnk *app = new AppLnk(linkfile); |
110 | if ( !app->isValid() ) { | 110 | if ( !app->isValid() ) { |
111 | delete app; | 111 | delete app; |
112 | return; | 112 | return; |
113 | } | 113 | } |
114 | if ( !app->file().isEmpty() ) { | 114 | if ( !app->file().isEmpty() ) { |
115 | // A document | 115 | // A document |
116 | delete app; | 116 | delete app; |
117 | app = new DocLnk(linkfile); | 117 | app = new DocLnk(linkfile); |
118 | ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app); | 118 | ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app); |
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) { | 121 | for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) { |
122 | if ( !(*it).isEmpty() ) { | 122 | if ( !(*it).isEmpty() ) { |
123 | QRegExp tf(*it,FALSE,TRUE); | 123 | QRegExp tf(*it,FALSE,TRUE); |
124 | if ( tf.match(app->type()) >= 0 ) { | 124 | if ( tf.match(app->type()) >= 0 ) { |
125 | ((LauncherView*)stack->widget(i))->addItem(app); | 125 | ((LauncherView*)stack->widget(i))->addItem(app); |
126 | return; | 126 | return; |
127 | } | 127 | } |
128 | i++; | 128 | i++; |
129 | } | 129 | } |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
133 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | 133 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, |
134 | AppLnkSet* docFolder, const QList<FileSystem> &fs) | 134 | AppLnkSet* docFolder, const QList<FileSystem> &fs) |
135 | { | 135 | { |
136 | delete categoryBar; | 136 | delete categoryBar; |
137 | categoryBar = new CategoryTabBar( this ); | 137 | categoryBar = new CategoryTabBar( this ); |
138 | QPalette pal = categoryBar->palette(); | 138 | QPalette pal = categoryBar->palette(); |
139 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 139 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
140 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 140 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
141 | categoryBar->setPalette( pal ); | 141 | categoryBar->setPalette( pal ); |
142 | 142 | ||
143 | delete stack; | 143 | delete stack; |
144 | stack = new QWidgetStack(this); | 144 | stack = new QWidgetStack(this); |
145 | tabs=0; | 145 | tabs=0; |
146 | 146 | ||
147 | ids.clear(); | 147 | ids.clear(); |
148 | 148 | ||
149 | QStringList types = rootFolder->types(); | 149 | QStringList types = rootFolder->types(); |
150 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { | 150 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { |
151 | if ( !(*it).isEmpty() ) { | 151 | if ( !(*it).isEmpty() ) { |
152 | newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it)); | 152 | newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it)); |
153 | } | 153 | } |
154 | } | 154 | } |
155 | QListIterator<AppLnk> it( rootFolder->children() ); | 155 | QListIterator<AppLnk> it( rootFolder->children() ); |
156 | AppLnk* l; | 156 | AppLnk* l; |
157 | while ( (l=it.current()) ) { | 157 | while ( (l=it.current()) ) { |
158 | if ( l->type() == "Separator" ) { | 158 | if ( l->type() == "Separator" ) { |
159 | rootFolder->remove(l); | 159 | rootFolder->remove(l); |
160 | delete l; | 160 | delete l; |
161 | } else { | 161 | } else { |
162 | int i=0; | 162 | int i=0; |
163 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { | 163 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { |
164 | if ( *it == l->type() ) | 164 | if ( *it == l->type() ) |
165 | ((LauncherView*)stack->widget(i))->addItem(l,FALSE); | 165 | ((LauncherView*)stack->widget(i))->addItem(l,FALSE); |
166 | i++; | 166 | i++; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | ++it; | 169 | ++it; |
170 | } | 170 | } |
171 | rootFolder->detachChildren(); | 171 | rootFolder->detachChildren(); |
172 | for (int i=0; i<tabs; i++) | 172 | for (int i=0; i<tabs; i++) |
173 | ((LauncherView*)stack->widget(i))->sort(); | 173 | ((LauncherView*)stack->widget(i))->sort(); |
174 | 174 | ||
175 | // all documents | 175 | // all documents |
176 | docview = newView( QString::null, Resource::loadPixmap("DocsIcon"), tr("Documents")); | 176 | docview = newView( QString::null, Resource::loadPixmap("DocsIcon"), tr("Documents")); |
177 | docview->populate( docFolder, QString::null ); | 177 | docview->populate( docFolder, QString::null ); |
178 | docFolder->detachChildren(); | 178 | docFolder->detachChildren(); |
179 | docview->setFileSystems(fs); | 179 | docview->setFileSystems(fs); |
180 | docview->setToolsEnabled(TRUE); | 180 | docview->setToolsEnabled(TRUE); |
181 | 181 | ||
182 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); | 182 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); |
183 | 183 | ||
184 | ((LauncherView*)stack->widget(0))->setFocus(); | 184 | ((LauncherView*)stack->widget(0))->setFocus(); |
185 | 185 | ||
186 | categoryBar->show(); | 186 | categoryBar->show(); |
187 | stack->show(); | 187 | stack->show(); |
188 | } | 188 | } |
189 | 189 | ||
190 | void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs) | 190 | void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs) |
191 | { | 191 | { |
192 | docview->populate( docFolder, QString::null ); | 192 | docview->populate( docFolder, QString::null ); |
193 | docFolder->detachChildren(); | 193 | docFolder->detachChildren(); |
194 | docview->setFileSystems(fs); | 194 | docview->setFileSystems(fs); |
195 | docview->updateTools(); | 195 | docview->updateTools(); |
196 | } | 196 | } |
197 | 197 | ||
198 | LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) | 198 | LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) |
199 | { | 199 | { |
200 | LauncherView* view = new LauncherView( stack ); | 200 | LauncherView* view = new LauncherView( stack ); |
201 | connect( view, SIGNAL(clicked(const AppLnk*)), | 201 | connect( view, SIGNAL(clicked(const AppLnk*)), |
202 | this, SIGNAL(clicked(const AppLnk*))); | 202 | this, SIGNAL(clicked(const AppLnk*))); |
203 | connect( view, SIGNAL(rightPressed(AppLnk*)), | 203 | connect( view, SIGNAL(rightPressed(AppLnk*)), |
204 | this, SIGNAL(rightPressed(AppLnk*))); | 204 | this, SIGNAL(rightPressed(AppLnk*))); |
205 | ids.append(id); | 205 | ids.append(id); |
206 | categoryBar->addTab( new QTab( pm, label ) ); | 206 | categoryBar->addTab( new QTab( pm, label ) ); |
207 | stack->addWidget( view, tabs++ ); | 207 | stack->addWidget( view, tabs++ ); |
208 | return view; | 208 | return view; |
209 | } | 209 | } |
210 | 210 | ||
211 | void CategoryTabWidget::updateLink(const QString& linkfile) | 211 | void CategoryTabWidget::updateLink(const QString& linkfile) |
212 | { | 212 | { |
213 | int i=0; | 213 | int i=0; |
214 | LauncherView* view; | 214 | LauncherView* view; |
215 | while ((view = (LauncherView*)stack->widget(i++))) { | 215 | while ((view = (LauncherView*)stack->widget(i++))) { |
216 | if ( view->removeLink(linkfile) ) | 216 | if ( view->removeLink(linkfile) ) |
217 | break; | 217 | break; |
218 | } | 218 | } |
219 | addItem(linkfile); | 219 | addItem(linkfile); |
220 | docview->updateTools(); | 220 | docview->updateTools(); |
221 | } | 221 | } |
222 | 222 | ||
223 | void CategoryTabWidget::paletteChange( const QPalette &p ) | 223 | void CategoryTabWidget::paletteChange( const QPalette &p ) |
224 | { | 224 | { |
225 | QVBox::paletteChange( p ); | 225 | QVBox::paletteChange( p ); |
226 | QPalette pal = palette(); | 226 | QPalette pal = palette(); |
227 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 227 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
228 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 228 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
229 | categoryBar->setPalette( pal ); | 229 | categoryBar->setPalette( pal ); |
230 | categoryBar->update(); | 230 | categoryBar->update(); |
231 | } | 231 | } |
232 | 232 | ||
233 | void CategoryTabWidget::setBusy(bool on) | 233 | void CategoryTabWidget::setBusy(bool on) |
234 | { | 234 | { |
235 | if ( on ) | 235 | if ( on ) |
236 | ((LauncherView*)stack->visibleWidget())->setBusy(TRUE); | 236 | ((LauncherView*)stack->visibleWidget())->setBusy(TRUE); |
237 | else | 237 | else |
238 | for (int i=0; i<tabs; i++) | 238 | for (int i=0; i<tabs; i++) |
239 | ((LauncherView*)stack->widget(i))->setBusy(FALSE); | 239 | ((LauncherView*)stack->widget(i))->setBusy(FALSE); |
240 | } | 240 | } |
241 | 241 | ||
242 | 242 | ||
243 | CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) | 243 | CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) |
244 | : QTabBar( parent, name ) | 244 | : QTabBar( parent, name ) |
245 | { | 245 | { |
246 | setFocusPolicy( NoFocus ); | 246 | setFocusPolicy( NoFocus ); |
247 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); | 247 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); |
248 | } | 248 | } |
249 | 249 | ||
250 | CategoryTabBar::~CategoryTabBar() | 250 | CategoryTabBar::~CategoryTabBar() |
251 | { | 251 | { |
252 | } | 252 | } |
253 | 253 | ||
254 | void CategoryTabBar::layoutTabs() | 254 | void CategoryTabBar::layoutTabs() |
255 | { | 255 | { |
256 | if ( !count() ) | 256 | if ( !count() ) |
257 | return; | 257 | return; |
258 | 258 | ||
259 | // int percentFalloffTable[] = { 100, 70, 40, 12, 6, 3, 1, 0 }; | 259 | // int percentFalloffTable[] = { 100, 70, 40, 12, 6, 3, 1, 0 }; |
260 | int hiddenTabWidth = -12; | 260 | int hiddenTabWidth = -12; |
261 | int middleTab = currentTab(); | 261 | int middleTab = currentTab(); |
262 | int hframe, vframe, overlap; | 262 | int hframe, vframe, overlap; |
263 | style().tabbarMetrics( this, hframe, vframe, overlap ); | 263 | style().tabbarMetrics( this, hframe, vframe, overlap ); |
264 | QFontMetrics fm = fontMetrics(); | 264 | QFontMetrics fm = fontMetrics(); |
265 | int x = 0; | 265 | int x = 0; |
266 | QRect r; | 266 | QRect r; |
267 | QTab *t; | 267 | QTab *t; |
268 | int available = width()-1; | 268 | int available = width()-1; |
269 | int required = 0; | 269 | int required = 0; |
270 | for ( int i = 0; i < count(); i++ ) { | 270 | for ( int i = 0; i < count(); i++ ) { |
271 | t = tab(i); | 271 | t = tab(i); |
272 | // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) { | 272 | // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) { |
273 | if ( i != middleTab ) { | 273 | if ( i != middleTab ) { |
274 | // required += hiddenTabWidth + hframe - overlap; | 274 | // required += hiddenTabWidth + hframe - overlap; |
275 | available -= hiddenTabWidth + hframe - overlap; | 275 | available -= hiddenTabWidth + hframe - overlap; |
276 | if ( t->iconSet() != 0 ) | 276 | if ( t->iconSet() != 0 ) |
277 | available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 277 | available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
278 | } else { | 278 | } else { |
279 | required += fm.width( t->text() ) + hframe - overlap; | 279 | required += fm.width( t->text() ) + hframe - overlap; |
280 | if ( t->iconSet() != 0 ) | 280 | if ( t->iconSet() != 0 ) |
281 | required += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 281 | required += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
282 | } | 282 | } |
283 | } | 283 | } |
284 | for ( int i = 0; i < count(); i++ ) { | 284 | for ( int i = 0; i < count(); i++ ) { |
285 | t = tab(i); | 285 | t = tab(i); |
286 | // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) { | 286 | // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) { |
287 | if ( i != middleTab ) { | 287 | if ( i != middleTab ) { |
288 | int w = hiddenTabWidth; | 288 | int w = hiddenTabWidth; |
289 | int ih = 0; | 289 | int ih = 0; |
290 | if ( t->iconSet() != 0 ) { | 290 | if ( t->iconSet() != 0 ) { |
291 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 291 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
292 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 292 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); |
293 | } | 293 | } |
294 | int h = QMAX( fm.height(), ih ); | 294 | int h = QMAX( fm.height(), ih ); |
295 | h = QMAX( h, QApplication::globalStrut().height() ); | 295 | h = QMAX( h, QApplication::globalStrut().height() ); |
296 | 296 | ||
297 | h += vframe; | 297 | h += vframe; |
298 | w += hframe; | 298 | w += hframe; |
299 | 299 | ||
300 | t->setRect( QRect(x, 0, w, h) ); | 300 | t->setRect( QRect(x, 0, w, h) ); |
301 | x += t->rect().width() - overlap; | 301 | x += t->rect().width() - overlap; |
302 | r = r.unite( t->rect() ); | 302 | r = r.unite( t->rect() ); |
303 | } else { | 303 | } else { |
304 | int w = fm.width( t->text() ); | 304 | int w = fm.width( t->text() ); |
305 | int ih = 0; | 305 | int ih = 0; |
306 | if ( t->iconSet() != 0 ) { | 306 | if ( t->iconSet() != 0 ) { |
307 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 307 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
308 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 308 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); |
309 | } | 309 | } |
310 | int h = QMAX( fm.height(), ih ); | 310 | int h = QMAX( fm.height(), ih ); |
311 | h = QMAX( h, QApplication::globalStrut().height() ); | 311 | h = QMAX( h, QApplication::globalStrut().height() ); |
312 | 312 | ||
313 | h += vframe; | 313 | h += vframe; |
314 | w += hframe; | 314 | w += hframe; |
315 | 315 | ||
316 | // t->setRect( QRect(x, 0, w * available/required, h) ); | 316 | // t->setRect( QRect(x, 0, w * available/required, h) ); |
317 | t->setRect( QRect(x, 0, available, h) ); | 317 | t->setRect( QRect(x, 0, available, h) ); |
318 | x += t->rect().width() - overlap; | 318 | x += t->rect().width() - overlap; |
319 | r = r.unite( t->rect() ); | 319 | r = r.unite( t->rect() ); |
320 | } | 320 | } |
321 | } | 321 | } |
322 | 322 | ||
323 | QRect rr = tab(count()-1)->rect(); | 323 | QRect rr = tab(count()-1)->rect(); |
324 | rr.setRight(width()-1); | 324 | rr.setRight(width()-1); |
325 | tab(count()-1)->setRect( rr ); | 325 | tab(count()-1)->setRect( rr ); |
326 | 326 | ||
327 | for ( t = tabList()->first(); t; t = tabList()->next() ) { | 327 | for ( t = tabList()->first(); t; t = tabList()->next() ) { |
328 | QRect tr = t->rect(); | 328 | QRect tr = t->rect(); |
329 | tr.setHeight( r.height() ); | 329 | tr.setHeight( r.height() ); |
330 | t->setRect( tr ); | 330 | t->setRect( tr ); |
331 | } | 331 | } |
332 | 332 | ||
333 | update(); | 333 | update(); |
334 | } | 334 | } |
335 | 335 | ||
336 | 336 | ||
337 | void CategoryTabBar::paint( QPainter * p, QTab * t, bool selected ) const | 337 | void CategoryTabBar::paint( QPainter * p, QTab * t, bool selected ) const |
338 | { | 338 | { |
339 | #if QT_VERSION >= 300 | 339 | #if QT_VERSION >= 300 |
340 | QStyle::SFlags flags = QStyle::Style_Default; | 340 | QStyle::SFlags flags = QStyle::Style_Default; |
341 | if ( selected ) | 341 | if ( selected ) |
342 | flags |= QStyle::Style_Selected; | 342 | flags |= QStyle::Style_Selected; |
343 | style().drawControl( QStyle::CE_TabBarTab, p, this, t->rect(), | 343 | style().drawControl( QStyle::CE_TabBarTab, p, this, t->rect(), |
344 | colorGroup(), flags, QStyleOption(t) ); | 344 | colorGroup(), flags, QStyleOption(t) ); |
345 | #else | 345 | #else |
346 | style().drawTab( p, this, t, selected ); | 346 | style().drawTab( p, this, t, selected ); |
347 | #endif | 347 | #endif |
348 | 348 | ||
349 | QRect r( t->rect() ); | 349 | QRect r( t->rect() ); |
350 | QFont f( font() ); | 350 | QFont f( font() ); |
351 | if ( selected ) | 351 | if ( selected ) |
352 | f.setBold( TRUE ); | 352 | f.setBold( TRUE ); |
353 | p->setFont( f ); | 353 | p->setFont( f ); |
354 | 354 | ||
355 | int iw = 0; | 355 | int iw = 0; |
356 | int ih = 0; | 356 | int ih = 0; |
357 | if ( t->iconSet() != 0 ) { | 357 | if ( t->iconSet() != 0 ) { |
358 | iw = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 2; | 358 | iw = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 2; |
359 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 359 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); |
360 | } | 360 | } |
361 | int w = iw + p->fontMetrics().width( t->text() ) + 4; | 361 | int w = iw + p->fontMetrics().width( t->text() ) + 4; |
362 | int h = QMAX(p->fontMetrics().height() + 4, ih ); | 362 | int h = QMAX(p->fontMetrics().height() + 4, ih ); |
363 | paintLabel( p, QRect( r.left() + (r.width()-w)/2 - 3, | 363 | paintLabel( p, QRect( r.left() + (r.width()-w)/2 - 3, |
364 | r.top() + (r.height()-h)/2, w, h ), t, | 364 | r.top() + (r.height()-h)/2, w, h ), t, |
365 | #if QT_VERSION >= 300 | 365 | #if QT_VERSION >= 300 |
366 | t->identifier() == keyboardFocusTab() | 366 | t->identifier() == keyboardFocusTab() |
367 | #else | 367 | #else |
368 | t->identitifer() == keyboardFocusTab() | 368 | t->identitifer() == keyboardFocusTab() |
369 | #endif | 369 | #endif |
370 | ); | 370 | ); |
371 | } | 371 | } |
372 | 372 | ||
373 | 373 | ||
374 | void CategoryTabBar::paintLabel( QPainter* p, const QRect&, | 374 | void CategoryTabBar::paintLabel( QPainter* p, const QRect&, |
375 | QTab* t, bool has_focus ) const | 375 | QTab* t, bool has_focus ) const |
376 | { | 376 | { |
377 | QRect r = t->rect(); | 377 | QRect r = t->rect(); |
378 | // if ( t->id != currentTab() ) | 378 | // if ( t->id != currentTab() ) |
379 | //r.moveBy( 1, 1 ); | 379 | //r.moveBy( 1, 1 ); |
380 | // | 380 | // |
381 | if ( t->iconSet() ) { | 381 | if ( t->iconSet() ) { |
382 | // the tab has an iconset, draw it in the right mode | 382 | // the tab has an iconset, draw it in the right mode |
383 | QIconSet::Mode mode = (t->isEnabled() && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; | 383 | QIconSet::Mode mode = (t->isEnabled() && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; |
384 | if ( mode == QIconSet::Normal && has_focus ) | 384 | if ( mode == QIconSet::Normal && has_focus ) |
385 | mode = QIconSet::Active; | 385 | mode = QIconSet::Active; |
386 | QPixmap pixmap = t->iconSet()->pixmap( QIconSet::Small, mode ); | 386 | QPixmap pixmap = t->iconSet()->pixmap( QIconSet::Small, mode ); |
387 | int pixw = pixmap.width(); | 387 | int pixw = pixmap.width(); |
388 | int pixh = pixmap.height(); | 388 | int pixh = pixmap.height(); |
389 | p->drawPixmap( r.left() + 6, r.center().y() - pixh / 2 + 1, pixmap ); | 389 | p->drawPixmap( r.left() + 6, r.center().y() - pixh / 2 + 1, pixmap ); |
390 | r.setLeft( r.left() + pixw + 5 ); | 390 | r.setLeft( r.left() + pixw + 5 ); |
391 | } | 391 | } |
392 | 392 | ||
393 | QRect tr = r; | 393 | QRect tr = r; |
394 | 394 | ||
395 | if ( r.width() < 20 ) | 395 | if ( r.width() < 20 ) |
396 | return; | 396 | return; |
397 | 397 | ||
398 | if ( t->isEnabled() && isEnabled() ) { | 398 | if ( t->isEnabled() && isEnabled() ) { |
399 | #if defined(_WS_WIN32_) | 399 | #if defined(_WS_WIN32_) |
400 | if ( colorGroup().brush( QColorGroup::Button ) == colorGroup().brush( QColorGroup::Background ) ) | 400 | if ( colorGroup().brush( QColorGroup::Button ) == colorGroup().brush( QColorGroup::Background ) ) |
401 | p->setPen( colorGroup().buttonText() ); | 401 | p->setPen( colorGroup().buttonText() ); |
402 | else | 402 | else |
403 | p->setPen( colorGroup().foreground() ); | 403 | p->setPen( colorGroup().foreground() ); |
404 | #else | 404 | #else |
405 | p->setPen( colorGroup().foreground() ); | 405 | p->setPen( colorGroup().foreground() ); |
406 | #endif | 406 | #endif |
407 | p->drawText( tr, AlignCenter | AlignVCenter | ShowPrefix, t->text() ); | 407 | p->drawText( tr, AlignCenter | AlignVCenter | ShowPrefix, t->text() ); |
408 | } else { | 408 | } else { |
409 | p->setPen( palette().disabled().foreground() ); | 409 | p->setPen( palette().disabled().foreground() ); |
410 | p->drawText( tr, AlignCenter | AlignVCenter | ShowPrefix, t->text() ); | 410 | p->drawText( tr, AlignCenter | AlignVCenter | ShowPrefix, t->text() ); |
411 | } | 411 | } |
412 | } | 412 | } |
413 | 413 | ||
414 | //--------------------------------------------------------------------------- | 414 | //--------------------------------------------------------------------------- |
415 | 415 | ||
416 | Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) | 416 | Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) |
417 | : QMainWindow( parent, name, fl ) | 417 | : QMainWindow( parent, name, fl ) |
418 | { | 418 | { |
419 | setCaption( tr("Launcher") ); | 419 | setCaption( tr("Launcher") ); |
420 | 420 | ||
421 | syncDialog = 0; | 421 | syncDialog = 0; |
422 | 422 | ||
423 | // we have a pretty good idea how big we'll be | 423 | // we have a pretty good idea how big we'll be |
424 | setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); | 424 | setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); |
425 | 425 | ||
426 | tabs = 0; | 426 | tabs = 0; |
427 | rootFolder = 0; | 427 | rootFolder = 0; |
428 | docsFolder = 0; | 428 | docsFolder = 0; |
429 | int stamp = uidgen.generate(); | 429 | int stamp = uidgen.generate(); |
430 | uidgen.store( stamp ); | 430 | uidgen.store( stamp ); |
431 | m_timeStamp = QString::number( stamp ); | 431 | m_timeStamp = QString::number( stamp ); |
432 | 432 | ||
433 | tabs = new CategoryTabWidget( this ); | 433 | tabs = new CategoryTabWidget( this ); |
434 | tabs->setMaximumWidth( qApp->desktop()->width() ); | 434 | tabs->setMaximumWidth( qApp->desktop()->width() ); |
435 | setCentralWidget( tabs ); | 435 | setCentralWidget( tabs ); |
436 | 436 | ||
437 | connect( tabs, SIGNAL(selected(const QString&)), | 437 | connect( tabs, SIGNAL(selected(const QString&)), |
438 | this, SLOT(viewSelected(const QString&)) ); | 438 | this, SLOT(viewSelected(const QString&)) ); |
439 | connect( tabs, SIGNAL(clicked(const AppLnk*)), | 439 | connect( tabs, SIGNAL(clicked(const AppLnk*)), |
440 | this, SLOT(select(const AppLnk*))); | 440 | this, SLOT(select(const AppLnk*))); |
441 | connect( tabs, SIGNAL(rightPressed(AppLnk*)), | 441 | connect( tabs, SIGNAL(rightPressed(AppLnk*)), |
442 | this, SLOT(properties(AppLnk*))); | 442 | this, SLOT(properties(AppLnk*))); |
443 | 443 | ||
444 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 444 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
445 | QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); | 445 | QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); |
446 | connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 446 | connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
447 | this, SLOT(systemMessage( const QCString &, const QByteArray &)) ); | 447 | this, SLOT(systemMessage( const QCString &, const QByteArray &)) ); |
448 | #endif | 448 | #endif |
449 | 449 | ||
450 | storage = new StorageInfo( this ); | 450 | storage = new StorageInfo( this ); |
451 | connect( storage, SIGNAL( disksChanged() ), SLOT( storageChanged() ) ); | 451 | connect( storage, SIGNAL( disksChanged() ), SLOT( storageChanged() ) ); |
452 | 452 | ||
453 | updateTabs(); | 453 | updateTabs(); |
454 | 454 | ||
455 | preloadApps(); | 455 | preloadApps(); |
456 | 456 | ||
457 | in_lnk_props = FALSE; | 457 | in_lnk_props = FALSE; |
458 | got_lnk_change = FALSE; | 458 | got_lnk_change = FALSE; |
459 | } | 459 | } |
460 | 460 | ||
461 | Launcher::~Launcher() | 461 | Launcher::~Launcher() |
462 | { | 462 | { |
463 | } | 463 | } |
464 | 464 | ||
465 | static bool isVisibleWindow(int wid) | 465 | static bool isVisibleWindow(int wid) |
466 | { | 466 | { |
467 | const QList<QWSWindow> &list = qwsServer->clientWindows(); | 467 | const QList<QWSWindow> &list = qwsServer->clientWindows(); |
468 | QWSWindow* w; | 468 | QWSWindow* w; |
469 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { | 469 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { |
470 | if ( w->winId() == wid ) | 470 | if ( w->winId() == wid ) |
471 | return !w->isFullyObscured(); | 471 | return !w->isFullyObscured(); |
472 | } | 472 | } |
473 | return FALSE; | 473 | return FALSE; |
474 | } | 474 | } |
475 | 475 | ||
476 | void Launcher::showMaximized() | 476 | void Launcher::showMaximized() |
477 | { | 477 | { |
478 | if ( isVisibleWindow( winId() ) ) | 478 | if ( isVisibleWindow( winId() ) ) |
479 | doMaximize(); | 479 | doMaximize(); |
480 | else | 480 | else |
481 | QTimer::singleShot( 20, this, SLOT(doMaximize()) ); | 481 | QTimer::singleShot( 20, this, SLOT(doMaximize()) ); |
482 | } | 482 | } |
483 | 483 | ||
484 | void Launcher::doMaximize() | 484 | void Launcher::doMaximize() |
485 | { | 485 | { |
486 | QMainWindow::showMaximized(); | 486 | QMainWindow::showMaximized(); |
487 | } | 487 | } |
488 | 488 | ||
489 | void Launcher::updateMimeTypes() | 489 | void Launcher::updateMimeTypes() |
490 | { | 490 | { |
491 | MimeType::clear(); | 491 | MimeType::clear(); |
492 | updateMimeTypes(rootFolder); | 492 | updateMimeTypes(rootFolder); |
493 | } | 493 | } |
494 | 494 | ||
495 | void Launcher::updateMimeTypes(AppLnkSet* folder) | 495 | void Launcher::updateMimeTypes(AppLnkSet* folder) |
496 | { | 496 | { |
497 | for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) { | 497 | for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) { |
498 | AppLnk *app = it.current(); | 498 | AppLnk *app = it.current(); |
499 | if ( app->type() == "Folder" ) | 499 | if ( app->type() == "Folder" ) |
500 | updateMimeTypes((AppLnkSet *)app); | 500 | updateMimeTypes((AppLnkSet *)app); |
501 | else { | 501 | else { |
502 | MimeType::registerApp(*app); | 502 | MimeType::registerApp(*app); |
503 | } | 503 | } |
504 | } | 504 | } |
505 | } | 505 | } |
506 | 506 | ||
507 | void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | 507 | void Launcher::loadDocs() // ok here comes a hack belonging to Global:: |
508 | { | 508 | { |
509 | qWarning("loading Documents" ); | 509 | qWarning("loading Documents" ); |
510 | qWarning("The currentTimeStamp is: %s", m_timeStamp.latin1() ); | 510 | qWarning("The currentTimeStamp is: %s", m_timeStamp.latin1() ); |
511 | delete docsFolder; | 511 | delete docsFolder; |
512 | docsFolder = new DocLnkSet; | 512 | docsFolder = new DocLnkSet; |
513 | qWarning("new DocLnkSet" ); | 513 | qWarning("new DocLnkSet" ); |
514 | // find out wich filesystems are new in this round | 514 | // find out wich filesystems are new in this round |
515 | // We will do this by having a timestamp inside each mountpoint | 515 | // We will do this by having a timestamp inside each mountpoint |
516 | // if the current timestamp doesn't match this is a new file system and | 516 | // if the current timestamp doesn't match this is a new file system and |
517 | // come up with our MediumMountGui :) let the hacking begin | 517 | // come up with our MediumMountGui :) let the hacking begin |
518 | int stamp = uidgen.generate(); | 518 | int stamp = uidgen.generate(); |
519 | 519 | ||
520 | QString newStamp = QString::number( stamp ); | 520 | QString newStamp = QString::number( stamp ); |
521 | qWarning("new time stamp is: %s", newStamp.latin1() ); | 521 | qWarning("new time stamp is: %s", newStamp.latin1() ); |
522 | StorageInfo storage; | 522 | StorageInfo storage; |
523 | const QList<FileSystem> &fileSystems = storage.fileSystems(); | 523 | const QList<FileSystem> &fileSystems = storage.fileSystems(); |
524 | qWarning("QList<FileSystem>" ); | 524 | qWarning("QList<FileSystem>" ); |
525 | QListIterator<FileSystem> it ( fileSystems ); | 525 | QListIterator<FileSystem> it ( fileSystems ); |
526 | qWarning("iterator initiliazed" ); | 526 | qWarning("iterator initiliazed" ); |
527 | for ( ; it.current(); ++it ) { | 527 | for ( ; it.current(); ++it ) { |
528 | qWarning("inside for loop" ); | 528 | qWarning("inside for loop" ); |
529 | qWarning("checking device %s", (*it)->path().latin1() ); | 529 | qWarning("checking device %s", (*it)->path().latin1() ); |
530 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it | 530 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it |
531 | qWarning("%s is removeable", (*it)->path().latin1() ); | 531 | qWarning("%s is removeable", (*it)->path().latin1() ); |
532 | OConfig cfg( (*it)->path() + "/.opiestorage.cf"); | 532 | OConfig cfg( (*it)->path() + "/.opiestorage.cf"); |
533 | cfg.setGroup("main"); | 533 | cfg.setGroup("main"); |
534 | QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() ); | 534 | QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() ); |
535 | if( stamp == m_timeStamp ){ // ok we know this card | 535 | if( stamp == m_timeStamp ){ // ok we know this card |
536 | qWarning("time stamp match" ); | 536 | qWarning("time stamp match" ); |
537 | cfg.writeEntry("timestamp", newStamp ); | 537 | cfg.writeEntry("timestamp", newStamp ); |
538 | // we need to scan the list now. Hopefully the cache will be there | 538 | // we need to scan the list now. Hopefully the cache will be there |
539 | }else{ // come up with the gui | 539 | }else{ // come up with the gui |
540 | qWarning("time stamp doesn't match" ); | 540 | qWarning("time stamp doesn't match" ); |
541 | MediumMountGui medium((*it)->path() ); | 541 | MediumMountGui medium((*it)->path() ); |
542 | qWarning("medium mount gui created" ); | 542 | qWarning("medium mount gui created" ); |
543 | if( medium.check() ){ | 543 | if( medium.check() ){ |
544 | qWarning("need to check this device" ); | 544 | qWarning("need to check this device" ); |
545 | if( medium.exec() ){ //ok | 545 | if( medium.exec() ){ //ok |
546 | // speicher | 546 | // speicher |
547 | qWarning("execed" ); | 547 | qWarning("execed" ); |
548 | cfg.read(); | ||
548 | cfg.writeEntry("timestamp", newStamp ); | 549 | cfg.writeEntry("timestamp", newStamp ); |
549 | } | 550 | } |
550 | }else{ | 551 | }else{ |
551 | qWarning("wrong :(" ); | 552 | qWarning("wrong :(" ); |
552 | // do something different see what we need to do | 553 | // do something different see what we need to do |
553 | } | 554 | } |
554 | } | 555 | } |
555 | } | 556 | } |
556 | } | 557 | } |
557 | qWarning("findDocuments" ); | 558 | qWarning("findDocuments" ); |
558 | Global::findDocuments(docsFolder); // get rid of this call later | 559 | Global::findDocuments(docsFolder); // get rid of this call later |
559 | qWarning("done" ); | 560 | qWarning("done" ); |
560 | m_timeStamp = newStamp; | 561 | m_timeStamp = newStamp; |
561 | } | 562 | } |
562 | 563 | ||
563 | void Launcher::updateTabs() | 564 | void Launcher::updateTabs() |
564 | { | 565 | { |
565 | MimeType::updateApplications(); // ### reads all applnks twice | 566 | MimeType::updateApplications(); // ### reads all applnks twice |
566 | 567 | ||
567 | delete rootFolder; | 568 | delete rootFolder; |
568 | rootFolder = new AppLnkSet( MimeType::appsFolderName() ); | 569 | rootFolder = new AppLnkSet( MimeType::appsFolderName() ); |
569 | 570 | ||
570 | loadDocs(); | 571 | loadDocs(); |
571 | 572 | ||
572 | tabs->initializeCategories(rootFolder, docsFolder, storage->fileSystems()); | 573 | tabs->initializeCategories(rootFolder, docsFolder, storage->fileSystems()); |
573 | } | 574 | } |
574 | 575 | ||
575 | void Launcher::updateDocs() | 576 | void Launcher::updateDocs() |
576 | { | 577 | { |
577 | loadDocs(); | 578 | loadDocs(); |
578 | tabs->updateDocs(docsFolder,storage->fileSystems()); | 579 | tabs->updateDocs(docsFolder,storage->fileSystems()); |
579 | } | 580 | } |
580 | 581 | ||
581 | void Launcher::viewSelected(const QString& s) | 582 | void Launcher::viewSelected(const QString& s) |
582 | { | 583 | { |
583 | setCaption( s + tr(" - Launcher") ); | 584 | setCaption( s + tr(" - Launcher") ); |
584 | } | 585 | } |
585 | 586 | ||
586 | void Launcher::nextView() | 587 | void Launcher::nextView() |
587 | { | 588 | { |
588 | tabs->nextTab(); | 589 | tabs->nextTab(); |
589 | } | 590 | } |
590 | 591 | ||
591 | 592 | ||
592 | void Launcher::select( const AppLnk *appLnk ) | 593 | void Launcher::select( const AppLnk *appLnk ) |
593 | { | 594 | { |
594 | if ( appLnk->type() == "Folder" ) { | 595 | if ( appLnk->type() == "Folder" ) { |
595 | // Not supported: flat is simpler for the user | 596 | // Not supported: flat is simpler for the user |
596 | } else { | 597 | } else { |
597 | if ( appLnk->exec().isNull() ) { | 598 | if ( appLnk->exec().isNull() ) { |
598 | QMessageBox::information(this,tr("No application"), | 599 | QMessageBox::information(this,tr("No application"), |
599 | tr("<p>No application is defined for this document." | 600 | tr("<p>No application is defined for this document." |
600 | "<p>Type is %1.").arg(appLnk->type())); | 601 | "<p>Type is %1.").arg(appLnk->type())); |
601 | return; | 602 | return; |
602 | } | 603 | } |
603 | tabs->setBusy(TRUE); | 604 | tabs->setBusy(TRUE); |
604 | emit executing( appLnk ); | 605 | emit executing( appLnk ); |
605 | appLnk->execute(); | 606 | appLnk->execute(); |
606 | } | 607 | } |
607 | } | 608 | } |
608 | 609 | ||
609 | void Launcher::externalSelected(const AppLnk *appLnk) | 610 | void Launcher::externalSelected(const AppLnk *appLnk) |
610 | { | 611 | { |
611 | tabs->setBusy(TRUE); | 612 | tabs->setBusy(TRUE); |
612 | emit executing( appLnk ); | 613 | emit executing( appLnk ); |
613 | } | 614 | } |
614 | 615 | ||
615 | void Launcher::properties( AppLnk *appLnk ) | 616 | void Launcher::properties( AppLnk *appLnk ) |
616 | { | 617 | { |
617 | if ( appLnk->type() == "Folder" ) { | 618 | if ( appLnk->type() == "Folder" ) { |
618 | // Not supported: flat is simpler for the user | 619 | // Not supported: flat is simpler for the user |
619 | } else { | 620 | } else { |
620 | in_lnk_props = TRUE; | 621 | in_lnk_props = TRUE; |
621 | got_lnk_change = FALSE; | 622 | got_lnk_change = FALSE; |
622 | LnkProperties prop(appLnk); | 623 | LnkProperties prop(appLnk); |
623 | connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); | 624 | connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); |
624 | prop.showMaximized(); | 625 | prop.showMaximized(); |
625 | prop.exec(); | 626 | prop.exec(); |
626 | in_lnk_props = FALSE; | 627 | in_lnk_props = FALSE; |
627 | if ( got_lnk_change ) { | 628 | if ( got_lnk_change ) { |
628 | updateLink(lnk_change); | 629 | updateLink(lnk_change); |
629 | } | 630 | } |
630 | } | 631 | } |
631 | } | 632 | } |
632 | 633 | ||
633 | void Launcher::updateLink(const QString& link) | 634 | void Launcher::updateLink(const QString& link) |
634 | { | 635 | { |
635 | if (link.isNull()) | 636 | if (link.isNull()) |
636 | updateTabs(); | 637 | updateTabs(); |
637 | else if (link.isEmpty()) | 638 | else if (link.isEmpty()) |
638 | updateDocs(); | 639 | updateDocs(); |
639 | else | 640 | else |
640 | tabs->updateLink(link); | 641 | tabs->updateLink(link); |
641 | } | 642 | } |
642 | 643 | ||
643 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | 644 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) |
644 | { | 645 | { |
645 | QDataStream stream( data, IO_ReadOnly ); | 646 | QDataStream stream( data, IO_ReadOnly ); |
646 | if ( msg == "linkChanged(QString)" ) { | 647 | if ( msg == "linkChanged(QString)" ) { |
647 | QString link; | 648 | QString link; |
648 | stream >> link; | 649 | stream >> link; |
649 | if ( in_lnk_props ) { | 650 | if ( in_lnk_props ) { |
650 | got_lnk_change = TRUE; | 651 | got_lnk_change = TRUE; |
651 | lnk_change = link; | 652 | lnk_change = link; |
652 | } else { | 653 | } else { |
653 | updateLink(link); | 654 | updateLink(link); |
654 | } | 655 | } |
655 | } else if ( msg == "busy()" ) { | 656 | } else if ( msg == "busy()" ) { |
656 | emit busy(); | 657 | emit busy(); |
657 | } else if ( msg == "notBusy(QString)" ) { | 658 | } else if ( msg == "notBusy(QString)" ) { |
658 | QString app; | 659 | QString app; |
659 | stream >> app; | 660 | stream >> app; |
660 | tabs->setBusy(FALSE); | 661 | tabs->setBusy(FALSE); |
661 | emit notBusy(app); | 662 | emit notBusy(app); |
662 | } else if ( msg == "mkdir(QString)" ) { | 663 | } else if ( msg == "mkdir(QString)" ) { |
663 | QString dir; | 664 | QString dir; |
664 | stream >> dir; | 665 | stream >> dir; |
665 | if ( !dir.isEmpty() ) | 666 | if ( !dir.isEmpty() ) |
666 | mkdir( dir ); | 667 | mkdir( dir ); |
667 | } else if ( msg == "rdiffGenSig(QString,QString)" ) { | 668 | } else if ( msg == "rdiffGenSig(QString,QString)" ) { |
668 | QString baseFile, sigFile; | 669 | QString baseFile, sigFile; |
669 | stream >> baseFile >> sigFile; | 670 | stream >> baseFile >> sigFile; |
670 | QRsync::generateSignature( baseFile, sigFile ); | 671 | QRsync::generateSignature( baseFile, sigFile ); |
671 | } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) { | 672 | } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) { |
672 | QString baseFile, sigFile, deltaFile; | 673 | QString baseFile, sigFile, deltaFile; |
673 | stream >> baseFile >> sigFile >> deltaFile; | 674 | stream >> baseFile >> sigFile >> deltaFile; |
674 | QRsync::generateDiff( baseFile, sigFile, deltaFile ); | 675 | QRsync::generateDiff( baseFile, sigFile, deltaFile ); |
675 | } else if ( msg == "rdiffApplyPatch(QString,QString)" ) { | 676 | } else if ( msg == "rdiffApplyPatch(QString,QString)" ) { |
676 | QString baseFile, deltaFile; | 677 | QString baseFile, deltaFile; |
677 | stream >> baseFile >> deltaFile; | 678 | stream >> baseFile >> deltaFile; |
678 | if ( !QFile::exists( baseFile ) ) { | 679 | if ( !QFile::exists( baseFile ) ) { |
679 | QFile f( baseFile ); | 680 | QFile f( baseFile ); |
680 | f.open( IO_WriteOnly ); | 681 | f.open( IO_WriteOnly ); |
681 | f.close(); | 682 | f.close(); |
682 | } | 683 | } |
683 | QRsync::applyDiff( baseFile, deltaFile ); | 684 | QRsync::applyDiff( baseFile, deltaFile ); |
684 | QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" ); | 685 | QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" ); |
685 | e << baseFile; | 686 | e << baseFile; |
686 | } else if ( msg == "rdiffCleanup()" ) { | 687 | } else if ( msg == "rdiffCleanup()" ) { |
687 | mkdir( "/tmp/rdiff" ); | 688 | mkdir( "/tmp/rdiff" ); |
688 | QDir dir; | 689 | QDir dir; |
689 | dir.setPath( "/tmp/rdiff" ); | 690 | dir.setPath( "/tmp/rdiff" ); |
690 | QStringList entries = dir.entryList(); | 691 | QStringList entries = dir.entryList(); |
691 | for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) | 692 | for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) |
692 | dir.remove( *it ); | 693 | dir.remove( *it ); |
693 | } else if ( msg == "sendHandshakeInfo()" ) { | 694 | } else if ( msg == "sendHandshakeInfo()" ) { |
694 | QString home = getenv( "HOME" ); | 695 | QString home = getenv( "HOME" ); |
695 | QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" ); | 696 | QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" ); |
696 | e << home; | 697 | e << home; |
697 | int locked = (int) Desktop::screenLocked(); | 698 | int locked = (int) Desktop::screenLocked(); |
698 | e << locked; | 699 | e << locked; |
699 | // register an app for autostart | 700 | // register an app for autostart |
700 | // if clear is send the list is cleared. | 701 | // if clear is send the list is cleared. |
701 | } else if ( msg == "autoStart(QString)" ) { | 702 | } else if ( msg == "autoStart(QString)" ) { |
702 | QString appName; | 703 | QString appName; |
703 | stream >> appName; | 704 | stream >> appName; |
704 | Config cfg( "autostart" ); | 705 | Config cfg( "autostart" ); |
705 | cfg.setGroup( "AutoStart" ); | 706 | cfg.setGroup( "AutoStart" ); |
706 | if ( appName.compare("clear") == 0){ | 707 | if ( appName.compare("clear") == 0){ |
707 | cfg.writeEntry("Apps", ""); | 708 | cfg.writeEntry("Apps", ""); |
708 | } | 709 | } |
709 | } else if ( msg == "autoStart(QString,QString)" ) { | 710 | } else if ( msg == "autoStart(QString,QString)" ) { |
710 | QString modifier, appName; | 711 | QString modifier, appName; |
711 | stream >> modifier >> appName; | 712 | stream >> modifier >> appName; |
712 | Config cfg( "autostart" ); | 713 | Config cfg( "autostart" ); |
713 | cfg.setGroup( "AutoStart" ); | 714 | cfg.setGroup( "AutoStart" ); |
714 | if ( modifier.compare("add") == 0 ){ | 715 | if ( modifier.compare("add") == 0 ){ |
715 | // only add it appname is entered | 716 | // only add it appname is entered |
716 | if (!appName.isEmpty()) { | 717 | if (!appName.isEmpty()) { |
717 | cfg.writeEntry("Apps", appName); | 718 | cfg.writeEntry("Apps", appName); |
718 | } | 719 | } |
719 | } else if (modifier.compare("remove") == 0 ) { | 720 | } else if (modifier.compare("remove") == 0 ) { |
720 | // need to change for multiple entries | 721 | // need to change for multiple entries |
721 | // actually remove is right now simular to clear, but in future there | 722 | // actually remove is right now simular to clear, but in future there |
722 | // should be multiple apps in autostart possible. | 723 | // should be multiple apps in autostart possible. |
723 | QString checkName; | 724 | QString checkName; |
724 | checkName = cfg.readEntry("Apps", ""); | 725 | checkName = cfg.readEntry("Apps", ""); |
725 | if (checkName == appName) { | 726 | if (checkName == appName) { |
726 | cfg.writeEntry("Apps", ""); | 727 | cfg.writeEntry("Apps", ""); |
727 | } | 728 | } |
728 | } | 729 | } |
729 | } else if ( msg == "sendCardInfo()" ) { | 730 | } else if ( msg == "sendCardInfo()" ) { |
730 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); | 731 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); |
731 | const QList<FileSystem> &fs = storage->fileSystems(); | 732 | const QList<FileSystem> &fs = storage->fileSystems(); |
732 | QListIterator<FileSystem> it ( fs ); | 733 | QListIterator<FileSystem> it ( fs ); |
733 | QString s; | 734 | QString s; |
734 | QString homeDir = getenv("HOME"); | 735 | QString homeDir = getenv("HOME"); |
735 | QString hardDiskHome; | 736 | QString hardDiskHome; |
736 | for ( ; it.current(); ++it ) { | 737 | for ( ; it.current(); ++it ) { |
737 | if ( (*it)->isRemovable() ) | 738 | if ( (*it)->isRemovable() ) |
738 | s += (*it)->name() + "=" + (*it)->path() + "/Documents " | 739 | s += (*it)->name() + "=" + (*it)->path() + "/Documents " |
739 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) | 740 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) |
740 | + " " + (*it)->options() + ";"; | 741 | + " " + (*it)->options() + ";"; |
741 | else if ( (*it)->disk() == "/dev/mtdblock1" || | 742 | else if ( (*it)->disk() == "/dev/mtdblock1" || |
742 | (*it)->disk() == "/dev/mtdblock/1" ) | 743 | (*it)->disk() == "/dev/mtdblock/1" ) |
743 | s += (*it)->name() + "=" + homeDir + "/Documents " | 744 | s += (*it)->name() + "=" + homeDir + "/Documents " |
744 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) | 745 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) |
745 | + " " + (*it)->options() + ";"; | 746 | + " " + (*it)->options() + ";"; |
746 | else if ( (*it)->name().contains( "Hard Disk") && | 747 | else if ( (*it)->name().contains( "Hard Disk") && |
747 | homeDir.contains( (*it)->path() ) && | 748 | homeDir.contains( (*it)->path() ) && |
748 | (*it)->path().length() > hardDiskHome.length() ) | 749 | (*it)->path().length() > hardDiskHome.length() ) |
749 | hardDiskHome = | 750 | hardDiskHome = |
750 | (*it)->name() + "=" + homeDir + "/Documents " | 751 | (*it)->name() + "=" + homeDir + "/Documents " |
751 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) | 752 | + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) |
752 | + " " + (*it)->options() + ";"; | 753 | + " " + (*it)->options() + ";"; |
753 | } | 754 | } |
754 | if ( !hardDiskHome.isEmpty() ) | 755 | if ( !hardDiskHome.isEmpty() ) |
755 | s += hardDiskHome; | 756 | s += hardDiskHome; |
756 | 757 | ||
757 | e << s; | 758 | e << s; |
758 | } else if ( msg == "sendSyncDate(QString)" ) { | 759 | } else if ( msg == "sendSyncDate(QString)" ) { |
759 | QString app; | 760 | QString app; |
760 | stream >> app; | 761 | stream >> app; |
761 | Config cfg( "qpe" ); | 762 | Config cfg( "qpe" ); |
762 | cfg.setGroup("SyncDate"); | 763 | cfg.setGroup("SyncDate"); |
763 | QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); | 764 | QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); |
764 | e << app << cfg.readEntry( app ); | 765 | e << app << cfg.readEntry( app ); |
765 | //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(), | 766 | //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(), |
766 | //cfg.readEntry( app ).latin1() ); | 767 | //cfg.readEntry( app ).latin1() ); |
767 | } else if ( msg == "setSyncDate(QString,QString)" ) { | 768 | } else if ( msg == "setSyncDate(QString,QString)" ) { |
768 | QString app, date; | 769 | QString app, date; |
769 | stream >> app >> date; | 770 | stream >> app >> date; |
770 | Config cfg( "qpe" ); | 771 | Config cfg( "qpe" ); |
771 | cfg.setGroup("SyncDate"); | 772 | cfg.setGroup("SyncDate"); |
772 | cfg.writeEntry( app, date ); | 773 | cfg.writeEntry( app, date ); |
773 | //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1()); | 774 | //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1()); |
774 | } else if ( msg == "startSync(QString)" ) { | 775 | } else if ( msg == "startSync(QString)" ) { |
775 | QString what; | 776 | QString what; |
776 | stream >> what; | 777 | stream >> what; |
777 | delete syncDialog; syncDialog = 0; | 778 | delete syncDialog; syncDialog = 0; |
778 | syncDialog = new SyncDialog( this, "syncProgress", FALSE, | 779 | syncDialog = new SyncDialog( this, "syncProgress", FALSE, |
779 | WStyle_Tool | WStyle_Customize | | 780 | WStyle_Tool | WStyle_Customize | |
780 | Qt::WStyle_StaysOnTop ); | 781 | Qt::WStyle_StaysOnTop ); |
781 | syncDialog->showMaximized(); | 782 | syncDialog->showMaximized(); |
782 | syncDialog->whatLabel->setText( "<b>" + what + "</b>" ); | 783 | syncDialog->whatLabel->setText( "<b>" + what + "</b>" ); |
783 | connect( syncDialog->buttonCancel, SIGNAL( clicked() ), | 784 | connect( syncDialog->buttonCancel, SIGNAL( clicked() ), |
784 | SLOT( cancelSync() ) ); | 785 | SLOT( cancelSync() ) ); |
785 | } | 786 | } |
786 | else if ( msg == "stopSync()") { | 787 | else if ( msg == "stopSync()") { |
787 | delete syncDialog; syncDialog = 0; | 788 | delete syncDialog; syncDialog = 0; |
788 | } else if ( msg == "getAllDocLinks()" ) { | 789 | } else if ( msg == "getAllDocLinks()" ) { |
789 | loadDocs(); | 790 | loadDocs(); |
790 | 791 | ||
791 | QString contents; | 792 | QString contents; |
792 | 793 | ||
793 | for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) { | 794 | for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) { |
794 | DocLnk *doc = it.current(); | 795 | DocLnk *doc = it.current(); |
795 | QFileInfo fi( doc->file() ); | 796 | QFileInfo fi( doc->file() ); |
796 | if ( !fi.exists() ) | 797 | if ( !fi.exists() ) |
797 | continue; | 798 | continue; |
798 | 799 | ||
799 | bool fake = !doc->linkFileKnown(); | 800 | bool fake = !doc->linkFileKnown(); |
800 | if ( !fake ) { | 801 | if ( !fake ) { |
801 | QFile f( doc->linkFile() ); | 802 | QFile f( doc->linkFile() ); |
802 | if ( f.open( IO_ReadOnly ) ) { | 803 | if ( f.open( IO_ReadOnly ) ) { |
803 | QTextStream ts( &f ); | 804 | QTextStream ts( &f ); |
804 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | 805 | ts.setEncoding( QTextStream::UnicodeUTF8 ); |
805 | contents += ts.read(); | 806 | contents += ts.read(); |
806 | f.close(); | 807 | f.close(); |
807 | } else | 808 | } else |
808 | fake = TRUE; | 809 | fake = TRUE; |
809 | } | 810 | } |
810 | if (fake) { | 811 | if (fake) { |
811 | contents += "[Desktop Entry]\n"; | 812 | contents += "[Desktop Entry]\n"; |
812 | contents += "Categories = " + Qtopia::Record::idsToString( doc->categories() ) + "\n"; | 813 | contents += "Categories = " + Qtopia::Record::idsToString( doc->categories() ) + "\n"; |
813 | contents += "File = "+doc->file()+"\n"; | 814 | contents += "File = "+doc->file()+"\n"; |
814 | contents += "Name = "+doc->name()+"\n"; | 815 | contents += "Name = "+doc->name()+"\n"; |
815 | contents += "Type = "+doc->type()+"\n"; | 816 | contents += "Type = "+doc->type()+"\n"; |
816 | } | 817 | } |
817 | contents += QString("Size = %1\n").arg( fi.size() ); | 818 | contents += QString("Size = %1\n").arg( fi.size() ); |
818 | } | 819 | } |
819 | 820 | ||
820 | //qDebug( "sending length %d", contents.length() ); | 821 | //qDebug( "sending length %d", contents.length() ); |
821 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); | 822 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); |
822 | e << contents; | 823 | e << contents; |
823 | 824 | ||
824 | qDebug( "================ \n\n%s\n\n===============", | 825 | qDebug( "================ \n\n%s\n\n===============", |
825 | contents.latin1() ); | 826 | contents.latin1() ); |
826 | 827 | ||
827 | delete docsFolder; | 828 | delete docsFolder; |
828 | docsFolder = 0; | 829 | docsFolder = 0; |
829 | } | 830 | } |
830 | } | 831 | } |
831 | 832 | ||
832 | void Launcher::cancelSync() | 833 | void Launcher::cancelSync() |
833 | { | 834 | { |
834 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); | 835 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); |
835 | } | 836 | } |
836 | 837 | ||
837 | void Launcher::storageChanged() | 838 | void Launcher::storageChanged() |
838 | { | 839 | { |
839 | if ( in_lnk_props ) { | 840 | if ( in_lnk_props ) { |
840 | got_lnk_change = TRUE; | 841 | got_lnk_change = TRUE; |
841 | lnk_change = ""; | 842 | lnk_change = ""; |
842 | } else { | 843 | } else { |
843 | updateDocs(); | 844 | updateDocs(); |
844 | } | 845 | } |
845 | } | 846 | } |
846 | 847 | ||
847 | 848 | ||
848 | bool Launcher::mkdir(const QString &localPath) | 849 | bool Launcher::mkdir(const QString &localPath) |
849 | { | 850 | { |
850 | QDir fullDir(localPath); | 851 | QDir fullDir(localPath); |
851 | if (fullDir.exists()) | 852 | if (fullDir.exists()) |
852 | return true; | 853 | return true; |
853 | 854 | ||
854 | // at this point the directory doesn't exist | 855 | // at this point the directory doesn't exist |
855 | // go through the directory tree and start creating the direcotories | 856 | // go through the directory tree and start creating the direcotories |
856 | // that don't exist; if we can't create the directories, return false | 857 | // that don't exist; if we can't create the directories, return false |
857 | 858 | ||
858 | QString dirSeps = "/"; | 859 | QString dirSeps = "/"; |
859 | int dirIndex = localPath.find(dirSeps); | 860 | int dirIndex = localPath.find(dirSeps); |
860 | QString checkedPath; | 861 | QString checkedPath; |
861 | 862 | ||
862 | // didn't find any seps; weird, use the cur dir instead | 863 | // didn't find any seps; weird, use the cur dir instead |
863 | if (dirIndex == -1) { | 864 | if (dirIndex == -1) { |
864 | //qDebug("No seperators found in path %s", localPath.latin1()); | 865 | //qDebug("No seperators found in path %s", localPath.latin1()); |
865 | checkedPath = QDir::currentDirPath(); | 866 | checkedPath = QDir::currentDirPath(); |
866 | } | 867 | } |
867 | 868 | ||
868 | while (checkedPath != localPath) { | 869 | while (checkedPath != localPath) { |
869 | // no more seperators found, use the local path | 870 | // no more seperators found, use the local path |
870 | if (dirIndex == -1) | 871 | if (dirIndex == -1) |
871 | checkedPath = localPath; | 872 | checkedPath = localPath; |
872 | else { | 873 | else { |
873 | // the next directory to check | 874 | // the next directory to check |
874 | checkedPath = localPath.left(dirIndex) + "/"; | 875 | checkedPath = localPath.left(dirIndex) + "/"; |
875 | // advance the iterator; the next dir seperator | 876 | // advance the iterator; the next dir seperator |
876 | dirIndex = localPath.find(dirSeps, dirIndex+1); | 877 | dirIndex = localPath.find(dirSeps, dirIndex+1); |
877 | } | 878 | } |
878 | 879 | ||
879 | QDir checkDir(checkedPath); | 880 | QDir checkDir(checkedPath); |
880 | if (!checkDir.exists()) { | 881 | if (!checkDir.exists()) { |
881 | //qDebug("mkdir making dir %s", checkedPath.latin1()); | 882 | //qDebug("mkdir making dir %s", checkedPath.latin1()); |
882 | 883 | ||
883 | if (!checkDir.mkdir(checkedPath)) { | 884 | if (!checkDir.mkdir(checkedPath)) { |
884 | qDebug("Unable to make directory %s", checkedPath.latin1()); | 885 | qDebug("Unable to make directory %s", checkedPath.latin1()); |
885 | return FALSE; | 886 | return FALSE; |
886 | } | 887 | } |
887 | } | 888 | } |
888 | 889 | ||
889 | } | 890 | } |
890 | return TRUE; | 891 | return TRUE; |
891 | } | 892 | } |
892 | 893 | ||
893 | void Launcher::preloadApps() | 894 | void Launcher::preloadApps() |
894 | { | 895 | { |
895 | Config cfg("Launcher"); | 896 | Config cfg("Launcher"); |
896 | cfg.setGroup("Preload"); | 897 | cfg.setGroup("Preload"); |
897 | QStringList apps = cfg.readListEntry("Apps",','); | 898 | QStringList apps = cfg.readListEntry("Apps",','); |
898 | for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { | 899 | for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { |
899 | QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); | 900 | QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); |
900 | } | 901 | } |
901 | } | 902 | } |
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp index 5225711..e3fa5bd 100644 --- a/core/launcher/mediummountgui.cpp +++ b/core/launcher/mediummountgui.cpp | |||
@@ -1,232 +1,233 @@ | |||
1 | 1 | ||
2 | #include "mediummountgui.h" | 2 | #include "mediummountgui.h" |
3 | 3 | ||
4 | #include <qvariant.h> | 4 | #include <qvariant.h> |
5 | #include <qcheckbox.h> | 5 | #include <qcheckbox.h> |
6 | #include <qgroupbox.h> | 6 | #include <qgroupbox.h> |
7 | #include <qlabel.h> | 7 | #include <qlabel.h> |
8 | #include <qlineedit.h> | 8 | #include <qlineedit.h> |
9 | #include <qpushbutton.h> | 9 | #include <qpushbutton.h> |
10 | #include <qlayout.h> | 10 | #include <qlayout.h> |
11 | #include <qtooltip.h> | 11 | #include <qtooltip.h> |
12 | #include <qwhatsthis.h> | 12 | #include <qwhatsthis.h> |
13 | #include <qimage.h> | 13 | #include <qimage.h> |
14 | #include <qpixmap.h> | 14 | #include <qpixmap.h> |
15 | 15 | ||
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <opie/oconfig.h> | 17 | #include <opie/oconfig.h> |
18 | 18 | ||
19 | 19 | ||
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | 21 | ||
22 | 22 | ||
23 | MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl ) | 23 | MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl ) |
24 | : QDialog( parent, name, true ) { | 24 | : QDialog( parent, name, true ) { |
25 | 25 | ||
26 | 26 | ||
27 | QWidget *d = QApplication::desktop(); | 27 | QWidget *d = QApplication::desktop(); |
28 | int w=d->width(); | 28 | int w=d->width(); |
29 | int h=d->height(); | 29 | int h=d->height(); |
30 | resize( w , h ); | 30 | resize( w , h ); |
31 | setCaption( tr( "Medium inserted" ) ); | 31 | setCaption( tr( "Medium inserted" ) ); |
32 | 32 | ||
33 | mediumPath = path; | 33 | mediumPath = path; |
34 | readConfig(); | 34 | readConfig(); |
35 | startGui(); | 35 | startGui(); |
36 | } | 36 | } |
37 | 37 | ||
38 | void MediumMountGui::readConfig(){ | 38 | void MediumMountGui::readConfig(){ |
39 | 39 | ||
40 | OConfig cfg (mediumPath +"/.opiestorage.cf"); | 40 | OConfig cfg (mediumPath +"/.opiestorage.cf"); |
41 | cfg.setGroup("main"); | 41 | cfg.setGroup("main"); |
42 | checkagain = cfg.readBoolEntry("check", false); | 42 | checkagain = cfg.readBoolEntry("check", false); |
43 | 43 | ||
44 | cfg.setGroup("mimetypes"); | 44 | cfg.setGroup("mimetypes"); |
45 | checkmimeaudio = cfg.readBoolEntry("audio", true); | 45 | checkmimeaudio = cfg.readBoolEntry("audio", true); |
46 | checkmimeimage = cfg.readBoolEntry("image", true); | 46 | checkmimeimage = cfg.readBoolEntry("image", true); |
47 | checkmimetext = cfg.readBoolEntry("text", true); | 47 | checkmimetext = cfg.readBoolEntry("text", true); |
48 | checkmimevideo = cfg.readBoolEntry("video", true); | 48 | checkmimevideo = cfg.readBoolEntry("video", true); |
49 | checkmimeall = cfg.readBoolEntry("all", true); | 49 | checkmimeall = cfg.readBoolEntry("all", true); |
50 | 50 | ||
51 | cfg.setGroup("dirs"); | 51 | cfg.setGroup("dirs"); |
52 | limittodirs = cfg.readEntry("dirs", ""); | 52 | limittodirs = cfg.readEntry("dirs", ""); |
53 | } | 53 | } |
54 | 54 | ||
55 | bool MediumMountGui::check() { | 55 | bool MediumMountGui::check() { |
56 | return !checkagain; | 56 | return !checkagain; |
57 | } | 57 | } |
58 | 58 | ||
59 | QStringList MediumMountGui::dirs() { | 59 | QStringList MediumMountGui::dirs() { |
60 | QStringList list = QStringList::split(",", limittodirs ); | 60 | QStringList list = QStringList::split(",", limittodirs ); |
61 | return list; | 61 | return list; |
62 | } | 62 | } |
63 | 63 | ||
64 | void MediumMountGui::writeConfig(bool autocheck) { | 64 | void MediumMountGui::writeConfig(bool autocheck) { |
65 | 65 | ||
66 | OConfig cfg (mediumPath +"/.opiestorage.cf"); | 66 | OConfig cfg (mediumPath +"/.opiestorage.cf"); |
67 | cfg.setGroup("main"); | 67 | cfg.setGroup("main"); |
68 | cfg.writeEntry("check", AskBox->isChecked() ); | 68 | cfg.writeEntry("check", AskBox->isChecked() ); |
69 | cfg.writeEntry("autocheck", autocheck ); | 69 | cfg.writeEntry("autocheck", autocheck ); |
70 | 70 | ||
71 | cfg.setGroup("mimetypes"); | 71 | cfg.setGroup("mimetypes"); |
72 | 72 | ||
73 | cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); | 73 | cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); |
74 | cfg.writeEntry("image",CheckBoxImage->isChecked() ); | 74 | cfg.writeEntry("image",CheckBoxImage->isChecked() ); |
75 | cfg.writeEntry("text",CheckBoxImage->isChecked() ); | 75 | cfg.writeEntry("text",CheckBoxImage->isChecked() ); |
76 | cfg.writeEntry("video",CheckBoxVideo->isChecked() ); | 76 | cfg.writeEntry("video",CheckBoxVideo->isChecked() ); |
77 | cfg.writeEntry("all",CheckBoxAll->isChecked() ); | 77 | cfg.writeEntry("all",CheckBoxAll->isChecked() ); |
78 | 78 | ||
79 | cfg.setGroup("dirs"); | 79 | cfg.setGroup("dirs"); |
80 | cfg.writeEntry("dirs", ""); | 80 | cfg.writeEntry("dirs", ""); |
81 | 81 | ||
82 | 82 | ||
83 | // if all is checked then add only "null" to the list. | 83 | // if all is checked then add only "null" to the list. |
84 | if (checkmimeall) { | 84 | if (checkmimeall) { |
85 | mimeTypeList += ("null"); | 85 | mimeTypeList += ("null"); |
86 | } else { | 86 | } else { |
87 | if (checkmimeaudio) { | 87 | if (checkmimeaudio) { |
88 | mimeTypeList += ("audio//*"); | 88 | mimeTypeList += ("audio//*"); |
89 | } | 89 | } |
90 | if (checkmimetext) { | 90 | if (checkmimetext) { |
91 | mimeTypeList += ("text//*"); | 91 | mimeTypeList += ("text//*"); |
92 | } | 92 | } |
93 | if (checkmimevideo) { | 93 | if (checkmimevideo) { |
94 | mimeTypeList += ("video//*"); | 94 | mimeTypeList += ("video//*"); |
95 | } | 95 | } |
96 | if (checkmimeimage) { | 96 | if (checkmimeimage) { |
97 | mimeTypeList += ("image//*"); | 97 | mimeTypeList += ("image//*"); |
98 | } | 98 | } |
99 | if (checkmimeall) { | 99 | if (checkmimeall) { |
100 | mimeTypeList << ("null"); | 100 | mimeTypeList << ("null"); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | cfg.write(); | ||
103 | } | 104 | } |
104 | 105 | ||
105 | void MediumMountGui::startGui() { | 106 | void MediumMountGui::startGui() { |
106 | 107 | ||
107 | QPixmap image = Resource::loadPixmap( "HelpBrowser"); | 108 | QPixmap image = Resource::loadPixmap( "HelpBrowser"); |
108 | 109 | ||
109 | Text_2 = new QLabel( this ); | 110 | Text_2 = new QLabel( this ); |
110 | Text_2->setGeometry( QRect( 10, 15, 40, 40 ) ); | 111 | Text_2->setGeometry( QRect( 10, 15, 40, 40 ) ); |
111 | Text_2->setPixmap( image ); | 112 | Text_2->setPixmap( image ); |
112 | 113 | ||
113 | Text = new QLabel( this, "Text" ); | 114 | Text = new QLabel( this, "Text" ); |
114 | Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) ); | 115 | Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) ); |
115 | Text->setText( tr( "A <b>storage medium</b> was inserted. Should it be scanned for media files?" ) ); | 116 | Text->setText( tr( "A <b>storage medium</b> was inserted. Should it be scanned for media files?" ) ); |
116 | 117 | ||
117 | // media box | 118 | // media box |
118 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); | 119 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); |
119 | GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) ); | 120 | GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) ); |
120 | GroupBox1->setTitle( tr( "Which media files" ) ); | 121 | GroupBox1->setTitle( tr( "Which media files" ) ); |
121 | 122 | ||
122 | CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); | 123 | CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); |
123 | CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) ); | 124 | CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) ); |
124 | CheckBoxAudio->setText( tr( "Audio" ) ); | 125 | CheckBoxAudio->setText( tr( "Audio" ) ); |
125 | 126 | ||
126 | CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" ); | 127 | CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" ); |
127 | CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) ); | 128 | CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) ); |
128 | CheckBoxImage->setText( tr( "Image" ) ); | 129 | CheckBoxImage->setText( tr( "Image" ) ); |
129 | 130 | ||
130 | CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" ); | 131 | CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" ); |
131 | CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) ); | 132 | CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) ); |
132 | CheckBoxText->setText( tr( "Text" ) ); | 133 | CheckBoxText->setText( tr( "Text" ) ); |
133 | 134 | ||
134 | CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); | 135 | CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); |
135 | CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); | 136 | CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); |
136 | CheckBoxVideo->setText( tr( "Video" ) ); | 137 | CheckBoxVideo->setText( tr( "Video" ) ); |
137 | 138 | ||
138 | CheckBoxAll = new QCheckBox ( GroupBox1); | 139 | CheckBoxAll = new QCheckBox ( GroupBox1); |
139 | CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) ); | 140 | CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) ); |
140 | CheckBoxAll->setText( tr( "All" ) ); | 141 | CheckBoxAll->setText( tr( "All" ) ); |
141 | QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) ); | 142 | QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) ); |
142 | 143 | ||
143 | 144 | ||
144 | 145 | ||
145 | CheckBoxLink = new QCheckBox ( GroupBox1); | 146 | CheckBoxLink = new QCheckBox ( GroupBox1); |
146 | CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) ); | 147 | CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) ); |
147 | CheckBoxLink->setText( tr( "Link apps" ) ); | 148 | CheckBoxLink->setText( tr( "Link apps" ) ); |
148 | // as long as the feature is not supported | 149 | // as long as the feature is not supported |
149 | CheckBoxLink->setEnabled(false); | 150 | CheckBoxLink->setEnabled(false); |
150 | 151 | ||
151 | 152 | ||
152 | // select dirs | 153 | // select dirs |
153 | 154 | ||
154 | DirSelectText = new QLabel( this, "DirSelectText" ); | 155 | DirSelectText = new QLabel( this, "DirSelectText" ); |
155 | DirSelectText->setGeometry( QRect( 10, 160,this->width() , 20 ) ); | 156 | DirSelectText->setGeometry( QRect( 10, 160,this->width() , 20 ) ); |
156 | DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) ); | 157 | DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) ); |
157 | 158 | ||
158 | LineEdit1 = new QLineEdit( this ); | 159 | LineEdit1 = new QLineEdit( this ); |
159 | LineEdit1->setGeometry( QRect( 10, 180, (this->width())-60, 20 ) ); | 160 | LineEdit1->setGeometry( QRect( 10, 180, (this->width())-60, 20 ) ); |
160 | 161 | ||
161 | PushButton3 = new QPushButton( this ); | 162 | PushButton3 = new QPushButton( this ); |
162 | PushButton3->setGeometry( QRect( (this->width())-40, 180, 30, 20 ) ); | 163 | PushButton3->setGeometry( QRect( (this->width())-40, 180, 30, 20 ) ); |
163 | PushButton3->setText( tr( "Add" ) ); | 164 | PushButton3->setText( tr( "Add" ) ); |
164 | 165 | ||
165 | 166 | ||
166 | // decision | 167 | // decision |
167 | DirSelectText_2 = new QLabel( this ); | 168 | DirSelectText_2 = new QLabel( this ); |
168 | DirSelectText_2->setGeometry( QRect( 10,240,this->width(), 15 ) ); | 169 | DirSelectText_2->setGeometry( QRect( 10,240,this->width(), 15 ) ); |
169 | DirSelectText_2->setText( tr( "Your decision will be stored on the medium." ) ); | 170 | DirSelectText_2->setText( tr( "Your decision will be stored on the medium." ) ); |
170 | 171 | ||
171 | // ask again | 172 | // ask again |
172 | AskBox = new QCheckBox( this ); | 173 | AskBox = new QCheckBox( this ); |
173 | AskBox->setGeometry( QRect( 10, 215, (this->width())-15 , 15 ) ); | 174 | AskBox->setGeometry( QRect( 10, 215, (this->width())-15 , 15 ) ); |
174 | AskBox->setText( tr( "Do not ask again for this medium" ) ); | 175 | AskBox->setText( tr( "Do not ask again for this medium" ) ); |
175 | 176 | ||
176 | 177 | ||
177 | AskBox->setChecked(checkagain); | 178 | AskBox->setChecked(checkagain); |
178 | CheckBoxAudio->setChecked(checkmimeaudio); | 179 | CheckBoxAudio->setChecked(checkmimeaudio); |
179 | CheckBoxImage->setChecked(checkmimeimage); | 180 | CheckBoxImage->setChecked(checkmimeimage); |
180 | CheckBoxText->setChecked(checkmimetext); | 181 | CheckBoxText->setChecked(checkmimetext); |
181 | CheckBoxVideo->setChecked(checkmimevideo); | 182 | CheckBoxVideo->setChecked(checkmimevideo); |
182 | 183 | ||
183 | // buttons | 184 | // buttons |
184 | quit = new QPushButton( this ); | 185 | quit = new QPushButton( this ); |
185 | quit->setGeometry( QRect( (this->width()/2)- 90 , 260, 80, 22 ) ); | 186 | quit->setGeometry( QRect( (this->width()/2)- 90 , 260, 80, 22 ) ); |
186 | quit->setFocus(); | 187 | quit->setFocus(); |
187 | quit->setText( tr( "Yes" ) ); | 188 | quit->setText( tr( "Yes" ) ); |
188 | 189 | ||
189 | quit_2 = new QPushButton( this ); | 190 | quit_2 = new QPushButton( this ); |
190 | quit_2->setGeometry( QRect((this->width()/2) , 260, 80, 22 ) ); | 191 | quit_2->setGeometry( QRect((this->width()/2) , 260, 80, 22 ) ); |
191 | quit_2->setText( tr( "No" ) ); | 192 | quit_2->setText( tr( "No" ) ); |
192 | 193 | ||
193 | QObject::connect( (QObject*)quit, SIGNAL( clicked() ), this, SLOT(yesPressed() ) ); | 194 | QObject::connect( (QObject*)quit, SIGNAL( clicked() ), this, SLOT(yesPressed() ) ); |
194 | QObject::connect( (QObject*)quit_2, SIGNAL( clicked() ), this, SLOT(noPressed() ) ); | 195 | QObject::connect( (QObject*)quit_2, SIGNAL( clicked() ), this, SLOT(noPressed() ) ); |
195 | 196 | ||
196 | 197 | ||
197 | } | 198 | } |
198 | 199 | ||
199 | 200 | ||
200 | void MediumMountGui::deactivateOthers() { | 201 | void MediumMountGui::deactivateOthers() { |
201 | bool mod = !(CheckBoxAll->isChecked()); | 202 | bool mod = !(CheckBoxAll->isChecked()); |
202 | 203 | ||
203 | //if (!CheckBoxVideo->isChecked()){ | 204 | //if (!CheckBoxVideo->isChecked()){ |
204 | // mod = false; | 205 | // mod = false; |
205 | //} else { | 206 | //} else { |
206 | // mod = true; | 207 | // mod = true; |
207 | //} | 208 | //} |
208 | CheckBoxVideo->setEnabled(mod); | 209 | CheckBoxVideo->setEnabled(mod); |
209 | CheckBoxAudio->setEnabled(mod); | 210 | CheckBoxAudio->setEnabled(mod); |
210 | CheckBoxText->setEnabled(mod); | 211 | CheckBoxText->setEnabled(mod); |
211 | CheckBoxImage->setEnabled(mod); | 212 | CheckBoxImage->setEnabled(mod); |
212 | } | 213 | } |
213 | 214 | ||
214 | void MediumMountGui::yesPressed() { | 215 | void MediumMountGui::yesPressed() { |
215 | writeConfig(true); | 216 | writeConfig(true); |
216 | // and do something | 217 | // and do something |
217 | accept(); | 218 | accept(); |
218 | } | 219 | } |
219 | 220 | ||
220 | 221 | ||
221 | QStringList MediumMountGui::mimeTypes(){ | 222 | QStringList MediumMountGui::mimeTypes(){ |
222 | return mimeTypeList; | 223 | return mimeTypeList; |
223 | } | 224 | } |
224 | 225 | ||
225 | void MediumMountGui::noPressed() { | 226 | void MediumMountGui::noPressed() { |
226 | writeConfig(false); | 227 | writeConfig(false); |
227 | reject(); | 228 | reject(); |
228 | } | 229 | } |
229 | 230 | ||
230 | MediumMountGui::~MediumMountGui(){ | 231 | MediumMountGui::~MediumMountGui(){ |
231 | } | 232 | } |
232 | 233 | ||
diff --git a/libopie/oconfig.h b/libopie/oconfig.h index c97fb6a..f6227d1 100644 --- a/libopie/oconfig.h +++ b/libopie/oconfig.h | |||
@@ -1,48 +1,48 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Holger 'zecke' Freyther<freyther@kde.org> | 3 | .=l. Copyright (c) 2002 Holger 'zecke' Freyther<freyther@kde.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | 29 | ||
30 | #include <qpe/config.h> | 30 | #include <qpe/config.h> |
31 | 31 | ||
32 | #ifndef opieconfig_h | 32 | #ifndef opieconfig_h |
33 | #define opieconfig_h | 33 | #define opieconfig_h |
34 | 34 | ||
35 | /** It supports all Config items + it lets you decide | 35 | /** It supports all Config items + it lets you decide |
36 | * which file to use. | 36 | * which file to use. |
37 | */ | 37 | */ |
38 | 38 | ||
39 | class OConfig : public Config { | 39 | class OConfig : public Config { |
40 | public: | 40 | public: |
41 | OConfig( const QString &filename ); | 41 | OConfig( const QString &filename ); |
42 | ~OConfig(); | 42 | ~OConfig(); |
43 | QString fileName() const; | 43 | QString fileName() const; |
44 | 44 | void read( ) { Config::read(); }; | |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #endif | 47 | #endif |
48 | 48 | ||