author | drw <drw> | 2005-05-06 21:54:49 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-06 21:54:49 (UTC) |
commit | 852f6cf4ff1c4010f998ee8cd68936e38001f032 (patch) (unidiff) | |
tree | f12269677f7a84dfe0c6b9aaa6db9875d3d8b8c4 /noncore/apps/zsafe/zsafe.cpp | |
parent | 1a4c6fd2efdb11c2bddc77126e509b5a47665715 (diff) | |
download | opie-852f6cf4ff1c4010f998ee8cd68936e38001f032.zip opie-852f6cf4ff1c4010f998ee8cd68936e38001f032.tar.gz opie-852f6cf4ff1c4010f998ee8cd68936e38001f032.tar.bz2 |
Opie-fy ZSafe UI: clean up menus, use proper toolbar, use shared pics where possible and use OResource for image loading
Diffstat (limited to 'noncore/apps/zsafe/zsafe.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 247 |
1 files changed, 76 insertions, 171 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 2b182f9..f70f863 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "zlistview.h" | 19 | #include "zlistview.h" |
20 | #include "shadedlistitem.h" | 20 | #include "shadedlistitem.h" |
21 | 21 | ||
22 | #include <opie2/oresource.h> | ||
22 | #include <opie2/ofiledialog.h> | 23 | #include <opie2/ofiledialog.h> |
23 | #include <opie2/odebug.h> | 24 | #include <opie2/odebug.h> |
24 | using namespace Opie::Core; | 25 | using namespace Opie::Core; |
@@ -38,12 +39,12 @@ using namespace Opie::Ui; | |||
38 | #include <qpopupmenu.h> | 39 | #include <qpopupmenu.h> |
39 | 40 | ||
40 | #include <qfile.h> | 41 | #include <qfile.h> |
41 | #include <qpe/fileselector.h> | 42 | #include <qpe/applnk.h> |
42 | #include <qpe/global.h> | 43 | #include <qpe/global.h> |
43 | #include <qpe/qpeapplication.h> | 44 | #include <qpe/qpeapplication.h> |
44 | #include <qpe/resource.h> | ||
45 | #include <qpe/config.h> | 45 | #include <qpe/config.h> |
46 | 46 | ||
47 | #include <qaction.h> | ||
47 | #include <qtimer.h> | 48 | #include <qtimer.h> |
48 | #include <qlayout.h> | 49 | #include <qlayout.h> |
49 | #include <qmessagebox.h> | 50 | #include <qmessagebox.h> |
@@ -51,7 +52,6 @@ using namespace Opie::Ui; | |||
51 | #include <qtextstream.h> | 52 | #include <qtextstream.h> |
52 | #include <qheader.h> | 53 | #include <qheader.h> |
53 | #include <qlistview.h> | 54 | #include <qlistview.h> |
54 | #include <qtoolbutton.h> | ||
55 | #include <qvariant.h> | 55 | #include <qvariant.h> |
56 | #include <qtooltip.h> | 56 | #include <qtooltip.h> |
57 | #include <qwhatsthis.h> | 57 | #include <qwhatsthis.h> |
@@ -64,34 +64,18 @@ using namespace Opie::Ui; | |||
64 | #include <qtextbrowser.h> | 64 | #include <qtextbrowser.h> |
65 | #include <qlabel.h> | 65 | #include <qlabel.h> |
66 | #include <qcombobox.h> | 66 | #include <qcombobox.h> |
67 | #include <qtoolbar.h> | ||
67 | 68 | ||
68 | #include "krc2.h" | 69 | #include "krc2.h" |
69 | 70 | ||
70 | #include "wait.h" | 71 | #include "wait.h" |
71 | 72 | ||
72 | int DeskW, DeskH; | ||
73 | QApplication *appl; | ||
74 | ZSafe *zs; | ||
75 | |||
76 | const QString APP_KEY = ""; | 73 | const QString APP_KEY = ""; |
77 | 74 | ||
78 | // include xmp images | 75 | // include xmp images |
79 | #include "pics/zsafe/copy.xpm" | ||
80 | #include "pics/zsafe/cut.xpm" | ||
81 | #include "pics/zsafe/edit.xpm" | ||
82 | #include "pics/zsafe/editdelete.xpm" | ||
83 | #include "pics/zsafe/find.xpm" | ||
84 | #include "pics/zsafe/folder_open.xpm" | ||
85 | #include "pics/zsafe/help_icon.xpm" | ||
86 | #include "pics/zsafe/new.xpm" | ||
87 | #include "pics/zsafe/paste.xpm" | ||
88 | #include "pics/zsafe/quit_icon.xpm" | ||
89 | #include "pics/zsafe/save.xpm" | ||
90 | #include "pics/zsafe/trash.xpm" | ||
91 | #include "pics/zsafe/expand.xpm" | 76 | #include "pics/zsafe/expand.xpm" |
92 | #include "pics/zsafe/export.xpm" | 77 | #include "pics/zsafe/export.xpm" |
93 | #include "pics/zsafe/import.xpm" | 78 | #include "pics/zsafe/import.xpm" |
94 | #include "pics/zsafe/zsafe.xpm" | ||
95 | 79 | ||
96 | static const char* const bank_cards_data[] = { | 80 | static const char* const bank_cards_data[] = { |
97 | "14 14 16 1", | 81 | "14 14 16 1", |
@@ -336,14 +320,9 @@ static const char* const general_data[] = { | |||
336 | * TRUE to construct a modal dialog. | 320 | * TRUE to construct a modal dialog. |
337 | */ | 321 | */ |
338 | ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl ) | 322 | ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl ) |
339 | : QWidget( parent, name, fl), | 323 | : QMainWindow( parent, name, fl), |
340 | Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l) | 324 | ListView(0l) |
341 | { | 325 | { |
342 | zs = this; | ||
343 | appl = qApp; | ||
344 | DeskW = qApp->desktop()->width(); | ||
345 | DeskH = qApp->desktop()->height(); | ||
346 | |||
347 | IsCut = false; | 326 | IsCut = false; |
348 | IsCopy = false; | 327 | IsCopy = false; |
349 | modified = false; | 328 | modified = false; |
@@ -362,18 +341,16 @@ ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl ) | |||
362 | expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0); | 341 | expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0); |
363 | conf->setGroup ("zsafe"); | 342 | conf->setGroup ("zsafe"); |
364 | 343 | ||
365 | QPixmap copy_img((const char**) copy_xpm); | 344 | QPixmap new_img = Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ); |
366 | QPixmap cut_img((const char**) cut_xpm); | 345 | QPixmap edit_img = Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ); |
367 | QPixmap edit_img((const char**) edit_xpm); | 346 | QPixmap trash_img = Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ); |
368 | QPixmap editdelete_img((const char**) editdelete_xpm); | 347 | QPixmap copy_img = Opie::Core::OResource::loadPixmap( "copy", Opie::Core::OResource::SmallIcon ); |
369 | QPixmap find_img((const char**) find_xpm); | 348 | QPixmap cut_img = Opie::Core::OResource::loadPixmap( "cut", Opie::Core::OResource::SmallIcon ); |
370 | QPixmap folder_open_img((const char**) folder_open_xpm); | 349 | QPixmap editdelete_img = Opie::Core::OResource::loadPixmap( "editdelete", Opie::Core::OResource::SmallIcon ); |
371 | QPixmap help_icon_img((const char**) help_icon_xpm); | 350 | QPixmap folder_open_img = Opie::Core::OResource::loadPixmap( "folder_open", Opie::Core::OResource::SmallIcon ); |
372 | QPixmap new_img((const char**) new_xpm); | 351 | QPixmap help_icon_img = Opie::Core::OResource::loadPixmap( "help_icon", Opie::Core::OResource::SmallIcon ); |
373 | QPixmap paste_img((const char**) paste_xpm); | 352 | QPixmap paste_img = Opie::Core::OResource::loadPixmap( "paste", Opie::Core::OResource::SmallIcon ); |
374 | QPixmap quit_icon_img((const char**) quit_icon_xpm); | 353 | QPixmap save_img = Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ); |
375 | QPixmap save_img((const char**) save_xpm); | ||
376 | QPixmap trash_img((const char**) trash_xpm); | ||
377 | QPixmap expand_img((const char**) expand_xpm); | 354 | QPixmap expand_img((const char**) expand_xpm); |
378 | QPixmap export_img((const char**) export_xpm); | 355 | QPixmap export_img((const char**) export_xpm); |
379 | QPixmap import_img((const char**) import_xpm); | 356 | QPixmap import_img((const char**) import_xpm); |
@@ -382,7 +359,7 @@ ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl ) | |||
382 | QPixmap passwords( ( const char** ) passwords_data ); | 359 | QPixmap passwords( ( const char** ) passwords_data ); |
383 | QPixmap software( ( const char** ) software_data ); | 360 | QPixmap software( ( const char** ) software_data ); |
384 | QPixmap general( ( const char** ) general_data ); | 361 | QPixmap general( ( const char** ) general_data ); |
385 | QPixmap image0( ( const char** ) zsafe_xpm ); | 362 | QPixmap image0 = Opie::Core::OResource::loadPixmap( "zsafe/zsafe", Opie::Core::OResource::SmallIcon ); |
386 | 363 | ||
387 | if ( !name ) | 364 | if ( !name ) |
388 | setName( "ZSafe" ); | 365 | setName( "ZSafe" ); |
@@ -448,90 +425,75 @@ ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl ) | |||
448 | categoryDialog = NULL; | 425 | categoryDialog = NULL; |
449 | infoForm->setIcon( image0); | 426 | infoForm->setIcon( image0); |
450 | 427 | ||
428 | // Create menu and tool bar dock | ||
429 | setToolBarsMovable( false ); | ||
430 | QToolBar *dock = new QToolBar( this ); | ||
431 | dock->setHorizontalStretchable( true ); | ||
432 | |||
451 | // add a menu bar | 433 | // add a menu bar |
452 | QMenuBar *menu = new QMenuBar( this ); | 434 | QMenuBar *menu = new QMenuBar( dock ); |
435 | menu->setMargin( 0 ); | ||
436 | |||
437 | // Add a toolbar | ||
438 | QToolBar *toolbar = new QToolBar( this ); | ||
453 | 439 | ||
454 | // add file menu | 440 | // add file menu |
455 | // QPopupMenu *file = new QPopupMenu( this ); | 441 | // QPopupMenu *file = new QPopupMenu( this ); |
456 | file = new QPopupMenu( this ); | 442 | file = new QPopupMenu( this ); |
457 | 443 | ||
458 | file->insertItem( new_img, tr("&New document"), this, SLOT(newDocument()) ); | 444 | // File menu |
459 | file->insertItem( folder_open_img, tr("&Open document"), this, SLOT(loadDocument()) ); | 445 | file->insertItem( new_img, tr("New document"), this, SLOT(newDocument()) ); |
460 | file->insertItem( save_img, tr("&Save document as .."), this, SLOT(saveDocumentAs()) ); | 446 | file->insertItem( folder_open_img, tr("Open document"), this, SLOT(loadDocument()) ); |
447 | file->insertItem( save_img, tr("Save document as"), this, SLOT(saveDocumentAs()) ); | ||
461 | file->insertSeparator(); | 448 | file->insertSeparator(); |
462 | 449 | ||
463 | file->insertItem( save_img, tr("&Save document"), this, SLOT(saveDocumentWithoutPwd()) ); | 450 | file->insertItem( save_img, tr("Save document"), this, SLOT(saveDocumentWithoutPwd()) ); |
464 | file->insertItem( save_img, tr("S&ave document with new Password"), this, | 451 | file->insertItem( save_img, tr("Save document with new Password"), this, |
465 | SLOT(saveDocumentWithPwd()) ); | 452 | SLOT(saveDocumentWithPwd()) ); |
466 | file->insertSeparator(); | 453 | file->insertSeparator(); |
467 | file->insertItem( export_img, tr("&Export text file"), this, SLOT(writeAllEntries()) ); | 454 | file->insertItem( export_img, tr("Export text file"), this, SLOT(writeAllEntries()) ); |
468 | file->insertItem( import_img, tr("&Import text file"), this, SLOT(readAllEntries()) ); | 455 | file->insertItem( import_img, tr("Import text file"), this, SLOT(readAllEntries()) ); |
469 | file->insertItem( trash_img, tr("&Remove text file"), this, SLOT(removeAsciiFile()) ); | 456 | file->insertItem( trash_img, tr("Remove text file"), this, SLOT(removeAsciiFile()) ); |
470 | file->insertSeparator(); | 457 | file->insertSeparator(); |
471 | file->insertItem( expand_img, tr("&Open entries expanded"), this, | 458 | file->insertItem( expand_img, tr("Open entries expanded"), this, |
472 | SLOT(setExpandFlag()), 0, 'o'); | 459 | SLOT(setExpandFlag()), 0, 'o'); |
473 | file->setItemChecked('o', expandTree); | 460 | file->setItemChecked('o', expandTree); |
474 | file->insertSeparator(); | 461 | menu->insertItem( tr("File"), file ); |
475 | file->insertItem( quit_icon_img, tr("E&xit"), this, SLOT(quitMe()) ); | ||
476 | menu->insertItem( tr("&File"), file ); | ||
477 | 462 | ||
463 | // Category menu | ||
478 | QPopupMenu *cat = new QPopupMenu( this ); | 464 | QPopupMenu *cat = new QPopupMenu( this ); |
479 | cat->insertItem( new_img, tr("&New"), this, SLOT(addCategory()) ); | 465 | cat->insertItem( new_img, tr("New"), this, SLOT(addCategory()) ); |
480 | cat->insertItem( edit_img, tr("&Edit"), this, SLOT(editCategory()) ); | 466 | cat->insertItem( edit_img, tr("Edit"), this, SLOT(editCategory()) ); |
481 | cat->insertItem( trash_img, tr("&Delete"), this, SLOT(delCategory()) ); | 467 | cat->insertItem( trash_img, tr("Delete"), this, SLOT(delCategory()) ); |
482 | menu->insertItem( tr("&Category"), cat ); | 468 | menu->insertItem( tr("Category"), cat ); |
483 | 469 | ||
470 | // Entry menu | ||
484 | QPopupMenu *it = new QPopupMenu( this ); | 471 | QPopupMenu *it = new QPopupMenu( this ); |
485 | it->insertItem( cut_img, tr("&Cut"), this, SLOT(cutItem()) ); | 472 | it->insertItem( cut_img, tr("Cut"), this, SLOT(cutItem()) ); |
486 | it->insertItem( copy_img, tr("C&opy"), this, SLOT(copyItem()) ); | 473 | it->insertItem( copy_img, tr("Copy"), this, SLOT(copyItem()) ); |
487 | it->insertItem( paste_img, tr("&Paste"), this, SLOT(pasteItem()) ); | 474 | it->insertItem( paste_img, tr("Paste"), this, SLOT(pasteItem()) ); |
488 | it->insertSeparator(); | 475 | it->insertSeparator(); |
489 | it->insertItem( new_img, tr("&New"), this, SLOT(newPwd()) ); | ||
490 | it->insertItem( edit_img, tr("&Edit"), this, SLOT(editPwd()) ); | ||
491 | it->insertItem( trash_img, tr("&Delete"), this, SLOT(deletePwd()) ); | ||
492 | it->insertItem( find_img, tr("&Search"), this, SLOT(findPwd()) ); | ||
493 | menu->insertItem( tr("&Entry"), it ); | ||
494 | |||
495 | QPopupMenu *help = new QPopupMenu( this ); | ||
496 | help->insertItem( help_icon_img, tr("&About"), this, SLOT(about()) ); | ||
497 | menu->insertItem( tr("&Help"), help ); | ||
498 | |||
499 | // toolbar icons | ||
500 | |||
501 | New = new QToolButton( menu, "New" ); | ||
502 | New->setGeometry( QRect( DeskW-84, 2, 20, 20 ) ); | ||
503 | New->setMouseTracking( TRUE ); | ||
504 | New->setText( "" ); | ||
505 | New->setPixmap( new_img ); | ||
506 | QToolTip::add( New, tr( "New entry" ) ); | ||
507 | |||
508 | Edit = new QToolButton( menu, "Edit" ); | ||
509 | Edit->setGeometry( QRect( DeskW-64, 2, 20, 20 ) ); | ||
510 | Edit->setText( "" ); | ||
511 | Edit->setPixmap( edit_img ); | ||
512 | QToolTip::add( Edit, tr( "Edit category or entry" ) ); | ||
513 | |||
514 | Delete = new QToolButton( menu, "Delete" ); | ||
515 | Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); | ||
516 | Delete->setText( "" ); | ||
517 | Delete->setPixmap( trash_img ); | ||
518 | QToolTip::add( Delete, tr( "Delete category or entry" ) ); | ||
519 | |||
520 | Find = new QToolButton( menu, "Find" ); | ||
521 | Find->setGeometry( QRect( DeskW-24, 2, 20, 20 ) ); | ||
522 | Find->setText( "" ); | ||
523 | Find->setPixmap( find_img ); | ||
524 | QToolTip::add( Find, tr( "Find entry" ) ); | ||
525 | |||
526 | /* | ||
527 | QBoxLayout * h = new QHBoxLayout( this ); | ||
528 | h->addWidget (menu); | ||
529 | h->addWidget (New); | ||
530 | h->addWidget (Edit); | ||
531 | h->addWidget (Delete); | ||
532 | h->addWidget (Find); | ||
533 | */ | ||
534 | 476 | ||
477 | QAction *a = new QAction( tr( "New" ), new_img, QString::null, 0, this, 0 ); | ||
478 | connect( a, SIGNAL(activated()), this, SLOT(newPwd()) ); | ||
479 | a->addTo( it ); | ||
480 | a->addTo( toolbar ); | ||
481 | a = new QAction( tr( "Edit" ), edit_img, QString::null, 0, this, 0 ); | ||
482 | connect( a, SIGNAL(activated()), this, SLOT(editPwd()) ); | ||
483 | a->addTo( it ); | ||
484 | a->addTo( toolbar ); | ||
485 | a = new QAction( tr( "Delete" ), trash_img, QString::null, 0, this, 0 ); | ||
486 | connect( a, SIGNAL(activated()), this, SLOT(deletePwd()) ); | ||
487 | a->addTo( it ); | ||
488 | a->addTo( toolbar ); | ||
489 | a = new QAction( tr( "Search" ), Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ), | ||
490 | QString::null, 0, this, 0 ); | ||
491 | connect( a, SIGNAL(activated()), this, SLOT(findPwd()) ); | ||
492 | a->addTo( it ); | ||
493 | a->addTo( toolbar ); | ||
494 | menu->insertItem( tr("Entry"), it ); | ||
495 | |||
496 | // Add main view | ||
535 | ListView = new ZListView( this, "ListView" ); | 497 | ListView = new ZListView( this, "ListView" ); |
536 | ListView->addColumn( tr( "Name" ) ); | 498 | ListView->addColumn( tr( "Name" ) ); |
537 | ListView->addColumn( tr( "Field 2" ) ); | 499 | ListView->addColumn( tr( "Field 2" ) ); |
@@ -542,10 +504,7 @@ ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl ) | |||
542 | ListView->setAllColumnsShowFocus(TRUE); | 504 | ListView->setAllColumnsShowFocus(TRUE); |
543 | 505 | ||
544 | ListView->setResizePolicy(QScrollView::AutoOneFit); | 506 | ListView->setResizePolicy(QScrollView::AutoOneFit); |
545 | // ListView->setGeometry( QRect( 0, 22, | 507 | setCentralWidget( ListView ); |
546 | // this->width(), this->height() - 30 ) ); | ||
547 | // ListView->setMaximumSize( QSize( 440, 290 ) ); | ||
548 | // ListView->setVScrollBarMode( QListView::Auto ); | ||
549 | 508 | ||
550 | QBoxLayout * l = new QVBoxLayout( this ); | 509 | QBoxLayout * l = new QVBoxLayout( this ); |
551 | l->addWidget (menu); | 510 | l->addWidget (menu); |
@@ -557,11 +516,6 @@ ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl ) | |||
557 | raiseFlag = true; | 516 | raiseFlag = true; |
558 | connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) ); | 517 | connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) ); |
559 | 518 | ||
560 | // signals and slots connections for QTollButton | ||
561 | connect( New, SIGNAL( clicked() ), this, SLOT( newPwd() ) ); | ||
562 | connect( Edit, SIGNAL( clicked() ), this, SLOT( editPwd() ) ); | ||
563 | connect( Delete, SIGNAL( clicked() ), this, SLOT( deletePwd() ) ); | ||
564 | connect( Find, SIGNAL( clicked() ), this, SLOT( findPwd() ) ); | ||
565 | // signals and slots connections for QListView | 519 | // signals and slots connections for QListView |
566 | connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), | 520 | connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), |
567 | this, SLOT( listViewSelected(QListViewItem*) ) ); | 521 | this, SLOT( listViewSelected(QListViewItem*) ) ); |
@@ -2110,8 +2064,8 @@ void ZSafe::getDocPassword(QString title) | |||
2110 | newPwdDialog = dialog; | 2064 | newPwdDialog = dialog; |
2111 | newPwdDialogResult = false; | 2065 | newPwdDialogResult = false; |
2112 | 2066 | ||
2113 | QPixmap image0( ( const char** ) zsafe_xpm ); | 2067 | // QPixmap image0 = Opie::Core::OResource::loadPixmap( "zsafe/zsafe", Opie::Core::OResource::SmallIcon ); |
2114 | dialog->setIcon( image0); | 2068 | // dialog->setIcon( image0); |
2115 | 2069 | ||
2116 | connect( dialog->PasswordField, SIGNAL( returnPressed() ), | 2070 | connect( dialog->PasswordField, SIGNAL( returnPressed() ), |
2117 | this, SLOT( setPasswordDialogDone() ) ); | 2071 | this, SLOT( setPasswordDialogDone() ) ); |
@@ -2407,10 +2361,7 @@ void ZSafe::addCategory() | |||
2407 | QString fileName = fi->fileName(); | 2361 | QString fileName = fi->fileName(); |
2408 | if(fileName.right(4) == ".png"){ | 2362 | if(fileName.right(4) == ".png"){ |
2409 | fileName = fileName.mid(0,fileName.length()-4); | 2363 | fileName = fileName.mid(0,fileName.length()-4); |
2410 | QPixmap imageOfFile(Resource::loadPixmap(fileName)); | 2364 | QPixmap imageOfFile(Opie::Core::OResource::loadPixmap(fileName,Opie::Core::OResource::SmallIcon)); |
2411 | QImage foo = imageOfFile.convertToImage(); | ||
2412 | foo = foo.smoothScale(16,16); | ||
2413 | imageOfFile.convertFromImage(foo); | ||
2414 | dialog->IconField->insertItem(imageOfFile,fileName); | 2365 | dialog->IconField->insertItem(imageOfFile,fileName); |
2415 | } | 2366 | } |
2416 | ++it; | 2367 | ++it; |
@@ -2761,10 +2712,7 @@ void ZSafe::editCategory() | |||
2761 | if(fileName.right(4) == ".png") | 2712 | if(fileName.right(4) == ".png") |
2762 | { | 2713 | { |
2763 | fileName = fileName.mid(0,fileName.length()-4); | 2714 | fileName = fileName.mid(0,fileName.length()-4); |
2764 | QPixmap imageOfFile(Resource::loadPixmap(fileName)); | 2715 | QPixmap imageOfFile(Opie::Core::OResource::loadPixmap(fileName,Opie::Core::OResource::SmallIcon)); |
2765 | QImage foo = imageOfFile.convertToImage(); | ||
2766 | foo = foo.smoothScale(16,16); | ||
2767 | imageOfFile.convertFromImage(foo); | ||
2768 | dialog->IconField->insertItem(imageOfFile,fileName); | 2716 | dialog->IconField->insertItem(imageOfFile,fileName); |
2769 | if(fileName+".png"==icon) | 2717 | if(fileName+".png"==icon) |
2770 | dialog->IconField->setCurrentItem(i+1); | 2718 | dialog->IconField->setCurrentItem(i+1); |
@@ -3113,33 +3061,6 @@ void ZSafe::saveDocumentWithPwd() | |||
3113 | saveDocument(filename, TRUE); | 3061 | saveDocument(filename, TRUE); |
3114 | } | 3062 | } |
3115 | 3063 | ||
3116 | void ZSafe::about() | ||
3117 | { | ||
3118 | QString info; | ||
3119 | info = tr("<html><body><div align=""center"">" | ||
3120 | "<b>" | ||
3121 | "Zaurus Password Manager<br>" | ||
3122 | "ZSafe version 2.1.2<br>" | ||
3123 | "</b>" | ||
3124 | "by Carsten Schneider<br>" | ||
3125 | "zcarsten@gmx.net<br>" | ||
3126 | "http://z-soft.z-portal.info/zsafe" | ||
3127 | "<br>" | ||
3128 | "Translations by Robert Ernst<br>" | ||
3129 | "robert.ernst@linux-solutions.at<br>" | ||
3130 | "<br></div>" | ||
3131 | "</body></html>"); | ||
3132 | |||
3133 | // QMessageBox::information( this, tr("ZSafe"), info, tr("&OK"), 0); | ||
3134 | |||
3135 | QMessageBox mb( this, tr("ZSafe")); | ||
3136 | mb.setText (info); | ||
3137 | mb.setButtonText (QMessageBox::Ok, tr ("&OK")); | ||
3138 | QPixmap zsafe_img((const char**) zsafe_xpm); | ||
3139 | mb.setIconPixmap (zsafe_img); | ||
3140 | mb.exec(); | ||
3141 | } | ||
3142 | |||
3143 | void ZSafe::setExpandFlag() | 3064 | void ZSafe::setExpandFlag() |
3144 | { | 3065 | { |
3145 | expandTree = !expandTree; | 3066 | expandTree = !expandTree; |
@@ -3163,22 +3084,6 @@ void ZSafe::paintEvent( QPaintEvent * ) | |||
3163 | } | 3084 | } |
3164 | } | 3085 | } |
3165 | 3086 | ||
3166 | void ZSafe::resizeEvent ( QResizeEvent * ) | ||
3167 | { | ||
3168 | // owarn << "resizeEvent" << oendl; | ||
3169 | DeskW = appl->desktop()->width(); | ||
3170 | DeskH = appl->desktop()->height(); | ||
3171 | |||
3172 | if (New) | ||
3173 | New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) ); | ||
3174 | if (Edit) | ||
3175 | Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) ); | ||
3176 | if (Delete) | ||
3177 | Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); | ||
3178 | if (Find) | ||
3179 | Find->setGeometry ( QRect( DeskW-24, 2, 20, 20 ) ); | ||
3180 | } | ||
3181 | |||
3182 | void ZSafe::slotRaiseTimer() | 3087 | void ZSafe::slotRaiseTimer() |
3183 | { | 3088 | { |
3184 | if (infoForm->isVisible()) | 3089 | if (infoForm->isVisible()) |
@@ -3268,10 +3173,10 @@ void ZSafe::ListPressed(int mouse, QListViewItem *item, const QPoint&, int colum | |||
3268 | { | 3173 | { |
3269 | QClipboard *cb = QApplication::clipboard(); | 3174 | QClipboard *cb = QApplication::clipboard(); |
3270 | 3175 | ||
3271 | QIconSet copy_img((const char**) copy_xpm); | 3176 | QIconSet copy_img = Opie::Core::OResource::loadPixmap( "copy", Opie::Core::OResource::SmallIcon ); |
3272 | QIconSet edit_img((const char**) edit_xpm); | 3177 | QIconSet edit_img = Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ); |
3273 | QPixmap folder_open_img((const char**) folder_open_xpm); | 3178 | QPixmap folder_open_img = Opie::Core::OResource::loadPixmap( "folder_open", Opie::Core::OResource::SmallIcon ); |
3274 | QPixmap editdelete_img((const char**) editdelete_xpm); | 3179 | QPixmap editdelete_img = Opie::Core::OResource::loadPixmap( "editdelete", Opie::Core::OResource::SmallIcon ); |
3275 | 3180 | ||
3276 | QPopupMenu *m = new QPopupMenu(this); | 3181 | QPopupMenu *m = new QPopupMenu(this); |
3277 | int copyItem = m->insertItem( copy_img, tr( "Copy to Clipboard" )); | 3182 | int copyItem = m->insertItem( copy_img, tr( "Copy to Clipboard" )); |