2
* Copyright 2013 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 2.1.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
19
#include "ubuntudevicemode.h"
20
#include "ubuntuconstants.h"
22
#include <coreplugin/modemanager.h>
23
#include <coreplugin/editormanager/editormanager.h>
24
#include <coreplugin/dialogs/iwizard.h>
25
#include <coreplugin/coreconstants.h>
26
#include <projectexplorer/projectexplorer.h>
27
#include <coreplugin/icore.h>
28
#include <coreplugin/imode.h>
29
#include <utils/styledbar.h>
30
#include <QVBoxLayout>
31
#include <QScrollArea>
33
using namespace Ubuntu::Internal;
35
UbuntuDeviceMode::UbuntuDeviceMode(QObject *parent) :
38
setDisplayName(tr(Ubuntu::Constants::UBUNTU_MODE_DEVICES_DISPLAYNAME));
39
setIcon(QIcon(QLatin1String(Ubuntu::Constants::UBUNTU_MODE_DEVICES_ICON)));
40
setPriority(Ubuntu::Constants::UBUNTU_MODE_DEVICES_PRIORITY);
41
setId(Ubuntu::Constants::UBUNTU_MODE_DEVICES);
42
setObjectName(QLatin1String(Ubuntu::Constants::UBUNTU_MODE_DEVICES));
44
m_modeWidget = new QWidget;
45
QVBoxLayout *layout = new QVBoxLayout;
47
layout->setSpacing(0);
48
m_modeWidget->setLayout(layout);
50
Utils::StyledBar* styledBar = new Utils::StyledBar(m_modeWidget);
51
layout->addWidget(styledBar);
52
QScrollArea *scrollArea = new QScrollArea(m_modeWidget);
53
scrollArea->setFrameShape(QFrame::NoFrame);
54
layout->addWidget(scrollArea);
55
scrollArea->setWidget(&m_ubuntuDevicesWidget);
56
scrollArea->setWidgetResizable(true);
58
connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), SLOT(modeChanged(Core::IMode*)));
60
setWidget(m_modeWidget);
63
void UbuntuDeviceMode::modeChanged(Core::IMode *mode) {
67
void UbuntuDeviceMode::initialize() {