Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
26 changed files
with
592 additions
and
542 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
cppdipylon/2win32_static/ressources/images/icons/win_app_icon.ico
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.