Skip to content

Commit

Permalink
Added next part of icons
Browse files Browse the repository at this point in the history
  • Loading branch information
juliagoda committed Oct 4, 2023
1 parent ec9918d commit da56ccd
Show file tree
Hide file tree
Showing 47 changed files with 379 additions and 816 deletions.
Binary file added resources/icons/available-packages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/checked-all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/installed-packages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/actions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/clean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/configure-languages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/configure-shortcuts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/configure-toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/exit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/find-action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/handbook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/hide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/print.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/report-bug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/statistics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/synchronization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/update-mirrors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/menu/what-is-this.png
Binary file added resources/icons/progress.png
Binary file added resources/icons/reversed-sort.png
Binary file added resources/icons/start-action.png
Binary file added resources/icons/styles-settings.png
Binary file added resources/icons/updated-packages.png
31 changes: 31 additions & 0 deletions resources/pak-gui.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,41 @@
<file>icons/app/32-apps-pak-gui.png</file>
<file>icons/app/64-apps-pak-gui.png</file>
<file>icons/app/128-apps-pak-gui.png</file>
<file>icons/menu/clean.png</file>
<file>icons/menu/download.png</file>
<file>icons/menu/exit.png</file>
<file>icons/menu/hide.png</file>
<file>icons/menu/refresh.png</file>
<file>icons/menu/search.png</file>
<file>icons/menu/statistics.png</file>
<file>icons/menu/synchronization.png</file>
<file>icons/menu/update-mirrors.png</file>
<file>icons/menu/update.png</file>
<file>icons/menu/settings.png</file>
<file>icons/menu/configure-toolbar.png</file>
<file>icons/menu/configure-languages.png</file>
<file>icons/menu/what-is-this.png</file>
<file>icons/menu/help.png</file>
<file>icons/menu/print.png</file>
<file>icons/menu/actions.png</file>
<file>icons/menu/handbook.png</file>
<file>icons/menu/application.png</file>
<file>icons/menu/configure-shortcuts.png</file>
<file>icons/menu/find-action.png</file>
<file>icons/menu/report-bug.png</file>
<file>icons/general-settings.png</file>
<file>icons/logs-settings.png</file>
<file>icons/package-info-settings.png</file>
<file>icons/previews-settings.png</file>
<file>icons/styles-settings.png</file>
<file>icons/available-packages.png</file>
<file>icons/updated-packages.png</file>
<file>icons/installed-packages.png</file>
<file>icons/start-action.png</file>
<file>icons/input.png</file>
<file>icons/progress.png</file>
<file>icons/checked-all.png</file>
<file>icons/reversed-sort.png</file>
<file>waiting.gif</file>
<file>waiting-small.gif</file>
</qresource>
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ ki18n_wrap_ui(pak-gui
src/choicewindow.ui
src/previewsappearancesettings.ui
src/packagesinfosettings.ui
src/logssettings.ui)
src/logssettings.ui
src/appstylesettings.ui)

install(FILES src/com.github.juliagoda.pak-gui.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES src/pak-gui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/pak-gui)
Expand Down
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@
#include <QLoggingCategory>
#include <QResource>
#include <QDir>
#include <QStyleFactory>


int main(int argc, char **argv)
{
QApplication application(argc, argv);
QString first_style = QStyleFactory::keys().first();

if (!Settings::records()->appStyleName().isEmpty())
first_style = Settings::records()->appStyleName();

QApplication::setStyle(QStyleFactory::create(first_style));
KLocalizedString::setApplicationDomain("pak-gui");
KCrash::initialize();

Expand Down
94 changes: 94 additions & 0 deletions src/src/appstylesettings.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AppStyleSettings</class>
<widget class="QWidget" name="AppStyleSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="windowIcon">
<iconset resource="../../resources/pak-gui.qrc">
<normaloff>:/icons/styles-settings.png</normaloff>:/icons/styles-settings.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="styles_text">
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Application style</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="app_style_name_combobox"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources>
<include location="../../resources/pak-gui.qrc"/>
</resources>
<connections/>
</ui>
49 changes: 31 additions & 18 deletions src/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "mainwindow.h"

#include "actionsaccesschecker.h"
#include "kstandardaction.h"
#include "mainwindowview.h"
#include "settingsrecords.h"
#include "src/settings.h"
Expand All @@ -28,12 +29,15 @@

#include <QAction>
#include <QStatusBar>
#include <QMenu>
#include <QMenuBar>

#include <KActionCollection>
#include <KConfigDialog>
#include <KLocalizedString>
#include <KStandardAction>
#include <KNotification>
#include <KHelpMenu>


MainWindow::MainWindow()
Expand Down Expand Up @@ -105,6 +109,11 @@ void MainWindow::disableOnlineActions()
sync_polaur_action->setDisabled(true);
}

void MainWindow::whatIsThis()
{
KXmlGuiWindow::whatsThis();
}


void MainWindow::prepareMainWindowView(MainWindowView* main_window_view)
{
Expand Down Expand Up @@ -179,15 +188,13 @@ void MainWindow::startTimerOnOperation(const QDateTime& time,


void MainWindow::setAction(QPointer<QAction>& action,
const QString& text,
const QString& icon,
const QKeySequence& key_sequence)
const MenuAction& menu_action_info)
{
action = new QAction(this);
action->setText(text);
action->setIcon(QIcon::fromTheme(icon));
this->actionCollection()->setDefaultShortcut(action, key_sequence);
this->actionCollection()->addAction(icon, action);
action->setText(menu_action_info.text);
action->setIcon(QIcon(":/icons/menu/" + menu_action_info.icon + ".png"));
this->actionCollection()->setDefaultShortcut(action, menu_action_info.key_sequence);
this->actionCollection()->addAction(menu_action_info.config_name, action);
}


Expand Down Expand Up @@ -227,10 +234,10 @@ void MainWindow::initSignals()
setTimersOnChecks();

KActionCollection* actionCollection = this->actionCollection();
setAction(update_action, i18n("&Update"), QString("update"), QKeySequence(Qt::CTRL, Qt::Key_U));
setAction(update_action, MenuAction{i18n("&Update"), QString("update"), QString("update"), QKeySequence(Qt::CTRL, Qt::Key_U)});
connect(update_action, &QAction::triggered, this, [this]() { if (process->preparedBeforeRun(Process::Task::UpdateInstalledPackages)) process->run(Process::Task::UpdateInstalledPackages); }, Qt::AutoConnection);

setAction(refresh_action, i18n("&Refresh"), QString("refresh"), QKeySequence(Qt::CTRL, Qt::Key_R));
setAction(refresh_action, MenuAction{i18n("&Refresh"), QString("refresh"), QString("refresh"), QKeySequence(Qt::CTRL, Qt::Key_R)});
connect(refresh_action, &QAction::triggered, main_window_view, &MainWindowView::refresh);

connect(main_window_view, &MainWindowView::initStarted, this, &MainWindow::disableActions);
Expand All @@ -246,31 +253,37 @@ void MainWindow::initSignals()
connect(actions_access_checker.get(), &ActionsAccessChecker::gitAccessChanged, [this](bool is_installed) {
sync_polaur_action->setEnabled(initEnded && is_installed); });

setAction(download_action, i18n("&Download"), QString("download"), QKeySequence(Qt::CTRL, Qt::Key_D));
setAction(download_action, MenuAction{i18n("&Download"), QString("download"), QString("download"), QKeySequence(Qt::CTRL, Qt::Key_D)});
connect(download_action, &QAction::triggered, main_window_view, &MainWindowView::downloadPackage);

setAction(search_action, i18n("&Search"), QString("search"), QKeySequence(Qt::CTRL, Qt::Key_S));
setAction(search_action, MenuAction{i18n("&Search"), QString("search"), QString("search"), QKeySequence(Qt::CTRL, Qt::Key_S)});
connect(search_action, &QAction::triggered, main_window_view, &MainWindowView::searchPackage);

setAction(update_all_action, i18n("&Update system packages"), QString("updateAllPackages"), QKeySequence(Qt::CTRL, Qt::Key_U, Qt::Key_A));
setAction(update_all_action, MenuAction{i18n("&Update system packages"), QString("update"), QString("updateAllPackages"), QKeySequence(Qt::CTRL, Qt::Key_U, Qt::Key_A)});
connect(update_all_action, &QAction::triggered, this, [this]() { if (process->preparedBeforeRun(Process::Task::UpdateAll)) process->run(Process::Task::UpdateAll); }, Qt::AutoConnection);

setAction(update_mirrors_action, i18n("&Update mirrors"), QString("updateMirrors"), QKeySequence(Qt::CTRL, Qt::Key_U, Qt::Key_M));
setAction(update_mirrors_action, MenuAction{i18n("&Update mirrors"), QString("update-mirrors"), QString("updateMirrors"), QKeySequence(Qt::CTRL, Qt::Key_U, Qt::Key_M)});
connect(update_mirrors_action, &QAction::triggered, this, [this]() { if (process->preparedBeforeRun(Process::Task::MirrorsUpdate)) process->run(Process::Task::MirrorsUpdate); }, Qt::AutoConnection);

setAction(clean_action, i18n("&Clean"), QString("clean"), QKeySequence(Qt::CTRL, Qt::Key_C));
setAction(clean_action, MenuAction{i18n("&Clean"), QString("clean"), QString("clean"), QKeySequence(Qt::CTRL, Qt::Key_C)});
connect(clean_action, &QAction::triggered, this, [this]() { if (process->preparedBeforeRun(Process::Task::Clean)) process->run(Process::Task::Clean); }, Qt::AutoConnection);

setAction(sync_polaur_action, i18n("&Sync POLAUR"), QString("syncPOLAUR"), QKeySequence(Qt::CTRL, Qt::Key_S, Qt::Key_P));
setAction(sync_polaur_action, MenuAction{i18n("&Sync POLAUR"), QString("synchronization"), QString("syncPOLAUR"), QKeySequence(Qt::CTRL, Qt::Key_S, Qt::Key_P)});
connect(sync_polaur_action, &QAction::triggered, this, [this]() { if (process->preparedBeforeRun(Process::Task::SyncPOLAUR)) process->run(Process::Task::SyncPOLAUR); }, Qt::AutoConnection);

setAction(print_statistics_action, i18n("&Statistics"), QString("statistics"), QKeySequence(Qt::CTRL, Qt::Key_S, Qt::Key_T));
setAction(print_statistics_action, MenuAction{i18n("&Statistics"), QString("statistics"), QString("statistics"), QKeySequence(Qt::CTRL, Qt::Key_S, Qt::Key_T)});
connect(print_statistics_action, &QAction::triggered, main_window_view, &MainWindowView::showStatisticsWindow);

disableActions();

KStandardAction::quit(main_window_view, SLOT(checkRunningThreadsBeforeQuit()), actionCollection);
KStandardAction::preferences(this, SLOT(settingsConfigure()), actionCollection);
auto quit_action = KStandardAction::quit(main_window_view, SLOT(checkRunningThreadsBeforeQuit()), actionCollection);
quit_action->setIcon(QIcon(":/icons/menu/exit.png"));
auto settings_action = KStandardAction::preferences(this, SLOT(settingsConfigure()), actionCollection);
settings_action->setIcon(QIcon(":/icons/menu/settings.png"));
auto configure_toolbars = KStandardAction::configureToolbars(this, &KXmlGuiWindow::configureToolbars, actionCollection);
configure_toolbars->setIcon(QIcon(":/icons/menu/configure-toolbar.png"));
auto whatsThis = KStandardAction::whatsThis(this, &KXmlGuiWindow::whatsThis, actionCollection);
whatsThis->setIcon(QIcon(":/icons/menu/what-is-this.png"));
}


Expand Down
14 changes: 11 additions & 3 deletions src/src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
#include "settings.h"


struct MenuAction
{
QString text;
QString icon;
QString config_name;
QKeySequence key_sequence;
};


class MainWindowView;

class MainWindow : public KXmlGuiWindow
Expand All @@ -54,6 +63,7 @@ private Q_SLOTS:
void enableActions();
void disableActions();
void disableOnlineActions();
void whatIsThis();

signals:
void closeApp();
Expand Down Expand Up @@ -91,9 +101,7 @@ private Q_SLOTS:
int time_limit_in_milliseconds,
const QString& operation);
void setAction(QPointer<QAction>& action,
const QString& text,
const QString& icon,
const QKeySequence& key_sequence);
const MenuAction& menu_action_info);

bool initEnded{false};

Expand Down
3 changes: 3 additions & 0 deletions src/src/mainwindowview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <QPieSeries>
#include <QTimer>
#include <QDateTime>
#include <QStyleFactory>
#include <QtConcurrent/QtConcurrent>


Expand Down Expand Up @@ -185,6 +186,7 @@ void MainWindowView::updatePreviewsDesign()
design.update(m_ui.text_browser_tab_update);
}


// TODOJG - to strategy design pattern
void MainWindowView::clearMainPreviews(Process::Task task)
{
Expand Down Expand Up @@ -476,6 +478,7 @@ void MainWindowView::addInputWidgets(QVBoxLayout*& vbox_layout,

auto input_btn = new QPushButton(input_widget);
input_btn->setText(i18n("Input"));
input_btn->setIcon(QIcon(":/icons/input.png"));
input_btn->setObjectName(QString::fromUtf8("input_for_%1_btn").arg(text));
input_btn->setMaximumSize(QSize(50, 16777215));

Expand Down
Loading

0 comments on commit da56ccd

Please sign in to comment.