2001-03-24 02:07:22 +00:00
|
|
|
/* progress_dlg.h
|
|
|
|
* Definitions for progress dialog box routines
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2001-03-24 02:07:22 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-03-24 02:07:22 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-03-24 02:07:22 +00:00
|
|
|
* This program 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 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-03-24 02:07:22 +00:00
|
|
|
* This program 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-03-24 02:07:22 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2001-03-24 02:07:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PROGRESS_DLG_H__
|
|
|
|
#define __PROGRESS_DLG_H__
|
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2004-06-04 20:04:34 +00:00
|
|
|
/** @file
|
|
|
|
* Progress (modal) dialog box routines.
|
|
|
|
* @ingroup dialog_group
|
2001-03-24 02:07:22 +00:00
|
|
|
*/
|
|
|
|
|
2004-06-04 20:04:34 +00:00
|
|
|
/** Progress dialog data. */
|
2001-03-24 02:07:22 +00:00
|
|
|
struct progdlg;
|
|
|
|
|
2004-06-04 20:04:34 +00:00
|
|
|
/** Progress dialog data. */
|
2001-03-24 02:07:22 +00:00
|
|
|
typedef struct progdlg progdlg_t;
|
|
|
|
|
2004-06-04 20:04:34 +00:00
|
|
|
/**
|
|
|
|
* Create and pop up the progress dialog. Allocates a "progdlg_t"
|
2001-03-24 02:07:22 +00:00
|
|
|
* and initialize it to contain all information the implementation
|
|
|
|
* needs in order to manipulate the dialog, and return a pointer to
|
|
|
|
* it.
|
|
|
|
*
|
2013-04-26 18:28:21 +00:00
|
|
|
* @param top_level_window UI widget to associate with the progress dialog, e.g.
|
2012-07-19 21:49:52 +00:00
|
|
|
* the main window.
|
|
|
|
* @param task_title The task to do, e.g. "Loading"
|
|
|
|
* @param item_title The item to do, e.g. "capture.cap"
|
2005-11-12 11:05:02 +00:00
|
|
|
* @param terminate_is_stop TRUE if the operation can't be cancelled, just
|
|
|
|
* stopped (i.e., it has a "Stop" button and clicking it doesn't undo
|
|
|
|
* anything already done), FALSE if it can
|
2012-07-19 21:49:52 +00:00
|
|
|
* @param stop_flag A pointer to a Boolean variable that will be
|
2004-06-04 20:04:34 +00:00
|
|
|
* set to TRUE if the user hits that button
|
2012-07-19 21:49:52 +00:00
|
|
|
* @return The newly created progress dialog
|
2001-03-24 02:07:22 +00:00
|
|
|
*/
|
2012-07-19 21:49:52 +00:00
|
|
|
progdlg_t *create_progress_dlg(const gpointer top_level_window, const gchar *task_title, const gchar *item_title,
|
2005-11-12 11:05:02 +00:00
|
|
|
gboolean terminate_is_stop, gboolean *stop_flag);
|
2001-03-24 02:07:22 +00:00
|
|
|
|
2004-06-04 20:04:34 +00:00
|
|
|
/**
|
|
|
|
* Create a progress dialog, but only if it's not likely to disappear
|
2011-12-29 00:08:47 +00:00
|
|
|
* immediately. This can be disconcerting for the user.
|
2002-07-30 10:13:16 +00:00
|
|
|
*
|
2013-04-26 18:28:21 +00:00
|
|
|
* @param top_level_window The top-level window associated with the progress update.
|
2012-07-19 21:49:52 +00:00
|
|
|
* May be NULL.
|
|
|
|
* @param task_title The task to do, e.g. "Loading"
|
|
|
|
* @param item_title The item to do, e.g. "capture.cap"
|
2005-11-12 11:05:02 +00:00
|
|
|
* @param terminate_is_stop TRUE if the operation can't be cancelled, just
|
|
|
|
* stopped (i.e., it has a "Stop" button and clicking it doesn't undo
|
|
|
|
* anything already done), FALSE if it can
|
2012-07-19 21:49:52 +00:00
|
|
|
* @param stop_flag A pointer to a Boolean variable that will be
|
2004-06-04 20:04:34 +00:00
|
|
|
* set to TRUE if the user hits that button
|
2012-07-19 21:49:52 +00:00
|
|
|
* @param start_time A pointer to a GTimeVal structure which holds
|
2004-06-04 20:04:34 +00:00
|
|
|
* the time at which the caller started to process the data
|
2012-07-19 21:49:52 +00:00
|
|
|
* @param progress The current progress (0..1)
|
|
|
|
* @return The newly created progress dialog
|
2002-07-30 10:13:16 +00:00
|
|
|
*/
|
2002-08-28 10:07:37 +00:00
|
|
|
progdlg_t *
|
2012-07-19 21:49:52 +00:00
|
|
|
delayed_create_progress_dlg(const gpointer top_level_window, const gchar *task_title, const gchar *item_title,
|
2005-11-12 11:05:02 +00:00
|
|
|
gboolean terminate_is_stop, gboolean *stop_flag,
|
|
|
|
const GTimeVal *start_time, gfloat progress);
|
2002-07-30 10:13:16 +00:00
|
|
|
|
2004-06-04 20:04:34 +00:00
|
|
|
/**
|
2002-08-28 10:07:37 +00:00
|
|
|
* Update the progress information of the progress dialog box.
|
2004-06-04 20:04:34 +00:00
|
|
|
*
|
2012-07-19 21:49:52 +00:00
|
|
|
* @param dlg The progress dialog from create_progress_dlg()
|
|
|
|
* @param percentage The current percentage value (0..1)
|
|
|
|
* @param status the New status string to show, e.g. "3000KB of 6000KB"
|
2001-03-24 02:07:22 +00:00
|
|
|
*/
|
2005-08-06 14:03:14 +00:00
|
|
|
void update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *status);
|
2001-03-24 02:07:22 +00:00
|
|
|
|
2004-06-04 20:04:34 +00:00
|
|
|
/**
|
2012-07-19 21:49:52 +00:00
|
|
|
* Destroy or hide the progress bar.
|
2004-06-04 20:04:34 +00:00
|
|
|
*
|
2012-07-19 21:49:52 +00:00
|
|
|
* @param dlg The progress dialog from create_progress_dlg()
|
2001-03-24 02:07:22 +00:00
|
|
|
*/
|
|
|
|
void destroy_progress_dlg(progdlg_t *dlg);
|
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2001-03-24 02:07:22 +00:00
|
|
|
#endif /* __PROGRESS_DLG_H__ */
|
2012-10-24 15:52:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|