[muon] /: Remove muon-installer
Aleix Pol
aleixpol at kde.org
Wed Jan 14 17:37:51 UTC 2015
Git commit 5326151f7ef09aa356ea09089cc7816f98d06583 by Aleix Pol.
Committed on 14/01/2015 at 17:30.
Pushed by apol into branch 'master'.
Remove muon-installer
Muon Discover does the same things and it's more actively maintained.
It wasn't ported to KF5.
It was still muonapt-dependent.
It has a bunch of bugs nobody really knows how to fix.
CCMAIL: kubuntu-devel at lists.ubuntu.com
M +0 -1 CMakeLists.txt
M +0 -1 Messages.sh
M +1 -1 README.PACKAGERS
D +0 -53 installer/AbstractViewBase.cpp
D +0 -50 installer/AbstractViewBase.h
D +0 -98 installer/AbstractViewContainer.cpp
D +0 -50 installer/AbstractViewContainer.h
D +0 -75 installer/ApplicationLauncher.cpp
D +0 -41 installer/ApplicationLauncher.h
D +0 -76 installer/AvailableView.cpp
D +0 -46 installer/AvailableView.h
D +0 -97 installer/BreadcrumbWidget/BreadcrumbItem.cpp
D +0 -62 installer/BreadcrumbWidget/BreadcrumbItem.h
D +0 -171 installer/BreadcrumbWidget/BreadcrumbItemButton.cpp
D +0 -70 installer/BreadcrumbWidget/BreadcrumbItemButton.h
D +0 -209 installer/BreadcrumbWidget/BreadcrumbWidget.cpp
D +0 -84 installer/BreadcrumbWidget/BreadcrumbWidget.h
D +0 -51 installer/CMakeLists.txt
D +0 -275 installer/CategoryView/CategoryDrawer.cpp
D +0 -42 installer/CategoryView/CategoryDrawer.h
D +0 -66 installer/CategoryView/CategoryView.cpp
D +0 -37 installer/CategoryView/CategoryView.h
D +0 -154 installer/CategoryView/CategoryViewWidget.cpp
D +0 -62 installer/CategoryView/CategoryViewWidget.h
D +0 -41 installer/ClickableLabel.cpp
D +0 -39 installer/ClickableLabel.h
D +0 -94 installer/LaunchListModel.cpp
D +0 -52 installer/LaunchListModel.h
D +0 -497 installer/MainWindow.cpp
D +0 -101 installer/MainWindow.h
D +0 -53 installer/ProgressView.cpp
D +0 -33 installer/ProgressView.h
D +0 -248 installer/ResourceDetailsView/AddonsWidget.cpp
D +0 -72 installer/ResourceDetailsView/AddonsWidget.h
D +0 -50 installer/ResourceDetailsView/ResourceDetailsView.cpp
D +0 -41 installer/ResourceDetailsView/ResourceDetailsView.h
D +0 -546 installer/ResourceDetailsView/ResourceDetailsWidget.cpp
D +0 -111 installer/ResourceDetailsView/ResourceDetailsWidget.h
D +0 -301 installer/ResourceView/ResourceDelegate.cpp
D +0 -69 installer/ResourceView/ResourceDelegate.h
D +0 -143 installer/ResourceView/ResourceExtender.cpp
D +0 -58 installer/ResourceView/ResourceExtender.h
D +0 -75 installer/ResourceView/ResourceListView.cpp
D +0 -47 installer/ResourceView/ResourceListView.h
D +0 -225 installer/ResourceView/ResourceViewWidget.cpp
D +0 -80 installer/ResourceView/ResourceViewWidget.h
D +0 -149 installer/ReviewsWidget/ReviewWidget.cpp
D +0 -50 installer/ReviewsWidget/ReviewWidget.h
D +0 -132 installer/ReviewsWidget/ReviewsWidget.cpp
D +0 -59 installer/ReviewsWidget/ReviewsWidget.h
D +0 -164 installer/ScreenShotOverlay.cpp
D +0 -66 installer/ScreenShotOverlay.h
D +0 -36 installer/ViewSwitcher.cpp
D +0 -35 installer/ViewSwitcher.h
D +0 -4 installer/config/MuonInstallerSettings.kcfgc
D +0 -20 installer/config/muon-installer.kcfg
D +0 -53 installer/effects/GraphicsOpacityDropShadowEffect.cpp
D +0 -43 installer/effects/GraphicsOpacityDropShadowEffect.h
D +0 -70 installer/main.cpp
D +0 -134 installer/muon-installer.desktop
D +0 -21 installer/muon-installerui.rc
D +0 -58 installer/qml/qml/ClickableImage.qml
D +0 -51 installer/qml/qml/ThumbnailView.qml
D +0 -42 installer/qml/src/mousecursor.cpp
D +0 -43 installer/qml/src/mousecursor.h
http://commits.kde.org/muon/5326151f7ef09aa356ea09089cc7816f98d06583
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a22b204..b9929c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,7 +45,6 @@ add_subdirectory(libmuon)
if(QApt_FOUND)
add_subdirectory(libmuonapt)
add_subdirectory(muon)
-# add_subdirectory(installer)
endif()
add_subdirectory(updater)
add_subdirectory(discover)
diff --git a/Messages.sh b/Messages.sh
index cf33789..0fe44d0 100644
--- a/Messages.sh
+++ b/Messages.sh
@@ -6,7 +6,6 @@ $EXTRACTRC --context="Category" --tag-group=none --tag=Name `find libmuon -name
$XGETTEXT categoriesxml.cpp `find libmuon -name \*.cpp` `find libmuonapt -name \*.cpp` -o $podir/libmuon.pot
$XGETTEXT rc.cpp muonrc.cpp `find muon -name \*.cpp` -o $podir/muon.pot
$XGETTEXT rc.cpp updaterrc.cpp `find updater -name \*.cpp` -o $podir/muon-updater.pot
-$XGETTEXT rc.cpp `find installer -name \*.cpp` -o $podir/muon-installer.pot
$XGETTEXT `find discover -name \*.cpp -o -name \*.qml` -o $podir/muon-discover.pot
rm -f muonrc.cpp
rm -f updaterrc.cpp
diff --git a/README.PACKAGERS b/README.PACKAGERS
index 1251a48..28f1519 100644
--- a/README.PACKAGERS
+++ b/README.PACKAGERS
@@ -6,6 +6,6 @@ libmuonprivate:
muon:
- apt-xapian-index
-muon-installer:
+muon-discover:
- app-install-data
- apt-xapian-index
diff --git a/installer/AbstractViewBase.cpp b/installer/AbstractViewBase.cpp
deleted file mode 100644
index 3b2ece8..0000000
--- a/installer/AbstractViewBase.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "AbstractViewBase.h"
-
-// Qt includes
-#include <QtWidgets/QVBoxLayout>
-
-// Own includes
-#include "BreadcrumbWidget/BreadcrumbItem.h"
-
-AbstractViewBase::AbstractViewBase(QWidget *parent)
- : QWidget(parent)
- , m_searchable(false)
-{
- m_layout = new QVBoxLayout(this);
- m_layout->setContentsMargins(0, 0, 0, 0);
- setLayout(m_layout);
-
- m_crumb = new BreadcrumbItem(this);
-}
-
-void AbstractViewBase::search(const QString &text)
-{
- Q_UNUSED(text);
-}
-
-BreadcrumbItem *AbstractViewBase::breadcrumbItem()
-{
- return m_crumb;
-}
-
-bool AbstractViewBase::isSearchable()
-{
- return m_searchable;
-}
diff --git a/installer/AbstractViewBase.h b/installer/AbstractViewBase.h
deleted file mode 100644
index e27026d..0000000
--- a/installer/AbstractViewBase.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef ABSTRACTVIEWBASE_H
-#define ABSTRACTVIEWBASE_H
-
-#include <QtWidgets/QWidget>
-
-class QVBoxLayout;
-
-class BreadcrumbItem;
-
-class AbstractViewBase : public QWidget
-{
- Q_OBJECT
-public:
- AbstractViewBase(QWidget *parent);
-
- BreadcrumbItem *breadcrumbItem();
- bool isSearchable();
- virtual void search(const QString &text);
-
-protected:
- QVBoxLayout *m_layout;
- BreadcrumbItem *m_crumb;
- bool m_searchable;
-
-Q_SIGNALS:
- void switchToSubView(AbstractViewBase *view);
- void registerNewSubView(AbstractViewBase *view);
-};
-
-#endif
diff --git a/installer/AbstractViewContainer.cpp b/installer/AbstractViewContainer.cpp
deleted file mode 100644
index 784fcd9..0000000
--- a/installer/AbstractViewContainer.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "AbstractViewContainer.h"
-
-// Qt includes
-#include <QtWidgets/QStackedWidget>
-
-#include "AbstractViewBase.h"
-#include "BreadcrumbWidget/BreadcrumbWidget.h"
-#include "BreadcrumbWidget/BreadcrumbItem.h"
-
-AbstractViewContainer::AbstractViewContainer(QWidget *parent)
- : KVBox(parent)
-{
- setSpacing(2);
- m_breadcrumbWidget = new BreadcrumbWidget(this);
-
- m_viewStack = new QStackedWidget(this);
-
- connect(m_breadcrumbWidget, SIGNAL(itemActivated(BreadcrumbItem*)),
- this, SLOT(activateBreadcrumbItem(BreadcrumbItem*)));
- connect(m_breadcrumbWidget, SIGNAL(search(QString)),
- this, SLOT(search(QString)));
-}
-
-AbstractViewContainer::~AbstractViewContainer()
-{
-}
-
-void AbstractViewContainer::registerNewSubView(AbstractViewBase *subView)
-{
- m_viewStack->addWidget(subView);
- m_viewStack->setCurrentWidget(subView);
- m_breadcrumbWidget->addLevel(subView->breadcrumbItem());
-
- AbstractViewBase *currentWidget = static_cast<AbstractViewBase *>(m_viewStack->currentWidget());
- if (currentWidget->isSearchable()) {
- m_breadcrumbWidget->showSearchEdit();
- } else {
- m_breadcrumbWidget->hideSearchEdit();
- }
-}
-
-void AbstractViewContainer::switchToSubView(AbstractViewBase *subView)
-{
- m_viewStack->setCurrentWidget(subView);
- m_breadcrumbWidget->setCurrentItem(m_breadcrumbWidget->breadcrumbForView(subView));
-
- AbstractViewBase *currentWidget = static_cast<AbstractViewBase *>(m_viewStack->currentWidget());
- if (currentWidget->isSearchable()) {
- m_breadcrumbWidget->showSearchEdit();
- } else {
- m_breadcrumbWidget->hideSearchEdit();
- }
-}
-
-void AbstractViewContainer::activateBreadcrumbItem(BreadcrumbItem *item)
-{
- if (!item->associatedView())
- return;
-
- m_viewStack->setCurrentWidget(item->associatedView());
-
- AbstractViewBase *currentWidget = static_cast<AbstractViewBase *>(m_viewStack->currentWidget());
- if (currentWidget->isSearchable()) {
- m_breadcrumbWidget->showSearchEdit();
- } else {
- m_breadcrumbWidget->hideSearchEdit();
- }
-}
-
-void AbstractViewContainer::search(const QString &text)
-{
- AbstractViewBase *currentWidget = static_cast<AbstractViewBase *>(m_viewStack->currentWidget());
- if (currentWidget->isSearchable()) {
- currentWidget->search(text);
- }
-}
-
-#include "AbstractViewContainer.moc"
diff --git a/installer/AbstractViewContainer.h b/installer/AbstractViewContainer.h
deleted file mode 100644
index 8a981a8..0000000
--- a/installer/AbstractViewContainer.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef ABSTRACTVIEWCONTAINER_H
-#define ABSTRACTVIEWCONTAINER_H
-
-#include <KVBox>
-
-class QStackedWidget;
-
-class AbstractViewBase;
-class BreadcrumbItem;
-class BreadcrumbWidget;
-
-class AbstractViewContainer : public KVBox
-{
- Q_OBJECT
-public:
- AbstractViewContainer(QWidget *parent);
- ~AbstractViewContainer();
-
-protected:
- BreadcrumbWidget *m_breadcrumbWidget;
- QStackedWidget *m_viewStack;
-
-private Q_SLOTS:
- void registerNewSubView(AbstractViewBase *subView);
- void activateBreadcrumbItem(BreadcrumbItem *item);
- void switchToSubView(AbstractViewBase *subView);
- void search(const QString &searchText);
-};
-
-#endif
diff --git a/installer/ApplicationLauncher.cpp b/installer/ApplicationLauncher.cpp
deleted file mode 100644
index ae7baf9..0000000
--- a/installer/ApplicationLauncher.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 by Daniel Nicoletti <dantti85-pk at yahoo.com.br> *
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; see the file COPYING. If not, write to *
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#include "ApplicationLauncher.h"
-
-#include "LaunchListModel.h"
-
-#include <QtCore/QStringBuilder>
-#include <QtWidgets/QLabel>
-#include <QListView>
-#include <QtWidgets/QPushButton>
-#include <QStandardItemModel>
-#include <QtWidgets/QVBoxLayout>
-
-#include <KLocalizedString>
-#include <KStandardGuiItem>
-
-ApplicationLauncher::ApplicationLauncher(LaunchListModel* model, QWidget* parent)
- : QDialog(parent)
- , m_model(model)
-{
- QVBoxLayout *layout = new QVBoxLayout(this);
- setLayout(layout);
-
- QLabel *label = new QLabel(this);
- label->setText(i18np("The following application was just installed, click on it to launch:",
- "The following applications were just installed, click on them to launch:",
- model->rowCount()));
-
- QListView *appView = new QListView(this);
- appView->setIconSize(QSize(32, 32));
- connect(appView, SIGNAL(activated(QModelIndex)),
- m_model, SLOT(invokeApplication(QModelIndex)));
-
- QWidget *bottomBox = new QWidget(this);
- QHBoxLayout *bottomLayout = new QHBoxLayout(bottomBox);
- bottomLayout->setSpacing(0);
- bottomLayout->setMargin(0);
- bottomBox->setLayout(bottomLayout);
-
- QWidget *bottomSpacer = new QWidget(bottomBox);
- bottomSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QPushButton *closeButton = new QPushButton(bottomBox);
- KGuiItem closeItem = KStandardGuiItem::close();
- closeButton->setText(closeItem.text());
- closeButton->setIcon(closeItem.icon());
- connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
-
- bottomLayout->addWidget(bottomSpacer);
- bottomLayout->addWidget(closeButton);
-
- appView->setModel(m_model);
-
- layout->addWidget(label);
- layout->addWidget(appView);
- layout->addWidget(bottomBox);
-}
diff --git a/installer/ApplicationLauncher.h b/installer/ApplicationLauncher.h
deleted file mode 100644
index d0fbfca..0000000
--- a/installer/ApplicationLauncher.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- * Copyright © 2008 by Daniel Nicoletti <dantti85-pk at yahoo.com.br> *
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; see the file COPYING. If not, write to *
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#ifndef APPLICATIONLAUNCHER_H
-#define APPLICATIONLAUNCHER_H
-
-#include <QDialog>
-
-class LaunchListModel;
-class QModelIndex;
-
-class KService;
-
-class ApplicationLauncher : public QDialog
-{
- Q_OBJECT
-public:
- explicit ApplicationLauncher(LaunchListModel* backend, QWidget* parent = nullptr);
-
-private:
- LaunchListModel *m_model;
-};
-
-#endif
diff --git a/installer/AvailableView.cpp b/installer/AvailableView.cpp
deleted file mode 100644
index 86a78bf..0000000
--- a/installer/AvailableView.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2011 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "AvailableView.h"
-
-// Qt includes
-#include <QtWidgets/QStackedWidget>
-
-// KDE includes
-#include <KCategorizedSortFilterProxyModel>
-#include <KLocalizedString>
-
-// Own includes
-#include <Category/Category.h>
-#include <resources/ResourcesModel.h>
-#include "BreadcrumbWidget/BreadcrumbWidget.h"
-#include "CategoryView/CategoryViewWidget.h"
-#include "ResourceDetailsView/ResourceDetailsView.h"
-
-AvailableView::AvailableView(QWidget *parent)
- : AbstractViewContainer(parent)
-{
-
- m_categoryViewWidget = new CategoryViewWidget(m_viewStack);
-
- m_categoryViewWidget->setDisplayedCategory(nullptr);
- m_breadcrumbWidget->setRootItem(m_categoryViewWidget->breadcrumbItem());
-
- m_viewStack->addWidget(m_categoryViewWidget);
- m_viewStack->setCurrentWidget(m_categoryViewWidget);
-
- ResourcesModel *resourcesModel = ResourcesModel::global();
- connect(resourcesModel, SIGNAL(searchInvalidated()),
- m_breadcrumbWidget, SLOT(startSearch()));
- connect(m_categoryViewWidget, SIGNAL(registerNewSubView(AbstractViewBase*)),
- this, SLOT(registerNewSubView(AbstractViewBase*)));
- connect(m_categoryViewWidget, SIGNAL(switchToSubView(AbstractViewBase*)),
- this, SLOT(switchToSubView(AbstractViewBase*)));
-}
-
-void AvailableView::setResource(AbstractResource *res)
-{
- // Check to see if a view for this app already exists
- if (m_currentPair.second == res) {
- QMetaObject::invokeMethod(this, "switchToSubView", Q_ARG(AbstractViewBase*, m_currentPair.first));
- return;
- }
-
- // Create one if not
- m_detailsView = new ResourceDetailsView(this);
- m_detailsView->setResource(res);
- m_currentPair.first = m_detailsView;
-
- connect(m_detailsView, SIGNAL(destroyed(QObject*)),
- this, SLOT(onSubViewDestroyed()));
-
- // Tell our parent that we can exist, so that they can forward it
- QMetaObject::invokeMethod(this, "registerNewSubView", Q_ARG(AbstractViewBase*, m_detailsView));
-}
diff --git a/installer/AvailableView.h b/installer/AvailableView.h
deleted file mode 100644
index 990eb72..0000000
--- a/installer/AvailableView.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef AVAILABLEVIEW_H
-#define AVAILABLEVIEW_H
-
-#include "AbstractViewContainer.h"
-
-class AbstractResource;
-class AbstractResourcesBackend;
-class CategoryViewWidget;
-class ResourceDetailsView;
-
-class AvailableView : public AbstractViewContainer
-{
- Q_OBJECT
-public:
- AvailableView(QWidget *parent);
-
- void setResource(AbstractResource *res);
-
-private:
- CategoryViewWidget *m_categoryViewWidget;
- QPair<AbstractViewBase *, AbstractResource *> m_currentPair;
-
- ResourceDetailsView *m_detailsView;
-};
-
-#endif
diff --git a/installer/BreadcrumbWidget/BreadcrumbItem.cpp b/installer/BreadcrumbWidget/BreadcrumbItem.cpp
deleted file mode 100644
index e64b3ef..0000000
--- a/installer/BreadcrumbWidget/BreadcrumbItem.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "BreadcrumbItem.h"
-
-#include <QtCore/QStringBuilder>
-#include <QtWidgets/QPushButton>
-
-#include "../AbstractViewBase.h"
-#include "BreadcrumbItemButton.h"
-
-BreadcrumbItem::BreadcrumbItem(QWidget *parent)
- : KHBox(parent)
- , m_hasChildren(false)
- , m_associatedView(nullptr)
-{
- m_button = new BreadcrumbItemButton(this);
- hide();
-
- connect(m_button, SIGNAL(clicked()), this, SLOT(emitActivated()));
-}
-
-BreadcrumbItem::~BreadcrumbItem()
-{
-}
-
-BreadcrumbItem *BreadcrumbItem::childItem() const
-{
- return m_childItem;
-}
-
-AbstractViewBase *BreadcrumbItem::associatedView() const
-{
- return m_associatedView;
-}
-
-bool BreadcrumbItem::hasChildren() const
-{
- return m_hasChildren;
-}
-
-void BreadcrumbItem::setChildItem(BreadcrumbItem *child)
-{
- // Only give an arrow if it has never had children. If it has, it will
- // already have one
- if (!m_hasChildren) {
- m_button->setText(m_button->text() % ' ' % QString::fromUtf8("➜"));
- }
-
- m_childItem = child;
- // Setting a null crumb pointer would technically make this false...
- m_hasChildren = true;
-}
-
-void BreadcrumbItem::setAssociatedView(AbstractViewBase *view)
-{
- m_associatedView = view;
-}
-
-void BreadcrumbItem::setText(const QString &text)
-{
- m_button->setText(text);
-}
-
-void BreadcrumbItem::setIcon(const QIcon &icon)
-{
- m_button->setIcon(icon);
-}
-
-void BreadcrumbItem::setActive(bool active)
-{
- m_button->setActive(active);
-}
-
-void BreadcrumbItem::emitActivated()
-{
- emit activated(this);
-}
-
-#include "BreadcrumbItem.moc"
diff --git a/installer/BreadcrumbWidget/BreadcrumbItem.h b/installer/BreadcrumbWidget/BreadcrumbItem.h
deleted file mode 100644
index f9bb9a6..0000000
--- a/installer/BreadcrumbWidget/BreadcrumbItem.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef BREADCRUMBITEM_H
-#define BREADCRUMBITEM_H
-
-#include <KHBox>
-
-class QIcon;
-
-class AbstractViewBase;
-class BreadcrumbItemButton;
-
-class BreadcrumbItem : public KHBox
-{
- Q_OBJECT
-public:
- BreadcrumbItem(QWidget *parent);
- ~BreadcrumbItem();
-
- BreadcrumbItem *childItem() const;
- AbstractViewBase *associatedView() const;
- bool hasChildren() const;
-
- void setChildItem(BreadcrumbItem *child);
- void setAssociatedView(AbstractViewBase *view);
- void setText(const QString &text);
- void setIcon(const QIcon &icon);
- void setActive(bool active);
-
-private:
- BreadcrumbItem *m_childItem;
-
- bool m_hasChildren;
- AbstractViewBase *m_associatedView;
- BreadcrumbItemButton *m_button;
-
-private Q_SLOTS:
- void emitActivated();
-
-Q_SIGNALS:
- void activated(BreadcrumbItem *item);
-};
-
-#endif
diff --git a/installer/BreadcrumbWidget/BreadcrumbItemButton.cpp b/installer/BreadcrumbWidget/BreadcrumbItemButton.cpp
deleted file mode 100644
index 72652f1..0000000
--- a/installer/BreadcrumbWidget/BreadcrumbItemButton.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************************
- * Copyright (c) 2006 Peter Penz <peter.penz at gmx.at> *
- * Copyright (c) 2006 Aaron Seigo <aseigo at kde.org> *
- * Copyright (c) 2009 Seb Ruiz <ruiz at kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License as published by the Free Software *
- * Foundation; either version 2 of the License, or (at your option) any later *
- * version. *
- * *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License along with *
- * this program. If not, see <http://www.gnu.org/licenses/>. *
- ****************************************************************************************/
-
-#include "BreadcrumbItemButton.h"
-
-#include <KColorScheme>
-#include <KLocalizedString>
-#include <KMenu>
-
-#include <QApplication>
-#include <QClipboard>
-#include <QMimeData>
-#include <QPainter>
-#include <QStyle>
-#include <QStyleOptionFocusRect>
-
-BreadcrumbItemButton::BreadcrumbItemButton( QWidget *parent )
- : QPushButton( parent )
- , m_displayHint( 0 )
-{
- init();
-}
-
-BreadcrumbItemButton::BreadcrumbItemButton( const QIcon &icon, const QString &text, QWidget *parent )
- : QPushButton( icon, text, parent )
- , m_displayHint( 0 )
-{
- init();
-}
-
-void
-BreadcrumbItemButton::init()
-{
- setFocusPolicy( Qt::NoFocus );
- setDisplayHintEnabled( HoverHint, false );
-}
-
-BreadcrumbItemButton::~BreadcrumbItemButton()
-{
-}
-
-void
-BreadcrumbItemButton::setActive( const bool active )
-{
- setDisplayHintEnabled( ActiveHint, active );
-
- QFont f = font();
- f.setBold( active );
- setFont( f );
-}
-
-void
-BreadcrumbItemButton::setDisplayHintEnabled( DisplayHint hint, bool enable )
-{
- if( enable )
- m_displayHint = m_displayHint | hint;
- else
- m_displayHint = m_displayHint & ~hint;
-
- update();
-}
-
-bool
-BreadcrumbItemButton::isDisplayHintEnabled( DisplayHint hint ) const
-{
- return (m_displayHint & hint) > 0;
-}
-
-void
-BreadcrumbItemButton::enterEvent( QEvent* event )
-{
- QPushButton::enterEvent( event );
- setDisplayHintEnabled( HoverHint, true );
- update();
-}
-
-void
-BreadcrumbItemButton::leaveEvent( QEvent* event )
-{
- QPushButton::leaveEvent( event );
- setDisplayHintEnabled( HoverHint, false );
- update();
-}
-
-void
-BreadcrumbItemButton::paintEvent( QPaintEvent* event )
-{
- Q_UNUSED(event);
-
- QPainter painter(this);
-
- const int buttonHeight = height();
- int buttonWidth = width();
- int preferredWidth = sizeHint().width();
- if (preferredWidth < minimumWidth()) {
- preferredWidth = minimumWidth();
- }
- if (buttonWidth > preferredWidth) {
- buttonWidth = preferredWidth;
- }
- drawHoverBackground(&painter);
-
- int left, top, right, bottom;
- getContentsMargins ( &left, &top, &right, &bottom );
- const int padding = 2;
- const int iconWidth = iconSize().width();
- const int iconHeight = iconSize().height();
- const int iconTop = ( (buttonHeight - top - bottom) - iconHeight ) / 2;
- const QRect iconRect( left + padding, iconTop, iconWidth, iconHeight );
- painter.drawPixmap( iconRect, icon().pixmap( iconSize() ) );
-
- const QRect textRect( left + (padding * 2) + iconWidth, top, buttonWidth, buttonHeight);
- painter.drawText(textRect, Qt::AlignVCenter, text());
-}
-
-
-void
-BreadcrumbItemButton::drawHoverBackground(QPainter* painter)
-{
- const bool isHovered = isDisplayHintEnabled( HoverHint );
-
- if( isHovered )
- {
- //QColor backgroundColor = palette().color(QPalette::Highlight);
- // TODO: the backgroundColor should be applied to the style
- QStyleOptionViewItemV4 option;
- option.initFrom(this);
- option.state = QStyle::State_Enabled | QStyle::State_MouseOver;
- option.viewItemPosition = QStyleOptionViewItemV4::OnlyOne;
- style()->drawPrimitive( QStyle::PE_PanelItemViewItem, &option, painter, this );
- }
-}
-
-QColor
-BreadcrumbItemButton::foregroundColor() const
-{
- const bool isHighlighted = isDisplayHintEnabled( HoverHint );
- const bool isActive = isDisplayHintEnabled( ActiveHint );
-
- QColor foregroundColor = palette().color( foregroundRole() );
- if( !isActive && !isHighlighted )
- foregroundColor.setAlpha( 180 );
-
- return foregroundColor;
-}
-
-QSize
-BreadcrumbItemButton::sizeHint() const
-{
- QSize size = QPushButton::sizeHint();
- QFontMetrics fm( font() );
- size.setWidth( fm.width( text() ) + iconSize().width() + 8 );
- return size;
-}
-
-#include "BreadcrumbItemButton.moc"
diff --git a/installer/BreadcrumbWidget/BreadcrumbItemButton.h b/installer/BreadcrumbWidget/BreadcrumbItemButton.h
deleted file mode 100644
index e0e7bb4..0000000
--- a/installer/BreadcrumbWidget/BreadcrumbItemButton.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************************
- * Copyright (c) 2006 Peter Penz <peter.penz at gmx.at> *
- * Copyright (c) 2006 Aaron Seigo <aseigo at kde.org> *
- * Copyright (c) 2009 Seb Ruiz <ruiz at kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License as published by the Free Software *
- * Foundation; either version 2 of the License, or (at your option) any later *
- * version. *
- * *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License along with *
- * this program. If not, see <http://www.gnu.org/licenses/>. *
- ****************************************************************************************/
-
-#ifndef BREADCRUMBITEMBUTTON_P_H
-#define BREADCRUMBITEMBUTTON_P_H
-
-#include <QColor>
-#include <QtWidgets/QPushButton>
-
-class QEvent;
-
-/**
- * @brief Base class for buttons of the URL navigator.
- *
- * Each button of the URL navigator contains an URL, which
- * is set as soon as the button has been clicked.
- */
-class BreadcrumbItemButton : public QPushButton
-{
- Q_OBJECT
-
- public:
- BreadcrumbItemButton( QWidget* parent );
- BreadcrumbItemButton( const QIcon &icon, const QString &text, QWidget *parent );
- virtual ~BreadcrumbItemButton();
-
- void setActive( const bool active );
-
- virtual QSize sizeHint() const;
-
- protected:
- enum DisplayHint
- {
- ActiveHint = 1,
- HoverHint = 2
- };
-
- void setDisplayHintEnabled(DisplayHint hint, bool enable);
- bool isDisplayHintEnabled(DisplayHint hint) const;
-
- virtual void enterEvent(QEvent* event);
- virtual void leaveEvent(QEvent* event);
-
- virtual void paintEvent(QPaintEvent* event);
- virtual void drawHoverBackground(QPainter* painter);
-
- /** Returns the foreground color by respecting the current display hint. */
- QColor foregroundColor() const;
-
- private:
- void init();
- int m_displayHint;
-};
-
-#endif
diff --git a/installer/BreadcrumbWidget/BreadcrumbWidget.cpp b/installer/BreadcrumbWidget/BreadcrumbWidget.cpp
deleted file mode 100644
index 7b8ed90..0000000
--- a/installer/BreadcrumbWidget/BreadcrumbWidget.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "BreadcrumbWidget.h"
-
-#include <QtCore/QTimer>
-#include <QtWidgets/QToolButton>
-
-#include <KLocalizedString>
-#include <KLineEdit>
-#include <KSeparator>
-#include <KStandardGuiItem>
-
-#include "../AbstractViewBase.h"
-#include "BreadcrumbItem.h"
-
-BreadcrumbWidget::BreadcrumbWidget(QWidget *parent)
- : KHBox(parent)
- , m_manualClear(false)
-{
- setSpacing(2);
- KGuiItem backButton = KStandardGuiItem::back();
- KGuiItem forwardButton = KStandardGuiItem::forward();
-
- m_backButton = new QToolButton(this);
- m_backButton->setAutoRaise(true);
- m_backButton->setToolTip(backButton.toolTip());
- m_backButton->setIcon(backButton.icon());
- m_backButton->setEnabled(false);
-
- m_forwardButton = new QToolButton(this);
- m_forwardButton->setAutoRaise(true);
- m_forwardButton->setToolTip(forwardButton.toolTip());
- m_forwardButton->setIcon(forwardButton.icon());
- m_forwardButton->setEnabled(false);
-
- KSeparator *verticalSeparator = new KSeparator(this);
- verticalSeparator->setOrientation(Qt::Vertical);
-
- m_breadcrumbArea = new KHBox(this);
- m_breadcrumbArea->setSpacing(2);
-
- QWidget *spacer = new QWidget(this);
- spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- m_searchEdit = new KLineEdit(this);
- m_searchEdit->setClickMessage(i18nc("@label Line edit click message", "Search"));
- m_searchEdit->setClearButtonShown(true);
-
- m_searchTimer = new QTimer(this);
- m_searchTimer->setInterval(300);
- m_searchTimer->setSingleShot(true);
-
- connect(m_backButton, SIGNAL(clicked()), this, SLOT(goBack()));
- connect(m_forwardButton, SIGNAL(clicked()), this, SLOT(goForward()));
- connect(m_searchTimer, SIGNAL(timeout()), this, SLOT(startSearch()));
- connect(m_searchEdit, SIGNAL(textChanged(QString)), m_searchTimer, SLOT(start()));
- connect(m_searchEdit, SIGNAL(clearButtonClicked()), this, SLOT(clearClicked()));
-}
-
-BreadcrumbWidget::~BreadcrumbWidget()
-{
-}
-
-void BreadcrumbWidget::setRootItem(BreadcrumbItem *root)
-{
- clearCrumbs();
- addLevel(root);
-
- m_forwardButton->setEnabled(false);
- m_backButton->setEnabled(false);
-}
-
-void BreadcrumbWidget::clearCrumbs()
-{
- if (!m_items.isEmpty()) {
- foreach(BreadcrumbItem *item, m_items) {
- item->hide();
- item->deleteLater();
- }
- }
-
- m_currentItem = 0;
- m_items.clear();
-}
-
-void BreadcrumbWidget::addLevel(BreadcrumbItem *item)
-{
- // If we are activating a new subView from a view that already has
- // children, the old ones must go
- if (m_currentItem && m_currentItem->hasChildren()) {
- removeItem(m_currentItem->childItem());
- }
-
- if (!m_items.isEmpty()) {
- m_items.last()->setChildItem(item);
- }
-
- item->setParent(m_breadcrumbArea);
- item->show();
-
- m_items.append(item);
- setCurrentItem(item);
-
- m_forwardButton->setEnabled(false);
- m_backButton->setEnabled(true);
-
- connect(item, SIGNAL(activated(BreadcrumbItem*)), this, SLOT(onItemActivated(BreadcrumbItem*)));
- connect(item, SIGNAL(activated(BreadcrumbItem*)), this, SLOT(setCurrentItem(BreadcrumbItem*)));
-}
-
-void BreadcrumbWidget::removeItem(BreadcrumbItem *item)
-{
- // Recursion ftw
- if (item->hasChildren()){
- removeItem(item->childItem());
- }
-
- item->hide();
- item->associatedView()->deleteLater();
- item->deleteLater();
- m_items.removeLast();
-}
-
-void BreadcrumbWidget::goForward()
-{
- setCurrentItem(m_items.at(m_items.indexOf(m_currentItem) + 1));
- onItemActivated(m_currentItem);
-}
-
-void BreadcrumbWidget::goBack()
-{
- setCurrentItem(m_items.at(m_items.indexOf(m_currentItem) - 1));
- onItemActivated(m_currentItem);
-}
-
-void BreadcrumbWidget::setCurrentItem(BreadcrumbItem *itemToBold)
-{
- // Bolds the appropriate item and unbolds everything else
- foreach(BreadcrumbItem *item, m_items) {
- item->setActive(item == itemToBold);
- }
-
- m_currentItem = itemToBold;
-}
-
-void BreadcrumbWidget::onItemActivated(BreadcrumbItem *item)
-{
- m_backButton->setEnabled(m_items.indexOf(item) > 0);
- m_forwardButton->setEnabled(item != m_items.last());
-
- emit itemActivated(item);
-}
-
-void BreadcrumbWidget::startSearch()
-{
- if (m_searchEdit->text().isEmpty() && !m_manualClear)
- return;
-
- emit search(m_searchEdit->text());
- m_manualClear = false;
-}
-
-void BreadcrumbWidget::showSearchEdit()
-{
- m_searchEdit->show();
-}
-
-void BreadcrumbWidget::hideSearchEdit()
-{
- m_searchEdit->hide();
-}
-
-BreadcrumbItem *BreadcrumbWidget::breadcrumbForView(AbstractViewBase *view)
-{
- BreadcrumbItem *itemForView = 0;
-
- foreach (BreadcrumbItem *item, m_items) {
- if (item->associatedView() == view) {
- itemForView = item;
- }
- }
-
- return itemForView;
-}
-
-void BreadcrumbWidget::clearClicked()
-{
- m_manualClear = true;
-}
-
-#include "BreadcrumbWidget.moc"
diff --git a/installer/BreadcrumbWidget/BreadcrumbWidget.h b/installer/BreadcrumbWidget/BreadcrumbWidget.h
deleted file mode 100644
index 9dad4b3..0000000
--- a/installer/BreadcrumbWidget/BreadcrumbWidget.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef BREADCRUMBWIDGET_H
-#define BREADCRUMBWIDGET_H
-
-#include <QtCore/QList>
-
-#include <KHBox>
-
-class QTimer;
-class QToolButton;
-
-class KLineEdit;
-
-class AbstractViewBase;
-class BreadcrumbItem;
-
-class BreadcrumbWidget : public KHBox
-{
- Q_OBJECT
-public:
- BreadcrumbWidget(QWidget *parent);
- ~BreadcrumbWidget();
-
- void setRootItem(BreadcrumbItem *root);
- void addLevel(BreadcrumbItem *crumb);
-
- /**
- * Removes the given item and all children
- *
- * @param The \c BreadcrumbItem to remove
- */
- void removeItem(BreadcrumbItem *crumb);
- void showSearchEdit();
- void hideSearchEdit();
-
- BreadcrumbItem *breadcrumbForView(AbstractViewBase *view);
-
-private:
- QList<BreadcrumbItem *> m_items;
- BreadcrumbItem *m_currentItem;
-
- QToolButton *m_backButton;
- QToolButton *m_forwardButton;
- KHBox *m_breadcrumbArea;
- KLineEdit *m_searchEdit;
- QTimer *m_searchTimer;
- bool m_manualClear;
-
-public Q_SLOTS:
- void setCurrentItem(BreadcrumbItem *crumb);
- void startSearch();
-
-private Q_SLOTS:
- void goBack();
- void goForward();
- void onItemActivated(BreadcrumbItem *item);
- void clearCrumbs();
- void clearClicked();
-
-Q_SIGNALS:
- void itemActivated(BreadcrumbItem *item);
- void search(const QString &text);
-};
-
-#endif
diff --git a/installer/CMakeLists.txt b/installer/CMakeLists.txt
deleted file mode 100644
index 8b5a161..0000000
--- a/installer/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-include_directories(../libmuon ../libmuonapt/)
-
-set(muon_installer_SRCS
- main.cpp
- MainWindow.cpp
- ApplicationLauncher.cpp
- ResourceView/ResourceDelegate.cpp
- ResourceView/ResourceExtender.cpp
- ResourceView/ResourceListView.cpp
- ResourceView/ResourceViewWidget.cpp
- ResourceDetailsView/ResourceDetailsWidget.cpp
- ResourceDetailsView/ResourceDetailsView.cpp
- ResourceDetailsView/AddonsWidget.cpp
- AbstractViewBase.cpp
- AbstractViewContainer.cpp
- AvailableView.cpp
- BreadcrumbWidget/BreadcrumbItem.cpp
- BreadcrumbWidget/BreadcrumbWidget.cpp
- BreadcrumbWidget/BreadcrumbItemButton.cpp
- CategoryView/CategoryDrawer.cpp
- CategoryView/CategoryView.cpp
- CategoryView/CategoryViewWidget.cpp
- ClickableLabel.cpp
- effects/GraphicsOpacityDropShadowEffect.cpp
- ProgressView.cpp
- qml/src/mousecursor.cpp
- ReviewsWidget/ReviewWidget.cpp
- ReviewsWidget/ReviewsWidget.cpp
- ScreenShotOverlay.cpp
- ViewSwitcher.cpp
- LaunchListModel.cpp
-)
-
-kconfig_add_kcfg_files(muon_installer_SRCS GENERATE_MOC config/MuonInstallerSettings.kcfgc)
-
-add_executable(muon-installer ${muon_installer_SRCS})
-
-target_link_libraries(muon-installer MuonCommon MuonApt
- KF5::KIOWidgets
- QApt::Main
- Qt5::Declarative)
-
-install(TARGETS muon-installer ${INSTALL_TARGETS_DEFAULT_ARGS} )
-
-########### install files ###############
-
-file(GLOB muon_QMLS "${CMAKE_CURRENT_SOURCE_DIR}/qml/qml/*.qml")
-install( PROGRAMS muon-installer.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
-install(FILES muoninstallerui.rc DESTINATION ${DATA_INSTALL_DIR}/muoninstaller)
-install(FILES ${muon_QMLS} DESTINATION ${DATA_INSTALL_DIR}/muoninstaller)
-install(FILES config/muon-installer.kcfg DESTINATION ${KCFG_INSTALL_DIR})
diff --git a/installer/CategoryView/CategoryDrawer.cpp b/installer/CategoryView/CategoryDrawer.cpp
deleted file mode 100644
index d251174..0000000
--- a/installer/CategoryView/CategoryDrawer.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Rafael Fernández López <ereslibre at kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
- ***************************************************************************/
-
-#include "CategoryDrawer.h"
-
-#include <QPainter>
-#include <QApplication>
-#include <QStyleOption>
-
-#include <KCategorizedSortFilterProxyModel>
-
-CategoryDrawer::CategoryDrawer(KCategorizedView *view)
- : KCategoryDrawerV3(view)
-{
- setLeftMargin( 7 );
- setRightMargin( 7 );
-}
-
-void CategoryDrawer::drawCategory(const QModelIndex &index,
- int sortRole,
- const QStyleOption &option,
- QPainter *painter) const
-{
- Q_UNUSED( option )
- Q_UNUSED( painter )
- Q_UNUSED( sortRole )
-
- painter->setRenderHint(QPainter::Antialiasing);
-
- const QRect optRect = option.rect;
- QFont font(QApplication::font());
- font.setBold(true);
- const QFontMetrics fontMetrics = QFontMetrics(font);
- const int height = categoryHeight(index, option);
- const bool leftToRight = painter->layoutDirection() == Qt::LeftToRight;
-
- //BEGIN: decoration gradient
- {
- QPainterPath path(optRect.bottomLeft());
-
- path.lineTo(QPoint(optRect.topLeft().x(), optRect.topLeft().y() - 3));
- const QPointF topLeft(optRect.topLeft());
- QRectF arc(topLeft, QSizeF(4, 4));
- path.arcTo(arc, 180, -90);
- path.lineTo(optRect.topRight());
- path.lineTo(optRect.bottomRight());
- path.lineTo(optRect.bottomLeft());
-
- QColor window(option.palette.window().color());
- const QColor base(option.palette.base().color());
-
- window.setAlphaF(0.4);
-
- QLinearGradient decoGradient1;
- if (leftToRight) {
- decoGradient1.setStart(optRect.topLeft());
- decoGradient1.setFinalStop(optRect.bottomLeft());
- } else {
- decoGradient1.setStart(optRect.topRight());
- decoGradient1.setFinalStop(optRect.bottomRight());
- }
- decoGradient1.setColorAt(0, window);
- decoGradient1.setColorAt(1, Qt::transparent);
-
- QLinearGradient decoGradient2;
- if (leftToRight) {
- decoGradient2.setStart(optRect.topLeft());
- decoGradient2.setFinalStop(optRect.topRight());
- } else {
- decoGradient2.setStart(optRect.topRight());
- decoGradient2.setFinalStop(optRect.topLeft());
- }
- decoGradient2.setColorAt(0, Qt::transparent);
- decoGradient2.setColorAt(1, base);
-
- painter->fillPath(path, decoGradient1);
- painter->fillPath(path, decoGradient2);
- }
- //END: decoration gradient
-
- {
- QRect newOptRect(optRect);
-
- if (leftToRight) {
- newOptRect.translate(1, 1);
- } else {
- newOptRect.translate(-1, 1);
- }
-
- //BEGIN: inner top left corner
- {
- painter->save();
- painter->setPen(option.palette.base().color());
- QRectF arc;
- if (leftToRight) {
- const QPointF topLeft(newOptRect.topLeft());
- arc = QRectF(topLeft, QSizeF(4, 4));
- arc.translate(0.5, 0.5);
- painter->drawArc(arc, 1440, 1440);
- } else {
- QPointF topRight(newOptRect.topRight());
- topRight.rx() -= 4;
- arc = QRectF(topRight, QSizeF(4, 4));
- arc.translate(-0.5, 0.5);
- painter->drawArc(arc, 0, 1440);
- }
- painter->restore();
- }
- //END: inner top left corner
-
- //BEGIN: inner left vertical line
- {
- QPoint start;
- QPoint verticalGradBottom;
- if (leftToRight) {
- start = newOptRect.topLeft();
- verticalGradBottom = newOptRect.topLeft();
- } else {
- start = newOptRect.topRight();
- verticalGradBottom = newOptRect.topRight();
- }
- start.ry() += 3;
- verticalGradBottom.ry() += newOptRect.height() - 3;
- QLinearGradient gradient(start, verticalGradBottom);
- gradient.setColorAt(0, option.palette.base().color());
- gradient.setColorAt(1, Qt::transparent);
- painter->fillRect(QRect(start, QSize(1, newOptRect.height() - 3)), gradient);
- }
- //END: inner left vertical line
-
- //BEGIN: inner horizontal line
- {
- QPoint start;
- QPoint horizontalGradTop;
- if (leftToRight) {
- start = newOptRect.topLeft();
- horizontalGradTop = newOptRect.topLeft();
- start.rx() += 3;
- horizontalGradTop.rx() += newOptRect.width() - 3;
- } else {
- start = newOptRect.topRight();
- horizontalGradTop = newOptRect.topRight();
- start.rx() -= 3;
- horizontalGradTop.rx() -= newOptRect.width() - 3;
- }
- QLinearGradient gradient(start, horizontalGradTop);
- gradient.setColorAt(0, option.palette.base().color());
- gradient.setColorAt(1, Qt::transparent);
- QSize rectSize;
- if (leftToRight) {
- rectSize = QSize(newOptRect.width() - 3, 1);
- } else {
- rectSize = QSize(-newOptRect.width() + 3, 1);
- }
- painter->fillRect(QRect(start, rectSize), gradient);
- }
- //END: inner horizontal line
- }
-
- QColor outlineColor = option.palette.text().color();
- outlineColor.setAlphaF(0.35);
-
- //BEGIN: top left corner
- {
- painter->save();
- painter->setPen(outlineColor);
- QRectF arc;
- if (leftToRight) {
- const QPointF topLeft(optRect.topLeft());
- arc = QRectF(topLeft, QSizeF(4, 4));
- arc.translate(0.5, 0.5);
- painter->drawArc(arc, 1440, 1440);
- } else {
- QPointF topRight(optRect.topRight());
- topRight.rx() -= 4;
- arc = QRectF(topRight, QSizeF(4, 4));
- arc.translate(-0.5, 0.5);
- painter->drawArc(arc, 0, 1440);
- }
- painter->restore();
- }
- //END: top left corner
-
- //BEGIN: left vertical line
- {
- QPoint start;
- QPoint verticalGradBottom;
- if (leftToRight) {
- start = optRect.topLeft();
- verticalGradBottom = optRect.topLeft();
- } else {
- start = optRect.topRight();
- verticalGradBottom = optRect.topRight();
- }
- start.ry() += 3;
- verticalGradBottom.ry() += optRect.height() - 3;
- QLinearGradient gradient(start, verticalGradBottom);
- gradient.setColorAt(0, outlineColor);
- gradient.setColorAt(1, option.palette.base().color());
- painter->fillRect(QRect(start, QSize(1, optRect.height() - 3)), gradient);
- }
- //END: left vertical line
-
- //BEGIN: horizontal line
- {
- QPoint start;
- QPoint horizontalGradTop;
- if (leftToRight) {
- start = optRect.topLeft();
- horizontalGradTop = optRect.topLeft();
- start.rx() += 3;
- horizontalGradTop.rx() += optRect.width() - 3;
- } else {
- start = optRect.topRight();
- horizontalGradTop = optRect.topRight();
- start.rx() -= 3;
- horizontalGradTop.rx() -= optRect.width() - 3;
- }
- QLinearGradient gradient(start, horizontalGradTop);
- gradient.setColorAt(0, outlineColor);
- gradient.setColorAt(1, option.palette.base().color());
- QSize rectSize;
- if (leftToRight) {
- rectSize = QSize(optRect.width() - 3, 1);
- } else {
- rectSize = QSize(-optRect.width() + 3, 1);
- }
- painter->fillRect(QRect(start, rectSize), gradient);
- }
- //END: horizontal line
-
- //BEGIN: draw text
- {
- const QString category = index.model()->data(index, KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
- QRect textRect = QRect(option.rect.topLeft(), QSize(option.rect.width() - 2 - 3 - 3, height));
- textRect.setTop(textRect.top() + 2 + 3 /* corner */);
- textRect.setLeft(textRect.left() + 2 + 3 /* corner */ + 3 /* a bit of margin */);
- painter->save();
- painter->setFont(font);
- QColor penColor(option.palette.text().color());
- penColor.setAlphaF(0.6);
- painter->setPen(penColor);
- painter->drawText(textRect, Qt::AlignLeft | Qt::AlignTop, category);
- painter->restore();
- }
- //END: draw text
-}
-
-int CategoryDrawer::categoryHeight(const QModelIndex &index, const QStyleOption &option) const
-{
- Q_UNUSED( index );
- Q_UNUSED( option );
-
- QFont font(QApplication::font());
- font.setBold(true);
- const QFontMetrics fontMetrics = QFontMetrics(font);
-
- return fontMetrics.height() + 2 + 12 /* vertical spacing */;
-}
diff --git a/installer/CategoryView/CategoryDrawer.h b/installer/CategoryView/CategoryDrawer.h
deleted file mode 100644
index cd7ec8e..0000000
--- a/installer/CategoryView/CategoryDrawer.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Rafael Fernández López <ereslibre at kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
- ***************************************************************************/
-
-#ifndef CATEGORYDRAWER_H
-#define CATEGORYDRAWER_H
-
-#include <KCategoryDrawer>
-
-class QPainter;
-class QModelIndex;
-class QStyleOption;
-
-class CategoryDrawer : public KCategoryDrawerV3
-{
-public:
- CategoryDrawer(KCategorizedView *view);
-
- virtual void drawCategory(const QModelIndex &index,
- int sortRole,
- const QStyleOption &option,
- QPainter *painter) const;
-
- virtual int categoryHeight(const QModelIndex &index, const QStyleOption &option) const;
-};
-
-#endif
diff --git a/installer/CategoryView/CategoryView.cpp b/installer/CategoryView/CategoryView.cpp
deleted file mode 100644
index a921c03..0000000
--- a/installer/CategoryView/CategoryView.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "CategoryView.h"
-
-// KDE includes
-#include <KDialog>
-#include <KCategoryDrawer>
-#include <KFileItemDelegate>
-
-// Own includes
-#include "CategoryDrawer.h"
-
-CategoryView::CategoryView(QWidget *parent)
- : KCategorizedView(parent)
-{
- CategoryDrawer *drawer = new CategoryDrawer(this);
-
- setSelectionMode(QAbstractItemView::SingleSelection);
- setSpacing(KDialog::spacingHint());
- setResizeMode(QListView::Adjust);
- setWordWrap(true);
- setCategoryDrawer(drawer);
- setViewMode(QListView::IconMode);
- setMouseTracking( true );
- viewport()->setAttribute( Qt::WA_Hover );
-
- KFileItemDelegate *delegate = new KFileItemDelegate(this);
- delegate->setWrapMode(QTextOption::WordWrap);
- setItemDelegate(delegate);
-}
-
-void CategoryView::setModel(QAbstractItemModel *model)
-{
- //icon stuff ripped from System Settings trunk
- KCategorizedView::setModel(model);
- int maxWidth = -1;
- int maxHeight = -1;
- for (int i = 0; i < model->rowCount(); ++i) {
- const QModelIndex index = model->index(i, modelColumn(), rootIndex());
- const QSize size = sizeHintForIndex(index);
- maxWidth = qMax(maxWidth, size.width());
- maxHeight = qMax(maxHeight, size.height());
- }
- setGridSize(QSize(maxWidth, maxHeight ));
- static_cast<KFileItemDelegate*>(itemDelegate())->setMaximumSize(QSize(maxWidth, maxHeight));
-}
-
-#include "CategoryView.moc"
diff --git a/installer/CategoryView/CategoryView.h b/installer/CategoryView/CategoryView.h
deleted file mode 100644
index dae6b74..0000000
--- a/installer/CategoryView/CategoryView.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef CATEGORYVIEW_H
-#define CATEGORYVIEW_H
-
-// KDE includes
-#include <KCategorizedView>
-
-class CategoryView : public KCategorizedView
-{
- Q_OBJECT
-
-public:
- CategoryView(QWidget *parent=0);
-
- void setModel(QAbstractItemModel *model);
-};
-
-#endif
diff --git a/installer/CategoryView/CategoryViewWidget.cpp b/installer/CategoryView/CategoryViewWidget.cpp
deleted file mode 100644
index 6508671..0000000
--- a/installer/CategoryView/CategoryViewWidget.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "CategoryViewWidget.h"
-
-// Qt includes
-#include <QStandardItemModel>
-#include <QtWidgets/QVBoxLayout>
-
-// KDE includes
-#include <KCategorizedSortFilterProxyModel>
-#include <KLocalizedString>
-
-// Libmuon includes
-#include <Category/Category.h>
-#include <Category/CategoryModel.h>
-
-// Own includes
-#include "ResourceView/ResourceViewWidget.h"
-#include "BreadcrumbWidget/BreadcrumbItem.h"
-#include "CategoryView.h"
-
-CategoryViewWidget::CategoryViewWidget(QWidget *parent)
- : AbstractViewBase(parent)
- , m_searchView(0)
-{
- m_searchable = true;
- m_categoryModel = new CategoryModel(this);
-
- m_categoryView = new CategoryView(this);
-
- m_layout->addWidget(m_categoryView);
-
- connect(m_categoryView, SIGNAL(activated(QModelIndex)),
- this, SLOT(onIndexActivated(QModelIndex)));
-}
-
-
-void CategoryViewWidget::setDisplayedCategory(Category* c)
-{
- m_categoryModel->setDisplayedCategory(c);
-
- KCategorizedSortFilterProxyModel *proxy = new KCategorizedSortFilterProxyModel(this);
- proxy->setSourceModel(m_categoryModel);
- proxy->setCategorizedModel(true);
- m_categoryView->setModel(proxy);
-
- m_crumb->setText(c ? c->name() : i18n("Get Software"));
- m_crumb->setIcon(QIcon::fromTheme(c ? c->icon() : "applications-other"));
- m_crumb->setAssociatedView(this);
-}
-
-void CategoryViewWidget::onIndexActivated(const QModelIndex &index)
-{
- AbstractViewBase *view = m_subViewHash.value(index);
-
- // If a view already exists, switch to it without disturbing things
- if (view && m_subView == view) {
- emit switchToSubView(view);
- return;
- }
-
- // Otherwise we have to create a new view
- Category *category = m_categoryModel->categoryForRow(index.row());
-
- if(!category->hasSubCategories()) {
- m_subView = new ResourceViewWidget(this);
-
- ResourceViewWidget *appView = static_cast<ResourceViewWidget *>(m_subView);
- appView->setFiltersFromCategory(category);
- appView->setTitle(category->name());
- appView->setIcon(QIcon::fromTheme(category->icon()));
- appView->setShouldShowTechnical(category->shouldShowTechnical());
- } else {
- m_subView = new CategoryViewWidget(this);
-
- CategoryViewWidget *subCatView = static_cast<CategoryViewWidget *>(m_subView);
- subCatView->setDisplayedCategory(category);
- }
-
- // Forward on to parent so that they can handle adding subviews to breadcrumb,
- // switching to subviews from the new subview, etc
- connect(m_subView, SIGNAL(registerNewSubView(AbstractViewBase*)),
- this, SIGNAL(registerNewSubView(AbstractViewBase*)));
- // Make sure we remove the index/widget association upon deletion
- connect(m_subView, SIGNAL(destroyed(QObject*)),
- this, SLOT(onSubViewDestroyed()));
-
- // Tell our parent that we can exist, so that they can forward it
- emit registerNewSubView(m_subView);
-}
-
-void CategoryViewWidget::search(const QString &text)
-{
- if (text.size() < 2) {
- return;
- }
-
- if (!m_searchView) {
- m_searchView = new ResourceViewWidget(this);
- m_searchView->setTitle(i18nc("@label", "Search Results"));
- m_searchView->setIcon(QIcon::fromTheme("applications-other"));
-
- // Forward on to parent so that they can handle adding subviews to breadcrumb,
- // switching to subviews from the new subview, etc
- connect(m_searchView, SIGNAL(registerNewSubView(AbstractViewBase*)),
- this, SIGNAL(registerNewSubView(AbstractViewBase*)));
- // Make sure we clear the pointer upon deletion
- connect(m_searchView, SIGNAL(destroyed(QObject*)),
- this, SLOT(onSearchViewDestroyed()));
-
- // Tell our parent that we can exist, so that they can forward it
- emit registerNewSubView(m_searchView);
- } else {
- switchToSubView(m_searchView);
- }
-
- m_searchView->search(text);
-}
-
-void CategoryViewWidget::onSubViewDestroyed()
-{
- auto iter = m_subViewHash.begin();
- while (iter != m_subViewHash.end()) {
- auto prev = iter;
- if (prev.value() == m_subView) {
- m_subViewHash.erase(prev);
- break; // Found our subview, guaranteed to be only one since we don't use insertMulti
- }
- ++iter;
- }
-}
-
-void CategoryViewWidget::onSearchViewDestroyed()
-{
- m_searchView = nullptr;
-}
diff --git a/installer/CategoryView/CategoryViewWidget.h b/installer/CategoryView/CategoryViewWidget.h
deleted file mode 100644
index 1bd7e4a..0000000
--- a/installer/CategoryView/CategoryViewWidget.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef CATEGORYVIEWWIDGET_H
-#define CATEGORYVIEWWIDGET_H
-
-#include "../AbstractViewBase.h"
-
-#include <QModelIndex>
-#include <QtCore/QList>
-
-class CategoryModel;
-class QIcon;
-class QStandardItemModel;
-class QString;
-
-class Category;
-class CategoryView;
-
-class ResourceViewWidget;
-
-class CategoryViewWidget : public AbstractViewBase
-{
- Q_OBJECT
-public:
- CategoryViewWidget(QWidget *parent);
-
- void setDisplayedCategory(Category* c);
- void search(const QString &text);
-
-private:
- CategoryModel *m_categoryModel;
- QHash<QModelIndex, AbstractViewBase *> m_subViewHash;
-
- CategoryView *m_categoryView;
- AbstractViewBase *m_subView;
- ResourceViewWidget *m_searchView;
-
-private Q_SLOTS:
- void onIndexActivated(const QModelIndex &index);
- void onSubViewDestroyed();
- void onSearchViewDestroyed();
-};
-
-#endif
diff --git a/installer/ClickableLabel.cpp b/installer/ClickableLabel.cpp
deleted file mode 100644
index 54dc5a6..0000000
--- a/installer/ClickableLabel.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009-2010 by Daniel Nicoletti *
- * dantti85-pk at yahoo.com.br *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; see the file COPYING. If not, write to *
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#include "ClickableLabel.h"
-
-#include <QMouseEvent>
-
-ClickableLabel::ClickableLabel(QWidget *parent, Qt::WindowFlags f)
- : QLabel(parent, f)
-{
-}
-
-
-void ClickableLabel::mousePressEvent(QMouseEvent *event)
-{
- if (cursor().shape() == Qt::PointingHandCursor) {
- emit clicked();
- event->accept();
- } else {
- QLabel::mousePressEvent(event);
- }
-}
-
-#include "ClickableLabel.moc"
diff --git a/installer/ClickableLabel.h b/installer/ClickableLabel.h
deleted file mode 100644
index 4803853..0000000
--- a/installer/ClickableLabel.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009-2010 by Daniel Nicoletti *
- * dantti85-pk at yahoo.com.br *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; see the file COPYING. If not, write to *
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#ifndef CLICKABLE_LABEL_H
-#define CLICKABLE_LABEL_H
-
-#include <QLabel>
-
-class ClickableLabel : public QLabel
-{
-Q_OBJECT
-public:
- explicit ClickableLabel(QWidget *parent = 0, Qt::WindowFlags f = 0);
-
-signals:
- void clicked();
-
-protected:
- virtual void mousePressEvent(QMouseEvent *event);
-};
-
-#endif
diff --git a/installer/LaunchListModel.cpp b/installer/LaunchListModel.cpp
deleted file mode 100644
index ced3970..0000000
--- a/installer/LaunchListModel.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * Copyright © 2012 Aleix Pol Gonzalez <aleixpol at blue-systems.com> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "LaunchListModel.h"
-
-// Qt includes
-#include <QStringBuilder>
-
-// KDE includes
-#include <KService>
-#include <KToolInvocation>
-
-// Libmuon includes
-#include "Transaction/TransactionModel.h"
-#include "resources/AbstractResource.h"
-
-LaunchListModel::LaunchListModel(QObject* parent)
- : QStandardItemModel(parent)
-{
- connect(TransactionModel::global(), SIGNAL(transactionAdded(Transaction*)),
- this, SLOT(watchTransaction(Transaction*)));
-}
-
-void LaunchListModel::watchTransaction(Transaction *trans)
-{
- connect(trans, SIGNAL(statusChanged(Transaction::Status)),
- this, SLOT(transactionStatusChanged(Transaction::Status)));
-}
-
-void LaunchListModel::transactionStatusChanged(Transaction::Status status)
-{
- Transaction *trans = qobject_cast<Transaction *>(sender());
-
- if (status == Transaction::DoneStatus)
- transactionFinished(trans);
-}
-
-void LaunchListModel::transactionFinished(Transaction* trans)
-{
- bool doneInstall = trans->status() == Transaction::DoneStatus &&
- trans->role() == Transaction::InstallRole;
-
- if(trans->resource()->canExecute() && doneInstall)
- addApplication(trans->resource());
-}
-
-void LaunchListModel::addApplication(AbstractResource* app)
-{
- QList<QStandardItem*> items;
- QStringList execs = app->executables();
-
- for (const QString& exec : execs) {
- KService::Ptr service = KService::serviceByStorageId(exec);
-
- QString name = service->property("Name").toString();
- if (!service->genericName().isEmpty())
- name += QLatin1String(" - ") % service->genericName();
-
- QStandardItem *item = new QStandardItem(name);
- item->setIcon(QIcon::fromTheme(service->icon()));
- item->setData(service->desktopEntryPath(), Qt::UserRole);
- items += item;
- }
- if(!items.isEmpty())
- invisibleRootItem()->appendRows(items);
-}
-
-void LaunchListModel::invokeApplication(const QModelIndex &idx) const
-{
- KToolInvocation::startServiceByDesktopPath(idx.data(Qt::UserRole).toString());
-}
-
-void LaunchListModel::invokeApplication(int row) const
-{
- invokeApplication(index(row, 0));
-}
diff --git a/installer/LaunchListModel.h b/installer/LaunchListModel.h
deleted file mode 100644
index c093cd7..0000000
--- a/installer/LaunchListModel.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- * Copyright © 2012 Aleix Pol Gonzalez <aleixpol at blue-systems.com> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef LAUNCHLISTMODEL_H
-#define LAUNCHLISTMODEL_H
-
-#include "libMuonCommon_export.h"
-
-// Qt includes
-#include <QStandardItemModel>
-
-// Libmuon includes
-#include "Transaction/Transaction.h"
-
-class AbstractResource;
-
-class MUONCOMMON_EXPORT LaunchListModel : public QStandardItemModel
-{
- Q_OBJECT
-public:
- explicit LaunchListModel(QObject* parent = nullptr);
-
- void addApplication(AbstractResource* a);
-
-public slots:
- void invokeApplication(const QModelIndex &idx) const;
- void invokeApplication(int row) const;
-
-private slots:
- void watchTransaction(Transaction *trans);
- void transactionStatusChanged(Transaction::Status status);
- void transactionFinished(Transaction *trans);
-};
-
-#endif // LAUNCHLISTMODEL_H
diff --git a/installer/MainWindow.cpp b/installer/MainWindow.cpp
deleted file mode 100644
index 6c98d72..0000000
--- a/installer/MainWindow.cpp
+++ /dev/null
@@ -1,497 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "MainWindow.h"
-
-// Qt includes
-#include <QStandardItemModel>
-#include <QtCore/QStringBuilder>
-#include <QtCore/QTimer>
-#include <QAbstractItemView>
-#include <QSplitter>
-#include <QtWidgets/QStackedWidget>
-
-// KDE includes
-#include <KActionCollection>
-#include <KMessageBox>
-#include <KMessageWidget>
-#include <KPixmapSequence>
-#include <KPixmapSequenceOverlayPainter>
-#include <KService>
-#include <KToolInvocation>
-
-// QApt includes
-#include <QApt/Backend>
-
-//libmuonapt includes
-#include <HistoryView/HistoryView.h>
-#include "../libmuonapt/QAptActions.h"
-
-// Libmuon includes
-#include <Transaction/TransactionModel.h>
-#include <resources/ResourcesModel.h>
-
-// Own includes
-#include "ApplicationLauncher.h"
-#include "ResourceView/ResourceListView.h"
-#include "AvailableView.h"
-#include "ProgressView.h"
-#include "ViewSwitcher.h"
-#include "LaunchListModel.h"
-#include "MuonInstallerSettings.h"
-
-enum ViewModelRole {
- /// A role for storing ViewType
- ViewTypeRole = Qt::UserRole + 1,
- /// A role for storing origin filter data
- OriginFilterRole,
- /// A role for storing state filter data
- StateFilterRole
-};
-
-enum ViewType {
- /// An invalid value
- InvalidView = 0,
- /// A simple ApplicationView that is filterable by status or origin
- AppView,
- /// An ApplicationView that has a Categorical homepage
- CatView,
- /// A CategoryView showing subcategories
- SubCatView,
- /// A view for showing history
- History,
- /// A view for showing in-progress transactions
- Progress
-};
-
-MainWindow::MainWindow()
- : MuonMainWindow()
- , m_appBackend(nullptr)
- , m_launches(nullptr)
- , m_launcherMessage(nullptr)
- , m_appLauncher(nullptr)
- , m_progressItem(nullptr)
-{
- initGUI();
-
- TransactionModel *transModel = TransactionModel::global();
- connect(transModel, SIGNAL(startingFirstTransaction()), SLOT(addProgressItem()));
- connect(transModel, SIGNAL(lastTransactionFinished()), SLOT(removeProgressItem()));
- m_launches = new LaunchListModel(this);
-
- ResourcesModel* resourcesModel = ResourcesModel::global();
- resourcesModel->integrateMainWindow(this);
- connect(resourcesModel, SIGNAL(backendsChanged()), SLOT(initObject()));
-}
-
-MainWindow::~MainWindow()
-{
- MuonInstallerSettings::self()->writeConfig();
-}
-
-void MainWindow::initGUI()
-{
- m_mainWidget = new QSplitter(this);
- m_mainWidget->setOrientation(Qt::Horizontal);
- connect(m_mainWidget, SIGNAL(splitterMoved(int,int)), this, SLOT(saveSplitterSizes()));
- setCentralWidget(m_mainWidget);
-
- // Set up the navigational sidebar on the right
- m_viewSwitcher = new ViewSwitcher(this);
- connect(m_viewSwitcher, SIGNAL(activated(QModelIndex)),
- this, SLOT(changeView(QModelIndex)));
- m_mainWidget->addWidget(m_viewSwitcher);
-
- // Set up the main pane
- KVBox *leftWidget = new KVBox(this);
- m_launcherMessage = new KMessageWidget(leftWidget);
- m_launcherMessage->hide();
- m_launcherMessage->setMessageType(KMessageWidget::Positive);
-
- m_viewStack = new QStackedWidget(leftWidget);
- m_viewStack->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- // Busy widget
- m_busyWidget = new QWidget(m_viewStack);
- KPixmapSequenceOverlayPainter *busyWidget = new KPixmapSequenceOverlayPainter(m_busyWidget);
- busyWidget->setSequence(KPixmapSequence("process-working", KIconLoader::SizeSmallMedium));
- busyWidget->setWidget(m_busyWidget);
- busyWidget->start();
-
- m_viewStack->addWidget(m_busyWidget);
- m_viewStack->setCurrentWidget(m_busyWidget);
-
- m_mainWidget->addWidget(leftWidget);
- loadSplitterSizes();
-
- m_viewModel = new QStandardItemModel(this);
- m_viewSwitcher->setModel(m_viewModel);
-
- setupActions();
- setupGUI(StandardWindowOption(KXmlGuiWindow::Default & ~KXmlGuiWindow::StatusBar));
-}
-
-void MainWindow::initObject()
-{
- ResourcesModel *resourcesModel = ResourcesModel::global();
-
- QVector<AbstractResourcesBackend*> backends = resourcesModel->backends();
- for (AbstractResourcesBackend *backend : backends) {
- if(!m_appBackend &&
- backend->metaObject()->className()==QLatin1String("ApplicationBackend"))
- {
- m_appBackend = backend;
- connect(m_appBackend, SIGNAL(fetchingChanged()), SLOT(aptFetchingChanged()));
- connect(m_appBackend, SIGNAL(sourcesEditorFinished()), SLOT(sourcesEditorFinished()));
- populateViews();
- }
- }
- connect(resourcesModel, SIGNAL(allInitialized()), SLOT(populateViews()));
-}
-
-void MainWindow::aptFetchingChanged()
-{
- if(m_appBackend && !m_appBackend->isFetching())
- showLauncherMessage();
-}
-
-void MainWindow::loadSplitterSizes()
-{
- QList<int> sizes = MuonInstallerSettings::self()->splitterSizes();
-
- if (sizes.isEmpty()) {
- sizes << 115 << (this->width() - 115);
- }
- m_mainWidget->setSizes(sizes);
-}
-
-void MainWindow::saveSplitterSizes()
-{
- MuonInstallerSettings::self()->setSplitterSizes(m_mainWidget->sizes());
- MuonInstallerSettings::self()->writeConfig();
-}
-
-void MainWindow::clearViews()
-{
- setCanExit(false); // APT is reloading at this point
- foreach (QWidget *widget, m_viewHash) {
- delete widget;
- }
- m_viewHash.clear();
- m_viewModel->clear();
-}
-
-QStandardItem* MainWindow::createOriginItem(const QString& originName)
-{
-// TODO: when origins are abstracted out this should go too
- QApt::Backend* backend = qobject_cast<QApt::Backend*>(m_appBackend->property("backend").value<QObject*>());
- QString originLabel = backend->originLabel(originName);
- if(originLabel.isEmpty())
- originLabel = originName;
-
- // We must spread the word of Origin. Hallowed are the Ori! ;P
- QStandardItem *viewItem = new QStandardItem;
- viewItem->setEditable(false);
- viewItem->setText(originLabel);
- viewItem->setData(originName, OriginFilterRole);
- viewItem->setData(AppView, ViewTypeRole);
-
- if (originName == "Ubuntu") {
- viewItem->setText(i18nc("@item:inlistbox", "Provided by Kubuntu"));
- viewItem->setIcon(QIcon::fromTheme("ubuntu-logo"));
- }
-
- if (originName == "Debian") {
- viewItem->setText(i18nc("@item:inlistbox", "Provided by Debian"));
- viewItem->setIcon(QIcon::fromTheme("emblem-debian"));
- }
-
- if (originName == "Canonical") {
- viewItem->setText(i18nc("@item:inlistbox The name of the repository provided by Canonical, Ltd. ",
- "Canonical Partners"));
- viewItem->setIcon(QIcon::fromTheme("partner"));
- }
-
- if (originName.startsWith(QLatin1String("LP-PPA"))) {
- viewItem->setIcon(QIcon::fromTheme("user-identity"));
-
- if (originName == QLatin1String("LP-PPA-app-review-board")) {
- viewItem->setText(i18nc("@item:inlistbox An independent software source",
- "Independent"));
- viewItem->setIcon(QIcon::fromTheme("system-users"));
- } else
- viewItem->setIcon(QIcon::fromTheme("user-identity"));
- }
- return viewItem;
-}
-
-bool repositoryNameLessThan(const QString& a, const QString& b)
-{
- static QStringList prioritary(QStringList() << "Debian" << "Ubuntu" << "Canonical" << "LP-PPA-app-review-board");
- int idxA = prioritary.indexOf(a), idxB = prioritary.indexOf(b);
- if(idxA == idxB)
- return a<b;
- else if((idxB == -1) ^ (idxA == -1))
- return idxB == -1;
- else
- return idxA<idxB;
-}
-
-QPair<QStringList, QStringList> fetchOrigins()
-{
- QSet<QString> originSet, instOriginSet;
-
- ResourcesModel *resourcesModel = ResourcesModel::global();
- for(int i=0; i<resourcesModel->rowCount(); i++) {
- AbstractResource* app = resourcesModel->resourceAt(i);
- if (app->backend()->isFetching())
- continue;
- if (app->isInstalled())
- instOriginSet << app->origin();
- else
- originSet << app->origin();
- }
-
- originSet.remove(QString());
- instOriginSet.remove(QString());
- originSet += instOriginSet;
-
- QStringList originList=originSet.toList(), instOriginList=instOriginSet.toList();
- qSort(originList.begin(), originList.end(), repositoryNameLessThan);
- qSort(instOriginList.begin(), instOriginList.end(), repositoryNameLessThan);
- return qMakePair(originList, instOriginList);
-}
-
-void MainWindow::populateViews()
-{
- m_viewModel->clear();
- QStandardItem *availableItem = new QStandardItem;
- availableItem->setEditable(false);
- availableItem->setIcon(QIcon::fromTheme("applications-other").pixmap(32,32));
- availableItem->setText(i18nc("@item:inlistbox Parent item for available software", "Get Software"));
- availableItem->setData(CatView, ViewTypeRole);
-
- QStandardItem *installedItem = new QStandardItem;
- installedItem->setEditable(false);
- installedItem->setIcon(QIcon::fromTheme("computer"));
- installedItem->setText(i18nc("@item:inlistbox Parent item for installed software", "Installed Software"));
- installedItem->setData(AppView, ViewTypeRole);
- installedItem->setData(AbstractResource::State::Installed, StateFilterRole);
-
- QPair< QStringList, QStringList > origins = fetchOrigins();
- QStringList originNames = origins.first;
- foreach(const QString &originName, originNames) {
- availableItem->appendRow(createOriginItem(originName));
- }
-
- QStringList instOriginNames = origins.second;
- foreach(const QString & originName, instOriginNames) {
- QStandardItem* viewItem = createOriginItem(originName);
-
- viewItem->setData(AbstractResource::State::Installed, StateFilterRole);
- installedItem->appendRow(viewItem);
- }
-
- QStandardItem *historyItem = new QStandardItem;
- historyItem->setEditable(false);
- historyItem->setIcon(QIcon::fromTheme("view-history").pixmap(32,32));
- historyItem->setText(i18nc("@item:inlistbox Item for showing the history view", "History"));
- historyItem->setData(History, ViewTypeRole);
-
- m_viewModel->appendRow(availableItem);
- m_viewModel->appendRow(installedItem);
- m_viewModel->appendRow(historyItem);
- selectFirstRow(m_viewSwitcher);
-
- emit viewsPopulated();
-}
-
-void MainWindow::changeView(const QModelIndex &index)
-{
- QWidget *view = m_viewHash.value(index);
-
- // Create new widget if not already created
- if (!view) {
- switch (index.data(ViewTypeRole).toInt()) {
- case AppView: {
- QString originFilter = index.data(OriginFilterRole).toString();
- AbstractResource::State stateFilter = (AbstractResource::State)index.data(StateFilterRole).toInt();
-
- view = new ResourceListView(this, index);
- ResourceListView *appView = static_cast<ResourceListView *>(view);
- appView->setStateFilter(stateFilter);
- appView->setOriginFilter(originFilter);
- appView->setCanShowTechnical(true);
-
- if (originFilter != QLatin1String("Ubuntu") && originFilter != QLatin1String("Debian"))
- appView->setShouldShowTechnical(true);
- }
- break;
- case CatView:
- view = new AvailableView(this);
- break;
- case History:
- view = new HistoryView(this);
- break;
- case Progress:
- view = new ProgressView(this);
- case InvalidView:
- default:
- break;
- }
-
- m_viewStack->addWidget(view);
- }
-
- m_viewStack->addWidget(view);
- m_viewStack->setCurrentWidget(view);
- m_viewStack->removeWidget(m_busyWidget);
-
- delete m_busyWidget;
- m_busyWidget = nullptr;
-
- m_viewHash[index] = view;
-}
-
-void MainWindow::selectFirstRow(const QAbstractItemView *itemView)
-{
- QModelIndex firstRow = itemView->model()->index(0, 0);
- itemView->selectionModel()->select(firstRow, QItemSelectionModel::Select);
- changeView(firstRow);
-}
-
-void MainWindow::sourcesEditorFinished()
-{
- clearViews();
- populateViews();
- find(effectiveWinId())->setEnabled(true);
-}
-
-void MainWindow::showLauncherMessage()
-{
- clearMessageActions();
-
- if (m_launches->rowCount()==1) {
- QModelIndex index = m_launches->index(0, 0);
- QString name = index.data().toString();
- m_launcherMessage->setText(i18nc("@info", "%1 was successfully installed.", name));
-
- QIcon launchIcon = index.data(Qt::DecorationRole).value<QIcon>();
- QAction *launchAction = new QAction(launchIcon, i18nc("@action", "Start"), this);
- connect(launchAction, SIGNAL(activated()), this, SLOT(launchSingleApp()));
-
- m_launcherMessage->addAction(launchAction);
- m_launcherMessage->animatedShow();
- } else if (m_launches->rowCount() > 1) {
- m_launcherMessage->setText(i18nc("@info", "Applications successfully installed."));
- QAction *launchAction = new QAction(i18nc("@action", "Run New Applications..."), this);
- connect(launchAction, SIGNAL(activated()), this, SLOT(showAppLauncher()));
- m_launcherMessage->addAction(launchAction);
- m_launcherMessage->animatedShow();
- }
-}
-
-void MainWindow::launchSingleApp()
-{
- m_launches->invokeApplication(0);
- m_launcherMessage->animatedHide();
- m_launcherMessage->removeAction(m_launcherMessage->actions().first());
-}
-
-void MainWindow::showAppLauncher()
-{
- if (!m_appLauncher && !m_launches->rowCount()==0) {
- m_appLauncher = new ApplicationLauncher(m_launches);
- connect(m_appLauncher, SIGNAL(destroyed(QObject*)),
- this, SLOT(onAppLauncherClosed()));
- connect(m_appLauncher, SIGNAL(finished(int)),
- this, SLOT(onAppLauncherClosed()));
- m_appLauncher->setWindowTitle(i18nc("@title:window", "Installation Complete"));
- m_appLauncher->show();
- }
- m_launcherMessage->animatedHide();
-}
-
-void MainWindow::onAppLauncherClosed()
-{
- m_appLauncher = 0;
-}
-
-void MainWindow::clearMessageActions()
-{
- foreach (QAction *action, m_launcherMessage->actions()) {
- m_launcherMessage->removeAction(action);
- }
-}
-
-void MainWindow::addProgressItem()
-{
- QStandardItem *parentItem = m_viewModel->invisibleRootItem();
-
- if (m_progressItem)
- return;
-
- m_progressItem = new QStandardItem;
- m_progressItem->setEditable(false);
- m_progressItem->setIcon(QIcon::fromTheme("download").pixmap(32,32));
- m_progressItem->setText(i18nc("@item:inlistbox Item for showing the progress view", "In Progress"));
- m_progressItem->setData(Progress, ViewTypeRole);
- parentItem->appendRow(m_progressItem);
-
- m_viewHash[m_progressItem->index()] = 0;
-}
-
-void MainWindow::removeProgressItem()
-{
- if (!m_progressItem)
- return;
-
- QObject *progressView = m_viewHash.take(m_progressItem->index());
- if (progressView)
- progressView->deleteLater();
-
- m_viewModel->removeRow(m_progressItem->row());
- m_progressItem = nullptr;
-}
-
-void MainWindow::openApplication(const QString &app)
-{
- setEnabled(false);
- m_appToBeOpened = app;
- triggerOpenApplication();
- if(!m_appToBeOpened.isEmpty())
- connect(this, SIGNAL(viewsPopulated()), SLOT(triggerOpenApplication()));
-}
-
-void MainWindow::triggerOpenApplication()
-{
- if (!ResourcesModel::global())
- return;
-
- AbstractResource* app = ResourcesModel::global()->resourceByPackageName(m_appToBeOpened);
- if(app) {
- AvailableView *view = qobject_cast<AvailableView *>(m_viewStack->currentWidget());
- view->setResource(app);
-
- m_appToBeOpened.clear();
- disconnect(this, SIGNAL(viewsPopulated()), this, SLOT(triggerOpenApplication()));
- setEnabled(true);
- }
-}
diff --git a/installer/MainWindow.h b/installer/MainWindow.h
deleted file mode 100644
index 687c8e3..0000000
--- a/installer/MainWindow.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-// KDE includes
-#include <KService>
-
-// Own includes
-#include "../libmuon/MuonMainWindow.h"
-
-class AbstractResourcesBackend;
-class LaunchListModel;
-class QAbstractItemView;
-class QModelIndex;
-class QSplitter;
-class QStackedWidget;
-class QStandardItem;
-class QStandardItemModel;
-class QTreeView;
-
-class KMessageWidget;
-class KService;
-class KVBox;
-
-class ApplicationBackend;
-class ApplicationLauncher;
-class ProgressView;
-class ViewSwitcher;
-
-class MainWindow : public MuonMainWindow
-{
- Q_OBJECT
-public:
- MainWindow();
- ~MainWindow();
-
- void openApplication(const QString &app);
-
-private:
- QStandardItem* createOriginItem(const QString& originName);
-
- AbstractResourcesBackend *m_appBackend;
- QString m_appToBeOpened;
- QSplitter *m_mainWidget;
- QStackedWidget *m_viewStack;
- QWidget *m_busyWidget;
- ViewSwitcher *m_viewSwitcher;
- QStandardItemModel *m_viewModel;
- QHash<QModelIndex, QWidget *> m_viewHash;
- QAction *m_loadSelectionsAction;
- QAction *m_saveSelectionsAction;
- LaunchListModel *m_launches;
- KMessageWidget *m_launcherMessage;
- ApplicationLauncher *m_appLauncher;
- ProgressView *m_progressView;
- QStandardItem *m_progressItem;
-
-private Q_SLOTS:
- void initGUI();
- void initObject();
- void loadSplitterSizes();
- void saveSplitterSizes();
- void clearViews();
- void populateViews();
- void changeView(const QModelIndex &index);
- void selectFirstRow(const QAbstractItemView *itemView);
- void sourcesEditorFinished();
- void showLauncherMessage();
- void launchSingleApp();
- void showAppLauncher();
- void onAppLauncherClosed();
- void clearMessageActions();
- void addProgressItem();
- void removeProgressItem();
- void triggerOpenApplication();
- void aptFetchingChanged();
-
-signals:
- void viewsPopulated();
-};
-
-#endif
diff --git a/installer/ProgressView.cpp b/installer/ProgressView.cpp
deleted file mode 100644
index 85681cb..0000000
--- a/installer/ProgressView.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright © 2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ProgressView.h"
-
-#include <QtWidgets/QLabel>
-#include <QListView>
-
-#include <KLocalizedString>
-
-#include <resources/ResourcesModel.h>
-#include <resources/ResourcesProxyModel.h>
-
-#include "ResourceView/ResourceDelegate.h"
-
-ProgressView::ProgressView(QWidget *parent)
- : KVBox(parent)
-{
- QLabel *headerLabel = new QLabel(this);
- headerLabel->setText(i18nc("@info", "<title>In Progress</title>"));
- headerLabel->setAlignment(Qt::AlignLeft);
-
- ResourcesModel *model = ResourcesModel::global();
- ResourcesProxyModel *proxyModel = new ResourcesProxyModel(this);
- proxyModel->setFilterActive(true);
- proxyModel->setSourceModel(model);
-
- QListView *listView = new QListView(this);
- listView->setAlternatingRowColors(true);
-
- ResourceDelegate *delegate = new ResourceDelegate(listView);
- delegate->setShowInfoButton(false);
- connect(proxyModel, SIGNAL(invalidated()), delegate, SLOT(invalidate()));
- listView->setItemDelegate(delegate);
- listView->setModel(proxyModel);
-}
diff --git a/installer/ProgressView.h b/installer/ProgressView.h
deleted file mode 100644
index 9c37dfa..0000000
--- a/installer/ProgressView.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/***************************************************************************
- * Copyright © 2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef PROGRESSVIEW_H
-#define PROGRESSVIEW_H
-
-#include <KVBox>
-
-class ProgressView : public KVBox
-{
- Q_OBJECT
-public:
- explicit ProgressView(QWidget *parent);
-};
-
-#endif // PROGRESSVIEW_H
diff --git a/installer/ResourceDetailsView/AddonsWidget.cpp b/installer/ResourceDetailsView/AddonsWidget.cpp
deleted file mode 100644
index 087df5d..0000000
--- a/installer/ResourceDetailsView/AddonsWidget.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/***************************************************************************
- * Copyright © 2011,2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "AddonsWidget.h"
-
-// Qt includes
-#include <QtCore/QStringBuilder>
-#include <QHBoxLayout>
-#include <QtWidgets/QLabel>
-#include <QListView>
-#include <QtWidgets/QPushButton>
-#include <QStandardItemModel>
-#include <QtWidgets/QToolButton>
-
-// KDE includes
-#include <KLocalizedString>
-
-// Libmuon includes
-#include <resources/AbstractResourcesBackend.h>
-#include <resources/AbstractResource.h>
-#include <resources/ResourcesModel.h>
-
-//FIXME: Port to the ApplicationAddonsModel, use QAbstractItemView::setIndexWidget
-// so we can still use our widget as a "delegate"
-
-AddonsWidget::AddonsWidget(QWidget *parent)
- : KVBox(parent)
- , m_resource(nullptr)
-{
- QWidget *headerWidget = new QWidget(this);
- QHBoxLayout *headerLayout = new QHBoxLayout(headerWidget);
- headerLayout->setMargin(0);
- headerWidget->setLayout(headerLayout);
-
- m_expandButton = new QToolButton(headerWidget);
- m_expandButton->setAutoRaise(true);
- m_expandButton->setArrowType(Qt::DownArrow);
- connect(m_expandButton, SIGNAL(clicked()), this, SLOT(expandButtonClicked()));
-
- QLabel *titleLabel = new QLabel(headerWidget);
- titleLabel->setText(QLatin1Literal("<h3>") %
- i18nc("@title", "Addons") % QLatin1Literal("</h3>"));
-
- QWidget *headerSpacer = new QWidget(headerWidget);
- headerSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- headerLayout->addWidget(m_expandButton);
- headerLayout->addWidget(titleLabel);
- headerLayout->addWidget(headerSpacer);
-
- m_addonsWidget = new QWidget(this);
- QVBoxLayout *addonsLayout = new QVBoxLayout(m_addonsWidget);
- addonsLayout->setMargin(0);
- m_addonsWidget->setLayout(addonsLayout);
-
- m_addonsView = new QListView(m_addonsWidget);
- m_addonsView->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
- m_addonsModel = new QStandardItemModel(this);
- m_addonsView->setModel(m_addonsModel);
-
- QWidget *addonsButtonBox = new QWidget(m_addonsWidget);
- QHBoxLayout *addonButtonsLayout = new QHBoxLayout(addonsButtonBox);
-
- QWidget *addonsButtonSpacer = new QWidget(m_addonsWidget);
- addonsButtonSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- m_addonsRevertButton = new QPushButton(addonsButtonBox);
- m_addonsRevertButton->setIcon(QIcon::fromTheme("edit-undo"));
- m_addonsRevertButton->setText(i18nc("@action:button", "Revert"));
- connect(m_addonsRevertButton, SIGNAL(clicked()),
- this, SLOT(populateModel()));
-
- m_addonsApplyButton = new QPushButton(addonsButtonBox);
- m_addonsApplyButton->setIcon(QIcon::fromTheme("dialog-ok-apply"));
- m_addonsApplyButton->setText(i18nc("@action:button", "Apply"));
- m_addonsApplyButton->setToolTip(i18nc("@info:tooltip", "Apply changes to addons"));
- connect(m_addonsApplyButton, SIGNAL(clicked()),
- this, SLOT(emitApplyButtonClicked()));
-
- addonButtonsLayout->addWidget(addonsButtonSpacer);
- addonButtonsLayout->addWidget(m_addonsRevertButton);
- addonButtonsLayout->addWidget(m_addonsApplyButton);
-
- addonsLayout->addWidget(m_addonsView);
- addonsLayout->addWidget(addonsButtonBox);
-
- connect(m_addonsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
- this, SLOT(addonStateChanged(QModelIndex,QModelIndex)));
-}
-
-void AddonsWidget::fetchingChanged()
-{
- if(m_resource && m_resource->backend()->isFetching()) {
- m_resource = nullptr;
- m_changedAddons.clear();
- m_availableAddons.clear();
- m_addonsModel->clear();
- } else {
- populateModel();
- }
-}
-
-void AddonsWidget::setResource(AbstractResource *resource)
-{
- m_resource = resource;
-
- // Clear addons when a reload starts
- connect(m_resource->backend(), SIGNAL(fetchingChanged()), this, SLOT(fetchingChanged()));
-
- populateModel();
-}
-
-void AddonsWidget::repaintViewport()
-{
- m_addonsView->viewport()->update();
- m_addonsView->viewport()->repaint();
-}
-
-void AddonsWidget::populateModel()
-{
- m_addonsModel->clear();
-
- if (!m_resource) {
- return;
- }
-
- m_availableAddons = m_resource->addonsInformation();
-
- for (const PackageState &addon : m_availableAddons) {
- // Check if we have an application for the addon
- AbstractResource *addonResource = 0;
-
- for (AbstractResource *resource : m_resource->backend()->allResources()) {
- if (!resource)
- continue;
-
- if (resource->packageName() == addon.name()) {
- addonResource = resource;
- break;
- }
- }
-
- QStandardItem *addonItem = new QStandardItem;
- addonItem->setData(addon.name());
- QString resourceName = QLatin1String(" (") % addon.name() % ')';
- if (addonResource) {
- addonItem->setText(addonResource->name() % resourceName);
- addonItem->setIcon(QIcon::fromTheme(addonResource->icon()));
- } else {
- addonItem->setText(addon.description() % resourceName);
- addonItem->setIcon(QIcon::fromTheme("applications-other"));
- }
-
- addonItem->setEditable(false);
- addonItem->setCheckable(true);
-
- if (addon.isInstalled()) {
- addonItem->setCheckState(Qt::Checked);
- } else {
- addonItem->setCheckState(Qt::Unchecked);
- }
-
- m_addonsModel->appendRow(addonItem);
- }
-
- m_addonsRevertButton->setEnabled(false);
- m_addonsApplyButton->setEnabled(false);
-}
-
-void AddonsWidget::expandButtonClicked()
-{
- if (m_addonsWidget->isHidden()) {
- m_expandButton->setArrowType(Qt::DownArrow);
- m_addonsWidget->show();
- } else {
- m_addonsWidget->hide();
- m_expandButton->setArrowType(Qt::RightArrow);
- }
-}
-
-void AddonsWidget::addonStateChanged(const QModelIndex &left, const QModelIndex &right)
-{
- Q_UNUSED(right);
- QStandardItem *item = m_addonsModel->itemFromIndex(left);
- PackageState *addon = nullptr;
-
- QString addonName = item->data().toString();
- for (PackageState state : m_availableAddons) {
- if (state.name() == addonName) {
- addon = &state;
- }
- }
-
- if (!addon)
- return;
-
- if (addon->isInstalled()) {
- switch (item->checkState()) {
- case Qt::Checked:
- m_changedAddons.remove(addonName);
- break;
- case Qt::Unchecked:
- m_changedAddons[addonName] = false;
- break;
- default:
- break;
- }
- } else {
- switch (item->checkState()) {
- case Qt::Checked:
- m_changedAddons[addonName] = true;
- break;
- case Qt::Unchecked:
- m_changedAddons.remove(addonName);
- break;
- default:
- break;
- }
- }
-
- m_addonsRevertButton->setEnabled(!m_changedAddons.isEmpty());
- m_addonsApplyButton->setEnabled(!m_changedAddons.isEmpty());
-}
-
-void AddonsWidget::emitApplyButtonClicked()
-{
-// ResourcesModel *resourcesModel = ResourcesModel::global();
- //resourcesModel->installApplication(m_resource, m_changedAddons);
-
- emit applyButtonClicked();
-}
diff --git a/installer/ResourceDetailsView/AddonsWidget.h b/installer/ResourceDetailsView/AddonsWidget.h
deleted file mode 100644
index ada5e8b..0000000
--- a/installer/ResourceDetailsView/AddonsWidget.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- * Copyright © 2011,2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef ADDONSWIDGET_H
-#define ADDONSWIDGET_H
-
-#include <QtCore/QHash>
-
-#include <KVBox>
-
-#include <resources/PackageState.h>
-
-class QListView;
-class QModelIndex;
-class QPushButton;
-class QStandardItemModel;
-class QToolButton;
-
-class AbstractResource;
-
-class AddonsWidget : public KVBox
-{
- Q_OBJECT
-public:
- AddonsWidget(QWidget *parent);
-
- void setResource(AbstractResource *resource);
-
-private:
- AbstractResource *m_resource;
- QStandardItemModel *m_addonsModel;
- QList<PackageState> m_availableAddons;
- QHash<QString, bool> m_changedAddons;
-
- QToolButton *m_expandButton;
- QWidget *m_addonsWidget;
- QListView *m_addonsView;
- QPushButton *m_addonsRevertButton;
- QPushButton *m_addonsApplyButton;
-
-public Q_SLOTS:
- void repaintViewport();
-
-private Q_SLOTS:
- void fetchingChanged();
- void populateModel();
- void expandButtonClicked();
- void addonStateChanged(const QModelIndex &left, const QModelIndex &right);
- void emitApplyButtonClicked();
-
-Q_SIGNALS:
- void applyButtonClicked();
-};
-
-#endif
diff --git a/installer/ResourceDetailsView/ResourceDetailsView.cpp b/installer/ResourceDetailsView/ResourceDetailsView.cpp
deleted file mode 100644
index 72b30b5..0000000
--- a/installer/ResourceDetailsView/ResourceDetailsView.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ResourceDetailsView.h"
-
-// Qt includes
-#include <QIcon>
-#include <QtWidgets/QVBoxLayout>
-
-// Libmuon includes
-#include <resources/AbstractResource.h>
-
-// Own includes
-#include "ResourceDetailsWidget.h"
-#include "../BreadcrumbWidget/BreadcrumbItem.h"
-
-ResourceDetailsView::ResourceDetailsView(QWidget *parent)
- : AbstractViewBase(parent)
-{
- m_detailsWidget = new ResourceDetailsWidget(this);
-
- m_layout->addWidget(m_detailsWidget);
-
- m_crumb->setAssociatedView(this);
-}
-
-void ResourceDetailsView::setResource(AbstractResource *resource)
-{
- m_detailsWidget->setResource(resource);
-
- m_crumb->setText(resource->name());
- m_crumb->setIcon(QIcon::fromTheme(resource->icon()));
-}
diff --git a/installer/ResourceDetailsView/ResourceDetailsView.h b/installer/ResourceDetailsView/ResourceDetailsView.h
deleted file mode 100644
index bedb453..0000000
--- a/installer/ResourceDetailsView/ResourceDetailsView.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef RESOURCEDETAILSVIEW_H
-#define RESOURCEDETAILSVIEW_H
-
-#include "../AbstractViewBase.h"
-
-class AbstractResource;
-class ResourceDetailsWidget;
-
-class ResourceDetailsView : public AbstractViewBase
-{
- Q_OBJECT
-public:
- ResourceDetailsView(QWidget *parent);
-
- void setResource(AbstractResource *resource);
-
-private:
- ResourceDetailsWidget *m_detailsWidget;
-};
-
-#endif
diff --git a/installer/ResourceDetailsView/ResourceDetailsWidget.cpp b/installer/ResourceDetailsView/ResourceDetailsWidget.cpp
deleted file mode 100644
index 3bc0dab..0000000
--- a/installer/ResourceDetailsView/ResourceDetailsWidget.cpp
+++ /dev/null
@@ -1,546 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * Copyright © 2012 Aleix Pol Gonzalez <aleixpol at blue-systems.com> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ResourceDetailsWidget.h"
-
-// Qt includes
-#include <QApplication>
-#include <QPropertyAnimation>
-#include <QtCore/QStringBuilder>
-#include <QtDeclarative/QDeclarativeView>
-#include <QtDeclarative/QDeclarativeContext>
-#include <QtDeclarative/QDeclarativeComponent>
-#include <QtDeclarative/QDeclarativeError>
-#include <QHBoxLayout>
-#include <QGraphicsDropShadowEffect>
-#include <QGraphicsBlurEffect>
-#include <QGraphicsObject>
-#include <QtWidgets/QLabel>
-#include <QtWidgets/QProgressBar>
-#include <QtWidgets/QPushButton>
-#include <QtWidgets/QVBoxLayout>
-
-// KDE includes
-#include <KDialog>
-#include <KGlobal>
-#include <KHBox>
-#include <KIO/Job>
-#include <KJob>
-#include <KLocalizedString>
-#include <KPixmapSequence>
-#include <kpixmapsequenceoverlaypainter.h>
-#include <KService>
-#include <KStandardDirs>
-#include <KStandardGuiItem>
-#include <KTemporaryFile>
-#include <KToolInvocation>
-#include <KDebug>
-#include <Nepomuk/KRatingWidget>
-
-// Libmuon includes
-#include <resources/AbstractResource.h>
-#include <resources/AbstractResourcesBackend.h>
-// #include <MuonStrings.h>
-#include <ReviewsBackend/Rating.h>
-#include <ReviewsBackend/Review.h>
-#include <ReviewsBackend/AbstractReviewsBackend.h>
-
-// std includes
-#include <math.h>
-
-// Own includes
-#include "AddonsWidget.h"
-#include "ClickableLabel.h"
-#include "qml/src/mousecursor.h"
-#include "ReviewsWidget/ReviewsWidget.h"
-#include "ScreenShotOverlay.h"
-#include "Transaction/TransactionListener.h"
-
-#define BLUR_RADIUS 15
-
-enum class ScreenshotType : quint8
-{
- /// An unknown/invalid type
- UnknownType = 0,
- /// A smaller thumbnail of the screenshot
- Thumbnail = 1,
- /// The full screenshot
- Screenshot = 2
-};
-
-ResourceDetailsWidget::ResourceDetailsWidget(QWidget *parent)
- : QScrollArea(parent)
- , m_screenshotFile(0)
-{
- qmlRegisterType<QGraphicsDropShadowEffect>("Effects",1,0,"DropShadow");
- qmlRegisterType<MouseCursor>("MuonMobile", 1, 0, "MouseCursor");
-
- setWidgetResizable(true);
- viewport()->setAutoFillBackground(false);
-
- QWidget *widget = new QWidget(this);
- QVBoxLayout *layout = new QVBoxLayout(widget);
- widget->setLayout(layout);
- widget->setBackgroundRole(QPalette::Base);
-
- // Header
- QWidget *headerWidget = new QWidget(widget);
- QHBoxLayout *headerLayout = new QHBoxLayout(headerWidget);
- headerWidget->setLayout(headerLayout);
-
- m_iconLabel = new QLabel(headerWidget);
-
- QWidget *nameDescWidget = new QWidget(headerWidget);
- QVBoxLayout *nameDescLayout = new QVBoxLayout(nameDescWidget);
- m_nameLabel = new QLabel(nameDescWidget);
- m_nameLabel->setAlignment(Qt::AlignLeft);
- m_shortDescLabel = new QLabel(nameDescWidget);
-
- nameDescLayout->addWidget(m_nameLabel);
- nameDescLayout->addWidget(m_shortDescLabel);
-
- QWidget *headerSpacer = new QWidget(headerWidget);
- headerSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QWidget *ratingUseWidget = new QWidget(headerWidget);
- QVBoxLayout *ratingUseLayout = new QVBoxLayout(ratingUseWidget);
-
- m_ratingWidget = new KRatingWidget(ratingUseWidget);
- m_ratingWidget->setAttribute(Qt::WA_TransparentForMouseEvents);
- m_ratingWidget->setPixmapSize(32);
-
- m_ratingCountLabel = new QLabel(ratingUseWidget);
- m_ratingCountLabel->setAlignment(Qt::AlignHCenter);
-
- ratingUseLayout->addWidget(m_ratingWidget);
- ratingUseLayout->addWidget(m_ratingCountLabel);
-
- headerLayout->addWidget(m_iconLabel);
- headerLayout->addWidget(nameDescWidget);
- headerLayout->addWidget(headerSpacer);
- headerLayout->addWidget(ratingUseWidget);
-
- // Menu path label
- m_menuPathWidget = new QWidget(this);
- QHBoxLayout *menuPathLayout = new QHBoxLayout(m_menuPathWidget);
- m_menuPathWidget->setLayout(menuPathLayout);
-
- QLabel *menuLabel = new QLabel(m_menuPathWidget);
- menuLabel->setText(i18nc("@info", "Find in the menu:"));
- m_menuPathLabel = new QLabel(m_menuPathWidget);
-
- QWidget *menuPathSpacer = new QWidget(this);
- menuPathSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- menuPathLayout->addWidget(menuLabel);
- menuPathLayout->addWidget(m_menuPathLabel);
- menuPathLayout->addWidget(menuPathSpacer);
-
- // Install/remove/update button
- QFrame *actionButtonWidget = new QFrame(this);
- QHBoxLayout *actionButtonLayout = new QHBoxLayout(actionButtonWidget);
- actionButtonWidget->setLayout(actionButtonLayout);
- actionButtonWidget->setFrameShadow(QFrame::Sunken);
- actionButtonWidget->setFrameShape(QFrame::StyledPanel);
-
- m_statusLabel = new QLabel(actionButtonWidget);
-
- QWidget *actionButtonSpacer = new QWidget(actionButtonWidget);
- actionButtonSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- m_actionButton = new QPushButton(actionButtonWidget);
- connect(m_actionButton, SIGNAL(clicked()), this, SLOT(actionButtonClicked()));
-
- m_progressBar = new QProgressBar(actionButtonWidget);
- m_progressBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
- m_progressBar->hide();
-
- m_cancelButton = new QPushButton(actionButtonWidget);
- KGuiItem cancelButton = KStandardGuiItem::cancel();
- m_cancelButton->setIcon(cancelButton.icon());
- m_cancelButton->setToolTip(cancelButton.toolTip());
- m_cancelButton->hide();
- connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));
-
- actionButtonLayout->addWidget(m_statusLabel);
- actionButtonLayout->addWidget(actionButtonSpacer);
- actionButtonLayout->addWidget(m_actionButton);
- actionButtonLayout->addWidget(m_progressBar);
- actionButtonLayout->addWidget(m_cancelButton);
-
- // Long description and Screenshot
- QWidget *body = new QWidget(widget);
- QHBoxLayout *bodyLayout = new QHBoxLayout(body);
-
- KVBox *bodyLeft = new KVBox(body);
- bodyLeft->setSpacing(2*KDialog::spacingHint());
-
- m_longDescLabel = new QLabel(bodyLeft);
- m_longDescLabel->setWordWrap(true);
- m_longDescLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
- m_longDescLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- m_websiteLabel = new QLabel(bodyLeft);
- m_websiteLabel->setAlignment(Qt::AlignLeft);
- m_websiteLabel->setOpenExternalLinks(true);
-
- m_screenshotView = new QDeclarativeView(this);
- m_screenshotView->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
- m_screenshotView->setMinimumSize(170, 130);
- m_screenshotView->rootContext()->setContextProperty("view", m_screenshotView);
- m_screenshotView->setSource(KStandardDirs::locate("data", QLatin1String("muon-installer/ThumbnailView.qml")));
- QObject *item = m_screenshotView->rootObject();
- connect(item, SIGNAL(thumbnailClicked()), this, SLOT(screenshotLabelClicked()));
-
- m_throbberWidget = new KPixmapSequenceOverlayPainter(m_screenshotView->viewport());
- m_throbberWidget->setSequence(KPixmapSequence("process-working", 22));
- m_throbberWidget->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
- m_throbberWidget->setWidget(m_screenshotView->viewport());
- m_throbberWidget->start();
- connect(item, SIGNAL(thumbnailLoaded()), m_throbberWidget, SLOT(stop()));
-
- bodyLayout->addWidget(bodyLeft);
- bodyLayout->addWidget(m_screenshotView);
- m_screenshotView->show();
-
- m_addonsWidget = new AddonsWidget(widget);
- m_addonsWidget->hide();
-
- connect(m_addonsWidget, SIGNAL(applyButtonClicked()),
- this, SLOT(addonsApplyButtonClicked()));
-
- // Technical details
- QWidget *detailsWidget = new QWidget(widget);
- QGridLayout *detailsGrid = new QGridLayout(detailsWidget);
-
- // detailsGrid, row 0
- QLabel *sizeLabel = new QLabel(detailsWidget);
- sizeLabel->setText("<b>" % i18nc("@label Label preceding the app size", "Total Size:") % "</b>");
- m_size = new QLabel(detailsWidget);
- detailsGrid->addWidget(sizeLabel, 0, 0, Qt::AlignRight);
- detailsGrid->addWidget(m_size, 0, 1, Qt::AlignLeft);
-
- // detailsGrid, row 1
- QLabel *versionLabel = new QLabel(detailsWidget);
- versionLabel->setText("<b>" % i18nc("@label/rich Label preceding the app version", "Version:") % "</b>");
- m_version = new QLabel(detailsWidget);
- detailsGrid->addWidget(versionLabel, 1, 0, Qt::AlignRight);
- detailsGrid->addWidget(m_version, 1, 1, Qt::AlignLeft);
-
- // detailsGrid, row 2
- QLabel *licenseLabel = new QLabel(detailsWidget);
- licenseLabel->setText("<b>" % i18nc("@label Label preceding the app license", "License:") % "</b>");
- m_license = new QLabel(detailsWidget);
- detailsGrid->addWidget(licenseLabel, 2, 0, Qt::AlignRight);
- detailsGrid->addWidget(m_license, 2, 1, Qt::AlignLeft);
-
- // detailsGrid, row 3
- QLabel *supportLabel = new QLabel(detailsWidget);
- supportLabel->setText("<b>" % i18nc("@label Label preceding the app support", "Support:") % "</b>");
- m_support = new QLabel(detailsWidget);
- detailsGrid->addWidget(supportLabel, 3, 0, Qt::AlignRight);
- detailsGrid->addWidget(m_support, 3, 1, Qt::AlignLeft);
-
- detailsGrid->setColumnStretch(1,1);
-
- m_reviewsWidget = new ReviewsWidget(widget);
- connect(m_reviewsWidget, SIGNAL(fetchPage(int)), this, SLOT(fetchReviews(int)));
-
- QWidget *verticalSpacer = new QWidget(this);
- verticalSpacer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
-
- // Blur effect for later
- m_blurEffect = new QGraphicsBlurEffect(widget);
- m_blurEffect->setBlurHints(QGraphicsBlurEffect::PerformanceHint);
- m_blurEffect->setBlurRadius(0);
- widget->setGraphicsEffect(m_blurEffect);
-
- m_fadeBlur = new QPropertyAnimation(m_blurEffect, "blurRadius", this);
- m_fadeBlur->setDuration(200);
- m_fadeBlur->setStartValue(qreal(0));
- m_fadeBlur->setEndValue(qreal(5));
-
- // Workarounds for QScrollAreas not repainting whilst under the effects of a QGraphicsEffect
- connect(m_fadeBlur, SIGNAL(finished()), m_addonsWidget, SLOT(repaintViewport()));
- connect(m_fadeBlur, SIGNAL(finished()), m_screenshotView->viewport(), SLOT(repaint()));
-
- layout->addWidget(headerWidget);
- layout->addWidget(m_menuPathWidget);
- layout->addWidget(actionButtonWidget);
- layout->addWidget(body);
- layout->addWidget(m_addonsWidget);
- layout->addWidget(detailsWidget);
- layout->addWidget(m_reviewsWidget);
- layout->addWidget(verticalSpacer);
-
- m_listener = new TransactionListener(this);
- // FIXME
-// connect(m_listener, SIGNAL(progressChanged()), SLOT(progressChanged()));
- connect(m_listener, SIGNAL(statusTextChanged()), SLOT(progressCommentChanged()));
- connect(m_listener, SIGNAL(runningChanged()), SLOT(applicationRunningChanged()));
- connect(m_listener, SIGNAL(cancellableChanged()), SLOT(cancellableChanged()));
-
- setWidget(widget);
-}
-
-ResourceDetailsWidget::~ResourceDetailsWidget()
-{
- delete m_screenshotFile;
-}
-
-void ResourceDetailsWidget::setResource(AbstractResource *resource)
-{
- m_resource = resource;
- m_listener->setResource(m_resource);
-
- AbstractResource *app = qobject_cast<AbstractResource*>(resource);
-
- // FIXME: Always keep label size at 48x48, and render the largest size
- // we can up to that point. Otherwise some icons will be blurry
- m_iconLabel->setPixmap(QIcon::fromTheme(resource->icon()).pixmap(48,48));
-
- m_nameLabel->setText(QLatin1Literal("<h1>") % resource->name() % QLatin1Literal("</h1>"));
- m_shortDescLabel->setText(resource->comment());
-
- AbstractReviewsBackend *reviewsBackend = resource->backend()->reviewsBackend();
- Rating *rating = reviewsBackend->ratingForApplication(resource);
- if (rating) {
- m_ratingWidget->setRating(rating->rating());
- m_ratingCountLabel->setText(i18ncp("@label The number of ratings the app has",
- "%1 rating", "%1 ratings",
- rating->ratingCount()));
- } else {
- m_ratingWidget->hide();
- m_ratingCountLabel->hide();
- }
-
- if (app) {
- QString menuPathString = app->property("menuPath").toString();
- if (!menuPathString.isEmpty()) {
- m_menuPathLabel->setText(menuPathString);
- } else {
- m_menuPathWidget->hide();
- }
- } else {
- m_menuPathWidget->hide();
- }
-
- connect(resource->backend(), SIGNAL(fetchingChanged()), SLOT(updateActionButton()));
- updateActionButton();
-
- m_longDescLabel->setText(resource->longDescription());
-
- m_addonsWidget->setResource(resource);
- m_addonsWidget->setVisible(resource->addonsInformation().count());
-
- QUrl homepageUrl = resource->homepage();
- if (!homepageUrl.isEmpty()) {
- QString websiteString = i18nc("@label visible text for an app's URL", "Website");
- m_websiteLabel->setText(QLatin1String("<a href=\"") % homepageUrl.toString() % "\">" %
- websiteString % QLatin1String("</a>"));
- m_websiteLabel->setToolTip(homepageUrl.toString());
- } else {
- m_websiteLabel->hide();
- }
-
- m_size->setText(resource->sizeDescription());
-
- if (!resource->isInstalled()) {
- m_version->setText(resource->name() % ' ' %
- resource->availableVersion());
- } else {
- m_version->setText(resource->name() % ' ' %
- resource->installedVersion());
- }
-
- m_license->setText(resource->license());
-
- // FIXME: Port to Resources
-// if (resource->isSupported()) {
-// m_support->setText(i18nc("@info Tells how long Canonical, Ltd. will support a package",
-// "Canonical provides critical updates for %1 until %2",
-// resource->name(), resource->supportedUntil()));
-// } else {
-// m_support->setText(i18nc("@info Tells how long Canonical, Ltd. will support a package",
-// "Canonical does not provide updates for %1. Some updates "
-// "may be provided by the Ubuntu community", resource->name()));
-// }
-
- // Fetch reviews
- connect(reviewsBackend, SIGNAL(reviewsReady(AbstractResource*,QList<Review*>)),
- this, SLOT(populateReviews(AbstractResource*,QList<Review*>)));
- fetchReviews(1);
-
- fetchScreenshot(ScreenshotType::Thumbnail);
-}
-
-void ResourceDetailsWidget::fetchScreenshot(ScreenshotType screenshotType)
-{
- if (m_screenshotFile) {
- m_screenshotFile->deleteLater();
- m_screenshotFile = 0;
- }
- m_screenshotFile = new KTemporaryFile;
- m_screenshotFile->setPrefix("muon");
- m_screenshotFile->setSuffix(".png");
- m_screenshotFile->open();
-
- switch (screenshotType) {
- case ScreenshotType::Thumbnail: {
- QObject *object = m_screenshotView->rootObject();
- if (object) {
- object->setProperty("source", KUrl(m_resource->thumbnailUrl()).pathOrUrl());
- }
- break;
- }
- case ScreenshotType::Screenshot: {
- KIO::FileCopyJob *getJob = KIO::file_copy(m_resource->screenshotUrl(),
- m_screenshotFile->fileName(), -1, KIO::Overwrite | KIO::HideProgressInfo);
- connect(getJob, SIGNAL(result(KJob*)),
- this, SLOT(screenshotFetched(KJob*)));
- break;
- }
- case ScreenshotType::UnknownType:
- default:
- break;
- }
-}
-
-void ResourceDetailsWidget::screenshotFetched(KJob *job)
-{
- if (job->error()) {
- return;
- }
-
- m_fadeBlur->setDirection(QAbstractAnimation::Forward);
- m_fadeBlur->start();
-
- ScreenShotOverlay *overlay = new ScreenShotOverlay(m_screenshotFile->fileName(), viewport(), this);
- connect(overlay, SIGNAL(destroyed(QObject*)), this, SLOT(overlayClosed()));
-}
-
-void ResourceDetailsWidget::overlayClosed()
-{
- QObject *item = m_screenshotView->rootObject();
- connect(item, SIGNAL(thumbnailClicked()), this, SLOT(screenshotLabelClicked()));
-
- m_fadeBlur->setDirection(QAbstractAnimation::Backward);
- m_fadeBlur->start();
-
- unsetCursor();
-}
-
-void ResourceDetailsWidget::screenshotLabelClicked()
-{
- QObject *item = m_screenshotView->rootObject();
- disconnect(item, SIGNAL(thumbnailClicked()), this, SLOT(screenshotLabelClicked()));
- fetchScreenshot(ScreenshotType::Screenshot);
-}
-
-void ResourceDetailsWidget::actionButtonClicked()
-{
- m_actionButton->hide();
- m_progressBar->show();
- m_progressBar->setValue(0);
- m_progressBar->setFormat(i18nc("@info:status Progress text when waiting", "Waiting"));
-
- AbstractResourcesBackend *backend = m_resource->backend();
- // TODO: update packages
- if (m_resource->isInstalled()) {
- backend->removeApplication(m_resource);
- } else {
- backend->installApplication(m_resource);
- }
-}
-
-void ResourceDetailsWidget::cancelButtonClicked()
-{
- AbstractResourcesBackend *backend = m_resource->backend();
- backend->cancelTransaction(m_resource);
-
- m_progressBar->hide();
- m_actionButton->show();
-}
-
-void ResourceDetailsWidget::fetchReviews(int page)
-{
- if (!m_resource)
- return;
-
- m_resource->backend()->reviewsBackend()->fetchReviews(m_resource, page);
-}
-
-void ResourceDetailsWidget::populateReviews(AbstractResource *app, const QList<Review *> &reviews)
-{
- if (app != m_resource)
- return;
-
- m_reviewsWidget->addReviews(reviews);
-}
-
-void ResourceDetailsWidget::addonsApplyButtonClicked()
-{
- m_actionButton->hide();
- m_progressBar->show();
- m_progressBar->setValue(0);
- m_progressBar->setFormat(i18nc("@info:status Progress text when waiting", "Waiting"));
-}
-
-void ResourceDetailsWidget::applicationRunningChanged()
-{
- bool running = m_listener->isActive();
- m_actionButton->setVisible(!running);
- m_progressBar->setVisible(running);
-}
-
-void ResourceDetailsWidget::cancellableChanged()
-{
- m_cancelButton->setVisible(m_listener->isCancellable());
-}
-
-void ResourceDetailsWidget::progressChanged()
-{
- // FIXME
- //m_progressBar->setValue(m_listener->progress());
-}
-
-void ResourceDetailsWidget::progressCommentChanged()
-{
- m_progressBar->setFormat(m_listener->statusText());
-}
-
-void ResourceDetailsWidget::updateActionButton()
-{
- if (!m_resource || m_resource->backend()->isFetching())
- return;
-
- m_statusLabel->setText(m_resource->status());
- if (!m_resource->isInstalled()) {
- m_actionButton->setText(i18nc("@action", "Install"));
- m_actionButton->setIcon(QIcon::fromTheme("download"));
- m_actionButton->show();
- } else {
- m_actionButton->setText(i18nc("@action", "Remove"));
- m_actionButton->setIcon(QIcon::fromTheme("edit-delete"));
- }
-
- m_addonsWidget->setResource(m_resource);
-}
diff --git a/installer/ResourceDetailsView/ResourceDetailsWidget.h b/installer/ResourceDetailsView/ResourceDetailsWidget.h
deleted file mode 100644
index ec20a0c..0000000
--- a/installer/ResourceDetailsView/ResourceDetailsWidget.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef RESOURCEDETAILSWIDGET_H
-#define RESOURCEDETAILSWIDGET_H
-
-// Qt includes
-#include <QScrollArea>
-
-// Libmuon includes
-#include <Transaction/Transaction.h>
-
-class QDeclarativeView;
-class QGraphicsBlurEffect;
-class QLabel;
-class QProgressBar;
-class QPropertyAnimation;
-class QPushButton;
-
-class KJob;
-class KPixmapSequenceOverlayPainter;
-class KRatingWidget;
-class KTemporaryFile;
-
-class AddonsWidget;
-class AbstractResource;
-class ClickableLabel;
-class TransactionListener;
-class Review;
-class ReviewsWidget;
-
-enum class ScreenshotType : quint8;
-
-// Widget for showing details about a single application
-class ResourceDetailsWidget : public QScrollArea
-{
- Q_OBJECT
-public:
- explicit ResourceDetailsWidget(QWidget *parent);
- ~ResourceDetailsWidget();
-
- void setResource(AbstractResource *resource);
-
-private:
- AbstractResource *m_resource;
- TransactionListener *m_listener;
-
- QLabel *m_iconLabel;
- QLabel *m_nameLabel;
- QLabel *m_shortDescLabel;
- KRatingWidget *m_ratingWidget;
- QLabel *m_ratingCountLabel;
- QWidget *m_menuPathWidget;
- QLabel *m_menuPathLabel;
- QLabel *m_statusLabel;
- QPushButton *m_actionButton;
- QProgressBar *m_progressBar;
- QPushButton *m_cancelButton;
- QLabel *m_longDescLabel;
- QDeclarativeView *m_screenshotView;
- QLabel *m_websiteLabel;
- AddonsWidget *m_addonsWidget;
- QLabel *m_size;
- QLabel *m_version;
- QLabel *m_license;
- QLabel *m_support;
- ReviewsWidget *m_reviewsWidget;
-
- KPixmapSequenceOverlayPainter *m_throbberWidget;
- QGraphicsBlurEffect *m_blurEffect;
- QPropertyAnimation *m_fadeBlur;
-
- KTemporaryFile *m_screenshotFile;
-
-private Q_SLOTS:
- void fetchScreenshot(ScreenshotType screenshotType);
- void screenshotFetched(KJob *job);
- void overlayClosed();
- void screenshotLabelClicked();
- void actionButtonClicked();
- void cancelButtonClicked();
- void fetchReviews(int page);
- void populateReviews(AbstractResource* app, const QList< Review* >& reviews);
- void addonsApplyButtonClicked();
- void progressCommentChanged();
- void progressChanged();
- void updateActionButton();
-
-public slots:
- void applicationRunningChanged();
- void cancellableChanged();
-};
-
-#endif
diff --git a/installer/ResourceView/ResourceDelegate.cpp b/installer/ResourceView/ResourceDelegate.cpp
deleted file mode 100644
index 0d18da4..0000000
--- a/installer/ResourceView/ResourceDelegate.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde at gmail.com>
- * Copyright (C) 2008 Daniel Nicoletti <dantti85-pk at yahoo.com.br>
- * Copyright (C) 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library/Lesser General Public License
- * version 2, or (at your option) any later version, as published by the
- * Free Software Foundation
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details
- *
- * You should have received a copy of the GNU Library/Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "ResourceDelegate.h"
-
-// Qt includes
-#include <QApplication>
-#include <QAbstractItemView>
-#include <QPainter>
-#include <QtWidgets/QPushButton>
-#include <QtWidgets/QTreeView>
-
-// KDE includes
-#include <KApplication>
-#include <KIconLoader>
-#include <KGlobal>
-#include <KLocalizedString>
-#include <KStandardDirs>
-#include <Nepomuk/KRatingPainter>
-#include <KDebug>
-
-// Libmuon includes
-#include <Transaction/TransactionModel.h>
-#include <resources/AbstractResource.h>
-#include <resources/ResourcesModel.h>
-
-// Own includes
-#include "ResourceExtender.h"
-
-#define FAV_ICON_SIZE 24
-#define EMBLEM_ICON_SIZE 8
-#define UNIVERSAL_PADDING 4
-#define MAIN_ICON_SIZE 32
-
-ResourceDelegate::ResourceDelegate(QAbstractItemView *parent)
- : KExtendableItemDelegate(parent),
- m_extender(0),
- m_showInfoButton(true)
-{
- // To get sizing.
- QPushButton button, button2;
- QIcon icon(QIcon::fromTheme("edit-delete"));
-
- button.setText(i18n("Install"));
- button.setIcon(icon);
- button2.setText(i18n("Remove"));
- button2.setIcon(icon);
- m_buttonSize = button.sizeHint();
- int width = qMax(button.sizeHint().width(), button2.sizeHint().width());
- width = qMax(width, button2.sizeHint().width());
- m_buttonSize.setWidth(width);
-
- m_emblem = QIcon::fromTheme("dialog-ok").pixmap(QSize(16, 16));
- m_ratingPainter = new KRatingPainter;
-}
-
-void ResourceDelegate::paint(QPainter *painter,
- const QStyleOptionViewItem &option,
- const QModelIndex &index) const
-{
- if (!index.isValid()) {
- return;
- }
- bool leftToRight = (painter->layoutDirection() == Qt::LeftToRight);
-
- QStyleOptionViewItemV4 opt(option);
- QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
- painter->save();
- style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
- painter->restore();
-
- // paint the extender
- KExtendableItemDelegate::paint(painter, opt, index);
-
- int leftCount;
- if (leftToRight) {
- opt.rect.setLeft(option.rect.left() + UNIVERSAL_PADDING);
- leftCount = opt.rect.left() + UNIVERSAL_PADDING;
- } else {
- opt.rect.setRight(option.rect.right() - UNIVERSAL_PADDING);
- leftCount = opt.rect.width() - (UNIVERSAL_PADDING + MAIN_ICON_SIZE);
- }
-
- int left = opt.rect.left();
- int top = opt.rect.top();
- int width = opt.rect.width();
-
- QRect rect = opt.rect;
-
- if (leftToRight) {
- rect.setLeft(left + width - (m_buttonSize.width() + UNIVERSAL_PADDING));
- width -= m_buttonSize.width() + UNIVERSAL_PADDING;
- } else {
- rect.setLeft(left + UNIVERSAL_PADDING);
- left += m_buttonSize.width() + UNIVERSAL_PADDING;
- }
- // Calculate the top of the ratings widget which is the item height - the widget height size divided by 2
- // this give us a little value which is the top and bottom margin
- rect.setTop(rect.top() + ((calcItemHeight(option) - m_buttonSize.height()) / 2));
- rect.setSize(m_buttonSize); // the width and height sizes of the button
-
- bool transactionActive = index.data(ResourcesModel::ActiveRole).toBool();
-
- if (!transactionActive) {
- int rating = index.data(ResourcesModel::RatingRole).toInt();
- if (rating != -1) {
- m_ratingPainter->paint(painter, rect, rating);
- }
- } else {
- TransactionModel *transModel = TransactionModel::global();
- AbstractResource* res = qobject_cast<AbstractResource*>( index.data(ResourcesModel::ApplicationRole).value<QObject*>());
- Transaction *trans = transModel->transactionFromResource(res);
- QModelIndex transIndex = transModel->indexOf(trans);
- QStyleOptionProgressBar progressBarOption;
- progressBarOption.rect = rect;
- progressBarOption.minimum = 0;
- progressBarOption.maximum = 100;
- progressBarOption.progress = transIndex.data(TransactionModel::ProgressRole).toInt();
- progressBarOption.text = transIndex.data(TransactionModel::StatusTextRole).toString();
- progressBarOption.textVisible = true;
- KApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOption, painter);
- }
-
-
- // selects the mode to paint the icon based on the info field
- QIcon::Mode iconMode = QIcon::Normal;
- if (option.state & QStyle::State_MouseOver) {
- iconMode = QIcon::Active;
- }
-
- QColor foregroundColor = (option.state.testFlag(QStyle::State_Selected))?
- option.palette.color(QPalette::HighlightedText):option.palette.color(QPalette::Text);
-
- // Painting main column
- QStyleOptionViewItem local_option_title(option);
- QStyleOptionViewItem local_option_normal(option);
-
- local_option_normal.font.setPointSize(local_option_normal.font.pointSize() - 1);
-
- QPixmap pixmap(option.rect.size());
- pixmap.fill(Qt::transparent);
- QPainter p(&pixmap);
- p.translate(-option.rect.topLeft());
-
- // Main icon
- QIcon icon = QIcon::fromTheme(index.data(ResourcesModel::IconRole).toString());
-
- int iconSize = calcItemHeight(option) - 2 * UNIVERSAL_PADDING;
- icon.paint(&p,
- leftCount,
- top + UNIVERSAL_PADDING,
- iconSize,
- iconSize,
- Qt::AlignCenter,
- iconMode);
-
- if (index.data(ResourcesModel::InstalledRole).toBool()) {
- p.drawPixmap(leftCount, top + rect.height() - m_emblem.height()/2, m_emblem);
- }
-
- int textWidth;
- if (leftToRight) {
- // add the main icon
- leftCount += iconSize + UNIVERSAL_PADDING;
- textWidth = width - (leftCount - left);
- } else {
- leftCount -= UNIVERSAL_PADDING;
- textWidth = leftCount - left;
- leftCount = left;
- }
-
- // Text
- const int itemHeight = calcItemHeight(option);
-
- p.setPen(foregroundColor);
- // draw the top line
- int topTextHeight = QFontInfo(local_option_title.font).pixelSize();
- p.setFont(local_option_title.font);
- p.drawText(leftCount,
- top,
- textWidth,
- topTextHeight + UNIVERSAL_PADDING,
- Qt::AlignVCenter | Qt::AlignLeft,
- index.data(ResourcesModel::NameRole).toString());
-
- // draw the bottom line
- iconSize = topTextHeight + UNIVERSAL_PADDING;
-
- // store the original opacity
- qreal opa = p.opacity();
- if (!(option.state & QStyle::State_MouseOver) && !(option.state & QStyle::State_Selected)) {
- p.setOpacity(opa / 2.5);
- }
-
- p.setFont(local_option_normal.font);
- p.drawText(leftToRight ? leftCount + 0.5*iconSize: left - UNIVERSAL_PADDING,
- top + itemHeight / 2,
- textWidth - iconSize,
- QFontInfo(local_option_normal.font).pixelSize() + UNIVERSAL_PADDING,
- Qt::AlignTop | Qt::AlignLeft,
- index.data(ResourcesModel::CommentRole).toString());
- p.setOpacity(opa);
-
- painter->drawPixmap(option.rect.topLeft(), pixmap);
-}
-
-int ResourceDelegate::calcItemHeight(const QStyleOptionViewItem &option) const
-{
- // Painting main column
- QStyleOptionViewItem local_option_title(option);
- QStyleOptionViewItem local_option_normal(option);
-
- local_option_normal.font.setPointSize(local_option_normal.font.pointSize() - 1);
-
- int textHeight = QFontInfo(local_option_title.font).pixelSize() + QFontInfo(local_option_normal.font).pixelSize();
- return textHeight + 3 * UNIVERSAL_PADDING;
-}
-
-bool ResourceDelegate::editorEvent(QEvent *event,
- QAbstractItemModel *model,
- const QStyleOptionViewItem &option,
- const QModelIndex &index)
-{
- Q_UNUSED(option)
- if (event->type() == QEvent::MouseButtonRelease) {
- itemActivated(index);
- }
-
- return KExtendableItemDelegate::editorEvent(event, model, option, index);
-}
-
-QSize ResourceDelegate::sizeHint(const QStyleOptionViewItem &option,
- const QModelIndex &index ) const
-{
- int width = (index.column() == 0) ? index.data(Qt::SizeHintRole).toSize().width() : FAV_ICON_SIZE + 2 * UNIVERSAL_PADDING;
- QSize ret(KExtendableItemDelegate::sizeHint(option, index));
- // remove the default size of the index
- ret -= QStyledItemDelegate::sizeHint(option, index);
-
- ret.rheight() += calcItemHeight(option);
- ret.rwidth() += width;
-
- return ret;
-}
-
-void ResourceDelegate::itemActivated(QModelIndex index)
-{
- if ((index == m_oldIndex && isExtended(index))) {
- return;
- }
-
- if (isExtended(m_oldIndex)) {
- disconnect(m_extender, SIGNAL(infoButtonClicked(AbstractResource*)),
- this, SIGNAL(infoButtonClicked(AbstractResource*)));
- contractItem(m_oldIndex);
-
- m_extender->deleteLater();
- m_extender = 0;
- }
-
- QVariant appVarient = static_cast<const QAbstractItemModel*>(index.model())->data(index, ResourcesModel::ApplicationRole);
- AbstractResource *app = qobject_cast<AbstractResource*>(appVarient.value<QObject*>());
-
- QTreeView *view = static_cast<QTreeView*>(parent());
- m_extender = new ResourceExtender(view, app);
- m_extender->setShowInfoButton(m_showInfoButton);
- connect(m_extender, SIGNAL(infoButtonClicked(AbstractResource*)),
- this, SIGNAL(infoButtonClicked(AbstractResource*)));
-
- extendItem(m_extender, index);
- m_oldIndex = index;
-}
-
-void ResourceDelegate::invalidate()
-{
- // If only contractAll was a Q_SLOT...
- contractAll();
-}
-
-void ResourceDelegate::setShowInfoButton(bool show)
-{
- m_showInfoButton = show;
-}
diff --git a/installer/ResourceView/ResourceDelegate.h b/installer/ResourceView/ResourceDelegate.h
deleted file mode 100644
index 37930dd..0000000
--- a/installer/ResourceView/ResourceDelegate.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde at gmail.com>
- * Copyright (C) 2008 Daniel Nicoletti <dantti85-pk at yahoo.com.br>
- * Copyright (C) 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library/Lesser General Public License
- * version 2, or (at your option) any later version, as published by the
- * Free Software Foundation
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details
- *
- * You should have received a copy of the GNU Library/Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef RESOURCEDELEGATE_H
-#define RESOURCEDELEGATE_H
-
-// KDE includes
-#include <KExtendableItemDelegate>
-
-class AbstractResource;
-class KRatingPainter;
-
-class ResourceExtender;
-
-/**
- * Delegate for displaying the applications
- */
-class ResourceDelegate: public KExtendableItemDelegate
-{
- Q_OBJECT
-public:
- ResourceDelegate(QAbstractItemView *parent);
-
- void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
- QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
- bool editorEvent(QEvent *event,
- QAbstractItemModel *model,
- const QStyleOptionViewItem &option,
- const QModelIndex &index);
- void setShowInfoButton(bool show);
-
-private:
- QSize m_buttonSize;
- QPersistentModelIndex m_oldIndex;
- ResourceExtender *m_extender;
- KRatingPainter *m_ratingPainter;
- QPixmap m_emblem;
- bool m_showInfoButton;
-
- int calcItemHeight(const QStyleOptionViewItem &option) const;
-
-public Q_SLOTS:
- void itemActivated(QModelIndex index);
- void invalidate();
-
-Q_SIGNALS:
- void showExtendItem(const QModelIndex &index);
- void infoButtonClicked(AbstractResource *app);
-};
-
-#endif
diff --git a/installer/ResourceView/ResourceExtender.cpp b/installer/ResourceView/ResourceExtender.cpp
deleted file mode 100644
index ad81e84..0000000
--- a/installer/ResourceView/ResourceExtender.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ResourceExtender.h"
-
-#include <QHBoxLayout>
-#include <QtWidgets/QPushButton>
-
-#include <KDebug>
-#include <KLocalizedString>
-#include <KStandardGuiItem>
-
-#include <resources/AbstractResource.h>
-#include <resources/ResourcesModel.h>
-#include "Transaction/TransactionModel.h"
-
-ResourceExtender::ResourceExtender(QWidget *parent, AbstractResource *app)
- : QWidget(parent)
- , m_resource(app)
-{
- QHBoxLayout *layout = new QHBoxLayout(this);
- setLayout(layout);
-
- m_infoButton = new QPushButton(this);
- m_infoButton->setText(i18n("More Info"));
- connect(m_infoButton, SIGNAL(clicked()), this, SLOT(emitInfoButtonClicked()));
-
- QWidget *buttonSpacer = new QWidget(this);
- buttonSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
-
- m_actionButton = new QPushButton(this);
-
- if (app->isInstalled()) {
- m_actionButton->setIcon(QIcon::fromTheme("edit-delete"));
- m_actionButton->setText(i18n("Remove"));
- connect(m_actionButton, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
- } else {
- m_actionButton->setIcon(QIcon::fromTheme("download"));
- m_actionButton->setText(i18n("Install"));
- connect(m_actionButton, SIGNAL(clicked()), this, SLOT(installButtonClicked()));
- }
-
- m_cancelButton = new QPushButton(this);
- KGuiItem cancelButton = KStandardGuiItem::cancel();
- m_cancelButton->setIcon(cancelButton.icon());
- m_cancelButton->setToolTip(cancelButton.toolTip());
- m_cancelButton->hide();
- connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));
-
- layout->addWidget(m_infoButton);
- layout->addWidget(buttonSpacer);
- layout->addWidget(m_actionButton);
- layout->addWidget(m_cancelButton);
-
- // Catch already-begun transactions
- TransactionModel *transModel = TransactionModel::global();
- setupTransaction(transModel->transactionFromResource(app));
-
- connect(transModel, SIGNAL(transactionAdded(Transaction*)),
- this, SLOT(setupTransaction(Transaction*)));
- connect(transModel, SIGNAL(transactionCancelled(Transaction*)),
- this, SLOT(transactionCancelled(Transaction*)));
-}
-
-void ResourceExtender::setShowInfoButton(bool show)
-{
- m_infoButton->setVisible(show);
-}
-
-void ResourceExtender::setupTransaction(Transaction *trans)
-{
- if (!trans || m_resource != trans->resource())
- return;
-
- // Transaction already started, so no action can be taken
- m_actionButton->hide();
- m_cancelButton->setVisible(trans->isCancellable());
-
- // Listen to future changes with the transaction
- connect(trans, SIGNAL(cancellableChanged(bool)),
- m_cancelButton, SLOT(setVisible(bool)));
-}
-
-void ResourceExtender::transactionCancelled(Transaction* trans)
-{
- AbstractResource* resource = trans->resource();
- if (m_resource != resource)
- return;
-
- // Reset UI to its pre-transaction state
- m_cancelButton->hide();
- m_actionButton->show();
- m_actionButton->setEnabled(true);
- if (m_resource->isInstalled()) {
- m_actionButton->setIcon(QIcon::fromTheme("edit-delete"));
- m_actionButton->setText(i18n("Remove"));
- } else {
- m_actionButton->setIcon(QIcon::fromTheme("download"));
- m_actionButton->setText(i18n("Install"));
- }
-}
-
-void ResourceExtender::emitInfoButtonClicked()
-{
- emit infoButtonClicked(m_resource);
-}
-
-void ResourceExtender::removeButtonClicked()
-{
- m_actionButton->setEnabled(false);
- ResourcesModel *resourcesModel = ResourcesModel::global();
- resourcesModel->removeApplication(m_resource);
-}
-
-void ResourceExtender::installButtonClicked()
-{
- m_actionButton->setEnabled(false);
- ResourcesModel *resourcesModel = ResourcesModel::global();
- resourcesModel->installApplication(m_resource);
-}
-
-void ResourceExtender::cancelButtonClicked()
-{
- ResourcesModel *resourcesModel = ResourcesModel::global();
- resourcesModel->cancelTransaction(m_resource);
-}
diff --git a/installer/ResourceView/ResourceExtender.h b/installer/ResourceView/ResourceExtender.h
deleted file mode 100644
index 0b98e7d..0000000
--- a/installer/ResourceView/ResourceExtender.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef RESOURCEEXTENDER_H
-#define RESOURCEEXTENDER_H
-
-#include <QtWidgets/QWidget>
-
-#include "resources/AbstractResourcesBackend.h"
-#include "Transaction/Transaction.h"
-
-class QProgressBar;
-class QPushButton;
-
-class ResourceExtender : public QWidget
-{
- Q_OBJECT
-public:
- ResourceExtender(QWidget *parent, AbstractResource *app);
-
- void setShowInfoButton(bool show);
-
-private:
- AbstractResource *m_resource;
- QPushButton *m_infoButton;
- QPushButton *m_actionButton;
- QPushButton *m_cancelButton;
-
-private Q_SLOTS:
- void setupTransaction(Transaction *trans);
- void transactionCancelled(Transaction *trans);
- void emitInfoButtonClicked();
- void removeButtonClicked();
- void installButtonClicked();
- void cancelButtonClicked();
-
-Q_SIGNALS:
- void infoButtonClicked(AbstractResource *resource);
-};
-
-#endif
diff --git a/installer/ResourceView/ResourceListView.cpp b/installer/ResourceView/ResourceListView.cpp
deleted file mode 100644
index 557e6ab..0000000
--- a/installer/ResourceView/ResourceListView.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ResourceListView.h"
-
-// Qt includes
-#include <QIcon>
-#include <QtWidgets/QStackedWidget>
-
-// KDE includes
-#include <KSeparator>
-
-// Libmuon includes
-#include <resources/ResourcesModel.h>
-
-// Own includes
-#include "BreadcrumbWidget/BreadcrumbWidget.h"
-#include "ResourceViewWidget.h"
-
-ResourceListView::ResourceListView(QWidget *parent, const QModelIndex &index)
- : AbstractViewContainer(parent)
-{
- m_appViewWidget = new ResourceViewWidget(this);
- m_appViewWidget->setTitle(index.data(Qt::DisplayRole).toString());
- m_appViewWidget->setIcon(index.data(Qt::DecorationRole).value<QIcon>());
- m_breadcrumbWidget->setRootItem(m_appViewWidget->breadcrumbItem());
-
- m_viewStack->addWidget(m_appViewWidget);
- m_viewStack->setCurrentWidget(m_appViewWidget);
-
- ResourcesModel *resourcesModel = ResourcesModel::global();
- connect(resourcesModel, SIGNAL(searchInvalidated()),
- m_breadcrumbWidget, SLOT(startSearch()));
- connect(m_appViewWidget, SIGNAL(registerNewSubView(AbstractViewBase*)),
- this, SLOT(registerNewSubView(AbstractViewBase*)));
- connect(m_appViewWidget, SIGNAL(switchToSubView(AbstractViewBase*)),
- this, SLOT(switchToSubView(AbstractViewBase*)));
-}
-
-void ResourceListView::setStateFilter(AbstractResource::State state)
-{
- m_appViewWidget->setStateFilter(state);
-}
-
-void ResourceListView::setOriginFilter(const QString &origin)
-{
- m_appViewWidget->setOriginFilter(origin);
-}
-
-void ResourceListView::setShouldShowTechnical(bool show)
-{
- m_appViewWidget->setShouldShowTechnical(show);
-}
-
-void ResourceListView::setCanShowTechnical(bool canShow)
-{
- m_appViewWidget->setCanShowTechnical(canShow);
-}
diff --git a/installer/ResourceView/ResourceListView.h b/installer/ResourceView/ResourceListView.h
deleted file mode 100644
index 92043cd..0000000
--- a/installer/ResourceView/ResourceListView.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef RESOURCELISTVIEW_H
-#define RESOURCELISTVIEW_H
-
-#include <QModelIndex>
-
-#include <resources/AbstractResource.h>
-
-#include "AbstractViewContainer.h"
-
-class ResourceViewWidget;
-
-class ResourceListView : public AbstractViewContainer
-{
- Q_OBJECT
-public:
- ResourceListView(QWidget *parent, const QModelIndex &index);
-
- void setStateFilter(AbstractResource::State state);
- void setOriginFilter(const QString &origin);
- void setShouldShowTechnical(bool show);
- void setCanShowTechnical(bool canShow);
-
-private:
- ResourceViewWidget *m_appViewWidget;
-};
-
-#endif
diff --git a/installer/ResourceView/ResourceViewWidget.cpp b/installer/ResourceView/ResourceViewWidget.cpp
deleted file mode 100644
index faaf776..0000000
--- a/installer/ResourceView/ResourceViewWidget.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ResourceViewWidget.h"
-
-// Qt includes
-#include <QtCore/QStringBuilder>
-#include <QCheckBox>
-#include <QtWidgets/QLabel>
-#include <QtWidgets/QTreeView>
-#include <QtWidgets/QVBoxLayout>
-
-// KDE includes
-#include <KComboBox>
-#include <KLocalizedString>
-
-// Libmuon includes
-#include <Category/Category.h>
-#include <Transaction/Transaction.h>
-#include <resources/AbstractResource.h>
-#include <resources/ResourcesModel.h>
-#include <resources/ResourcesProxyModel.h>
-
-// Own includes
-#include "ResourceDelegate.h"
-#include "ResourceDetailsView/ResourceDetailsView.h"
-#include "BreadcrumbWidget/BreadcrumbItem.h"
-
-ResourceViewWidget::ResourceViewWidget(QWidget *parent)
- : AbstractViewBase(parent)
- , m_canShowTechnical(false)
- , m_detailsView(0)
-{
- m_searchable = true;
- m_proxyModel = new ResourcesProxyModel(this);
- m_proxyModel->setSortRole(ResourcesModel::SortableRatingRole);
- m_proxyModel->setSourceModel(ResourcesModel::global());
-
- QWidget *header = new QWidget(this);
- QHBoxLayout *headerLayout = new QHBoxLayout(header);
- headerLayout->setMargin(0);
- header->setLayout(headerLayout);
-
- m_headerIcon = new QLabel(header);
- m_headerLabel = new QLabel(header);
-
- m_techCheckBox = new QCheckBox(header);
- m_techCheckBox->setText(i18n("Show technical items"));
- m_techCheckBox->hide();
- connect(m_techCheckBox, SIGNAL(stateChanged(int)),
- this, SLOT(techCheckChanged(int)));
-
- QLabel *sortLabel = new QLabel(header);
- sortLabel->setText(i18n("Sort:"));
- m_sortCombo = new KComboBox(header);
- m_sortCombo->addItem(i18nc("@item:inlistbox", "By Name"), ResourcesModel::NameRole);
- m_sortCombo->addItem(i18nc("@item:inlistbox", "By Top Rated"), ResourcesModel::SortableRatingRole);
- m_sortCombo->addItem(i18nc("@item:inlistbox", "By Most Buzz"), ResourcesModel::RatingPointsRole);
- m_sortCombo->setCurrentIndex(1); // Top Rated index
- connect(m_sortCombo, SIGNAL(currentIndexChanged(int)),
- this, SLOT(sortComboChanged(int)));
-
- headerLayout->addWidget(m_headerIcon);
- headerLayout->addWidget(m_headerLabel);
- headerLayout->addStretch();
- headerLayout->addWidget(sortLabel);
- headerLayout->addWidget(m_sortCombo);
- headerLayout->addWidget(m_techCheckBox);
-
- m_treeView = new QTreeView(this);
- m_treeView->setAlternatingRowColors(true);
- m_treeView->setHeaderHidden(true);
- m_treeView->setRootIsDecorated(false);
-
- m_treeView->setModel(m_proxyModel);
- m_delegate = new ResourceDelegate(m_treeView);
- m_treeView->setItemDelegate(m_delegate);
-
- connect(m_proxyModel, SIGNAL(invalidated()),
- m_delegate, SLOT(invalidate()));
- connect(m_proxyModel, SIGNAL(invalidated()),
- this, SLOT(updateSortCombo()));
-
- m_layout->addWidget(header);
- m_layout->addWidget(m_treeView);
-
- connect(m_delegate, SIGNAL(infoButtonClicked(AbstractResource*)),
- this, SLOT(infoButtonClicked(AbstractResource*)));
-
- m_treeView->setSortingEnabled(true);
-
- m_crumb->setAssociatedView(this);
-}
-
-void ResourceViewWidget::setTitle(const QString &title)
-{
- m_crumb->setText(title);
- m_headerLabel->setText(QLatin1String("<h2>") % title % "</h2>");
-}
-
-void ResourceViewWidget::setIcon(const QIcon &icon)
-{
- m_crumb->setIcon(icon);
- m_headerIcon->setPixmap(icon.pixmap(24,24));
-}
-
-void ResourceViewWidget::setStateFilter(AbstractResource::State state)
-{
- m_proxyModel->setStateFilter(state);
-}
-
-void ResourceViewWidget::setOriginFilter(const QString &origin)
-{
- m_proxyModel->setOriginFilter(origin);
-}
-
-void ResourceViewWidget::setFiltersFromCategory(Category *category)
-{
- m_proxyModel->setFiltersFromCategory(category);
-}
-
-void ResourceViewWidget::setShouldShowTechnical(bool show)
-{
- m_proxyModel->setShouldShowTechnical(show);
- m_techCheckBox->setChecked(show);
-}
-
-void ResourceViewWidget::setCanShowTechnical(bool canShow)
-{
- m_canShowTechnical = canShow;
-
- if (canShow) {
- m_techCheckBox->show();
- }
-}
-
-void ResourceViewWidget::search(const QString &text)
-{
- m_proxyModel->sort(m_proxyModel->sortColumn(), Qt::AscendingOrder);
- m_proxyModel->setSearch(text);
-}
-
-void ResourceViewWidget::infoButtonClicked(AbstractResource *resource)
-{
- // Check to see if a view for this app already exists
- if (m_currentPair.second == resource) {
- emit switchToSubView(m_currentPair.first);
- return;
- }
-
- // Create one if not
- m_detailsView = new ResourceDetailsView(this);
- m_detailsView->setResource(resource);
- m_currentPair.first = m_detailsView;
-
- connect(m_detailsView, SIGNAL(destroyed(QObject*)),
- this, SLOT(onSubViewDestroyed()));
-
- // Tell our parent that we can exist, so that they can forward it
- emit registerNewSubView(m_detailsView);
-}
-
-void ResourceViewWidget::onSubViewDestroyed()
-{
- m_currentPair.first = 0;
- m_currentPair.second = 0;
-}
-
-void ResourceViewWidget::sortComboChanged(int index)
-{
- m_proxyModel->setSortRole(m_sortCombo->itemData(index).toInt());
- int sortRole = m_proxyModel->sortRole();
-
- if (m_proxyModel->isFilteringBySearch()) {
- bool sortByRelevancy = (sortRole == -1) ? true : false;
- m_proxyModel->setSortByRelevancy(sortByRelevancy);
- }
-
- switch (sortRole) {
- case ResourcesModel::SortableRatingRole:
- case ResourcesModel::RatingPointsRole:
- m_proxyModel->sort(m_proxyModel->sortColumn(), Qt::DescendingOrder);
- break;
- default:
- m_proxyModel->sort(m_proxyModel->sortColumn(), Qt::AscendingOrder);
- }
-}
-
-void ResourceViewWidget::updateSortCombo()
-{
- bool searching = m_proxyModel->isFilteringBySearch();
- int searchItemIndex = m_sortCombo->findData(-1, Qt::UserRole);
-
- if (searching && searchItemIndex == -1) {
- // Add search combobox item for sort by search relevancy
- m_sortCombo->addItem(i18nc("@item:inlistbox", "By Relevancy"), -1);
- searchItemIndex = m_sortCombo->findData(-1, Qt::UserRole);
- m_sortCombo->setCurrentIndex(searchItemIndex);
- } else if (searchItemIndex != -1) {
- // Remove relevancy item if we aren't searching anymore
- m_sortCombo->removeItem(searchItemIndex);
- }
-}
-
-void ResourceViewWidget::techCheckChanged(int state)
-{
- setShouldShowTechnical(state == Qt::Checked);
-}
diff --git a/installer/ResourceView/ResourceViewWidget.h b/installer/ResourceView/ResourceViewWidget.h
deleted file mode 100644
index d37e2f5..0000000
--- a/installer/ResourceView/ResourceViewWidget.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2012 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef RESOURCEVIEWWIDGET_H
-#define RESOURCEVIEWWIDGET_H
-
-#include <QtCore/QPair>
-
-#include <resources/AbstractResource.h>
-
-#include "AbstractViewBase.h"
-
-class QCheckBox;
-class QIcon;
-class QLabel;
-class QTreeView;
-
-class KComboBox;
-
-class ResourceDelegate;
-class ResourceDetailsView;
-class ResourcesProxyModel;
-class Category;
-
-class ResourceViewWidget : public AbstractViewBase
-{
- Q_OBJECT
-public:
- ResourceViewWidget(QWidget *parent);
-
- void search(const QString &text);
-
-private:
- ResourcesProxyModel *m_proxyModel;
- QPair<AbstractViewBase *, AbstractResource *> m_currentPair;
- bool m_canShowTechnical;
-
- QLabel *m_headerIcon;
- QLabel *m_headerLabel;
- QCheckBox *m_techCheckBox;
- KComboBox *m_sortCombo;
- QTreeView *m_treeView;
- ResourceDelegate *m_delegate;
- ResourceDetailsView *m_detailsView;
-
-private Q_SLOTS:
- void infoButtonClicked(AbstractResource *resource);
- void onSubViewDestroyed();
- void sortComboChanged(int index);
- void updateSortCombo();
- void techCheckChanged(int state);
-
-public Q_SLOTS:
- void setTitle(const QString &title);
- void setIcon(const QIcon &icon);
- void setStateFilter(AbstractResource::State state);
- void setOriginFilter(const QString &origin);
- void setFiltersFromCategory(Category *category);
- void setShouldShowTechnical(bool show);
- void setCanShowTechnical(bool canShow);
-};
-
-#endif
diff --git a/installer/ReviewsWidget/ReviewWidget.cpp b/installer/ReviewsWidget/ReviewWidget.cpp
deleted file mode 100644
index f28a707..0000000
--- a/installer/ReviewsWidget/ReviewWidget.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/***************************************************************************
- * Copyright © 2011 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ReviewWidget.h"
-
-#include <QtCore/QStringBuilder>
-#include <QHBoxLayout>
-#include <QtWidgets/QLabel>
-
-#include <KGlobal>
-#include <KLocalizedString>
-#include <Nepomuk/KRatingWidget>
-
-#include <ReviewsBackend/Review.h>
-#include <resources/AbstractResource.h>
-
-ReviewWidget::ReviewWidget(QWidget *parent)
- : KVBox(parent)
-{
- QWidget *headerWidget = new QWidget(this);
- QHBoxLayout *headerLayout = new QHBoxLayout(headerWidget);
- headerLayout->setMargin(0);
- headerWidget->setLayout(headerLayout);
-
- m_ratingWidget = new KRatingWidget(headerWidget);
- m_ratingWidget->setAttribute(Qt::WA_TransparentForMouseEvents);
- m_ratingWidget->setPixmapSize(16);
- m_summaryLabel = new QLabel(headerWidget);
- QWidget *headerSpacer = new QWidget(headerWidget);
- headerSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
- m_nameDateLabel = new QLabel(headerWidget);
- m_nameDateLabel->setEnabled(false);
-
- headerLayout->addWidget(m_ratingWidget);
- headerLayout->addWidget(m_summaryLabel);
- headerLayout->addWidget(headerSpacer);
- headerLayout->addWidget(m_nameDateLabel);
-
- m_reviewLabel = new QLabel(this);
- m_reviewLabel->setWordWrap(true);
-
- m_versionLabel = new QLabel(this);
- m_versionLabel->setEnabled(false);
- m_versionLabel->hide();
-
- QWidget *usefulnessWidget = new QWidget(this);
- QHBoxLayout *usefulnessLayout = new QHBoxLayout(usefulnessWidget);
- usefulnessLayout->setMargin(0);
- usefulnessWidget->setLayout(usefulnessLayout);
-
- m_usefulnessLabel = new QLabel(usefulnessWidget);
- // TODO: Report usefulness/inappropriateness once submitting works
-
- usefulnessLayout->addWidget(m_usefulnessLabel);
-}
-
-ReviewWidget::~ReviewWidget()
-{
-}
-
-static int compareVersion(const QString& a, const QString& b)
-{
- if(a==b)
- return 0;
- QStringList verA = a.split('.');
- QStringList verB = b.split('.');
- while(!verA.isEmpty() && !verB.isEmpty()) {
- QString curA = verA.takeFirst(), curB = verB.takeFirst();
- int diff = curB.compare(curA);
- if(diff!=0)
- return diff;
- }
- return verB.size()-verA.size();
-}
-
-static QString upstreamVersion(const QString& ver)
-{
- QString ret = ver;
-
- int idx = ret.indexOf(':');
- if(idx>=0)
- ret= ret.mid(idx+1);
-
- idx = ret.indexOf('-');
- if(idx>=0)
- ret= ret.left(idx);
-
- idx = ret.indexOf('+');
- if(idx>=0)
- ret= ret.left(idx);
-
- return ret;
-}
-
-void ReviewWidget::setReview(Review *review)
-{
- if (!review->package())
- return;
-
- m_ratingWidget->setRating(review->rating());
-
- m_summaryLabel->setText(QLatin1Literal("<b>") % review->summary()
- % QLatin1Literal("</b>"));
-
- QString date = KGlobal::locale()->formatDate(review->creationDate().date(), KLocale::ShortDate);
- m_nameDateLabel->setText(i18nc("@label Formatted: username, date",
- "%1, %2",
- review->reviewer(), date));
-
- m_reviewLabel->setText(review->reviewText());
-
- const QString reviewUpstream = upstreamVersion(review->packageVersion());
- const QString currentUpstream = upstreamVersion(review->package()->installedVersion());
-
- int res = compareVersion(reviewUpstream, currentUpstream);
-
- if (res < 0) {
- m_versionLabel->setText(QLatin1Literal("<i>") %
- i18nc("@label", "This review was written for an older version "
- "(Version: %1)", reviewUpstream) %
- QLatin1Literal("</i>"));
- m_versionLabel->show();
- }
-
- if (review->usefulnessTotal()) {
- m_usefulnessLabel->setText(i18ncp("@label", "%1 out of %2 person found this review useful",
- "%1 out of %2 people found this review useful",
- review->usefulnessFavorable(), review->usefulnessTotal()));
- }
-}
-
-#include "ReviewWidget.moc"
diff --git a/installer/ReviewsWidget/ReviewWidget.h b/installer/ReviewsWidget/ReviewWidget.h
deleted file mode 100644
index 4f4d7a7..0000000
--- a/installer/ReviewsWidget/ReviewWidget.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- * Copyright © 2011 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef REVIEWWIDGET_H
-#define REVIEWWIDGET_H
-
-#include <KVBox>
-
-class QLabel;
-
-class KRatingWidget;
-
-class Review;
-
-class ReviewWidget : public KVBox
-{
- Q_OBJECT
-public:
- ReviewWidget(QWidget *parent);
- ~ReviewWidget();
-
- void setReview(Review *review);
-
-private:
- KRatingWidget *m_ratingWidget;
- QLabel *m_summaryLabel;
- QLabel *m_nameDateLabel;
- QLabel *m_reviewLabel;
- QLabel *m_versionLabel;
- QLabel *m_usefulnessLabel;
-};
-
-#endif
diff --git a/installer/ReviewsWidget/ReviewsWidget.cpp b/installer/ReviewsWidget/ReviewsWidget.cpp
deleted file mode 100644
index 5c8b6e8..0000000
--- a/installer/ReviewsWidget/ReviewsWidget.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
- * Copyright © 2011 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ReviewsWidget.h"
-
-#include <QtCore/QStringBuilder>
-#include <QtWidgets/QLabel>
-#include <QtWidgets/QPushButton>
-#include <QHBoxLayout>
-#include <QtWidgets/QToolButton>
-
-#include <KDialog>
-#include <KLocalizedString>
-
-#include <ReviewsBackend/Review.h>
-
-#include "ReviewWidget.h"
-
-bool reviewsGreaterThan(Review *lhs, Review *rhs)
-{
- return *lhs > *rhs;
-}
-
-ReviewsWidget::ReviewsWidget(QWidget *parent)
- : KVBox(parent)
- , m_pagesFetched(0)
-{
- QWidget *headerWidget = new QWidget(this);
- QHBoxLayout *headerLayout = new QHBoxLayout(headerWidget);
- headerLayout->setMargin(0);
- headerWidget->setLayout(headerLayout);
-
- m_expandButton = new QToolButton(headerWidget);
- m_expandButton->setAutoRaise(true);
- m_expandButton->setArrowType(Qt::DownArrow);
- connect(m_expandButton, SIGNAL(clicked()), this, SLOT(expandButtonClicked()));
-
- QLabel *titleLabel = new QLabel(headerWidget);
- titleLabel->setText(QLatin1Literal("<h3>") %
- i18nc("@title", "Reviews") % QLatin1Literal("</h3>"));
-
- QWidget *headerSpacer = new QWidget(headerWidget);
- headerSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- headerLayout->addWidget(m_expandButton);
- headerLayout->addWidget(titleLabel);
- headerLayout->addWidget(headerSpacer);
-
- m_reviewContainer = new QWidget(this);
- m_reviewLayout = new QVBoxLayout(m_reviewContainer);
- m_reviewLayout->setSpacing(2*KDialog::spacingHint());
- m_reviewContainer->setLayout(m_reviewLayout);
-
- m_statusLabel = new QLabel(m_reviewContainer);
- m_statusLabel->setAlignment(Qt::AlignHCenter);
- m_statusLabel->setText(i18nc("@info:status", "Loading reviews"));
-
- m_reviewLayout->addWidget(m_statusLabel);
-
- m_moreButton = new QPushButton(this);
- m_moreButton->hide();
- m_moreButton->setText(i18nc("@action", "Check for more reviews"));
- connect(m_moreButton, SIGNAL(clicked()), this, SLOT(emitFetchPage()));
-}
-
-ReviewsWidget::~ReviewsWidget()
-{
-}
-
-void ReviewsWidget::expandButtonClicked()
-{
- if (m_reviewContainer->isHidden()) {
- m_expandButton->setArrowType(Qt::DownArrow);
- m_reviewContainer->show();
- } else {
- m_reviewContainer->hide();
- m_expandButton->setArrowType(Qt::RightArrow);
- }
-}
-
-void ReviewsWidget::addReviews(QList<Review *> reviews)
-{
- if (reviews.isEmpty()) {
- m_moreButton->hide();
- if (!m_pagesFetched) {
- m_statusLabel->setText(i18nc("@info:status", "No reviews available"));
- }
- return;
- }
-
- m_pagesFetched++;
- m_statusLabel->hide();
- m_moreButton->show();
- m_moreButton->setEnabled(true);
-
- qSort(reviews.begin(), reviews.end(), reviewsGreaterThan);
-
- foreach (Review *review, reviews) {
- if (!review->shouldShow()) {
- continue;
- }
- ReviewWidget *reviewWidget = new ReviewWidget(m_reviewContainer);
- reviewWidget->setReview(review);
-
- m_reviewLayout->addWidget(reviewWidget);
- }
-}
-
-void ReviewsWidget::emitFetchPage()
-{
- emit fetchPage(m_pagesFetched + 1);
- m_moreButton->setEnabled(false);
-}
-
-#include "ReviewsWidget.moc"
diff --git a/installer/ReviewsWidget/ReviewsWidget.h b/installer/ReviewsWidget/ReviewsWidget.h
deleted file mode 100644
index 7f0598b..0000000
--- a/installer/ReviewsWidget/ReviewsWidget.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- * Copyright © 2011 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef REVIEWSWIDGET_H
-#define REVIEWSWIDGET_H
-
-#include <KVBox>
-
-class QLabel;
-class QPushButton;
-class QToolButton;
-class QVBoxLayout;
-
-class Review;
-
-class ReviewsWidget : public KVBox
-{
- Q_OBJECT
-public:
- ReviewsWidget(QWidget *parent);
- ~ReviewsWidget();
-
- void addReviews(QList<Review *> reviews);
-
-private:
- QToolButton *m_expandButton;
- QWidget *m_reviewContainer;
- QVBoxLayout *m_reviewLayout;
- QLabel *m_statusLabel;
- QPushButton *m_moreButton;
-
- int m_pagesFetched;
-
-private Q_SLOTS:
- void expandButtonClicked();
- void emitFetchPage();
-
-signals:
- void fetchPage(int page);
-};
-
-#endif
diff --git a/installer/ScreenShotOverlay.cpp b/installer/ScreenShotOverlay.cpp
deleted file mode 100644
index c4fadb7..0000000
--- a/installer/ScreenShotOverlay.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- This file is part of Akonadi Contact.
-
- Copyright (c) 2008 Volker Krause <vkrause at kde.org>
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published by
- the Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- This library is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
- License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-#include "ScreenShotOverlay.h"
-
-#include <QApplication>
-#include <QtCore/QEvent>
-#include <QBoxLayout>
-#include <QtWidgets/QLabel>
-#include <QMouseEvent>
-#include <QPalette>
-#include <QtWidgets/QProgressBar>
-
-#include <QParallelAnimationGroup>
-#include <QPropertyAnimation>
-#include <QGraphicsOpacityEffect>
-#include <QScrollArea>
-
-#include <KLocalizedString>
-
-#include "ClickableLabel.h"
-#include "effects/GraphicsOpacityDropShadowEffect.h"
-
-#define BLUR_RADIUS 15
-
-ScreenShotOverlay::ScreenShotOverlay(const QString &url, QWidget *baseWidget, QWidget *parent)
- : QWidget( parent ? parent : baseWidget->window() ),
- mBaseWidget( baseWidget )
-{
- connect( baseWidget, SIGNAL(destroyed()), SLOT(deleteLater()) );
- setAttribute(Qt::WA_DeleteOnClose);
- setCursor(Qt::PointingHandCursor);
-
- QBoxLayout *topLayout = new QVBoxLayout( this );
- QWidget *topStretch = new QWidget(this);
- topStretch->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
- topLayout->addWidget(topStretch);
-
- m_scrollArea = new QScrollArea(this);
-
- m_screenshotL = new ClickableLabel(m_scrollArea);
- m_screenshotL->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
- m_screenshotL->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
- m_screenshotL->setCursor(Qt::PointingHandCursor);
-
- m_scrollArea->setFrameShape(QFrame::NoFrame);
- m_scrollArea->setFrameShadow(QFrame::Plain);
- m_scrollArea->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- m_scrollArea->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
- m_scrollArea->setWidget(m_screenshotL);
- m_screenshotL->resize(250, 500);
- m_scrollArea->resize(250, 500);
-
- m_screenshot = QPixmap(url);
-
- connect(m_screenshotL, SIGNAL(clicked()), this, SLOT(close()));
- connect(this, SIGNAL(clicked()), this, SLOT(close()));
-
- topLayout->addWidget(m_scrollArea);
- QWidget *bottomStretch = new QWidget(this);
- bottomStretch->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
- topLayout->addWidget(bottomStretch);
-
- QPalette p = palette();
- p.setColor( backgroundRole(), QColor( 0, 0, 0, 128 ) );
- setPalette( p );
- setAutoFillBackground( true );
-
- mBaseWidget->installEventFilter( this );
-
- fadeIn();
-
- reposition();
-}
-
-ScreenShotOverlay::~ ScreenShotOverlay()
-{
-}
-
-void ScreenShotOverlay::reposition()
-{
- if ( !mBaseWidget )
- return;
-
- // reparent to the current top level widget of the base widget if needed
- // needed eg. in dock widgets
- if ( parentWidget() != mBaseWidget->window() )
- //setParent( mBaseWidget->window() );
-
- // follow base widget visibility
- // needed eg. in tab widgets
- if ( !mBaseWidget->isVisible() ) {
- hide();
- return;
- }
- show();
-
- // follow position changes
- const QPoint topLevelPos = mBaseWidget->mapTo( window(), QPoint( 0, 0 ) );
- const QPoint parentPos = parentWidget()->mapFrom( window(), topLevelPos );
- move( parentPos );
-
- // follow size changes
- // TODO: hide/scale icon if we don't have enough space
- resize( mBaseWidget->size() );
-}
-
-void ScreenShotOverlay::fadeIn()
-{
- GraphicsOpacityDropShadowEffect *effect = new GraphicsOpacityDropShadowEffect(m_screenshotL);
- effect->setBlurRadius(BLUR_RADIUS);
- effect->setOpacity(0);
- effect->setOffset(2);
- effect->setColor(QApplication::palette().dark().color());
-
- QPropertyAnimation *anim = new QPropertyAnimation(effect, "opacity", this);
- anim->setDuration(200);
- anim->setStartValue(qreal(0));
- anim->setEndValue(qreal(1));
-
- m_screenshotL->setGraphicsEffect(effect);
- m_screenshotL->setPixmap(m_screenshot);
- m_screenshotL->adjustSize();
-
- anim->start();
-}
-
-bool ScreenShotOverlay::eventFilter(QObject * object, QEvent * event)
-{
- if ( object == mBaseWidget &&
- ( event->type() == QEvent::Move || event->type() == QEvent::Resize ||
- event->type() == QEvent::Show || event->type() == QEvent::Hide ||
- event->type() == QEvent::ParentChange ) ) {
- reposition();
- }
- return QWidget::eventFilter( object, event );
-}
-
-void ScreenShotOverlay::mousePressEvent(QMouseEvent *event)
-{
- emit clicked();
- event->accept();
-}
-
-
-#include "ScreenShotOverlay.moc"
diff --git a/installer/ScreenShotOverlay.h b/installer/ScreenShotOverlay.h
deleted file mode 100644
index 55f8953..0000000
--- a/installer/ScreenShotOverlay.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- Copyright (c) 2009 Tobias Koenig <tokoe at kde.org>
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published by
- the Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- This library is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
- License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-#ifndef SCREENSHOTOVERLAY_H
-#define SCREENSHOTOVERLAY_H
-
-#include <QtCore/QPointer>
-#include <QtWidgets/QWidget>
-#include <QPixmap>
-
-class QMouseEvent;
-class QScrollArea;
-
-class ClickableLabel;
-
-/**
- * Class to display a screenshot as an overlay of a widget
- */
-class ScreenShotOverlay : public QWidget
-{
- Q_OBJECT
- public:
- /**
- * Create an overlay widget on @p baseWidget for the image at @p url.
- * @p baseWidget must not be null.
- * @p parent must not be equal to @p baseWidget
- */
- explicit ScreenShotOverlay(const QString &url, QWidget *baseWidget, QWidget *parent = 0);
- ~ScreenShotOverlay();
-
- protected:
- bool eventFilter( QObject *object, QEvent *event );
- virtual void mousePressEvent(QMouseEvent *event);
-
- private slots:
- void fadeIn();
-
- private:
- QPointer<QWidget> mBaseWidget;
- QScrollArea *m_scrollArea;
- QPixmap m_screenshot;
- ClickableLabel *m_screenshotL;
-
- void reposition();
-
- signals:
- void clicked();
-};
-
-#endif
diff --git a/installer/ViewSwitcher.cpp b/installer/ViewSwitcher.cpp
deleted file mode 100644
index dcdfa3a..0000000
--- a/installer/ViewSwitcher.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "ViewSwitcher.h"
-
-ViewSwitcher::ViewSwitcher(QWidget *parent)
- : QTreeView(parent)
-{
- setHeaderHidden(true);
- setUniformRowHeights(true);
- setIconSize(QSize(24,24));
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
-}
-
-ViewSwitcher::~ViewSwitcher()
-{
-}
-
-#include "ViewSwitcher.moc"
diff --git a/installer/ViewSwitcher.h b/installer/ViewSwitcher.h
deleted file mode 100644
index a51b05a..0000000
--- a/installer/ViewSwitcher.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * Copyright © 2010 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef VIEWSWITCHER_H
-#define VIEWSWITCHER_H
-
-// Qt includes
-#include <QtWidgets/QTreeView>
-
-class ViewSwitcher : public QTreeView
-{
- Q_OBJECT
-public:
- explicit ViewSwitcher(QWidget *parent);
- ~ViewSwitcher();
-};
-
-#endif
diff --git a/installer/config/MuonInstallerSettings.kcfgc b/installer/config/MuonInstallerSettings.kcfgc
deleted file mode 100644
index c268b65..0000000
--- a/installer/config/MuonInstallerSettings.kcfgc
+++ /dev/null
@@ -1,4 +0,0 @@
-File=muon-installer.kcfg
-ClassName=MuonInstallerSettings
-Singleton=true
-Mutators=true
\ No newline at end of file
diff --git a/installer/config/muon-installer.kcfg b/installer/config/muon-installer.kcfg
deleted file mode 100644
index 80b4522..0000000
--- a/installer/config/muon-installer.kcfg
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
- http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
- <kcfgfile name="muon-installerrc"/>
- <group name="muon-installer">
- <entry name="SplitterSizes" type="IntList">
- <label>How the main window is divided.</label>
- </entry>
- <entry name="Width" type="Int">
- <label>Width of the main window.</label>
- <default>600</default>
- </entry>
- <entry name="Height" type="Int">
- <label>Height of the main window.</label>
- <default>400</default>
- </entry>
- </group>
-</kcfg>
diff --git a/installer/effects/GraphicsOpacityDropShadowEffect.cpp b/installer/effects/GraphicsOpacityDropShadowEffect.cpp
deleted file mode 100644
index aa2f629..0000000
--- a/installer/effects/GraphicsOpacityDropShadowEffect.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2010 by Daniel Nicoletti *
- * dantti85-pk at yahoo.com.br *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; see the file COPYING. If not, write to *
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#include "GraphicsOpacityDropShadowEffect.h"
-
-#include <QPainter>
-#include <QVariant>
-
-GraphicsOpacityDropShadowEffect::GraphicsOpacityDropShadowEffect(QObject *parent)
- : QGraphicsDropShadowEffect(parent),
- m_opacity(1)
-{
-}
-
-GraphicsOpacityDropShadowEffect::~GraphicsOpacityDropShadowEffect()
-{
-}
-
-qreal GraphicsOpacityDropShadowEffect::opacity() const
-{
- return m_opacity;
-}
-
-void GraphicsOpacityDropShadowEffect::setOpacity(qreal opacity)
-{
- m_opacity = opacity;
- update();
-}
-
-void GraphicsOpacityDropShadowEffect::draw(QPainter *painter)
-{
- painter->setOpacity(m_opacity);
- QGraphicsDropShadowEffect::draw(painter);
-}
-
-#include "GraphicsOpacityDropShadowEffect.moc"
diff --git a/installer/effects/GraphicsOpacityDropShadowEffect.h b/installer/effects/GraphicsOpacityDropShadowEffect.h
deleted file mode 100644
index 50ec498..0000000
--- a/installer/effects/GraphicsOpacityDropShadowEffect.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2010 by Daniel Nicoletti *
- * dantti85-pk at yahoo.com.br *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; see the file COPYING. If not, write to *
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#ifndef GRAPHICS_OPACITY_DROP_SHADOW_EFFECT_H
-#define GRAPHICS_OPACITY_DROP_SHADOW_EFFECT_H
-
-#include <QGraphicsDropShadowEffect>
-
-class GraphicsOpacityDropShadowEffect : public QGraphicsDropShadowEffect
-{
- Q_OBJECT
- Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity USER true)
-public:
- GraphicsOpacityDropShadowEffect(QObject *parent = 0);
- ~GraphicsOpacityDropShadowEffect();
-
- qreal opacity() const;
- void setOpacity(qreal opacity);
-
- virtual void draw(QPainter *painter);
-
-private:
- qreal m_opacity;
-};
-
-#endif
diff --git a/installer/main.cpp b/installer/main.cpp
deleted file mode 100644
index 6ca8062..0000000
--- a/installer/main.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/***************************************************************************
- * Copyright © 2010-2013 Jonathan Thomas <echidnaman at kubuntu.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License or (at your option) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#include "MainWindow.h"
-
-#include <KAboutData>
-#include <KCmdLineArgs>
-#include <KStandardDirs>
-#include <KUniqueApplication>
-#include "MuonVersion.h"
-#include <stdio.h>
-
-static const char description[] =
- I18N_NOOP("An application manager");
-
-int main(int argc, char **argv)
-{
- KAboutData about("muoninstaller", "muon-installer", ki18n("Muon Software Center"), version, ki18n(description),
- KAboutData::License_GPL, ki18n("©2010-2012 Jonathan Thomas"), KLocalizedString(), 0);
- about.addAuthor(ki18n("Jonathan Thomas"), KLocalizedString(), "echidnaman at kubuntu.org");
- about.setProductName("muon/installer");
-
- KCmdLineArgs::init(argc, argv, &about);
- KCmdLineOptions options;
- options.add("application <name>", KLocalizedString()); // FIXME Undocumented due to string freeze, fix for 2.1.
- options.add("backends <names>", KLocalizedString());
- KCmdLineArgs::addCmdLineOptions(options);
-
- if (!KUniqueApplication::start()) {
- fprintf(stderr, "Software Center is already running!\n");
- return 0;
- }
-
- KUniqueApplication app;
- app.setWindowIcon(QIcon::fromTheme("applications-other"));
- // Translations
- // KGlobal::locale()->insertCatalog("app-install-data"); //FIXME: Port to kf5
-// KGlobal::locale()->insertCatalog("libmuon"); //FIXME: Port to kf5
- // Needed for KIcon compatibility w/ application icons from app-install-data
- KGlobal::dirs()->addResourceDir("appicon", "/usr/share/app-install/icons/");
- app.disableSessionManagement();
-
- KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
-
- MainWindow *mainWindow = new MainWindow;
-
- if(args->isSet("application"))
- mainWindow->openApplication(args->getOption("application"));
-
- mainWindow->show();
-
- return app.exec();
-}
diff --git a/installer/muon-installer.desktop b/installer/muon-installer.desktop
deleted file mode 100644
index 0c53476..0000000
--- a/installer/muon-installer.desktop
+++ /dev/null
@@ -1,134 +0,0 @@
-[Desktop Entry]
-Name=Muon Software Center
-Name[bg]=Софтуерен център Muon
-Name[bs]=Muon softverski centar
-Name[ca]=Centre de programari Muon
-Name[ca at valencia]=Centre de programari Muon
-Name[cs]=Centrum softwaru Muon
-Name[da]=Muon softwarecenter
-Name[de]=Muon-Programmverwaltung
-Name[el]=Muon Software Center
-Name[en_GB]=Muon Software Centre
-Name[es]=Centro de software de Muon
-Name[et]=Muoni tarkvarakeskus
-Name[fi]=Muon-sovellusvalikoima
-Name[fr]=Logithèque de Muon
-Name[ga]=Lárionad Bogearraí Muon
-Name[gl]=Centro de software Muon
-Name[hu]=Muon szoftverközpont
-Name[id]=Pusat Perangkat Lunak Muon
-Name[it]=Muon Software Center
-Name[kk]=Muon бағдарлама орталығы
-Name[ko]=Muon 소프트웨어 센터
-Name[lt]=Muon programų centras
-Name[mr]=म्युओन सॉफ़्टवेअर केंद्र
-Name[nb]=Muon programvaresenter
-Name[nds]=Muon-Software-Zentrum
-Name[nl]=Muon softwarecentrum
-Name[pa]=ਮੂਓਨ ਸਾਫਟਵੇਅਰ ਸੈਂਟਰ
-Name[pl]=Centrum oprogramowania Muon
-Name[pt]=Centro de Aplicações Muon
-Name[pt_BR]=Central de aplicativos do Muon
-Name[ro]=Centrul de Aplicații Muon
-Name[ru]=Центр программ Muon
-Name[sk]=Muon softwareové centum
-Name[sl]=Programsko središče Muon
-Name[sr]=Муонов софтверски центар
-Name[sr at ijekavian]=Муонов софтверски центар
-Name[sr at ijekavianlatin]=Muonov softverski centar
-Name[sr at latin]=Muonov softverski centar
-Name[sv]=Muon programvarucentral
-Name[tr]=Muon Yazılım Merkezi
-Name[ug]=Muon يۇمشاق دېتال مەركىزى
-Name[uk]=Центр програм Muon
-Name[x-test]=xxMuon Software Centerxx
-Name[zh_CN]=Muon 软件中心
-Name[zh_TW]=Muon 軟體中心
-Exec=muon-installer %i -caption %c
-Icon=applications-other
-Type=Application
-X-DocPath=muon/index.html
-GenericName=Software Center
-GenericName[bg]=Софтуерен център
-GenericName[bs]=Softverski centar
-GenericName[ca]=Centre de programari
-GenericName[ca at valencia]=Centre de programari
-GenericName[cs]=Centrum softwaru
-GenericName[da]=Softwarecenter
-GenericName[de]=Programmverwaltung
-GenericName[el]=Κέντρο λογισμικού
-GenericName[en_GB]=Software Centre
-GenericName[es]=Centro de software
-GenericName[et]=Tarkvarakeskus
-GenericName[fi]=Sovellusvalikoima
-GenericName[fr]=Logithèque
-GenericName[ga]=Lárionad Bogearraí
-GenericName[gl]=Centro de Software
-GenericName[hu]=Szoftverközpont
-GenericName[id]=Pusat Perangkat Lunak
-GenericName[it]=Software Center
-GenericName[kk]=Бағдарлама орталығы
-GenericName[ko]=소프트웨어 센터
-GenericName[lt]=Programų centras
-GenericName[mr]=सॉफ़्टवेअर केंद्र
-GenericName[nb]=Programvaresenter
-GenericName[nds]=Software-Zentrum
-GenericName[nl]=Softwarecentrum
-GenericName[pa]=ਸਾਫਟਵੇਅਰ ਸੈਂਟਰ
-GenericName[pl]=Centrum oprogramowania
-GenericName[pt]=Centro de Aplicações
-GenericName[pt_BR]=Central de aplicativos
-GenericName[ro]=Centrul de Aplicații
-GenericName[ru]=Центр программ
-GenericName[sk]=Softwareové centum
-GenericName[sl]=Programsko središče
-GenericName[sr]=Софтверски центар
-GenericName[sr at ijekavian]=Софтверски центар
-GenericName[sr at ijekavianlatin]=Softverski centar
-GenericName[sr at latin]=Softverski centar
-GenericName[sv]=Programvarucentral
-GenericName[tr]=Yazılım Merkezi
-GenericName[ug]=يۇمشاق دېتال مەركىزى
-GenericName[uk]=Центр програм
-GenericName[x-test]=xxSoftware Centerxx
-GenericName[zh_CN]=软件中心
-GenericName[zh_TW]=軟體中心
-Categories=Qt;KDE;System;
-Keywords=program;software;repository;package;install;remove;update;apps;applications;
-Keywords[bg]=програма;софтуер;хранилище;пакет;инсталиране;премахване;обновяване;приложение;приложения;
-Keywords[ca]=programa;programari;repositori;paquet;instal·la;suprimeix;actualitza;apps;aplicacions;
-Keywords[ca at valencia]=programa;programari;repositori;paquet;instal·la;suprimeix;actualitza;apps;aplicacions;
-Keywords[cs]=program;software;repozitář;balíček;instalovat;odstranit;aktualizovat;programy;aplikace;
-Keywords[da]=program,software,repository,softwarekilde,pakke,installere,fjerne,apps,applikationer,opdatere;
-Keywords[de]=Programm;Software;Archiv;Repository;Paket;Installieren;Entfernen;Aktualisieren;deb;Programme;Anwendungen;
-Keywords[el]=πρόγραμμα;λογισμικό;αποθετήριο;πακέτο;εγκατάσταση;αφαίρεση;ενημέρωση;εφαρμογές;
-Keywords[en_GB]=program;software;repository;package;install;remove;update;apps;applications;
-Keywords[es]=programa;software;repositorio;paquete;instalar;eliminar;actualizar;apps;aplicaciones;
-Keywords[et]=programm,rakendus,tarkvara,hoidla,pakk,pakett,paigaldamine,installimine,eemaldamine,uuendamine,rakendused,deb
-Keywords[fi]=program;software;repository;package;install;remove;update;apps;applications;ohjelma;ohjelmisto;ohjelmalähde;lähteet;arkisto;paketti;asenna;poista;päivitä;sovellukset;
-Keywords[fr]=programme ; logiciel ; dépôt ; archive ; paquet ; installation ; suppression ; mise à jour ; deb
-Keywords[hu]=program;szoftver;tároló;csomag;telepítés;eltávolítás;frissítés;appok;alkalmazások;
-Keywords[id]=program;perangkat lunak;repositori;paket;pasang;buang;perbarui;apl;aplikasi;
-Keywords[it]=programma,software,deposito,pacchetto,installa,rimuovi,aggiorna,app;applicazioni;
-Keywords[ko]=program,software,repository,archive,package,install,remove,update,deb,프로그램,소프트웨어,저장소,리포지토리,패키지,꾸러미,설치,삭제,업데이트
-Keywords[lt]=programos,programinė įranga,saugykla,archyvas,paketas,įdiegti,pašalinti,atnaujinti;
-Keywords[nb]=program;programvare;pakkebrønn;pakke;installere;fjerne;oppdatere;app;apper
-Keywords[nds]=programm;software;repository;archiev,paket;installeren;wegmaken;opfrischen;update;apps;programmen;
-Keywords[nl]=programma;software;opslagruimte;pakket;installeren;verwijderen;bijwerken;apps;toepassingen;applicaties;
-Keywords[pl]=program,oprogramowanie,repozytorium,archiwum,pakiet,paczka,instaluj,zainstaluj,usuń,odinstaluj,uaktualnij,aktualizuj,programy,aplikacje,deb
-Keywords[pt]=programa;software;repositório;arquivo;pacote;instalar;remover;actualizar;deb;aplicações;
-Keywords[pt_BR]=programa;software;repositório;pacote;instalar;instalação;remover;atualizar;aplicativos;apps;aplicações;
-Keywords[ro]=program;software;depozit;arhivă;pachet;instalare;elimină;actualizare;aplicații;
-Keywords[ru]=program;software;repository;package;install;remove;update;apps;applications;программа;приложение;репозиторий;пакет;установка;удаление;deb
-Keywords[sk]=program;softvér;repozitár;archív;balík;inštalácia;odstránenie;appky;aplikácie;aktualizácia;
-Keywords[sl]=program;programska oprema;skladišče;paket;namesti;odstrani;posodobi;programi;
-Keywords[sr]=program;software;repository;package;install;remove;update;apps;applications;програм;софтвер;ризница;пакет;инсталирати;уклонити;ажурирати;
-Keywords[sr at ijekavian]=program;software;repository;package;install;remove;update;apps;applications;програм;софтвер;ризница;пакет;инсталирати;уклонити;ажурирати;
-Keywords[sr at ijekavianlatin]=program;software;repository;package;install;remove;update;apps;applications;program;softver;riznica;paket;instalirati;ukloniti;ažurirati;
-Keywords[sr at latin]=program;software;repository;package;install;remove;update;apps;applications;program;softver;riznica;paket;instalirati;ukloniti;ažurirati;
-Keywords[sv]=program;programvara;arkiv;paket;installera;ta bort;uppdatera;appar;program;
-Keywords[tr]=uygulama;yazılım;depo;paket;kur;kaldır;güncelle;uygulamalar;yüklemeler;
-Keywords[uk]=program;software;repository;package;install;remove;update;app;apps;applications;програма;програмне забезпечення;сховище;архів;пакунок;встановити;встановлення;вилучити;вилучення;оновлення;оновити;
-Keywords[x-test]=xxprogram;software;repository;package;install;remove;update;apps;applications;xx
-Keywords[zh_CN]=program;software;repository;package;install;remove;update;apps;applications;程序;软件;软件源;包;安装;移除;升级;应用程序
-Keywords[zh_TW]=program;software;repository;package;install;remove;update;apps;applications;
diff --git a/installer/muon-installerui.rc b/installer/muon-installerui.rc
deleted file mode 100644
index 3e7e8e8..0000000
--- a/installer/muon-installerui.rc
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gui name="muon-installer"
- version="1"
- xmlns="http://www.kde.org/standards/kxmlgui/1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
- http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd">
- <MenuBar>
- <Menu name="file" >
- <Action name="open_markings" />
- <Separator/>
- <Action name="save_markings" />
- <Separator/>
- <Action name="file_quit" />
- </Menu>
- <Menu name="settings">
- <Separator />
- <Action name="software_properties" />
- </Menu>
- </MenuBar>
-</gui>
diff --git a/installer/qml/qml/ClickableImage.qml b/installer/qml/qml/ClickableImage.qml
deleted file mode 100644
index bc0932f..0000000
--- a/installer/qml/qml/ClickableImage.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright (C) 2011 Jonathan Thomas <echidnaman at kubuntu.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) version 3, or any
- later version accepted by the membership of KDE e.V. (or its
- successor approved by the membership of KDE e.V.), Nokia Corporation
- (or its successors, if any) and the KDE Free Qt Foundation, which shall
- act as a proxy defined in Section 6 of version 3 of the license.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-import QtQuick 2.1
-import MuonMobile 1.0
-
-Image {
- id: image
- fillMode: Image.PreserveAspectFit
- asynchronous: true
- opacity: 0.0
- visible: true
-
- signal buttonClicked
-
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton
- Component.onCompleted: clicked.connect(parent.buttonClicked)
- }
-
- MouseCursor {
- anchors.fill: parent
- shape: Qt.PointingHandCursor
- }
-
- transitions: Transition {
- from: "*"
- to: "loaded"
- PropertyAnimation { target: image; property: "opacity"; duration: 500 }
- }
-
- states: [
- State {
- name: 'loaded'
- when: image.status == Image.Ready
- PropertyChanges { target: image; opacity: 1.0 }
- }
- ]
-}
diff --git a/installer/qml/qml/ThumbnailView.qml b/installer/qml/qml/ThumbnailView.qml
deleted file mode 100644
index c42a335..0000000
--- a/installer/qml/qml/ThumbnailView.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Copyright (C) 2011 Jonathan Thomas <echidnaman at kubuntu.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) version 3, or any
- later version accepted by the membership of KDE e.V. (or its
- successor approved by the membership of KDE e.V.), Nokia Corporation
- (or its successors, if any) and the KDE Free Qt Foundation, which shall
- act as a proxy defined in Section 6 of version 3 of the license.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-import QtQuick 2.1
-import Effects 1.0
-
-Rectangle {
- id: rectangle1
- width: 170
- height: 130
-
- property alias source: image.source
- signal thumbnailClicked()
- signal thumbnailLoaded()
-
- ClickableImage {
- id: image
- width: 160
- height: 120
-
- effect: DropShadow {
- blurRadius: 10
- }
-
- onStatusChanged: {
- if (image.status == Image.Error)
- view.hide()
- else if (image.status == Image.Ready)
- parent.thumbnailLoaded()
- }
- onButtonClicked: parent.thumbnailClicked()
- }
-}
diff --git a/installer/qml/src/mousecursor.cpp b/installer/qml/src/mousecursor.cpp
deleted file mode 100644
index efc01a9..0000000
--- a/installer/qml/src/mousecursor.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Copyright (C) 2011 Harald Sitter <sitter at kde.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) version 3, or any
- later version accepted by the membership of KDE e.V. (or its
- successor approved by the membership of KDE e.V.), Nokia Corporation
- (or its successors, if any) and the KDE Free Qt Foundation, which shall
- act as a proxy defined in Section 6 of version 3 of the license.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "mousecursor.h"
-
-MouseCursor::MouseCursor()
-{
-}
-
-Qt::CursorShape MouseCursor::cursorShape() const
-{
- return cursor().shape();
-}
-
-void MouseCursor::setCursorShape(Qt::CursorShape shape)
-{
- setCursor(QCursor(shape));
- emit cursorShapeChanged();
-}
-
-void MouseCursor::reset()
-{
- setCursor(QCursor());
-}
diff --git a/installer/qml/src/mousecursor.h b/installer/qml/src/mousecursor.h
deleted file mode 100644
index 8feabe1..0000000
--- a/installer/qml/src/mousecursor.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright (C) 2011 Harald Sitter <sitter at kde.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) version 3, or any
- later version accepted by the membership of KDE e.V. (or its
- successor approved by the membership of KDE e.V.), Nokia Corporation
- (or its successors, if any) and the KDE Free Qt Foundation, which shall
- act as a proxy defined in Section 6 of version 3 of the license.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef MOUSECURSOR_H
-#define MOUSECURSOR_H
-
-#include <QtDeclarative/QDeclarativeItem>
-
-class MouseCursor : public QDeclarativeItem
-{
- Q_OBJECT
- Q_PROPERTY(Qt::CursorShape shape READ cursorShape WRITE setCursorShape NOTIFY cursorShapeChanged)
-public:
- MouseCursor();
-
- Qt::CursorShape cursorShape() const;
- void setCursorShape(Qt::CursorShape shape);
-
- Q_INVOKABLE void reset();
-
-signals:
- void cursorShapeChanged();
-};
-
-#endif // MOUSECURSOR_H
More information about the kubuntu-devel
mailing list