diff options
author | Roland Knall <rknall@gmail.com> | 2018-06-01 22:54:49 +0200 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2018-06-01 22:01:20 +0000 |
commit | f4e3d8cbf3b8815f8affb3cb625ff5e8813bd0a8 (patch) | |
tree | a4c3dbbd91c80fdcf8fa8dab19af6875a7352c00 /ui | |
parent | 5ff8c3895a41b44486fbc17e05e4a188e3c4827e (diff) |
Qt: Rename MainWelcome
Currently exist two main pages within Wireshark. The first being
the main welcome page and the second the packet capture page. The
first is called "main_welcome.?" and the second is actually the
master_split_ object defined in main_window.h. The first being a
QFrame, the second not.
In preparation for future developments (dockable windows, multiple capture
files), this is being corrected, with the main welcome being renamed
as welcome_page as a first step
Change-Id: I40703e6ed15ff6f6b62b2a3cf31f5636ac6da9ec
Reviewed-on: https://code.wireshark.org/review/27949
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/CMakeLists.txt | 6 | ||||
-rw-r--r-- | ui/qt/main_window.cpp | 14 | ||||
-rw-r--r-- | ui/qt/main_window.h | 4 | ||||
-rw-r--r-- | ui/qt/main_window.ui | 6 | ||||
-rw-r--r-- | ui/qt/main_window_layout.cpp | 2 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 16 | ||||
-rw-r--r-- | ui/qt/welcome_page.cpp (renamed from ui/qt/main_welcome.cpp) | 60 | ||||
-rw-r--r-- | ui/qt/welcome_page.h (renamed from ui/qt/main_welcome.h) | 18 | ||||
-rw-r--r-- | ui/qt/welcome_page.ui (renamed from ui/qt/main_welcome.ui) | 4 |
9 files changed, 65 insertions, 65 deletions
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt index 3aa870f103..e39366238c 100644 --- a/ui/qt/CMakeLists.txt +++ b/ui/qt/CMakeLists.txt @@ -163,7 +163,7 @@ set(WIRESHARK_QT_HEADERS lte_mac_statistics_dialog.h lte_rlc_statistics_dialog.h main_status_bar.h - main_welcome.h + welcome_page.h main_window.h main_window_preferences_frame.h manage_interfaces_dialog.h @@ -372,7 +372,7 @@ set(WIRESHARK_QT_SRC lte_rlc_graph_dialog.cpp lte_rlc_statistics_dialog.cpp main_status_bar.cpp - main_welcome.cpp + welcome_page.cpp main_window.cpp main_window_preferences_frame.cpp main_window_layout.cpp @@ -503,7 +503,7 @@ set(WIRESHARK_QT_UI lbm_lbtru_transport_dialog.ui lbm_stream_dialog.ui lte_rlc_graph_dialog.ui - main_welcome.ui + welcome_page.ui main_window.ui main_window_preferences_frame.ui manage_interfaces_dialog.ui diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 29261bb8c5..418f82dc62 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -510,7 +510,7 @@ MainWindow::MainWindow(QWidget *parent) : packet_list_->setProtoTree(proto_tree_); packet_list_->installEventFilter(this); - main_welcome_ = main_ui_->welcomePage; + welcome_page_ = main_ui_->welcomePage; connect(proto_tree_, SIGNAL(fieldSelected(FieldInformation *)), this, SIGNAL(fieldSelected(FieldInformation *))); @@ -575,13 +575,13 @@ MainWindow::MainWindow(QWidget *parent) : connect(main_ui_->mainStack, SIGNAL(currentChanged(int)), this, SLOT(mainStackChanged(int))); - connect(main_welcome_, SIGNAL(startCapture()), + connect(welcome_page_, SIGNAL(startCapture()), this, SLOT(startCapture())); - connect(main_welcome_, SIGNAL(recentFileActivated(QString)), + connect(welcome_page_, SIGNAL(recentFileActivated(QString)), this, SLOT(openCaptureFile(QString))); - connect(main_welcome_, SIGNAL(pushFilterSyntaxStatus(const QString&)), + connect(welcome_page_, SIGNAL(pushFilterSyntaxStatus(const QString&)), main_ui_->statusBar, SLOT(pushFilterStatus(const QString&))); - connect(main_welcome_, SIGNAL(popFilterSyntaxStatus()), + connect(welcome_page_, SIGNAL(popFilterSyntaxStatus()), main_ui_->statusBar, SLOT(popFilterStatus())); connect(main_ui_->addressEditorFrame, SIGNAL(editAddressStatus(QString)), @@ -691,7 +691,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(main_ui_->welcomePage, SIGNAL(captureFilterSyntaxChanged(bool)), this, SLOT(captureFilterSyntaxChanged(bool))); - connect(this->main_welcome_, SIGNAL(showExtcapOptions(QString&)), + connect(this->welcome_page_, SIGNAL(showExtcapOptions(QString&)), this, SLOT(showExtcapOptionsDialog(QString&))); #endif // HAVE_LIBPCAP @@ -945,7 +945,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { if (capture_interfaces_dialog_) capture_interfaces_dialog_->close(); #endif // Make sure we kill any open dumpcap processes. - delete main_welcome_; + delete welcome_page_; // One of the many places we assume one main window. if(!wsApp->isInitialized()) { diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index 6165edbbde..3b985bd73d 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -81,7 +81,7 @@ class CaptureInterfacesDialog; class FileSetDialog; class FilterDialog; class FunnelStatistics; -class MainWelcome; +class WelcomePage; class PacketList; class ProtoTree; class WirelessFrame; @@ -165,7 +165,7 @@ private: QSplitter master_split_; QSplitter extra_split_; QVector<unsigned> cur_layout_; - MainWelcome *main_welcome_; + WelcomePage *welcome_page_; DisplayFilterCombo *df_combo_box_; CaptureFile capture_file_; QFont mono_font_; diff --git a/ui/qt/main_window.ui b/ui/qt/main_window.ui index 27c9c2fff8..573f480cfb 100644 --- a/ui/qt/main_window.ui +++ b/ui/qt/main_window.ui @@ -133,7 +133,7 @@ <property name="enabled"> <bool>true</bool> </property> - <widget class="MainWelcome" name="welcomePage"/> + <widget class="WelcomePage" name="welcomePage"/> </widget> </item> </layout> @@ -2998,9 +2998,9 @@ <header>main_status_bar.h</header> </customwidget> <customwidget> - <class>MainWelcome</class> + <class>WelcomePage</class> <extends>QFrame</extends> - <header>main_welcome.h</header> + <header>welcome_page.h</header> <container>1</container> </customwidget> <customwidget> diff --git a/ui/qt/main_window_layout.cpp b/ui/qt/main_window_layout.cpp index e7412f0048..889f90621b 100644 --- a/ui/qt/main_window_layout.cpp +++ b/ui/qt/main_window_layout.cpp @@ -38,7 +38,7 @@ DIAG_ON(frame-larger-than=) void MainWindow::showWelcome() { - main_ui_->mainStack->setCurrentWidget(main_welcome_); + main_ui_->mainStack->setCurrentWidget(welcome_page_); } void MainWindow::showCapture() diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index f3713aa49a..66ddd12417 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -1456,7 +1456,7 @@ void MainWindow::captureFilterSyntaxChanged(bool valid) void MainWindow::startInterfaceCapture(bool valid, const QString capture_filter) { capture_filter_valid_ = valid; - main_welcome_->setCaptureFilter(capture_filter); + welcome_page_->setCaptureFilter(capture_filter); // The interface tree will update the selected interfaces via its timer // so no need to do anything here. startCapture(); @@ -3711,17 +3711,17 @@ void MainWindow::on_actionCaptureOptions_triggered() connect(capture_interfaces_dialog_, SIGNAL(stopCapture()), this, SLOT(stopCapture())); connect(capture_interfaces_dialog_, SIGNAL(getPoints(int,PointList*)), - this->main_welcome_->getInterfaceFrame(), SLOT(getPoints(int,PointList*))); + this->welcome_page_->getInterfaceFrame(), SLOT(getPoints(int,PointList*))); connect(capture_interfaces_dialog_, SIGNAL(interfacesChanged()), - this->main_welcome_, SLOT(interfaceSelected())); + this->welcome_page_, SLOT(interfaceSelected())); connect(capture_interfaces_dialog_, SIGNAL(interfacesChanged()), - this->main_welcome_->getInterfaceFrame(), SLOT(updateSelectedInterfaces())); + this->welcome_page_->getInterfaceFrame(), SLOT(updateSelectedInterfaces())); connect(capture_interfaces_dialog_, SIGNAL(interfaceListChanged()), - this->main_welcome_->getInterfaceFrame(), SLOT(interfaceListChanged())); + this->welcome_page_->getInterfaceFrame(), SLOT(interfaceListChanged())); connect(capture_interfaces_dialog_, SIGNAL(captureFilterTextEdited(QString)), - this->main_welcome_, SLOT(setCaptureFilterText(QString))); + this->welcome_page_, SLOT(setCaptureFilterText(QString))); // Propagate selection changes from main UI to dialog. - connect(this->main_welcome_, SIGNAL(interfacesChanged()), + connect(this->welcome_page_, SIGNAL(interfacesChanged()), capture_interfaces_dialog_, SLOT(interfaceSelected())); connect(capture_interfaces_dialog_, SIGNAL(setFilterValid(bool, const QString)), @@ -3784,7 +3784,7 @@ void MainWindow::extcap_options_finished(int result) if (result == QDialog::Accepted) { startCapture(); } - this->main_welcome_->getInterfaceFrame()->interfaceListChanged(); + this->welcome_page_->getInterfaceFrame()->interfaceListChanged(); } void MainWindow::showExtcapOptionsDialog(QString &device_name) diff --git a/ui/qt/main_welcome.cpp b/ui/qt/welcome_page.cpp index 4991fb8254..bef2b66e83 100644 --- a/ui/qt/main_welcome.cpp +++ b/ui/qt/welcome_page.cpp @@ -1,4 +1,4 @@ -/* main_welcome.cpp +/* welcome_page.cpp * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> @@ -18,8 +18,8 @@ #include "version_info.h" -#include "main_welcome.h" -#include <ui_main_welcome.h> +#include "welcome_page.h" +#include <ui_welcome_page.h> #include <ui/qt/utils/tango_colors.h> #include <ui/qt/utils/color_utils.h> #include <ui/qt/utils/qt_ui_utils.h> @@ -41,9 +41,9 @@ #include <extcap.h> -MainWelcome::MainWelcome(QWidget *parent) : +WelcomePage::WelcomePage(QWidget *parent) : QFrame(parent), - welcome_ui_(new Ui::MainWelcome), + welcome_ui_(new Ui::WelcomePage), flavor_(tr(VERSION_FLAVOR)), #ifdef Q_OS_MAC show_in_str_(tr("Show in Finder")), @@ -62,10 +62,10 @@ MainWelcome::MainWelcome(QWidget *parent) : QColor hover_color = ColorUtils::alphaBlend(palette().window(), palette().highlight(), 0.5); QString welcome_ss = QString( - "MainWelcome {" + "WelcomePage {" " padding: 1em;" " }" - "MainWelcome, QAbstractItemView {" + "WelcomePage, QAbstractItemView {" " background-color: palette(base);" " color: palette(text);" " }" @@ -185,22 +185,22 @@ MainWelcome::MainWelcome(QWidget *parent) : splash_overlay_ = new SplashOverlay(this); } -MainWelcome::~MainWelcome() +WelcomePage::~WelcomePage() { delete welcome_ui_; } -InterfaceFrame *MainWelcome::getInterfaceFrame() +InterfaceFrame *WelcomePage::getInterfaceFrame() { return welcome_ui_->interfaceFrame; } -const QString MainWelcome::captureFilter() +const QString WelcomePage::captureFilter() { return welcome_ui_->captureFilterComboBox->currentText(); } -void MainWelcome::setCaptureFilter(const QString capture_filter) +void WelcomePage::setCaptureFilter(const QString capture_filter) { // capture_filter comes from the current filter in // CaptureInterfacesDialog. We need to find a good way to handle @@ -208,7 +208,7 @@ void MainWelcome::setCaptureFilter(const QString capture_filter) welcome_ui_->captureFilterComboBox->lineEdit()->setText(capture_filter); } -void MainWelcome::interfaceListChanged() +void WelcomePage::interfaceListChanged() { QString btnText = tr("All interfaces shown"); if (welcome_ui_->interfaceFrame->interfacesHidden() > 0) { @@ -220,7 +220,7 @@ void MainWelcome::interfaceListChanged() welcome_ui_->btnInterfaceType->setMenu(welcome_ui_->interfaceFrame->getSelectionMenu()); } -void MainWelcome::appInitialized() +void WelcomePage::appInitialized() { // XXX Add a "check for updates" link? QString full_release; @@ -264,7 +264,7 @@ void MainWelcome::appInitialized() // of the capture filter lineedit. We do so here so that we don't clobber // filters set in the Capture Options / Interfaces dialog or ones set via // the command line. -void MainWelcome::captureFilterTextEdited(const QString capture_filter) +void WelcomePage::captureFilterTextEdited(const QString capture_filter) { if (global_capture_opts.num_selected > 0) { interface_t *device; @@ -290,7 +290,7 @@ void MainWelcome::captureFilterTextEdited(const QString capture_filter) } #else // No-op if we don't have capturing. -void MainWelcome::captureFilterTextEdited(const QString) +void WelcomePage::captureFilterTextEdited(const QString) { } #endif @@ -300,7 +300,7 @@ void MainWelcome::captureFilterTextEdited(const QString) // sources such as our remote connection, the command line, or a previous // selection. // Must not change any interface data. -void MainWelcome::interfaceSelected() +void WelcomePage::interfaceSelected() { QPair <const QString, bool> sf_pair = CaptureFilterEdit::getSelectedFilter(); const QString user_filter = sf_pair.first; @@ -317,17 +317,17 @@ void MainWelcome::interfaceSelected() emit interfacesChanged(); } -void MainWelcome::on_interfaceFrame_showExtcapOptions(QString device_name) +void WelcomePage::on_interfaceFrame_showExtcapOptions(QString device_name) { emit showExtcapOptions(device_name); } -void MainWelcome::on_interfaceFrame_startCapture() +void WelcomePage::on_interfaceFrame_startCapture() { emit startCapture(); } -void MainWelcome::updateRecentCaptures() { +void WelcomePage::updateRecentCaptures() { QString itemLabel; QListWidgetItem *rfItem; QFont rfFont; @@ -393,12 +393,12 @@ void MainWelcome::updateRecentCaptures() { } } -void MainWelcome::openRecentItem(QListWidgetItem *item) { +void WelcomePage::openRecentItem(QListWidgetItem *item) { QString cfPath = item->data(Qt::UserRole).toString(); emit recentFileActivated(cfPath); } -void MainWelcome::resizeEvent(QResizeEvent *event) +void WelcomePage::resizeEvent(QResizeEvent *event) { if (splash_overlay_) splash_overlay_->resize(event->size()); @@ -407,13 +407,13 @@ void MainWelcome::resizeEvent(QResizeEvent *event) QFrame::resizeEvent(event); } -void MainWelcome::setCaptureFilterText(const QString capture_filter) +void WelcomePage::setCaptureFilterText(const QString capture_filter) { welcome_ui_->captureFilterComboBox->lineEdit()->setText(capture_filter); captureFilterTextEdited(capture_filter); } -void MainWelcome::changeEvent(QEvent* event) +void WelcomePage::changeEvent(QEvent* event) { if (0 != event) { @@ -431,7 +431,7 @@ void MainWelcome::changeEvent(QEvent* event) QFrame::changeEvent(event); } -void MainWelcome::showRecentContextMenu(QPoint pos) +void WelcomePage::showRecentContextMenu(QPoint pos) { QListWidgetItem *li = recent_files_->itemAt(pos); if (!li) return; @@ -457,7 +457,7 @@ void MainWelcome::showRecentContextMenu(QPoint pos) recent_ctx_menu_->exec(recent_files_->mapToGlobal(pos)); } -void MainWelcome::showRecentFolder() +void WelcomePage::showRecentFolder() { QAction *ria = qobject_cast<QAction*>(sender()); if (!ria) return; @@ -466,7 +466,7 @@ void MainWelcome::showRecentFolder() desktop_show_in_folder(cf_path); } -void MainWelcome::copyRecentPath() +void WelcomePage::copyRecentPath() { QAction *ria = qobject_cast<QAction*>(sender()); if (!ria) return; @@ -477,7 +477,7 @@ void MainWelcome::copyRecentPath() wsApp->clipboard()->setText(cf_path); } -void MainWelcome::removeRecentPath() +void WelcomePage::removeRecentPath() { QAction *ria = qobject_cast<QAction*>(sender()); if (!ria) return; @@ -488,17 +488,17 @@ void MainWelcome::removeRecentPath() wsApp->removeRecentItem(cf_path); } -void MainWelcome::on_captureLabel_clicked() +void WelcomePage::on_captureLabel_clicked() { wsApp->doTriggerMenuItem(WiresharkApplication::CaptureOptionsDialog); } -void MainWelcome::on_helpLabel_clicked() +void WelcomePage::on_helpLabel_clicked() { QDesktopServices::openUrl(QUrl(topic_online_url(ONLINEPAGE_DOCS))); } -void MainWelcome::on_recentLabel_clicked() +void WelcomePage::on_recentLabel_clicked() { wsApp->doTriggerMenuItem(WiresharkApplication::FileOpenDialog); } diff --git a/ui/qt/main_welcome.h b/ui/qt/welcome_page.h index 7aef031a41..dce4a64e7e 100644 --- a/ui/qt/main_welcome.h +++ b/ui/qt/welcome_page.h @@ -1,4 +1,4 @@ -/* main_welcome.h +/* welcome_page.h * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef MAIN_WELCOME_H -#define MAIN_WELCOME_H +#ifndef WELCOME_PAGE_H +#define WELCOME_PAGE_H #include <QFrame> @@ -20,15 +20,15 @@ class QMenu; #include "interface_frame.h" namespace Ui { - class MainWelcome; + class WelcomePage; } -class MainWelcome : public QFrame +class WelcomePage : public QFrame { Q_OBJECT public: - explicit MainWelcome(QWidget *parent = 0); - virtual ~MainWelcome(); + explicit WelcomePage(QWidget *parent = 0); + virtual ~WelcomePage(); InterfaceFrame *getInterfaceFrame(); const QString captureFilter(); void setCaptureFilter(const QString capture_filter); @@ -46,7 +46,7 @@ protected slots: void on_helpLabel_clicked(); private: - Ui::MainWelcome *welcome_ui_; + Ui::WelcomePage *welcome_ui_; QString flavor_; QString show_in_str_; @@ -85,7 +85,7 @@ private slots: void on_interfaceFrame_startCapture(); }; -#endif // MAIN_WELCOME_H +#endif // WELCOME_PAGE_H /* * Editor modelines diff --git a/ui/qt/main_welcome.ui b/ui/qt/welcome_page.ui index 43d721dce1..e94fda678b 100644 --- a/ui/qt/main_welcome.ui +++ b/ui/qt/welcome_page.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>MainWelcome</class> - <widget class="QWidget" name="MainWelcome"> + <class>WelcomePage</class> + <widget class="QWidget" name="WelcomePage"> <property name="geometry"> <rect> <x>0</x> |