Ejemplo n.º 1
0
void WindowsOutpost::Start()
// This effectually starts the whole system.
{
  thread_run = true;
  // New g_thread_new ("windowsoutpost", GThreadFunc(thread_start), gpointer(this));
  g_thread_create (GThreadFunc(thread_start), gpointer(this), false, NULL);
}
Ejemplo n.º 2
0
int main(int argc, char **argv)
{
	UpdaterAppState* app_state = new UpdaterAppState;
	GThread *worker_thread;

	parse_args_and_init(argc, argv, app_state);

	// Initialize logger, and rename old log file
	gDirUtilp->initAppDirs("SecondLife");
	LLError::initForApplication
		(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
	std::string old_log_file = gDirUtilp->getExpandedFilename
		(LL_PATH_LOGS, "updater.log.old");
	std::string log_file =
		gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log");
	LLFile::rename(log_file, old_log_file);
	LLError::logToFile(log_file);

	// initialize gthreads and gtk+
	if (!g_thread_supported())
	{
		g_thread_init(NULL);
		gdk_threads_init();
	}

	gtk_init(&argc, &argv);

	// create UI
	updater_app_ui_init(app_state);

	//llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl;

	// create download thread
	worker_thread = g_thread_create
		(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL);

	gdk_threads_enter();
	gtk_main();
	gdk_threads_leave();

	// Delete the file only if created from url download.
	if(!app_state->url.empty() && !app_state->file.empty())
	{
		if (gDirUtilp->fileExists(app_state->file))
		{
			LLFile::remove(app_state->file);
		}
	}

	bool success = !app_state->failure;
	delete app_state->image_dir_iter;
	delete app_state;
	return success ? 0 : 1;
}
Ejemplo n.º 3
0
//
// Start process
//
void CNewFilesBox::OnShow(void)
{
	if (m_Thread)
		return;

	Clear();
	CMessagesDlg::InitBuffer();
	if (m_Checker.Init()) {
		m_State = STATE_WAIT;
		m_StopThread = m_SuspendRq = false;
		m_Thread = g_thread_create(GThreadFunc(thread_proc), this, TRUE, NULL);
		gtk_widget_set_sensitive(m_PauseBtn, TRUE);
	} else {
		gtk_label_set_text(GTK_LABEL(m_Line2), "The directory does not exist.");
		m_State = STATE_STOP;
	}
	PushMessage(EVENT_UPDATE, 0);
}
Ejemplo n.º 4
0
DisplayProjectNotes::DisplayProjectNotes(const ustring & reference, GtkWidget * webview_in, vector < unsigned int >*ids, unsigned int& edited_note_id)
{
  // Initialize and save variables.
  editor_reference = reference;
  webview = webview_in;
  mystop = false;
  ready = false;
  cursor_offset = 0;
  extra_note_id = edited_note_id;
  edited_note_id = 0;
  // Handle any notes given for display.
  if (ids) {
    ids_passed = true;
    ids_to_display.assign (ids->begin (), ids->end ());
  } else {
    ids_passed = false;
  }
  // Start main thread.  
  // New g_thread_new ("displayprojectnotes", GThreadFunc (thread_start), gpointer(this));
  g_thread_create(GThreadFunc(thread_start), gpointer(this), false, NULL);
  DEBUG("Started thread")
}