Esempio n. 1
0
void CMakeAviDlg::OnEditClearList() {
  m_nameArray.clear();
  m_nameList.DeleteAllItems();
  unloadPicture();
  updateWindowState();
  updatePreview();
}
Esempio n. 2
0
void CMakeAviDlg::OnEditDeleteSelected() {
  int index = getSelectedIndex();
  if(index >= 0) {
    m_nameArray.removeIndex(index);
    m_nameList.DeleteItem(index);
    if(m_nameArray.size() > 0) {
      index = min(index, (int)m_nameArray.size()-1);
      loadPicture(m_nameArray[index]);
      if(m_currentPicture.isLoaded()) {
        setSelectedIndex(m_nameList, index);
      }
    } else {
      unloadPicture();
    }
    updateWindowState();
    updatePreview();
  }
}
Esempio n. 3
0
void CMakeAviDlg::OnPaint()  {
  if(IsIconic()) {
    CPaintDC dc(this);

    SendMessage(WM_ICONERASEBKGND, (WPARAM)dc.GetSafeHdc(), 0);

    // Center icon in client rectangle
    const int   cxIcon = GetSystemMetrics(SM_CXICON);
    const int   cyIcon = GetSystemMetrics(SM_CYICON);
    const CRect rect   = getClientRect(this);
    const int   x      = (rect.Width() - cxIcon + 1) / 2;
    const int   y      = (rect.Height() - cyIcon + 1) / 2;
    dc.DrawIcon(x, y, m_hIcon);
  } else {
    __super::OnPaint();
    updateWindowState();
  }
}
Esempio n. 4
0
void CMakeAviDlg::OnChangeEditUseEvery() {
  updateWindowState();
}
Esempio n. 5
0
void CMakeAviDlg::OnChangeEditFramePerSec() {
  updateWindowState();
}
Esempio n. 6
0
ModalLayerWindow::ModalLayerWindow()
{
    setWindowTitle("fpscuiwindow");
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(updateWindowState()));
}
Esempio n. 7
0
WindowsModel::WindowsModel (QObject *parent)
    : QAbstractItemModel (parent)
    , CurrentDesktop_ (Util::XWrapper::Instance ().GetCurrentDesktop ())
    , ImageProvider_ (new TaskbarImageProvider (QIcon::fromTheme ("xorg")))
{
    auto& w = Util::XWrapper::Instance ();
    auto windows = w.GetWindows ();
    for (auto wid : windows)
        AddWindow (wid, w);

    connect (&w,
             SIGNAL (windowListChanged ()),
             this,
             SLOT (updateWinList ()));
    connect (&w,
             SIGNAL (activeWindowChanged ()),
             this,
             SLOT (updateActiveWindow ()));

    connect (&w,
             SIGNAL (windowNameChanged (ulong)),
             this,
             SLOT (updateWindowName (ulong)));
    connect (&w,
             SIGNAL (windowIconChanged (ulong)),
             this,
             SLOT (updateWindowIcon (ulong)));
    connect (&w,
             SIGNAL (windowStateChanged (ulong)),
             this,
             SLOT (updateWindowState (ulong)));
    connect (&w,
             SIGNAL (windowActionsChanged (ulong)),
             this,
             SLOT (updateWindowActions (ulong)));
    connect (&w,
             SIGNAL (windowDesktopChanged (ulong)),
             this,
             SLOT (updateWindowDesktop (ulong)));
    connect (&w,
             SIGNAL (desktopChanged ()),
             this,
             SLOT (updateCurrentDesktop ()));

    QHash<int, QByteArray> roleNames;
    roleNames [Role::WindowName] = "windowName";
    roleNames [Role::WindowID] = "windowID";
    roleNames [Role::IconGenID] = "iconGenID";
    roleNames [Role::IsCurrentDesktop] = "isCurrentDesktop";
    roleNames [Role::IsActiveWindow] = "isActiveWindow";
    roleNames [Role::IsMinimizedWindow] = "isMinimizedWindow";
    setRoleNames (roleNames);

    int eventBase, errorBase;
    if (XCompositeQueryExtension (w.GetDisplay (), &eventBase, &errorBase))
    {
        int major = 0, minor = 2;
        XCompositeQueryVersion (w.GetDisplay (), &major, &minor);

        if (major > 0 || minor >= 2)
            qDebug () << "all good, has NamePixmap";
    }
}