author | zcarsten <zcarsten> | 2003-08-20 16:57:52 (UTC) |
---|---|---|
committer | zcarsten <zcarsten> | 2003-08-20 16:57:52 (UTC) |
commit | fb3e8cda0d2c929278c7ecbf829475f8b1c92956 (patch) (side-by-side diff) | |
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 @@ -366,59 +366,65 @@ static const char* const general_data[] = { #ifdef DESKTOP #ifndef WIN32 conf = new QSettings (); conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath()); #else conf = new QSettings (cfgFile); conf->insertSearchPath (QSettings::Unix, cfgFile); #endif #else conf = new Config (cfgFile, Config::File); conf->setGroup ("zsafe"); #endif } } /* * Constructs a ZSafe which is a child of 'parent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) + : QDialog( parent, name, modal, fl ), + Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l) { IsCut = false; IsCopy = false; modified = false; // set the config file cfgFile=QDir::homeDirPath(); cfgFile += "/.zsafe.cfg"; // set the icon path +#ifdef NO_OPIE QString qpedir ((const char *)getenv("QPEDIR")); +#else + QString qpedir ((const char *)getenv("OPIEDIR")); +#endif + #ifdef DESKTOP iconPath = QDir::homeDirPath() + "/pics/"; #else if (qpedir.isEmpty()) iconPath = "/home/QtPalmtop/pics/"; else iconPath = qpedir + "/pics/"; #endif // create a zsafe configuration object #ifdef DESKTOP #ifndef WIN32 conf = new QSettings (); conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath()); #else conf = new QSettings (cfgFile); conf->insertSearchPath (QSettings::Unix, cfgFile); #endif #else conf = new Config (cfgFile, Config::File); conf->setGroup ("zsafePrefs"); #endif #ifdef DESKTOP // #ifndef WIN32 @@ -488,57 +494,53 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) { // check if the directory application exists, if not // create it // #ifndef WIN32 // QString d1("Documents/application"); // #else QString d1(QDir::homeDirPath() + "/Documents/application"); // #endif QDir pd1(d1); if (!pd1.exists()) { QDir pd1("Documents"); if (!pd1.mkdir("application", FALSE)) { QMessageBox::critical( 0, tr("ZSafe"), #ifdef JPATCH_HDE tr("Can't create directory\n.../Documents/application\n\nZSafe will now exit.")); #else tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d1)); #endif exitZs (1); } } -// #ifndef WIN32 - // QString d2("Documents/application/zsafe"); -// #else - QString d2(QDir::homeDirPath() + "/Documents/application/zsafe"); -// #endif + QString d2(QDir::homeDirPath() + "/Documents/application/zsafe"); QDir pd2(d2); if (!pd2.exists()) { - QDir pd2("Documents/application"); + QDir pd2(QDir::homeDirPath() + "Documents/application"); if (!pd2.mkdir("zsafe", FALSE)) { QMessageBox::critical( 0, tr("ZSafe"), #ifdef JPATCH_HDE tr("Can't create directory\n...//Documents/application/zsafe\n\nZSafe will now exit.")); #else tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d2)); #endif exitZs (1); } } // set the default filename filename=d2 + "/passwords.zsf"; // save the current filename to the config file conf->writeEntry(APP_KEY+"document", filename); saveConf(); } //if (filename == "INVALIDPWD") //filename = ""; @@ -3626,55 +3628,57 @@ void ZSafe::setExpandFlag() } void ZSafe::paintEvent( QPaintEvent * ) { if (raiseFlag) { raiseFlag = false; raiseTimer.start (1, true); if (infoForm->isVisible()) infoForm->raise(); } } void ZSafe::resizeEvent ( QResizeEvent * ) { // qWarning ("resizeEvent"); #ifndef DESKTOP DeskW = appl->desktop()->width(); DeskH = appl->desktop()->height(); #else DeskW = this->width(); DeskH = this->height(); #endif - qWarning( QString("Width : %1").arg(DeskW), 2000 ); - qWarning( QString("Height: %1").arg(DeskH), 2000 ); - New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) ); - Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) ); - Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); - Find->setGeometry ( QRect( DeskW-24, 2, 20, 20 ) ); + if (New) + New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) ); + if (Edit) + Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) ); + if (Delete) + Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); + if (Find) + Find->setGeometry ( QRect( DeskW-24, 2, 20, 20 ) ); } void ZSafe::slotRaiseTimer() { if (infoForm->isVisible()) infoForm->raise(); raiseFlag = true; } QPixmap * ZSafe::getPredefinedIcon(QString category) { QPixmap *pm; if (category == "Bank cards") pm = new QPixmap((const char**)bank_cards_data); else if (category == "Passwords") pm = new QPixmap((const char**)passwords_data); else if (category == "Software") pm = new QPixmap((const char**)software_data); else if (category == "General") pm = new QPixmap((const char**)general_data); else pm = new QPixmap((const char**)general_data); return pm; } |