Verified Commit 080e7426 authored by azubieta's avatar azubieta
Browse files

Merge branch 'development'

parents 99eabd2b 2af103b3
Pipeline #1412 passed with stages
in 19 minutes and 22 seconds
......@@ -56,7 +56,7 @@ build:debian_buster_pkg:
script:
- cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .
- make -j`nproc`
- cpack -G DEB -G DEB -R 1.0.0-debian-buster
- cpack -G DEB -G DEB -R 1.0.1-debian-buster
artifacts:
paths:
- appimage-installer*.deb
......@@ -79,7 +79,7 @@ build:ubuntu_bionic_pkg:
script:
- cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .
- make -j`nproc`
- cpack -G DEB -G DEB -R 1.0.0-ubuntu-bionic
- cpack -G DEB -G DEB -R 1.0.1-ubuntu-bionic
artifacts:
expire_in: 1 year
paths:
......
......@@ -2,7 +2,7 @@
projectname=appimage-installer
pkgname=appimage-installer
pkgver=1.0.0
pkgver=1.0.1
pkgrel=1
epoch=
pkgdesc="AppImage Installer"
......
......@@ -15,4 +15,4 @@ fi
mkdir docker-build-release
sudo docker run -v ${PWD}:/source -v ${PWD}/docker-build-release:/build ${DOCKER_IMAGE} \
/bin/bash -c "cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j`nproc` && cpack -G DEB -G DEB -R 1.0.0-debian-buster"
/bin/bash -c "cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j`nproc` && cpack -G DEB -G DEB -R 1.0.1-debian-buster"
......@@ -15,4 +15,4 @@ fi
mkdir docker-build-release
sudo docker run -v ${PWD}:/source -v ${PWD}/docker-build-release:/build ${DOCKER_IMAGE} \
/bin/bash -c "cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j`nproc` && cpack -G DEB -R 1.0.0-ubuntu-bionic"
/bin/bash -c "cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j`nproc` && cpack -G DEB -R 1.0.1-ubuntu-bionic"
cmake_minimum_required(VERSION 3.8)
project(appimage-installer VERSION 1.0.0)
project(appimage-installer VERSION 1.0.1)
set(CMAKE_CXX_STANDARD 11)
......
......@@ -4,7 +4,7 @@
set(APPIMAGE_INSTALLER_V_MAJOR 1)
set(APPIMAGE_INSTALLER_V_MINOR 0)
set(APPIMAGE_INSTALLER_V_PATCH 0)
set(APPIMAGE_INSTALLER_V_PATCH 1)
set(APPIMAGE_INSTALLER_VERSION ${APPIMAGE_INSTALLER_V_MAJOR}.${APPIMAGE_INSTALLER_V_MINOR}.${APPIMAGE_INSTALLER_V_PATCH}${APPIMAGE_INSTALLER_V_SUFFIX})
......
install(FILES appimage_logo.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps COMPONENT APPIMAGE_INSTALLER)
install(FILES org.appimage.user-tool.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT APPIMAGE_INSTALLER)
install(FILES org.appimage.user-tool-settings.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT APPIMAGE_INSTALLER)
# Sources settings
install(FILES appimage-providers.yaml DESTINATION /etc COMPONENT APPIMAGE_INSTALLER)
......
[Desktop Entry]
Version=1.0
Type=Application
Name=appimage-installer-settings
Comment=Configure AppImage providers
TryExec=appimage-installer-settings
Exec=appimage-installer-settings %F
Icon=appimage_logo
Categories=Utility;
include(utils.cmake)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed
......@@ -13,7 +11,6 @@ endif()
add_subdirectory(core)
add_subdirectory(cli)
add_subdirectory(settings)
# Install libappimage with the main executable
if(INSTALL_LIBAPPIMAGE)
......
......@@ -9,15 +9,13 @@ set(
commands/UpdateCommand.cpp
)
add_executable(app ${APP_SRCS} $<TARGET_OBJECTS:settings-common> $<TARGET_OBJECTS:core>)
configure_module(app)
add_executable(app ${APP_SRCS})
target_include_directories(app PUBLIC $<TARGET_PROPERTY:core,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(app PUBLIC $<TARGET_PROPERTY:settings-common,INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(
app
PRIVATE core
PRIVATE Qt5::Core
PRIVATE Qt5::Network
PRIVATE KF5::Attica
......@@ -27,7 +25,7 @@ target_link_libraries(
PRIVATE AppImageUpdaterBridge
)
add_dependencies(app core settings-common)
add_dependencies(app core)
# Install
install(
......
......@@ -8,7 +8,7 @@
#include "commands/ListCommand.h"
#include "commands/RemoveCommand.h"
#include "commands/UpdateCommand.h"
#include "settings/Settings.h"
#include "Settings.h"
Command* createCommand(QStringList& args, Settings& settings);
......@@ -21,13 +21,13 @@ int main(int argc, char** argv) {
parser.addOption({"verbose", QCoreApplication::translate("cli-main", "Show debug messages")});
parser.setApplicationDescription(
QCoreApplication::translate("cli-main",
"Command details\n"
" search <query> list applications available in the store\n"
" install <STORE ID> get the application with the given store id\n"
" list list applications available on your system\n"
" update <APP ID> update if possible the given application\n"
" remove <APP ID> remove the application from your system"));
QCoreApplication::translate("cli-main",
"Command details\n"
" search <query> list applications available in the store\n"
" install <STORE ID> get the application with the given store id\n"
" list list applications available on your system\n"
" update <APP ID> update if possible the given application\n"
" remove <APP ID> remove the application from your system"));
parser.addVersionOption();
parser.addHelpOption();
......@@ -67,6 +67,8 @@ int main(int argc, char** argv) {
case QtFatalMsg:
msgPrefix = "Fatal";
break;
default:
msgPrefix = "";
}
fprintf(stderr, "%s: %s", msgPrefix, localMsg.constData());
......
add_library(
core OBJECT
core STATIC
Download.cpp
FileDownload.cpp
AppsLibrary.cpp
Console.cpp
Settings.cpp
)
configure_module(core)
target_include_directories(core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(
core
PRIVATE yaml-cpp
PRIVATE Qt5::Core
PRIVATE Qt5::Network
)
\ No newline at end of file
# Common settings module
add_library(settings-common OBJECT Settings.cpp Settings.h)
configure_module(settings-common)
target_include_directories(settings-common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(
appimage-installer-settings
main.cpp
SettingsDialog.h
SettingsDialog.cpp
SettingsDialog.ui
$<TARGET_OBJECTS:settings-common>
)
configure_module(appimage-installer-settings)
target_link_libraries(appimage-installer-settings PRIVATE Qt5::Core Qt5::Widgets yaml-cpp)
add_dependencies(appimage-installer-settings settings-common)
# Install
install(
TARGETS appimage-installer-settings
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT APPIMAGE_INSTALLER
)
// libary
#include <QStringListModel>
// local
#include "ui_SettingsDialog.h"
#include "SettingsDialog.h"
SettingsDialog::SettingsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SettingsDialog)
{
ui->setupUi(this);
ocsProvidersListModel.setStringList(settings.getOCSProviders());
ui->providersListView->setModel(&ocsProvidersListModel);
}
SettingsDialog::~SettingsDialog()
{
delete ui;
}
void SettingsDialog::on_providersListAddButton_released()
{
if(ocsProvidersListModel.insertRow(ocsProvidersListModel.rowCount())) {
QModelIndex index = ocsProvidersListModel.index(ocsProvidersListModel.rowCount() - 1, 0);
ocsProvidersListModel.setData(index, "... new provider url ...");
}
}
void SettingsDialog::on_providersListRemoveButton_released()
{
QModelIndexList selection = ui->providersListView->selectionModel()->selectedRows();
for (const QModelIndex &modelIndex: selection)
ocsProvidersListModel.removeRow(modelIndex.row());
}
void SettingsDialog::on_buttonBox_accepted()
{
QStringList ocsProviders = ocsProvidersListModel.stringList();
settings.setOCSProviders(ocsProviders);
}
#pragma once
// libary
#include <QStringListModel>
// local
#include <QDialog>
#include "Settings.h"
namespace Ui {
class SettingsDialog;
}
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
explicit SettingsDialog(QWidget *parent = 0);
~SettingsDialog();
private slots:
void on_providersListAddButton_released();
void on_providersListRemoveButton_released();
void on_buttonBox_accepted();
private:
Ui::SettingsDialog *ui;
Settings settings;
QStringListModel ocsProvidersListModel;
};
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>640</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>AppImage Providers</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListView" name="providersListView"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="providersListAddButton">
<property name="text">
<string>Add</string>
</property>
<property name="icon">
<iconset theme="list-add"/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="providersListRemoveButton">
<property name="text">
<string>Remove</string>
</property>
<property name="icon">
<iconset theme="list-remove-all-symbolic"/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SettingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SettingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
// library
#include <QApplication>
// local
#include "SettingsDialog.h"
int main(int argc, char** argv) {
QApplication application(argc, argv);
QApplication::setApplicationDisplayName(QApplication::tr("AppImage User Tool Settings"));
SettingsDialog dialog;
dialog.setWindowTitle(QApplication::applicationDisplayName());
dialog.show();
return QApplication::exec();
}
function(configure_module target_name)
target_include_directories(
${target_name}
PUBLIC ${PROJECT_SOURCE_DIR}/src
PUBLIC ${libappimage_INCLUDE_DIRS}
PUBLIC ${libappimage_INCLUDE_DIRS}
PUBLIC $<TARGET_PROPERTY:libappimage,INTERFACE_INCLUDE_DIRECTORIES>
PUBLIC $<TARGET_PROPERTY:Qt5::Core,INTERFACE_INCLUDE_DIRECTORIES>
PUBLIC $<TARGET_PROPERTY:Qt5::Network,INTERFACE_INCLUDE_DIRECTORIES>
PUBLIC $<TARGET_PROPERTY:yaml-cpp,INTERFACE_INCLUDE_DIRECTORIES>
)
set_property(TARGET ${target_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(${target_name} PRIVATE LIBAPPIMAGE_DESKTOP_INTEGRATION_ENABLED)
target_compile_definitions(${target_name} PRIVATE LIBAPPIMAGE_THUMBNAILER_ENABLED)
endfunction()
Supports Markdown
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