Commit baa01d21 authored by Simon Josefsson's avatar Simon Josefsson

Imported Upstream version 3.1.11

parent 25fe0db6
Author: Yubico
Basename: yubikey-personalization-gui
Homepage: http://opensource.yubico.com/yubikey-personalization-gui/
License: BSD-2-Clause
Name: yubikey-personalization-gui
Project: yubikey-personalization-gui
Summary: Qt based Cross-Platform YubiKey Personalization Tool
Yubico-Category: YubiKey Personalization
2013-10-09 Klas Lindfors <klas@yubico.com>
* NEWS: release 3.1.11
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/help.h, src/yubikeylogger.cpp: add endl and tab variables to
logging
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/yubikeylogger.cpp, src/yubikeylogger.h: make the logging local
resolver take the name as string to reduce the amount of similar resolvers
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/ui/settingpage.cpp: disable the format edit when not in
flexible format
2013-09-26 Klas Lindfors <klas@yubico.com>
* NEWS: add NEWS for flexible logging
2013-09-26 Klas Lindfors <klas@yubico.com>
* build-homepage.sh: drop build-homepage script
2013-09-26 Klas Lindfors <klas@yubico.com>
* BLURB: add category to BLURB
2013-09-26 Klas Lindfors <klas@yubico.com>
* BLURB: BLURB for yubikey-personalization-gui
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/help.h, src/ui/helpbox.cpp, src/ui/helpbox.h,
src/ui/settingpage.cpp, src/ui/settingpage.ui: add help for the
flexible logging format
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/yubikeylogger.cpp, src/yubikeylogger.h: add getting a list of
lognames
2013-09-26 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro, src/common.h, src/help.h,
src/ui/helpbox.cpp: move help texts to it's own header to reduce re-compile times due to changed texts..
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/settingpage.cpp, src/ui/settingpage.ui,
src/yubikeylogger.cpp, src/yubikeylogger.h: add a flexible logformat
with configurable input
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/ui/settingpage.cpp, src/ui/settingpage.ui: change the radio
buttons for logformat to a combobox
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/yubiaccbox.cpp: move defines for accbox to
yubiaccbox.cpp from common.h
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/settingpage.cpp: localize OUT_CHAR_RATE
defines to settingpage.cpp
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/yubikeylogger.cpp, src/yubikeylogger.h: refactor building of
the logging string to use a lookup table and format-strings, calling methods in the
YubikeyConfig class by name instead. This will allow building more
flexible logging schemes.
2013-09-26 Klas Lindfors <klas@yubico.com>
* src/yubikeyconfig.h: make YubikeyConfig a QObject and it's getter
methods invokable this will make the getter methods available for calling by name
through the meta object.
2013-09-20 Klas Lindfors <klas@yubico.com>
* NEWS: add NEWS for the next version
2013-09-19 Klas Lindfors <klas@yubico.com>
* src/yubikeyfinder.cpp, src/yubikeyfinder.h: fix so we recheck the
key after regaining focus add a new state to the finder NoFocus, when running the find cycle
re-read all info if NoFocus is set as well.
2013-09-17 Klas Lindfors <klas@yubico.com>
* resources/win/resources.rc, src/version.h: and change around again utf8 in src/version.h latin1 in resources/win/resources.rc
2013-09-17 Klas Lindfors <klas@yubico.com>
* src/ui/aboutpage.cpp, src/version.h: revert back to latin1 for the
copyright sign but use tr() utf8 broke in the windows resource file and in some versions of qt.
2013-09-17 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro, resources/win/resources.rc: make version
numbering work on windows
2013-09-17 Klas Lindfors <klas@yubico.com>
* : Merge pull request #24 from eworm-de/encoding fix encoding for copyright sign
2013-09-17 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/mainwindow.cpp, src/yubikeyfinder.cpp,
src/yubikeywriter.cpp: Allow writing of keys with unknown firmware Print a warning in place of "YubiKey inserted" fixes #23
2013-09-17 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro, src/ui/confirmbox.cpp,
src/ui/mainwindow.cpp, src/ui/otppage.cpp, src/ui/scanedit.cpp,
src/ui/settingpage.cpp, src/ui/staticpage.cpp,
src/ui/yubiaccbox.cpp, src/ui/yubiaccbox.h, src/yubikeyfinder.cpp,
src/yubikeywriter.cpp: support qt5
2013-09-17 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/aboutpage.cpp, src/ui/chalresppage.cpp,
src/ui/mainwindow.cpp, src/ui/mainwindow.h, src/ui/mainwindow.ui,
src/ui/oathpage.cpp, src/ui/otppage.cpp, src/ui/settingpage.cpp,
src/ui/staticpage.cpp, src/ui/toolpage.cpp, src/ui/yubiaccbox.cpp,
src/yubikeyfinder.cpp, src/yubikeyfinder.h: handle error messages
when opening key Adds proper output for the case when there's more than one key
present fixes #9
2013-08-05 Klas Lindfors <klas@yubico.com>
* src/ui/toolpage.ui: re-add the importBox as a qWidget fixes compilation errors and hopefully doesn't show the box fixes
#22
2013-07-05 Klas Lindfors <klas@yubico.com>
* build-homepage.sh: drop news file from homepage
2013-07-24 Simon Josefsson <simon@josefsson.org>
* resources/lin/yubikey-personalization-gui.desktop: Add Keywords to
desktop file.
2013-07-04 Klas Lindfors <klas@yubico.com>
* src/ui/toolpage.ui: drop box around import
2013-07-04 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro, src/version.h: fix windows build by
fiddling some with version
2013-07-04 Klas Lindfors <klas@yubico.com>
* NEWS, YKPersonalization.pro: bump versions post-release
2013-07-04 Klas Lindfors <klas@yubico.com>
* do-source-release.sh: fix release script for new VERSION format
2013-07-04 Klas Lindfors <klas@yubico.com>
* NEWS: release 3.1.10
......
yubikey-personalization-gui NEWS -- History of user-visible changes. -*- outline -*-
* Version 3.1.11 (released 2013-10-09)
** Make sure there is no extra box shown around import on tools page.
** Show correct error when there's more than one key detected.
** Support for building and using qt5.
** Allow writing of a YubiKey with unknown firmware.
** Recheck the key properly after regaining focus, might be a new key.
** Add a "flexible" logging scheme, possible to be configured from the GUI.
* Version 3.1.10 (released 2013-07-04)
** Add import page under tools for importing ycfg.
......
......@@ -3,7 +3,7 @@
#
VERSION_MAJOR = 3
VERSION_MINOR = 1
VERSION_BUILD = 10
VERSION_BUILD = 11
VERSION = "$${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_BUILD}"
APP_NAME = $$quote(YubiKey Personalization Tool)
......@@ -15,10 +15,13 @@ DEPLOYMENT_PLUGIN += qmng
TEMPLATE = app
TARGET = yubikey-personalization-gui
DEFINES += VERSION_MAJOR=\\\"$${VERSION_MAJOR}\\\" VERSION_MINOR=\\\"$${VERSION_MINOR}\\\" VERSION_BUILD=\\\"$${VERSION_BUILD}\\\"
DEFINES += VERSION_MAJOR=\\\"$${VERSION_MAJOR}\\\" VERSION_MINOR=\\\"$${VERSION_MINOR}\\\" VERSION_BUILD=\\\"$${VERSION_BUILD}\\\" VERSION=\\\"$${VERSION}\\\"
CONFIG += exceptions
# if this is qt5, add widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
!nosilent {
CONFIG += silent
}
......@@ -83,6 +86,7 @@ HEADERS += \
src/yubikeyconfig.h \
src/version.h \
src/otpdef.h \
src/help.h \
src/common.h
SOURCES += \
......@@ -132,7 +136,7 @@ cross {
win32 {
QMAKE_LIB = $$(TARGET_ARCH)-ar -ru
QMAKE_RC = $$(TARGET_ARCH)-windres
QMAKE_RC = $$(TARGET_ARCH)-windres $$quote(-DVERSION_WIN_STR=\'\\\"$${VERSION}\\0\\\"\')
QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
......
#!/bin/sh
if [ "x$YUBICO_GITHUB_REPO" = "x" ]; then
echo "YUBICO_GITHUB_REPO not defined"
exit
fi
if [ ! -d $YUBICO_GITHUB_REPO/yubikey-personalization-gui ]; then
echo "$YUBICO_GITHUB_REPO/yubikey-personalization-gui does not exist"
exit
fi
README_FILE=`mktemp '/tmp/README.XXXXXX'`
NEWS_FILE=`mktemp '/tmp/NEWS.XXXXXX'`
asciidoc -s -o $README_FILE README
asciidoc -s -o $NEWS_FILE NEWS
cd $YUBICO_GITHUB_REPO/yubikey-personalization-gui
cat index.html.in $README_FILE > index.html
echo "</div></body></html>" >> index.html
cat news.html.in $NEWS_FILE > news.html
echo "</div></body></html>" >> news.html
rm -f $README_FILE $NEWS_FILE
git add index.html
git add news.html
git commit -m "updated page with new README and release notes"
echo "Commited new readme and release notes, not pushed."
......@@ -16,7 +16,15 @@ if ! head -3 NEWS | grep -q "Version $VERSION .released `date -I`"; then
exit
fi
if ! head -5 YKPersonalization.pro | grep -q "VERSION.*= \"$VERSION\""; then
if ! head -10 YKPersonalization.pro | grep -q "VERSION_MAJOR.*= `echo $VERSION | cut -d. -f1`"; then
echo "You need to update version in YKPersonalization.pro"
exit
fi
if ! head -10 YKPersonalization.pro | grep -q "VERSION_MINOR.*= `echo $VERSION | cut -d. -f2`"; then
echo "You need to update version in YKPersonalization.pro"
exit
fi
if ! head -10 YKPersonalization.pro | grep -q "VERSION_BUILD.*= `echo $VERSION | cut -d. -f3`"; then
echo "You need to update version in YKPersonalization.pro"
exit
fi
......
......@@ -8,3 +8,4 @@ StartupNotify=true
Terminal=false
Type=Application
Categories=Utility;
Keywords=YubiKey;Personalization;
......@@ -12,12 +12,12 @@ BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_PRODUCTVERSION_STR
VALUE "FileVersion", VERSION_WIN_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "LegalCopyright", "Copyright 2011-2013 Yubico"
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
VALUE "ProductVersion", VERSION_WIN_STR
END
END
......
This diff is collapsed.
This diff is collapsed.
......@@ -66,7 +66,7 @@ AboutPage::AboutPage(QWidget *parent) :
//Set copyright
QString copyright = tr("%1. %2.").
arg(VER_LEGALCOPYRIGHT_STR).
arg(VER_LEGALCOPYRIGHT).
arg(VER_LEGALTRADEMARKS1_STR);
ui->copyrightLbl->setText(copyright);
......@@ -74,7 +74,7 @@ AboutPage::AboutPage(QWidget *parent) :
connectButtons();
//Connect other signals and slots
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*)),
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*, int)),
this, SLOT(keyFound(bool, bool*)));
}
......
......@@ -52,7 +52,7 @@ ChalRespPage::ChalRespPage(QWidget *parent) :
connectHelpButtons();
//Connect other signals and slots
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*)),
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*, int)),
this, SLOT(keyFound(bool, bool*)));
connect(ui->quickResetBtn, SIGNAL(clicked()),
......
......@@ -29,6 +29,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "confirmbox.h"
#include "ui_confirmbox.h"
#include <QMessageBox>
#include "common.h"
ConfirmBox::ConfirmBox(QWidget *parent) :
......
......@@ -30,6 +30,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ui_helpbox.h"
#include "common.h"
#include "help.h"
#include "yubikeylogger.h"
HelpBox::HelpBox(QWidget *parent) :
QDialog(parent),
......@@ -123,6 +125,15 @@ void HelpBox::setHelpIndex(Help helpIndex) {
title = tr("Manual Update");
helpMsg = HELP_MAN_UPDATE_OPTION;
break;
case Help_LogFormat:
{
title = tr("Flexible Log Format");
helpMsg = HELP_LOG_FORMAT;
QStringList names = YubiKeyLogger::getLogNames();
helpMsg.append(names.join(", "));
helpMsg.append("</p>");
}
break;
default:
helpMsg = tr("");
......
......@@ -62,6 +62,7 @@ public:
Help_AllowUpdate,
Help_Swap,
Help_ManUpdate,
Help_LogFormat,
};
void setHelpIndex(Help helpIndex);
......
......@@ -61,8 +61,8 @@ MainWindow::MainWindow(QWidget *parent) :
//Connect other signals and slots
connect(ui->exitMenuBtn, SIGNAL(clicked()), qApp, SLOT(quit()));
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*)),
this, SLOT(keyFound(bool, bool*)));
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*, int)),
this, SLOT(keyFound(bool, bool*, int)));
connect(YubiKeyWriter::getInstance(), SIGNAL(errorOccurred(QString)),
this, SLOT(showStatusMessage(QString)));
......@@ -296,25 +296,25 @@ void MainWindow::resetDeviceInfo() {
ui->serialNoHexCopyBtn->setStyleSheet(blankBtnSS);
ui->serialNoModhexCopyBtn->setStyleSheet(blankBtnSS);
ui->otpSupportLbl->setPixmap(NULL);
ui->otpSupportLbl->setPixmap(QPixmap());
ui->otpSupportLbl->setText(NA);
ui->multiConfigSupportLbl->setPixmap(NULL);
ui->multiConfigSupportLbl->setPixmap(QPixmap());
ui->multiConfigSupportLbl->setText(NA);
ui->oathHotpSupportLbl->setPixmap(NULL);
ui->oathHotpSupportLbl->setPixmap(QPixmap());
ui->oathHotpSupportLbl->setText(NA);
ui->staticPwdSupportLbl->setPixmap(NULL);
ui->staticPwdSupportLbl->setPixmap(QPixmap());
ui->staticPwdSupportLbl->setText(NA);
ui->scanCodeSupportLbl->setPixmap(NULL);
ui->scanCodeSupportLbl->setPixmap(QPixmap());
ui->scanCodeSupportLbl->setText(NA);
ui->chalRespSupportLbl->setPixmap(NULL);
ui->chalRespSupportLbl->setPixmap(QPixmap());
ui->chalRespSupportLbl->setText(NA);
ui->updatableSupportLbl->setPixmap(NULL);
ui->updatableSupportLbl->setPixmap(QPixmap());
ui->updatableSupportLbl->setText(NA);
ui->ndefSupportLbl->setPixmap(NULL);
ui->ndefSupportLbl->setPixmap(QPixmap());
ui->ndefSupportLbl->setText(NA);
}
void MainWindow::keyFound(bool found, bool* featuresMatrix) {
void MainWindow::keyFound(bool found, bool* featuresMatrix, int error) {
QString disabledMenuBtnSS = QString::fromUtf8(SS_MENU_DISABLED);
QString checkedMenuBtnSS = QString::fromUtf8(SS_MENU_CHECKED);
QString uncheckedMenuBtnSS = QString::fromUtf8(SS_MENU_UNCHECKED);
......@@ -343,8 +343,13 @@ void MainWindow::keyFound(bool found, bool* featuresMatrix) {
}
unsigned int version = finder->version();
ui->statusLbl->setText(KEY_FOUND);
ui->statusLbl->setStyleSheet(QString::fromUtf8(SS_YKSTATUS_SUCCESS));
if(error == ERR_UNKNOWN_FIRMWARE) {
ui->statusLbl->setStyleSheet(QString::fromUtf8(SS_YKSTATUS_ERROR));
ui->statusLbl->setText(UNKNOWN_FIRMWARE);
} else {
ui->statusLbl->setStyleSheet(QString::fromUtf8(SS_YKSTATUS_SUCCESS));
ui->statusLbl->setText(KEY_FOUND);
}
ui->versionLbl->setText(finder->versionStr());
qDebug() << "version is" << finder->versionStr();
......@@ -486,10 +491,16 @@ void MainWindow::keyFound(bool found, bool* featuresMatrix) {
} else {
ui->programLbl->clear();
if(ui->deviceImage->pixmap()) {
ui->deviceImage->setPixmap(NULL);
ui->deviceImage->setPixmap(QPixmap());
}
ui->deviceImage->clear();
ui->statusLbl->setText(NO_KEY_FOUND);
if(error == ERR_NOKEY) {
ui->statusLbl->setText(NO_KEY_FOUND);
} else if(error == ERR_MORETHANONE) {
ui->statusLbl->setText(MORE_THAN_ONE);
} else {
ui->statusLbl->setText(OTHER_ERROR);
}
ui->statusLbl->setStyleSheet(QString::fromUtf8(SS_YKSTATUS_ERROR));
if(m_currentPage == Page_Oath) {
......
......@@ -87,7 +87,7 @@ private slots:
// Device Widget
void resetDeviceInfo();
void keyFound(bool found, bool* featuresMatrix);
void keyFound(bool found, bool* featuresMatrix, int error);
// Status Widget
void showStatusMessage(const QString &text, int status = 1);
......
......@@ -157,9 +157,9 @@ background-color: rgb(255, 255, 255);</string>
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<y>5</y>
<width>151</width>
<height>20</height>
<height>30</height>
</rect>
</property>
<property name="styleSheet">
......
......@@ -63,7 +63,7 @@ OathPage::OathPage(QWidget *parent) :
connectHelpButtons();
//Connect other signals and slots
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*)),
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*, int)),
this, SLOT(keyFound(bool, bool*)));
connect(ui->quickWriteConfigBtn, SIGNAL(clicked()),
......
......@@ -55,7 +55,7 @@ OtpPage::OtpPage(QWidget *parent) :
connectHelpButtons();
//Connect other signals and slots
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*)),
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*, int)),
this, SLOT(keyFound(bool, bool*)));
connect(ui->quickWriteConfigBtn, SIGNAL(clicked()),
......@@ -436,7 +436,7 @@ void OtpPage::quickConfigWritten(bool written, __attribute__((unused)) const QSt
void OtpPage::uploadQuickConfig() {
m_tempFile.setFileTemplate(QDir::tempPath() + "/ykpers.XXXXXX.html");
m_tempFile.open();
m_tempFile.write(m_uploadUrl.toAscii(), m_uploadUrl.length());
m_tempFile.write(m_uploadUrl.toLatin1(), m_uploadUrl.length());
m_tempFile.close();
qDebug() << "temporary file for upload is: " << m_tempFile.fileName();
QDesktopServices::openUrl(QUrl::fromLocalFile(m_tempFile.fileName()));
......
......@@ -288,11 +288,11 @@ static const char *usb2key2[] = {
QString ScanEdit::textToScanCodes(const QString text) {
QString scanCode;
for(int i = 0; i < text.length(); i++) {
QChar ch = text.at(i).toAscii();
QChar ch = text.at(i).toLatin1();
unsigned char code = 0;
if(ch == '\\') {
if(i + 1 != text.length()) {
QChar next = text.at(i + 1).toAscii();
QChar next = text.at(i + 1).toLatin1();
if(next == '\\') {
i++;
} else if(next == 't') {
......@@ -305,7 +305,7 @@ QString ScanEdit::textToScanCodes(const QString text) {
}
}
if(code == 0) {
code = key2usb[(int)ch.toAscii()];
code = key2usb[(int)ch.toLatin1()];
}
QString hexTxt = YubiKeyUtil::qstrHexEncode(&code, 1);
scanCode += hexTxt;
......
......@@ -36,6 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "toolpage.h"
#include <QFile>
#include <QMessageBox>
#include "common.h"
......@@ -43,6 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MODHEX 1
#define HEX 2
#define OUT_CHAR_RATE_STD 0
#define OUT_CHAR_RATE_SLOWDOWN_20 1
#define OUT_CHAR_RATE_SLOWDOWN_40 2
#define OUT_CHAR_RATE_SLOWDOWN_60 3
SettingPage::SettingPage(QWidget *parent) :
QStackedWidget(parent),
ui(new Ui::SettingPage)
......@@ -84,12 +90,12 @@ SettingPage::SettingPage(QWidget *parent) :
connect(ui->fastTrigCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->ledInvertCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->useNumericKeypadCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->logTraditionalRadio, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->logYubicoRadio, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->logFormatCombo, SIGNAL(activated(int)), this, SLOT(save()));
connect(ui->logFormatEdit, SIGNAL(textEdited(QString)), this, SLOT(save()));
connect(ui->outCharRateCombo, SIGNAL(activated(int)), this, SLOT(save()));
connect(ui->exportCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*)),
connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*, int)),
this, SLOT(keyFound(bool, bool*)));
QRegExp modHexRx("^[cbdefghijklnrtuv]{0,4}$");
......@@ -121,6 +127,7 @@ void SettingPage::connectHelpButtons() {
connect(ui->updateHelpBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->swapHelpBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->manUpdateHelpBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->logFormatEditHelpBtn, SIGNAL(clicked()), mapper, SLOT(map()));
//Set a value for each button
mapper->setMapping(ui->outFormatHelpBtn, HelpBox::Help_OutputFormat);
......@@ -129,6 +136,7 @@ void SettingPage::connectHelpButtons() {
mapper->setMapping(ui->updateHelpBtn, HelpBox::Help_AllowUpdate);
mapper->setMapping(ui->swapHelpBtn, HelpBox::Help_Swap);
mapper->setMapping(ui->manUpdateHelpBtn, HelpBox::Help_ManUpdate);
mapper->setMapping(ui->logFormatEditHelpBtn, HelpBox::Help_LogFormat);
//Connect the mapper
connect(mapper, SIGNAL(mapped(int)), this, SLOT(helpBtn_pressed(int)));
......@@ -290,20 +298,22 @@ void SettingPage::load() {
YubiKeyLogger::disableLogging();
ui->logOutputCheck->setChecked(false);
ui->logTraditionalRadio->setEnabled(false);
ui->logYubicoRadio->setEnabled(false);
ui->logFormatCombo->setEnabled(false);
ui->logFormatEdit->setEnabled(false);
} else {
YubiKeyLogger::enableLogging();
ui->logOutputCheck->setChecked(true);
ui->logTraditionalRadio->setEnabled(true);
ui->logYubicoRadio->setEnabled(true);
if(logFormat == YubiKeyLogger::Format_Yubico) {
ui->logYubicoRadio->setChecked(true);
YubiKeyLogger::setLogFormat(YubiKeyLogger::Format_Yubico);
ui->logFormatCombo->setEnabled(true);
ui->logFormatCombo->setCurrentIndex(logFormat);
YubiKeyLogger::setLogFormat((YubiKeyLogger::Format)logFormat);
if(logFormat == YubiKeyLogger::Format_Flexible) {
QString format = settings.value(SG_LOG_FLEXIBLE).toString();
ui->logFormatEdit->setEnabled(true);
ui->logFormatEdit->setText(format);
YubiKeyLogger::setFlexibleFormat(format);
} else {
ui->logTraditionalRadio->setChecked(true);
YubiKeyLogger::setLogFormat(YubiKeyLogger::Format_Traditional);
ui->logFormatEdit->setEnabled(false);
}
}
......@@ -375,11 +385,9 @@ void SettingPage::save() {
//Logging settings...
if(ui->logOutputCheck->isChecked()) {
settings.setValue(SG_LOG_DISABLED, false);
if(ui->logYubicoRadio->isChecked()) {
settings.setValue(SG_LOG_FORMAT, YubiKeyLogger::Format_Yubico);
} else {
settings.setValue(SG_LOG_FORMAT, YubiKeyLogger::Format_Traditional);
settings.setValue(SG_LOG_FORMAT, ui->logFormatCombo->currentIndex());
if(ui->logFormatCombo->currentIndex() == YubiKeyLogger::Format_Flexible) {
settings.setValue(SG_LOG_FLEXIBLE, ui->logFormatEdit->text());
}
} else {
settings.setValue(SG_LOG_DISABLED, true);
......
......@@ -276,36 +276,97 @@ color: rgb(140, 192, 65);</string>
<string>Log configuration output</string>
</property>
</widget>
<widget class="QRadioButton" name="logTraditionalRadio">
<widget class="QComboBox" name="logFormatCombo">
<property name="geometry">
<rect>
<x>210</x>
<x>200</x>
<y>25</y>
<width>131</width>
<height>19</height>
<width>125</width>
<height>22</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">font-weight: normal;</string>
</property>
<property name="text">
<string>Traditional format</string>
</property>
<item>
<property name="text">
<string>Traditional format</string>
</property>
</item>
<item>
<property name="text">
<string>Yubico format</string>
</property>
</item>
<item>
<property name="text">
<string>Flexible format</string>
</property>
</item>
</widget>
<widget class="QRadioButton" name="logYubicoRadio">
<widget class="QLineEdit" name="logFormatEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>350</x>
<y>25</y>
<width>120</width>
<height>19</height>
<width>325</width>
<height>20</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">font-weight: normal;</string>
</property>
</widget>
<widget class="QPushButton" name="logFormatEditHelpBtn">
<property name="geometry">
<rect>
<x>680</x>
<y>25</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="contextMenuPolicy">