-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 | |||
@@ -452,192 +452,193 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) | |||
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) |
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 | |||
@@ -7,192 +7,193 @@ | |||
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 | ||
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 | ||