author | zcarsten <zcarsten> | 2003-08-20 16:57:52 (UTC) |
---|---|---|
committer | zcarsten <zcarsten> | 2003-08-20 16:57:52 (UTC) |
commit | fb3e8cda0d2c929278c7ecbf829475f8b1c92956 (patch) (unidiff) | |
tree | fa99523aecbfe5b1c7312a6f39aabfc5c727e4a2 | |
parent | 9845e740ab9707dc77165a236510a9103e372c26 (diff) | |
download | opie-fb3e8cda0d2c929278c7ecbf829475f8b1c92956.zip opie-fb3e8cda0d2c929278c7ecbf829475f8b1c92956.tar.gz opie-fb3e8cda0d2c929278c7ecbf829475f8b1c92956.tar.bz2 |
zecke's modifications added
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 43565ee..ee1da77 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -382,27 +382,33 @@ static const char* const general_data[] = { | |||
382 | /* | 382 | /* |
383 | * Constructs a ZSafe which is a child of 'parent', with the | 383 | * Constructs a ZSafe which is a child of 'parent', with the |
384 | * name 'name' and widget flags set to 'f' | 384 | * name 'name' and widget flags set to 'f' |
385 | * | 385 | * |
386 | * The dialog will by default be modeless, unless you set 'modal' to | 386 | * The dialog will by default be modeless, unless you set 'modal' to |
387 | * TRUE to construct a modal dialog. | 387 | * TRUE to construct a modal dialog. |
388 | */ | 388 | */ |
389 | ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | 389 | ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) |
390 | : QDialog( parent, name, modal, fl ) | 390 | : QDialog( parent, name, modal, fl ), |
391 | Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l) | ||
391 | { | 392 | { |
392 | IsCut = false; | 393 | IsCut = false; |
393 | IsCopy = false; | 394 | IsCopy = false; |
394 | modified = false; | 395 | modified = false; |
395 | 396 | ||
396 | // set the config file | 397 | // set the config file |
397 | cfgFile=QDir::homeDirPath(); | 398 | cfgFile=QDir::homeDirPath(); |
398 | cfgFile += "/.zsafe.cfg"; | 399 | cfgFile += "/.zsafe.cfg"; |
399 | // set the icon path | 400 | // set the icon path |
401 | #ifdef NO_OPIE | ||
400 | QString qpedir ((const char *)getenv("QPEDIR")); | 402 | QString qpedir ((const char *)getenv("QPEDIR")); |
403 | #else | ||
404 | QString qpedir ((const char *)getenv("OPIEDIR")); | ||
405 | #endif | ||
406 | |||
401 | #ifdef DESKTOP | 407 | #ifdef DESKTOP |
402 | iconPath = QDir::homeDirPath() + "/pics/"; | 408 | iconPath = QDir::homeDirPath() + "/pics/"; |
403 | #else | 409 | #else |
404 | if (qpedir.isEmpty()) | 410 | if (qpedir.isEmpty()) |
405 | iconPath = "/home/QtPalmtop/pics/"; | 411 | iconPath = "/home/QtPalmtop/pics/"; |
406 | else | 412 | else |
407 | iconPath = qpedir + "/pics/"; | 413 | iconPath = qpedir + "/pics/"; |
408 | #endif | 414 | #endif |
@@ -504,25 +510,21 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | |||
504 | #ifdef JPATCH_HDE | 510 | #ifdef JPATCH_HDE |
505 | tr("Can't create directory\n.../Documents/application\n\nZSafe will now exit.")); | 511 | tr("Can't create directory\n.../Documents/application\n\nZSafe will now exit.")); |
506 | #else | 512 | #else |
507 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d1)); | 513 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d1)); |
508 | #endif | 514 | #endif |
509 | exitZs (1); | 515 | exitZs (1); |
510 | } | 516 | } |
511 | } | 517 | } |
512 | // #ifndef WIN32 | 518 | QString d2(QDir::homeDirPath() + "/Documents/application/zsafe"); |
513 | // QString d2("Documents/application/zsafe"); | ||
514 | // #else | ||
515 | QString d2(QDir::homeDirPath() + "/Documents/application/zsafe"); | ||
516 | // #endif | ||
517 | QDir pd2(d2); | 519 | QDir pd2(d2); |
518 | if (!pd2.exists()) | 520 | if (!pd2.exists()) |
519 | { | 521 | { |
520 | QDir pd2("Documents/application"); | 522 | QDir pd2(QDir::homeDirPath() + "Documents/application"); |
521 | if (!pd2.mkdir("zsafe", FALSE)) | 523 | if (!pd2.mkdir("zsafe", FALSE)) |
522 | { | 524 | { |
523 | QMessageBox::critical( 0, tr("ZSafe"), | 525 | QMessageBox::critical( 0, tr("ZSafe"), |
524 | #ifdef JPATCH_HDE | 526 | #ifdef JPATCH_HDE |
525 | tr("Can't create directory\n...//Documents/application/zsafe\n\nZSafe will now exit.")); | 527 | tr("Can't create directory\n...//Documents/application/zsafe\n\nZSafe will now exit.")); |
526 | #else | 528 | #else |
527 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d2)); | 529 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d2)); |
528 | #endif | 530 | #endif |
@@ -3642,23 +3644,25 @@ void ZSafe::resizeEvent ( QResizeEvent * ) | |||
3642 | // qWarning ("resizeEvent"); | 3644 | // qWarning ("resizeEvent"); |
3643 | #ifndef DESKTOP | 3645 | #ifndef DESKTOP |
3644 | DeskW = appl->desktop()->width(); | 3646 | DeskW = appl->desktop()->width(); |
3645 | DeskH = appl->desktop()->height(); | 3647 | DeskH = appl->desktop()->height(); |
3646 | #else | 3648 | #else |
3647 | DeskW = this->width(); | 3649 | DeskW = this->width(); |
3648 | DeskH = this->height(); | 3650 | DeskH = this->height(); |
3649 | #endif | 3651 | #endif |
3650 | qWarning( QString("Width : %1").arg(DeskW), 2000 ); | ||
3651 | qWarning( QString("Height: %1").arg(DeskH), 2000 ); | ||
3652 | 3652 | ||
3653 | New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) ); | 3653 | if (New) |
3654 | Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) ); | 3654 | New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) ); |
3655 | Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); | 3655 | if (Edit) |
3656 | Find->setGeometry ( QRect( DeskW-24, 2, 20, 20 ) ); | 3656 | Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) ); |
3657 | if (Delete) | ||
3658 | Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); | ||
3659 | if (Find) | ||
3660 | Find->setGeometry ( QRect( DeskW-24, 2, 20, 20 ) ); | ||
3657 | } | 3661 | } |
3658 | 3662 | ||
3659 | void ZSafe::slotRaiseTimer() | 3663 | void ZSafe::slotRaiseTimer() |
3660 | { | 3664 | { |
3661 | if (infoForm->isVisible()) | 3665 | if (infoForm->isVisible()) |
3662 | infoForm->raise(); | 3666 | infoForm->raise(); |
3663 | raiseFlag = true; | 3667 | raiseFlag = true; |
3664 | } | 3668 | } |