UEFITool 0.18.7

- EFI11/Tiano compression code reverted back to 0.17.x implementation
because of higher compression ratio
- delete and backspace work properly for GUID search field
This commit is contained in:
Nikolaj Schlej 2014-08-14 21:42:18 +02:00
parent 41448ea49f
commit 754f9c5b13
7 changed files with 1863 additions and 1377 deletions

File diff suppressed because it is too large Load diff

61
guidlineedit.cpp Normal file
View file

@ -0,0 +1,61 @@
/* guidlineedit.cpp
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
#include "guidlineedit.h"
GuidLineEdit::GuidLineEdit(QWidget * parent)
:QLineEdit(parent)
{
}
GuidLineEdit::GuidLineEdit(const QString & contents, QWidget * parent)
:QLineEdit(contents, parent)
{
}
GuidLineEdit::~GuidLineEdit()
{
}
void GuidLineEdit::keyPressEvent(QKeyEvent * event)
{
if (event == QKeySequence::Delete || event->key() == Qt::Key_Backspace)
{
int pos = cursorPosition();
if (event->key() == Qt::Key_Backspace && pos > 0) {
cursorBackward(false);
pos = cursorPosition();
}
QString txt = text();
QString selected = selectedText();
if (!selected.isEmpty()) {
pos = QLineEdit::selectionStart();
for (int i = pos; i < pos + selected.count(); i++)
if (txt[i] != QChar('-'))
txt[i] = QChar('.');
}
else
txt[pos] = QChar('.');
setCursorPosition(0);
insert(txt);
setCursorPosition(pos);
return;
}
// Call original event handler
QLineEdit::keyPressEvent(event);
}

36
guidlineedit.h Normal file
View file

@ -0,0 +1,36 @@
/* guidlineedit.h
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
#ifndef __GUIDLINEEDIT_H__
#define __GUIDLINEEDIT_H__
#include <QLineEdit>
#include <QKeyEvent>
#include <QKeySequence>
#include <QString>
#include "basetypes.h"
class GuidLineEdit : public QLineEdit
{
public:
GuidLineEdit(QWidget * parent = 0);
GuidLineEdit(const QString & contents, QWidget * parent = 0);
~GuidLineEdit();
protected:
void keyPressEvent(QKeyEvent * event);
};
#endif

View file

@ -101,7 +101,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="guidEdit">
<widget class="GuidLineEdit" name="guidEdit">
<property name="font">
<font>
<family>Consolas</family>
@ -217,6 +217,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>GuidLineEdit</class>
<extends>QLineEdit</extends>
<header>guidlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>hexEdit</tabstop>

View file

@ -17,7 +17,7 @@
UEFITool::UEFITool(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::UEFITool),
version(tr("0.18.6"))
version(tr("0.18.7"))
{
clipboard = QApplication::clipboard();

View file

@ -14,6 +14,7 @@ SOURCES += uefitool_main.cpp \
treeitem.cpp \
treemodel.cpp \
messagelistitem.cpp \
guidlineedit.cpp \
LZMA/LzmaCompress.c \
LZMA/LzmaDecompress.c \
LZMA/SDK/C/LzFind.c \
@ -35,6 +36,7 @@ HEADERS += uefitool.h \
treeitem.h \
treemodel.h \
messagelistitem.h \
guidlineedit.h \
LZMA/LzmaCompress.h \
LZMA/LzmaDecompress.h \
Tiano/EfiTianoDecompress.h \

View file

@ -497,7 +497,7 @@
</action>
<action name="actionMessagesCopyAll">
<property name="text">
<string>C&amp;opy All</string>
<string>C&amp;opy all</string>
</property>
<property name="shortcut">
<string>Ctrl+Alt+C</string>