Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Aegisub
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Ce projet est archivé. Le dépôt et les autres ressources du projet sont en lecture seule.
Afficher davantage de fils d'Ariane
Kubat
Aegisub
Validations
924c6310
Valider
924c6310
rédigé
11 years ago
par
Thomas Goyne
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Add a better error message when a hotkey is set for an invalid command
parent
0b205e80
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
aegisub/src/command/command.h
+3
-5
3 ajouts, 5 suppressions
aegisub/src/command/command.h
aegisub/src/hotkey.cpp
+12
-4
12 ajouts, 4 suppressions
aegisub/src/hotkey.cpp
aegisub/src/toolbar.cpp
+1
-1
1 ajout, 1 suppression
aegisub/src/toolbar.cpp
avec
16 ajouts
et
10 suppressions
aegisub/src/command/command.h
+
3
−
5
Voir le fichier @
924c6310
...
@@ -28,11 +28,6 @@
...
@@ -28,11 +28,6 @@
namespace
agi
{
struct
Context
;
}
namespace
agi
{
struct
Context
;
}
DEFINE_BASE_EXCEPTION_NOINNER
(
CommandError
,
agi
::
Exception
)
DEFINE_SIMPLE_EXCEPTION_NOINNER
(
CommandNotFound
,
CommandError
,
"command/notfound"
)
DEFINE_SIMPLE_EXCEPTION_NOINNER
(
CommandIconNone
,
CommandError
,
"command/icon"
)
DEFINE_SIMPLE_EXCEPTION_NOINNER
(
CommandIconInvalid
,
CommandError
,
"command/icon/invalid"
)
#define CMD_NAME(a) const char* name() const { return a; }
#define CMD_NAME(a) const char* name() const { return a; }
#define STR_MENU(a) wxString StrMenu(const agi::Context *) const { return _(a); }
#define STR_MENU(a) wxString StrMenu(const agi::Context *) const { return _(a); }
#define STR_DISP(a) wxString StrDisplay(const agi::Context *) const { return _(a); }
#define STR_DISP(a) wxString StrDisplay(const agi::Context *) const { return _(a); }
...
@@ -50,6 +45,9 @@ struct cname : public Command { \
...
@@ -50,6 +45,9 @@ struct cname : public Command { \
/// Commands
/// Commands
namespace
cmd
{
namespace
cmd
{
DEFINE_BASE_EXCEPTION_NOINNER
(
CommandError
,
agi
::
Exception
)
DEFINE_SIMPLE_EXCEPTION_NOINNER
(
CommandNotFound
,
CommandError
,
"command/notfound"
)
enum
CommandFlags
{
enum
CommandFlags
{
/// Default command type
/// Default command type
COMMAND_NORMAL
=
0
,
COMMAND_NORMAL
=
0
,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
aegisub/src/hotkey.cpp
+
12
−
4
Voir le fichier @
924c6310
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include
"libresrc/libresrc.h"
#include
"libresrc/libresrc.h"
#include
"command/command.h"
#include
"command/command.h"
#include
"compat.h"
#include
"options.h"
#include
"options.h"
#include
<libaegisub/path.h>
#include
<libaegisub/path.h>
...
@@ -163,11 +164,18 @@ bool check(std::string const& context, agi::Context *c, int key_code, int modifi
...
@@ -163,11 +164,18 @@ bool check(std::string const& context, agi::Context *c, int key_code, int modifi
}
}
bool
check
(
std
::
string
const
&
context
,
agi
::
Context
*
c
,
wxKeyEvent
&
evt
)
{
bool
check
(
std
::
string
const
&
context
,
agi
::
Context
*
c
,
wxKeyEvent
&
evt
)
{
if
(
!
hotkey
::
check
(
context
,
c
,
evt
.
GetKeyCode
(),
evt
.
GetModifiers
()))
{
try
{
evt
.
Skip
();
if
(
!
hotkey
::
check
(
context
,
c
,
evt
.
GetKeyCode
(),
evt
.
GetModifiers
()))
{
return
false
;
evt
.
Skip
();
return
false
;
}
return
true
;
}
catch
(
cmd
::
CommandNotFound
const
&
e
)
{
wxMessageBox
(
to_wx
(
e
.
GetChainedMessage
()),
_
(
"Invalid command name for hotkey"
),
wxOK
|
wxICON_ERROR
|
wxCENTER
|
wxSTAY_ON_TOP
);
return
true
;
}
}
return
true
;
}
}
std
::
vector
<
std
::
string
>
get_hotkey_strs
(
std
::
string
const
&
context
,
std
::
string
const
&
command
)
{
std
::
vector
<
std
::
string
>
get_hotkey_strs
(
std
::
string
const
&
context
,
std
::
string
const
&
command
)
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
aegisub/src/toolbar.cpp
+
1
−
1
Voir le fichier @
924c6310
...
@@ -124,7 +124,7 @@ namespace {
...
@@ -124,7 +124,7 @@ namespace {
try
{
try
{
command
=
cmd
::
get
(
command_name
);
command
=
cmd
::
get
(
command_name
);
}
}
catch
(
CommandNotFound
const
&
)
{
catch
(
cmd
::
CommandNotFound
const
&
)
{
LOG_W
(
"toolbar/command/not_found"
)
<<
"Command '"
<<
command_name
<<
"' not found; skipping"
;
LOG_W
(
"toolbar/command/not_found"
)
<<
"Command '"
<<
command_name
<<
"' not found; skipping"
;
continue
;
continue
;
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter