diff options
Diffstat (limited to 'ui/qt/progress_frame.cpp')
-rw-r--r-- | ui/qt/progress_frame.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/ui/qt/progress_frame.cpp b/ui/qt/progress_frame.cpp index 2e40ac80..33306ebc 100644 --- a/ui/qt/progress_frame.cpp +++ b/ui/qt/progress_frame.cpp @@ -28,8 +28,8 @@ // - Don't complain so loudly when the user stops a capture. progdlg_t * -create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title, - gboolean terminate_is_stop, gboolean *stop_flag) { +create_progress_dlg(void *top_level_window, const char *task_title, const char *item_title, + bool terminate_is_stop, bool *stop_flag) { ProgressFrame *pf; QWidget *main_window; @@ -57,9 +57,9 @@ create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gc } progdlg_t * -delayed_create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title, - gboolean terminate_is_stop, gboolean *stop_flag, - gfloat progress) +delayed_create_progress_dlg(void *top_level_window, const char *task_title, const char *item_title, + bool terminate_is_stop, bool *stop_flag, + float progress) { progdlg_t *progress_dialog = create_progress_dlg(top_level_window, task_title, item_title, terminate_is_stop, stop_flag); update_progress_dlg(progress_dialog, progress, item_title); @@ -70,7 +70,7 @@ delayed_create_progress_dlg(gpointer top_level_window, const gchar *task_title, * Update the progress information of the progress bar box. */ void -update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *) +update_progress_dlg(progdlg_t *dlg, float percentage, const char *) { if (!dlg) return; @@ -145,8 +145,8 @@ ProgressFrame::ProgressFrame(QWidget *parent) : effect_ = new QGraphicsOpacityEffect(this); animation_ = new QPropertyAnimation(effect_, "opacity", this); - connect(this, SIGNAL(showRequested(bool,bool,gboolean*)), - this, SLOT(show(bool,bool,gboolean*))); + connect(this, SIGNAL(showRequested(bool,bool,bool*)), + this, SLOT(show(bool,bool,bool*))); hide(); } @@ -155,17 +155,13 @@ ProgressFrame::~ProgressFrame() delete ui; } -struct progdlg *ProgressFrame::showProgress(const QString &title, bool animate, bool terminate_is_stop, gboolean *stop_flag, int value) +struct progdlg *ProgressFrame::showProgress(const QString &title, bool animate, bool terminate_is_stop, bool *stop_flag, int value) { setMaximumValue(100); ui->progressBar->setValue(value); QString elided_title = title; int max_w = fontMetrics().height() * 20; // em-widths, arbitrary -#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) int title_w = fontMetrics().horizontalAdvance(title); -#else - int title_w = fontMetrics().width(title); -#endif if (title_w > max_w) { elided_title = fontMetrics().elidedText(title, Qt::ElideRight, max_w); } @@ -175,7 +171,7 @@ struct progdlg *ProgressFrame::showProgress(const QString &title, bool animate, return &progress_dialog_; } -progdlg *ProgressFrame::showBusy(bool animate, bool terminate_is_stop, gboolean *stop_flag) +progdlg *ProgressFrame::showBusy(bool animate, bool terminate_is_stop, bool *stop_flag) { setMaximumValue(0); emit showRequested(animate, terminate_is_stop, stop_flag); @@ -209,8 +205,8 @@ void ProgressFrame::addToButtonBox(QDialogButtonBox *button_box, QObject *main_w int one_em = progress_frame->fontMetrics().height(); progress_frame->setMaximumWidth(one_em * 8); - connect(main_progress_frame, SIGNAL(showRequested(bool,bool,gboolean*)), - progress_frame, SLOT(show(bool,bool,gboolean*))); + connect(main_progress_frame, SIGNAL(showRequested(bool,bool,bool*)), + progress_frame, SLOT(show(bool,bool,bool*))); connect(main_progress_frame, SIGNAL(maximumValueChanged(int)), progress_frame, SLOT(setMaximumValue(int))); connect(main_progress_frame, SIGNAL(valueChanged(int)), @@ -226,12 +222,12 @@ void ProgressFrame::captureFileClosing() { // Hide any paired ProgressFrames and disconnect from them. emit setHidden(); - disconnect(SIGNAL(showRequested(bool,bool,gboolean*))); + disconnect(SIGNAL(showRequested(bool,bool,bool*))); disconnect(SIGNAL(maximumValueChanged(int))); disconnect(SIGNAL(valueChanged(int))); - connect(this, SIGNAL(showRequested(bool,bool,gboolean*)), - this, SLOT(show(bool,bool,gboolean*))); + connect(this, SIGNAL(showRequested(bool,bool,bool*)), + this, SLOT(show(bool,bool,bool*))); } void ProgressFrame::setValue(int value) @@ -281,7 +277,7 @@ void ProgressFrame::on_stopButton_clicked() const int show_delay_ = 150; // ms -void ProgressFrame::show(bool animate, bool terminate_is_stop, gboolean *stop_flag) +void ProgressFrame::show(bool animate, bool terminate_is_stop, bool *stop_flag) { terminate_is_stop_ = terminate_is_stop; stop_flag_ = stop_flag; |