From efaaceb99533e06efa5bafe567c4dec55abc111d Mon Sep 17 00:00:00 2001 From: Lutz Eichler Date: Fri, 23 Sep 2016 23:15:11 +0200 Subject: [PATCH] improve some GUI elements in combination with macro tab There are some contraints in using the TAB area for configuration. because of too many elements neccessary for the macro GUI, The font size had been set to 12px fix. If you find that is to small, you can change it by installing an own stylesheet file and calling ckb with ckb -stylesheet= The complete TAB area (better the surrounding areas) should be redesigned... --- migmac.sh | 48 +++++++++++++++++++++++ src/ckb/macromigrationtip.cpp | 14 +++++++ src/ckb/macromigrationtip.h | 22 +++++++++++ src/ckb/macromigrationtip.ui | 71 +++++++++++++++++++++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100755 migmac.sh create mode 100644 src/ckb/macromigrationtip.cpp create mode 100644 src/ckb/macromigrationtip.h create mode 100644 src/ckb/macromigrationtip.ui diff --git a/migmac.sh b/migmac.sh new file mode 100755 index 00000000..17c2870a --- /dev/null +++ b/migmac.sh @@ -0,0 +1,48 @@ +#!/bin/bash +SAVEFILE=~/.config/ckb/ckb.conf + +################### +# +# Change the format of macro definitons from 4- to 5-parts. +# +# + +# Find a line, beginning with '$macro:', +# followed by exact 3 colon-separated strings. +# The may not be a 4th string (it would be the new format). +# If found, add a ':x' at the end. +# Otherwise just print it. +SEDLINE='/$macro:[^:]*:[^:]*:[^:]*$/s/$/:x/' + +cp $SAVEFILE $SAVEFILE.orig + +# some statistics +echo -n "how many \$macro:-Statements to deal with: " +grep "$macro:" $SAVEFILE | wc -l + +echo -n "That number entries do we find: " +sed -e $SEDLINE $SAVEFILE | grep "$macro:" | wc -l + +echo -n "how many lines without \$macro:-statements: " +grep -v "$macro:" $SAVEFILE | wc -l + +echo -n "That many entries are ignored: " +sed -e $SEDLINE $SAVEFILE | grep -v "$macro:" | wc -l + +read -p "Is the information correct? [y|n] " RL +RL=${RL:-n} + +if [[ ${RL} != "y" ]]; then + echo you typed $RL. + echo "Aborted." + exit -1; +fi + +echo you typed $RL. +sed -e $SEDLINE $SAVEFILE > $SAVEFILE.new +rm -f $SAVEFILE +mv $SAVEFILE.new $SAVEFILE +wc $SAVEFILE +grep :x$ $SAVEFILE + +exit 0 diff --git a/src/ckb/macromigrationtip.cpp b/src/ckb/macromigrationtip.cpp new file mode 100644 index 00000000..1eaab700 --- /dev/null +++ b/src/ckb/macromigrationtip.cpp @@ -0,0 +1,14 @@ +#include "macromigrationtip.h" +#include "ui_macromigrationtip.h" + +macroMigrationTip::macroMigrationTip(QWidget *parent) : + QDialog(parent), + ui(new Ui::macroMigrationTip) +{ + ui->setupUi(this); +} + +macroMigrationTip::~macroMigrationTip() +{ + delete ui; +} diff --git a/src/ckb/macromigrationtip.h b/src/ckb/macromigrationtip.h new file mode 100644 index 00000000..bd3018a2 --- /dev/null +++ b/src/ckb/macromigrationtip.h @@ -0,0 +1,22 @@ +#ifndef MACROMIGRATIONTIP_H +#define MACROMIGRATIONTIP_H + +#include + +namespace Ui { +class macroMigrationTip; +} + +class macroMigrationTip : public QDialog +{ + Q_OBJECT + +public: + explicit macroMigrationTip(QWidget *parent = 0); + ~macroMigrationTip(); + +private: + Ui::macroMigrationTip *ui; +}; + +#endif // MACROMIGRATIONTIP_H diff --git a/src/ckb/macromigrationtip.ui b/src/ckb/macromigrationtip.ui new file mode 100644 index 00000000..cdca67b3 --- /dev/null +++ b/src/ckb/macromigrationtip.ui @@ -0,0 +1,71 @@ + + + + + macroMigrationTip + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 240 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + buttonBox + accepted() + macroMigrationTip + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + macroMigrationTip + reject() + + + 316 + 260 + + + 286 + 274 + + + + +