Skip to content
Snippets Groups Projects
Commit aa7d2c54 authored by Denis Mingulov's avatar Denis Mingulov Committed by Thorbjørn Lindeijer
Browse files

ImageViewer: Reimplemented as a new plugin


Merge-request: 2165
Reviewed-by: default avatarThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
parent fc3fd82e
No related branches found
No related tags found
No related merge requests found
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
** Copyright (c) 2010 Denis Mingulov.
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "imageviewerplugin.h"
#include "imageviewerfactory.h"
#include "imageviewerconstants.h"
#include <QtCore/QDebug>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
namespace ImageViewer {
namespace Internal {
///////////////////////////////// ImageViewerPlugin //////////////////////////////////
ImageViewerPlugin::ImageViewerPlugin()
{
}
ImageViewerPlugin::~ImageViewerPlugin()
{
}
bool ImageViewerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
Core::ICore *core = Core::ICore::instance();
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/imageviewer/ImageViewer.mimetypes.xml"), errorMessage))
return false;
ImageViewerFactory *factory = new ImageViewerFactory(this);
Aggregation::Aggregate *aggregate = new Aggregation::Aggregate;
aggregate->add(factory);
addAutoReleasedObject(factory);
return true;
}
void ImageViewerPlugin::extensionsInitialized()
{
}
} // namespace Internal
} // namespace ImageViewer
Q_EXPORT_PLUGIN(ImageViewer::Internal::ImageViewerPlugin)
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
** Copyright (c) 2010 Denis Mingulov.
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef IMAGEVIEWERPLUGIN_H
#define IMAGEVIEWERPLUGIN_H
#include <extensionsystem/iplugin.h>
#include <QtCore/QtPlugin>
namespace ImageViewer {
namespace Internal {
class ImageViewerFactory;
class ImageViewerPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
public:
ImageViewerPlugin();
~ImageViewerPlugin();
bool initialize(const QStringList &arguments, QString *error_message = 0);
void extensionsInitialized();
private:
};
} // namespace Internal
} // namespace ImageViewer
#endif // IMAGEVIEWERPLUGIN_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ImageViewer::Internal::ImageViewerToolbar</class>
<widget class="QWidget" name="ImageViewer::Internal::ImageViewerToolbar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>28</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="toolButtonBackground">
<property name="toolTip">
<string>Show background</string>
</property>
<property name="icon">
<iconset resource="imageviewer.qrc">
<normaloff>:/imageviewer/images/background.png</normaloff>:/imageviewer/images/background.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonOutline">
<property name="toolTip">
<string>Show outline</string>
</property>
<property name="icon">
<iconset resource="imageviewer.qrc">
<normaloff>:/imageviewer/images/outline.png</normaloff>:/imageviewer/images/outline.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonFitToScreen">
<property name="toolTip">
<string>Fit image in the screen</string>
</property>
<property name="icon">
<iconset resource="imageviewer.qrc">
<normaloff>:/imageviewer/images/fitinscreen.png</normaloff>:/imageviewer/images/fitinscreen.png</iconset>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonOriginalSize">
<property name="toolTip">
<string>Original size</string>
</property>
<property name="icon">
<iconset resource="imageviewer.qrc">
<normaloff>:/imageviewer/images/originalsize.png</normaloff>:/imageviewer/images/originalsize.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonZoomIn">
<property name="toolTip">
<string>Zoom In</string>
</property>
<property name="icon">
<iconset resource="imageviewer.qrc">
<normaloff>:/imageviewer/images/zoomin.png</normaloff>:/imageviewer/images/zoomin.png</iconset>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonZoomOut">
<property name="toolTip">
<string>Zoom Out</string>
</property>
<property name="icon">
<iconset resource="imageviewer.qrc">
<normaloff>:/imageviewer/images/zoomout.png</normaloff>:/imageviewer/images/zoomout.png</iconset>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Utils::StyledSeparator" name="widgetToolbarSeparator" native="true"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>315</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Utils::StyledSeparator" name="widgetInfoSeparator" native="true"/>
</item>
<item>
<widget class="QLabel" name="labelInfo"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::StyledSeparator</class>
<extends>QWidget</extends>
<header>utils/styledbar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="imageviewer.qrc"/>
</resources>
<connections/>
</ui>
...@@ -9,6 +9,7 @@ SUBDIRS = plugin_coreplugin \ ...@@ -9,6 +9,7 @@ SUBDIRS = plugin_coreplugin \
plugin_texteditor \ plugin_texteditor \
plugin_cppeditor \ plugin_cppeditor \
plugin_bineditor \ plugin_bineditor \
plugin_imageviewer \
plugin_bookmarks \ plugin_bookmarks \
plugin_projectexplorer \ plugin_projectexplorer \
plugin_vcsbase \ plugin_vcsbase \
...@@ -74,6 +75,9 @@ plugin_bineditor.subdir = bineditor ...@@ -74,6 +75,9 @@ plugin_bineditor.subdir = bineditor
plugin_bineditor.depends = plugin_texteditor plugin_bineditor.depends = plugin_texteditor
plugin_bineditor.depends += plugin_coreplugin plugin_bineditor.depends += plugin_coreplugin
plugin_imageviewer.subdir = imageviewer
plugin_imageviewer.depends = plugin_coreplugin
plugin_designer.subdir = designer plugin_designer.subdir = designer
plugin_designer.depends = plugin_coreplugin plugin_cppeditor plugin_projectexplorer plugin_designer.depends = plugin_coreplugin plugin_cppeditor plugin_projectexplorer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment