~zeller-benjamin/qtcreator-plugin-ubuntu/qtc41-beta

« back to all changes in this revision

Viewing changes to src/ubuntu/ubuntudevicemode.cpp

  • Committer: Juhapekka Piiroinen
  • Date: 2013-09-04 15:30:00 UTC
  • mto: (23.1.14 binary-plugin)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: juhapekka.piiroinen@canonical.com-20130904153000-r4lhfhrjlwmop277
Added cordova plugin from ubuntu-qtcreator-plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 Canonical Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
 
17
 */
 
18
 
 
19
#include "ubuntudevicemode.h"
 
20
#include "ubuntuconstants.h"
 
21
 
 
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>
 
32
 
 
33
using namespace Ubuntu::Internal;
 
34
 
 
35
UbuntuDeviceMode::UbuntuDeviceMode(QObject *parent) :
 
36
    Core::IMode(parent)
 
37
{
 
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));
 
43
 
 
44
    m_modeWidget = new QWidget;
 
45
    QVBoxLayout *layout = new QVBoxLayout;
 
46
    layout->setMargin(0);
 
47
    layout->setSpacing(0);
 
48
    m_modeWidget->setLayout(layout);
 
49
 
 
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);
 
57
 
 
58
    connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), SLOT(modeChanged(Core::IMode*)));
 
59
 
 
60
    setWidget(m_modeWidget);
 
61
}
 
62
 
 
63
void UbuntuDeviceMode::modeChanged(Core::IMode *mode) {
 
64
 
 
65
}
 
66
 
 
67
void UbuntuDeviceMode::initialize() {
 
68
 
 
69
 
 
70
}