2011-08-19 18:59:21 +00:00
|
|
|
#pragma once
|
|
|
|
|
2011-08-24 09:17:57 +00:00
|
|
|
#include "UpdateMessage.h"
|
2011-08-23 11:29:47 +00:00
|
|
|
#include "UpdateObserver.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
class UpdateDialogGtk : public UpdateObserver
|
2011-08-19 18:59:21 +00:00
|
|
|
{
|
2011-08-23 11:29:47 +00:00
|
|
|
public:
|
|
|
|
UpdateDialogGtk();
|
|
|
|
|
|
|
|
bool restartApp() const;
|
|
|
|
|
|
|
|
void init(int argc, char** argv);
|
|
|
|
void exec();
|
|
|
|
|
|
|
|
// observer callbacks - these may be called
|
|
|
|
// from a background thread
|
|
|
|
virtual void updateError(const std::string& errorMessage);
|
|
|
|
virtual bool updateRetryCancel(const std::string& message);
|
|
|
|
virtual void updateProgress(int percentage);
|
|
|
|
virtual void updateFinished();
|
|
|
|
|
|
|
|
private:
|
2011-08-23 11:51:35 +00:00
|
|
|
static void finish(GtkWidget* widget, gpointer dialog);
|
2011-08-23 11:29:47 +00:00
|
|
|
static gboolean notify(void* message);
|
|
|
|
|
|
|
|
GtkWidget* m_window;
|
|
|
|
GtkWidget* m_progressLabel;
|
|
|
|
GtkWidget* m_finishButton;
|
|
|
|
GtkWidget* m_progressBar;
|
|
|
|
bool m_restartApp;
|
2011-08-24 11:15:02 +00:00
|
|
|
bool m_hadError;
|
2011-08-19 18:59:21 +00:00
|
|
|
};
|
|
|
|
|