aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-11-08 21:10:42 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2017-11-09 07:35:48 +0000
commit25c5d830c95872630ca87d21a3d9e3a7e084e0db (patch)
treeff6b2a5ec7d74b70e3e30136be6203f618f0002e /ui
parent35a1907fe6a5f7d630223ba38adabc28eeeed971 (diff)
Qt: Give focus to Title in ColumnEditorFrame
Select the title text and give focus to the title when Edit Column. Bug: 14191 Change-Id: I04fc5f6bcc830a15ef43fa2d06a1a729df52e370 Reviewed-on: https://code.wireshark.org/review/24305 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/column_editor_frame.cpp8
-rw-r--r--ui/qt/column_editor_frame.h1
-rw-r--r--ui/qt/main_window_slots.cpp2
3 files changed, 10 insertions, 1 deletions
diff --git a/ui/qt/column_editor_frame.cpp b/ui/qt/column_editor_frame.cpp
index 307b643bc4..72dcf8116d 100644
--- a/ui/qt/column_editor_frame.cpp
+++ b/ui/qt/column_editor_frame.cpp
@@ -99,6 +99,14 @@ void ColumnEditorFrame::editColumn(int column)
setFields(ui->typeComboBox->currentIndex());
}
+void ColumnEditorFrame::showEvent(QShowEvent *event)
+{
+ ui->titleLineEdit->setFocus();
+ ui->titleLineEdit->selectAll();
+
+ AccordionFrame::showEvent(event);
+}
+
void ColumnEditorFrame::on_typeComboBox_activated(int index)
{
setFields(index);
diff --git a/ui/qt/column_editor_frame.h b/ui/qt/column_editor_frame.h
index e6969a1be1..d2c77baac4 100644
--- a/ui/qt/column_editor_frame.h
+++ b/ui/qt/column_editor_frame.h
@@ -42,6 +42,7 @@ signals:
void pushFilterSyntaxStatus(const QString&);
protected:
+ virtual void showEvent(QShowEvent *event);
void keyPressEvent(QKeyEvent *event);
private slots:
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 77a60b4582..4c5491920a 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -1631,8 +1631,8 @@ void MainWindow::showColumnEditor(int column)
{
previous_focus_ = wsApp->focusWidget();
connect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
- showAccordionFrame(main_ui_->columnEditorFrame);
main_ui_->columnEditorFrame->editColumn(column);
+ showAccordionFrame(main_ui_->columnEditorFrame);
}
void MainWindow::showPreferenceEditor()