Skip to content

Commit

Permalink
Merge branch 'release-0.4.2'
Browse files Browse the repository at this point in the history
o feature41, feature42 : new splashscreen, new application's icon.
o feature43, feature44, feature45 : the UI has been cleaned up : no more
  useless icons.
o feature46 : Each Dipydoc folder now contains a 'menuname' file : in this
  file, a unique line gives the name of the Dipydoc that appear in the
  submenu 'File>Open'. The UI serches in the default folder all the available
  Dipydoc and add them to this submenu.
o + feature47, feature48, feature49
  • Loading branch information
suizokukan committed Sep 16, 2014
2 parents b2fe35d + 719800e commit 8bbaa1a
Show file tree
Hide file tree
Showing 26 changed files with 592 additions and 542 deletions.
Binary file added art/application_icon.xcf
Binary file not shown.
Binary file removed art/dipylon_application_icon.png
Binary file not shown.
Binary file removed art/dipylon_application_icon.xcf
Binary file not shown.
Binary file removed art/splashscreen.png
Binary file not shown.
Binary file modified art/splashscreen.xcf
Binary file not shown.
Binary file added art/splashscreen_500x500.xcf
Binary file not shown.
6 changes: 4 additions & 2 deletions cppdipylon/2win32_static/dipylonreader.pro
Expand Up @@ -22,6 +22,7 @@ DEFINES += ALLOW_MAXIMIZE_MAINWINDOW
DEFINES += MAXIMIZE_MAINWINDOW_TRUE_METHOD
DEFINES += STORE_DEBUG_MESSAGES
DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += DISPLAY_INTERNAL_MESSAGES_IN_HELP_MENUITEM

#_______________________________________________________________________________
#
Expand All @@ -43,6 +44,7 @@ HEADERS += ./fixedparameters.h \
debugmsg/debugmsg.h \
dipydoc/dipydoc.h \
dipydoc/dipydocnotes.h \
dipydoc/menunames.h \
languages/languages.h \
languages/languagefromto.h \
pos/posintext2posinaudio.h \
Expand All @@ -56,7 +58,7 @@ HEADERS += ./fixedparameters.h \
qt/arrowformat.h \
qt/blockformat.h \
qt/commentaryeditor.h \
qt/dipylonui.h \
qt/ui.h \
qt/mainwindow.h \
qt/posintextframeformat.h \
qt/sourceeditor.h \
Expand All @@ -76,7 +78,7 @@ SOURCES += ./main.cpp \
qt/arrowformat.cpp \
qt/blockformat.cpp \
qt/commentaryeditor.cpp \
qt/dipylonui.cpp \
qt/ui.cpp \
qt/mainwindow.cpp \
qt/posintextframeformat.cpp \
qt/sourceeditor.cpp \
Expand Down
Binary file not shown.
171 changes: 99 additions & 72 deletions cppdipylon/dipydoc/dipydoc.cpp

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions cppdipylon/dipydoc/dipydoc.h
Expand Up @@ -43,6 +43,7 @@
#include <cstring>

#include "./fixedparameters.h"
#include "dipydoc/menunames.h"
#include "dipydoc/dipydocnotes.h"
#include "pos/posintext/posintext2str.h"
#include "pos/posintext2posinaudio.h"
Expand Down Expand Up @@ -257,7 +258,7 @@ typedef std::pair<PosInTextRanges, PairOfPosInAudio> PTRangesAND2PosAudio;


class DipyDoc {
friend class DipylonUI;
friend class UI;
friend class MainWindow;
friend class SourceEditor;
friend class CommentaryEditor;
Expand All @@ -271,6 +272,8 @@ friend class CommentaryEditor;
QString main_filename_with_fullpath;

// general informations :
QString menu_name;

QString id;
int version;
int dipydocformat_version;
Expand Down Expand Up @@ -315,9 +318,10 @@ friend class CommentaryEditor;
template<class T> bool error(const T& object, const QString& _error_string, const QString& where);
QString error_string(const QXmlStreamReader& xmlreader);
QString get_condensed_extracts_from_the_source_text(PosInTextRanges, int) const;
bool init_from_xml__read_the_rest_of_the_file(QXmlStreamReader& xmlreader);
bool init_from_xml__read_first_token(QXmlStreamReader& xmlreader);
bool read_mainfile__read_the_rest_of_the_file(QXmlStreamReader& xmlreader);
bool read_mainfile__read_first_token(QXmlStreamReader& xmlreader);
QString levels_repr(void) const;
void read_menu_name(const QString& _path);

// public methods .............................................................
public:
Expand All @@ -329,7 +333,7 @@ friend class CommentaryEditor;
PosInTextRanges translation_contains(PosInText x0, PosInText x1) const;
QString diagnosis(void) const;
QString get_xml_repr(void) const;
void init_from_xml(const QString&);
void read_mainfile(const QString&);
int internal_state(void) const;
bool well_initialized(void) const;

Expand Down Expand Up @@ -360,9 +364,6 @@ friend class CommentaryEditor;
THE_GIVENPATH_DOES_NOT_EXIST = -4,
THE_GIVENPATH_IS_NOT_A_DIRECTORY = -5,
};

// name of the main file in a dipydoc directory :
constexpr static const char* MAIN_FILENAME = "main.xml";
};

inline DipyDoc::DipyDoc(void) {
Expand Down
137 changes: 137 additions & 0 deletions cppdipylon/dipydoc/menunames.h
@@ -0,0 +1,137 @@
/*******************************************************************************
DipylonReader Copyright (C) 2008 Xavier Faure
Contact: faure dot epistulam dot mihi dot scripsisti at orange dot fr
This file is part of DipylonReader.
DipylonReader is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DipylonReader is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DipylonReader. If not, see <http://www.gnu.org/licenses/>.
____________________________________________________________________________
❏DipylonReader❏ : dipydoc/menunames.h
MenuNames class
*******************************************************************************/

#ifndef CPPDIPYLON_DIPYDOC_MENUNAMES_H_
#define CPPDIPYLON_DIPYDOC_MENUNAMES_H_

#include "debugmsg/debugmsg.h"

/*______________________________________________________________________________
MenuNames class
Store in MenuNames the 'menu name' and the directory's name. The constructor
with a QString parameter searches in the default path to find every 'menu name'
file.
______________________________________________________________________________*/
typedef std::map<QString, QString> MAP_STR2STR;
typedef std::map<QString, QString>::const_iterator MAP_STR2STR_CI;

struct MenuNames {
// menu name -> directory's name (full path).
MAP_STR2STR menuname_to_directory;

MenuNames(void);
MenuNames(const QString& path);
MAP_STR2STR_CI begin(void) const;
MAP_STR2STR_CI end(void) const;
static QString read_menu_name_from_a_file_within_a_directory(const QString& path);
QString repr(void) const;
std::size_t size(void) const;
};

/*______________________________________________________________________________
MenuNames constructors.
______________________________________________________________________________*/
// default constructor
inline MenuNames::MenuNames(void) {
this->menuname_to_directory.clear();
}

// let's search in 'path' to find every 'menu name' :
inline MenuNames::MenuNames(const QString& path) {
this->menuname_to_directory.clear();

QDir dipydocs_path(path);
dipydocs_path.setFilter( QDir::AllDirs );

for( auto &directory_name: dipydocs_path.entryList()) {
if ( (directory_name != ".") && (directory_name != "..") ) {
QString menuname(this->read_menu_name_from_a_file_within_a_directory(path + "/" + directory_name));
if (menuname.size() != 0) {
this->menuname_to_directory[menuname] = path + "/" + directory_name;
}
}
}
}

/*______________________________________________________________________________
MenuNames::begin(), MenuNames::end()
________________________________________________________________________________*/
inline MAP_STR2STR_CI MenuNames::begin(void) const {
return this->menuname_to_directory.begin();
}
inline MAP_STR2STR_CI MenuNames::end(void) const {
return this->menuname_to_directory.end();
}

/*______________________________________________________________________________
MenuNames::read_menu_name_from_a_file_within_a_directory
Return an empty QString if path doesn't contain the expected file or if this
file is empty.
static method
________________________________________________________________________________*/
inline QString MenuNames::read_menu_name_from_a_file_within_a_directory(const QString& path) {
QString res;
QFile menuname_file(path + "/" + fixedparameters::DIPYDOC__MENUNAME_FILENAME);

if (menuname_file.open(QFile::ReadOnly)) {
res = menuname_file.readLine();
res = res.trimmed();
}

return res;
}

/*______________________________________________________________________________
MenuNames::repr()
________________________________________________________________________________*/
inline QString MenuNames::repr(void) const {
QStringList resl;

for(auto &item : this->menuname_to_directory) {
resl.append( QString("'%1' -> '%2'").arg(item.first, item.second) );
}

return resl.join("\n");
}

/*______________________________________________________________________________
MenuNames::size
________________________________________________________________________________*/
inline std::size_t MenuNames::size(void) const {
return this->menuname_to_directory.size();
}

#endif // CPPDIPYLON_DIPYDOC_MENUNAMES_H_
6 changes: 4 additions & 2 deletions cppdipylon/dipylonreader.pro
Expand Up @@ -23,6 +23,7 @@ DEFINES += MAXIMIZE_MAINWINDOW_LINUXDESKTOPX11_METHOD
DEFINES += DEBUG_MESSAGES_TO_CERR
DEFINES += STORE_DEBUG_MESSAGES
DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += DISPLAY_INTERNAL_MESSAGES_IN_HELP_MENUITEM

QT += widgets
QT += multimedia
Expand All @@ -32,6 +33,7 @@ HEADERS += ./fixedparameters.h \
debugmsg/debugmsg.h \
dipydoc/dipydoc.h \
dipydoc/dipydocnotes.h \
dipydoc/menunames.h \
languages/languages.h \
languages/languagefromto.h \
pos/posintext2posinaudio.h \
Expand All @@ -45,7 +47,7 @@ HEADERS += ./fixedparameters.h \
qt/arrowformat.h \
qt/blockformat.h \
qt/commentaryeditor.h \
qt/dipylonui.h \
qt/ui.h \
qt/mainwindow.h \
qt/posintextframeformat.h \
qt/sourceeditor.h \
Expand All @@ -65,7 +67,7 @@ SOURCES += ./main.cpp \
qt/arrowformat.cpp \
qt/blockformat.cpp \
qt/commentaryeditor.cpp \
qt/dipylonui.cpp \
qt/ui.cpp \
qt/mainwindow.cpp \
qt/posintextframeformat.cpp \
qt/sourceeditor.cpp \
Expand Down
1 change: 0 additions & 1 deletion cppdipylon/dipylonreader.qrc
Expand Up @@ -9,7 +9,6 @@

<file>ressources/images/icons/copy.png</file>
<file>ressources/images/icons/cut.png</file>
<file>ressources/images/icons/new.png</file>
<file>ressources/images/icons/open.png</file>
<file>ressources/images/icons/paste.png</file>
<file>ressources/images/icons/save.png</file>
Expand Down
10 changes: 9 additions & 1 deletion cppdipylon/fixedparameters.h
Expand Up @@ -42,7 +42,7 @@ namespace fixedparameters {
static const QString organization_name = "suizokukanfactory";
static const QString organization_domain = "94.23.197.37";
static const QString application_name = "dipylonreader";
static const QString application_version = "0.4.1";
static const QString application_version = "0.4.2";
static const QString application_style = "CleanLooks";

/*
Expand Down Expand Up @@ -82,5 +82,13 @@ const QStringList known_doctypes = { QString("text"), };
*/
static const int splashscreen_maximal_duration = 9000;
static const bool default__display_splashscreen = true;

// name of the main file in a dipydoc directory :
constexpr static const char* DIPYDOC__MAIN_FILENAME = "main.xml";
// name of the 'menu name' file in a dipydoc directory :
constexpr static const char* DIPYDOC__MENUNAME_FILENAME = "menuname";

// constant used to limit the number of items displayed in submenu 'open' :
static const int maximum_number_of_items_in_submenu_open = 10;
}
#endif
4 changes: 2 additions & 2 deletions cppdipylon/main.cpp
Expand Up @@ -25,7 +25,7 @@

#include <QApplication>

#include "qt/dipylonui.h"
#include "qt/ui.h"
#include "debugmsg/debugmsg.h"

/*______________________________________________________________________________
Expand All @@ -40,7 +40,7 @@ int main(int argc, char **argv) {

Q_INIT_RESOURCE(dipylonreader);

DipylonUI myapp = DipylonUI();
UI myapp = UI();
int resvalue = myapp.go(argc, argv);

return resvalue;
Expand Down

0 comments on commit 8bbaa1a

Please sign in to comment.