2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync/** @file
d34409ad02ea0d28e08a6c4b089a412fdb3b4c9cvboxsync * VBox Qt GUI - UIGlobalSettingsExtension class declaration.
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync/*
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2010-2012 Oracle Corporation
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync *
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * available from http://www.virtualbox.org. This file is free software;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * General Public License (GPL) as published by the Free Software
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync#ifndef __UIGlobalSettingsExtension_h__
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync#define __UIGlobalSettingsExtension_h__
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync/* Local includes */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync#include "UISettingsPage.h"
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync#include "UIGlobalSettingsExtension.gen.h"
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync/* Global settings / Extension page / Cache Item: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsyncstruct UISettingsCacheGlobalExtensionItem
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync{
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync QString m_strName;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync QString m_strDescription;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync QString m_strVersion;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync ULONG m_strRevision;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync bool m_fIsUsable;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync QString m_strWhyUnusable;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync};
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync/* Global settings / Extension page / Cache: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsyncstruct UISettingsCacheGlobalExtension
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync{
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync QList<UISettingsCacheGlobalExtensionItem> m_items;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync};
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync/* Global settings / Extension page: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsyncclass UIGlobalSettingsExtension : public UISettingsPageGlobal, public Ui::UIGlobalSettingsExtension
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync{
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync Q_OBJECT;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsyncpublic:
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync /* Constructor: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync UIGlobalSettingsExtension();
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
441579693f771e49eb05f2bd20c316232155675bvboxsync static void doInstallation(QString const &strFilePath, QString const &strDigest, QWidget *pParent, QString *pstrExtPackName);
f7d0672fb68919a6a824f47d7ef72b9b7bd0c266vboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsyncprotected:
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
ab6b321de44ece2b31cc0240f85599772772bbdfvboxsync /* Load data to cache from corresponding external object(s),
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * this task COULD be performed in other than GUI thread: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void loadToCacheFrom(QVariant &data);
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync /* Load data to corresponding widgets from cache,
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * this task SHOULD be performed in GUI thread only: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void getFromCache();
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync /* Save data from corresponding widgets to cache,
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * this task SHOULD be performed in GUI thread only: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void putToCache();
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync /* Save data from cache to corresponding external object(s),
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync * this task COULD be performed in other than GUI thread: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void saveFromCacheTo(QVariant &data);
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
5a95814777041397590021f3ac5002e403c8e5cevboxsync /* Helper: Navigation stuff: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void setOrderAfter(QWidget *pWidget);
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
5a95814777041397590021f3ac5002e403c8e5cevboxsync /* Helper: Translation stuff: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void retranslateUi();
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsyncprivate slots:
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
5a95814777041397590021f3ac5002e403c8e5cevboxsync /* Handlers: Tree-widget stuff: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void sltHandleCurrentItemChange(QTreeWidgetItem *pCurrentItem);
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void sltShowContextMenu(const QPoint &position);
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
5a95814777041397590021f3ac5002e403c8e5cevboxsync /* Handlers: Package stuff: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void sltInstallPackage();
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync void sltRemovePackage();
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsyncprivate:
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync /* Prepare UISettingsCacheGlobalExtensionItem basing on CExtPack: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync UISettingsCacheGlobalExtensionItem fetchData(const CExtPack &package) const;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
5a95814777041397590021f3ac5002e403c8e5cevboxsync /* Variables: Actions: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync QAction *m_pActionAdd;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync QAction *m_pActionRemove;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync /* Cache: */
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync UISettingsCacheGlobalExtension m_cache;
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync};
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync#endif // __UIGlobalSettingsExtension_h__
2666f1297eab4eed7d552370cc025b38dcd6b78cvboxsync