├── debian ├── compat ├── source │ └── format ├── ubunsys-docs.docs ├── files ├── dirs ├── menu ├── README ├── changelog ├── README.Debian ├── README.source ├── ubunsys.install ├── control ├── rules └── copyright ├── logo.png ├── src ├── images │ ├── broom.png │ ├── check.png │ ├── close.png │ ├── copy.png │ ├── cut.png │ ├── info.png │ ├── new.png │ ├── open.png │ ├── panda.png │ ├── paste.png │ ├── save.png │ ├── 559612.png │ ├── broom2.png │ ├── escoba.png │ ├── images.jpeg │ ├── install.png │ ├── kernel.jpg │ ├── key1600.png │ ├── paquete.png │ ├── repair.png │ ├── td_logo.png │ ├── ubunsys.ico │ ├── ubunsys.png │ ├── update.png │ ├── upgrade.png │ ├── install2.png │ ├── install2.png~ │ ├── linux-icon.png │ ├── nav_10-512.png │ ├── typografia.png │ ├── upgrade2.png │ ├── Twitter-icon.png │ ├── made-with-qt.png │ ├── orange-up-24.png │ ├── red-number-1.jpg │ ├── red-number-2.jpg │ ├── red-number-3.jpg │ ├── red-number-4.jpg │ ├── red-number-5.jpg │ ├── red-number-6.jpg │ ├── settings-512.png │ ├── ubunsys_005.png │ ├── ubunsys_006.png │ ├── ubunsys_007.png │ ├── ubunsys_008.png │ ├── current-icons.png │ ├── ethernet_on1600.png │ ├── flecha_arriba.png │ ├── gtk-preferences.png │ ├── settings-4-128.png │ ├── settings-5122.png │ ├── ubunsys+panda.png │ ├── update-arrows.png │ ├── control_panel-512.png │ ├── icons8-update-100.png │ ├── repairing-service.png │ ├── shellscript-icon.png │ ├── github-release-stats.png │ ├── if_gtk-refresh_28464.png │ ├── refresh-round-symbol.png │ ├── Apps-Terminal-Pc-104-icon.png │ ├── package-box-with-down-arrow.png │ ├── transparent-clipboard-clear-5.png │ ├── 128-128-76912453c14fc15ed016df244ce34b54.png │ ├── Alecive-Flatwoken-Apps-Terminal-Pc-104.ico │ ├── thin-071_file_document_code_binary-512.png │ ├── electricity-clipart-lightnig-597870-3188154.png │ ├── Refresh_reload_arrow_sync_repeat_update_arrows.png │ ├── Future-595b40b75ba036ed117d7e0d.svg │ └── 55961.svg ├── qdarkstyle │ ├── rc │ │ ├── close.png │ │ ├── sizegrip.png │ │ ├── undock.png │ │ ├── up_arrow.png │ │ ├── down_arrow.png │ │ ├── left_arrow.png │ │ ├── Hmovetoolbar.png │ │ ├── Hsepartoolbar.png │ │ ├── Vmovetoolbar.png │ │ ├── Vsepartoolbar.png │ │ ├── branch_closed.png │ │ ├── branch_open.png │ │ ├── close-hover.png │ │ ├── close-pressed.png │ │ ├── radio_checked.png │ │ ├── right_arrow.png │ │ ├── transparent.png │ │ ├── branch_open-on.png │ │ ├── radio_unchecked.png │ │ ├── branch_closed-on.png │ │ ├── checkbox_checked.png │ │ ├── checkbox_unchecked.png │ │ ├── stylesheet-vline.png │ │ ├── up_arrow_disabled.png │ │ ├── down_arrow_disabled.png │ │ ├── left_arrow_disabled.png │ │ ├── radio_checked_focus.png │ │ ├── right_arrow_disabled.png │ │ ├── checkbox_checked_focus.png │ │ ├── checkbox_indeterminate.png │ │ ├── radio_checked_disabled.png │ │ ├── radio_unchecked_focus.png │ │ ├── stylesheet-branch-end.png │ │ ├── stylesheet-branch-more.png │ │ ├── checkbox_checked_disabled.png │ │ ├── checkbox_unchecked_focus.png │ │ ├── radio_unchecked_disabled.png │ │ ├── checkbox_indeterminate_focus.png │ │ ├── checkbox_unchecked_disabled.png │ │ └── checkbox_indeterminate_disabled.png │ └── style.qrc ├── languages │ └── ubunsys_es_ES.qm ├── packagestab.cpp ├── qt.conf ├── ubunsys.desktop ├── .gitignore ├── scripts │ ├── updateUbuntuScripts.sh │ ├── updateForced.sh │ ├── updateUbuntupackages.sh │ ├── apt-fastChecking.sh │ └── updateUbunsys.sh ├── toolbartab.cpp ├── preferencesdialog.h ├── tutorial.cpp ├── packagesdialog.h ├── .qmake.stash ├── main.cpp ├── rootfilesysproxymodel.h ├── dbmanager.h ├── ubunsys.pro ├── fixes.cpp ├── ubunsys.qrc ├── about.cpp ├── updates.cpp ├── packagesdialog.ui ├── preferencesdialog.cpp ├── rootfilesysproxymodel.cpp ├── preferencesdialog.ui ├── mainwindow.h ├── dbmanager.cpp ├── initializations.cpp ├── mainwindow.cpp ├── checkstatus.cpp ├── packagesdialog.cpp ├── LICENSE └── tweakstab.cpp ├── READMEesES.md └── README.md /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/ubunsys-docs.docs: -------------------------------------------------------------------------------- 1 | README 2 | README.Debian 3 | README.source 4 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/logo.png -------------------------------------------------------------------------------- /debian/files: -------------------------------------------------------------------------------- 1 | ubunsys_2020.08.25~ubuntu20.04_source.buildinfo admin optional 2 | -------------------------------------------------------------------------------- /src/images/broom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/broom.png -------------------------------------------------------------------------------- /src/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/check.png -------------------------------------------------------------------------------- /src/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/close.png -------------------------------------------------------------------------------- /src/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/copy.png -------------------------------------------------------------------------------- /src/images/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/cut.png -------------------------------------------------------------------------------- /src/images/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/info.png -------------------------------------------------------------------------------- /src/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/new.png -------------------------------------------------------------------------------- /src/images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/open.png -------------------------------------------------------------------------------- /src/images/panda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/panda.png -------------------------------------------------------------------------------- /src/images/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/paste.png -------------------------------------------------------------------------------- /src/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/save.png -------------------------------------------------------------------------------- /src/images/559612.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/559612.png -------------------------------------------------------------------------------- /src/images/broom2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/broom2.png -------------------------------------------------------------------------------- /src/images/escoba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/escoba.png -------------------------------------------------------------------------------- /src/images/images.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/images.jpeg -------------------------------------------------------------------------------- /src/images/install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/install.png -------------------------------------------------------------------------------- /src/images/kernel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/kernel.jpg -------------------------------------------------------------------------------- /src/images/key1600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/key1600.png -------------------------------------------------------------------------------- /src/images/paquete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/paquete.png -------------------------------------------------------------------------------- /src/images/repair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/repair.png -------------------------------------------------------------------------------- /src/images/td_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/td_logo.png -------------------------------------------------------------------------------- /src/images/ubunsys.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ubunsys.ico -------------------------------------------------------------------------------- /src/images/ubunsys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ubunsys.png -------------------------------------------------------------------------------- /src/images/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/update.png -------------------------------------------------------------------------------- /src/images/upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/upgrade.png -------------------------------------------------------------------------------- /src/images/install2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/install2.png -------------------------------------------------------------------------------- /src/images/install2.png~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/install2.png~ -------------------------------------------------------------------------------- /src/images/linux-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/linux-icon.png -------------------------------------------------------------------------------- /src/images/nav_10-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/nav_10-512.png -------------------------------------------------------------------------------- /src/images/typografia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/typografia.png -------------------------------------------------------------------------------- /src/images/upgrade2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/upgrade2.png -------------------------------------------------------------------------------- /src/images/Twitter-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/Twitter-icon.png -------------------------------------------------------------------------------- /src/images/made-with-qt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/made-with-qt.png -------------------------------------------------------------------------------- /src/images/orange-up-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/orange-up-24.png -------------------------------------------------------------------------------- /src/images/red-number-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/red-number-1.jpg -------------------------------------------------------------------------------- /src/images/red-number-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/red-number-2.jpg -------------------------------------------------------------------------------- /src/images/red-number-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/red-number-3.jpg -------------------------------------------------------------------------------- /src/images/red-number-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/red-number-4.jpg -------------------------------------------------------------------------------- /src/images/red-number-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/red-number-5.jpg -------------------------------------------------------------------------------- /src/images/red-number-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/red-number-6.jpg -------------------------------------------------------------------------------- /src/images/settings-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/settings-512.png -------------------------------------------------------------------------------- /src/images/ubunsys_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ubunsys_005.png -------------------------------------------------------------------------------- /src/images/ubunsys_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ubunsys_006.png -------------------------------------------------------------------------------- /src/images/ubunsys_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ubunsys_007.png -------------------------------------------------------------------------------- /src/images/ubunsys_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ubunsys_008.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/close.png -------------------------------------------------------------------------------- /src/images/current-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/current-icons.png -------------------------------------------------------------------------------- /src/images/ethernet_on1600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ethernet_on1600.png -------------------------------------------------------------------------------- /src/images/flecha_arriba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/flecha_arriba.png -------------------------------------------------------------------------------- /src/images/gtk-preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/gtk-preferences.png -------------------------------------------------------------------------------- /src/images/settings-4-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/settings-4-128.png -------------------------------------------------------------------------------- /src/images/settings-5122.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/settings-5122.png -------------------------------------------------------------------------------- /src/images/ubunsys+panda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/ubunsys+panda.png -------------------------------------------------------------------------------- /src/images/update-arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/update-arrows.png -------------------------------------------------------------------------------- /src/languages/ubunsys_es_ES.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/languages/ubunsys_es_ES.qm -------------------------------------------------------------------------------- /src/qdarkstyle/rc/sizegrip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/sizegrip.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/undock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/undock.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/up_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/up_arrow.png -------------------------------------------------------------------------------- /src/images/control_panel-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/control_panel-512.png -------------------------------------------------------------------------------- /src/images/icons8-update-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/icons8-update-100.png -------------------------------------------------------------------------------- /src/images/repairing-service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/repairing-service.png -------------------------------------------------------------------------------- /src/images/shellscript-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/shellscript-icon.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/down_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/down_arrow.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/left_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/left_arrow.png -------------------------------------------------------------------------------- /src/images/github-release-stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/github-release-stats.png -------------------------------------------------------------------------------- /src/images/if_gtk-refresh_28464.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/if_gtk-refresh_28464.png -------------------------------------------------------------------------------- /src/images/refresh-round-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/refresh-round-symbol.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/Hmovetoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/Hmovetoolbar.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/Hsepartoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/Hsepartoolbar.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/Vmovetoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/Vmovetoolbar.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/Vsepartoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/Vsepartoolbar.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/branch_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/branch_closed.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/branch_open.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/close-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/close-hover.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/close-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/close-pressed.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/radio_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/radio_checked.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/right_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/right_arrow.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/transparent.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/branch_open-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/branch_open-on.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/radio_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/radio_unchecked.png -------------------------------------------------------------------------------- /src/images/Apps-Terminal-Pc-104-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/Apps-Terminal-Pc-104-icon.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/branch_closed-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/branch_closed-on.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_checked.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_unchecked.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/stylesheet-vline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/stylesheet-vline.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/up_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/up_arrow_disabled.png -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/applications 3 | usr/share/icons/hicolor/256x256/apps 4 | usr/share/ubunsys 5 | usr/share/ubunsys/scripts -------------------------------------------------------------------------------- /debian/menu: -------------------------------------------------------------------------------- 1 | ?package(ubunsys):needs="x11" \ 2 | section="Applications/admin" \ 3 | title="ubunsys" \ 4 | command="/usr/bin/ubunsys" 5 | -------------------------------------------------------------------------------- /src/images/package-box-with-down-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/package-box-with-down-arrow.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/down_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/down_arrow_disabled.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/left_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/left_arrow_disabled.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/radio_checked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/radio_checked_focus.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/right_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/right_arrow_disabled.png -------------------------------------------------------------------------------- /src/images/transparent-clipboard-clear-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/transparent-clipboard-clear-5.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_checked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_checked_focus.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_indeterminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_indeterminate.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/radio_checked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/radio_checked_disabled.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/radio_unchecked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/radio_unchecked_focus.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/stylesheet-branch-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/stylesheet-branch-end.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/stylesheet-branch-more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/stylesheet-branch-more.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_checked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_checked_disabled.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_unchecked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_unchecked_focus.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/radio_unchecked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/radio_unchecked_disabled.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_indeterminate_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_indeterminate_focus.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_unchecked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_unchecked_disabled.png -------------------------------------------------------------------------------- /src/images/128-128-76912453c14fc15ed016df244ce34b54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/128-128-76912453c14fc15ed016df244ce34b54.png -------------------------------------------------------------------------------- /src/images/Alecive-Flatwoken-Apps-Terminal-Pc-104.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/Alecive-Flatwoken-Apps-Terminal-Pc-104.ico -------------------------------------------------------------------------------- /src/images/thin-071_file_document_code_binary-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/thin-071_file_document_code_binary-512.png -------------------------------------------------------------------------------- /src/qdarkstyle/rc/checkbox_indeterminate_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/qdarkstyle/rc/checkbox_indeterminate_disabled.png -------------------------------------------------------------------------------- /src/images/electricity-clipart-lightnig-597870-3188154.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/electricity-clipart-lightnig-597870-3188154.png -------------------------------------------------------------------------------- /src/images/Refresh_reload_arrow_sync_repeat_update_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adgellida/ubunsys/HEAD/src/images/Refresh_reload_arrow_sync_repeat_update_arrows.png -------------------------------------------------------------------------------- /debian/README: -------------------------------------------------------------------------------- 1 | The Debian Package ubunsys 2 | ---------------------------- 3 | 4 | Comments regarding the Package 5 | 6 | -- Antonio David Gellida Lavara Mon, 25 Aug 2020 08:29:00 +0200 7 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | ubunsys (2020.08.25~ubuntu20.04) focal; urgency=medium 2 | 3 | * Added minor changes and applied bugfixes. 4 | 5 | -- Antonio David Gellida Lavara Mon, 25 Aug 2020 08:29:00 +0200 6 | -------------------------------------------------------------------------------- /src/packagestab.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include "packagesdialog.h" 4 | #include 5 | 6 | ///////////////////////PACKAGES TAB/////////////////////// 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | ubunsys for Debian 2 | ----------------- 3 | 4 | 5 | 6 | -- Antonio David Gellida Lavara Mon, 25 Aug 2020 08:29:00 +0200 7 | -------------------------------------------------------------------------------- /src/qt.conf: -------------------------------------------------------------------------------- 1 | # Generated by linuxdeployqt 2 | # https://github.com/probonopd/linuxdeployqt/ 3 | [Paths] 4 | Prefix = ./ 5 | Plugins = /usr/share/ubunsys/plugins 6 | #Imports = qml 7 | #Qml2Imports = qml 8 | Libraries = /usr/share/ubunsys/lib -------------------------------------------------------------------------------- /debian/README.source: -------------------------------------------------------------------------------- 1 | ubunsys for Debian 2 | ----------------- 3 | 4 | 6 | 7 | 8 | 9 | -- Antonio David Gellida Lavara Mon, 25 Aug 2020 08:29:00 +0200 10 | 11 | -------------------------------------------------------------------------------- /debian/ubunsys.install: -------------------------------------------------------------------------------- 1 | bin/ubunsys usr/bin 2 | ubunsys.desktop usr/share/applications 3 | images/ubunsys.png usr/share/icons/hicolor/256x256/apps 4 | scripts/apt-fastChecking.sh usr/share/ubunsys/scripts 5 | scripts/updateUbuntupackages.sh usr/share/ubunsys/scripts 6 | scripts/updateUbuntuScripts.sh usr/share/ubunsys/scripts 7 | scripts/updateUbunsys.sh usr/share/ubunsys/scripts 8 | scripts/updateForced.sh usr/share/ubunsys/scripts -------------------------------------------------------------------------------- /src/ubunsys.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=ubunsys 3 | Version=1.0 4 | Exec=/usr/bin/ubunsys 5 | Comment=Configure your Ubuntu! 6 | Icon=/usr/share/icons/hicolor/256x256/apps/ubunsys.png 7 | Type=Application 8 | Terminal=false 9 | StartupNotify=false 10 | Encoding=UTF-8 11 | Categories=System; 12 | GenericName=Installer & system configurer 13 | Keywords=installer;apps;configure; 14 | Name[en_GB]=ubunsys 15 | Name[en_US]=ubunsys 16 | Name[es_ES]=ubunsys 17 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | #*.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # Extra 35 | *.pro.user 36 | *.pro.user* 37 | wget-log* 38 | moc_* 39 | ui_* 40 | qrc_* 41 | 42 | #Makefile 43 | #/ubunsys -------------------------------------------------------------------------------- /src/scripts/updateUbuntuScripts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | url=https://github.com/adgellida/ubuntuScripts/archive/dev.zip 4 | message2="Updating ubuntuscripts. Please wait... Stage 1/4." 5 | message3="ubuntuscripts was updated to latest version. 1/4 ok." 6 | message4="Error downloading. Holding your ubuntuScripts version. 1/4 fail." 7 | 8 | wget "$url" -O ~/.ubunsys/dev.zip && rm -Rf ~/.ubunsys/downloads/ubuntuScripts-dev && unzip ~/.ubunsys/dev.zip -d ~/.ubunsys/downloads &>/dev/null && chmod 777 -R ~/.ubunsys/downloads/ubuntuScripts-dev && rm ~/.ubunsys/dev.zip && echo "$message3" >> ~/.ubunsys/updates/updateLog.log || echo "$message4" >> ~/.ubunsys/updates/updateLog.log # && sleep 1 9 | 10 | #Rename file 11 | mv "$file1" "$file2" -------------------------------------------------------------------------------- /src/toolbartab.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | ///////////////////////TOOLBAR TAB/////////////////////// 5 | 6 | void MainWindow::on_actionNew_triggered() 7 | { 8 | ui->statusBar->showMessage(tr("New")); 9 | } 10 | 11 | void MainWindow::on_actionOpen_triggered() 12 | { 13 | ui->statusBar->showMessage(tr("Open")); 14 | } 15 | 16 | void MainWindow::on_actionSave_triggered() 17 | { 18 | ui->statusBar->showMessage(tr("Save")); 19 | } 20 | 21 | void MainWindow::on_actionSave_as_triggered() 22 | { 23 | ui->statusBar->showMessage(tr("Save_as")); 24 | } 25 | 26 | /* 27 | 28 | void MainWindow::on_actionAbout_triggered() 29 | { 30 | ui->statusBar->showMessage(tr("About")); 31 | } 32 | 33 | */ 34 | -------------------------------------------------------------------------------- /src/preferencesdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef PREFERENCESDIALOG_H 2 | #define PREFERENCESDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class PreferencesDialog; 8 | } 9 | 10 | class PreferencesDialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit PreferencesDialog(QWidget *parent = 0); 16 | ~PreferencesDialog(); 17 | 18 | signals: 19 | void CloseClicked();/////////// 20 | 21 | private slots: 22 | void on_closePreferencesDialogButton_clicked(); 23 | 24 | void closeEvent(QCloseEvent *event); 25 | 26 | void on_restoreDefaultTextEditorButton_clicked(); 27 | 28 | void on_restoreDefaultTerminalButton_clicked(); 29 | 30 | private: 31 | Ui::PreferencesDialog *ui; 32 | 33 | }; 34 | 35 | #endif // PREFERENCESDIALOG_H 36 | -------------------------------------------------------------------------------- /src/images/Future-595b40b75ba036ed117d7e0d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: ubunsys 2 | Section: admin 3 | Priority: optional 4 | Maintainer: Antonio David Gellida Lavara 5 | Build-Depends: debhelper (>= 9), qtbase5-dev, qtbase5-dev-tools, qt5-qmake 6 | Standards-Version: 4.4.0 7 | Homepage: https://launchpad.net/~adgellida/+archive/ubuntu/ubunsys 8 | #Vcs-Git: git://anonscm.debian.org/collab-maint/ubunsys.git 9 | #Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/ubunsys.git 10 | 11 | Package: ubunsys 12 | Architecture: amd64 13 | Depends: libqt5gui5, libqt5widgets5, libqt5core5a, libqt5sql5, git, wget, xdg-utils, nano, xterm, ufw, curl, sqlite3, sudo, gdebi, ${misc:Depends} 14 | Description: Software installer of a helpful package list, able to do changes on system configuration, updates, execute improves, fixes, executing actions to blow of mouse click. -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | # see ENVIRONMENT in dpkg-buildflags(1) 11 | # package maintainers to append CFLAGS 12 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 13 | # package maintainers to append LDFLAGS 14 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 15 | 16 | #!/usr/bin/make -f 17 | export QT_SELECT := qt5 18 | 19 | %: 20 | dh $@ 21 | 22 | # dh_make generated override targets 23 | # This is example for Cmake (See https://bugs.debian.org/641051 ) 24 | #override_dh_auto_configure: 25 | # dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) 26 | 27 | -------------------------------------------------------------------------------- /src/tutorial.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | 5 | ///////////////////////TUTORIAL/////////////////////// 6 | 7 | void MainWindow::on_actionTutorial_triggered() 8 | { 9 | QMessageBox information; 10 | 11 | information.setTextFormat(Qt::RichText); //this is what makes the links clickable 12 | information.setText(tr("

ubunsys


" 13 | "

Click here to go to wiki.")); 14 | 15 | //ui->statusBar->showMessage(tr("Checking integrity system")); 16 | information.setWindowTitle(tr("Tutorial")); 17 | information.setStyleSheet("QLabel{width: 300px; min-width: 300px; max-width: 300px;}"); 18 | information.setStandardButtons(QMessageBox::Ok); 19 | information.setIconPixmap(QPixmap(":/images/ubunsys.png")); 20 | information.setWindowIcon(QIcon(":/images/ubunsys.png")); 21 | information.setDefaultButton(QMessageBox::Ok); 22 | 23 | information.show(); 24 | information.exec(); 25 | } 26 | -------------------------------------------------------------------------------- /src/packagesdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef PACKAGESDIALOG_H 2 | #define PACKAGESDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class PackagesDialog; 8 | } 9 | 10 | class RootFileSysProxyModel; 11 | 12 | class PackagesDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit PackagesDialog(QWidget *parent = 0); 18 | ~PackagesDialog(); 19 | 20 | private slots: 21 | 22 | void onFileItemSelected(); 23 | void on_runScriptButton_clicked(); 24 | void on_selectOfficialReposButton_clicked(); 25 | void on_selectUnofficialReposButton_clicked(); 26 | void on_runSavedScriptListButton_clicked(); 27 | void on_exportListButton_clicked(); 28 | void on_openInTextEditorButton_clicked(); 29 | void on_clearSelectionButton_clicked(); 30 | ///To implement yet 31 | //void on_txtFilter_textChanged(const QString &arg1); 32 | void on_showCategoriesButton_clicked(); 33 | void getShowNumberofPackages(); 34 | 35 | private: 36 | Ui::PackagesDialog *ui; 37 | RootFileSysProxyModel* fsModel ; 38 | }; 39 | 40 | #endif // PACKAGESDIALOG_H 41 | -------------------------------------------------------------------------------- /src/scripts/updateForced.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | message2="Updating packages & scripts forcedly. Please wait..." 4 | message31="Packages were updated to latest version." 5 | message41="Error downloading. Holding packages." 6 | message32="Scripts were updated to latest version." 7 | message42="Error downloading. Holding scripts." 8 | 9 | test -d ~/.ubunsys || mkdir -p ~/.ubunsys 10 | test -d ~/.ubunsys/downloads || mkdir -p ~/.ubunsys/downloads 11 | 12 | echo "$message2" 13 | #sleep 2 14 | echo " " 15 | 16 | wget https://github.com/adgellida/ubuntupackages/archive/master.zip -O ~/.ubunsys/master.zip && rm -Rf ~/.ubunsys/downloads/ubuntupackages-master && unzip ~/.ubunsys/master.zip -d ~/.ubunsys/downloads &>/dev/null && chmod 777 -R ~/.ubunsys/downloads/ubuntupackages-master && rm ~/.ubunsys/master.zip && echo "$message31" >> ~/.ubunsys/updates/updateLog.log || echo "$message41" >> ~/.ubunsys/updates/updateLog.log # && sleep 1 17 | wget https://github.com/adgellida/ubuntuScripts/archive/dev.zip -O ~/.ubunsys/dev.zip && rm -Rf ~/.ubunsys/downloads/ubuntuScripts-dev && unzip ~/.ubunsys/dev.zip -d ~/.ubunsys/downloads &>/dev/null && chmod 777 -R ~/.ubunsys/downloads/ubuntuScripts-dev && rm ~/.ubunsys/dev.zip && echo "$message32" >> ~/.ubunsys/updates/updateLog.log || echo "$message42" >> ~/.ubunsys/updates/updateLog.log # && sleep 1 -------------------------------------------------------------------------------- /src/scripts/updateUbuntupackages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | url=https://github.com/adgellida/ubuntupackages 4 | file1=~/.ubunsys/updates/ubuntupackages_check_version/now_check_commit_version.txt 5 | file2=~/.ubunsys/updates/ubuntupackages_check_version/last_check_commit_version.txt 6 | message1="ubuntupackages are in the latest version. No updates required. 2/4 ok." 7 | message2="Updating ubuntupackages. Please wait... Stage 2/4." 8 | message3="ubuntupackages was updated to latest version. 2/4 ok." 9 | message4="Error downloading. Holding your ubuntupackages version. 2/4 fail." 10 | 11 | #Getting commit version 12 | 13 | git ls-remote "$url" | head -1 | cut -f 1 > "$file1" 14 | 15 | #Comparing and executing 16 | 17 | if diff "$file1" "$file2" 18 | then 19 | echo "$message1" 20 | echo "$message1" >> ~/.ubunsys/updates/updateLog.log 21 | #sleep 1 22 | else 23 | test -d ~/.ubunsys || mkdir -p ~/.ubunsys 24 | test -d ~/.ubunsys/downloads || mkdir -p ~/.ubunsys/downloads 25 | 26 | echo "$message2" 27 | #sleep 2 28 | echo " " 29 | 30 | wget https://github.com/adgellida/ubuntupackages/archive/master.zip -O ~/.ubunsys/master.zip && rm -Rf ~/.ubunsys/downloads/ubuntupackages-master && unzip ~/.ubunsys/master.zip -d ~/.ubunsys/downloads &>/dev/null && chmod 777 -R ~/.ubunsys/downloads/ubuntupackages-master && rm ~/.ubunsys/master.zip && echo "$message3" >> ~/.ubunsys/updates/updateLog.log || echo "$message4" >> ~/.ubunsys/updates/updateLog.log # && sleep 1 31 | 32 | fi 33 | 34 | #Rename file 35 | mv "$file1" "$file2" -------------------------------------------------------------------------------- /src/images/55961.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: ubunsys 3 | Source: https://github.com/adgellida/ubunsys 4 | 5 | Files: * 6 | Copyright: 2020 Antonio David Gellida Lavara 7 | License: GPL-3.0+ 8 | 9 | Files: debian/* 10 | Copyright: 2020 Antonio David Gellida Lavara 11 | License: GPL-3.0+ 12 | 13 | License: GPL-3.0+ 14 | This program is free software: you can redistribute it and/or modify 15 | it under the terms of the GNU General Public License as published by 16 | the Free Software Foundation, either version 3 of the License, or 17 | (at your option) any later version. 18 | . 19 | This package is distributed in the hope that it will be useful, 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | GNU General Public License for more details. 23 | . 24 | You should have received a copy of the GNU General Public License 25 | along with this program. If not, see . 26 | . 27 | On Debian systems, the complete text of the GNU General 28 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 29 | 30 | # Please also look if there are files or directories which have a 31 | # different copyright/license attached and list them here. 32 | # Please avoid picking licenses with terms that are more restrictive than the 33 | # packaged work, as it may make Debian's contributions unacceptable upstream. 34 | -------------------------------------------------------------------------------- /src/.qmake.stash: -------------------------------------------------------------------------------- 1 | QMAKE_DEFAULT_INCDIRS = \ 2 | /usr/include/c++/6 \ 3 | /usr/include/x86_64-linux-gnu/c++/6 \ 4 | /usr/include/c++/6/backward \ 5 | /usr/lib/gcc/x86_64-linux-gnu/6/include \ 6 | /usr/local/include \ 7 | /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed \ 8 | /usr/include/x86_64-linux-gnu \ 9 | /usr/include 10 | QMAKE_DEFAULT_LIBDIRS = \ 11 | /usr/lib/gcc/x86_64-linux-gnu/6 \ 12 | /usr/lib/x86_64-linux-gnu \ 13 | /usr/lib \ 14 | /lib/x86_64-linux-gnu \ 15 | /lib 16 | QMAKE_CXX.INCDIRS = \ 17 | /usr/include/c++/6 \ 18 | /usr/include/x86_64-linux-gnu/c++/6 \ 19 | /usr/include/c++/6/backward \ 20 | /usr/lib/gcc/x86_64-linux-gnu/6/include \ 21 | /usr/local/include \ 22 | /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed \ 23 | /usr/include/x86_64-linux-gnu \ 24 | /usr/include \ 25 | /usr/include/c++/6 \ 26 | /usr/include/x86_64-linux-gnu/c++/6 \ 27 | /usr/include/c++/6/backward \ 28 | /usr/lib/gcc/x86_64-linux-gnu/6/include \ 29 | /usr/local/include \ 30 | /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed \ 31 | /usr/include/x86_64-linux-gnu \ 32 | /usr/include 33 | QMAKE_CXX.LIBDIRS = \ 34 | /usr/lib/gcc/x86_64-linux-gnu/6 \ 35 | /usr/lib/x86_64-linux-gnu \ 36 | /usr/lib \ 37 | /lib/x86_64-linux-gnu \ 38 | /lib 39 | QMAKE_CXX.QT_COMPILER_STDCXX = 201402L 40 | QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 6 41 | QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3 42 | QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0 43 | QMAKE_CXX.COMPILER_MACROS = \ 44 | QT_COMPILER_STDCXX \ 45 | QMAKE_GCC_MAJOR_VERSION \ 46 | QMAKE_GCC_MINOR_VERSION \ 47 | QMAKE_GCC_PATCH_VERSION 48 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | QApplication app(argc, argv); 13 | app.setOrganizationName("adgellida"); 14 | app.setApplicationName("ubunsys"); 15 | 16 | //SETTINGS 17 | 18 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 19 | DbManager db(path); 20 | 21 | //######## Language selection 22 | 23 | // if (db.isOpen()) 24 | // { 25 | QTranslator translator; 26 | 27 | QString languageSelected = db.getStatus("language"); 28 | 29 | if ((languageSelected == "Spanish") || (languageSelected == "Español")){ 30 | 31 | translator.load(":/languages/ubunsys_es_ES.qm"); 32 | app.installTranslator(&translator); 33 | qDebug() << "Spanish loaded"; 34 | } 35 | 36 | // } 37 | 38 | //######## Theme selection 39 | 40 | QString themeSelected = db.getStatus("theme"); 41 | 42 | if ((themeSelected == "Dark") || (themeSelected == "Oscuro")){ 43 | 44 | QFile file(":qdarkstyle/style.qss"); 45 | file.open(QFile::ReadOnly | QFile::Text); 46 | QTextStream ts(&file); 47 | qApp->setStyleSheet(ts.readAll()); 48 | qDebug() << "Dark loaded"; 49 | } 50 | 51 | else if ((themeSelected == "Default") || (themeSelected == "Por defecto")){ 52 | 53 | qDebug() << "Default loaded"; 54 | } 55 | 56 | else { 57 | 58 | qDebug() << "Default loaded"; 59 | } 60 | 61 | //theme end 62 | 63 | MainWindow w; 64 | w.show(); 65 | //Widget o; 66 | //o.show(); 67 | return app.exec(); 68 | } 69 | -------------------------------------------------------------------------------- /src/scripts/apt-fastChecking.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | message1="apt-fast not installed, installing it... Stage 3/4." 4 | message2="apt-fast attempted to install, check if ok. 3/4 ok." 5 | message3="apt-fast was already installed. No installation required. 3/4 ok." 6 | 7 | #echo "Checking if apt-fast installed. Please wait...Stage 3/4" 8 | #sleep 2 9 | #echo " " 10 | 11 | if [ $(dpkg-query -W -f='${Status}' apt-fast 2>/dev/null | grep -c "ok installed") -eq 0 ] 12 | then 13 | #echo "$message1" 14 | ######sleep 2 15 | #test -f /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-zesty.list || sudo rm /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-zesty.list 16 | #test -f /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-zesty.list || sudo rm /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-zesty.list.save 17 | #test -f /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-xenial.list || sudo rm /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-xenial.list 18 | #test -f /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-xenial.list || sudo rm /etc/apt/sources.list.d/saiarcot895-ubuntu-myppa-xenial.list.save 19 | #######x-terminal-emulator -e echo "Put sudo password if proceed:" && sh ~/.ubunsys/downloads/ubuntupackages-master/apps1/apt-fast 20 | ########x-terminal-emulator -e echo " " 21 | #x-terminal-emulator -e sh ~/.ubunsys/downloads/ubuntupackages-master/apps1/apt-fast 22 | #echo "$message2" 23 | #echo "$message2" >> ~/.ubunsys/updates/updateLog.log 24 | ########sleep 2 25 | 26 | sqlite3 ~/.ubunsys/configurations/config.db <> ~/.ubunsys/updates/updateLog.log 40 | ########sleep 2 41 | fi -------------------------------------------------------------------------------- /src/qdarkstyle/style.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | rc/up_arrow_disabled.png 4 | rc/Hmovetoolbar.png 5 | rc/stylesheet-branch-end.png 6 | rc/branch_closed-on.png 7 | rc/stylesheet-vline.png 8 | rc/branch_closed.png 9 | rc/branch_open-on.png 10 | rc/transparent.png 11 | rc/right_arrow_disabled.png 12 | rc/sizegrip.png 13 | rc/close.png 14 | rc/close-hover.png 15 | rc/close-pressed.png 16 | rc/down_arrow.png 17 | rc/Vmovetoolbar.png 18 | rc/left_arrow.png 19 | rc/stylesheet-branch-more.png 20 | rc/up_arrow.png 21 | rc/right_arrow.png 22 | rc/left_arrow_disabled.png 23 | rc/Hsepartoolbar.png 24 | rc/branch_open.png 25 | rc/Vsepartoolbar.png 26 | rc/down_arrow_disabled.png 27 | rc/undock.png 28 | rc/checkbox_checked_disabled.png 29 | rc/checkbox_checked_focus.png 30 | rc/checkbox_checked.png 31 | rc/checkbox_indeterminate.png 32 | rc/checkbox_indeterminate_focus.png 33 | rc/checkbox_unchecked_disabled.png 34 | rc/checkbox_unchecked_focus.png 35 | rc/checkbox_unchecked.png 36 | rc/radio_checked_disabled.png 37 | rc/radio_checked_focus.png 38 | rc/radio_checked.png 39 | rc/radio_unchecked_disabled.png 40 | rc/radio_unchecked_focus.png 41 | rc/radio_unchecked.png 42 | 43 | 44 | style.qss 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/scripts/updateUbunsys.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | url=https://github.com/adgellida/ubunsys 4 | file1=~/.ubunsys/updates/ubunsys_check_version/latest_version.txt 5 | file2=~/.ubunsys/updates/ubunsys_check_version/installed_version.txt 6 | file3=~/.ubunsys/updates/ubunsys_check_version/latest_version2.txt 7 | message1="ubunsys are in the latest version. No updates required. 4/4 ok." 8 | message2="ubunsys outdated. Push upper red button to update it via PPA. 4/4 ok." 9 | 10 | #Getting Github version 11 | 12 | ubunsysGithubVersion=$(git ls-remote --tags "$url" | awk -F'/' '/[0-9].[0-9].[0-9].*/ { print $3}' | sort -nr | head -n1) 13 | 14 | echo $ubunsysGithubVersion 15 | 16 | ubunsysGithubVersion2=$(echo "$ubunsysGithubVersion" | sed 's/v//' ) 17 | 18 | ubunsysGithubVersion="$ubunsysGithubVersion2" 19 | 20 | #ubunsysGithubVersion=2019.01.01 #Tests. Forcing a new version 21 | 22 | echo "$ubunsysGithubVersion" 23 | 24 | sqlite3 ~/.ubunsys/configurations/config.db <> ~/.ubunsys/updates/updateLog.log 47 | 48 | sqlite3 ~/.ubunsys/configurations/config.db < 5 | #include 6 | #include 7 | 8 | 9 | class RootFileSysProxyModel: public QSortFilterProxyModel 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | RootFileSysProxyModel(QFileSystemModel* model, const QString& rootAbsPath, QObject* parent); 15 | 16 | virtual QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const; 17 | virtual QModelIndex mapToSource ( const QModelIndex & proxyIndex ) const; 18 | QModelIndex buddy(const QModelIndex &index) const; 19 | 20 | 21 | QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; 22 | QModelIndex parent(const QModelIndex&) const; 23 | bool hasChildren(const QModelIndex & parent = QModelIndex()) const ; 24 | 25 | int columnCount(const QModelIndex & parent = QModelIndex()) const; 26 | int rowCount(const QModelIndex & parent = QModelIndex()) const; 27 | QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; 28 | bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); 29 | 30 | void fetchMore(const QModelIndex & parent); 31 | bool canFetchMore(const QModelIndex & parent) const; 32 | 33 | QModelIndex sibling ( int row, int column, const QModelIndex & index ) const; 34 | Qt::ItemFlags flags(const QModelIndex & index) const; 35 | 36 | QMimeData* mimeData(const QModelIndexList & indexes) const; 37 | QStringList mimeTypes() const; 38 | 39 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 40 | bool setHeaderData(int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole); 41 | 42 | QList checkedData(bool checked = true, int role = Qt::DisplayRole) const; 43 | 44 | private: 45 | const QFileSystemModel* fsModel() const; 46 | QFileSystemModel* fsModel(); 47 | QModelIndex rootIndex(int column) const; 48 | QModelIndex badSrcIndex() const; 49 | 50 | private: 51 | QFileSystemModel* fsm; 52 | mutable QMap ptrToSrcIdx; 53 | mutable QMap ptrToProxyIdx; 54 | QMap ptrToChecked; 55 | }; 56 | 57 | 58 | 59 | #endif // FOLDERSPROXYMODEL_H 60 | -------------------------------------------------------------------------------- /src/dbmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef DBMANAGER_H 2 | #define DBMANAGER_H 3 | 4 | #include 5 | 6 | /** 7 | * \class DbManager 8 | * 9 | * \brief SQL Database Manager class 10 | * 11 | * DbManager sets up the connection with SQL database 12 | * and performs some basics queries. The class requires 13 | * existing SQL database. You can create it with sqlite: 14 | * 1. $ sqlite3 config.db 15 | * 2. sqilte> CREATE TABLE config(ids integer primary key, name text); 16 | * 3. sqlite> .quit 17 | */ 18 | class DbManager 19 | { 20 | public: 21 | /** 22 | * @brief Constructor 23 | * 24 | * Constructor sets up connection with db and opens it 25 | * @param path - absolute path to db file 26 | */ 27 | DbManager(const QString& path); 28 | 29 | /** 30 | * @brief Destructor 31 | * 32 | * Close the db connection 33 | */ 34 | ~DbManager(); 35 | 36 | bool isOpen() const; 37 | 38 | /** 39 | * @brief Creates a new 'config' table if it doesn't already exist 40 | * @return true - 'config' table created successfully, false - table not created 41 | */ 42 | bool createTable(); 43 | /** 44 | * @brief Add name data to db 45 | * @param name - name to add 46 | * @return true - name added successfully, false - name not added 47 | */ 48 | bool addName(const QString& name); 49 | bool addStatus(const QString& status); 50 | bool addNameStatus(const QString& name, const QString& status); 51 | bool updateStatus(const QString& name, const QString& status); 52 | /** 53 | * @brief Remove name data from db 54 | * @param name - name to remove. 55 | * @return true - name removed successfully, false - name not removed 56 | */ 57 | bool removeName(const QString& name); 58 | 59 | /** 60 | * @brief Check if "name" exists in db 61 | * @param name - name to check. 62 | * @return true - name exists, false - name does not exist 63 | */ 64 | bool nameExists(const QString& name) const; 65 | QString getStatus(const QString& name) const; 66 | /** 67 | * @brief Print names in db 68 | */ 69 | void printAllNames() const; 70 | 71 | /** 72 | * @brief Remove all names from db 73 | * @return true - all name removed successfully, false - not removed 74 | */ 75 | bool removeAllNames(); 76 | 77 | private: 78 | QSqlDatabase m_db; 79 | }; 80 | 81 | #endif // DBMANAGER_H 82 | -------------------------------------------------------------------------------- /src/ubunsys.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-12-17T12:13:28 4 | # 5 | # ubunsys 6 | # 7 | # Copyright (c) 2017 all rights reserved - GPL v2 8 | # Antonio David Gellida Lavara - adgellida@gmail.com 9 | # https://github.com/adgellida/ubunsys 10 | # 11 | #------------------------------------------------- 12 | 13 | QT += core gui sql 14 | 15 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 16 | 17 | TARGET = ubunsys 18 | TEMPLATE = app 19 | 20 | SOURCES += main.cpp \ 21 | checkstatus.cpp \ 22 | initializations.cpp \ 23 | mainwindow.cpp \ 24 | toolbartab.cpp \ 25 | tweakstab.cpp \ 26 | packagestab.cpp \ 27 | about.cpp \ 28 | tutorial.cpp \ 29 | packagesdialog.cpp \ 30 | rootfilesysproxymodel.cpp \ 31 | preferencesdialog.cpp \ 32 | updates.cpp \ 33 | dbmanager.cpp \ 34 | fixes.cpp 35 | 36 | HEADERS += mainwindow.h \ 37 | packagesdialog.h \ 38 | rootfilesysproxymodel.h \ 39 | preferencesdialog.h \ 40 | dbmanager.h 41 | 42 | FORMS += mainwindow.ui \ 43 | packagesdialog.ui \ 44 | preferencesdialog.ui 45 | 46 | RC_ICONS += images/ubunsys.png 47 | 48 | RESOURCES += ubunsys.qrc \ 49 | qdarkstyle/style.qrc 50 | DISTFILES += 51 | 52 | TRANSLATIONS += languages/ubunsys_es_ES.ts 53 | 54 | #FILES 55 | 56 | #binary 57 | target.path = /usr/bin 58 | 59 | #icon 60 | icon.path = /usr/share/icons/hicolor/256x256/apps 61 | icon.files = $$PWD/images/ubunsys.png 62 | 63 | #desktop shortcut 64 | desktop.path = /usr/share/applications 65 | desktop.files += ubunsys.desktop 66 | 67 | #scripts 68 | 69 | apt-fastChecking.path = /usr/share/ubunsys/scripts 70 | apt-fastChecking.files = $$PWD/scripts/apt-fastChecking.sh 71 | 72 | updateUbuntupackages.path = /usr/share/ubunsys/scripts 73 | updateUbuntupackages.files = $$PWD/scripts/updateUbuntupackages.sh 74 | 75 | updateUbuntuScripts.path = /usr/share/ubunsys/scripts 76 | updateUbuntuScripts.files = $$PWD/scripts/updateUbuntuScripts.sh 77 | 78 | updateUbunsys.path = /usr/share/ubunsys/scripts 79 | updateUbunsys.files = $$PWD/scripts/updateUbunsys.sh 80 | 81 | updateForced.path = /usr/share/ubunsys/scripts 82 | updateForced.files = $$PWD/scripts/updateForced.sh 83 | 84 | INSTALLS += target desktop icon apt-fastChecking updateUbuntupackages updateUbuntuScripts updateUbunsys updateForced 85 | 86 | QMAKE_CXXFLAGS += "-fno-sized-deallocation" 87 | -------------------------------------------------------------------------------- /src/fixes.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | ///////////////////////FIXES TAB/////////////////////// 5 | //http://www.upubuntu.com/2013/05/how-to-fix-broken-packages-using.html 6 | 7 | void MainWindow::on_integrityCheckButton_clicked() 8 | { 9 | // Reboots and checks integrity system 10 | 11 | process->start("sh", QStringList() << "-c" << "shutdown -Fr now"); 12 | } 13 | 14 | void MainWindow::on_repairNetworkButton_clicked() 15 | { 16 | process->start("sh", QStringList() << "-c" << "sudo service network-manager restart"); 17 | } 18 | 19 | void MainWindow::on_repairGPGKeys_clicked() 20 | { 21 | process->start("sh", QStringList() << "-c" << "~/.ubunsys/downloads/ubuntupackages-master/apps1/y-ppa-manager && sudo launchpad-getkeys && sudo apt-fast -y update"); 22 | } 23 | 24 | void MainWindow::on_unlock_var_lib_dpkg_lock_clicked() 25 | { 26 | process->start("sh", QStringList() << "-c" << "sudo ~/.ubunsys/downloads/ubuntuScripts-dev/058.dpkgLock"); 27 | } 28 | 29 | void MainWindow::on_fixBrokenPackagesButton_1_clicked() 30 | { 31 | on_updateAndUpgradeButton_clicked(); 32 | } 33 | 34 | void MainWindow::on_fixBrokenPackagesButton_2_clicked() 35 | { 36 | process->start("sh", QStringList() << "-c" << "sudo apt-fast -y --fix-broken install"); 37 | } 38 | 39 | void MainWindow::on_fixBrokenPackagesButton_3_clicked() 40 | { 41 | process->start("sh", QStringList() << "-c" << "sudo rm /var/lib/apt/lists/* -vf && sudo apt-fast -y update"); 42 | } 43 | 44 | void MainWindow::on_fixBrokenPackagesButton_4_clicked() 45 | { 46 | process->start("sh", QStringList() << "-c" << "sudo apt-fast -f install && sudo apt-fast -y autoremove && sudo apt-fast -y autoclean && sudo apt-fast -y clean"); 47 | } 48 | 49 | void MainWindow::on_fixBrokenPackagesButton_5_clicked() 50 | { 51 | process->start("sh", QStringList() << "-c" << "sudo dpkg --configure -a && sudo apt-fast -y update"); 52 | } 53 | 54 | void MainWindow::on_fixBrokenPackagesButton_6_clicked() 55 | { 56 | process->start("sh", QStringList() << "-c" << "echo Open Ubuntu Software Center and if prompted to repair broken packages, click simply the repair button"); 57 | } 58 | 59 | void MainWindow::on_backupReposButton_clicked() 60 | { 61 | process->start("sh", QStringList() << "-c" << "~/.ubunsys/downloads/ubuntuScripts-dev/077.backupReposUnsupportedReleases"); 62 | } 63 | 64 | void MainWindow::on_reenableReposButton_clicked() 65 | { 66 | process->start("sh", QStringList() << "-c" << "~/.ubunsys/downloads/ubuntuScripts-dev/078.re-enableReposUnsupportedReleases"); 67 | } 68 | 69 | void MainWindow::on_restoreReposButton_clicked() 70 | { 71 | process->start("sh", QStringList() << "-c" << "~/.ubunsys/downloads/ubuntuScripts-dev/079.restoreReposUnsupportedReleases"); 72 | } 73 | -------------------------------------------------------------------------------- /src/ubunsys.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/copy.png 4 | images/cut.png 5 | images/new.png 6 | images/open.png 7 | images/paste.png 8 | images/save.png 9 | images/shellscript-icon.png 10 | images/linux-icon.png 11 | images/kernel.jpg 12 | images/update.png 13 | images/upgrade.png 14 | images/flecha_arriba.png 15 | images/repair.png 16 | images/install.png 17 | images/typografia.png 18 | images/escoba.png 19 | images/red-number-1.jpg 20 | images/red-number-2.jpg 21 | images/red-number-3.jpg 22 | images/red-number-4.jpg 23 | images/red-number-5.jpg 24 | images/red-number-6.jpg 25 | languages/ubunsys_es_ES.qm 26 | languages/ubunsys_es_ES.ts 27 | images/ubunsys.png 28 | images/ubunsys.ico 29 | images/orange-up-24.png 30 | images/settings-512.png 31 | images/gtk-preferences.png 32 | images/if_gtk-refresh_28464.png 33 | images/thin-071_file_document_code_binary-512.png 34 | images/ethernet_on1600.png 35 | images/key1600.png 36 | images/paquete.png 37 | images/upgrade2.png 38 | images/control_panel-512.png 39 | images/Refresh_reload_arrow_sync_repeat_update_arrows.png 40 | images/install2.png 41 | images/128-128-76912453c14fc15ed016df244ce34b54.png 42 | images/Twitter-icon.png 43 | images/55961.svg 44 | images/559612.png 45 | images/electricity-clipart-lightnig-597870-3188154.png 46 | images/nav_10-512.png 47 | images/package-box-with-down-arrow.png 48 | images/update-arrows.png 49 | images/refresh-round-symbol.png 50 | images/repairing-service.png 51 | images/settings-5122.png 52 | images/Alecive-Flatwoken-Apps-Terminal-Pc-104.ico 53 | images/Apps-Terminal-Pc-104-icon.png 54 | images/Future-595b40b75ba036ed117d7e0d.svg 55 | images/icons8-update-100.png 56 | images/broom.png 57 | images/broom2.png 58 | images/settings-4-128.png 59 | images/transparent-clipboard-clear-5.png 60 | images/panda.png 61 | images/ubunsys+panda.png 62 | images/check.png 63 | images/close.png 64 | images/info.png 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/about.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | ///////////////////////ABOUT/////////////////////// 9 | 10 | void MainWindow::on_actionAbout_triggered() 11 | { 12 | QMessageBox about; 13 | 14 | about.setTextFormat(Qt::RichText); //this is what makes the links clickable 15 | about.setText(tr("

ubunsys


" 16 | "

Configurable app referent to packages, updates and configurations


" 17 | "

Contains bugs. Alpha status.


" 18 | "

.


" 19 | 20 | "

Credits to:


" 21 | 22 | "

Art by " 23 | "napafau


" 24 | 25 | "

Icon based on this Author " 26 | "Bernar Novalyi


" 27 | 28 | "

Theme got from here Author " 29 | "ColinDuquesnoyi


" 30 | 31 | "

SQLite library based on this Author " 32 | "katecpp


" 33 | 34 | "

.


" 35 | 36 | "

Sources:


" 37 | 38 | "

Github Repo


" 39 | 40 | "

Gitlab Repo


" 41 | 42 | "

Linux-apps


" 43 | 44 | "

Sourceforge


" 45 | 46 | "

Launchpad PPA


" 47 | 48 | "

.


" 49 | 50 | "


")); 51 | 52 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 53 | DbManager db(path); 54 | 55 | QString status = db.getStatus("ubunsysInstalledVersion"); 56 | 57 | about.setInformativeText(qPrintable("Copyright (c) 2020 all rights reserved\n\n\GPL v2\n\nAntonio David Gellida Lavara\n\nadgellida@gmail.com\n\n" + status)); 58 | 59 | about.setWindowTitle(tr("About")); 60 | 61 | about.setStandardButtons(QMessageBox::Ok); 62 | //about.setIconPixmap(QPixmap(":/images/panda.png")); 63 | 64 | about.setIconPixmap(QPixmap(":/images/ubunsys+panda.png")); 65 | about.setWindowIcon(QIcon(":/images/ubunsys.png")); 66 | //about.setIcon(":/images/ubunsys.png"); 67 | about.setDefaultButton(QMessageBox::Ok); 68 | 69 | about.show(); 70 | about.exec(); 71 | } 72 | -------------------------------------------------------------------------------- /src/updates.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | ///////////////////////UPDATES/////////////////////// 9 | 10 | //void MainWindow::on_updateScriptsButton_clicked() 11 | //{ 12 | // on_runUpdateDialog_clicked(); 13 | //} 14 | 15 | // Normal user 16 | 17 | void MainWindow::on_updateAndUpgradeButton_clicked() 18 | { 19 | 20 | process->start("sh", QStringList() << "-c" << "sudo apt-fast -y update && sudo apt-fast -y upgrade"); 21 | 22 | } 23 | 24 | void MainWindow::on_basicPackagesInstallButton_clicked() 25 | { 26 | process->start("sh", QStringList() << "-c" << "cd ~/.ubunsys/downloads/ubuntupackages-master && sudo ~/.ubunsys/downloads/ubuntupackages-master/packagesToInstall_20200419.list"); 27 | } 28 | 29 | void MainWindow::on_cleanButton_clicked() 30 | { 31 | process->start("sh", QStringList() << "-c" << "sudo apt-get -f install && sudo apt-get -y autoremove && sudo apt-get -y autoclean && sudo apt-get -y clean"); 32 | } 33 | 34 | // Advanced user 35 | 36 | void MainWindow::on_dist_upgradeButton_clicked() 37 | { 38 | process->start("sh", QStringList() << "-c" << "sudo apt-fast -y update && sudo apt-fast -y dist-upgrade"); 39 | } 40 | 41 | void MainWindow::on_cleanKernelsButton_clicked() 42 | { 43 | process->start("sh", QStringList() << "-c" << "sudo purge-old-kernels"); 44 | } 45 | 46 | void MainWindow::on_listUpgradablePackagesButton_clicked() 47 | { 48 | process->start("sh", QStringList() << "-c" << "sudo ~/.ubunsys/downloads/ubuntuScripts-dev/listUpgradablePackages"); 49 | } 50 | 51 | void MainWindow::on_listLatestInstalledPackagesButton_clicked() 52 | { 53 | process->start("sh", QStringList() << "-c" << "~/.ubunsys/downloads/ubuntuScripts-dev/listLatestInstalledPackages"); 54 | } 55 | 56 | void MainWindow::on_upgradeLatestStableButton_clicked() 57 | { 58 | QProcess::startDetached("xterm -e \"sudo do-release-upgrade; exec bash\""); 59 | } 60 | 61 | void MainWindow::on_installMainlineKernels_clicked() 62 | { 63 | process->start("sh", QStringList() << "-c" << "sudo ~/.ubunsys/downloads/ubuntupackages-master/apps1/mainline-ubuntu-kernel-installer && mainline-gtk"); 64 | } 65 | 66 | void MainWindow::on_comboBoxUpdate_currentIndexChanged(const QString &arg1) 67 | { 68 | if (arg1 == "Disabled"){ 69 | 70 | qDebug() << "Auto update disabled"; 71 | 72 | system("xterm -e '" 73 | "~/.ubunsys/downloads/ubuntuScripts-dev/066.remove_to_root_crontab" 74 | " && " 75 | "exit" 76 | "; exec bash'"); 77 | } 78 | 79 | else if (arg1 == "Each hour"){ 80 | 81 | qDebug() << "Each hour"; 82 | 83 | system("xterm -e '" 84 | "~/.ubunsys/downloads/ubuntuScripts-dev/066.remove_to_root_crontab" 85 | " && " 86 | "~/.ubunsys/downloads/ubuntuScripts-dev/065.add_to_root_crontab_each_hour" 87 | " && " 88 | "exit" 89 | "; exec bash'"); 90 | } 91 | 92 | else if (arg1 == "At boot"){ 93 | 94 | qDebug() << "At boot"; 95 | 96 | system("xterm -e '" 97 | "~/.ubunsys/downloads/ubuntuScripts-dev/066.remove_to_root_crontab" 98 | " && " 99 | "~/.ubunsys/downloads/ubuntuScripts-dev/083.add_to_root_crontab_at_boot" 100 | " && " 101 | "exit" 102 | "; exec bash'"); 103 | } 104 | 105 | MainWindow::checkUpdateAutoStatus(); 106 | } 107 | 108 | // Developer 109 | 110 | void MainWindow::on_upgradeLatestDevButton_clicked() 111 | { 112 | QProcess::startDetached("xterm -e \"sudo do-release-upgrade -d; exec bash\""); 113 | } 114 | -------------------------------------------------------------------------------- /src/packagesdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PackagesDialog 4 | 5 | 6 | Qt::NonModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 461 13 | 681 14 | 15 | 16 | 17 | Scripts Manager 18 | 19 | 20 | 21 | :/images/Apps-Terminal-Pc-104-icon.png:/images/Apps-Terminal-Pc-104-icon.png 22 | 23 | 24 | Dialog 25 | 26 | 27 | 28 | 29 | 10 30 | 20 31 | 441 32 | 631 33 | 34 | 35 | 36 | 37 | 38 | 39 | Run saved script list 40 | 41 | 42 | 43 | 44 | 45 | 46 | true 47 | 48 | 49 | Select only Official repos 50 | 51 | 52 | 53 | 54 | 55 | 56 | Export list 57 | 58 | 59 | 60 | 61 | 62 | 63 | true 64 | 65 | 66 | Select only Unofficial repos 67 | 68 | 69 | 70 | 71 | 72 | 73 | Run script 74 | 75 | 76 | 77 | 78 | 79 | 80 | Clear selection 81 | 82 | 83 | 84 | 85 | 86 | 87 | Open in text editor 88 | 89 | 90 | 91 | 92 | 93 | 94 | false 95 | 96 | 97 | <html><head/><body><p>Search filter not implemented yet</p><p>Wait for future releases...</p></body></html> 98 | 99 | 100 | 101 | 102 | 103 | 104 | false 105 | 106 | 107 | Qt::LeftToRight 108 | 109 | 110 | <html><head/><body><p align="right">Filter:</p></body></html> 111 | 112 | 113 | 114 | 115 | 116 | 117 | true 118 | 119 | 120 | false 121 | 122 | 123 | 124 | 125 | 126 | 127 | Show categories 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | true 136 | 137 | 138 | 139 | 0 140 | 660 141 | 451 142 | 21 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /src/preferencesdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "preferencesdialog.h" 2 | #include "ui_preferencesdialog.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | PreferencesDialog::PreferencesDialog(QWidget *parent) : 11 | QDialog(parent), 12 | ui(new Ui::PreferencesDialog) 13 | { 14 | ui->setupUi(this); 15 | 16 | connect(ui->closePreferencesDialogButton, SIGNAL(clicked()),this, SIGNAL(CloseClicked()) );////////// 17 | 18 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 19 | DbManager db(path); 20 | 21 | 22 | //language and theme begin 23 | 24 | QString languageSelected = db.getStatus("language"); 25 | QString themeSelected = db.getStatus("theme"); 26 | 27 | if (languageSelected == "English") ui->comboBox_language->setCurrentText("English"); 28 | if (languageSelected == "Spanish") ui->comboBox_language->setCurrentText("Spanish"); 29 | if (languageSelected == "Español") ui->comboBox_language->setCurrentText("Español"); 30 | if (languageSelected == "Inglés") ui->comboBox_language->setCurrentText("Inglés"); 31 | 32 | if (themeSelected == "Dark") ui->comboBox_theme->setCurrentText("Dark"); 33 | if (themeSelected == "Oscuro") ui->comboBox_theme->setCurrentText("Oscuro"); 34 | if (themeSelected == "Por defecto") ui->comboBox_theme->setCurrentText("Por defecto"); 35 | if (themeSelected == "Default") ui->comboBox_theme->setCurrentText("Default"); 36 | 37 | //language ant theme end 38 | 39 | //text editor begin 40 | 41 | QString actualTextEditorSelected = db.getStatus("textEditor"); //gets data from db 42 | 43 | ui->textEditor->setText(actualTextEditorSelected); //puts actual data on gui 44 | 45 | //text editor end 46 | 47 | //terminal begin 48 | 49 | QString actualTerminalSelected = db.getStatus("terminal"); //gets data from db 50 | 51 | ui->terminal->setText(actualTerminalSelected); //puts actual data on gui 52 | 53 | //terminal end 54 | 55 | } 56 | PreferencesDialog::~PreferencesDialog() 57 | { 58 | delete ui; 59 | } 60 | 61 | void PreferencesDialog::on_closePreferencesDialogButton_clicked() 62 | { 63 | 64 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 65 | DbManager db(path); 66 | 67 | //language and theme begin 68 | 69 | QString languageSelected = ui->comboBox_language->currentText(); 70 | QString themeSelected = ui->comboBox_theme->currentText(); 71 | 72 | if ((languageSelected == "English") && (themeSelected == "Dark")){ 73 | db.updateStatus("language", "English"); 74 | db.updateStatus("theme", "Dark"); 75 | } 76 | 77 | if ((languageSelected == "Spanish") && (themeSelected == "Dark")){ 78 | db.updateStatus("language", "Español"); 79 | db.updateStatus("theme", "Oscuro"); 80 | } 81 | 82 | if ((languageSelected == "Inglés") && (themeSelected == "Oscuro")){ 83 | db.updateStatus("language", "English"); 84 | db.updateStatus("theme", "Dark"); 85 | } 86 | 87 | if ((languageSelected == "Español") && (themeSelected == "Oscuro")){ 88 | db.updateStatus("language", "Español"); 89 | db.updateStatus("theme", "Oscuro"); 90 | } 91 | 92 | ///// 93 | 94 | if ((languageSelected == "English") && (themeSelected == "Default")){ 95 | db.updateStatus("language", "English"); 96 | db.updateStatus("theme", "Default"); 97 | } 98 | 99 | if ((languageSelected == "Spanish") && (themeSelected == "Default")){ 100 | db.updateStatus("language", "Español"); 101 | db.updateStatus("theme", "Por defecto"); 102 | } 103 | 104 | if ((languageSelected == "Inglés") && (themeSelected == "Por defecto")){ 105 | db.updateStatus("language", "English"); 106 | db.updateStatus("theme", "Default"); 107 | } 108 | 109 | if ((languageSelected == "Español") && (themeSelected == "Por defecto")){ 110 | db.updateStatus("language", "Español"); 111 | db.updateStatus("theme", "Por defecto"); 112 | } 113 | 114 | //language and theme end 115 | 116 | 117 | //textEditor begin 118 | 119 | QString newTextEditorSelected = ui->textEditor->toPlainText(); //gets new data from gui 120 | db.updateStatus("textEditor", newTextEditorSelected); //puts into db 121 | 122 | //textEditor end 123 | 124 | //terminal begin 125 | 126 | QString newTerminalSelected = ui->terminal->toPlainText(); //gets new data from gui 127 | db.updateStatus("terminal", newTerminalSelected); //puts into db 128 | 129 | //terminal end 130 | 131 | } 132 | 133 | void PreferencesDialog::closeEvent(QCloseEvent *event) 134 | { 135 | // do what you need here 136 | // then call parent's procedure 137 | 138 | on_closePreferencesDialogButton_clicked(); 139 | 140 | QMessageBox::information(this,tr("Notification"),tr("Now app will restart with the last config setted")); 141 | 142 | QProcess::startDetached(QApplication::applicationFilePath()); 143 | exit(12); 144 | 145 | QWidget::closeEvent(event); 146 | } 147 | 148 | void PreferencesDialog::on_restoreDefaultTextEditorButton_clicked() 149 | { 150 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 151 | DbManager db(path); 152 | db.updateStatus("textEditor", "nano"); 153 | ui->textEditor->setText("nano"); 154 | 155 | } 156 | 157 | void PreferencesDialog::on_restoreDefaultTerminalButton_clicked() 158 | { 159 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 160 | DbManager db(path); 161 | db.updateStatus("terminal", "xterm"); 162 | ui->terminal->setText("xterm"); 163 | } 164 | -------------------------------------------------------------------------------- /src/rootfilesysproxymodel.cpp: -------------------------------------------------------------------------------- 1 | #include "rootfilesysproxymodel.h" 2 | 3 | RootFileSysProxyModel::RootFileSysProxyModel(QFileSystemModel* model, const QString& rootAbsPath, QObject* parent): 4 | QSortFilterProxyModel(parent), 5 | fsm(model) 6 | { 7 | setSourceModel(fsm); 8 | if(!rootAbsPath.isEmpty()) fsm->setRootPath(rootAbsPath); 9 | } 10 | 11 | QModelIndex RootFileSysProxyModel::mapFromSource(const QModelIndex& sourceIndex) const 12 | { 13 | if(!sourceIndex.isValid() || sourceIndex.row() < 0) return QModelIndex(); 14 | 15 | return ptrToProxyIdx[sourceIndex.internalPointer()]; 16 | } 17 | 18 | QModelIndex RootFileSysProxyModel::mapToSource(const QModelIndex& proxyIndex) const 19 | { 20 | if(!proxyIndex.isValid()) return badSrcIndex(); 21 | 22 | if(!ptrToSrcIdx.contains(proxyIndex.internalPointer())) {return badSrcIndex();} 23 | 24 | return ptrToSrcIdx[proxyIndex.internalPointer()]; 25 | } 26 | 27 | QModelIndex RootFileSysProxyModel::buddy(const QModelIndex& index) const 28 | { 29 | if(!index.isValid()) return QModelIndex(); 30 | 31 | return mapFromSource(fsModel()->buddy(mapToSource(index))); 32 | } 33 | 34 | QModelIndex RootFileSysProxyModel::index(int row, int column, const QModelIndex& parent) const 35 | { 36 | if(column < 0 || column > 1) return QModelIndex(); 37 | 38 | QModelIndex sourceIndex; 39 | if(!parent.isValid()) {sourceIndex = rootIndex(0);} 40 | else {sourceIndex = fsModel()->index(row, column, mapToSource(parent));} 41 | void* const ptr = sourceIndex.internalPointer(); 42 | ptrToSrcIdx[ptr] = sourceIndex; 43 | ptrToProxyIdx[ptr] = createIndex(row, column, ptr); 44 | 45 | return ptrToProxyIdx[ptr]; 46 | } 47 | 48 | QModelIndex RootFileSysProxyModel::parent(const QModelIndex& idx) const 49 | { 50 | if(!idx.isValid()) return QModelIndex(); 51 | 52 | if(idx.internalPointer() == rootIndex(idx.column()).internalPointer()) 53 | { 54 | return QModelIndex(); 55 | } 56 | 57 | return mapFromSource(fsModel()->parent(mapToSource(idx))); 58 | } 59 | 60 | bool RootFileSysProxyModel::hasChildren(const QModelIndex& parent) const 61 | { 62 | if(!parent.isValid()) return true; 63 | 64 | return fsModel()->hasChildren(mapToSource(parent)); 65 | } 66 | 67 | int RootFileSysProxyModel::columnCount(const QModelIndex& parent) const 68 | { 69 | if(!parent.isValid()) return 1; 70 | return fsModel()->columnCount(mapToSource(parent)); 71 | } 72 | 73 | int RootFileSysProxyModel::rowCount(const QModelIndex& parent) const 74 | { 75 | if(!parent.isValid()) return 1; 76 | 77 | if(fsModel()->fileInfo(mapToSource(parent)).isDir() && fsModel()->rowCount(mapToSource(parent)) == 0) 78 | { 79 | if(canFetchMore(parent)) const_cast(this)->fetchMore(parent);; 80 | } 81 | 82 | return fsModel()->rowCount(mapToSource(parent)); 83 | } 84 | 85 | QVariant RootFileSysProxyModel::data(const QModelIndex& index, int role) const 86 | { 87 | if(role == Qt::CheckStateRole) 88 | { 89 | if(ptrToChecked[index.internalPointer()] ) return Qt::Checked; 90 | else return Qt::Unchecked; 91 | } 92 | 93 | return fsModel()->data(mapToSource(index), role); 94 | } 95 | 96 | bool RootFileSysProxyModel::setData(const QModelIndex& index, const QVariant& value, int role) 97 | { 98 | if (role == Qt::CheckStateRole && index.column() == 0) 99 | { 100 | ptrToChecked[index.internalPointer()] = static_cast(value.toInt()); //!ptrToChecked[index.internalPointer()]; 101 | 102 | emit dataChanged(index, index); 103 | return true; 104 | } 105 | return fsModel()->setData(mapToSource(index), value, role); 106 | } 107 | 108 | Qt::ItemFlags RootFileSysProxyModel::flags(const QModelIndex& index) const 109 | { 110 | return fsModel()->flags(mapToSource(index)) | Qt::ItemIsUserCheckable; 111 | } 112 | 113 | QMimeData* RootFileSysProxyModel::mimeData(const QModelIndexList& indexes) const 114 | { 115 | if(indexes.isEmpty()) return fsModel()->mimeData(indexes); 116 | 117 | QModelIndexList srcIndexes; 118 | 119 | for(int i = 0; i < indexes.count(); ++i) 120 | { 121 | srcIndexes.append(mapToSource(indexes[i])); 122 | } 123 | 124 | return fsModel()->mimeData(srcIndexes); 125 | } 126 | 127 | QStringList RootFileSysProxyModel::mimeTypes() const 128 | { 129 | return fsModel()->mimeTypes(); 130 | } 131 | 132 | QVariant RootFileSysProxyModel::headerData(int section, Qt::Orientation orientation, int role) const 133 | { 134 | return fsModel()->headerData(section, orientation, role); 135 | } 136 | 137 | bool RootFileSysProxyModel::setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role) 138 | { 139 | return fsModel()->setHeaderData(section, orientation, value, role); 140 | } 141 | 142 | QList RootFileSysProxyModel::checkedData(bool checked, int role) const 143 | { 144 | Q_UNUSED(role); 145 | 146 | QMap::const_iterator it = ptrToChecked.begin(); 147 | QList dataList; 148 | for(; it != ptrToChecked.end(); ++it) 149 | { 150 | if(it.value() != checked) continue; 151 | dataList.append(fsModel()->fileInfo(ptrToSrcIdx[it.key()])); 152 | } 153 | 154 | return dataList; 155 | } 156 | 157 | void RootFileSysProxyModel::fetchMore(const QModelIndex& parent) 158 | { 159 | fsModel()->fetchMore(mapToSource(parent)); 160 | } 161 | 162 | bool RootFileSysProxyModel::canFetchMore(const QModelIndex& parent) const 163 | { 164 | return fsModel()->canFetchMore(mapToSource(parent)); 165 | } 166 | 167 | QModelIndex RootFileSysProxyModel::sibling(int row, int column, const QModelIndex& index) const 168 | { 169 | if(!index.isValid()) return QModelIndex(); 170 | 171 | return fsModel()->sibling(row, column, mapToSource(index));; 172 | } 173 | 174 | const QFileSystemModel* RootFileSysProxyModel::fsModel() const 175 | { 176 | return fsm; 177 | } 178 | 179 | QFileSystemModel* RootFileSysProxyModel::fsModel() 180 | { 181 | return fsm; 182 | } 183 | 184 | QModelIndex RootFileSysProxyModel::rootIndex(int column) const 185 | { 186 | return fsModel()->index(fsModel()->rootPath(), column); 187 | } 188 | 189 | QModelIndex RootFileSysProxyModel::badSrcIndex() const 190 | { 191 | return fsModel()->index(-1, -1); 192 | } 193 | 194 | -------------------------------------------------------------------------------- /src/preferencesdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PreferencesDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Preferences 15 | 16 | 17 | 18 | true 19 | 20 | 21 | 22 | 130 23 | 60 24 | 101 25 | 31 26 | 27 | 28 | 29 | 30 | Default 31 | 32 | 33 | 34 | 35 | Dark 36 | 37 | 38 | 39 | 40 | 41 | true 42 | 43 | 44 | 45 | 130 46 | 10 47 | 101 48 | 31 49 | 50 | 51 | 52 | 53 | English 54 | 55 | 56 | 57 | 58 | Spanish 59 | 60 | 61 | 62 | 63 | 64 | 65 | 20 66 | 70 67 | 101 68 | 21 69 | 70 | 71 | 72 | 73 | 75 74 | true 75 | 76 | 77 | 78 | Theme 79 | 80 | 81 | 82 | 83 | 84 | 20 85 | 20 86 | 101 87 | 21 88 | 89 | 90 | 91 | 92 | 75 93 | true 94 | 95 | 96 | 97 | Language 98 | 99 | 100 | 101 | 102 | 103 | 250 104 | 260 105 | 141 106 | 31 107 | 108 | 109 | 110 | Close and Restart 111 | 112 | 113 | 114 | 115 | 116 | 20 117 | 190 118 | 371 119 | 61 120 | 121 | 122 | 123 | 124 | 50 125 | false 126 | 127 | 128 | 129 | Clicking "X" close button of this window 130 | do the same if you click on "Close and Restart" 131 | 132 | 133 | 134 | 135 | 136 | 20 137 | 120 138 | 101 139 | 21 140 | 141 | 142 | 143 | 144 | 75 145 | true 146 | 147 | 148 | 149 | Text editor 150 | 151 | 152 | 153 | 154 | true 155 | 156 | 157 | 158 | 130 159 | 110 160 | 111 161 | 31 162 | 163 | 164 | 165 | 166 | 167 | true 168 | 169 | 170 | 171 | 250 172 | 110 173 | 141 174 | 31 175 | 176 | 177 | 178 | Restore Default 179 | 180 | 181 | 182 | 183 | true 184 | 185 | 186 | 187 | 250 188 | 160 189 | 141 190 | 31 191 | 192 | 193 | 194 | Restore Default 195 | 196 | 197 | 198 | 199 | 200 | 20 201 | 170 202 | 101 203 | 21 204 | 205 | 206 | 207 | 208 | 75 209 | true 210 | 211 | 212 | 213 | Terminal 214 | 215 | 216 | 217 | 218 | true 219 | 220 | 221 | 222 | 130 223 | 160 224 | 111 225 | 31 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /src/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include ////////// 15 | #include ////////// 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | namespace Ui { 22 | class MainWindow; 23 | } 24 | 25 | class QSystemTrayIcon; 26 | 27 | class MainWindow : public QMainWindow 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit MainWindow(QWidget *parent = 0); 33 | ~MainWindow(); 34 | 35 | //######## CONSOLE 36 | QVBoxLayout *layout; 37 | QTextEdit *console; 38 | //######## 39 | void initializeTrayIcon(); 40 | void createFoldersFiles(); 41 | void initializeDatabase(); 42 | void showMessageAtInit(); 43 | void initializeGUI(); 44 | void initializeConsole(); 45 | void checkUbunsysUpdate(); 46 | void checkUserInSudoers(); 47 | void showUpdateOutput(); //######## DISABLED 48 | void putUbunsysVersion(); 49 | 50 | 51 | 52 | //######## CHECK METHODS 53 | void checkAllStatus(); 54 | void checkFirewallStatus(); 55 | void checkHiddenStartupItemsStatus(); 56 | void checkOfficialUpdateNotificationStatus(); 57 | void checkSudoWithoutPassStatus(); 58 | void checkAsterisksStatus(); 59 | void checkUpdateAutoStatus(); 60 | void checkHibernationStatus(); 61 | void checkLockScreenStatus(); 62 | void checkLoginSoundStatus(); 63 | void checkaptfastInstalled(); 64 | 65 | public slots: 66 | 67 | //######## CONSOLE 68 | void add_text_completed(); 69 | //######## 70 | 71 | //void closePackagesDialog();/////////////// 72 | void closePreferencesDialog();/////////////// 73 | 74 | void iconActivated(QSystemTrayIcon::ActivationReason);///icon 75 | void trayIconClicked(QSystemTrayIcon::ActivationReason);///icon 76 | 77 | private slots: 78 | 79 | //######## CONSOLE 80 | void get_data(); 81 | //######## 82 | 83 | void on_runScriptsManager_released();//////////// 84 | void on_actionPreferences_triggered();//////////// 85 | 86 | void on_actionNew_triggered(); 87 | void on_actionOpen_triggered(); 88 | void on_actionSave_triggered(); 89 | void on_actionSave_as_triggered(); 90 | void on_actionAbout_triggered(); 91 | void on_actionTutorial_triggered(); 92 | void on_updateAndUpgradeButton_clicked(); 93 | void on_dist_upgradeButton_clicked(); 94 | void on_cleanKernelsButton_clicked(); 95 | void on_integrityCheckButton_clicked(); 96 | void on_basicPackagesInstallButton_clicked(); 97 | void on_cleanButton_clicked(); 98 | void on_fixBrokenPackagesButton_1_clicked(); 99 | void on_fixBrokenPackagesButton_2_clicked(); 100 | void on_fixBrokenPackagesButton_3_clicked(); 101 | void on_fixBrokenPackagesButton_4_clicked(); 102 | void on_fixBrokenPackagesButton_5_clicked(); 103 | void on_fixBrokenPackagesButton_6_clicked(); 104 | void on_repairNetworkButton_clicked(); 105 | void on_repairGPGKeys_clicked(); 106 | void on_upgradeLatestStableButton_clicked(); 107 | void on_upgradeLatestDevButton_clicked(); 108 | void on_installTemplatesButton_clicked(); 109 | void on_openSourcesListDButton_clicked(); 110 | void on_enableSudoWithoutPassSpecificButton_clicked(); 111 | void on_disableSudoWithoutPassSpecificButton_clicked(); 112 | void on_openSudoersFileButton_clicked(); 113 | void on_backupSudoersFileButton_clicked(); 114 | 115 | //void on_actionAbout_clicked(); 116 | //void on_updateScriptsButton_clicked(); 117 | //void on_runUpdateDialog_clicked(); 118 | 119 | void on_importSudoersFileButton_clicked(); 120 | void on_installMainlineKernels_clicked(); 121 | void on_runGrubcustomizerButton_clicked(); 122 | void on_openSourcesListButton_clicked(); 123 | void on_backupSourcesListButton_clicked(); 124 | void on_importSourcesListButton_clicked(); 125 | void on_openMainBackupButton_clicked(); 126 | void on_openMainRestoreButton_clicked(); 127 | void on_openSudoersDButton_clicked(); 128 | void on_openRCLocalButton_clicked(); 129 | void on_resetDconf_clicked(); 130 | void on_unlock_var_lib_dpkg_lock_clicked(); 131 | void on_openHostsButton_clicked(); 132 | void on_actionSeeReleases_triggered(); 133 | void on_actionUpdateApp_triggered(); 134 | void on_actionDefaultUpdateUpgradePackages_triggered(); 135 | void on_actionDefaultUpdateUpgradeSmartPackages_triggered(); 136 | void on_actionTwitter_triggered(); 137 | void on_openCronButton_clicked(); 138 | void on_eraseCronButton_clicked(); 139 | void on_checkBox_firewall_clicked(bool checked); 140 | void on_checkBoxOfficialUpdateNotification_clicked(bool checked); 141 | void on_checkBoxSudoWOPass_clicked(bool checked); 142 | void on_checkBoxAsterisks_clicked(bool checked); 143 | void on_checkBoxHibernation_clicked(bool checked); 144 | void on_checkBoxLockScreen_clicked(bool checked); 145 | void on_checkBoxHiddenStartupItems_clicked(bool checked); 146 | void on_checkBoxLoginSound_clicked(bool checked); 147 | void on_backupReposButton_clicked(); 148 | void on_reenableReposButton_clicked(); 149 | void on_restoreReposButton_clicked(); 150 | void on_checkFirewallStatus_clicked(); 151 | void on_goMouseRateCheckerButton_clicked(); 152 | void on_editGrubButton_clicked(); 153 | void on_updateGrubButton_clicked(); 154 | void on_installInfinalityFontsButton_clicked(); 155 | void on_uninstallInfinalityFontsButton_clicked(); 156 | void on_comboBoxUpdate_currentIndexChanged(const QString &arg1); 157 | void on_runSyncTime_clicked(); 158 | void on_listUpgradablePackagesButton_clicked(); 159 | void on_listLatestInstalledPackagesButton_clicked(); 160 | void on_actionCleanTerminal_triggered(); 161 | void on_actionCleanSystem_triggered(); 162 | void on_openBashRCButton_clicked(); 163 | void closeEvent(QCloseEvent *event); 164 | void on_configAutologinButton_clicked(); 165 | void on_InfinalityFontsGeneralStylesButton_clicked(); 166 | void on_InfinalityFontsInfinalityStylesButton_clicked(); 167 | void on_generalInfoButton_clicked(); 168 | void on_openDNSButton_clicked(); 169 | void on_saveDNSButton_clicked(); 170 | void on_showDNSButton_clicked(); 171 | 172 | private: 173 | Ui::MainWindow *ui; 174 | PackagesDialog *PackagesDialogUi;///////////// 175 | PreferencesDialog *PreferencesDialogUi;///////////// 176 | 177 | //icon begin 178 | QSystemTrayIcon *trayIcon; 179 | QMenu* trayIconMenu; 180 | QMenu* createMenu(); 181 | //icon end 182 | 183 | //######## CONSOLE 184 | QProcess *process; 185 | //######## 186 | 187 | }; 188 | 189 | #endif // MAINWINDOW_H 190 | -------------------------------------------------------------------------------- /src/dbmanager.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | DbManager::DbManager(const QString &path) 8 | { 9 | m_db = QSqlDatabase::addDatabase("QSQLITE"); 10 | m_db.setDatabaseName(path); 11 | 12 | if (!m_db.open()) 13 | { 14 | qDebug() << "Error: connection with database fail"; 15 | } 16 | else 17 | { 18 | qDebug() << "Database: connection ok"; 19 | } 20 | } 21 | 22 | DbManager::~DbManager() 23 | { 24 | if (m_db.isOpen()) 25 | { 26 | m_db.close(); 27 | } 28 | } 29 | 30 | bool DbManager::isOpen() const 31 | { 32 | return m_db.isOpen(); 33 | } 34 | 35 | bool DbManager::createTable() 36 | { 37 | bool success = false; 38 | 39 | QSqlQuery query; 40 | query.prepare("CREATE TABLE config(id INTEGER PRIMARY KEY, name TEXT, status TEXT);"); 41 | 42 | if (!query.exec()) 43 | { 44 | qDebug() << "Couldn't create the table 'config': one might already exist."; 45 | success = false; 46 | } 47 | 48 | return success; 49 | } 50 | 51 | bool DbManager::addName(const QString& name) 52 | { 53 | bool success = false; 54 | 55 | if (!name.isEmpty()) 56 | { 57 | QSqlQuery queryAdd; 58 | queryAdd.prepare("INSERT INTO config (name) VALUES (:name)"); 59 | queryAdd.bindValue(":name", name); 60 | 61 | if(queryAdd.exec()) 62 | { 63 | success = true; 64 | } 65 | else 66 | { 67 | qDebug() << "add name failed: " << queryAdd.lastError(); 68 | } 69 | } 70 | else 71 | { 72 | qDebug() << "add name failed: name cannot be empty"; 73 | } 74 | 75 | return success; 76 | } 77 | 78 | bool DbManager::addStatus(const QString& status) 79 | { 80 | bool success = false; 81 | 82 | if (!status.isEmpty()) 83 | { 84 | QSqlQuery queryAdd; 85 | queryAdd.prepare("INSERT INTO config (status) VALUES (:status)"); 86 | 87 | queryAdd.bindValue(":status", status); 88 | 89 | if(queryAdd.exec()) 90 | { 91 | success = true; 92 | } 93 | else 94 | { 95 | qDebug() << "add status failed: " << queryAdd.lastError(); 96 | } 97 | } 98 | else 99 | { 100 | qDebug() << "add status failed: status cannot be empty"; 101 | } 102 | 103 | return success; 104 | } 105 | 106 | QString DbManager::getStatus(const QString& name) const 107 | { 108 | //bool exists = false; 109 | 110 | QString status; 111 | 112 | QSqlQuery query; 113 | query.prepare("SELECT status FROM config WHERE name = (:name)"); 114 | 115 | query.bindValue(":name", name); 116 | //query.bindValue(":status", status); 117 | 118 | if (query.exec()) 119 | { 120 | while (query.next()) 121 | { 122 | status = query.value(0).toString(); 123 | //int salary = query.value(1).toInt(); 124 | //qDebug() << "El valor real es " + status; 125 | //Debug() << name << salary; 126 | } 127 | } 128 | else 129 | { 130 | qDebug() << "No existe noooo:"; 131 | } 132 | 133 | //return exists; 134 | 135 | return status; 136 | } 137 | 138 | bool DbManager::updateStatus(const QString& name, const QString& status) 139 | { 140 | bool success = false; 141 | 142 | if (!name.isEmpty() && !status.isEmpty()) 143 | { 144 | QSqlQuery queryAdd; 145 | 146 | queryAdd.prepare("UPDATE config SET status = (:status) WHERE name = (:name)"); 147 | 148 | queryAdd.bindValue(":name", name); 149 | queryAdd.bindValue(":status", status); 150 | 151 | if(queryAdd.exec()) 152 | { 153 | success = true; 154 | } 155 | else 156 | { 157 | qDebug() << "add status failed: " << queryAdd.lastError(); 158 | } 159 | } 160 | else 161 | { 162 | qDebug() << "add status failed: status cannot be empty"; 163 | } 164 | 165 | return success; 166 | } 167 | 168 | bool DbManager::addNameStatus(const QString& name, const QString& status) 169 | { 170 | bool success = false; 171 | 172 | if (!name.isEmpty() && !status.isEmpty()) 173 | { 174 | QSqlQuery queryAdd; 175 | 176 | //queryAdd.prepare("INSERT INTO config (status) VALUES (:status)"); 177 | 178 | queryAdd.prepare("INSERT INTO config (name, status) VALUES (:name, :status)"); 179 | 180 | //queryAdd.prepare("INSERT INTO config (name, status) VALUES ('textEditor', 'nano')"); 181 | 182 | //queryAdd.prepare("UPDATE config SET status = 'Disabled' WHERE name = 'firewall'"); 183 | 184 | queryAdd.bindValue(":name", name); 185 | queryAdd.bindValue(":status", status); 186 | 187 | if(queryAdd.exec()) 188 | { 189 | success = true; 190 | } 191 | else 192 | { 193 | qDebug() << "add NameStatus failed: " << queryAdd.lastError(); 194 | } 195 | } 196 | else 197 | { 198 | qDebug() << "add NameStatus failed: status cannot be empty"; 199 | } 200 | 201 | return success; 202 | } 203 | 204 | bool DbManager::removeName(const QString& name) 205 | { 206 | bool success = false; 207 | 208 | if (nameExists(name)) 209 | { 210 | QSqlQuery queryDelete; 211 | queryDelete.prepare("DELETE FROM config WHERE name = (:name)"); 212 | queryDelete.bindValue(":name", name); 213 | success = queryDelete.exec(); 214 | 215 | if(!success) 216 | { 217 | qDebug() << "remove name failed: " << queryDelete.lastError(); 218 | } 219 | } 220 | else 221 | { 222 | qDebug() << "remove name failed: name doesnt exist"; 223 | } 224 | 225 | return success; 226 | } 227 | 228 | void DbManager::printAllNames() const 229 | { 230 | qDebug() << "Names in db:"; 231 | QSqlQuery query("SELECT * FROM config"); 232 | int idName = query.record().indexOf("name"); 233 | while (query.next()) 234 | { 235 | QString name = query.value(idName).toString(); 236 | qDebug() << "===" << name; 237 | } 238 | } 239 | 240 | bool DbManager::nameExists(const QString& name) const 241 | { 242 | bool exists = false; 243 | 244 | QSqlQuery checkQuery; 245 | checkQuery.prepare("SELECT name FROM config WHERE name = (:name)"); 246 | checkQuery.bindValue(":name", name); 247 | 248 | if (checkQuery.exec()) 249 | { 250 | if (checkQuery.next()) 251 | { 252 | exists = true; 253 | } 254 | } 255 | else 256 | { 257 | qDebug() << "name exists failed: " << checkQuery.lastError(); 258 | } 259 | 260 | return exists; 261 | } 262 | 263 | bool DbManager::removeAllNames() 264 | { 265 | bool success = false; 266 | 267 | QSqlQuery removeQuery; 268 | removeQuery.prepare("DELETE FROM config"); 269 | 270 | if (removeQuery.exec()) 271 | { 272 | success = true; 273 | } 274 | else 275 | { 276 | qDebug() << "remove all names failed: " << removeQuery.lastError(); 277 | } 278 | 279 | return success; 280 | } 281 | -------------------------------------------------------------------------------- /READMEesES.md: -------------------------------------------------------------------------------- 1 |

2 | Gitlab 3 |

4 | 5 | 6 | 7 | 8 | ubunsys 9 | ============================================= 10 | 11 |

12 | GNU GPL v2 13 | stars 14 | forks 15 | open issues 16 | total downloads 17 | total downloads latest release 18 | latest release 19 | maintained 20 | Platforms 21 | Status 22 | Awesome 23 | 24 |

25 | 26 |

27 | telegram group 28 | twitter 29 | chat 30 | Donate to project Donate to developer 31 | Donate with Bountysource 32 |

33 | 34 |

35 | forthebadge 36 | qt version 37 | github release stats 38 |

39 | 40 | Instalador de una lista de paquetes útiles, capaz de hacer cambios en la configuración del sistema, actualizaciones, ejecutar mejoras, arreglos, ejecutando acciones a golpe de click de ratón. 41 | 42 | Teóricamente compatible con todas las versiones de 64 bits de Ubuntu. 43 | 44 | Debido a falta de tiempo desarrollo pausado. 45 | 46 | 47 | 48 | 49 | 50 | **Actualmente hay 2 ramas de desarrollo:** 51 | 52 | * [master](https://github.com/adgellida/ubunsys/tree/master) - Incluye la versión más estable y reciente. 53 | * [dev](https://github.com/adgellida/ubunsys/tree/dev) - Esta rama está en desuso, sólo para experimentos. 54 | 55 | **App muy peligrosa en algunos puntos, si no sabes donde estás tocando o cómo arreglarlo, no lo hagas. Hecha con motivos de aprendizaje y testeo. No pretende ser estable de momento.** 56 | 57 | Alimentado con [ubuntupackages](https://github.com/adgellida/ubuntupackages) y [ubuntuScripts](https://github.com/adgellida/ubuntuScripts). 58 | 59 | Apps basadas en él: 60 | 61 | * [winsys](https://github.com/adgellida/winsys) 62 | 63 | Tutorial 64 | ============================================= 65 | 66 | Pulsa [aquí](https://github.com/adgellida/ubunsys/wiki/Tutorial_es) para ir a la wiki. 67 | 68 | Más información 69 | ============================================= 70 | 71 | Pulsa [aquí](https://github.com/adgellida/ubunsys/wiki/Mas-info) para ir a la wiki. 72 | 73 | Cómo puedo ayudar? 74 | ============================================= 75 | 76 | Puedes crear un nuevo [asunto](https://github.com/adgellida/ubunsys/issues/new) con un error, proponiendo nuevas funcionalidades, añadiendo nuevos paquetes, ayudando en el desarrollo, etc... 77 | 78 | Ten cuidado 79 | ============================================= 80 | 81 | Cuidado! Estas versiones iniciales tienen un montón de fallos y funcionalidades desactivadas. 82 | 83 | Si quieres ayudar en este desarrollo, dímelo. 84 | 85 | Si necesitas ayuda a cerca de compilar y empaquetar tengo nociones básicas, pregúntame. 86 | 87 | No soy un programador senior, ni junior. Programo como hobby. No estoy siguiendo prácticas de código profesionales. 88 | 89 | Sé que mi código es horrible y no está bien implementado. Con paciencia lo iré limpiando y mejorando. 90 | 91 | Créditos y gracias a 92 | ============================================= 93 | 94 | * Icono basado en [este](https://thenounproject.com/term/terminal/715962/). Autor [Bernar Novalyi](https://thenounproject.com/bernar.novalyi) 95 | * Tema cogido de [aquí](https://github.com/ColinDuquesnoy/QDarkStyleSheet). Autor [ColinDuquesnoy](https://github.com/ColinDuquesnoy) 96 | * Librería SQLite basada en [esta](https://github.com/katecpp/sql_with_qt). Autor [katecpp](https://github.com/katecpp) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Gitlab 3 |

4 | 5 | 6 | 7 | 8 | ubunsys 9 | ============================================= 10 | 11 |

12 | GNU GPL v2 13 | stars 14 | forks 15 | open issues 16 | total downloads 17 | total downloads latest release 18 | latest release 19 | maintained 20 | Platforms 21 | Status 22 | Awesome 23 | 24 |

25 | 26 |

27 | telegram group 28 | twitter 29 | chat 30 | Donate to project Donate to developer 31 | Donate with Bountysource 32 |

33 | 34 |

35 | forthebadge 36 | qt version 37 | github release stats 38 |

39 | 40 | Gives the user a powerful control center to toggle on and off many system settings in Ubuntu, it is able to change system configurations, system updates, executable improvements, small system fixes, and more at the touch of a button. 41 | 42 | It's theoretically compatible with all Ubuntu versions. 43 | 44 | Due to lack of time paused development. 45 | 46 | 47 | 48 | 49 | 50 | **There are currently 2 branches of development:** 51 | 52 | * [master](https://github.com/adgellida/ubunsys/tree/master) - Includes the most stable and lastest version. 53 | * [dev](https://github.com/adgellida/ubunsys/tree/dev) - This branch is deprecated, only for experiments. 54 | 55 | **This is a very dangerous app, if you don't know what you are touching or how to fix it, don't do it. This software is for testing and knowledge purposes. It's unstable software.** 56 | 57 | This is a GUI for these scripts [ubuntupackages](https://github.com/adgellida/ubuntupackages) and [ubuntuScripts](https://github.com/adgellida/ubuntuScripts). 58 | 59 | Other Apps based on this: 60 | 61 | * [winsys](https://github.com/adgellida/winsys) 62 | 63 | Tutorial 64 | ============================================= 65 | 66 | Push [here](https://github.com/adgellida/ubunsys/wiki/Tutorial_en) to go to the wiki. 67 | 68 | More info 69 | ============================================= 70 | 71 | Push [here](https://github.com/adgellida/ubunsys/wiki/More-info) to go to the wiki. 72 | 73 | How can I help? 74 | ============================================= 75 | 76 | You can create a new [issue](https://github.com/adgellida/ubunsys/issues/new) with an error, proposing new functionality, adding new packages, help on coding, etc... 77 | 78 | Be careful 79 | ============================================= 80 | 81 | Be careful! The initial versions have a lot of bugs and disabled functions for a reason. 82 | 83 | If you want to help with development on this software, please contact me. 84 | 85 | If you need help with compiling and packaging I have basic knowhow, feel free to ask me. 86 | 87 | I'm not a senior programmer, nor junior. I program as a hobby. So I'm not following professional coding practices. 88 | 89 | I know that my code is horrifying and very well implemented. With patience and time I'll go to cleaning and improving it. 90 | 91 | Credits and thanks to 92 | ============================================= 93 | 94 | * Icon based on [this](https://thenounproject.com/term/terminal/715962/). Author [Bernar Novalyi](https://thenounproject.com/bernar.novalyi) 95 | * Theme got from [here](https://github.com/ColinDuquesnoy/QDarkStyleSheet). Author [ColinDuquesnoy](https://github.com/ColinDuquesnoy) 96 | * SQLite library based on [this](https://github.com/katecpp/sql_with_qt). Author [katecpp](https://github.com/katecpp) -------------------------------------------------------------------------------- /src/initializations.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include "packagesdialog.h" 4 | #include 5 | #include 6 | 7 | void MainWindow::initializeTrayIcon(){ 8 | 9 | // Tray icon menu 10 | auto menu = this->createMenu(); 11 | this->trayIcon->setContextMenu(menu); 12 | 13 | // App icon 14 | auto appIcon = QIcon(":/images/ubunsys.png"); 15 | this->trayIcon->setIcon(appIcon); 16 | this->setWindowIcon(appIcon); 17 | 18 | // Displaying the tray icon 19 | this->trayIcon->show(); // Note: without explicitly calling show(), QSystemTrayIcon::activated signal will never be emitted! 20 | 21 | // Interaction 22 | connect(trayIcon, &QSystemTrayIcon::activated, this, &MainWindow::iconActivated); 23 | 24 | //trayIcon->showMessage("ubunsys", "I'm opening... Please wait, downloading required scripts", appIcon, 6000); 25 | 26 | } 27 | 28 | void MainWindow::initializeDatabase(){ 29 | 30 | //Database initialization begin 31 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 32 | DbManager db(path); 33 | 34 | if (db.isOpen()) 35 | { 36 | bool out = db.nameExists("dataPresent"); 37 | qDebug() << "Exists?"; 38 | qDebug() << out; 39 | 40 | if (out == false) // If table not exists, we add variables and values 41 | { 42 | //initializing values of database begin 43 | db.createTable(); // Creates a table if it doens't exist. Otherwise, it will use existing table. 44 | //db.removeAllNames(); 45 | //######### 46 | db.addNameStatus("dataPresent", "Enabled"); 47 | //######### 48 | db.addNameStatus("messageAtInit", "Enabled"); 49 | //######### 50 | db.addNameStatus("firewall", "Disabled"); 51 | //######### 52 | db.addNameStatus("hideStartupItems", "Disabled"); 53 | //######### 54 | db.addNameStatus("officialUpdateNotification", "Enabled"); 55 | //######### 56 | db.addNameStatus("sudoWOPass", "Disabled"); 57 | //######### 58 | db.addNameStatus("textEditor", "nano"); 59 | //######### 60 | db.addNameStatus("asterisks", "Disabled"); 61 | //######### 62 | db.addNameStatus("updateAuto", "Disabled"); 63 | //######### 64 | db.addNameStatus("hibernation", "Disabled"); 65 | //######### 66 | db.addNameStatus("lockScreen", "Enabled"); 67 | //######### 68 | db.addNameStatus("loginSound", "Enabled"); 69 | //######## 70 | db.addNameStatus("language", "English"); 71 | //######## 72 | db.addNameStatus("theme", "Default"); 73 | //######## 74 | db.addNameStatus("apt-fastInstalled", "false"); 75 | //######## 76 | db.addNameStatus("appUpdatePresent", "false"); 77 | //######## 78 | db.addNameStatus("ubunsysGithubVersion", "NULL"); 79 | //######## 80 | db.addNameStatus("ubunsysInstalledVersion", "NULL"); 81 | //######## 82 | db.addNameStatus("updateAutoAppBegin", "Enabled"); 83 | //######### 84 | db.addNameStatus("terminal", "xterm"); 85 | } 86 | 87 | bool out2 = db.nameExists("terminal"); 88 | qDebug() << "Exists?"; 89 | qDebug() << out2; 90 | 91 | if (out == false) // If table not exists, we add variables and values 92 | { 93 | db.addNameStatus("terminal", "xterm"); 94 | } 95 | 96 | } 97 | else 98 | { 99 | qDebug() << "Database is not open!"; 100 | } 101 | 102 | //Database initialization end 103 | } 104 | 105 | void MainWindow::initializeGUI(){ 106 | 107 | //Configure tabs open begin 108 | 109 | QTabWidget *tabw = ui->tabWidget; 110 | tabw->setTabText(0, ""); 111 | tabw->setTabText(1, ""); 112 | tabw->setTabText(2, ""); 113 | tabw->setTabText(3, ""); 114 | tabw->setTabText(4, ""); 115 | tabw->setTabText(5, ""); 116 | tabw->setTabText(6, ""); 117 | tabw->setTabText(7, ""); 118 | tabw->setTabText(8, ""); 119 | 120 | QTabBar *tabbar = tabw->tabBar(); 121 | 122 | QLabel *lbl1 = new QLabel(); 123 | lbl1->setStyleSheet("QLabel { background:transparent }"); 124 | lbl1->setText("Packages"); 125 | tabbar->setTabButton(0, QTabBar::LeftSide, lbl1); 126 | 127 | QLabel *lbl2 = new QLabel(); 128 | lbl2->setStyleSheet("QLabel { background:transparent }"); 129 | lbl2->setText("Sources"); 130 | tabbar->setTabButton(1, QTabBar::LeftSide, lbl2); 131 | 132 | QLabel *lbl3 = new QLabel(); 133 | lbl3->setStyleSheet("QLabel { background:transparent }"); 134 | lbl3->setText("Updates"); 135 | tabbar->setTabButton(2, QTabBar::LeftSide, lbl3); 136 | 137 | QLabel *lbl4 = new QLabel(); 138 | lbl4->setStyleSheet("QLabel { background:transparent }"); 139 | lbl4->setText("Fixes"); 140 | tabbar->setTabButton(3, QTabBar::LeftSide, lbl4); 141 | 142 | QLabel *lbl5 = new QLabel(); 143 | lbl5->setStyleSheet("QLabel { background:transparent }"); 144 | lbl5->setText("Security"); 145 | tabbar->setTabButton(4, QTabBar::LeftSide, lbl5); 146 | 147 | QLabel *lbl6 = new QLabel(); 148 | lbl6->setStyleSheet("QLabel { background:transparent }"); 149 | lbl6->setText("Power"); 150 | tabbar->setTabButton(5, QTabBar::LeftSide, lbl6); 151 | 152 | QLabel *lbl7 = new QLabel(); 153 | lbl7->setStyleSheet("QLabel { background:transparent }"); 154 | lbl7->setText("Extras"); 155 | tabbar->setTabButton(6, QTabBar::LeftSide, lbl7); 156 | 157 | QLabel *lbl8 = new QLabel(); 158 | lbl8->setStyleSheet("QLabel { background:transparent }"); 159 | lbl8->setText("Info"); 160 | tabbar->setTabButton(7, QTabBar::LeftSide, lbl8); 161 | 162 | //Configure tabs open end 163 | 164 | //Set main GUI position 165 | 166 | ui->tabWidget->setCurrentIndex(1); 167 | ui->tabWidget_3->setCurrentIndex(0); 168 | } 169 | 170 | void MainWindow::initializeConsole(){ 171 | 172 | //this->setGeometry(333, 333, 355, 355); 173 | 174 | QVBoxLayout *layout = new QVBoxLayout; 175 | 176 | console = new QTextEdit; 177 | process = new QProcess; 178 | 179 | //console->setTextBackgroundColor("RED"); 180 | 181 | layout->addWidget(console); 182 | 183 | process->setProcessChannelMode(QProcess::MergedChannels); 184 | 185 | console->setStyleSheet("QTextEdit { background-color : black; color : green; }"); 186 | console->ensureCursorVisible(); 187 | 188 | ui->widget_3->setLayout(layout); 189 | ui->widget_3->setGeometry(70, 600, 600, 200); 190 | 191 | connect(process, SIGNAL(readyRead()), this, SLOT(get_data())); 192 | connect(process, SIGNAL(finished(int)), this, SLOT(add_text_completed())); 193 | } 194 | 195 | void MainWindow::showMessageAtInit() 196 | { 197 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 198 | DbManager db(path); 199 | QString status = db.getStatus("messageAtInit"); 200 | 201 | if (status == "Enabled"){ 202 | 203 | QMessageBox msgBox; 204 | msgBox.setWindowTitle("Warning"); 205 | msgBox.setText("This version is alpha release.\nContains a lot of bugs.\nParticipate reporting them and demanding new functionalities.\nThanks."); 206 | msgBox.exec(); 207 | 208 | db.updateStatus("messageAtInit","Disabled"); 209 | } 210 | 211 | //system("/usr/share/ubunsys/scripts/installApt-fast.sh"); 212 | } 213 | 214 | void MainWindow::createFoldersFiles() 215 | { 216 | system("test -d ~/.ubunsys || mkdir -p ~/.ubunsys && " 217 | "test -d ~/.ubunsys/configurations || mkdir -p ~/.ubunsys/configurations && " 218 | "test -d ~/.ubunsys/scripts || mkdir -p ~/.ubunsys/scripts && " 219 | "test -d ~/.ubunsys/downloads || mkdir -p ~/.ubunsys/downloads && " 220 | "test -d ~/.ubunsys/files || mkdir -p ~/.ubunsys/files && " 221 | "test -d ~/.ubunsys/backups/scriptsFiles || mkdir -p ~/.ubunsys/backups/scriptsFiles && " 222 | "test -d ~/.ubunsys/backups/sudoersFiles || mkdir -p ~/.ubunsys/backups/sudoersFiles && " 223 | "test -d ~/.ubunsys/updates || mkdir -p ~/.ubunsys/updates && " 224 | "rm -Rf ~/.ubunsys/updates/updateLog.log && " 225 | "touch ~/.ubunsys/updates/updateLog.log && " 226 | "exit"); 227 | } 228 | 229 | void MainWindow::showUpdateOutput() 230 | { 231 | /* 232 | QFile file (QDir::homePath() + "/.ubunsys/updates/updateLog.log"); 233 | 234 | if(!file.open(QIODevice::ReadOnly)) 235 | QMessageBox::information(0,"info",file.errorString()); 236 | 237 | QTextStream in (&file); 238 | 239 | ui->textBrowser->setText(in.readAll()); 240 | 241 | system("rm -Rf ~/.ubunsys/updates/updateLog.log"); 242 | system("touch ~/.ubunsys/updates/updateLog.log"); 243 | 244 | ui->statusBar->showMessage(tr("Recommendation: Push Help -> Tutorial")); 245 | */ 246 | } 247 | -------------------------------------------------------------------------------- /src/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include "preferencesdialog.cpp" 4 | #include "preferencesdialog.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | MainWindow::MainWindow(QWidget *parent) 13 | : QMainWindow(parent) 14 | , ui(new Ui::MainWindow) 15 | , trayIcon(new QSystemTrayIcon(this)) 16 | 17 | { 18 | ui->setupUi(this); 19 | 20 | //ui->centralWidget->setVisible(false); 21 | 22 | //######## INITIALIZATIONS 23 | MainWindow::initializeTrayIcon(); 24 | MainWindow::createFoldersFiles(); 25 | MainWindow::initializeDatabase(); 26 | MainWindow::initializeGUI(); 27 | MainWindow::initializeConsole(); 28 | MainWindow::showMessageAtInit(); 29 | MainWindow::checkAllStatus(); 30 | //MainWindow::showUpdateOutput(); 31 | 32 | //Create extra open on future dialogs begin 33 | connect(ui->actionAbout_Qt, SIGNAL(triggered()), 34 | qApp, SLOT(aboutQt())); 35 | 36 | PackagesDialogUi = new PackagesDialog ();////////////// 37 | //connect(PackagesDialogUi, SIGNAL(CloseClicked()), this , SLOT(closePackagesDialog()));//////////////// 38 | 39 | PreferencesDialogUi = new PreferencesDialog ();////////////// 40 | connect(PreferencesDialogUi, SIGNAL(CloseClicked()), this , SLOT(closePreferencesDialog()));//////////////// 41 | } 42 | 43 | ///icon 44 | QMenu* MainWindow::createMenu() 45 | { 46 | // App can exit via Quit menu 47 | 48 | //auto update = new QAction(tr("&Update system"), this); 49 | //connect(update, SIGNAL(triggered()), this, SLOT(MainWindow::on_updateAndUpgradeButton_clicked())); 50 | 51 | auto quitAction = new QAction("&Quit", this); 52 | connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit); 53 | 54 | auto menu = new QMenu(this); 55 | 56 | //menu->addAction(update); 57 | //menu->addSeparator(); 58 | menu->addAction(quitAction); 59 | 60 | return menu; 61 | } 62 | 63 | ///icon 64 | 65 | void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason_) 66 | { 67 | switch (reason_) { 68 | case QSystemTrayIcon::Trigger: 69 | trayIcon->showMessage("Hello", "You clicked me!"); 70 | break; 71 | default: 72 | ; 73 | } 74 | } 75 | 76 | 77 | void MainWindow::trayIconClicked(QSystemTrayIcon::ActivationReason reason) 78 | { 79 | if(reason == QSystemTrayIcon::Trigger) 80 | this->show(); 81 | } 82 | 83 | 84 | MainWindow::~MainWindow() 85 | { 86 | delete PackagesDialogUi;//////////////// 87 | delete PreferencesDialogUi;//////////////// 88 | delete ui; 89 | } 90 | 91 | //#############FUNCTION DECLARATIONS 92 | 93 | void MainWindow::on_runScriptsManager_released()////////////////////// 94 | { 95 | qDebug() << "dialogOpenned"; 96 | PackagesDialogUi->show(); 97 | ui->statusBar->showMessage(tr("Continue on the opened dialog...")); 98 | } 99 | 100 | //PREFERENCES 101 | 102 | void MainWindow::on_actionPreferences_triggered()////////////////////// 103 | { 104 | qDebug() << "Preferences pushed"; 105 | PreferencesDialogUi->show(); 106 | //ui->textBrowser->setText(tr("Opened preferences dialog...")); 107 | } 108 | 109 | void MainWindow::closePreferencesDialog()////////////////////// 110 | { 111 | 112 | qDebug() << "Close pushed"; 113 | 114 | PreferencesDialogUi->close(); 115 | } 116 | 117 | void MainWindow::on_actionSeeReleases_triggered() 118 | { 119 | QDesktopServices::openUrl(QUrl("https://github.com/adgellida/ubunsys/releases", QUrl::TolerantMode)); 120 | ui->statusBar->showMessage(tr("Launches release page to update manually. Please wait.")); 121 | } 122 | 123 | void MainWindow::on_actionUpdateApp_triggered() 124 | { 125 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 126 | DbManager db(path); 127 | 128 | QString status = db.getStatus("appUpdatePresent"); 129 | 130 | if (status == "false"){ 131 | 132 | QMessageBox::information(this,tr("Notification"),tr("You are running the latest version, no update needed. Remember that every time you open the app an update notification is shown if it exists.")); 133 | 134 | } 135 | 136 | else if (status == "true"){ 137 | 138 | ui->statusBar->showMessage(tr("Put sudo pass to try to update ubunsys through PPA")); 139 | 140 | system("xterm -e '" 141 | "~/.ubunsys/downloads/ubuntupackages-master/apps1/ubunsys" 142 | " && " 143 | "exit" 144 | "; exec bash'"); 145 | 146 | QMessageBox::information(this,tr("ubunsys app update"),tr("Now you have to close & reopen app \n") + tr("and check if update is ok.")); 147 | 148 | ui->statusBar->showMessage(tr("Reopen app when terminal closes to check if ubunsys was updated to latest version.")); 149 | } 150 | } 151 | 152 | void MainWindow::on_actionDefaultUpdateUpgradePackages_triggered() 153 | { 154 | on_updateAndUpgradeButton_clicked(); 155 | } 156 | 157 | void MainWindow::on_actionDefaultUpdateUpgradeSmartPackages_triggered() 158 | { 159 | on_dist_upgradeButton_clicked(); 160 | } 161 | 162 | void MainWindow::on_actionTwitter_triggered() 163 | { 164 | QDesktopServices::openUrl(QUrl("https://www.twitter.com/ubunsys_app", QUrl::TolerantMode)); 165 | ui->statusBar->showMessage(tr("Go to ubunsys twitter. Please wait.")); 166 | } 167 | 168 | void MainWindow::on_openCronButton_clicked() 169 | { 170 | system("xterm -e '" 171 | "~/.ubunsys/downloads/ubuntuScripts-dev/063.openCron" 172 | " && " 173 | "echo Close this window!" 174 | "; exec bash'"); 175 | } 176 | 177 | void MainWindow::on_eraseCronButton_clicked() 178 | { 179 | system("xterm -e '" 180 | "~/.ubunsys/downloads/ubuntuScripts-dev/064.eraseCron" 181 | " && " 182 | "echo Close this window!" 183 | "; exec bash'"); 184 | } 185 | 186 | void MainWindow::on_openDNSButton_clicked() 187 | { 188 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 189 | DbManager db(path); 190 | 191 | QString status = db.getStatus("terminal"); 192 | QString status2 = db.getStatus("textEditor"); 193 | 194 | QProcess::startDetached(status + " -e \"sudo -i "+ status2 +" /etc/resolvconf/resolv.conf.d/head \" "); 195 | 196 | } 197 | 198 | void MainWindow::on_saveDNSButton_clicked() 199 | { 200 | system("xterm -e '" 201 | "sudo resolvconf --enable-updates" 202 | " && " 203 | "sudo resolvconf -u" 204 | " && " 205 | "echo Close this window!" 206 | "; exec bash'"); 207 | } 208 | 209 | void MainWindow::on_showDNSButton_clicked() 210 | { 211 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 212 | DbManager db(path); 213 | 214 | QString status = db.getStatus("terminal"); 215 | QString status2 = db.getStatus("textEditor"); 216 | 217 | QProcess::startDetached(status + " -e \"sudo -i "+ status2 +" /etc/resolv.conf \" "); 218 | 219 | 220 | } 221 | 222 | void MainWindow::on_actionCleanTerminal_triggered() 223 | { 224 | console->clear(); 225 | } 226 | 227 | void MainWindow::on_actionCleanSystem_triggered() 228 | { 229 | MainWindow::on_cleanButton_clicked(); 230 | } 231 | 232 | void MainWindow::on_openBashRCButton_clicked() 233 | { 234 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 235 | DbManager db(path); 236 | 237 | QString status = db.getStatus("terminal"); 238 | QString status2 = db.getStatus("textEditor"); 239 | 240 | QProcess::startDetached(status + " -e \"sudo -i "+ status2 +" ~/.bashrc \" "); 241 | } 242 | 243 | //##CONSOLE 244 | 245 | void MainWindow::get_data() 246 | { 247 | this->console->moveCursor(QTextCursor::End); 248 | this->console->insertPlainText(process->readAll()); 249 | this->console->moveCursor(QTextCursor::End); 250 | // this->console->setPlainText(process->readAllStandardError()); 251 | } 252 | 253 | void MainWindow::add_text_completed() 254 | { 255 | this->console->insertPlainText("\n\n===PROCESS FINISHED===\n\n"); 256 | } 257 | 258 | //## 259 | 260 | void MainWindow::closeEvent(QCloseEvent *event) 261 | { 262 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 263 | DbManager db(path); 264 | 265 | QString status = db.getStatus("sudoWOPass"); 266 | 267 | if (status == "Enabled"){ 268 | 269 | MainWindow::on_checkBoxSudoWOPass_clicked(false); 270 | QMessageBox::information(this,tr("sudoers group"),tr("For more security ubunsys has removed your user from sudoers group")); 271 | } 272 | 273 | QWidget::closeEvent(event); 274 | } 275 | 276 | -------------------------------------------------------------------------------- /src/checkstatus.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include "packagesdialog.h" 4 | #include 5 | #include 6 | #include 7 | 8 | void MainWindow::checkAllStatus() 9 | { 10 | //First update ubuntuscripts and ubuntupackages always, no checks 11 | system("/usr/share/ubunsys/scripts/updateUbuntuScripts.sh"); 12 | system("/usr/share/ubunsys/scripts/updateUbuntupackages.sh"); 13 | MainWindow::checkUserInSudoers(); 14 | MainWindow::checkaptfastInstalled(); 15 | MainWindow::checkUbunsysUpdate(); 16 | MainWindow::putUbunsysVersion(); 17 | //MainWindow::checkFirewallStatus(); 18 | MainWindow::checkHiddenStartupItemsStatus(); 19 | MainWindow::checkOfficialUpdateNotificationStatus(); 20 | MainWindow::checkSudoWithoutPassStatus(); 21 | MainWindow::checkAsterisksStatus(); 22 | MainWindow::checkUpdateAutoStatus(); 23 | MainWindow::checkHibernationStatus(); 24 | MainWindow::checkLockScreenStatus(); 25 | MainWindow::checkLoginSoundStatus(); 26 | } 27 | 28 | //######## 29 | void MainWindow::checkFirewallStatus() 30 | { 31 | //######## firewall 32 | //######## Status 33 | 34 | system("xterm -e '" 35 | "~/.ubunsys/downloads/ubuntuScripts-dev/067.checkFirewallStatus" 36 | " && " 37 | "echo Close this window!" 38 | "; exec bash'"); 39 | 40 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 41 | DbManager db(path); 42 | QString status = db.getStatus("firewall"); 43 | 44 | if (status == "Enabled"){ 45 | 46 | ui->checkBox_firewall->setChecked(true); 47 | } 48 | 49 | else if (status == "Disabled"){ 50 | 51 | ui->checkBox_firewall->setChecked(false); 52 | } 53 | 54 | ui->checkBox_firewall->setEnabled(true); 55 | } 56 | 57 | //######## 58 | 59 | void MainWindow::on_checkFirewallStatus_clicked() 60 | { 61 | //######## HideStartupItems 62 | //######## Status 63 | 64 | MainWindow::checkFirewallStatus(); 65 | } 66 | 67 | //######## 68 | void MainWindow::checkHiddenStartupItemsStatus() 69 | { 70 | //######## HideStartupItems 71 | //######## Status 72 | 73 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 74 | DbManager db(path); 75 | QString status = db.getStatus("hideStartupItems"); 76 | 77 | if (status == "Enabled"){ 78 | 79 | ui->checkBoxHiddenStartupItems->setChecked(true); 80 | } 81 | 82 | else if (status == "Disabled"){ 83 | 84 | ui->checkBoxHiddenStartupItems->setChecked(false); 85 | } 86 | 87 | } 88 | 89 | //######## 90 | void MainWindow::checkOfficialUpdateNotificationStatus() 91 | { 92 | //########updateNotif 93 | //######## Status 94 | 95 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 96 | DbManager db(path); 97 | QString status = db.getStatus("officialUpdateNotification"); 98 | 99 | if (status == "Enabled"){ 100 | 101 | ui->checkBoxOfficialUpdateNotification->setChecked(true); 102 | } 103 | 104 | else if (status == "Disabled"){ 105 | 106 | ui->checkBoxOfficialUpdateNotification->setChecked(false); 107 | } 108 | 109 | } 110 | 111 | //######## 112 | void MainWindow::checkSudoWithoutPassStatus() 113 | { 114 | //######## sudoWithoutPass 115 | //######## Status 116 | 117 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 118 | DbManager db(path); 119 | QString status = db.getStatus("sudoWOPass"); 120 | 121 | if (status == "Enabled"){ 122 | 123 | ui->checkBoxSudoWOPass->setChecked(true); 124 | } 125 | 126 | else if (status == "Disabled"){ 127 | 128 | ui->checkBoxSudoWOPass->setChecked(false); 129 | } 130 | 131 | } 132 | 133 | //######## 134 | 135 | void MainWindow::checkAsterisksStatus() 136 | { 137 | //######## asterisks 138 | //######## Status 139 | 140 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 141 | DbManager db(path); 142 | QString status = db.getStatus("asterisks"); 143 | 144 | if (status == "Enabled"){ 145 | 146 | ui->checkBoxAsterisks->setChecked(true); 147 | } 148 | 149 | else if (status == "Disabled"){ 150 | 151 | ui->checkBoxAsterisks->setChecked(false); 152 | } 153 | } 154 | 155 | //######## 156 | 157 | void MainWindow::checkUpdateAutoStatus() 158 | { 159 | //######## updateAuto 160 | //######## Status 161 | 162 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 163 | DbManager db(path); 164 | QString status = db.getStatus("updateAuto"); 165 | 166 | if (status == "Disabled"){ 167 | 168 | ui->comboBoxUpdate->setCurrentText("Disabled"); 169 | } 170 | 171 | else if (status == "Each hour"){ 172 | 173 | ui->comboBoxUpdate->setCurrentText("Each hour"); 174 | } 175 | 176 | else if (status == "At boot"){ 177 | 178 | ui->comboBoxUpdate->setCurrentText("At boot"); 179 | } 180 | 181 | } 182 | 183 | //######## 184 | 185 | void MainWindow::checkHibernationStatus() 186 | { 187 | //######## hibernation 188 | //######## Status 189 | 190 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 191 | DbManager db(path); 192 | QString status = db.getStatus("hibernation"); 193 | 194 | if (status == "Enabled"){ 195 | 196 | ui->checkBoxHibernation->setChecked(true); 197 | } 198 | 199 | else if (status == "Disabled"){ 200 | 201 | ui->checkBoxHibernation->setChecked(false); 202 | } 203 | } 204 | 205 | //######## 206 | 207 | void MainWindow::checkLockScreenStatus() 208 | { 209 | //######## lockScreen 210 | //######## Status 211 | 212 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 213 | DbManager db(path); 214 | QString status = db.getStatus("lockScreen"); 215 | 216 | if (status == "Enabled"){ 217 | 218 | ui->checkBoxLockScreen->setChecked(true); 219 | } 220 | 221 | else if (status == "Disabled"){ 222 | 223 | ui->checkBoxLockScreen->setChecked(false); 224 | } 225 | 226 | } 227 | 228 | //######## 229 | 230 | void MainWindow::checkLoginSoundStatus() 231 | { 232 | //######## loginSound 233 | //######## Status 234 | 235 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 236 | DbManager db(path); 237 | QString status = db.getStatus("loginSound"); 238 | 239 | if (status == "Enabled"){ 240 | 241 | ui->checkBoxLoginSound->setChecked(true); 242 | } 243 | 244 | else if (status == "Disabled"){ 245 | 246 | ui->checkBoxLoginSound->setChecked(false); 247 | } 248 | 249 | } 250 | 251 | //######## 252 | 253 | void MainWindow::checkaptfastInstalled(){ 254 | 255 | //######## checkApt-fastInstallation 256 | //######## Status 257 | system("/usr/share/ubunsys/scripts/apt-fastChecking.sh"); 258 | 259 | //Checks if apt-fast is installed and show message if proceed 260 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 261 | DbManager db(path); 262 | 263 | QString status = db.getStatus("apt-fastInstalled"); 264 | 265 | if (status == "true"){ 266 | 267 | //system("echo apt-fast was already installed. No installation required. 1/4 ok. >> ~/.ubunsys/updates/updateLog.log"); 268 | 269 | } 270 | 271 | else if (status == "false"){ 272 | 273 | QMessageBox msgBox; 274 | msgBox.setWindowTitle("Warning"); 275 | msgBox.setText("We need extra dependencies:\napt-fast, we go to install it"); 276 | msgBox.exec(); 277 | 278 | system("xterm -e '" 279 | "~/.ubunsys/downloads/ubuntupackages-master/apps1/apt-fast" 280 | " && " 281 | "echo Close this window!" 282 | "; exec bash'"); 283 | } 284 | 285 | } 286 | 287 | void MainWindow::checkUbunsysUpdate(){ 288 | 289 | system("/usr/share/ubunsys/scripts/updateUbunsys.sh"); 290 | 291 | //Checks if ubunsys has an update and show message if proceed 292 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 293 | DbManager db(path); 294 | 295 | QString status = db.getStatus("appUpdatePresent"); 296 | QString status2 = db.getStatus("ubunsysGithubVersion"); 297 | 298 | 299 | if (status == "false"){ 300 | 301 | // do nothing 302 | } 303 | 304 | else if (status == "true"){ 305 | 306 | QMessageBox msgBox; 307 | msgBox.setWindowTitle("ubunsys app update present"); 308 | msgBox.setText("There's an update v" + status2 + ", would you like to install it?"); 309 | msgBox.setStandardButtons(QMessageBox::Yes); 310 | msgBox.addButton(QMessageBox::No); 311 | msgBox.setDefaultButton(QMessageBox::No); 312 | if(msgBox.exec() == QMessageBox::Yes){ 313 | //on_actionUpdateApp_triggered(); //launch update ubunsys app 314 | QDesktopServices::openUrl(QUrl("https://www.pling.com/p/1179908", QUrl::TolerantMode)); 315 | ui->statusBar->showMessage(tr("Launches release page to update manually. Please wait.")); 316 | } 317 | else { 318 | // do nothing 319 | } 320 | } 321 | } 322 | 323 | void MainWindow::putUbunsysVersion(){ 324 | 325 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 326 | DbManager db(path); 327 | 328 | QString status = db.getStatus("appUpdatePresent"); 329 | QString status2 = db.getStatus("ubunsysInstalledVersion"); 330 | 331 | 332 | if (status == "false"){ 333 | 334 | QPixmap pix(":/images/check.png"); 335 | ui->label_pic->setPixmap(pix.scaled(25,25,Qt::KeepAspectRatio)); 336 | ui->label_vMessage->setText("Latest version"); 337 | qDebug() << "Latest version"; 338 | } 339 | 340 | else if (status == "true"){ 341 | 342 | QPixmap pix(":/images/close.png"); 343 | ui->label_pic->setPixmap(pix.scaled(25,25,Qt::KeepAspectRatio)); 344 | ui->label_vMessage->setText("Outdated version"); 345 | qDebug() << "Outdated version"; 346 | } 347 | 348 | ui->label_version->setText(status2); 349 | 350 | } 351 | 352 | void MainWindow::checkUserInSudoers(){ 353 | 354 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 355 | DbManager db(path); 356 | 357 | QString status = db.getStatus("sudoWOPass"); 358 | 359 | if (status == "Enabled"){ 360 | 361 | QMessageBox::information(this,tr("ubunsys needs privileges"),tr("Your user is in sudoers group.\nubunsys now will work correctly")); 362 | 363 | } 364 | 365 | else if (status == "Disabled"){ 366 | 367 | QMessageBox msgBox; 368 | msgBox.setWindowTitle("ubunsys needs privileges"); 369 | msgBox.setText("ubunsys needs your user in the sudoers group.\nDo you allow it?"); 370 | msgBox.setStandardButtons(QMessageBox::Yes); 371 | msgBox.addButton(QMessageBox::No); 372 | msgBox.setDefaultButton(QMessageBox::Yes); 373 | 374 | if (msgBox.exec() == QMessageBox::Yes){ 375 | 376 | MainWindow::on_checkBoxSudoWOPass_clicked(true); 377 | 378 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 379 | DbManager db(path); 380 | 381 | QString status2 = db.getStatus("sudoWOPass"); 382 | 383 | if (status2 == "Enabled"){ 384 | 385 | QMessageBox::information(this,tr("ubunsys needs privileges"),tr("Your user is in sudoers group.\nubunsys now will work correctly")); 386 | } 387 | 388 | else{ 389 | 390 | QMessageBox::information(this,tr("ubunsys needs privileges"),tr("ubunsys wont' work correctly")); 391 | 392 | } 393 | 394 | }else { 395 | 396 | QMessageBox::information(this,tr("ubunsys needs privileges"),tr("ubunsys wont' work correctly")); 397 | } 398 | 399 | } 400 | 401 | } 402 | -------------------------------------------------------------------------------- /src/packagesdialog.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | #include "ui_mainwindow.h" 4 | #include "rootfilesysproxymodel.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "packagesdialog.h" 10 | #include "ui_packagesdialog.h" 11 | 12 | PackagesDialog::PackagesDialog(QWidget *parent) : 13 | QDialog(parent), 14 | ui(new Ui::PackagesDialog) 15 | { 16 | ui->setupUi(this); 17 | 18 | //connect(ui->closePackagesDialogButton, SIGNAL(clicked()),this, SIGNAL(CloseClicked()) );////////// 19 | 20 | //MainWindow *bdd = new MainWindow; 21 | //QString location = bdd->returnMainRepo(); 22 | 23 | //MainWindow testObject; 24 | //QString location = testObject.returnMainRepo(); 25 | 26 | //QString location = MainWindow::returnMainRepo(); 27 | 28 | //fsModel = new RootFileSysProxyModel(new QFileSystemModel, QDir::homePath() + location, this); 29 | fsModel = new RootFileSysProxyModel(new QFileSystemModel, QDir::homePath() + "/.ubunsys/downloads/ubuntupackages-master/apps1", this); 30 | ui->treeView->setModel(fsModel); 31 | connect(fsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector)), this, SLOT(onFileItemSelected())); 32 | //ui->statusBar->showMessage(tr("Select your option")); 33 | //fsModel->setFilterRegExp(QRegExp(".png", Qt::CaseInsensitive,QRegExp::FixedString)); 34 | fsModel->setFilterKeyColumn(1); 35 | ui->treeView->expandAll(); 36 | 37 | getShowNumberofPackages(); 38 | } 39 | 40 | PackagesDialog::~PackagesDialog() 41 | { 42 | delete ui; 43 | } 44 | 45 | void PackagesDialog::onFileItemSelected() 46 | { 47 | getShowNumberofPackages(); 48 | 49 | //Preparing to install 50 | 51 | QString filename = QDir::homePath() + "/.ubunsys/files/packagesToInstall.sh"; 52 | QFile file(filename); 53 | QFile::remove(filename); 54 | 55 | qDebug() << Q_FUNC_INFO; 56 | foreach (QFileInfo fi, fsModel->checkedData()) 57 | { 58 | 59 | if (file.open(QIODevice::ReadWrite | QIODevice::Append)) { 60 | QTextStream stream(&file); 61 | 62 | //stream << "#!/bin/bash\n\n" + fi.absoluteFilePath() << endl; 63 | stream << "'" + fi.absoluteFilePath() + "'" << endl; 64 | qDebug() << "'" + fi.absoluteFilePath() + "'"; 65 | 66 | //Assign Permissions on each selection to selected file 67 | QString filenamePermissionsPath = fi.absoluteFilePath(); 68 | QFile filenamePermissions(filenamePermissionsPath); 69 | filenamePermissions.setPermissions(QFile::ExeGroup | QFile::ExeGroup | QFile::ExeOther | QFile::ExeOwner | QFile::ExeUser | QFile::ReadGroup | QFile::ReadOther | QFile::ReadOwner | QFile::ReadUser | QFile::WriteGroup | QFile::WriteOther | QFile::WriteOwner | QFile::WriteUser); 70 | } 71 | 72 | file.close(); 73 | } 74 | 75 | //Preparing to watch 76 | 77 | QString filename2 = QDir::homePath() + "/.ubunsys/files/packagesToWatch.sh"; 78 | QFile file2(filename2); 79 | QFile::remove(filename2); 80 | 81 | qDebug() << Q_FUNC_INFO; 82 | foreach (QFileInfo fi, fsModel->checkedData()) 83 | { 84 | 85 | if (file2.open(QIODevice::ReadWrite | QIODevice::Append)) { 86 | QTextStream stream(&file2); 87 | 88 | //stream << "#!/bin/bash\n\n" + fi.absoluteFilePath() << endl; 89 | stream << "xdg-open '" + fi.absoluteFilePath() + "'"<< endl; 90 | qDebug() << "xdg-open '" + fi.absoluteFilePath() + "'"; 91 | 92 | //Assign Permissions on each selection to selected file 93 | QString filenamePermissionsPath = fi.absoluteFilePath(); 94 | QFile filenamePermissions(filenamePermissionsPath); 95 | filenamePermissions.setPermissions(QFile::ExeGroup | QFile::ExeGroup | QFile::ExeOther | QFile::ExeOwner | QFile::ExeUser | QFile::ReadGroup | QFile::ReadOther | QFile::ReadOwner | QFile::ReadUser | QFile::WriteGroup | QFile::WriteOther | QFile::WriteOwner | QFile::WriteUser); 96 | } 97 | 98 | file2.close(); 99 | } 100 | 101 | } 102 | 103 | void PackagesDialog::on_runScriptButton_clicked() 104 | { 105 | /* QString filename = QDir::homePath() + "/.ubunsys/files/scriptToInstall.sh"; 106 | QFile file(filename); 107 | //QFile::remove(filename); 108 | 109 | if (file.open(QIODevice::WriteOnly)) { 110 | // Point a QTextStream object at the file 111 | QTextStream outStream(&file); 112 | 113 | // Write the line to the file 114 | outStream << "Victory!\n"; 115 | 116 | // Close the file 117 | file.close(); 118 | } 119 | */ 120 | ui->statusBar->showMessage(tr("Executing Scripts selected. Please wait...")); 121 | 122 | system("sed -i '1i #!/bin/bash' ~/.ubunsys/files/packagesToInstall.sh"); 123 | 124 | QProcess::startDetached("xterm -e \"cd ~/.ubunsys/files && sudo chmod 777 ~/.ubunsys/files/packagesToInstall.sh && ~/.ubunsys/files/packagesToInstall.sh && exit; exec bash\""); 125 | /* 126 | system("xterm -e '" 127 | "cd ~/.ubunsys/files && sudo chmod 777 ~/.ubunsys/files/packagesToInstall.sh && ~/.ubunsys/files/packagesToInstall.sh" 128 | " && " 129 | "exit" 130 | "; exec bash'"); 131 | */ 132 | ui->statusBar->showMessage(tr("Scripts executed with or without errors. Check it!")); 133 | } 134 | 135 | void PackagesDialog::on_selectOfficialReposButton_clicked() 136 | { 137 | 138 | //MainWindow MainWindow; 139 | //QString location = MainWindow.returnMainRepo(); 140 | 141 | //qDebug() << "La ruta es" + location; 142 | 143 | //fsModel = new RootFileSysProxyModel(new QFileSystemModel, location, this); 144 | fsModel = new RootFileSysProxyModel(new QFileSystemModel, QDir::homePath() + "/.ubunsys/downloads/ubuntupackages-master/apps1", this); 145 | ui->treeView->setModel(fsModel); 146 | ui->treeView->expandAll(); 147 | connect(fsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector)), this, SLOT(onFileItemSelected())); 148 | 149 | ui->statusBar->showMessage(tr("Official Repos selected")); 150 | } 151 | 152 | void PackagesDialog::on_selectUnofficialReposButton_clicked() 153 | { 154 | 155 | QMessageBox msgBox; 156 | msgBox.setWindowTitle("Select"); 157 | //msgBox.setText("Select option"); 158 | //msgBox.setStandardButtons(QMessageBox::Yes); 159 | QAbstractButton* pButtonRemote = msgBox.addButton(tr("Remote URL"), QMessageBox::YesRole); 160 | QAbstractButton* pButtonLocal = msgBox.addButton(tr("Local folder"), QMessageBox::YesRole); 161 | msgBox.exec(); 162 | 163 | if (msgBox.clickedButton()==pButtonLocal) { 164 | //on_actionUpdateApp_triggered(); 165 | qDebug() << "Local repo"; 166 | fsModel = new RootFileSysProxyModel(new QFileSystemModel, QDir::homePath(), this); 167 | ui->treeView->setModel(fsModel); 168 | connect(fsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector)), this, SLOT(onFileItemSelected())); 169 | 170 | ui->statusBar->showMessage(tr("Local Repo selected")); 171 | 172 | } 173 | else { 174 | //qDebug() << "Remote repo"; 175 | //QTextEdit *txt = new QTextEdit(); 176 | //txt->setText("Hello, world!"); 177 | //txt->append("Appending some text…"); 178 | //txt->show(); 179 | 180 | //system("xterm -e '" 181 | // "~/.ubunsys/downloads/ubuntuScripts-dev/060.openHosts" 182 | // " && " 183 | // "echo Close this window!" 184 | // "; exec bash'"); 185 | QMessageBox::information(this,"Info","Not yet implemented"); 186 | } 187 | 188 | } 189 | 190 | void PackagesDialog::on_runSavedScriptListButton_clicked() 191 | { 192 | ui->statusBar->showMessage(tr("Select your list")); 193 | 194 | // Get filename 195 | 196 | QString filename=QFileDialog::getOpenFileName( 197 | this, 198 | tr("Import your script file here"), 199 | QDir::homePath() + "/.ubunsys/backups/scriptsFiles", 200 | //getenv("HOME"), 201 | //"All files (*.*);;Bak files(*.bak)"); 202 | "List files(*.list)"); 203 | 204 | //QMessageBox::information(this,tr("File Name"),filename); 205 | 206 | //ui->statusBar->showMessage(tr("Done. sudoers file restored succesful")); 207 | 208 | // Create a new file to execute script path 209 | 210 | QFile file (QDir::homePath() + "/.ubunsys/files/runImportedScript.sh"); 211 | file.open(QIODevice::WriteOnly | QIODevice::Text); 212 | QTextStream out(&file); 213 | out << "#!/bin/bash\n\n" + filename; 214 | 215 | // optional, as QFile destructor will already do it: 216 | file.close(); 217 | 218 | // run script formed 219 | 220 | QProcess::startDetached("xterm -e \"sudo chmod 777 ~/.ubunsys/files/runImportedScript.sh && sudo ~/.ubunsys/files/runImportedScript.sh && exit; exec bash\""); 221 | 222 | /* 223 | 224 | system("xterm -e '" 225 | "sudo chmod 777 ~/.ubunsys/files/runImportedScript.sh" 226 | "&&" 227 | "sudo ~/.ubunsys/files/runImportedScript.sh" 228 | " && " 229 | "exit" 230 | "; exec bash'"); 231 | 232 | */ 233 | 234 | //this would normally start the event loop, but is not needed for this 235 | //minimal example: 236 | //return app.exec(); 237 | 238 | ui->statusBar->showMessage(tr("Scripts executed with or without errors. Check it!")); 239 | } 240 | 241 | void PackagesDialog::on_exportListButton_clicked() 242 | { 243 | system("xterm -e '" 244 | "~/.ubunsys/downloads/ubuntuScripts-dev/047.exportList" 245 | " && " 246 | "exit" 247 | "; exec bash'"); 248 | 249 | QMessageBox::information(this,tr("Notification"),tr("Backuped OK on \n\n") + QDir::homePath() + "/.ubunsys/backups/scriptsFiles"); 250 | } 251 | 252 | void PackagesDialog::on_openInTextEditorButton_clicked() 253 | { 254 | system("sed -i '1i #!/bin/bash' ~/.ubunsys/files/packagesToWatch.sh"); 255 | 256 | QProcess::startDetached("xterm -e \"cd ~/.ubunsys/files && sudo chmod 777 ~/.ubunsys/files/packagesToWatch.sh && ~/.ubunsys/files/packagesToWatch.sh && echo Close this window!! && read; exec bash\""); 257 | } 258 | 259 | //void PackagesDialog::on_txtFilter_textChanged(const QString &arg1) 260 | //{ 261 | ///To implement yet 262 | //} 263 | 264 | void PackagesDialog::on_clearSelectionButton_clicked() 265 | { 266 | fsModel = new RootFileSysProxyModel(new QFileSystemModel, QDir::homePath() + "/.ubunsys/downloads/ubuntupackages-master/apps1", this); 267 | ui->treeView->setModel(fsModel); 268 | connect(fsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector)), this, SLOT(onFileItemSelected())); 269 | //ui->statusBar->showMessage(tr("Select your option")); 270 | //fsModel->setFilterRegExp(QRegExp(".png", Qt::CaseInsensitive,QRegExp::FixedString)); 271 | //fsModel->setFilterKeyColumn(1); 272 | ui->treeView->expandAll(); 273 | system("rm ~/.ubunsys/files/packagesToInstall.sh && ~/.ubunsys/files/packagesToWatch.sh"); 274 | ui->statusBar->showMessage(tr("Selection cleared")); 275 | } 276 | 277 | void PackagesDialog::on_showCategoriesButton_clicked() 278 | { 279 | fsModel = new RootFileSysProxyModel(new QFileSystemModel, QDir::homePath() + "/.ubunsys/downloads/ubuntupackages-master/apps1-categories", this); 280 | ui->treeView->setModel(fsModel); 281 | ui->treeView->expandAll(); 282 | connect(fsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector)), this, SLOT(onFileItemSelected())); 283 | 284 | ui->statusBar->showMessage(tr("Categories enabled")); 285 | } 286 | 287 | void PackagesDialog::getShowNumberofPackages() 288 | { 289 | //Get and show number of packages 290 | 291 | system("find ~/.ubunsys/downloads/ubuntupackages-master/apps1 -type f | wc -l >> ~/.ubunsys/files/packagesNumber"); 292 | system("echo packages >> ~/.ubunsys/files/packagesNumber"); 293 | 294 | QFile file0 (QDir::homePath() + "/.ubunsys/files/packagesNumber"); 295 | 296 | if(!file0.open(QIODevice::ReadOnly)) 297 | QMessageBox::information(0,"info",file0.errorString()); 298 | 299 | QTextStream in (&file0); 300 | 301 | ui->statusBar->showMessage(in.readAll()); 302 | 303 | //ui->statusBar->showMessage("test"); 304 | 305 | //ui->textBrowser->setText(in.readAll()); 306 | 307 | //ui->statusBar->showMessage(tr(in.readAll())); 308 | 309 | system("rm -Rf ~/.ubunsys/files/packagesNumber"); 310 | 311 | //ui->statusBar->showMessage(tr("Selecting items...")); 312 | } 313 | -------------------------------------------------------------------------------- /src/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /src/tweakstab.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | ///////////////////////TWEAKS TAB/////////////////////// 12 | 13 | ////////////////////////////////SOURCES 14 | 15 | //##sources.list.d - no slider terminal 16 | 17 | void MainWindow::on_openSourcesListDButton_clicked() 18 | { 19 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 20 | DbManager db(path); 21 | 22 | QString status = db.getStatus("terminal"); 23 | 24 | QProcess::startDetached(status + " -e \" bash -c ~/.ubunsys/downloads/ubuntuScripts-dev/023.openSourcesListD \" "); 25 | } 26 | 27 | //##open sources.list - no slider terminal + texteditor 28 | 29 | void MainWindow::on_openSourcesListButton_clicked() 30 | { 31 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 32 | DbManager db(path); 33 | 34 | QString status = db.getStatus("terminal"); 35 | QString status2 = db.getStatus("textEditor"); 36 | 37 | QProcess::startDetached(status + " -e \"sudo -i "+ status2 +" /etc/apt/sources.list \" "); 38 | } 39 | 40 | //##backup sources.list - no slider terminal 41 | 42 | void MainWindow::on_backupSourcesListButton_clicked() 43 | { 44 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 45 | DbManager db(path); 46 | 47 | QString status = db.getStatus("terminal"); 48 | 49 | QProcess::startDetached(status + " -e \" bash -c ~/.ubunsys/downloads/ubuntuScripts-dev/043.backupSourcesList \" "); 50 | ui->statusBar->showMessage(tr("Done. sources.list restored succesful")); 51 | 52 | QMessageBox::information(this,tr("Notification"),tr("Backuped OK on \n\n") + QDir::homePath() + "/.ubunsys/backups/sources.list"); 53 | } 54 | 55 | //##import sources.list - no slider terminal 56 | 57 | void MainWindow::on_importSourcesListButton_clicked() 58 | { 59 | QString filename=QFileDialog::getOpenFileName( 60 | this, 61 | tr("Import your sources.list file here"), 62 | QDir::homePath() + "/.ubunsys/backups/sources.list", 63 | //getenv("HOME"), 64 | //"All files (*.*);;Bak files(*.bak)"); 65 | "Bak files(*.bak)"); 66 | 67 | //QMessageBox::information(this,tr("File Name"),filename); 68 | 69 | // Create a new file 70 | 71 | QFile file (QDir::homePath() + "/.ubunsys/backups/sources.list/restoreSourcesListScript.sh"); 72 | file.open(QIODevice::WriteOnly | QIODevice::Text); 73 | QTextStream out(&file); 74 | out << "#!/bin/bash\n\nsudo cp " + filename + " /etc/apt/sources.list"; 75 | 76 | // optional, as QFile destructor will already do it: 77 | file.close(); 78 | 79 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 80 | DbManager db(path); 81 | 82 | QString status = db.getStatus("terminal"); 83 | 84 | QProcess::startDetached(status + " -e \" sudo chmod 777 ~/.ubunsys/backups/sources.list/restoreSourcesListScript.sh " 85 | "&&" 86 | " bash -c ~/.ubunsys/backups/sources.list/restoreSourcesListScript.sh " 87 | "&&" 88 | " -e \" sudo rm -Rf ~/.ubunsys/backups/sources.list/restoreSourcesListScript.sh \" "); 89 | 90 | QMessageBox::information(this,tr("Notification"),tr("sources.list restored succesful")); 91 | } 92 | 93 | //##OfficialUpdateNotification - slider 94 | 95 | void MainWindow::on_checkBoxOfficialUpdateNotification_clicked(bool checked) 96 | { 97 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 98 | DbManager db(path); 99 | 100 | QString status = db.getStatus("terminal"); 101 | 102 | if (checked == true){ 103 | 104 | qDebug() << checked; 105 | 106 | QProcess::startDetached(status + " -e \" bash -c ~/.ubunsys/downloads/ubuntuScripts-dev/054.enableOfficialUpdateNotification \" "); 107 | 108 | ui->statusBar->showMessage(tr("Enabled")); 109 | } 110 | 111 | if (checked == false){ 112 | 113 | qDebug() << checked; 114 | 115 | QProcess::startDetached(status + " -e \" bash -c ~/.ubunsys/downloads/ubuntuScripts-dev/055.disableOfficialUpdateNotification \" "); 116 | 117 | ui->statusBar->showMessage(tr("Disabled")); 118 | } 119 | 120 | MainWindow::checkOfficialUpdateNotificationStatus(); 121 | 122 | } 123 | 124 | ////////////////////////////////SECURITY 125 | 126 | //##sudo without pass all - slider 127 | 128 | void MainWindow::on_checkBoxSudoWOPass_clicked(bool checked) 129 | { 130 | if (checked == true){ 131 | qDebug() << checked; 132 | 133 | ui->statusBar->showMessage(tr("Enabling sudo without pass")); 134 | 135 | system("xterm -e '" 136 | "~/.ubunsys/downloads/ubuntuScripts-dev/025.enableSudoWithoutPassAll" 137 | " && " 138 | "exit" 139 | "; exec bash'"); 140 | 141 | } 142 | 143 | else if (checked == false){ 144 | qDebug() << checked; 145 | 146 | ui->statusBar->showMessage(tr("Disabling sudo without pass")); 147 | 148 | system("xterm -e '" 149 | "~/.ubunsys/downloads/ubuntuScripts-dev/026.disableSudoWithoutPassAll" 150 | " && " 151 | "exit" 152 | "; exec bash'"); 153 | 154 | } 155 | 156 | MainWindow::checkSudoWithoutPassStatus(); 157 | 158 | } 159 | 160 | //##enable sudo without pass specific - to verify 161 | 162 | void MainWindow::on_enableSudoWithoutPassSpecificButton_clicked() 163 | { 164 | system("xterm -e '" 165 | "~/.ubunsys/downloads/ubuntuScripts-dev/052.enableSudoWithoutPassSpecific" 166 | " && " 167 | "exit" 168 | "; exec bash'"); 169 | 170 | } 171 | 172 | //##disable sudo without pass specific - to verify 173 | 174 | void MainWindow::on_disableSudoWithoutPassSpecificButton_clicked() 175 | { 176 | system("xterm -e '" 177 | "~/.ubunsys/downloads/ubuntuScripts-dev/053.disableSudoWithoutPassSpecific" 178 | " && " 179 | "exit" 180 | "; exec bash'"); 181 | } 182 | 183 | //##sudoers.d - no slider terminal 184 | 185 | void MainWindow::on_openSudoersDButton_clicked() 186 | { 187 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 188 | DbManager db(path); 189 | 190 | QString status = db.getStatus("terminal"); 191 | 192 | QProcess::startDetached(status + " -e \" bash -c ~/.ubunsys/downloads/ubuntuScripts-dev/051.openSudoersD \" "); 193 | } 194 | 195 | //##hosts - no slider terminal + texteditor 196 | 197 | void MainWindow::on_openHostsButton_clicked() 198 | { 199 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 200 | DbManager db(path); 201 | 202 | QString status = db.getStatus("terminal"); 203 | QString status2 = db.getStatus("textEditor"); 204 | 205 | QProcess::startDetached(status + " -e \"sudo -i "+ status2 +" /etc/hosts \" "); 206 | } 207 | 208 | //##sudoers - special 209 | 210 | void MainWindow::on_openSudoersFileButton_clicked() 211 | { 212 | system("xterm -e '" 213 | "~/.ubunsys/downloads/ubuntuScripts-dev/027.openSudoersFile" 214 | " && " 215 | "echo Close this window!" 216 | "; exec bash'"); 217 | } 218 | 219 | void MainWindow::on_backupSudoersFileButton_clicked() 220 | { 221 | system("xterm -e '" 222 | "~/.ubunsys/downloads/ubuntuScripts-dev/028.backupSudoersFile" 223 | " && " 224 | "exit" 225 | "; exec bash'"); 226 | 227 | QMessageBox::information(this,tr("Notification"),tr("Backuped OK on \n\n") + QDir::homePath() + "/.ubunsys/backups/sudoersFiles"); 228 | } 229 | 230 | //import Sudoers - to verify 231 | 232 | void MainWindow::on_importSudoersFileButton_clicked() 233 | { 234 | QString filename=QFileDialog::getOpenFileName( 235 | this, 236 | tr("Import your sudoers file here"), 237 | QDir::homePath() + "/.ubunsys/backups/sudoersFiles", 238 | //getenv("HOME"), 239 | //"All files (*.*);;Bak files(*.bak)"); 240 | "Bak files(*.bak)"); 241 | 242 | //QMessageBox::information(this,tr("File Name"),filename); 243 | 244 | ui->statusBar->showMessage(tr("Done. sudoers file restored succesful")); 245 | 246 | // Create a new file 247 | 248 | QFile file (QDir::homePath() + "/.ubunsys/backups/sudoersFiles/restoreSudoersScript.sh"); 249 | file.open(QIODevice::WriteOnly | QIODevice::Text); 250 | QTextStream out(&file); 251 | out << "#!/bin/bash\n\nsudo cp " + filename + " /etc/sudoers"; 252 | 253 | // optional, as QFile destructor will already do it: 254 | file.close(); 255 | 256 | system("xterm -e '" 257 | "sudo chmod 777 ~/.ubunsys/backups/sudoersFiles/restoreSudoersScript.sh" 258 | "&&" 259 | "sudo ~/.ubunsys/backups/sudoersFiles/restoreSudoersScript.sh" 260 | " && " 261 | "sudo rm -Rf ~/.ubunsys/backups/sudoersFiles/restoreSudoersScript.sh" 262 | " && " 263 | "exit" 264 | "; exec bash'"); 265 | 266 | //this would normally start the event loop, but is not needed for this 267 | //minimal example: 268 | //return app.exec(); 269 | } 270 | 271 | //##firewall - slider 272 | 273 | void MainWindow::on_checkBox_firewall_clicked(bool checked) 274 | { 275 | if (checked != false){ 276 | qDebug() << checked; 277 | 278 | ui->statusBar->showMessage(tr("Enabling firewall")); 279 | 280 | system("xterm -e '" 281 | "~/.ubunsys/downloads/ubuntuScripts-dev/033.check_ufw_installed" 282 | " && " 283 | "~/.ubunsys/downloads/ubuntuScripts-dev/031.enableFirewall" 284 | " && " 285 | "exit" 286 | "; exec bash'"); 287 | } 288 | 289 | else if (checked == false){ 290 | qDebug() << checked; 291 | 292 | ui->statusBar->showMessage(tr("Disabling firewall")); 293 | 294 | system("xterm -e '" 295 | "~/.ubunsys/downloads/ubuntuScripts-dev/033.check_ufw_installed" 296 | " && " 297 | "~/.ubunsys/downloads/ubuntuScripts-dev/032.disableFirewall" 298 | " && " 299 | "exit" 300 | "; exec bash'"); 301 | 302 | } 303 | 304 | MainWindow::checkFirewallStatus(); 305 | } 306 | 307 | void MainWindow::on_configAutologinButton_clicked() 308 | { 309 | system("xterm -e '" 310 | "~/.ubunsys/downloads/ubuntuScripts-dev/configAutologin" 311 | " && " 312 | "exit" 313 | "; exec bash'"); 314 | } 315 | 316 | ////////////////////////////////POWER 317 | 318 | 319 | 320 | ////////////////////////////////EXTRAS 321 | 322 | void MainWindow::on_goMouseRateCheckerButton_clicked() 323 | { 324 | QDesktopServices::openUrl(QUrl("https://zowie.benq.com/en/support/mouse-rate-checker.html", QUrl::TolerantMode)); 325 | ui->statusBar->showMessage(tr("Go to mouse rate checker. Please wait.")); 326 | } 327 | 328 | //##Templates - no slider terminal 329 | 330 | void MainWindow::on_installTemplatesButton_clicked() 331 | { 332 | ui->statusBar->showMessage(tr("Installing templates")); 333 | 334 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 335 | DbManager db(path); 336 | 337 | QString status = db.getStatus("terminal"); 338 | 339 | QProcess::startDetached(status + " -e \" bash -c ~/.ubunsys/downloads/ubuntuScripts-dev/018.installTemplates \" "); 340 | 341 | ui->statusBar->showMessage(tr("Templates installed succesful. Now select another action")); 342 | } 343 | 344 | //##Main Backup - to verify 345 | 346 | void MainWindow::on_openMainBackupButton_clicked() 347 | { 348 | ui->statusBar->showMessage(tr("Executing Main Backup")); 349 | 350 | system("xterm -e '" 351 | "~/.ubunsys/downloads/ubuntuScripts-dev/045.mainBackup" 352 | " && " 353 | "exit" 354 | "; exec bash'"); 355 | 356 | QMessageBox::information(this,tr("Notification"),tr("Backuped OK on \n\n") + QDir::homePath() + "/.ubunsys/backups/lots"); 357 | 358 | 359 | QMessageBox::StandardButton reply; 360 | reply = QMessageBox::question(this, "Question", "Open folder where located?", 361 | QMessageBox::Yes|QMessageBox::No); 362 | if (reply == QMessageBox::Yes) { 363 | 364 | 365 | system("xterm -e '" 366 | "~/.ubunsys/downloads/ubuntuScripts-dev/074.openLots" 367 | " && " 368 | "echo Close this window!" 369 | "; exec bash'"); 370 | 371 | } 372 | } 373 | 374 | //##Main Restore - to verify 375 | 376 | void MainWindow::on_openMainRestoreButton_clicked() 377 | { 378 | QString filename=QFileDialog::getOpenFileName( 379 | this, 380 | tr("Import your main backup file here"), 381 | QDir::homePath() + "/.ubunsys/backups/lots", 382 | //getenv("HOME"), 383 | //"All files (*.*);;Bak files(*.bak)"); 384 | "ZIP files(*.zip)"); 385 | 386 | if (!filename.isNull()){ 387 | qDebug() << "No es cero"; 388 | 389 | 390 | //QMessageBox::information(this,tr("File Name"),filename); 391 | 392 | ui->statusBar->showMessage(tr("Done. Main backup restored succesful")); 393 | 394 | // Create a new file 395 | 396 | QFile file (QDir::homePath() + "/.ubunsys/backups/lots/restoremainBackup.sh"); 397 | file.open(QIODevice::WriteOnly | QIODevice::Text); 398 | QTextStream out(&file); 399 | out << "#!/bin/bash\n\nsudo unzip -d ~/.ubunsys/backups/ " + filename; 400 | 401 | // optional, as QFile destructor will already do it: 402 | file.close(); 403 | 404 | system("xterm -e '" 405 | "sudo chmod 777 ~/.ubunsys/backups/lots/restoremainBackup.sh" 406 | "&&" 407 | "sudo ~/.ubunsys/backups/lots/restoremainBackup.sh" 408 | " && " 409 | "sudo rm -Rf ~/.ubunsys/backups/lots/restoremainBackup.sh" 410 | " && " 411 | "exit" 412 | "; exec bash'"); 413 | 414 | 415 | // ui->statusBar->showMessage(tr("Executing Main Restore")); 416 | 417 | system("xterm -e '" 418 | "~/.ubunsys/downloads/ubuntuScripts-dev/046.mainRestore" 419 | " && " 420 | "exit" 421 | "; exec bash'"); 422 | 423 | QMessageBox::information(this,tr("Notification"),tr("Restored all OK")); 424 | } 425 | 426 | } 427 | 428 | //##rc.local - no slider terminal + texteditor 429 | 430 | void MainWindow::on_openRCLocalButton_clicked() 431 | { 432 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 433 | DbManager db(path); 434 | 435 | QString status = db.getStatus("terminal"); 436 | QString status2 = db.getStatus("textEditor"); 437 | 438 | QProcess::startDetached(status + " -e \"sudo -i "+ status2 +" /etc/rc.local \" "); 439 | } 440 | 441 | //##HiddenStartupItems - slider 442 | 443 | void MainWindow::on_checkBoxHiddenStartupItems_clicked(bool checked) 444 | { 445 | if (checked != false){ 446 | qDebug() << checked; 447 | system("xterm -e '" 448 | "~/.ubunsys/downloads/ubuntuScripts-dev/038.showHiddenStartupItems" 449 | " && " 450 | "exit" 451 | "; exec bash'"); 452 | } 453 | 454 | else if (checked == false){ 455 | qDebug() << checked; 456 | system("xterm -e '" 457 | "~/.ubunsys/downloads/ubuntuScripts-dev/037.unshowHiddenStartupItems" 458 | " && " 459 | "exit" 460 | "; exec bash'"); 461 | } 462 | 463 | MainWindow::checkHiddenStartupItemsStatus(); 464 | 465 | } 466 | 467 | //##dualBoot - no slider terminal 468 | 469 | void MainWindow::on_runGrubcustomizerButton_clicked() 470 | { 471 | process->start("sh", QStringList() << "-c" << "~/.ubunsys/downloads/ubuntupackages-master/apps1/grub-customizer && sudo grub-customizer"); 472 | } 473 | 474 | //##Sync Time - no slider terminal 475 | 476 | void MainWindow::on_runSyncTime_clicked() 477 | { 478 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 479 | DbManager db(path); 480 | 481 | QString status = db.getStatus("terminal"); 482 | 483 | QProcess::startDetached(status + " -e \" bash -c ~/.ubunsys/downloads/ubuntuScripts-dev/changeLinuxtoWindowsTime \" "); 484 | } 485 | 486 | 487 | //##edit grub - no slider terminal + texteditor 488 | 489 | void MainWindow::on_editGrubButton_clicked() 490 | { 491 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 492 | DbManager db(path); 493 | 494 | QString status = db.getStatus("terminal"); 495 | QString status2 = db.getStatus("textEditor"); 496 | 497 | QProcess::startDetached(status + " -e \"sudo -i "+ status2 +" /etc/default/grub \" "); 498 | } 499 | 500 | //##update grub - no slider terminal 501 | 502 | void MainWindow::on_updateGrubButton_clicked() 503 | { 504 | process->start("sh", QStringList() << "-c" << "~/.ubunsys/downloads/ubuntuScripts-dev/081.updateGrub"); 505 | 506 | } 507 | 508 | //##resetDconf - reserved 509 | 510 | void MainWindow::on_resetDconf_clicked() 511 | { 512 | QMessageBox::StandardButton reply; 513 | reply = QMessageBox::question(this, "Warning", "Are you completely sure?", 514 | QMessageBox::Yes|QMessageBox::No); 515 | if (reply == QMessageBox::Yes) { 516 | qDebug() << "Yes was clicked"; 517 | //QApplication::quit(); 518 | 519 | system("xterm -e '" 520 | "~/.ubunsys/downloads/ubuntuScripts-dev/057.resetDconf" 521 | " && " 522 | "echo Close this window!" 523 | "; exec bash'"); 524 | } else { 525 | qDebug() << "Yes was *not* clicked"; 526 | } 527 | 528 | } 529 | 530 | //##asterisks - slider 531 | 532 | void MainWindow::on_checkBoxAsterisks_clicked(bool checked) 533 | { 534 | if (checked == true){ 535 | qDebug() << checked; 536 | system("xterm -e '" 537 | "~/.ubunsys/downloads/ubuntuScripts-dev/021.doVisibleAsterisks" 538 | " && " 539 | "exit" 540 | "; exec bash'"); 541 | } 542 | 543 | else if (checked == false){ 544 | qDebug() << checked; 545 | system("xterm -e '" 546 | "~/.ubunsys/downloads/ubuntuScripts-dev/022.doInvisibleAsterisks" 547 | " && " 548 | "exit" 549 | "; exec bash'"); 550 | } 551 | 552 | MainWindow::checkAsterisksStatus(); 553 | 554 | } 555 | 556 | //##hibernation - slider 557 | 558 | void MainWindow::on_checkBoxHibernation_clicked(bool checked) 559 | { 560 | if (checked == true){ 561 | qDebug() << checked; 562 | system("xterm -e '" 563 | "~/.ubunsys/downloads/ubuntuScripts-dev/007.enableHibernation" 564 | " && " 565 | "exit" 566 | "; exec bash'"); 567 | } 568 | 569 | else if (checked == false){ 570 | qDebug() << checked; 571 | system("xterm -e '" 572 | "~/.ubunsys/downloads/ubuntuScripts-dev/024.disableHibernation" 573 | " && " 574 | "exit" 575 | "; exec bash'"); 576 | } 577 | 578 | MainWindow::checkHibernationStatus(); 579 | } 580 | 581 | //##lock screen - slider 582 | 583 | void MainWindow::on_checkBoxLockScreen_clicked(bool checked) 584 | { 585 | if (checked == true){ 586 | qDebug() << checked; 587 | system("xterm -e '" 588 | "~/.ubunsys/downloads/ubuntuScripts-dev/036.enableLockScreen" 589 | " && " 590 | "exit" 591 | "; exec bash'"); 592 | } 593 | 594 | else if (checked == false){ 595 | qDebug() << checked; 596 | system("xterm -e '" 597 | "~/.ubunsys/downloads/ubuntuScripts-dev/035.disableLockScreen" 598 | " && " 599 | "exit" 600 | "; exec bash'"); 601 | } 602 | 603 | MainWindow::checkLockScreenStatus(); 604 | } 605 | 606 | //##login sound - slider 607 | 608 | void MainWindow::on_checkBoxLoginSound_clicked(bool checked) 609 | { 610 | if (checked == true){ 611 | qDebug() << checked; 612 | 613 | system("xterm -e '" 614 | "~/.ubunsys/downloads/ubuntuScripts-dev/039.enableLoginSound" 615 | " && " 616 | "exit" 617 | "; exec bash'"); 618 | } 619 | 620 | else if (checked == false){ 621 | qDebug() << checked; 622 | 623 | system("xterm -e '" 624 | "~/.ubunsys/downloads/ubuntuScripts-dev/040.disableLoginSound" 625 | " && " 626 | "exit" 627 | "; exec bash'"); 628 | } 629 | 630 | MainWindow::checkLoginSoundStatus(); 631 | } 632 | 633 | //##fonts 634 | 635 | void MainWindow::on_installInfinalityFontsButton_clicked() 636 | { 637 | system("xterm -e '" 638 | "~/.ubunsys/downloads/ubuntupackages-master/apps1/infinality-fonts" 639 | " && " 640 | "exit" 641 | "; exec bash'"); 642 | } 643 | 644 | void MainWindow::on_uninstallInfinalityFontsButton_clicked() 645 | { 646 | system("xterm -e '" 647 | "~/.ubunsys/downloads/ubuntuScripts-dev/082.uninstallInfinalityFonts" 648 | " && " 649 | "exit" 650 | "; exec bash'"); 651 | } 652 | 653 | void MainWindow::on_InfinalityFontsGeneralStylesButton_clicked() 654 | { 655 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 656 | DbManager db(path); 657 | 658 | QString status = db.getStatus("terminal"); 659 | 660 | QProcess::startDetached(status + " -e \"sudo bash /etc/fonts/infinality/infctl.sh setstyle \" "); 661 | } 662 | 663 | void MainWindow::on_InfinalityFontsInfinalityStylesButton_clicked() 664 | { 665 | static const QString path (QDir::homePath() + "/.ubunsys/configurations/config.db"); 666 | DbManager db(path); 667 | 668 | QString status = db.getStatus("terminal"); 669 | QString status2 = db.getStatus("textEditor"); 670 | 671 | QProcess::startDetached(status + " -e \"sudo -H "+ status2 +" /etc/profile.d/infinality-settings.sh\" "); 672 | } 673 | 674 | 675 | void MainWindow::on_generalInfoButton_clicked() 676 | { 677 | system("xterm -e '" 678 | "sudo apt install -y neofetch" 679 | " && " 680 | " clear " 681 | " && " 682 | "neofetch -n" 683 | "; exec bash'"); 684 | } 685 | --------------------------------------------------------------------------------