Commit a7c0eb7f authored by camilo higuita's avatar camilo higuita

merge changes

parents d62719ba bc64b1a0
mauikit/
3rdparty/kirigami
3rdparty/breeze-icons
3rdparty/mauikit
.directory
*.kdev4
......
......@@ -2,20 +2,17 @@ QT += qml
QT += quick
QT += sql
CONFIG += c++11
TARGET = index
CONFIG += c++17
QMAKE_LINK += -nostdlib++
#DESTDIR = $$OUT_PWD/../
linux:unix:!android {
message(Building for Linux KDE)
include($$PWD/src/kde/kde.pri)
} else:android {
message(Building helpers for Android)
include($$PWD/mauikit/mauikit.pri)
include($$PWD/3rdparty/kirigami/kirigami.pri)
include($$PWD/3rdparty/mauikit/mauikit.pri)
DEFINES += STATIC_KIRIGAMI
......@@ -38,9 +35,12 @@ SOURCES += \
$$PWD/src/main.cpp \
$$PWD/src/index.cpp \
HEADERS += \
$$PWD/src/index.h \
$$PWD/src/inx.h \
RESOURCES += \
$$PWD/src/qml.qrc \
# $$PWD/src/assets.qrc \
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
......@@ -53,11 +53,19 @@ qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \
$$PWD/src/index.h \
$$PWD/src/inx.h \
include($$PWD/install.pri)
DISTFILES += \
$$PWD/org.kde.index.desktop
$$PWD/org.kde.index.desktop \
3rdparty/mauikit/src/android/AndroidManifest.xml \
3rdparty/mauikit/src/android/build.gradle \
3rdparty/mauikit/src/android/gradle/wrapper/gradle-wrapper.jar \
3rdparty/mauikit/src/android/gradle/wrapper/gradle-wrapper.properties \
3rdparty/mauikit/src/android/gradlew \
3rdparty/mauikit/src/android/gradlew.bat \
3rdparty/mauikit/src/android/res/values/libs.xml
contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
ANDROID_PACKAGE_SOURCE_DIR = \
$$PWD/3rdparty/mauikit/src/android
}
......@@ -2,6 +2,7 @@
#include <QFileInfo>
#include <QDir>
#include <QDebug>
#include <QUrl>
Index::Index(QObject *parent) : QObject(parent) {}
......@@ -10,12 +11,17 @@ void Index::openPaths(const QStringList &paths)
{
emit this->openPath(std::accumulate(paths.constBegin(), paths.constEnd(), QStringList(), [](QStringList &list, const QString &path) -> QStringList
{
const QFileInfo file(path);
if(file.isDir())
list << path;
else
list << file.dir().absolutePath();
const auto url = QUrl::fromUserInput(path);
if(url.isLocalFile())
{
const QFileInfo file(url.toLocalFile());
if(file.isDir())
list << url.toString();
else
list << QUrl::fromLocalFile(file.dir().absolutePath()).toString();
}else
list << url.toString();
return list;
}));
return list;
}));
}
*.pro.user
*.*~
~*.*
QT += KService KNotifications KNotifications KI18n
QT += KIOCore KIOFileWidgets KIOWidgets KNTLM
desktop.files += $$PWD../../org.kde.index.desktop
desktop.path += /usr/share/applications
INSTALLS += desktop
DISTFILES += \
$$PWD/kde.pri
HEADERS += \
$$PWD/kde.h \
$$PWD/notify.h
SOURCES += \
$$PWD/notify.cpp
LIBS += -lMauiKit
/***
Pix Copyright (C) 2018 Camilo Higuita
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
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 3 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 "notify.h"
Notify::Notify(QObject *parent) : QObject(parent)
{}
Notify::~Notify()
{
qDebug()<<"DELETING KNOTIFY";
}
void Notify::notify(const QString &title, const QString &body)
{
// notification->setComponentName(QStringLiteral("Babe"));
auto notification = new KNotification(QStringLiteral("Notify"),KNotification::CloseOnTimeout, this);
connect(notification, &KNotification::closed, notification, &KNotification::deleteLater);
notification->setTitle(QStringLiteral("%1").arg(title));
notification->setText(QStringLiteral("%1").arg(body));
notification->sendEvent();
}
/***
Pix Copyright (C) 2018 Camilo Higuita
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
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 3 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 NOTIFY_H
#define NOTIFY_H
#include <QObject>
#include <QByteArray>
#include <klocalizedstring.h>
#include <knotifyconfig.h>
#include <knotification.h>
#include <QStandardPaths>
#include <QPixmap>
#include <QDebug>
#include <QMap>
class Notify : public QObject
{
Q_OBJECT
public:
explicit Notify(QObject *parent = nullptr);
~Notify();
void notify(const QString &title, const QString &body);
private:
};
#endif // NOTIFY_H
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QIcon>
#include <QCommandLineParser>
#include <QFileInfo>
#include <QDebug>
#include "index.h"
#include "inx.h"
......@@ -16,7 +14,11 @@
#endif
#ifdef STATIC_KIRIGAMI
#include "./../3rdparty/kirigami/src/kirigamiplugin.h"
#include "3rdparty/kirigami/src/kirigamiplugin.h"
#endif
#ifdef STATIC_MAUIKIT
#include "3rdparty/mauikit/src/mauikit.h"
#endif
int main(int argc, char *argv[])
......@@ -47,19 +49,6 @@ int main(int argc, char *argv[])
if(!args.isEmpty())
paths = args;
Index index;
QQmlApplicationEngine engine;
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, [&]()
{
if(!paths.isEmpty())
index.openPaths(paths);
});
auto context = engine.rootContext();
context->setContextProperty("inx", &index);
#ifdef STATIC_KIRIGAMI
KirigamiPlugin::getInstance().registerTypes();
#endif
......@@ -68,18 +57,22 @@ int main(int argc, char *argv[])
MauiKit::getInstance().registerTypes();
#endif
#ifndef Q_OS_ANDROID
// QStringList importPathList = engine.importPathList();
// importPathList.prepend(QCoreApplication::applicationDirPath() + "/kde/qmltermwidget");
// engine.setImportPathList(importPathList);
// QQuickStyle::setStyle("material");
#endif
Index index;
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url, paths, &index](QObject *obj, const QUrl &objUrl)
{
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
// QQuickStyle::setStyle("Material");
if(!paths.isEmpty())
index.openPaths(paths);
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
}, Qt::QueuedConnection);
auto context = engine.rootContext();
context->setContextProperty("inx", &index);
engine.load(url);
return app.exec();
}
......@@ -13,7 +13,7 @@ Maui.ApplicationWindow
{
id: root
title: browser.browser.currentPath
// property alias browser: browserView.browser
// property alias browser: browserView.browser
property alias browser: _browserList.currentItem
showAccounts: false
about.appDescription: qsTr("Index is a file manager that works on desktops, Android and Plasma Mobile. Index lets you browse your system files and applications and preview your music, text, image and video files and share them with external applications.")
......@@ -23,9 +23,9 @@ Maui.ApplicationWindow
property bool searchBar: false
// accentColor: "#303952"
// accentColor: "#303952"
// highlightColor: "#64B5F6"
// altColorText: "#ffffff"
// altColorText: "#ffffff"
// headBarBGColor: "#64B5F6"
// headBarFGColor: altColorText
// headBar.colorScheme.borderColor: Qt.darker(headBarBGColor, 1.4)
......@@ -44,16 +44,16 @@ Maui.ApplicationWindow
// headBar.drawBorder: false
// footBar.visible: false
headBar.leftContent: ToolButton
{
visible: _drawer.modal
icon.name: "view-right-new"
onClicked: _drawer.visible = !_drawer.visible
checkable: true
checked: _drawer.visible
}
// headBar.leftContent: ToolButton
// {
// visible: _drawer.modal
// icon.name: "view-right-new"
// onClicked: _drawer.visible = !_drawer.visible
// checkable: true
// checked: _drawer.visible
// }
leftIcon.visible: false
// leftIcon.visible: false
// leftIcon.onClicked: _drawer.visible = !_drawer.visible
// leftIcon.checkable: true
// leftIcon.checked: _drawer.visible
......@@ -85,7 +85,7 @@ Maui.ApplicationWindow
{
anchors.fill: parent
placeholderText: qsTr("Search for files... ")
onAccepted: browser.browser.openFolder("Search/"+text)
onAccepted: browser.openFolder("search://"+text)
// onCleared: browser.goBack()
onGoBackTriggered:
{
......@@ -112,11 +112,11 @@ Maui.ApplicationWindow
Layout.margins: space.medium
Layout.preferredHeight: iconSizes.big
sourceComponent: searchBar ? _searchFieldComponent : _pathBarComponent
// onLoaded:
// {
// if(sourceComponent === _pathBarComponent)
// item.url =browser.currentPath
// }
// onLoaded:
// {
// if(sourceComponent === _pathBarComponent)
// item.url =browser.currentPath
// }
}
Loader
......@@ -128,8 +128,10 @@ Maui.ApplicationWindow
{
id: _drawer
width: Math.min(Kirigami.Units.gridUnit * 11, root.width)
// height: 200 /*- root.header.height - browser.header.height*/
// y: 0
handleClosedIcon.source: "view-right-new"
handleOpenIcon.source: "view-right-new"
// height: 200 /*- root.header.height - browser.header.height*/
// y: 0
height: root.height - root.header.height - (browser.browser.headBar.position === ToolBar.Footer && _drawer.modal ? browser.browser.footer.height : 0)
modal: !root.isWide
handleVisible: modal
......@@ -182,8 +184,8 @@ Maui.ApplicationWindow
TabBar
{
id: tabsBar
anchors.fill: parent
// currentIndex : _editorList.currentIndex
anchors.fill: parent
// currentIndex : _editorList.currentIndex
clip: true
ListModel { id: tabsListModel }
......@@ -331,8 +333,7 @@ Maui.ApplicationWindow
Component.onCompleted:
{
if(isAndroid)
Maui.Android.statusbarColor(backgroundColor, true)
Maui.Android.statusbarColor(Kirigami.Theme.backgroundColor, true)
openTab(Maui.FM.homePath())
}
......@@ -359,7 +360,8 @@ Maui.ApplicationWindow
}
}
function setTabMetadata(filepath) {
function setTabMetadata(filepath)
{
tabsListModel.setProperty(tabsBar.currentIndex, "path", filepath)
}
}
import QtQuick 2.9
import QtQuick.Controls 2.12
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
import org.kde.mauikit 1.0 as Maui
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment