Changeset 428 for trunk/src


Ignore:
Timestamp:
Dec 16, 2009, 1:52:19 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Implemented QSessionManager and removed the QT_NO_SESSIONMANAGER define (closes #100).

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/kernel/qcoreapplication.h

    r327 r428  
    207207
    208208    friend class QEventDispatcherUNIXPrivate;
     209
    209210    friend class QApplication;
    210211    friend class QApplicationPrivate;
  • trunk/src/corelib/kernel/qcoreapplication_p.h

    r2 r428  
    8282    static void removePostedTimerEvent(QObject *object, int timerId);
    8383#endif
     84
     85
     86
    8487
    8588#ifdef Q_OS_MAC
  • trunk/src/corelib/kernel/qeventdispatcher_pm.cpp

    r302 r428  
    12531253            if (haveMessage) {
    12541254                if (msg.msg == WM_QUIT) {
    1255                     if (QCoreApplication::instance())
    1256                         QCoreApplication::instance()->quit();
     1255                    if (QCoreApplication::instance()) {
     1256                        if (QCoreApplication::instance()->d_func()->canQuit()) {
     1257                            QCoreApplication::instance()->quit();
     1258                            return true;
     1259                        } else {
     1260                            WinCancelShutdown(d->hmq, FALSE);
     1261                            return true;
     1262                        }
     1263                    }
    12571264                    return false;
    12581265                }
  • trunk/src/gui/kernel/qapplication.cpp

    r182 r428  
    43694369 *****************************************************************************/
    43704370#ifndef QT_NO_SESSIONMANAGER
    4371 #if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
     4371#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
    43724372
    43734373#if defined(Q_OS_WINCE)
     
    44514451#endif
    44524452
    4453 #if !defined(Q_WS_WIN)
     4453#if !defined(Q_WS_WIN)
    44544454bool QSessionManager::allowsInteraction()
    44554455{
  • trunk/src/gui/kernel/qapplication_p.h

    r95 r428  
    425425    void sendSyntheticEnterLeave(QWidget *widget);
    426426#endif
     427
     428
     429
    427430
    428431private:
  • trunk/src/gui/kernel/qapplication_pm.cpp

    r412 r428  
    5454#include "qpixmapcache.h"
    5555#include "qdesktopwidget.h"
     56
    5657
    5758#include "qset.h"
     
    7778#if !defined (QT_NO_SESSIONMANAGER)
    7879
     80
     81
    7982// Session management
    80 static bool     sm_blockUserInput    = FALSE;
    81 
    82 //#define DEBUG_SESSIONMANAGER
     83static bool     sm_blockUserInput    = false;
     84static bool     sm_smActive          = false;
     85static bool     sm_cancel            = false;
     86static bool     sm_gracefulShutdown  = false;
     87static bool     sm_quitSkipped       = false;
     88
     89extern QSessionManager *qt_session_manager_self; // defined in qapplication.cpp
     90extern bool qt_about_to_destroy_wnd; // defined in qwidget_pm.cpp
    8391
    8492#endif
     
    765773        switch(msg) {
    766774
     775
     776
     777
     778
     779
     780
     781
     782
     783
     784
     785
     786
     787
     788
     789
     790
     791
     792
     793
     794
     795
     796
     797
     798
     799
     800
     801
     802
     803
     804
     805
     806
     807
     808
     809
     810
     811
     812
     813
     814
     815
     816
     817
     818
     819
     820
     821
     822
     823
     824
     825
     826
    767827        case WM_SYSVALUECHANGED: {
    768828            // This message is sent to all top-level widgets, handle only once
     
    785845            }
    786846            #undef MY_IS_SV
     847
     848
     849
     850
     851
     852
     853
     854
     855
     856
     857
     858
     859
    787860            break;
    788861        }
     
    22222295}
    22232296
     2297
     2298
     2299
     2300
     2301
     2302
     2303
     2304
     2305
     2306
     2307
     2308
     2309
     2310
     2311
     2312
     2313
     2314
     2315
     2316
     2317
     2318
     2319
     2320
     2321
     2322
     2323
     2324
     2325
     2326
     2327
     2328
     2329
     2330
     2331
     2332
     2333
     2334
     2335
     2336
     2337
     2338
     2339
     2340
     2341
     2342
     2343
     2344
     2345
     2346
     2347
     2348
     2349
     2350
     2351
     2352
     2353
     2354
     2355
     2356
     2357
     2358
     2359
     2360
     2361
     2362
     2363
     2364
     2365
     2366
     2367
     2368
     2369
     2370
     2371
     2372
     2373
     2374
     2375
     2376
     2377
     2378
     2379
     2380
     2381
     2382
     2383
     2384
     2385
     2386
     2387
     2388
     2389
     2390
     2391
     2392
     2393
     2394
     2395
     2396
    22242397
    22252398/*!
     
    22542427    return QString(QLatin1String("<no-widget>"));
    22552428}
    2256 
    2257 /*****************************************************************************
    2258   PM struct/message debug helpers
    2259  *****************************************************************************/
    22602429
    22612430typedef QLatin1String QCStr;
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r309 r428  
    7171extern PFNWP QtOldFrameProc;
    7272extern MRESULT EXPENTRY QtFrameProc(HWND, ULONG, MPARAM, MPARAM);
     73
     74
     75
     76
    7377
    7478typedef QSet<QString> WinClassNameHash;
Note: See TracChangeset for help on using the changeset viewer.