Diffstat (limited to 'noncore/settings/tabmanager/tabmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/tabmanager/tabmanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/tabmanager/tabmanager.cpp b/noncore/settings/tabmanager/tabmanager.cpp index 3eae424..85e5814 100644 --- a/noncore/settings/tabmanager/tabmanager.cpp +++ b/noncore/settings/tabmanager/tabmanager.cpp | |||
@@ -1,48 +1,48 @@ | |||
1 | #include "tabmanager.h" | 1 | #include "tabmanager.h" |
2 | #include "app.h" | 2 | #include "app.h" |
3 | #include "wait.h" | 3 | #include "wait.h" |
4 | #include "tabapplnk.h" | 4 | #include "tabapplnk.h" |
5 | 5 | ||
6 | #include <opie2/odebug.h> | 6 | #include <opie2/odebug.h> |
7 | 7 | ||
8 | #include <qpe/applnk.h> | 8 | #include <qpe/applnk.h> |
9 | #include <qdir.h> | 9 | #include <qdir.h> |
10 | #include <qfile.h> | 10 | #include <qfile.h> |
11 | #include <qtextstream.h> | 11 | #include <qtextstream.h> |
12 | #include <qlistview.h> | 12 | #include <qlistview.h> |
13 | #include <qheader.h> | 13 | #include <qheader.h> |
14 | #include <qcombobox.h> | 14 | #include <qcombobox.h> |
15 | #include <qlineedit.h> | 15 | #include <qlineedit.h> |
16 | #include <qlabel.h> | 16 | #include <qlabel.h> |
17 | #include <qmessagebox.h> | 17 | #include <qmessagebox.h> |
18 | #include <stdlib.h> | 18 | #include <stdlib.h> |
19 | #include <qpe/qcopenvelope_qws.h> | 19 | #include <qpe/qcopenvelope_qws.h> |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | 22 | ||
23 | 23 | ||
24 | #define HOME_APP_DIR QPEApplication::qpeDir()+"/apps" | 24 | #define HOME_APP_DIR QPEApplication::qpeDir()+"apps" |
25 | #define HOME_APP_INSTALL_DIR "/usr/lib/ipkg/info" | 25 | #define HOME_APP_INSTALL_DIR "/usr/lib/ipkg/info" |
26 | #define NEW_FOLDER "EmptyTab" | 26 | #define NEW_FOLDER "EmptyTab" |
27 | #define NEW_APPLICATION "NewApp" | 27 | #define NEW_APPLICATION "NewApp" |
28 | #define APPLICATION_EXTENSION ".desktop" | 28 | #define APPLICATION_EXTENSION ".desktop" |
29 | #define APPLICATION_EXTENSION_LENGTH 8 | 29 | #define APPLICATION_EXTENSION_LENGTH 8 |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * Constructor. Sets up signals. Performs initial scan of applications | 32 | * Constructor. Sets up signals. Performs initial scan of applications |
33 | * and tabs | 33 | * and tabs |
34 | */ | 34 | */ |
35 | TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){ | 35 | TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){ |
36 | rescanFolder(HOME_APP_DIR); | 36 | rescanFolder(HOME_APP_DIR); |
37 | 37 | ||
38 | // Connect the signals and slots | 38 | // Connect the signals and slots |
39 | connect(tabList, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(editItem(QListViewItem*))); | 39 | connect(tabList, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(editItem(QListViewItem*))); |
40 | (tabList->header())->hide(); | 40 | (tabList->header())->hide(); |
41 | connect(tabList, SIGNAL(moveItem(QListViewItem*,QListViewItem*)), this, SLOT(moveApplication(QListViewItem*,QListViewItem*))); | 41 | connect(tabList, SIGNAL(moveItem(QListViewItem*,QListViewItem*)), this, SLOT(moveApplication(QListViewItem*,QListViewItem*))); |
42 | } | 42 | } |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * If anything in the tab's have been changed then update the system or alert | 45 | * If anything in the tab's have been changed then update the system or alert |
46 | * the user. | 46 | * the user. |
47 | */ | 47 | */ |
48 | TabManager::~TabManager(){ | 48 | TabManager::~TabManager(){ |
@@ -237,49 +237,49 @@ void TabManager::editCurrentItem(){ | |||
237 | 237 | ||
238 | /** | 238 | /** |
239 | * Edit the item that is passed in. | 239 | * Edit the item that is passed in. |
240 | * Show application dialog and if anything changed | 240 | * Show application dialog and if anything changed |
241 | * @param item the item to edit. | 241 | * @param item the item to edit. |
242 | */ | 242 | */ |
243 | void TabManager::editItem( QListViewItem * item){ | 243 | void TabManager::editItem( QListViewItem * item){ |
244 | if(!item) | 244 | if(!item) |
245 | return; | 245 | return; |
246 | 246 | ||
247 | TabAppLnk app(itemList[item]); | 247 | TabAppLnk app(itemList[item]); |
248 | if(!app.isValid()){ | 248 | if(!app.isValid()){ |
249 | odebug << QString("editItem: Not a valid applnk file: ") + itemList[item].latin1() << oendl; | 249 | odebug << QString("editItem: Not a valid applnk file: ") + itemList[item].latin1() << oendl; |
250 | return; | 250 | return; |
251 | } | 251 | } |
252 | 252 | ||
253 | // Fill with all of the icons | 253 | // Fill with all of the icons |
254 | if(!application){ | 254 | if(!application){ |
255 | Wait waitDialog(this, "Wait dialog"); | 255 | Wait waitDialog(this, "Wait dialog"); |
256 | waitDialog.waitLabel->setText(tr("Gathering icons...")); | 256 | waitDialog.waitLabel->setText(tr("Gathering icons...")); |
257 | waitDialog.show(); | 257 | waitDialog.show(); |
258 | qApp->processEvents(); | 258 | qApp->processEvents(); |
259 | application = new AppEdit(this, "Application edit", true); | 259 | application = new AppEdit(this, "Application edit", true); |
260 | 260 | ||
261 | QDir d(QPEApplication::qpeDir() + "/pics/"); | 261 | QDir d(QPEApplication::qpeDir() + "pics/"); |
262 | d.setFilter( QDir::Files); | 262 | d.setFilter( QDir::Files); |
263 | 263 | ||
264 | const QFileInfoList *list = d.entryInfoList(); | 264 | const QFileInfoList *list = d.entryInfoList(); |
265 | QFileInfoListIterator it( *list ); // create list iterator | 265 | QFileInfoListIterator it( *list ); // create list iterator |
266 | QFileInfo *fi; // pointer for traversing | 266 | QFileInfo *fi; // pointer for traversing |
267 | 267 | ||
268 | while ( (fi=it.current()) ) { // for each file... | 268 | while ( (fi=it.current()) ) { // for each file... |
269 | QString fileName = fi->fileName(); | 269 | QString fileName = fi->fileName(); |
270 | if(fileName.right(4) == ".png"){ | 270 | if(fileName.right(4) == ".png"){ |
271 | fileName = fileName.mid(0,fileName.length()-4); | 271 | fileName = fileName.mid(0,fileName.length()-4); |
272 | QPixmap imageOfFile(Resource::loadPixmap(fileName)); | 272 | QPixmap imageOfFile(Resource::loadPixmap(fileName)); |
273 | QImage foo = imageOfFile.convertToImage(); | 273 | QImage foo = imageOfFile.convertToImage(); |
274 | foo = foo.smoothScale(16,16); | 274 | foo = foo.smoothScale(16,16); |
275 | imageOfFile.convertFromImage(foo); | 275 | imageOfFile.convertFromImage(foo); |
276 | application->iconLineEdit->insertItem(imageOfFile,fileName); | 276 | application->iconLineEdit->insertItem(imageOfFile,fileName); |
277 | } | 277 | } |
278 | //odebug << fi->fileName().latin1() << oendl; | 278 | //odebug << fi->fileName().latin1() << oendl; |
279 | ++it; | 279 | ++it; |
280 | } | 280 | } |
281 | waitDialog.hide(); | 281 | waitDialog.hide(); |
282 | } | 282 | } |
283 | int pixmap = -1; | 283 | int pixmap = -1; |
284 | QString pixmapText = app.pixmapString(); | 284 | QString pixmapText = app.pixmapString(); |
285 | QComboBox *f = application->iconLineEdit; | 285 | QComboBox *f = application->iconLineEdit; |