~ubuntu-branches/ubuntu/trusty/kvirc/trusty

« back to all changes in this revision

Viewing changes to src/kvirc/ui/KviMainWindow.cpp

  • Committer: Package Import Robot
  • Author(s): Kai Wasserbäch
  • Date: 2011-09-29 16:27:07 UTC
  • mfrom: (0.3.15 upstream)
  • Revision ID: package-import@ubuntu.com-20110929162707-t29s6itjnsg2syuf
Tags: 4:4.1.3+20110929.svn5980-1
The "Balance of Power" release.

* Synced to upstream's SVN revision 5980.
* debian/control:
  - Vcs-* fields updated.
  - Remove libcrypto++-dev from B-Ds, was dropped upstream.
  - Bumped B-D on debhelper to >= 8.9.4.
* debian/rules:
  - Remove a now obsolete flag.
  - Upstream fixed a typo in a configuration variable name (now
    WANT_COEXISTENCE), updated invocation.
* debian/compat: Now at 9.
* Make KVIrc multiarch ready:
  - debian/{kvirc,libkvilib4,kvirc-modules}.install: Split out binaries
    under /usr/lib.
  - debian/rules: Add -DLIB_SUFFIX to dh_auto_configure invocation.
  - debian/control:
    + Added new packages (needed for split).
    + Added Multi-Arch fields
    + Added Pre-Depends: multiarch-support and ${misc:Pre-Depends} where
      needed.
    + Bumped B-D on CMake.
  - debian/{kvirc,libkvilib4,kvirc-modules}.lintian-overrides: Moved and
    updated overrides to match new locations (one could be dropped in the
    process).

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
#include "KviKvsEventTriggers.h"
61
61
#include "KviTalPopupMenu.h"
62
62
#include "KviTextIconManager.h"
63
 
#include "kvi_shortcuts.h"
 
63
#include "KviShortcut.h"
64
64
 
65
65
#define _WANT_OPTION_FLAGS_
66
66
#include "KviOptions.h"
243
243
                closeWindow(m_pWinList->first());
244
244
 
245
245
        delete m_pWinList;
 
246
        delete m_pAccellerators;
246
247
 
247
248
        g_pMainWindow = 0;
248
249
 
301
302
 
302
303
void KviMainWindow::installAccelerators()
303
304
{
304
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_PREV),this,SLOT(switchToPrevWindow()),0,Qt::ApplicationShortcut);
305
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_NEXT),this,SLOT(switchToNextWindow()),0,Qt::ApplicationShortcut);
306
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_PREV_CONTEXT),this,SLOT(switchToPrevWindowInContext()),0,Qt::ApplicationShortcut);
307
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_NEXT_CONTEXT),this,SLOT(switchToNextWindowInContext()),0,Qt::ApplicationShortcut);
308
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_PREV_HIGHLIGHT),this,SLOT(switchToPrevHighlightedWindow()),0,Qt::ApplicationShortcut);
309
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_NEXT_HIGHLIGHT),this,SLOT(switchToNextHighlightedWindow()),0,Qt::ApplicationShortcut);
310
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_MAXIMIZE),this,SLOT(maximizeWindow()),0,Qt::ApplicationShortcut);
311
 
        new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_MINIMIZE),this,SLOT(minimizeWindow()),0,Qt::ApplicationShortcut);
 
305
        m_pAccellerators = new KviPointerList<QShortcut>;
 
306
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_PREV,this,SLOT(switchToPrevWindow()),0,Qt::ApplicationShortcut));
 
307
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_NEXT,this,SLOT(switchToNextWindow()),0,Qt::ApplicationShortcut));
 
308
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_PREV_CONTEXT,this,SLOT(switchToPrevWindowInContext()),0,Qt::ApplicationShortcut));
 
309
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_NEXT_CONTEXT,this,SLOT(switchToNextWindowInContext()),0,Qt::ApplicationShortcut));
 
310
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_PREV_HIGHLIGHT,this,SLOT(switchToPrevHighlightedWindow()),0,Qt::ApplicationShortcut));
 
311
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_NEXT_HIGHLIGHT,this,SLOT(switchToNextHighlightedWindow()),0,Qt::ApplicationShortcut));
 
312
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_MAXIMIZE,this,SLOT(maximizeWindow()),0,Qt::ApplicationShortcut));
 
313
        m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_MINIMIZE,this,SLOT(minimizeWindow()),0,Qt::ApplicationShortcut));
312
314
 
313
315
        static int accel_table[] = {
314
316
                Qt::Key_1 + Qt::ControlModifier,       // script accels...
338
340
        int i=0, keys=0;
339
341
        while((keys = accel_table[i]))
340
342
        {
341
 
                new QShortcut(QKeySequence(keys),this,SLOT(accelActivated()),SLOT(accelActivated()),Qt::ApplicationShortcut);
 
343
                m_pAccellerators->append(KviShortcut::create(keys,this,SLOT(accelActivated()),SLOT(accelActivated()),Qt::ApplicationShortcut));
342
344
                i++;
343
345
        }
344
346
}
345
347
 
 
348
void KviMainWindow::freeAccelleratorKeySequence(QString & key)
 
349
{
 
350
        QKeySequence kS(key);
 
351
        for(QShortcut * pS = m_pAccellerators->first();pS;pS = m_pAccellerators->next())
 
352
        {
 
353
                if(pS->key() == kS)
 
354
                {
 
355
                        m_pAccellerators->removeRef(pS);
 
356
                        return;
 
357
                }
 
358
        }
 
359
}
 
360
 
346
361
void KviMainWindow::accelActivated()
347
362
{
348
363
        KVS_TRIGGER_EVENT_1(KviEvent_OnAccelKeyPressed,g_pActiveWindow,(QString)(((QShortcut *)sender())->key()));
500
515
        if(g_pWinPropertiesConfig->hasGroup(group))
501
516
        {
502
517
                g_pWinPropertiesConfig->setGroup(group);
 
518
        } else if(wnd->type() == KviWindow::Channel && 
 
519
                g_pWinPropertiesConfig->hasGroup(group = wnd->windowName())
 
520
        ) {
 
521
                // try to load pre-4.2 channel settings
 
522
                g_pWinPropertiesConfig->setGroup(group);
503
523
        } else {
504
524
                bGroupSettings = true;
505
525
                if(g_pWinPropertiesConfig->hasGroup(wnd->typeString()))
897
917
#ifdef COMPILE_PSEUDO_TRANSPARENCY
898
918
        uint uOpacity = KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent) < 50 ? 50 : KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent);
899
919
        setWindowOpacity((float) uOpacity / 100);
 
920
        #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
 
921
                #ifndef Q_WS_EX_LAYERED
 
922
                        #define Q_WS_EX_LAYERED WS_EX_LAYERED
 
923
                #endif
 
924
        if(uOpacity < 100)
 
925
        {
 
926
        SetWindowLong(effectiveWinId(), GWL_EXSTYLE,
 
927
                        GetWindowLong(effectiveWinId(), GWL_EXSTYLE) | Q_WS_EX_LAYERED);
 
928
    } else {
 
929
        SetWindowLong(effectiveWinId(), GWL_EXSTYLE,
 
930
            GetWindowLong(effectiveWinId(), GWL_EXSTYLE) & ~Q_WS_EX_LAYERED);
 
931
    }
 
932
        #endif
900
933
        if(g_pShadedParentGlobalDesktopBackground)m_pMdi->viewport()->update();
901
934
 
902
935
        if(g_pShadedChildGlobalDesktopBackground)