git-svn-id: svn://db.shs.com.ru/libs@367 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>726</width>
|
||||
<height>697</height>
|
||||
<height>577</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@@ -178,7 +178,7 @@
|
||||
<string>Previous</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../nicirt/src/nics_admin/icons.qrc">
|
||||
<iconset resource="qad_widgets.qrc">
|
||||
<normaloff>:/icons/go-previous.png</normaloff>:/icons/go-previous.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -195,7 +195,7 @@
|
||||
<string>Next</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../nicirt/src/nics_admin/icons.qrc">
|
||||
<iconset resource="qad_widgets.qrc">
|
||||
<normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -312,7 +312,7 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../nicirt/src/nics_admin/icons.qrc"/>
|
||||
<include location="qad_widgets.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
@@ -385,5 +385,6 @@
|
||||
<slot>searchNext()</slot>
|
||||
<slot>searchPrevious()</slot>
|
||||
<slot>searchAll()</slot>
|
||||
<slot>hideSearch()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user