Ignore:
Timestamp:
Sep 5, 2006, 1:31:01 AM (19 years ago)
Author:
dmik
Message:

UI: Misc changes:

  • Added OS/2-related definitions.
  • On all platforms but Mac, the main (roster) window will be minimized (instead of closing) when Esc is pressed, but the doclet window is disabled.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • psi/trunk/src/common.cpp

    r2 r19  
    2727
    2828QString PROG_NAME = "Psi";
     29#ifdef Q_WS_PM
     30QString PROG_VERSION = "0.10-os2-b1 (" __DATE__ ")"; // OS/2 versions are betas yet
     31#else
    2932//QString PROG_VERSION = "0.11-dev" " (" __DATE__ ")"; //CVS Builds are dated
    3033QString PROG_VERSION = "0.10";
     34#endif
    3135
    3236#ifdef HAVE_CONFIG
     
    5862#ifdef Q_WS_WIN
    5963#include<windows.h>
     64#endif
     65
     66#ifdef Q_WS_PM
     67#include<sys/types.h>
     68#include<sys/stat.h>
    6069#endif
    6170
     
    9951004                useCustom = FALSE;
    9961005#endif
     1006#ifdef Q_WS_PM
     1007        /// @todo (dmik) use HINI_USER_PROFILE\WPURLDEFAULTSETTINGS\DefaultBrowserExe
     1008#endif
    9971009#ifdef Q_WS_X11
    9981010        if(option.browser == 0 || option.browser == 2)
     
    10401052                        QMessageBox::critical(0, CAP(QObject::tr("URL error")), QObject::tr("Unable to open the URL. Ensure that you have a web browser installed."));
    10411053                }
     1054#endif
     1055#ifdef Q_WS_PM
     1056        /// @todo (dmik) use HINI_USER_PROFILE\WPURLDEFAULTSETTINGS\DefaultBrowserExe
    10421057#endif
    10431058#ifdef Q_WS_X11
     
    11021117static void getSysInfo()
    11031118{
    1104 #if defined(Q_WS_X11) || defined(Q_WS_MAC)
     1119#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_PM)
     1120        /// @todo (dmik) test it
    11051121        time_t x;
    11061122        time(&x);
     
    12061222                }
    12071223        }
     1224#elif defined(Q_WS_PM)
     1225        os_str = "OS/2";
    12081226#elif defined(Q_WS_MAC)
    12091227        os_str = "Mac OS X";
     
    13281346        else
    13291347                base = QDir::homeDirPath();
     1348
     1349        // no trailing slash
     1350        if(base.at(base.length()-1) == '/')
     1351                base.truncate(base.length()-1);
     1352
     1353        QDir proghome(base + "/PsiData");
     1354        if(!proghome.exists()) {
     1355                QDir home(base);
     1356                home.mkdir("PsiData");
     1357        }
     1358
     1359        return proghome.path();
     1360}
     1361#endif
     1362
     1363#ifdef Q_WS_PM
     1364QString getResourcesDir()
     1365{
     1366#if QT_VERSION >= 0x030200
     1367        return qApp->applicationDirPath();
     1368#else
     1369#  error Not implemented!
     1370#endif
     1371}
     1372
     1373QString getHomeDir()
     1374{
     1375        QString base = QDir::homeDirPath();
    13301376
    13311377        // no trailing slash
     
    14651511                return;
    14661512
    1467 #if defined(Q_WS_WIN) || defined(Q_WS_MAC)
     1513#if defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_WS_MAC)
    14681514        QSound::play(str);
    14691515#else
Note: See TracChangeset for help on using the changeset viewer.