diff --git a/cmainwindow.cpp b/cmainwindow.cpp index 4f49ce4..66a918b 100644 --- a/cmainwindow.cpp +++ b/cmainwindow.cpp @@ -15,6 +15,8 @@ #include "cwidget.h" +#include "coptionsdialog.h" + #include #include #include @@ -437,6 +439,11 @@ void cMainWindow::createTextActions() void cMainWindow::createToolsActions() { + QAction* lpAction; + + m_lpToolsMenu = menuBar()->addMenu(tr("&Tools")); + + lpAction = m_lpToolsMenu->addAction(tr("&Options..."), this, &cMainWindow::onToolsOptions); } void cMainWindow::createWindowActions() @@ -1379,6 +1386,15 @@ void cMainWindow::onFileProperties() onShowPropertiesWindow(); } +void cMainWindow::onToolsOptions() +{ + cOptionsDialog* lpOptionsDialog = new cOptionsDialog(this); + + lpOptionsDialog->exec(); + + delete lpOptionsDialog; +} + void cMainWindow::onHelpContents() { QMessageBox::information(this, "Help", "Contents"); diff --git a/cmainwindow.h b/cmainwindow.h index 7a24303..30f1e3e 100644 --- a/cmainwindow.h +++ b/cmainwindow.h @@ -445,6 +445,13 @@ private slots: */ void onFileProperties(); + /*! + \brief + + \fn onToolsOptions + */ + void onToolsOptions(); + /*! \brief @@ -638,7 +645,7 @@ private slots: private: Ui::cMainWindow* ui; /*!< User Interface */ - cSplashScreen* m_lpSplashScreen; + cSplashScreen* m_lpSplashScreen; /*!< Splash Screen */ QStandardItemModel* m_lpOutlineModel; /*!< Item Model for Outline list */ QStandardItemModel* m_lpCharacterModel; /*!< Item Model for Character list */ diff --git a/coptionsdialog.cpp b/coptionsdialog.cpp new file mode 100644 index 0000000..7e533ed --- /dev/null +++ b/coptionsdialog.cpp @@ -0,0 +1,24 @@ +#include "coptionsdialog.h" +#include "ui_coptionsdialog.h" + + +cOptionsDialog::cOptionsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::cOptionsDialog) +{ + ui->setupUi(this); + + m_lpCategoryModel = new QStandardItemModel(0, 1); + ui->m_lpCategoryList->setModel(m_lpCategoryModel); + + QIcon icon(":/category/category_core.png"); + QStandardItem* lpItem = new QStandardItem(icon, tr("General")); + m_lpCategoryModel->appendRow(lpItem); + + ui->m_lpCategoryList->resizeColumnToContents(0); +} + +cOptionsDialog::~cOptionsDialog() +{ + delete ui; +} diff --git a/coptionsdialog.h b/coptionsdialog.h new file mode 100644 index 0000000..bcc5219 --- /dev/null +++ b/coptionsdialog.h @@ -0,0 +1,43 @@ +#ifndef COPTIONSDIALOG_H +#define COPTIONSDIALOG_H + + +#include + +#include + + +namespace Ui { +class cOptionsDialog; +} + +/*! + \brief + + \class cOptionsDialog coptionsdialog.h "coptionsdialog.h" +*/ +class cOptionsDialog : public QDialog +{ + Q_OBJECT + +public: + /*! + \brief + + \fn cOptionsDialog + \param parent + */ + explicit cOptionsDialog(QWidget *parent = 0); + /*! + \brief + + \fn ~cOptionsDialog + */ + ~cOptionsDialog(); + +private: + Ui::cOptionsDialog* ui; /*!< TODO: describe */ + QStandardItemModel* m_lpCategoryModel; /*!< TODO: describe */ +}; + +#endif // COPTIONSDIALOG_H diff --git a/coptionsdialog.ui b/coptionsdialog.ui new file mode 100644 index 0000000..eec6591 --- /dev/null +++ b/coptionsdialog.ui @@ -0,0 +1,107 @@ + + + cOptionsDialog + + + + 0 + 0 + 544 + 386 + + + + Dialog + + + + + + + + + 150 + 0 + + + + + 24 + 24 + + + + false + + + false + + + + + + + true + + + + + 0 + 0 + 366 + 335 + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + cOptionsDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + cOptionsDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/images/category/category_core.png b/images/category/category_core.png new file mode 100644 index 0000000..aaa9464 Binary files /dev/null and b/images/category/category_core.png differ diff --git a/storyWriter.pro b/storyWriter.pro index d608477..85bbf47 100644 --- a/storyWriter.pro +++ b/storyWriter.pro @@ -88,7 +88,8 @@ SOURCES += \ ccharacterselectdialog.cpp \ csplashscreen.cpp \ cplaceselectdialog.cpp \ - cobjectselectdialog.cpp + cobjectselectdialog.cpp \ + coptionsdialog.cpp HEADERS += \ cmainwindow.h \ @@ -128,7 +129,8 @@ HEADERS += \ ccharacterselectdialog.h \ csplashscreen.h \ cplaceselectdialog.h \ - cobjectselectdialog.h + cobjectselectdialog.h \ + coptionsdialog.h FORMS += \ cmainwindow.ui \ @@ -143,7 +145,8 @@ FORMS += \ cpropertieswindow.ui \ ccharacterselectdialog.ui \ cplaceselectdialog.ui \ - cobjectselectdialog.ui + cobjectselectdialog.ui \ + coptionsdialog.ui DISTFILES += \ Doxyfile \ diff --git a/storywriter.qrc b/storywriter.qrc index 44031c6..d5e45cb 100644 --- a/storywriter.qrc +++ b/storywriter.qrc @@ -665,4 +665,7 @@ storyWriter_de.qm + + images/category/category_core.png +