Skip to content

Commit

Permalink
Merge look and feel with shell
Browse files Browse the repository at this point in the history
We want shells to be tightly integrated with components.
  • Loading branch information
plfiorini committed Apr 19, 2014
1 parent 1c77bfa commit 0738656
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 81 deletions.
3 changes: 0 additions & 3 deletions src/declarative/core/packagesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ void PackagesModelPrivate::populate()
case PackagesModel::ShellPackage:
pluginType = PluginLoader::ShellPlugin;
break;
case PackagesModel::LookAndFeelPackage:
pluginType = PluginLoader::LookAndFeelPlugin;
break;
default:
return;
}
Expand Down
3 changes: 1 addition & 2 deletions src/declarative/core/packagesmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ class PackagesModel : public QAbstractListModel
BackgroundPackage,
ElementPackage,
ContainmentPackage,
ShellPackage,
LookAndFeelPackage
ShellPackage
};

enum Roles {
Expand Down
15 changes: 0 additions & 15 deletions src/libhawaii/packages_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,6 @@ void ShellPackage::initializePackage(Package *package)
// Elements
package->addFileDefinition("elementerror", QStringLiteral("element/ElementError.qml"),
tr("Error message for elements that fail to load"));
}

void LookAndFeelPackage::initializePackage(Package *package)
{
package->setDefaultPackageRoot(QStringLiteral("hawaii/lookandfeel/"));

// Previews
package->addDirectoryDefinition("previews", QStringLiteral("previews"),
tr("Preview images"));
package->addFileDefinition("overlaypreview", QStringLiteral("previews/overlay.png"),
tr("Preview for the overlay"));
package->addFileDefinition("authenticationpreview", QStringLiteral("previews/authentication.png"),
tr("Preview for the authentication user interface"));
package->addFileDefinition("lockscreenpreview", QStringLiteral("previews/lockscreen.png"),
tr("Preview for the Lock Screen"));

// Overlay
package->addDirectoryDefinition("overlayui", QStringLiteral("overlay"),
Expand Down
6 changes: 0 additions & 6 deletions src/libhawaii/packages_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ class ShellPackage : public BasePackage
void initializePackage(Package *package);
};

class LookAndFeelPackage : public BasePackage
{
public:
void initializePackage(Package *package);
};

class PreferencesPackage : public MainScriptPackage
{
public:
Expand Down
3 changes: 0 additions & 3 deletions src/libhawaii/pluginloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ Package PluginLoader::loadPackage(PluginType type)
case ShellPlugin:
structure = new ShellPackage();
break;
case LookAndFeelPlugin:
structure = new LookAndFeelPackage();
break;
case PreferencesPlugin:
structure = new PreferencesPackage();
break;
Expand Down
9 changes: 4 additions & 5 deletions src/libhawaii/pluginloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ class HAWAII_EXPORT PluginLoader
public:
enum PluginType {
BackgroundPlugin = 0,
ElementPlugin = 1,
ContainmentPlugin = 2,
ShellPlugin = 3,
LookAndFeelPlugin = 4,
PreferencesPlugin = 5,
ElementPlugin,
ContainmentPlugin,
ShellPlugin,
PreferencesPlugin,
CustomPlugin = 0x0100
};

Expand Down
7 changes: 2 additions & 5 deletions src/libhawaiishell/HawaiiShellMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# Installs a Hawaii Shell package.
#
# \param type the package type, one of the following: background,
# element, shell, lookandfeel, containment, preferences
# element, shell, containment, preferences
# \param name the package name, same as the "name" key value
# from metadata.json
# \param srcpath the source path to install from, it's the
Expand All @@ -49,17 +49,14 @@ macro(hawaiishell_install_package type name srcpath)
set(dstpath hawaii/elements)
elseif("${type}" STREQUAL "shell")
set(dstpath hawaii/shells)
elseif("${type}" STREQUAL "lookandfeel")
set(dstpath hawaii/lookandfeel)
elseif("${type}" STREQUAL "containment")
set(dstpath hawaii/containments)
elseif("${type}" STREQUAL "preferences")
set(dstpath hawaii/preferences)
else()
message(FATAL_ERROR "Package type \"${type}\" not recognized, "
"possible values: \"element\", \"shell\", "
"\"lookandfeel\", \"containment\", "
"\"preferences\".")
"\"containment\", \"preferences\".")
endif()

install(DIRECTORY ${srcpath}/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${dstpath}/${name}
Expand Down
29 changes: 0 additions & 29 deletions src/libhawaiishell/mantle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ Package Mantle::shellPackage() const
return d->shellPackage;
}

QString Mantle::lookAndFeel() const
{
Q_D(const Mantle);
return d->lookAndFeel;
}

Package Mantle::lookAndFeelPackage() const
{
Q_D(const Mantle);
return d->lookAndFeelPackage;
}

void Mantle::setShell(const QString &name)
{
Q_D(Mantle);
Expand All @@ -100,23 +88,6 @@ void Mantle::setShellPackage(const Package &package)
Q_EMIT shellPackageChanged(package);
}

void Mantle::setLookAndFeel(const QString &name)
{
Q_D(Mantle);

if (d->lookAndFeel != name) {
d->lookAndFeel = name;
Q_EMIT lookAndFeelChanged(d->lookAndFeel);
}
}

void Mantle::setLookAndFeelPackage(const Package &package)
{
Q_D(Mantle);
d->lookAndFeelPackage = package;
Q_EMIT lookAndFeelPackageChanged(package);
}

} // namespace Hawaii

#include "moc_mantle.cpp"
10 changes: 0 additions & 10 deletions src/libhawaiishell/mantle.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class HAWAIISHELL_EXPORT Mantle : public QObject
{
Q_OBJECT
Q_PROPERTY(QString shell READ shell NOTIFY shellChanged)
Q_PROPERTY(QString lookAndFeel READ lookAndFeel NOTIFY lookAndFeelChanged)
public:
explicit Mantle(QObject *parent = 0);
~Mantle();
Expand All @@ -51,23 +50,14 @@ class HAWAIISHELL_EXPORT Mantle : public QObject
QString shell() const;
Package shellPackage() const;

QString lookAndFeel() const;
Package lookAndFeelPackage() const;

Q_SIGNALS:
void shellChanged(const QString &shell);
void shellPackageChanged(const Package &package);

void lookAndFeelChanged(const QString &name);
void lookAndFeelPackageChanged(const Package &package);

protected:
void setShell(const QString &name);
void setShellPackage(const Package &package);

void setLookAndFeel(const QString &name);
void setLookAndFeelPackage(const Package &package);

private:
Q_DECLARE_PRIVATE(Mantle)
MantlePrivate *const d_ptr;
Expand Down
3 changes: 0 additions & 3 deletions src/libhawaiishell/mantle_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ class MantlePrivate
QString shell;
Package shellPackage;

QString lookAndFeel;
Package lookAndFeelPackage;

protected:
Q_DECLARE_PUBLIC(Mantle)
Mantle *q_ptr;
Expand Down

0 comments on commit 0738656

Please sign in to comment.