From 155cca0c9a23eec9db94f2e9214110029a0a4838 Mon Sep 17 00:00:00 2001 From: Michal Sciubidlo Date: Sat, 2 Feb 2013 16:25:41 +0100 Subject: [PATCH] Upload missing files. Fix folder name. Keep Qt optional. Move open dialogue from doc to tools. Rename 'load' to 'open'. Deleted wrong comment. --- apps/launcher/graphicspage.cpp | 2 +- apps/launcher/maindialog.cpp | 2 +- apps/opencs/CMakeLists.txt | 8 +++--- apps/opencs/view/doc/opendialog.cpp | 27 +++++++++++++++++++ apps/opencs/view/doc/opendialog.hpp | 17 ++++++++++++ apps/opencs/view/doc/view.cpp | 16 +++++------ apps/opencs/view/doc/view.hpp | 6 ++--- components/CMakeLists.txt | 16 ++++++----- .../datafileslist.cpp | 0 .../datafileslist.hpp | 0 .../model/datafilesmodel.cpp | 0 .../model/datafilesmodel.hpp | 0 .../model/esm/esmfile.cpp | 0 .../model/esm/esmfile.hpp | 0 .../model/modelitem.cpp | 0 .../model/modelitem.hpp | 0 .../utils/filedialog.cpp | 0 .../utils/filedialog.hpp | 0 .../utils/lineedit.cpp | 0 .../utils/lineedit.hpp | 0 .../utils/naturalsort.cpp | 0 .../utils/naturalsort.hpp | 0 .../utils/profilescombobox.cpp | 0 .../utils/profilescombobox.hpp | 0 .../utils/textinputdialog.cpp | 0 .../utils/textinputdialog.hpp | 0 26 files changed, 69 insertions(+), 25 deletions(-) create mode 100644 apps/opencs/view/doc/opendialog.cpp create mode 100644 apps/opencs/view/doc/opendialog.hpp rename components/{file_order_list => fileorderlist}/datafileslist.cpp (100%) rename components/{file_order_list => fileorderlist}/datafileslist.hpp (100%) rename components/{file_order_list => fileorderlist}/model/datafilesmodel.cpp (100%) rename components/{file_order_list => fileorderlist}/model/datafilesmodel.hpp (100%) rename components/{file_order_list => fileorderlist}/model/esm/esmfile.cpp (100%) rename components/{file_order_list => fileorderlist}/model/esm/esmfile.hpp (100%) rename components/{file_order_list => fileorderlist}/model/modelitem.cpp (100%) rename components/{file_order_list => fileorderlist}/model/modelitem.hpp (100%) rename components/{file_order_list => fileorderlist}/utils/filedialog.cpp (100%) rename components/{file_order_list => fileorderlist}/utils/filedialog.hpp (100%) rename components/{file_order_list => fileorderlist}/utils/lineedit.cpp (100%) rename components/{file_order_list => fileorderlist}/utils/lineedit.hpp (100%) rename components/{file_order_list => fileorderlist}/utils/naturalsort.cpp (100%) rename components/{file_order_list => fileorderlist}/utils/naturalsort.hpp (100%) rename components/{file_order_list => fileorderlist}/utils/profilescombobox.cpp (100%) rename components/{file_order_list => fileorderlist}/utils/profilescombobox.hpp (100%) rename components/{file_order_list => fileorderlist}/utils/textinputdialog.cpp (100%) rename components/{file_order_list => fileorderlist}/utils/textinputdialog.hpp (100%) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index e69a8c207..dee84498c 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "graphicspage.hpp" diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 43b8f317a..7914650fe 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include "maindialog.hpp" #include "playpage.hpp" diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 68b22c10e..76d669e15 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -12,12 +12,12 @@ set (OPENCS_SRC model/tools/mandatoryid.cpp model/tools/reportmodel.cpp view/doc/viewmanager.cpp view/doc/view.cpp view/doc/operations.cpp view/doc/operation.cpp view/doc/subviewfactory.cpp - view/doc/subview.cpp + view/doc/subview.cpp view/doc/opendialog.cpp view/world/table.cpp view/world/tablesubview.cpp view/world/subviews.cpp view/world/util.cpp view/world/dialoguesubview.cpp - view/tools/reportsubview.cpp view/tools/subviews.cpp view/tools/opendialog.cpp + view/tools/reportsubview.cpp view/tools/subviews.cpp ) set (OPENCS_HDR @@ -33,12 +33,12 @@ set (OPENCS_HDR model/tools/mandatoryid.hpp model/tools/reportmodel.hpp view/doc/viewmanager.hpp view/doc/view.hpp view/doc/operations.hpp view/doc/operation.hpp view/doc/subviewfactory.hpp - view/doc/subview.hpp view/doc/subviewfactoryimp.hpp + view/doc/subview.hpp view/doc/subviewfactoryimp.hpp view/doc/opendialog.hpp view/world/table.hpp view/world/tablesubview.hpp view/world/subviews.hpp view/world/util.hpp view/world/dialoguesubview.hpp - view/tools/reportsubview.hpp view/tools/subviews.hpp view/tools/opendialog.hpp + view/tools/reportsubview.hpp view/tools/subviews.hpp ) set (OPENCS_US diff --git a/apps/opencs/view/doc/opendialog.cpp b/apps/opencs/view/doc/opendialog.cpp new file mode 100644 index 000000000..f51cbadb9 --- /dev/null +++ b/apps/opencs/view/doc/opendialog.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include + +#include "opendialog.hpp" + +OpenDialog::OpenDialog(QWidget * parent) : QDialog(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + mFileSelector = new DataFilesList(mCfgMgr, this); + layout->addWidget(mFileSelector); + mFileSelector->setupDataFiles(); + + buttonBox = new QDialogButtonBox(QDialogButtonBox::Open | QDialogButtonBox::Cancel, Qt::Horizontal, this); + connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); + connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + layout->addWidget(buttonBox); + + setLayout(layout); + setWindowTitle(tr("Open")); +} + +void OpenDialog::getFileList(std::vector& paths) +{ + mFileSelector->getSelectedFiles(paths); +} diff --git a/apps/opencs/view/doc/opendialog.hpp b/apps/opencs/view/doc/opendialog.hpp new file mode 100644 index 000000000..6355aea44 --- /dev/null +++ b/apps/opencs/view/doc/opendialog.hpp @@ -0,0 +1,17 @@ +#include +#include + +class DataFilesList; +class QDialogButtonBox; + +class OpenDialog : public QDialog { + Q_OBJECT +public: + OpenDialog(QWidget * parent = 0); + + void getFileList(std::vector& paths); +private: + DataFilesList * mFileSelector; + QDialogButtonBox * buttonBox; + Files::ConfigurationManager mCfgMgr; +}; \ No newline at end of file diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index ebcb9aaa7..112807cca 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -14,8 +14,7 @@ #include "../tools/subviews.hpp" -#include "../tools/opendialog.hpp" - +#include "opendialog.hpp" #include "viewmanager.hpp" #include "operations.hpp" #include "subview.hpp" @@ -34,9 +33,9 @@ void CSVDoc::View::setupFileMenu() connect (new_, SIGNAL (triggered()), this, SIGNAL (newDocumentRequest())); file->addAction (new_); - mLoad = new QAction(tr ("&Load"), this); - connect (mLoad, SIGNAL (triggered()), this, SLOT (load())); - file->addAction (mLoad); + mOpen = new QAction(tr ("&Open"), this); + connect (mOpen, SIGNAL (triggered()), this, SLOT (open())); + file->addAction (mOpen); mSave = new QAction (tr ("&Save"), this); connect (mSave, SIGNAL (triggered()), this, SLOT (save())); @@ -211,11 +210,11 @@ void CSVDoc::View::save() mDocument->save(); } -void CSVDoc::View::load() +void CSVDoc::View::open() { if (!mOpenDialog) { mOpenDialog = new OpenDialog(this); - connect(mOpenDialog, SIGNAL(accepted()), this, SLOT(loadNewFiles())); + connect(mOpenDialog, SIGNAL(accepted()), this, SLOT(openNewFiles())); } mOpenDialog->show(); @@ -223,9 +222,8 @@ void CSVDoc::View::load() mOpenDialog->activateWindow(); } -void CSVDoc::View::loadNewFiles() +void CSVDoc::View::openNewFiles() { - //FIXME close old files std::vector paths; mOpenDialog->getFileList(paths); //FIXME load new files diff --git a/apps/opencs/view/doc/view.hpp b/apps/opencs/view/doc/view.hpp index 182252203..839edf0a5 100644 --- a/apps/opencs/view/doc/view.hpp +++ b/apps/opencs/view/doc/view.hpp @@ -37,7 +37,7 @@ namespace CSVDoc QAction *mUndo; QAction *mRedo; QAction *mSave; - QAction *mLoad; + QAction *mOpen; QAction *mVerify; std::vector mEditingActions; Operations *mOperations; @@ -95,8 +95,8 @@ namespace CSVDoc void newView(); - void load(); - void loadNewFiles(); + void open(); + void openNewFiles(); void save(); void verify(); diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 3798f66b7..63a227621 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -66,15 +66,17 @@ add_component_dir (translation translation ) -add_component_qt_dir (file_order_list - datafileslist model/modelitem model/datafilesmodel model/esm/esmfile - utils/filedialog utils/lineedit utils/profilescombobox utils/textinputdialog utils/naturalsort - ) +find_package(Qt4 COMPONENTS QtCore QtGui) -find_package(Qt4 COMPONENTS QtCore QtGUI REQUIRED) -include(${QT_USE_FILE}) +if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY) + add_component_qt_dir (fileorderlist + datafileslist model/modelitem model/datafilesmodel model/esm/esmfile + utils/filedialog utils/lineedit utils/profilescombobox utils/textinputdialog utils/naturalsort + ) -QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) + include(${QT_USE_FILE}) + QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) +endif(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY) include_directories(${BULLET_INCLUDE_DIRS}) diff --git a/components/file_order_list/datafileslist.cpp b/components/fileorderlist/datafileslist.cpp similarity index 100% rename from components/file_order_list/datafileslist.cpp rename to components/fileorderlist/datafileslist.cpp diff --git a/components/file_order_list/datafileslist.hpp b/components/fileorderlist/datafileslist.hpp similarity index 100% rename from components/file_order_list/datafileslist.hpp rename to components/fileorderlist/datafileslist.hpp diff --git a/components/file_order_list/model/datafilesmodel.cpp b/components/fileorderlist/model/datafilesmodel.cpp similarity index 100% rename from components/file_order_list/model/datafilesmodel.cpp rename to components/fileorderlist/model/datafilesmodel.cpp diff --git a/components/file_order_list/model/datafilesmodel.hpp b/components/fileorderlist/model/datafilesmodel.hpp similarity index 100% rename from components/file_order_list/model/datafilesmodel.hpp rename to components/fileorderlist/model/datafilesmodel.hpp diff --git a/components/file_order_list/model/esm/esmfile.cpp b/components/fileorderlist/model/esm/esmfile.cpp similarity index 100% rename from components/file_order_list/model/esm/esmfile.cpp rename to components/fileorderlist/model/esm/esmfile.cpp diff --git a/components/file_order_list/model/esm/esmfile.hpp b/components/fileorderlist/model/esm/esmfile.hpp similarity index 100% rename from components/file_order_list/model/esm/esmfile.hpp rename to components/fileorderlist/model/esm/esmfile.hpp diff --git a/components/file_order_list/model/modelitem.cpp b/components/fileorderlist/model/modelitem.cpp similarity index 100% rename from components/file_order_list/model/modelitem.cpp rename to components/fileorderlist/model/modelitem.cpp diff --git a/components/file_order_list/model/modelitem.hpp b/components/fileorderlist/model/modelitem.hpp similarity index 100% rename from components/file_order_list/model/modelitem.hpp rename to components/fileorderlist/model/modelitem.hpp diff --git a/components/file_order_list/utils/filedialog.cpp b/components/fileorderlist/utils/filedialog.cpp similarity index 100% rename from components/file_order_list/utils/filedialog.cpp rename to components/fileorderlist/utils/filedialog.cpp diff --git a/components/file_order_list/utils/filedialog.hpp b/components/fileorderlist/utils/filedialog.hpp similarity index 100% rename from components/file_order_list/utils/filedialog.hpp rename to components/fileorderlist/utils/filedialog.hpp diff --git a/components/file_order_list/utils/lineedit.cpp b/components/fileorderlist/utils/lineedit.cpp similarity index 100% rename from components/file_order_list/utils/lineedit.cpp rename to components/fileorderlist/utils/lineedit.cpp diff --git a/components/file_order_list/utils/lineedit.hpp b/components/fileorderlist/utils/lineedit.hpp similarity index 100% rename from components/file_order_list/utils/lineedit.hpp rename to components/fileorderlist/utils/lineedit.hpp diff --git a/components/file_order_list/utils/naturalsort.cpp b/components/fileorderlist/utils/naturalsort.cpp similarity index 100% rename from components/file_order_list/utils/naturalsort.cpp rename to components/fileorderlist/utils/naturalsort.cpp diff --git a/components/file_order_list/utils/naturalsort.hpp b/components/fileorderlist/utils/naturalsort.hpp similarity index 100% rename from components/file_order_list/utils/naturalsort.hpp rename to components/fileorderlist/utils/naturalsort.hpp diff --git a/components/file_order_list/utils/profilescombobox.cpp b/components/fileorderlist/utils/profilescombobox.cpp similarity index 100% rename from components/file_order_list/utils/profilescombobox.cpp rename to components/fileorderlist/utils/profilescombobox.cpp diff --git a/components/file_order_list/utils/profilescombobox.hpp b/components/fileorderlist/utils/profilescombobox.hpp similarity index 100% rename from components/file_order_list/utils/profilescombobox.hpp rename to components/fileorderlist/utils/profilescombobox.hpp diff --git a/components/file_order_list/utils/textinputdialog.cpp b/components/fileorderlist/utils/textinputdialog.cpp similarity index 100% rename from components/file_order_list/utils/textinputdialog.cpp rename to components/fileorderlist/utils/textinputdialog.cpp diff --git a/components/file_order_list/utils/textinputdialog.hpp b/components/fileorderlist/utils/textinputdialog.hpp similarity index 100% rename from components/file_order_list/utils/textinputdialog.hpp rename to components/fileorderlist/utils/textinputdialog.hpp