1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Fixed issues with download manager on windows, added possibility to

build W7API with msvc 2008, width of locationbar, websearchbar and
sidebars is now saved
This commit is contained in:
nowrep 2011-10-17 09:59:09 +02:00
parent 6f395631ad
commit a46ea19a25
17 changed files with 388 additions and 27 deletions

323
src/3rdparty/msvc2008.h vendored Normal file
View File

@ -0,0 +1,323 @@
#ifndef MSVC2008_H
#define MSVC2008_H
//Neccessary declarations to use new Windows 7 API with Microsoft Visual C++ 2008 compiler
//However, it is still needed to link against newer libraries from Visual C++ 2010
#if (_MSC_VER >= 1500 && _MSC_VER < 1600) //Microsoft Visual C++ 2008
#include "rpc.h"
#include "rpcndr.h"
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __objectarray_h__
#define __objectarray_h__
#pragma once
/* Forward Declarations */
#ifndef __IObjectArray_FWD_DEFINED__
#define __IObjectArray_FWD_DEFINED__
typedef interface IObjectArray IObjectArray;
#endif /* __IObjectArray_FWD_DEFINED__ */
#ifndef __IObjectCollection_FWD_DEFINED__
#define __IObjectCollection_FWD_DEFINED__
typedef interface IObjectCollection IObjectCollection;
#endif /* __IObjectCollection_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/*
****************************************************************************************************
IObjectArray
<from ObjectArray.h>
****************************************************************************************************
*/
#ifndef __IObjectArray_INTERFACE_DEFINED__
#define __IObjectArray_INTERFACE_DEFINED__
/* interface IObjectArray */
/* [unique][object][uuid][helpstring] */
EXTERN_C const IID IID_IObjectArray;
MIDL_INTERFACE("92CA9DCD-5622-4bba-A805-5E9F541BD8C9")
IObjectArray : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCount(
/* [out] */ __RPC__out UINT *pcObjects) = 0;
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ UINT uiIndex,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */ __RPC__deref_out_opt void **ppv) = 0;
};
#endif /* __IObjectArray_INTERFACE_DEFINED__ */
#ifndef __IObjectCollection_INTERFACE_DEFINED__
#define __IObjectCollection_INTERFACE_DEFINED__
/* interface IObjectCollection */
/* [unique][object][uuid] */
EXTERN_C const IID IID_IObjectCollection;
MIDL_INTERFACE("5632b1a4-e38a-400a-928a-d4cd63230295")
IObjectCollection : public IObjectArray
{
public:
virtual HRESULT STDMETHODCALLTYPE AddObject(
/* [in] */ __RPC__in_opt IUnknown *punk) = 0;
virtual HRESULT STDMETHODCALLTYPE AddFromArray(
/* [in] */ __RPC__in_opt IObjectArray *poaSource) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveObjectAt(
/* [in] */ UINT uiIndex) = 0;
virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0;
};
#endif /* __IObjectCollection_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************************************
ICustomDestinationList
<from ShObjIdl.h>
****************************************************************************************************
*/
typedef interface ICustomDestinationList ICustomDestinationList;
/* interface ICustomDestinationList */
/* [unique][object][uuid] */
typedef /* [v1_enum] */
enum KNOWNDESTCATEGORY
{ KDC_FREQUENT = 1,
KDC_RECENT = ( KDC_FREQUENT + 1 )
} KNOWNDESTCATEGORY;
EXTERN_C const IID IID_ICustomDestinationList;
MIDL_INTERFACE("6332debf-87b5-4670-90c0-5e57b408a49e")
ICustomDestinationList : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetAppID(
/* [string][in] */ __RPC__in_string LPCWSTR pszAppID) = 0;
virtual HRESULT STDMETHODCALLTYPE BeginList(
/* [out] */ __RPC__out UINT *pcMinSlots,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */ __RPC__deref_out_opt void **ppv) = 0;
virtual HRESULT STDMETHODCALLTYPE AppendCategory(
/* [string][in] */ __RPC__in_string LPCWSTR pszCategory,
/* [in] */ __RPC__in_opt IObjectArray *poa) = 0;
virtual HRESULT STDMETHODCALLTYPE AppendKnownCategory(
/* [in] */ KNOWNDESTCATEGORY category) = 0;
virtual HRESULT STDMETHODCALLTYPE AddUserTasks(
/* [in] */ __RPC__in_opt IObjectArray *poa) = 0;
virtual HRESULT STDMETHODCALLTYPE CommitList( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRemovedDestinations(
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */ __RPC__deref_out_opt void **ppv) = 0;
virtual HRESULT STDMETHODCALLTYPE DeleteList(
/* [string][unique][in] */ __RPC__in_opt_string LPCWSTR pszAppID) = 0;
virtual HRESULT STDMETHODCALLTYPE AbortList( void) = 0;
};
/*
****************************************************************************************************
CLSID_EnumerableObjectCollection + CLSID_DestinationList
<from ShObjIdl.h>
****************************************************************************************************
*/
EXTERN_C const CLSID CLSID_EnumerableObjectCollection;
#ifdef __cplusplus
class DECLSPEC_UUID("2d3468c1-36a7-43b6-ac24-d3f02fd9607a")
EnumerableObjectCollection;
#endif
EXTERN_C const CLSID CLSID_DestinationList;
#ifdef __cplusplus
class DECLSPEC_UUID("77f10cf0-3db5-4966-b520-b7c54fd35ed6")
DestinationList;
#endif
/*
****************************************************************************************************
ITaskbarList3
<from ShObjIdl.h>
****************************************************************************************************
*/
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
extern "C++" { \
inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \
inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \
inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \
inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \
inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \
inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \
inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
}
#ifdef MIDL_PASS
typedef IUnknown *HIMAGELIST;
#endif
typedef /* [v1_enum] */
enum THUMBBUTTONFLAGS
{ THBF_ENABLED = 0,
THBF_DISABLED = 0x1,
THBF_DISMISSONCLICK = 0x2,
THBF_NOBACKGROUND = 0x4,
THBF_HIDDEN = 0x8,
THBF_NONINTERACTIVE = 0x10
} THUMBBUTTONFLAGS;
DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONFLAGS)
typedef /* [v1_enum] */
enum THUMBBUTTONMASK
{ THB_BITMAP = 0x1,
THB_ICON = 0x2,
THB_TOOLTIP = 0x4,
THB_FLAGS = 0x8
} THUMBBUTTONMASK;
DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONMASK)
#include <pshpack8.h>
typedef struct THUMBBUTTON
{
THUMBBUTTONMASK dwMask;
UINT iId;
UINT iBitmap;
HICON hIcon;
WCHAR szTip[ 260 ];
THUMBBUTTONFLAGS dwFlags;
} THUMBBUTTON;
typedef struct THUMBBUTTON *LPTHUMBBUTTON;
#include <poppack.h>
#define THBN_CLICKED 0x1800
extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0093_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0093_v0_0_s_ifspec;
/* interface ITaskbarList3 */
/* [object][uuid] */
typedef /* [v1_enum] */
enum TBPFLAG
{ TBPF_NOPROGRESS = 0,
TBPF_INDETERMINATE = 0x1,
TBPF_NORMAL = 0x2,
TBPF_ERROR = 0x4,
TBPF_PAUSED = 0x8
} TBPFLAG;
DEFINE_ENUM_FLAG_OPERATORS(TBPFLAG)
EXTERN_C const IID IID_ITaskbarList3;
MIDL_INTERFACE("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")
ITaskbarList3 : public ITaskbarList2
{
public:
virtual HRESULT STDMETHODCALLTYPE SetProgressValue(
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ ULONGLONG ullCompleted,
/* [in] */ ULONGLONG ullTotal) = 0;
virtual HRESULT STDMETHODCALLTYPE SetProgressState(
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ TBPFLAG tbpFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE RegisterTab(
/* [in] */ __RPC__in HWND hwndTab,
/* [in] */ __RPC__in HWND hwndMDI) = 0;
virtual HRESULT STDMETHODCALLTYPE UnregisterTab(
/* [in] */ __RPC__in HWND hwndTab) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTabOrder(
/* [in] */ __RPC__in HWND hwndTab,
/* [in] */ __RPC__in HWND hwndInsertBefore) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTabActive(
/* [in] */ __RPC__in HWND hwndTab,
/* [in] */ __RPC__in HWND hwndMDI,
/* [in] */ DWORD dwReserved) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons(
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ UINT cButtons,
/* [size_is][in] */ __RPC__in_ecount_full(cButtons) LPTHUMBBUTTON pButton) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons(
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ UINT cButtons,
/* [size_is][in] */ __RPC__in_ecount_full(cButtons) LPTHUMBBUTTON pButton) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList(
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ __RPC__in_opt HIMAGELIST himl) = 0;
virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon(
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ __RPC__in HICON hIcon,
/* [string][unique][in] */ __RPC__in_opt_string LPCWSTR pszDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip(
/* [in] */ __RPC__in HWND hwnd,
/* [string][unique][in] */ __RPC__in_opt_string LPCWSTR pszTip) = 0;
virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip(
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ __RPC__in RECT *prcClip) = 0;
};
#endif //_MSC_VER >= 1500 && _MSC_VER < 1600
#endif // MSVC2008_H

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -39,6 +39,7 @@
#include <ShlObj.h>
#include <shlwapi.h>
#include <Propvarutil.h>
#include "msvc2008.h"
DEFINE_PROPERTYKEY(PKEY_Title, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 2);
DEFINE_PROPERTYKEY(PKEY_AppUserModel_IsDestListSeparator, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 6);

View File

@ -247,7 +247,8 @@ HEADERS += \
other/pagescreen.h \
downloads/downloadfilehelper.h \
tools/certificateinfowidget.h \
webview/webinspectordockwidget.h
webview/webinspectordockwidget.h \
3rdparty/msvc2008.h
FORMS += \
preferences/autofillmanager.ui \
@ -325,3 +326,4 @@ equals(d_w7api, "true") { DEFINES += W7API }
message(Using following defines)
message($$DEFINES)

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -60,7 +60,7 @@
const QString QupZilla::VERSION = "1.0.0-rc1";
const QString QupZilla::BUILDTIME = __DATE__" "__TIME__;
const QString QupZilla::AUTHOR = "nowrep";
const QString QupZilla::AUTHOR = "David Rosca";
const QString QupZilla::COPYRIGHT = "2010-2011";
const QString QupZilla::WWWADDRESS = "http://qupzilla.co.cc";
const QString QupZilla::WIKIADDRESS = "https://github.com/nowrep/QupZilla/wiki";
@ -88,6 +88,7 @@ QupZilla::QupZilla(bool tryRestore, QUrl startUrl)
, m_webInspectorDock(0)
, m_sideBar(0)
, m_statusBarMessage(new StatusBarMessage(this))
, m_sideBarWidth(0)
{
setObjectName("mainwindow");
setAttribute(Qt::WA_DeleteOnClose);
@ -164,6 +165,9 @@ void QupZilla::postLaunch()
void QupZilla::setupUi()
{
int locationBarWidth;
int websearchBarWidth;
QSettings settings(m_activeProfil+"settings.ini", QSettings::IniFormat);
settings.beginGroup("Browser-View-Settings");
if (settings.value("WindowMaximised", false).toBool()) {
@ -173,6 +177,9 @@ void QupZilla::setupUi()
setGeometry(settings.value("WindowGeometry", QRect(20, 20, 800, 550)).toRect());
}
locationBarWidth = settings.value("LocationBarWidth", 0).toInt();
websearchBarWidth = settings.value("WebSearchBarWidth", 0).toInt();
QWidget* widget = new QWidget(this);
setCentralWidget(widget);
@ -184,6 +191,7 @@ void QupZilla::setupUi()
m_tabWidget = new TabWidget(this);
m_superMenu = new QMenu(this);
m_navigationBar = new NavigationBar(this);
m_navigationBar->setSplitterSizes(locationBarWidth, websearchBarWidth);
m_bookmarksToolbar = new BookmarksToolbar(this);
m_mainSplitter->addWidget(m_tabWidget);
m_mainLayout->addWidget(m_navigationBar);
@ -380,6 +388,7 @@ void QupZilla::loadSettings()
bool showMenuBar = settings.value("showMenubar",true).toBool();
bool showAddTab = settings.value("showAddTabButton", true).toBool();
bool makeTransparent = settings.value("useTransparentBackground",false).toBool();
m_sideBarWidth = settings.value("SideBarWidth", 250).toInt();
QString activeSideBar = settings.value("SideBar", "None").toString();
settings.endGroup();
bool adBlockEnabled = settings.value("AdBlock/enabled", true).toBool();
@ -829,8 +838,9 @@ void QupZilla::showBookmarksSideBar()
if (m_sideBar->activeWidget() != SideBar::Bookmarks)
m_sideBar->showBookmarks();
else
else {
m_sideBar->close();
}
}
void QupZilla::showHistorySideBar()
@ -839,8 +849,9 @@ void QupZilla::showHistorySideBar()
if (m_sideBar->activeWidget() != SideBar::History)
m_sideBar->showHistory();
else
else {
m_sideBar->close();
}
}
void QupZilla::addSideBar()
@ -852,6 +863,17 @@ void QupZilla::addSideBar()
m_mainSplitter->insertWidget(0, m_sideBar);
m_mainSplitter->setCollapsible(0, false);
QList<int> sizes;
sizes << m_sideBarWidth << width() - m_sideBarWidth;
m_mainSplitter->setSizes(sizes);
}
void QupZilla::saveSideBarWidth()
{
// That +1 is important here, without it, the sidebar width would
// decrease by 1 pixel every close
m_sideBarWidth = m_mainSplitter->sizes().at(0) + 1;
}
void QupZilla::showNavigationToolbar()
@ -1047,12 +1069,19 @@ void QupZilla::closeEvent(QCloseEvent* event)
bool QupZilla::quitApp()
{
if (m_sideBar)
saveSideBarWidth();
QSettings settings(m_activeProfil+"settings.ini", QSettings::IniFormat);
int afterLaunch = settings.value("Web-URL-Settings/afterLaunch",0).toInt();
bool askOnClose = settings.value("Browser-Tabs-Settings/AskOnClosing", false).toBool();
settings.setValue("Browser-View-Settings/WindowMaximised", windowState().testFlag(Qt::WindowMaximized));
settings.setValue("Browser-View-Settings/WindowGeometry", geometry());
settings.beginGroup("Browser-View-Settings");
settings.setValue("WindowMaximised", windowState().testFlag(Qt::WindowMaximized));
settings.setValue("WindowGeometry", geometry());
settings.setValue("LocationBarWidth", m_navigationBar->splitter()->sizes().at(0));
settings.setValue("WebSearchBarWidth", m_navigationBar->splitter()->sizes().at(1));
settings.setValue("SideBarWidth", m_sideBar ? m_mainSplitter->sizes().at(0) : m_sideBarWidth);
if (askOnClose && afterLaunch != 2 && m_tabWidget->count() > 1) {
QDialog* dialog = new QDialog(this);

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -87,6 +87,7 @@ public:
void installTranslator();
void loadSettings();
void showNavigationWithFullscreen();
void saveSideBarWidth();
inline WebView* weView() const { WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(m_tabWidget->currentIndex())); if (!webTab) return 0; return webTab->view(); }
inline WebView* weView(int index) const { WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(index)); if (!webTab) return 0; return webTab->view(); }
@ -239,6 +240,8 @@ private:
QString m_activeLanguage;
QColor m_menuTextColor;
int m_sideBarWidth;
//Used for F11 FullScreen remember visibility
//of menubar and statusbar
bool m_menuBarVisible;

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -77,7 +77,6 @@ DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, const QS
stop();
error(m_reply->error());
}
show();
}
void DownloadItem::parentResized(const QSize &size)

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -59,7 +59,7 @@ void DownloadManager::loadSettings()
QSettings settings(mApp->getActiveProfilPath()+"settings.ini", QSettings::IniFormat);
settings.beginGroup("DownloadManager");
m_downloadPath = settings.value("defaultDownloadPath", "").toString();
m_lastDownloadPath = settings.value("lastDownloadPath",QDir::homePath()+"/").toString();
m_lastDownloadPath = settings.value("lastDownloadPath", QDir::homePath() + "/").toString();
m_useNativeDialog = settings.value("useNativeDialog",
#ifdef Q_WS_WIN
false

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -21,13 +21,13 @@
#include "historysidebar.h"
#include "qupzilla.h"
SideBar::SideBar(QWidget* parent) :
QWidget(parent)
,m_activeWidget(None)
SideBar::SideBar(QWidget* parent)
: QWidget(parent)
, p_QupZilla((QupZilla*)parentWidget())
, m_activeWidget(None)
{
setObjectName("sidebar");
setAttribute(Qt::WA_DeleteOnClose);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
m_layout = new QVBoxLayout();
m_layout->setContentsMargins(0, 0, 0, 0);
@ -78,6 +78,8 @@ void SideBar::close()
QSettings settings(mApp->getActiveProfilPath() + "settings.ini", QSettings::IniFormat);
settings.setValue("Browser-View-Settings/SideBar", "None");
p_QupZilla->saveSideBarWidth();
QWidget::close();
}

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2011 nowrep
* Copyright (C) 2010-2011 David Rosca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -22,6 +22,7 @@
#include <QVBoxLayout>
class DockTitleBarWidget;
class QupZilla;
class SideBar : public QWidget
{
Q_OBJECT
@ -44,6 +45,7 @@ public slots:
private:
void setWidget(QWidget* widget);
QupZilla* p_QupZilla;
QVBoxLayout* m_layout;
DockTitleBarWidget* m_titleBar;
SideWidget m_activeWidget;