#include "ui_dialogoptions.h"
#include "math.h"
#include <QFileDialog>
+#include <QEvent>
+#include <QKeyEvent>
+/**
+ * Constructor.
+ *
+ * @param dialog the option dialog
+ */
+TableKeyPressEater::TableKeyPressEater(DialogOptions* dialog) :
+ QObject(dialog),
+ m_dialog(dialog)
+{
+}
+
+
+/**
+ * Event handler for the up/down keys of the table widget.
+ *
+ * @param obj the table widget
+ * @param event the current event
+ * @return
+ */
+bool TableKeyPressEater::eventFilter(QObject *obj, QEvent *event)
+{
+ if (event->type() == QEvent::KeyPress){
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+ int key = keyEvent->key();
+ if (key == Qt::Key_Up || key == Qt::Key_Down)
+ m_dialog->handleKey(key);
+ }
+ // standard event processing
+ return QObject::eventFilter(obj, event);
+}
/**
* Constructor.
*
connect(ui->pushButtonUp, SIGNAL(clicked()), this, SLOT(up()));
connect(ui->tableWidget, SIGNAL(cellClicked(int,int)), this, SLOT(cellEntered(int,int)));
connect(ui->tableWidget, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
+ connect(ui->tableWidget, SIGNAL(currentItemChanged()), this, SLOT(currentItemChanged()));
+ ui->tableWidget->installEventFilter(new TableKeyPressEater(this));
+
for (int ix = 0; ix < ui->comboBoxFileType->count(); ix++)
m_fileTypes.append(ui->comboBoxFileType->itemText(ix));
for (int ix = 0; ix < ui->comboBoxDirMode->count(); ix++)
delete ui;
}
+void DialogOptions::currentItemChanged(QTableWidgetItem * current,
+ QTableWidgetItem * previous){
+ QString text = current->text() + " " + previous->text();
+}
+
/**
* Handles the event "pushed button add".
*/
*/
void DialogOptions::del(){
int count = ui->tableWidget->rowCount() - 1;
- int start = m_selectedRow;
- if (start == 0)
- start = 1;
- for (int row = start; row < count; row++){
+ for (int row = m_selectedRow + 1; row <= count; row++){
swapRows(row, row - 1);
}
ui->tableWidget->setRowCount(count);
}
}
+/**
+ * Handles the up/down key press event.
+ *
+ * @param key the key (up or down)
+ */
+void DialogOptions::handleKey(int key)
+{
+ if (key == Qt::Key_Down){
+ if (m_selectedRow < ui->tableWidget->rowCount() - 1)
+ m_selectedRow++;
+ } else if (key == Qt::Key_Up){
+ if (m_selectedRow > 0)
+ m_selectedRow--;
+ }
+}
+
/**
* Deselects the current row and selects another.
* @param row the number of the new selected row
class DialogOptions;
}
+class DialogOptions;
+class TableKeyPressEater : public QObject
+{
+ Q_OBJECT
+public:
+ TableKeyPressEater(DialogOptions* dialog);
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+private:
+ DialogOptions* m_dialog;
+};
+
class DialogOptions: public QDialog {
Q_OBJECT
void selectProgram();
void selectionChanged();
void up();
+public:
+ void handleKey(int key);
private:
void currentToTable(int row);
+ void currentItemChanged(QTableWidgetItem* current, QTableWidgetItem* previous);
void fillContextHandler(int row, ContextHandler& handler);
void fillTable();
void fromTable();
m_lastBaseDir(),
m_horizontalHeader(NULL),
m_lastOrder(Qt::DescendingOrder),
- m_homeDir(),
+ m_homeDir(homeDir),
m_storageFile(),
m_contextHandlers(){
ui->setupUi(this);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AboutDialog</class>
+ <widget class="QDialog" name="AboutDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>225</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>About</string>
+ </property>
+ <widget class="QTextEdit" name="textEdit">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>351</width>
+ <height>141</height>
+ </rect>
+ </property>
+ <property name="html">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">ReFind</span> for searching files in a directory tree</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This is a program of the project &quot;<span style=" font-weight:600;">Re</span>al <span style=" font-weight:600;">Pub</span>lic <span style=" font-weight:600;">Lib</span>rary&quot;.</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Sources are public domain and available under https://github.com/republib</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Implemented in QT (C++) 5.x</p></body></html></string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>280</x>
+ <y>180</y>
+ <width>93</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>&OK</string>
+ </property>
+ </widget>
+ <action name="action_OK">
+ <property name="text">
+ <string>&OK</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>action_OK</sender>
+ <signal>triggered()</signal>
+ <receiver>AboutDialog</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>199</x>
+ <y>112</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+/*
+ * Licence:
+ * You can use and modify this file without any restriction.
+ * There is no warranty.
+ * You also can use the licence from http://www.wtfpl.net/.
+ * The original sources can be found on https://github.com/republib.
+ */
+
+#include "aboutdialog.hpp"
+#include "ui_aboutdialog.h"
+
+AboutDialog::AboutDialog(QWidget *parent) :
+ QDialog(parent), ui(new Ui::AboutDialog){
+ ui->setupUi(this);
+}
+
+AboutDialog::~AboutDialog(){
+ delete ui;
+}
--- /dev/null
+/*
+ * Licence:
+ * You can use and modify this file without any restriction.
+ * There is no warranty.
+ * You also can use the licence from http://www.wtfpl.net/.
+ * The original sources can be found on https://github.com/republib.
+ */
+
+#ifndef ABOUTDIALOG_HPP
+#define ABOUTDIALOG_HPP
+
+#include <QDialog>
+
+namespace Ui {
+class AboutDialog;
+}
+
+class AboutDialog: public QDialog {
+ Q_OBJECT
+
+public:
+ explicit AboutDialog(QWidget *parent = 0);
+ ~AboutDialog();
+
+private:
+ Ui::AboutDialog *ui;
+};
+
+#endif // ABOUTDIALOG_HPP
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AboutDialog</class>
+ <widget class="QDialog" name="AboutDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>423</width>
+ <height>289</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <property name="modal">
+ <bool>true</bool>
+ </property>
+ <widget class="QTextEdit" name="textEdit">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>381</width>
+ <height>221</height>
+ </rect>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="html">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">ReFind</span> for searching files in a directory tree.</p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This is a program of the project</p>
+<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Re</span>al <span style=" font-weight:600;">Pub</span>lic <span style=" font-weight:600;">Lib</span>rary (RePubLib)</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Sources are public domain and available under</p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/republib"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/republib</span></a> </p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Implemented in QT (C++) 5.x</p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Icons: Mark James, <a href="http://famfamfam.com"><span style=" text-decoration: underline; color:#0000ff;">http://famfamfam.com</span></a> </p></body></html></string>
+ </property>
+ <property name="acceptRichText">
+ <bool>false</bool>
+ </property>
+ <property name="textInteractionFlags">
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="pushButtonOK">
+ <property name="geometry">
+ <rect>
+ <x>310</x>
+ <y>250</y>
+ <width>93</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>&OK</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>pushButtonOK</sender>
+ <signal>clicked()</signal>
+ <receiver>AboutDialog</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>196</x>
+ <y>183</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>199</x>
+ <y>108</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+/*
+ * main.cpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#include <QApplication>
+#include "base/rebase.hpp"
+#include "gui/regui.hpp"
+#include "mainwindow.hpp"
+
+int main(int argc, char *argv[]){
+ QApplication app(argc, argv);
+ QString file = argc > 1 ? argv[1] : "";
+ MainWindow w(file);
+
+ QObject::connect(&app, SIGNAL(aboutToQuit()), &w, SLOT(closing()));
+
+ w.show();
+
+ return app.exec();
+}
--- /dev/null
+/*
+ * mainwindow.cpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#include "base/rebase.hpp"
+#include "gui/regui.hpp"
+#include "mainwindow.hpp"
+#include "ui_mainwindow.h"
+#include "aboutdialog.hpp"
+#include <QDir>
+#include <QFileDialog>
+#include <QClipboard>
+#include <QLineEdit>
+#include <QMouseEvent>
+#include <QDrag>
+#include <QMimeData>
+#include <QProcess>
+#include <QMessageBox>
+
+/**
+ * @brief Constructor.
+ *
+ * @param parent NULL or the parent widget
+ */
+MainWindow::MainWindow(const QString& file,
+ QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::MainWindow),
+ m_statusMessage(NULL),
+ m_stdLabelBackgroundRole(NULL),
+ m_homeDir(),
+ m_file(file),
+ m_storageFile(){
+ ui->setupUi(this);
+ initializeHome();
+ m_statusMessage = new QLabel(tr("Welcome at reviewer"));
+ statusBar()->addWidget(m_statusMessage);
+}
+
+/**
+ * @brief Destructor.
+ */
+MainWindow::~MainWindow(){
+ delete ui;
+}
+
+/**
+ * initializeHomeializes the program home directory.
+ */
+void MainWindow::initializeHome(){
+ if (m_homeDir.isEmpty()){
+ m_homeDir = QDir::home().absoluteFilePath(".review");
+ }
+
+ QDir home(m_homeDir);
+ if (!home.exists()){
+ if (!home.mkpath(m_homeDir)){
+ m_homeDir = home.tempPath() + "/.refind";
+ home.mkpath(m_homeDir);
+ }
+ }
+ if (!m_homeDir.endsWith("/"))
+ m_homeDir += "/";
+ m_storageFile = m_homeDir + "state.conf";
+ restoreState();
+}
+
+/**
+ * Starts the about dialog.
+ */
+void MainWindow::about(){
+ AboutDialog dialog;
+ dialog.exec();
+}
+
+void MainWindow::closing(){
+ saveState();
+}
+
+
+
+
+/**
+ * Handles the push of the button "select directory".
+ */
+void MainWindow::restoreState(){
+ ReStateStorage storage(m_storageFile);
+ storage.setForm("main");
+ //storage.restore(ui->comboBoxDirectory, "comboBoxDirectory", true);
+ storage.close();
+}
+
+/**
+ * Handles the push of the button "select directory".
+ */
+void MainWindow::saveState(){
+ ReStateStorage storage(m_storageFile);
+ storage.setForm("main");
+ //storage.store(ui->comboBoxDirectory, "comboBoxDirectory");
+ storage.close();
+}
+
+
+/**
+ * Writes a text to the status line.
+ *
+ * @param error <code>true</code>: the message is an error message
+ * @param message the text to set
+ */
+void MainWindow::setStatusMessage(bool error, const QString& message){
+ if (m_stdLabelBackgroundRole == NULL)
+ m_stdLabelBackgroundRole = new QPalette::ColorRole(
+ m_statusMessage->backgroundRole());
+ m_statusMessage->setBackgroundRole(
+ error ? QPalette::HighlightedText : *m_stdLabelBackgroundRole);
+ m_statusMessage->setText(message);
+}
+
--- /dev/null
+/*
+ * mainwindow.hpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#ifndef MAINWINDOW_HPP
+#define MAINWINDOW_HPP
+#ifndef REBASE_HPP
+#include "base/rebase.hpp"
+#endif
+#include <QHeaderView>
+#include <QMainWindow>
+#include <QComboBox>
+#include <QLabel>
+#include <QDir>
+#if ! defined GUI_REGUI_HPP_
+#include "gui/regui.hpp"
+#endif
+namespace Ui {
+class MainWindow;
+}
+enum TableColumns {
+ TC_NODE, TC_EXT, TC_SIZE, TC_MODIFIED, TC_TYPE, TC_PATH
+};
+
+class MainWindow: public QMainWindow, public ReGuiValidator {
+
+ Q_OBJECT
+
+public:
+ explicit MainWindow(const QString& file, QWidget *parent = 0);
+ ~MainWindow();
+
+private slots:
+ void about();
+ void closing();
+ void saveState();
+
+private:
+ void initializeHome();
+ void restoreState();
+ virtual void setStatusMessage(bool error, const QString& message);
+private:
+ Ui::MainWindow *ui;
+ QLabel* m_statusMessage;
+ QPalette::ColorRole* m_stdLabelBackgroundRole;
+ QString m_homeDir;
+ QString m_file;
+ QString m_storageFile;
+};
+
+#endif // MAINWINDOW_HPP
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1030</width>
+ <height>579</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>RePubLib File Finder</string>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QTabWidget" name="tabWidget">
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Tab 1</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Start:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="comboBoxStart">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QCheckBox" name="checkBoxRegExprStart">
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Reg.Expr.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QLabel" name="label_2">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>End:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4">
+ <widget class="QComboBox" name="comboBoxEnd">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5">
+ <widget class="QCheckBox" name="checkBoxRegExprEnd">
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Reg.Expr</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Show:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="comboBoxVisible">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QCheckBox" name="checkBoxRegExprVisible">
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Reg.Expr.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QLabel" name="label_4">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Hide:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4">
+ <widget class="QComboBox" name="comboBoxHide">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="5">
+ <widget class="QCheckBox" name="checkBoxRegExprHide">
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Reg.Expr.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Mark:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="comboBoxMark">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QCheckBox" name="checkBoxRegExprMark">
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Reg.Expr.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4">
+ <widget class="QPushButton" name="pushButtonSearch">
+ <property name="text">
+ <string>&Suchen</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QPlainTextEdit" name="plainTextEdit">
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textEdit"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QPushButton" name="pushButtonPrev">
+ <property name="text">
+ <string>&Previous</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>&Next</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>First Line:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxFirstLine">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Tab 2</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menuBar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1030</width>
+ <height>23</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuFile">
+ <property name="title">
+ <string>&File</string>
+ </property>
+ <addaction name="separator"/>
+ <addaction name="separator"/>
+ <addaction name="separator"/>
+ <addaction name="actionExit"/>
+ <addaction name="separator"/>
+ </widget>
+ <widget class="QMenu" name="menuHelp">
+ <property name="title">
+ <string>&Help</string>
+ </property>
+ <addaction name="actionAbout"/>
+ </widget>
+ <widget class="QMenu" name="menuNavigation">
+ <property name="title">
+ <string>&Navigate</string>
+ </property>
+ </widget>
+ <widget class="QMenu" name="menu_Edit">
+ <property name="title">
+ <string>&Edit</string>
+ </property>
+ <addaction name="separator"/>
+ <addaction name="separator"/>
+ <addaction name="separator"/>
+ </widget>
+ <addaction name="menuFile"/>
+ <addaction name="menu_Edit"/>
+ <addaction name="menuNavigation"/>
+ <addaction name="menuHelp"/>
+ </widget>
+ <widget class="QToolBar" name="mainToolBar">
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ <widget class="QStatusBar" name="statusBar"/>
+ <widget class="QToolBar" name="toolBarNavigate">
+ <property name="windowTitle">
+ <string>toolBar</string>
+ </property>
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ <widget class="QToolBar" name="toolBarEdit">
+ <property name="windowTitle">
+ <string>toolBar_2</string>
+ </property>
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ <addaction name="separator"/>
+ <addaction name="separator"/>
+ </widget>
+ <widget class="QToolBar" name="toolBarExit">
+ <property name="windowTitle">
+ <string>toolBar_2</string>
+ </property>
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ <addaction name="actionExit"/>
+ </widget>
+ <action name="actionExit">
+ <property name="icon">
+ <iconset resource="reviewer.qrc">
+ <normaloff>:/main/icons/door_in.png</normaloff>:/main/icons/door_in.png</iconset>
+ </property>
+ <property name="text">
+ <string>E&xit</string>
+ </property>
+ <property name="toolTip">
+ <string>Exits the program</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+X</string>
+ </property>
+ </action>
+ <action name="actionAbout">
+ <property name="text">
+ <string>&About</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Shift+A</string>
+ </property>
+ </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+ <include location="reviewer.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>actionExit</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>566</x>
+ <y>289</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+#-------------------------------------------------
+#
+# Project created by QtCreator 2015-04-02T23:48:19
+#
+#-------------------------------------------------
+
+QT += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = refind
+TEMPLATE = app
+
+INCLUDEPATH = ../.. /usr/include/c++/4.9
+
+SOURCES += main.cpp\
+ mainwindow.cpp \
+ ../../base/ReException.cpp \
+ ../../base/ReQStringUtil.cpp \
+ ../../base/ReLogger.cpp \
+ aboutdialog.cpp \
+ ../../gui/ReStateStorage.cpp \
+ ../../gui/ReGuiValidator.cpp \
+ ../../base/ReBigFile.cpp
+
+HEADERS += mainwindow.hpp \
+ ../../base/rebase.hpp \
+ ../../base/ReQStringUtil.hpp \
+ ../../gui/ReStateStorage.hpp \
+ aboutdialog.hpp \
+ ../../gui/ReGuiValidator.hpp \
+ ../../gui/regui.hpp \
+ ../../base/ReBigFile.hpp
+
+
+FORMS += mainwindow.ui \
+ aboutdialog.ui
+
+TRANSLATIONS = reviewer_de.ts
+
+CODECFORSRC = UTF-8
+
+RESOURCES += \
+ reviewer.qrc
--- /dev/null
+<RCC>
+ <qresource prefix="/main">
+ <file>icons/bullet_go.png</file>
+ <file>icons/door_in.png</file>
+ <file>icons/layout_add.png</file>
+ <file>icons/resultset_next.png</file>
+ <file>icons/sitemap_color.png</file>
+ <file>icons/arrow_turn_left.png</file>
+ <file>icons/table.png</file>
+ <file>icons/tables.png</file>
+ <file>icons/action_go.png</file>
+ <file>icons/action_paste.png</file>
+ <file>icons/folder_find.png</file>
+ <file>icons/folder_go.png</file>
+ <file>icons/folder_magnify.png</file>
+ <file>icons/folder.png</file>
+ <file>icons/wand.png</file>
+ <file>icons/cog_edit.png</file>
+ <file>icons/database_save.png</file>
+ <file>icons/disk.png</file>
+ <file>icons/wrench.png</file>
+ <file>icons/eye.png</file>
+ </qresource>
+</RCC>
const char* ptr = start;
int restLength = length - sourceLength + 1;
while (restLength > 0
- && (ptr =
- ignoreCase ?
+ && (ptr = reinterpret_cast<const char*>(ignoreCase ?
memchr(start, first, restLength) :
- memichr(start, cc, restLength)) != NULL){
+ memichr(start, first, restLength))) != NULL){
if ((ignoreCase ?
memicmp(ptr, toFind, sourceLength) :
memcmp(ptr, toFind, sourceLength)) == 0){
rc = true;
lineNo = m_lineNo;
- line = QString::fromUtf8(QByteBuffer(m_startOfLine, m_lineLength));
+ QByteArray buffer(m_startOfLine, m_lineLength);
+ if (line == NULL)
+ *line = QString::fromUtf8(buffer);
break;
}
restLength = length - (ptr - start) - sourceLength + 1;
* @param includePattern "" or the pattern matching the result
* @param includeIsRegExpr true: the pattern is a regular expression<br>
* false: the pattern is a string without meta chars
+ * @param includeIgnoreCase true: includePattern is case insensitive
* @param excludePattern "" or the pattern wich must not match the result
* @param excludeIsRegExpr true: the exclude pattern is a regular expression<br>
* false: the pattern is a string without meta chars
-
+ * @param excludeIgnoreCase true: excludePattern is case insensitive
* @param lineNo OUT: 0 or the line number
* @param line OUT: "" or the found line
* @return true: a line has been found<br>
* false: a line has not been found
*/
bool ReFile::findLine(const QString& includePattern, bool includeIsRegExpr,
- const QString& excludePattern, bool excludeIsRegExpr, int& lineNo,
+ bool includeIgnoreCase, const QString& excludePattern,
+ bool excludeIsRegExpr, bool includeIgnoreCase, int& lineNo,
QString* line){
line = "";
lineNo = 0;