#!/bin/sh # Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST # Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015 Eric Hameleers, Eindhoven, Netherlands # Copyright 2015-2017 Thorn Inurcide # Copyright 2015-2017 tde-slackbuilds project on GitHub # All rights reserved. # # Permission to use, copy, modify, and distribute this software for # any purpose with or without fee is hereby granted, provided that # the above copyright notice and this permission notice appear in all # copies. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. PRGNAM=kvkbd VERSION=$TDEVERSION BUILD=${BUILD:-1} TAG=${TAG:-_tde} source ../../get-source.sh getsource_fn untar_fn ## copy the helpfile docs to the build tree cp -a $SB_SRCDIR/doc . ## remove meinproc --check - there are a number of validity errors relating to the use of etc., ## which I feel provides a better presentation. The help file displays as intended. sed -i 's|--check --cache index.cache.bz2|--cache index.cache.bz2|' cmake/modules/TDEMacros.cmake ## copy translations cp $SB_SRCDIR/translations/messages/* translations/messages/ ## add translatable strings to template echo ' #: MainWidget.cpp:535 msgid "Help" msgstr "" #: MainWidget.cpp:562 msgid "Configure" msgstr ""' >> translations/messages/kvkbd.pot ## [2] change num-pad keys text [[ $(cat $TMPVARS/Kvkbd_OPTS) == *numpad* ]] && { echo -e "\033[36;1m"'patching for num-pad text ..'"\033[0m" patch -N -p0 << EOF || true --- src/MainWidget.cpp +++ src/MainWidget.cpp @@ -408 +408 @@ - TQString txt[9] = { "Ho\nme", TQString::fromUtf8("▲"), "Pg\nUp", + TQString txt[9] = { TQString::fromUtf8("H\u2190"), TQString::fromUtf8("▲"), TQString::fromUtf8("P\u2191"), @@ -410 +410 @@ - "End", TQString::fromUtf8("▼"), "Pg\nDn" }; + TQString::fromUtf8("E\u2192"), TQString::fromUtf8("▼"), TQString::fromUtf8("P\u2193") }; @@ -453 +453 @@ - numl->setText("Num\nLock"); + numl->setText(TQString::fromUtf8("\u2116")); @@ -479 +479 @@ - ent->setText("En\nter"); + ent->setText("Ent"); EOF } ## [3] set small icons to better fit on buttons for keyboard used at default size [[ $(cat $TMPVARS/Kvkbd_OPTS) == *icons* ]] && { echo -e "\033[36;1m"'patching for small icons ..'"\033[0m" patch -N -p0 << EOF || true --- src/MainWidget.cpp +++ src/MainWidget.cpp @@ -380 +380 @@ - quit->setPixmap(TQIconSet(SmallIcon("application-exit", TDEIcon::SizeMedium)).pixmap()); + quit->setPixmap(TQIconSet(SmallIcon("application-exit")).pixmap()); @@ -391 +391 @@ - extent->setPixmap(TQIconSet(SmallIcon("media-seek-backward", TDEIcon::SizeMedium)).pixmap()); + extent->setPixmap(TQIconSet(SmallIcon("media-seek-backward")).pixmap()); @@ -396 +396 @@ - extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward", TDEIcon::SizeMedium)).pixmap()); + extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap()); @@ -561 +561 @@ - popup_menu->setPixmap(TQIconSet(SmallIcon("configure", TDEIcon::SizeMedium)).pixmap()); + popup_menu->setPixmap(TQIconSet(SmallIcon("configure")).pixmap()); @@ -748 +748 @@ - extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward", TDEIcon::SizeMedium)).pixmap()); + extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap()); @@ -754 +754 @@ - extent->setPixmap(TQIconSet(SmallIcon("media-seek-backward", TDEIcon::SizeMedium)).pixmap()); + extent->setPixmap(TQIconSet(SmallIcon("media-seek-backward")).pixmap()); EOF } ## configuration menu sed -i 's|Font \.\.\.|Font|;s|Keys color|Key color|' {src/MainWidget.cpp,translations/messages/*} patch -N -p0 << EOF || true --- src/MainWidget.cpp +++ src/MainWidget.cpp @@ -520,0 +521 @@ + m->insertSeparator(); EOF ## key spacing & sizing patch -N -p0 << EOF || true --- src/MainWidget.cpp +++ src/MainWidget.cpp @@ -323 +323 @@ - lalt->move ( lwin->x() +lwin->width() +6, sty+ ( 5*35 ) ); + lalt->move ( lwin->x() +lwin->width() +5, sty+ ( 5*35 ) ); @@ -340 +340 @@ - ralt->resize ( 48,30 ); + ralt->resize ( 50,30 ); @@ -350 +350 @@ - rwin->resize ( 48,30 ); + rwin->resize ( 50,30 ); @@ -359 +359 @@ - mnu->resize ( 49,30 ); + mnu->resize ( 50,30 ); @@ -369 +369 @@ - rctrl->resize ( 49,30 ); + rctrl->resize ( 45,30 ); @@ -379 +379 @@ - quit->move ( 524,15 ); + quit->move ( 526,15 ); @@ -388 +388 @@ - extent->move (524, 85 ); + extent->move (526, 85 ); @@ -558 +558 @@ - popup_menu->move ( 524,15+35 ); + popup_menu->move ( 526,15+35 ); @@ -959 +959 @@ - resize ( 96,47 ); + resize ( 64,31 ); EOF ## [4] blank character display where AltGr does not provide extra characters [[ $(cat $TMPVARS/Kvkbd_OPTS) == *blank* ]] && { echo -e "\033[36;1m"'patching for blank keys ..'"\033[0m" patch -N -p0 << EOF || true --- src/VButton.cpp +++ src/VButton.cpp @@ -56,6 +56,6 @@ - if (c == " ") - { - // use normal text in case altGr does not provide extra characters. - // This is required at least on US keyboards, where altGr works as Alt. - c = nc; - } +// if (c == " ") +// { +// // use normal text in case altGr does not provide extra characters. +// // This is required at least on US keyboards, where altGr works as Alt. +// c = nc; +// } @@ -74,6 +74,6 @@ - if (c == " ") - { - // use shift text in case altGr does not provide extra characters. - // This is required at least on US keyboards, where altGr works as Alt. - c = sc; - } +// if (c == " ") +// { +// // use shift text in case altGr does not provide extra characters. +// // This is required at least on US keyboards, where altGr works as Alt. +// c = sc; +// } EOF } ## [1] generate keycode for Win keys with single click so that they can be used for xmodmap [[ $(cat $TMPVARS/Kvkbd_OPTS) != *Winlock* ]] && { echo -e "\033[36;1m"'patching for no-lock Win keys ..'"\033[0m" patch -N -p0 << EOF || true --- src/MainWidget.cpp +++ src/MainWidget.cpp # ## don't lock the LWin button @@ -317 +317 @@ - lwin->setToggleButton ( true ); + lwin->setToggleButton ( false ); ## generate keycode on click rather than wait for next key-click @@ -318 +318,2 @@ - mod_keys.append ( lwin ); + connect ( lwin, TQ_SIGNAL ( keyClick ( unsigned int ) ), this, TQ_SLOT ( keyPress ( unsigned int ) ) ); + other_keys.append( lwin ); # ## don't lock the RWin button @@ -354 +355 @@ - rwin->setToggleButton ( true ); + rwin->setToggleButton ( false ); ## generate keycode on click rather than wait for next key-click @@ -355 +356,2 @@ - mod_keys.append ( rwin ); + connect ( rwin, TQ_SIGNAL ( keyClick ( unsigned int ) ), this, TQ_SLOT ( keyPress ( unsigned int ) ) ); + other_keys.append( rwin ); EOF } ## for slack-desc langs="en";for Lang in $I18N;do [[ -s translations/messages/$Lang.po ]] && langs="$langs $Lang";done listdocs_fn chown_fn cd_builddir_fn cmake ${G_NINJA:-} -C $TMPVARS/CMAKE_CACHE ${CMAKE_OPTS:-} make_fn installdocs_fn strip_fn mkdir_install_fn doinst_sh_fn echo " # HOW TO EDIT THIS FILE: # The 'handy ruler' below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| $PRGNAM: A virtual keyboard for TDE $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: With language support for: $PRGNAM: $langs $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: " > $PKG/install/slack-desc makepkg_fn