Skip to content

Commit

Permalink
initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Jul 21, 2018
0 parents commit d593f62
Show file tree
Hide file tree
Showing 57 changed files with 15,269 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Binaries and build artifacts
build/*
bin/*
*.o
qrc_resources.cpp

# QtCreator temporary project files
OffloadBuddy.config
OffloadBuddy.creator*
OffloadBuddy.files
OffloadBuddy.includes

# QMake temporary project files
OffloadBuddy.pro.*
Makefile
.qmake.stash

# Others
stash/*
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions OffloadBuddy.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
TARGET = OffloadBuddy
VERSION = 0.1.0

CONFIG += c++14
QT += core gui svg
QT += quick quickcontrols2

# Features
#DEFINES += ENABLE_LIBMTP
#DEFINES += ENABLE_FFMPEG

# Validate Qt version
if (lessThan(QT_MAJOR_VERSION, 5) | lessThan(QT_MINOR_VERSION, 7)) {
error("You need Qt 5.7 to build $${TARGET}...")
}

# Build artifacts
OBJECTS_DIR = build/
MOC_DIR = build/
RCC_DIR = build/
UI_DIR = build/
DESTDIR = bin/

# Sources ######################################################################

SOURCES += src/main.cpp \
src/SettingsManager.cpp \
src/DeviceManager.cpp \
src/Device.cpp \
src/Shot.cpp

HEADERS += src/SettingsManager.h \
src/DeviceManager.h \
src/Device.h \
src/Shot.h

RESOURCES += qml.qrc \
resources.qrc

include(src/thirdparty/SingleApplication/singleapplication.pri)
DEFINES += QAPPLICATION_CLASS=QApplication

# OS icons (macOS and Windows)
ICON = resources/app/$$lower($${TARGET}).icns
RC_ICONS = resources/app/$$lower($${TARGET}).ico

# Build ########################################################################

unix {
contains(DEFINES, ENABLE_LIBMTP) {
CONFIG += link_pkgconfig
PKGCONFIG += libusb-1.0 libmtp

#LIBS += `pkg-config --libs libusb-1.0 libmtp`
#INCLUDEPATH += `pkg-config --cflags libusb-1.0 libmtp`
}

contains(DEFINES, ENABLE_FFMPEG) {
CONFIG += link_pkgconfig
PKGCONFIG += libavutil libavparser libavcodec
}
}

DEFINES += QT_DEPRECATED_WARNINGS

# Additional import path used to resolve QML modules
QML_IMPORT_PATH = qml/
QML_DESIGNER_IMPORT_PATH = qml/

# Deploy #######################################################################
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
OffloadBuddy
============

[![License: GPL v3](https://img.shields.io/badge/license-GPL%20v3-blue.svg&style=flat-square)](http://www.gnu.org/licenses/gpl-3.0)


## Introduction

OffloadBuddy remove the hassle of handling and transfering the many videos and pictures file from your action cameras.


### Screenshots!

![GUI1](https://i.imgur.com/2w9V8uA.png)


## Documentation

### Dependencies

You will need a C++14 capable compiler and Qt 5.7+


### Building OffloadBuddy

> $ cd OffloadBuddy/
> $ qmake
> $ make

## Licensing

OffloadBuddy 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.
[Consult the licence on the FSF website](http://www.gnu.org/licenses/gpl-3.0.txt).

Emeric Grange <[email protected]>


## Special thanks

* Mickael Heudre <[email protected]> for his invaluable QML expertise!
* Many icons are from [Faience](https://tiheum.deviantart.com/art/Faience-icon-theme-255099649) and [Boston](https://diazchris.deviantart.com/art/Boston-Icons-558741523) icons themes.


## Get involved!

### Developers

You can browse the code here on GitHub, submit patches and pull requests! Your help would be greatly appreciated ;-)

### Users

You can help us finding bugs, proposing new features and more! Visit the "Issues" section in the GitHub menu to start.

Empty file added bin/.gitkeep
Empty file.
Empty file added build/.gitkeep
Empty file.
Empty file added deploy_linux.sh
Empty file.
Empty file added deploy_macos.sh
Empty file.
Empty file added deploy_windows.sh
Empty file.
14 changes: 14 additions & 0 deletions qml.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<RCC>
<qresource prefix="/">
<file>qml/themes.qml</file>
<file>qml/main.qml</file>
<file>qml/ScreenMedias.qml</file>
<file>qml/ScreenDevice.qml</file>
<file>qml/ScreenSettings.qml</file>
<file>qml/ItemDeviceMenu.qml</file>
<file>qml/ItemMediaDirectory.qml</file>
<file>qml/ScreenAbout.qml</file>
<file>qml/ItemShot.qml</file>
<file>qml/SpaceUtils.js</file>
</qresource>
</RCC>
58 changes: 58 additions & 0 deletions qml/ItemDeviceMenu.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import QtQuick 2.0
import QtQuick.Controls 2.3

import com.offloadbuddy.style 1.0

Rectangle {
id: itemDeviceMenu
width: 80
height: 80
color: "#00000000"
//color: "#ff6464"
anchors.horizontalCenter: parent.horizontalCenter

property var myDevice
signal myDeviceClicked(var devicePtr)

Image {
id: deviceImage
width: 64
height: 64
anchors.horizontalCenterOffset: 0
anchors.topMargin: 4
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
fillMode: Image.PreserveAspectCrop
source: "qrc:/resources/menus/device.svg"
}

Text {
id: deviceText
height: 16
color: "#ffffff"
text: myDevice.model
font.bold: true
font.pixelSize: 10
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter

anchors.left: parent.left
anchors.leftMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
}

MouseArea {
id: deviceClick
anchors.fill: parent
onClicked: {
//console.log("SIDEBAR deviceClick: " + myDevice.serial);
itemDeviceMenu.myDeviceClicked(myDevice)

imageArrow.anchors.verticalCenter= undefined
imageArrow.y = menuDevice.y + itemDeviceMenu.y + 32
}
}
}
172 changes: 172 additions & 0 deletions qml/ItemMediaDirectory.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
import QtQuick 2.8
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.1

import com.offloadbuddy.style 1.0
import "SpaceUtils.js" as SpaceUtils

Rectangle {
id: itemMediaDirectory
height: 48
width: parent.width

property var directory
property bool directoryAvailable: directory.available
property var settingsMgr

signal chooseClicked()
signal scanClicked()
signal deleteClicked()

Component.onCompleted: {
if (directory.available === false)
itemMediaDirectory.color = ThemeEngine.colorWarning
else
itemMediaDirectory.color = "white"
}
onDirectoryAvailableChanged: {
if (directory.available === false)
itemMediaDirectory.color = ThemeEngine.colorWarning
else
itemMediaDirectory.color = "white"
}

Rectangle {
id: rectangleDelete
width: 40
height: 40
color: ThemeEngine.colorDangerZone
anchors.right: parent.right
anchors.rightMargin: 4
anchors.verticalCenter: parent.verticalCenter

MouseArea {
id: mouseAreaDelete
anchors.fill: parent
onClicked: settingsMgr.deleteDirectory(textField_path.text)

onPressed: {
rectangleDelete.anchors.bottomMargin = rectangleDelete.anchors.bottomMargin + 2
rectangleDelete.anchors.leftMargin = rectangleDelete.anchors.leftMargin + 2
rectangleDelete.anchors.rightMargin = rectangleDelete.anchors.rightMargin + 2
rectangleDelete.width = rectangleDelete.width - 4
rectangleDelete.height = rectangleDelete.height - 4
}
onReleased: {
rectangleDelete.anchors.bottomMargin = rectangleDelete.anchors.bottomMargin - 2
rectangleDelete.anchors.leftMargin = rectangleDelete.anchors.leftMargin - 2
rectangleDelete.anchors.rightMargin = rectangleDelete.anchors.rightMargin - 2
rectangleDelete.width = rectangleDelete.width + 4
rectangleDelete.height = rectangleDelete.height + 4
}
}

Text {
id: textDelete
color: ThemeEngine.colorButtonText
text: qsTr("X")
anchors.fill: parent
font.bold: true
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 24
}
}

ProgressBar {
id: progressBar
y: 20
height: 20
anchors.right: rectangleDelete.left
anchors.rightMargin: 16
anchors.left: button_scan.right
anchors.leftMargin: 16
anchors.verticalCenter: parent.verticalCenter
value: directory.spaceUsedPercent
}

ComboBox {
id: comboBox_content
width: 140
height: 40
anchors.left: textField_path.right
anchors.leftMargin: 16
anchors.verticalCenter: parent.verticalCenter

model: ListModel {
id: cbItemsContent
ListElement { text: qsTr("all medias"); }
ListElement { text: qsTr("videos"); }
ListElement { text: qsTr("pictures"); }
}
Component.onCompleted: {
currentIndex = directory.directoryContent;
if (currentIndex === -1) { currentIndex = 0 }
}
property bool cbinit: false
onCurrentIndexChanged: {
if (cbinit) {
directory.directoryContent = currentIndex;
settingsMgr.directoryModified();
} else
cbinit = true;
}
}

Button {
id: button_scan
text: qsTr("SCAN")
enabled: false
anchors.left: comboBox_content.right
anchors.leftMargin: 16
anchors.verticalCenterOffset: 0
anchors.verticalCenter: parent.verticalCenter
}

TextField {
id: textField_path
width: 400
height: 40
text: directory.directoryPath
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 4

FileDialog {
id: fileDialogChange
title: qsTr("Please choose a destination directory!")
sidebarVisible: true
selectExisting: true
selectMultiple: false
selectFolder: true

onAccepted: {
directory.directoryPath = SpaceUtils.urlToPath(fileDialogChange.fileUrl.toString());
settingsMgr.directoryModified();
}
}

Button {
id: button_change
x: 328
y: 8
width: 80
height: 24
text: qsTr("change")
anchors.right: parent.right
anchors.rightMargin: 8
anchors.verticalCenter: parent.verticalCenter

MouseArea {
anchors.fill: parent
onClicked: {
console.log("fileDialog.folder: " + fileDialogChange.folder)
console.log("textField_path.text: " + textField_path.text)

fileDialogChange.folder = "file://" + textField_path.text
fileDialogChange.open()
}
}
}
}
}
Loading

0 comments on commit d593f62

Please sign in to comment.