Rename WindowMain back to MainWindow and DialogAdd to AddDialog.

Looked weird.
This commit is contained in:
tastytea 2020-02-26 06:29:22 +01:00
parent e73a55e1ca
commit adf0e62106
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
7 changed files with 36 additions and 33 deletions

View File

@ -6,7 +6,7 @@
namespace FediPotato namespace FediPotato
{ {
DialogAbout::DialogAbout(QDialog *parent) AboutDialog::AboutDialog(QDialog *parent)
: QDialog(parent) : QDialog(parent)
{ {
setupUi(this); setupUi(this);
@ -17,7 +17,7 @@ DialogAbout::DialogAbout(QDialog *parent)
display_authors(); display_authors();
} }
void DialogAbout::display_authors() const void AboutDialog::display_authors() const
{ {
QFile file(":/AUTHORS"); QFile file(":/AUTHORS");
if (file.open(QIODevice::ReadOnly)) if (file.open(QIODevice::ReadOnly))

View File

@ -9,26 +9,26 @@
namespace FediPotato namespace FediPotato
{ {
class DialogAbout : public QDialog, private Ui::DialogAbout class AboutDialog : public QDialog, private Ui::AboutDialog
{ {
public: public:
//! Default constructor //! Default constructor
explicit DialogAbout(QDialog *parent = nullptr); explicit AboutDialog(QDialog *parent = nullptr);
//! Copy constructor //! Copy constructor
DialogAbout(const DialogAbout &other) = delete; AboutDialog(const AboutDialog &other) = delete;
//! Move constructor //! Move constructor
DialogAbout(DialogAbout &&other) noexcept = delete; AboutDialog(AboutDialog &&other) noexcept = delete;
//! Destructor //! Destructor
~DialogAbout() noexcept override = default; ~AboutDialog() noexcept override = default;
//! Copy assignment operator //! Copy assignment operator
DialogAbout& operator=(const DialogAbout &other) = delete; AboutDialog& operator=(const AboutDialog &other) = delete;
//! Move assignment operator //! Move assignment operator
DialogAbout& operator=(DialogAbout &&other) noexcept = delete; AboutDialog& operator=(AboutDialog &&other) noexcept = delete;
public: public:

View File

@ -37,7 +37,7 @@ int main(int argc, char *argv[])
QLibraryInfo::location(QLibraryInfo::TranslationsPath)); QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QGuiApplication::installTranslator(&appTranslator); QGuiApplication::installTranslator(&appTranslator);
WindowMain win; MainWindow win;
win.show(); win.show();
return QGuiApplication::exec(); return QGuiApplication::exec();

View File

@ -27,7 +27,7 @@
namespace FediPotato namespace FediPotato
{ {
WindowMain::WindowMain(QMainWindow *parent) MainWindow::MainWindow(QMainWindow *parent)
: QMainWindow(parent) : QMainWindow(parent)
, _model_channel(new QStandardItemModel(this)) , _model_channel(new QStandardItemModel(this))
{ {
@ -36,7 +36,7 @@ WindowMain::WindowMain(QMainWindow *parent)
add_account(); add_account();
} }
void WindowMain::add_account() void MainWindow::add_account()
{ {
QStandardItem *item_root{_model_channel->invisibleRootItem()}; QStandardItem *item_root{_model_channel->invisibleRootItem()};
auto *item_account{new ChannelItem("@user@example.com", id_channel::none)}; auto *item_account{new ChannelItem("@user@example.com", id_channel::none)};
@ -69,18 +69,18 @@ void WindowMain::add_account()
treeview_channel->setFont(font_channel); treeview_channel->setFont(font_channel);
} }
void WindowMain::show_about() void MainWindow::show_about()
{ {
auto *dlg{new DialogAbout()}; // NOLINT(cppcoreguidelines-owning-memory) auto *dlg{new AboutDialog()}; // NOLINT(cppcoreguidelines-owning-memory)
dlg->show(); dlg->show();
} }
void WindowMain::open_website() void MainWindow::open_website()
{ {
QDesktopServices::openUrl(QUrl("http://fedipotato.org/")); QDesktopServices::openUrl(QUrl("http://fedipotato.org/"));
} }
void WindowMain::clicked_channel(const QModelIndex &index) void MainWindow::clicked_channel(const QModelIndex &index)
{ {
auto item{dynamic_cast<ChannelItem*>(_model_channel->itemFromIndex(index))}; auto item{dynamic_cast<ChannelItem*>(_model_channel->itemFromIndex(index))};

View File

@ -13,28 +13,28 @@
namespace FediPotato namespace FediPotato
{ {
class WindowMain : public QMainWindow, private Ui::WindowMain class MainWindow : public QMainWindow, private Ui::MainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
//! Default constructor //! Default constructor
explicit WindowMain(QMainWindow *parent = nullptr); explicit MainWindow(QMainWindow *parent = nullptr);
//! Copy constructor //! Copy constructor
WindowMain(const WindowMain &other) = delete; MainWindow(const MainWindow &other) = delete;
//! Move constructor //! Move constructor
WindowMain(WindowMain &&other) noexcept = delete; MainWindow(MainWindow &&other) noexcept = delete;
//! Destructor //! Destructor
~WindowMain() noexcept override = default; ~MainWindow() noexcept override = default;
//! Copy assignment operator //! Copy assignment operator
WindowMain& operator=(const WindowMain &other) = delete; MainWindow& operator=(const MainWindow &other) = delete;
//! Move assignment operator //! Move assignment operator
WindowMain& operator=(WindowMain &&other) noexcept = delete; MainWindow& operator=(MainWindow &&other) noexcept = delete;
private: private:
QStandardItemModel *_model_channel; QStandardItemModel *_model_channel;

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>DialogAbout</class> <class>AboutDialog</class>
<widget class="QDialog" name="DialogAbout"> <widget class="QDialog" name="AboutDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>400</width>
<height>187</height> <height>200</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -76,6 +76,9 @@
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
@ -102,7 +105,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>358</width> <width>358</width>
<height>116</height> <height>129</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>WindowMain</class> <class>MainWindow</class>
<widget class="QMainWindow" name="WindowMain"> <widget class="QMainWindow" name="MainWindow">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -103,7 +103,7 @@
<connection> <connection>
<sender>action_about</sender> <sender>action_about</sender>
<signal>triggered()</signal> <signal>triggered()</signal>
<receiver>WindowMain</receiver> <receiver>MainWindow</receiver>
<slot>show_about()</slot> <slot>show_about()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -119,7 +119,7 @@
<connection> <connection>
<sender>action_quit</sender> <sender>action_quit</sender>
<signal>triggered()</signal> <signal>triggered()</signal>
<receiver>WindowMain</receiver> <receiver>MainWindow</receiver>
<slot>close()</slot> <slot>close()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -135,7 +135,7 @@
<connection> <connection>
<sender>action_website</sender> <sender>action_website</sender>
<signal>triggered()</signal> <signal>triggered()</signal>
<receiver>WindowMain</receiver> <receiver>MainWindow</receiver>
<slot>open_website()</slot> <slot>open_website()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -151,7 +151,7 @@
<connection> <connection>
<sender>treeview_channel</sender> <sender>treeview_channel</sender>
<signal>clicked(QModelIndex)</signal> <signal>clicked(QModelIndex)</signal>
<receiver>WindowMain</receiver> <receiver>MainWindow</receiver>
<slot>clicked_channel(QModelIndex)</slot> <slot>clicked_channel(QModelIndex)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">