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 conteneurs
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é GitLab
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
ec3d8e4f
Valider
ec3d8e4f
rédigé
Il y a 11 ans
par
Thomas Goyne
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Unbind the progress dialog's idle handler when it's unneeded
parent
2ea9c4c2
Aucune branche associée trouvée
Étiquettes
Étiquettes contenant la validation
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
src/dialog_progress.cpp
+8
-6
8 ajouts, 6 suppressions
src/dialog_progress.cpp
avec
8 ajouts
et
6 suppressions
src/dialog_progress.cpp
+
8
−
6
Voir le fichier @
ec3d8e4f
...
@@ -142,7 +142,6 @@ DialogProgress::DialogProgress(wxWindow *parent, wxString const& title_text, wxS
...
@@ -142,7 +142,6 @@ DialogProgress::DialogProgress(wxWindow *parent, wxString const& title_text, wxS
Bind
(
wxEVT_SHOW
,
&
DialogProgress
::
OnShow
,
this
);
Bind
(
wxEVT_SHOW
,
&
DialogProgress
::
OnShow
,
this
);
Bind
(
wxEVT_TIMER
,
[
=
](
wxTimerEvent
&
)
{
gauge
->
Pulse
();
});
Bind
(
wxEVT_TIMER
,
[
=
](
wxTimerEvent
&
)
{
gauge
->
Pulse
();
});
Bind
(
wxEVT_IDLE
,
&
DialogProgress
::
OnIdle
,
this
);
}
}
void
DialogProgress
::
Run
(
std
::
function
<
void
(
agi
::
ProgressSink
*
)
>
task
,
int
priority
)
{
void
DialogProgress
::
Run
(
std
::
function
<
void
(
agi
::
ProgressSink
*
)
>
task
,
int
priority
)
{
...
@@ -161,6 +160,7 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
...
@@ -161,6 +160,7 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
Main
().
Async
([
this
]{
Main
().
Async
([
this
]{
pulse_timer
.
Stop
();
pulse_timer
.
Stop
();
Unbind
(
wxEVT_IDLE
,
&
DialogProgress
::
OnIdle
,
this
);
// Unbind the cancel handler so that the default behavior happens (i.e. the
// Unbind the cancel handler so that the default behavior happens (i.e. the
// dialog is closed) as there's no longer a task to cancel
// dialog is closed) as there's no longer a task to cancel
...
@@ -170,14 +170,13 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
...
@@ -170,14 +170,13 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
// so the user can read the debug output and switch the cancel button to a
// so the user can read the debug output and switch the cancel button to a
// close button
// close button
bool
cancelled
=
this
->
ps
->
IsCancelled
();
bool
cancelled
=
this
->
ps
->
IsCancelled
();
if
(
cancelled
||
(
log_output
->
IsEmpty
()
&&
!
pending_log
))
{
if
(
cancelled
||
(
log_output
->
IsEmpty
()
&&
!
pending_log
))
set_taskbar_progress
(
0
);
EndModal
(
!
cancelled
);
EndModal
(
!
cancelled
);
}
else
{
else
{
cancel_button
->
SetLabelText
(
_
(
"Close"
));
cancel_button
->
SetLabelText
(
_
(
"Close"
));
SetProgress
(
300
);
gauge
->
SetValue
(
300
);
}
}
set_taskbar_progress
(
0
);
});
});
});
});
...
@@ -185,10 +184,13 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
...
@@ -185,10 +184,13 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
throw
agi
::
UserCancelException
(
"Cancelled by user"
);
throw
agi
::
UserCancelException
(
"Cancelled by user"
);
}
}
void
DialogProgress
::
OnShow
(
wxShowEvent
&
)
{
void
DialogProgress
::
OnShow
(
wxShowEvent
&
evt
)
{
if
(
!
evt
.
IsShown
())
return
;
// Restore the cancel button in case it was previously switched to a close
// Restore the cancel button in case it was previously switched to a close
// button
// button
Bind
(
wxEVT_BUTTON
,
&
DialogProgress
::
OnCancel
,
this
,
wxID_CANCEL
);
Bind
(
wxEVT_BUTTON
,
&
DialogProgress
::
OnCancel
,
this
,
wxID_CANCEL
);
Bind
(
wxEVT_IDLE
,
&
DialogProgress
::
OnIdle
,
this
);
cancel_button
->
SetLabelText
(
_
(
"Cancel"
));
cancel_button
->
SetLabelText
(
_
(
"Cancel"
));
cancel_button
->
Enable
();
cancel_button
->
Enable
();
...
...
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