summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/UI
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2017-11-06 14:07:41 +0200
committerTomi Korpipää <tomi.korpipaa@qt.io>2017-11-09 11:32:50 +0000
commit98da2a3133fea5d48446a340ab99a5f51dba0e1f (patch)
treef190e602d0c28cbe8ee5b7c3d2d46c72568ee0ae /src/Authoring/Studio/UI
parent8fd8581427c9685f89d00933255bf9f19a78b6f3 (diff)
Remove unused code from Views
Change-Id: I40862e7a146225ba94a284bcd1a69a3363d1c853 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/UI')
-rw-r--r--src/Authoring/Studio/UI/PaletteState.cpp160
-rw-r--r--src/Authoring/Studio/UI/PaletteState.h69
2 files changed, 0 insertions, 229 deletions
diff --git a/src/Authoring/Studio/UI/PaletteState.cpp b/src/Authoring/Studio/UI/PaletteState.cpp
deleted file mode 100644
index 52750593..00000000
--- a/src/Authoring/Studio/UI/PaletteState.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "stdafx.h"
-
-#include "PaletteState.h"
-#include "Preferences.h"
-
-CPaletteState::CPaletteState(Q3DStudio::CString inWindowName)
- : m_WindowName(inWindowName)
- , m_Maximized(false)
- , m_IsVisible(false)
-{
-}
-
-CPaletteState::~CPaletteState()
-{
-}
-
-CPt CPaletteState::GetPosition() const
-{
- return m_Position;
-}
-
-void CPaletteState::SetPosition(CPt inPosition)
-{
- m_Position = inPosition;
-}
-
-CPt CPaletteState::GetSize() const
-{
- return m_Size;
-}
-
-void CPaletteState::SetSize(CPt inSize)
-{
- m_Size = inSize;
-}
-
-bool CPaletteState::IsVisible() const
-{
- return m_IsVisible;
-}
-
-void CPaletteState::SetVisible(bool inIsVisible)
-{
- m_IsVisible = inIsVisible;
-}
-
-void CPaletteState::LoadState()
-{
- RestoreDefaults();
-
- CPreferences thePrefs = CPreferences::GetUserPreferences(m_WindowName);
-
- m_Maximized = static_cast<bool>(thePrefs.GetValue("maximized", m_Maximized));
- m_Position.x = thePrefs.GetLongValue("positionX", m_Position.x);
- m_Position.y = thePrefs.GetLongValue("positionY", m_Position.y);
- m_Size.x = thePrefs.GetLongValue("sizeX", m_Size.x);
- m_Size.y = thePrefs.GetLongValue("sizeY", m_Size.y);
- m_IsVisible = static_cast<bool>(thePrefs.GetValue("visible", m_IsVisible));
-}
-
-void CPaletteState::SaveState() const
-{
- CPreferences thePrefs = CPreferences::GetUserPreferences(m_WindowName);
-
- thePrefs.SetValue("maximized", m_Maximized);
- if (!m_Maximized) {
- thePrefs.SetLongValue("positionX", m_Position.x);
- thePrefs.SetLongValue("positionY", m_Position.y);
- thePrefs.SetLongValue("sizeX", m_Size.x);
- thePrefs.SetLongValue("sizeY", m_Size.y);
- }
- thePrefs.SetValue("visible", m_IsVisible);
-}
-
-void CPaletteState::RestoreDefaults()
-{
- CPt theDisplaySize = ::GetAvailableDisplaySize();
- CPt theInitialPos = GetDisplaySize();
-
- if (m_WindowName == "Library") {
- m_Position.x = theInitialPos.x;
- m_Position.y = theInitialPos.y;
- m_Size.x = ::dtol(theDisplaySize.x * .25);
- m_Size.y = ::dtol(theDisplaySize.y * .60);
- m_IsVisible = true;
- } else if (m_WindowName == "Timeline") {
- m_Position.x = ::dtol(theDisplaySize.x * .25) + theInitialPos.x;
- m_Position.y = ::dtol(theDisplaySize.y * .60) + theInitialPos.y;
- m_Size.x = ::dtol(theDisplaySize.x * .50);
- m_Size.y = ::dtol(theDisplaySize.y * .40);
- m_IsVisible = true;
- } else if (m_WindowName == "Storage") {
- m_Position.x = ::dtol(theDisplaySize.x * .75) + theInitialPos.x;
- m_Position.y = ::dtol(theDisplaySize.y * .60) + theInitialPos.y;
- m_Size.x = ::dtol(theDisplaySize.x * .25);
- m_Size.y = ::dtol(theDisplaySize.y * .40);
- m_IsVisible = true;
- } else if (m_WindowName == "MainWindow") {
- // m_Position.x = ::dtol( theDisplaySize.x * .25 ) + theInitialPos.x;
- m_Position.x = theInitialPos.x;
- m_Position.y = theInitialPos.y;
- // m_Size.x = ::dtol( theDisplaySize.x * .50 );
- // m_Size.y = ::dtol( theDisplaySize.y * .60 );
- m_Size.x = ::dtol(theDisplaySize.x * 1.0);
- m_Size.y = ::dtol(theDisplaySize.y * 1.0);
- m_IsVisible = true;
- } else if (m_WindowName == "Inspector") {
- m_Position.x = theInitialPos.x;
- m_Position.y = ::dtol(theDisplaySize.y * .60) + theInitialPos.y;
- m_Size.x = ::dtol(theDisplaySize.x * .25);
- m_Size.y = ::dtol(theDisplaySize.y * .40);
- m_IsVisible = true;
- } else {
- m_Position.x = theInitialPos.x;
- m_Position.y = ::dtol(theDisplaySize.y * .50);
- m_Size.x = ::dtol(theDisplaySize.x * .25);
- m_Size.y = ::dtol(theDisplaySize.y * .50);
- m_IsVisible = true;
- }
-}
-
-//=============================================================================
-/**
-* @return Returns the resolution in pixels of the current primary display.
- */
-CPt CPaletteState::GetDisplaySize() const
-{
- // return CPt( 0, 0 );
- CRect theWorkArea;
- SystemParametersInfo(SPI_GETWORKAREA, 0, &theWorkArea, FALSE);
- return CPt(theWorkArea.left, theWorkArea.top);
-}
diff --git a/src/Authoring/Studio/UI/PaletteState.h b/src/Authoring/Studio/UI/PaletteState.h
deleted file mode 100644
index c56b48e6..00000000
--- a/src/Authoring/Studio/UI/PaletteState.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_PALETTE_STATE_H
-#define INCLUDED_PALETTE_STATE_H 1
-
-#pragma once
-
-#include "Pt.h"
-
-class CPaletteState
-{
-public:
- CPaletteState(Q3DStudio::CString inWindowName);
- virtual ~CPaletteState();
-
- bool IsMaximized() const { return m_Maximized; }
- void SetMaximized(bool inMaximized) { m_Maximized = inMaximized; }
-
- CPt GetPosition() const;
- void SetPosition(CPt inPosition);
-
- CPt GetSize() const;
- void SetSize(CPt inSize);
-
- bool IsVisible() const;
- void SetVisible(bool inIsVisible);
-
- void SaveState() const;
- void LoadState();
-
- void RestoreDefaults();
-
-protected:
- CPt GetDisplaySize() const;
-
- Q3DStudio::CString m_WindowName;
- bool m_Maximized;
- CPt m_Position;
- CPt m_Size;
- bool m_IsVisible;
-};
-
-#endif // INCLUDED_PALETTE_STATE_H