mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +01:00
Les menus listant les fichiers recemment ouverts affichent desormais des icones.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@785 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -163,11 +163,14 @@
|
|||||||
<file>ico/oxygen-icons/128x128/apps/qelectrotech.png</file>
|
<file>ico/oxygen-icons/128x128/apps/qelectrotech.png</file>
|
||||||
<file>ico/oxygen-icons/16x16/apps/qelectrotech.png</file>
|
<file>ico/oxygen-icons/16x16/apps/qelectrotech.png</file>
|
||||||
<file>ico/oxygen-icons/16x16/mimetypes/application-x-qet-element.png</file>
|
<file>ico/oxygen-icons/16x16/mimetypes/application-x-qet-element.png</file>
|
||||||
|
<file>ico/oxygen-icons/16x16/mimetypes/application-x-qet-project.png</file>
|
||||||
<file>ico/oxygen-icons/22x22/apps/qelectrotech.png</file>
|
<file>ico/oxygen-icons/22x22/apps/qelectrotech.png</file>
|
||||||
<file>ico/oxygen-icons/22x22/mimetypes/application-x-qet-element.png</file>
|
<file>ico/oxygen-icons/22x22/mimetypes/application-x-qet-element.png</file>
|
||||||
|
<file>ico/oxygen-icons/22x22/mimetypes/application-x-qet-project.png</file>
|
||||||
<file>ico/oxygen-icons/256x256/apps/qelectrotech.png</file>
|
<file>ico/oxygen-icons/256x256/apps/qelectrotech.png</file>
|
||||||
<file>ico/oxygen-icons/32x32/apps/qelectrotech.png</file>
|
<file>ico/oxygen-icons/32x32/apps/qelectrotech.png</file>
|
||||||
<file>ico/oxygen-icons/32x32/mimetypes/application-x-qet-element.png</file>
|
<file>ico/oxygen-icons/32x32/mimetypes/application-x-qet-element.png</file>
|
||||||
|
<file>ico/oxygen-icons/32x32/mimetypes/application-x-qet-project.png</file>
|
||||||
<file>ico/oxygen-icons/48x48/apps/qelectrotech.png</file>
|
<file>ico/oxygen-icons/48x48/apps/qelectrotech.png</file>
|
||||||
<file>ico/oxygen-icons/64x64/apps/qelectrotech.png</file>
|
<file>ico/oxygen-icons/64x64/apps/qelectrotech.png</file>
|
||||||
<file>ico/splash.png</file>
|
<file>ico/splash.png</file>
|
||||||
|
|||||||
@@ -924,7 +924,9 @@ void QETApp::initConfiguration() {
|
|||||||
// fichiers recents
|
// fichiers recents
|
||||||
// note : les icones doivent etre initialisees avant ces instructions (qui creent des menus en interne)
|
// note : les icones doivent etre initialisees avant ces instructions (qui creent des menus en interne)
|
||||||
projects_recent_files_ = new RecentFiles("projects");
|
projects_recent_files_ = new RecentFiles("projects");
|
||||||
|
projects_recent_files_ -> setIconForFiles(QET::Icons::ProjectFile);
|
||||||
elements_recent_files_ = new RecentFiles("elements");
|
elements_recent_files_ = new RecentFiles("elements");
|
||||||
|
elements_recent_files_ -> setIconForFiles(QET::Icons::Element);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ namespace QET {
|
|||||||
QIcon PrintPortrait;
|
QIcon PrintPortrait;
|
||||||
QIcon PrintTwoPages;
|
QIcon PrintTwoPages;
|
||||||
QIcon Project;
|
QIcon Project;
|
||||||
|
QIcon ProjectFile;
|
||||||
QIcon QETIcon;
|
QIcon QETIcon;
|
||||||
QIcon QETLogo;
|
QIcon QETLogo;
|
||||||
QIcon QETOxygenLogo;
|
QIcon QETOxygenLogo;
|
||||||
@@ -272,6 +273,9 @@ void QET::Icons::initIcons() {
|
|||||||
PrintPortrait .addFile(":/ico/22x22/portrait.png");
|
PrintPortrait .addFile(":/ico/22x22/portrait.png");
|
||||||
PrintTwoPages .addFile(":/ico/22x22/two_pages.png");
|
PrintTwoPages .addFile(":/ico/22x22/two_pages.png");
|
||||||
Project .addFile(":/ico/16x16/project.png");
|
Project .addFile(":/ico/16x16/project.png");
|
||||||
|
ProjectFile .addFile(":/ico/oxygen-icons/16x16/mimetypes/application-x-qet-project.png");
|
||||||
|
ProjectFile .addFile(":/ico/oxygen-icons/22x22/mimetypes/application-x-qet-project.png");
|
||||||
|
ProjectFile .addFile(":/ico/oxygen-icons/32x32/mimetypes/application-x-qet-project.png");
|
||||||
QETIcon .addFile(":/ico/256x256/qelectrotech.png");
|
QETIcon .addFile(":/ico/256x256/qelectrotech.png");
|
||||||
QETLogo .addFile(":/ico/16x16/qet.png");
|
QETLogo .addFile(":/ico/16x16/qet.png");
|
||||||
QETLogo .addFile(":/ico/256x256/qet.png");
|
QETLogo .addFile(":/ico/256x256/qet.png");
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ namespace QET {
|
|||||||
extern QIcon PrintPortrait;
|
extern QIcon PrintPortrait;
|
||||||
extern QIcon PrintTwoPages;
|
extern QIcon PrintTwoPages;
|
||||||
extern QIcon Project;
|
extern QIcon Project;
|
||||||
|
extern QIcon ProjectFile;
|
||||||
extern QIcon QETIcon;
|
extern QIcon QETIcon;
|
||||||
extern QIcon QETLogo;
|
extern QIcon QETLogo;
|
||||||
extern QIcon QETOxygenLogo;
|
extern QIcon QETOxygenLogo;
|
||||||
|
|||||||
@@ -61,6 +61,24 @@ QMenu *RecentFiles::menu() const {
|
|||||||
return(menu_);
|
return(menu_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@return l'icone affichee a cote de chaque fichier, ou une QIcon nulle si
|
||||||
|
aucune icone n'est utilisee.
|
||||||
|
*/
|
||||||
|
QIcon RecentFiles::iconForFiles() const {
|
||||||
|
return(files_icon_);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Definit l'icone a afficher a cote de chaque fichier. Si une QIcon nulle
|
||||||
|
est fournie, aucune icone n'est utilisee.
|
||||||
|
@param icon Icone a afficher a cote de chaque fichier
|
||||||
|
*/
|
||||||
|
void RecentFiles::setIconForFiles(const QIcon &icon) {
|
||||||
|
files_icon_ = icon;
|
||||||
|
buildMenu();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Oublie les fichiers recents
|
Oublie les fichiers recents
|
||||||
*/
|
*/
|
||||||
@@ -151,6 +169,9 @@ void RecentFiles::buildMenu() {
|
|||||||
foreach (QString filepath, list_) {
|
foreach (QString filepath, list_) {
|
||||||
// creee une nouvelle action pour le fichier
|
// creee une nouvelle action pour le fichier
|
||||||
QAction *action = new QAction(filepath, 0);
|
QAction *action = new QAction(filepath, 0);
|
||||||
|
if (!files_icon_.isNull()) {
|
||||||
|
action -> setIcon(files_icon_);
|
||||||
|
}
|
||||||
menu_ -> addAction(action);
|
menu_ -> addAction(action);
|
||||||
|
|
||||||
// lie l'action et le mapper
|
// lie l'action et le mapper
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#ifndef RECENT_FILES_H
|
#ifndef RECENT_FILES_H
|
||||||
#define RECENT_FILES_H
|
#define RECENT_FILES_H
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
#include <QIcon>
|
||||||
class QMenu;
|
class QMenu;
|
||||||
/**
|
/**
|
||||||
Cette classe permet de gerer des fichiers recents.
|
Cette classe permet de gerer des fichiers recents.
|
||||||
@@ -36,6 +37,8 @@ class RecentFiles : public QObject {
|
|||||||
public:
|
public:
|
||||||
int size() const;
|
int size() const;
|
||||||
QMenu *menu() const;
|
QMenu *menu() const;
|
||||||
|
QIcon iconForFiles() const;
|
||||||
|
void setIconForFiles(const QIcon &);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
@@ -61,5 +64,6 @@ class RecentFiles : public QObject {
|
|||||||
QList<QString> list_;
|
QList<QString> list_;
|
||||||
QMenu *menu_;
|
QMenu *menu_;
|
||||||
QSignalMapper *mapper_;
|
QSignalMapper *mapper_;
|
||||||
|
QIcon files_icon_;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user