Esempio n. 1
0
void
TrayControlWindow::create_tray_actions() {
  m_act_launch = new QAction(QIcon(":/hub/Launch-07.png") ,tr("Launch"), this);

  m_act_settings = new QAction(QIcon(":/hub/Settings-07.png"), tr("Settings"), this);
  connect(m_act_settings, SIGNAL(triggered()), this, SLOT(show_settings_dialog()));

  m_act_vbox = new QAction(QIcon(":/hub/VM-07.png"), tr("Virtual machines"), this);
  connect(m_act_vbox, SIGNAL(triggered()), this, SLOT(show_vbox()));

  m_act_hub = new QAction(QIcon(":/hub/Environmetns-07.png"), tr("Environments"), this);

  m_act_quit = new QAction(QIcon(":/hub/Exit-07"), tr("Quit"), this);
  connect(m_act_quit, SIGNAL(triggered()), this, SLOT(application_quit()));

  m_act_info = new QAction(QIcon(":/hub/Balance-07.png"), CHubController::Instance().balance(), this);

  m_act_about = new QAction(QIcon(":/hub/about.png"), tr("About"), this);
  connect(m_act_about, SIGNAL(triggered()), this, SLOT(show_about()));

  m_act_generate_ssh = new QAction("Generate SSH key", this);
  connect(m_act_generate_ssh, SIGNAL(triggered()), this, SLOT(ssh_key_generate_triggered()));
}
Esempio n. 2
0
G_MODULE_EXPORT void cb_quit(GtkButton *button, Dialogs *data)
{
    application_quit();
}
Esempio n. 3
0
gint main (int argc, char **argv)
{
	int c;

	char *profile = NULL;

	init_signal_handlers(argv[0]);

	opterr = 0;
	while ((c = getopt (argc, argv, "c:p:u:")) != -1)
		switch (c) {
			case 'c':
				ctx = iio_create_network_context(optarg);
				if (!ctx) {
					printf("Failed connecting to remote device: %s\n", optarg);
					exit(-1);
				}
				break;
			case 'u':
				ctx = iio_create_context_from_uri(optarg);
				if (!ctx) {
					printf("Failed connecting to remote device: %s\n", optarg);
					exit(-1);
				}
				break;
			case 'p':
				profile = strdup(optarg);
				break;
			case '?':
				usage(argv[0]);
				break;
			default:
				printf("Unknown command line option\n");
				usage(argv[0]);
				break;
		}

#ifndef __MINGW32__
	/* XXX: Enabling threading when compiling for Windows will lock the UI
	 * as soon as the main window is moved. */
	gdk_threads_init();
#endif
	gtk_init(&argc, &argv);

	signal(SIGTERM, sigterm);
	signal(SIGINT, sigterm);
#ifndef __MINGW32__
	signal(SIGHUP, sigterm);
#endif

	gdk_threads_enter();
	init_application();
	c = load_default_profile(profile, true);
	if (!ctx_destroyed_by_do_quit) {
		if (!ctx)
			connect_dialog(false);

		create_default_plot();
		if (c == 0) {
			if (gtk_check_menu_item_get_active(
					GTK_CHECK_MENU_ITEM(versioncheck_en)))
				version_check_start(NULL);
			gtk_main();
		} else
			application_quit();
	}
	gdk_threads_leave();

	if (profile)
	    free(profile);

	if (c == 0 || c == -ENOTTY)
		return 0;
	else
		return -1;
}
Esempio n. 4
0
static void sigterm (int signum)
{
	application_quit();
}
Esempio n. 5
0
static void on_quit_event()
{
	application_quit();
	gtk_main_quit();
}