diff --git a/qad/application/emainwindow.cpp b/qad/application/emainwindow.cpp index 76eb206..3dd03c6 100644 --- a/qad/application/emainwindow.cpp +++ b/qad/application/emainwindow.cpp @@ -379,6 +379,16 @@ void EMainWindow::openFile() { } +void EMainWindow::openFiles() { + if (!checkSave()) return; + QStringList ret = QFileDialog::getOpenFileNames(this, trUtf8("Select files to open"), file_name, loadFilter()); + foreach (QString s, ret) { + if (load(s)) + addToRecent(s); + } +} + + bool EMainWindow::saveFile(bool ask) { if (ask) { int ret = QMessageBox::question(this, windowTitle(), trUtf8("Save changes%1?").arg(!file_name.isEmpty() ? (trUtf8(" in") + " \"" + file_name + "\"") : ""), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save); diff --git a/qad/application/emainwindow.h b/qad/application/emainwindow.h index ae0615a..ef104c0 100644 --- a/qad/application/emainwindow.h +++ b/qad/application/emainwindow.h @@ -115,6 +115,7 @@ public slots: void changed() {setChanged(true);} void newFile(); void openFile(); + void openFiles(); bool saveFile(bool ask = false); bool saveAsFile(); void clearRecent(); diff --git a/qad/widgets/qcodeedit.cpp b/qad/widgets/qcodeedit.cpp index a491a1c..b77a6fc 100644 --- a/qad/widgets/qcodeedit.cpp +++ b/qad/widgets/qcodeedit.cpp @@ -19,6 +19,8 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) { ui = new Ui::QCodeEdit(); ui->setupUi(this); ui->widgetSearch->hide(); + ui->comboSearch->installEventFilter(this); + ui->comboReplace->installEventFilter(this); prev_lc = auto_comp_pl = cur_search_ind = pos_press = pos_el_press = -1; timer = 0; _ignore_focus_out = _destructor = _replacing = false; @@ -334,6 +336,20 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) { //qDebug() << e; return QWidget::eventFilter(o, e); } + if (o == ui->comboSearch || o == ui->comboReplace) { + //qDebug() << o << e; + if (e->type() == QEvent::KeyPress) { + if (((QKeyEvent * )e)->key() == Qt::Key_Escape) { + hideHelp(); + if (completer->isVisible()) + completer->hide(); + else + hideSearch(); + } + } + //qDebug() << e; + return QWidget::eventFilter(o, e); + } if (ui->textCode) { if (o == ui->textCode->viewport()) { if (e->type() == QEvent::MouseButtonPress) { @@ -343,7 +359,7 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) { return QWidget::eventFilter(o, e); } if (o == ui->textCode) { - //qDebug() << o << e; + //qDebug() << e; QMetaObject::invokeMethod(this, "syncScrolls", Qt::QueuedConnection); QKeyEvent * ke; QChar kc(0); diff --git a/qad/widgets/qcodeedit.ui b/qad/widgets/qcodeedit.ui index 2c07725..1a53c84 100644 --- a/qad/widgets/qcodeedit.ui +++ b/qad/widgets/qcodeedit.ui @@ -7,7 +7,7 @@ 0 0 726 - 697 + 577 @@ -178,7 +178,7 @@ Previous - + :/icons/go-previous.png:/icons/go-previous.png @@ -195,7 +195,7 @@ Next - + :/icons/go-next.png:/icons/go-next.png @@ -312,7 +312,7 @@ - + @@ -385,5 +385,6 @@ searchNext() searchPrevious() searchAll() + hideSearch()