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 + + + + +