Skip to content

Commit

Permalink
added compression settings dropdown; removed 'edit configuration file…
Browse files Browse the repository at this point in the history
…' button
  • Loading branch information
AdrianTM committed Sep 1, 2019
1 parent aa50fe0 commit 4af1d28
Show file tree
Hide file tree
Showing 60 changed files with 5,009 additions and 4,235 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
mx-snapshot (19.8.4) mx; urgency=medium

* added compression settings dropdown
* removed "edit configuration file" button

-- Adrian <adrian@mxlinux.org> Sat, 31 Aug 2019 23:12:10 -0400

mx-snapshot (19.8.3) mx; urgency=medium

* fix: allow about/help to run while calculating space used by system
Expand Down
32 changes: 0 additions & 32 deletions debs/mx-snapshot_19.8.3.dsc

This file was deleted.

Binary file removed debs/mx-snapshot_19.8.3.tar.xz
Binary file not shown.
49 changes: 0 additions & 49 deletions debs/mx-snapshot_19.8.3_amd64.changes

This file was deleted.

Binary file removed debs/mx-snapshot_19.8.3_amd64.deb
Binary file not shown.
Binary file removed debs/mx-snapshot_19.8.3_i386.deb
Binary file not shown.
32 changes: 32 additions & 0 deletions debs/mx-snapshot_19.8.4.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 3.0 (native)
Source: mx-snapshot
Binary: mx-snapshot
Architecture: any
Version: 19.8.4
Maintainer: Adrian <adrian@mxlinux.org>
Standards-Version: 3.9.8
Vcs-Git: git://github.com/AdrianTM/mx-snapshot
Build-Depends: debhelper (>= 9), libcmd, qt5-qmake, qtbase5-dev, qttools5-dev-tools
Package-List:
mx-snapshot deb admin optional arch=any
Checksums-Sha1:
96cb6ffc11b0b0cec83b1b6a9bb1a92196351898 161620 mx-snapshot_19.8.4.tar.xz
Checksums-Sha256:
f369a24c10de57b7d4b4ada144b89940e575d293cca8d8c399b6a7a5c22c9882 161620 mx-snapshot_19.8.4.tar.xz
Files:
4a52808bc7667ef1159a0499b6bdbed2 161620 mx-snapshot_19.8.4.tar.xz

-----BEGIN PGP SIGNATURE-----

iQFHBAEBCAAxFiEE8ndToY6S45N+YzXncJOMeAZ57pgFAl1rN8ETHGFkcmlhbkBt
eGxpbnV4Lm9yZwAKCRBwk4x4BnnumCh3B/0T52x2AO0FtIxm49S7f3cLVGsc9S1z
+fpKZx3EoIKvCL3AW5Cm9KyNoyvSIe3GalEhiB7e4D+JfVL7f6WdX4Cvcx4Q3gvv
Ts4nXEN2qRg/cDlYIguQP+4uL70NgSMvRax4hhKCjOIRCxM0EGcZh9LjKNrjf3tu
Ssn2oy9K/1fWH8cyg3yuJYoNoSlf6WXO9cCfT1y112Aq1zgqcHMg0z3g+Z3BBFKf
V9+/lD/9al8Nr5avFoNwkp9ZLPYA0oT8eRxeqqww2GsCH7V+5twb2BhX9lS8c107
OSo1tQS+tmFmdCtcH7ZlQaBd2OadmBUG9JCJZ+mUROFW1aZsw8euDi22
=aW5x
-----END PGP SIGNATURE-----
Binary file added debs/mx-snapshot_19.8.4.tar.xz
Binary file not shown.
50 changes: 50 additions & 0 deletions debs/mx-snapshot_19.8.4_amd64.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 31 Aug 2019 23:12:10 -0400
Source: mx-snapshot
Binary: mx-snapshot
Architecture: source amd64
Version: 19.8.4
Distribution: mx
Urgency: medium
Maintainer: Adrian <adrian@mxlinux.org>
Changed-By: Adrian <adrian@mxlinux.org>
Description:
mx-snapshot - MX Snapshot
Changes:
mx-snapshot (19.8.4) mx; urgency=medium
.
* added compression settings dropdown
* removed "edit configuration file" button
Checksums-Sha1:
36f49c725f36f447289be223a4c63a3bb9057417 1190 mx-snapshot_19.8.4.dsc
96cb6ffc11b0b0cec83b1b6a9bb1a92196351898 161620 mx-snapshot_19.8.4.tar.xz
2c1f74bfec0f9cd1434ee587d083e15f96598817 545708 mx-snapshot-dbgsym_19.8.4_amd64.deb
f1e24346d32eb0bd390ca5575b611f6ddb32ebd0 11202 mx-snapshot_19.8.4_amd64.buildinfo
d6bf93744cf8180c492b0408378d99008d0aa7e4 192062 mx-snapshot_19.8.4_amd64.deb
Checksums-Sha256:
5709e75057602450d13e05486249aa8a403538e97067b48d8cb3a8814426d2a3 1190 mx-snapshot_19.8.4.dsc
f369a24c10de57b7d4b4ada144b89940e575d293cca8d8c399b6a7a5c22c9882 161620 mx-snapshot_19.8.4.tar.xz
b25fbd4b8c1ea34a52895a8c026ac599c0ee72f79474f8f5cf421ba6a0c32e78 545708 mx-snapshot-dbgsym_19.8.4_amd64.deb
133403f8d1bfcfa644432f3eadbbfb9c96b5f643bb442e3ff54661817e31649f 11202 mx-snapshot_19.8.4_amd64.buildinfo
c388d708d6616a23c5a3b9c5aabd729728a770499931433236e0836dfb66b016 192062 mx-snapshot_19.8.4_amd64.deb
Files:
d1baf714f4d241681308da84fbbf06f2 1190 admin optional mx-snapshot_19.8.4.dsc
4a52808bc7667ef1159a0499b6bdbed2 161620 admin optional mx-snapshot_19.8.4.tar.xz
adb7de779f282d7108b33dd3fc6c05d8 545708 debug optional mx-snapshot-dbgsym_19.8.4_amd64.deb
8bbdf1a94a3284a72651db0d22ca9bbf 11202 admin optional mx-snapshot_19.8.4_amd64.buildinfo
906381e13083baf5809289951f9c6d8a 192062 admin optional mx-snapshot_19.8.4_amd64.deb

-----BEGIN PGP SIGNATURE-----

iQFHBAEBCAAxFiEE8ndToY6S45N+YzXncJOMeAZ57pgFAl1rN8ITHGFkcmlhbkBt
eGxpbnV4Lm9yZwAKCRBwk4x4BnnumCvHCADOLe+OrPSAVR2T02L13ip6zoJU7aZ2
+DTvQGpMJ3yyxqqaNEy9uQLCZbuaFym1eBcD9I9Xcar//5Cybr4NkwcCQZ9Cp/Ze
XA9a2rR7vMB3lqLjJYmjfVIVIxJsRwO6WQkA+vBCl69MJwbX5bF2P0iCjaLx4Wky
20LcoGawc6ssYjeaYEARYl61vRSjOJJ8v5u8zEOlBwNW9ej+TGO6+KHl3Clzc9rr
W5re6iu/UqTpBYtXmd5m6poyqgB9pECvmYcO89qKASz78I2j3T6hBXTwXUU23Ibl
OWFmIXMLZuLZiTzzvBaa4Ibxnf+fKacuiRd7PKozE57CI1H0+iB0rezV
=dBNR
-----END PGP SIGNATURE-----
Binary file added debs/mx-snapshot_19.8.4_amd64.deb
Binary file not shown.
Binary file added debs/mx-snapshot_19.8.4_i386.deb
Binary file not shown.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int main(int argc, char *argv[])
a.installTranslator(&appTran);

// Check if SQUASHFS is available
if (system("[ -f /boot/config-$(uname -r) ]") == 0 && system("grep ^CONFIG_SQUASHFS=[ym] /boot/config-$(uname -r)") != 0) {
if (system("[ -f /boot/config-$(uname -r) ]") == 0 && system("grep -q ^CONFIG_SQUASHFS=[ym] /boot/config-$(uname -r)") != 0) {
QMessageBox::critical(0, QApplication::tr("Error"),
QApplication::tr("Current kernel doesn't support Squashfs, cannot continue."));
return EXIT_FAILURE;
Expand Down
43 changes: 21 additions & 22 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList args) :
QDialog(parent),
ui(new Ui::MainWindow)
{
qDebug() << "Program Version:" << VERSION;
qDebug().noquote() << QCoreApplication::applicationName() << "version:" << VERSION;
ui->setupUi(this);
setWindowFlags(Qt::Window); // for the close, min and max buttons
shell = new Cmd(this);
Expand Down Expand Up @@ -78,6 +78,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList args) :
if (args.contains("--monthly") || args.contains("-m")) {
QString name = shell->getOutput("cat /etc/mx-version | cut -f1 -d' '");
ui->lineEditName->setText(name.section("_", 0, 0) + "_" + QDate::currentDate().toString("MMMM") + "_" + name.section("_", 1, 1) + ".iso");
ui->cbCompression->setCurrentIndex(ui->cbCompression->findText("xz")); // use XZ by default on Monthly snapshots
ui->buttonNext->click();
ui->radioRespin->click();
ui->buttonNext->click();
Expand Down Expand Up @@ -105,7 +106,8 @@ void MainWindow::loadSettings()
snapshot_basename = settings.value("snapshot_basename", "snapshot").toString();
make_md5sum = settings.value("make_md5sum", "no").toString();
make_isohybrid = settings.value("make_isohybrid", "yes").toString();
mksq_opt = settings.value("mksq_opt", "-comp xz").toString();
compression = settings.value("compression", "lz4").toString();
mksq_opt = settings.value("mksq_opt").toString();
edit_boot_menu = settings.value("edit_boot_menu", "no").toString();
lib_mod_dir = settings.value("lib_mod_dir", "/lib/modules/").toString();
gui_editor.setFileName(settings.value("gui_editor", "/usr/bin/featherpad").toString());
Expand All @@ -129,6 +131,8 @@ void MainWindow::setup()

loadSettings();
listFreeSpace();

ui->cbCompression->setCurrentIndex(ui->cbCompression->findText(compression));
}


Expand Down Expand Up @@ -579,7 +583,7 @@ bool MainWindow::createIso(QString filename)
// squash the filesystem copy
QDir::setCurrent(work_dir);
QString cmd;
cmd = "mksquashfs /.bind-root iso-template/antiX/linuxfs " + mksq_opt + " -wildcards -ef " + snapshot_excludes.fileName() + " " + session_excludes;
cmd = "mksquashfs /.bind-root iso-template/antiX/linuxfs -comp " + compression + ((mksq_opt.isEmpty()) ? "" : " " + mksq_opt) + " -wildcards -ef " + snapshot_excludes.fileName() + " " + session_excludes;

ui->outputLabel->setText(tr("Squashing filesystem..."));
displayOutput();
Expand Down Expand Up @@ -706,13 +710,11 @@ void MainWindow::displayDoc(QString url)
proc.start("logname");
proc.waitForFinished();
QString user = proc.readAllStandardOutput().trimmed();
QString exec = "xdg-open";
Cmd cmd;
if (cmd.run("command -v mx-viewer") == 0) { // use mx-viewer if available
exec = "mx-viewer";
if (system("command -v mx-viewer >/dev/null") == 0) {
system("mx-viewer " + url.toUtf8());
} else {
system("su " + user.toUtf8() + " -c \"env XDG_RUNTIME_DIR=/run/user/$(id -u " + user.toUtf8() + ") xdg-open " + url.toUtf8() + "\"&");
}
QString cmd_str = "su " + user + " -c \"env XDG_RUNTIME_DIR=/run/user/$(id -u " + user + ") " + exec + " " + url + "\"&";
cmd.run(cmd_str);
}

// check if compression is available in the kernel (lz4, lzo, xz)
Expand All @@ -721,11 +723,11 @@ bool MainWindow::checkCompression()
if (shell->run("[ -f /boot/config-$(uname -r) ]") != 0) { // return true if cannot check config file
return true;
}
if (mksq_opt.contains("lz4")) {
if (compression == "lz4") {
return (shell->run("grep ^CONFIG_SQUASHFS_LZ4=y /boot/config-$(uname -r)") == 0);
} else if (mksq_opt.contains("xz")) {
} else if (compression == "xz") {
return (shell->run("grep ^CONFIG_SQUASHFS_XZ=y /boot/config-$(uname -r)") == 0);
} else if (mksq_opt.contains("lzo")) {
} else if (compression == "lzo") {
return (shell->run("grep ^CONFIG_SQUASHFS_LZO=y /boot/config-$(uname -r)") == 0);
} else {
return true;
Expand Down Expand Up @@ -799,7 +801,6 @@ void MainWindow::on_buttonNext_clicked()
ui->label_2->setText("\n" + tr("- Snapshot directory:") + " " + snapshot_dir.absolutePath() + "\n" +
"- " + tr("Snapshot name:") + " " + file_name + "\n" +
tr("- Kernel to be used:") + " " + kernel_used + "\n");
ui->label_3->setText(tr("*These settings can be changed by editing: ") + config_file.fileName());

// on settings page
} else if (ui->stackedWidget->currentWidget() == ui->settingsPage) {
Expand Down Expand Up @@ -859,13 +860,6 @@ void MainWindow::on_buttonBack_clicked()
ui->outputBox->clear();
}

void MainWindow::on_buttonEditConfig_clicked()
{
this->hide();
shell->run(getEditor() + " " + config_file.fileName());
setup();
}

void MainWindow::on_buttonEditExclude_clicked()
{
this->hide();
Expand Down Expand Up @@ -950,7 +944,6 @@ void MainWindow::on_radioPersonal_clicked(bool checked)
// About button clicked
void MainWindow::on_buttonAbout_clicked()
{
this->hide();
QMessageBox msgBox(QMessageBox::NoIcon,
tr("About MX Snapshot"), "<p align=\"center\"><b><h2>" +
tr("MX Snapshot") + "</h2></b></p><p align=\"center\">" + tr("Version: ") +
Expand Down Expand Up @@ -986,7 +979,6 @@ void MainWindow::on_buttonAbout_clicked()
changelog->setLayout(layout);
changelog->exec();
}
this->show();
}

// Help button clicked
Expand Down Expand Up @@ -1041,3 +1033,10 @@ void MainWindow::on_buttonCancel_clicked()
{
closeApp();
}

void MainWindow::on_cbCompression_currentIndexChanged(const QString &arg1)
{
QSettings settings(config_file.fileName(), QSettings::IniFormat);
settings.setValue("compression", arg1);
compression = arg1;
}
5 changes: 3 additions & 2 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class MainWindow : public QDialog

void addRemoveExclusion(bool add, QString exclusion);
void displayDoc(QString url);
QSettings settings;
QStringList args;

bool checkCompression();
Expand All @@ -72,6 +71,7 @@ class MainWindow : public QDialog
QString kernel_used;
QString make_isohybrid;
QString make_md5sum;
QString compression;
QString mksq_opt;
QString save_message;
QString session_excludes;
Expand Down Expand Up @@ -133,7 +133,6 @@ private slots:
void on_buttonAbout_clicked();
void on_buttonBack_clicked();
void on_buttonCancel_clicked();
void on_buttonEditConfig_clicked();
void on_buttonEditExclude_clicked();
void on_buttonHelp_clicked();
void on_buttonNext_clicked();
Expand All @@ -148,6 +147,8 @@ private slots:
void on_radioPersonal_clicked(bool checked);


void on_cbCompression_currentIndexChanged(const QString &arg1);

private:
Ui::MainWindow *ui;
Cmd *shell;
Expand Down
Loading

0 comments on commit 4af1d28

Please sign in to comment.