Example #1
0
void CardiacMeshReaderUI::connectSignals() {

  // Page 1
  connect(directoryEdit, SIGNAL(editingFinished()), this, SLOT(newDirectory()));
  connect(directoryChooser, SIGNAL(clicked()), this, SLOT(dirChooser()));
  connect(p1NextButton, SIGNAL(clicked()), this, SLOT(page1Next()));
  connect(p1FinishButton, SIGNAL(clicked()), this, SLOT(page1Finish()));

  // Page 2
  minSliceSlider->setMinimum(0);
  maxSliceSlider->setMinimum(0);

  connect(directoryEditMesh, SIGNAL(editingFinished()), this, SLOT(newDirectoryMesh()));
  connect(directoryChooserMesh, SIGNAL(clicked()), this, SLOT(dirChooserMesh()));
  connect(minSliceSlider, SIGNAL(valueChanged(int)), this, SLOT(minSliderChanged(int)));
  connect(maxSliceSlider, SIGNAL(valueChanged(int)), this, SLOT(maxSliderChanged(int)));
  connect(p2BackButton, SIGNAL(clicked()), this, SLOT(page2Back()));
  connect(p2NextButton, SIGNAL(clicked()), this, SLOT(page2Next()));
  connect(p2FinishButton, SIGNAL(clicked()), this, SLOT(page2Finish()));

  // Page 3
  connect(nameLineEdit, SIGNAL(editingFinished()), this, SLOT(namesChanged()));
  connect(meshNameLineEdit, SIGNAL(editingFinished()), this, SLOT(namesChanged()));
  connect(p3BackButton, SIGNAL(clicked()), this, SLOT(page3Back()));
  connect(p3FinishButton, SIGNAL(clicked()), this, SLOT(page3Finish()));
}
Example #2
0
inline void button_clicked_entry_browse_directory (GtkWidget* widget, GtkEntry* entry)
{
	gtkutil::FileChooser dirChooser(gtk_widget_get_toplevel(widget), _("Choose Directory"), true, true);
	std::string curEntry = gtk_entry_get_text(entry);

	if (g_path_is_absolute(curEntry.c_str()))
		curEntry.clear();
	dirChooser.setCurrentPath(curEntry);

	std::string filename = dirChooser.display();

	if (GTK_IS_WINDOW(gtk_widget_get_toplevel(widget))) {
		gtk_window_present(GTK_WINDOW(gtk_widget_get_toplevel(widget)));
	}

	if (!filename.empty()) {
		gtk_entry_set_text(entry, filename.c_str());
	}
}
Example #3
0
int CRecDirChooser::exec(CMenuTarget* parent, const std::string & actionKey)
/**********************************************************************/
{
	int result = menu_return::RETURN_EXIT;
	const char * key = actionKey.c_str();
	
	//printf(" CRecDirChooser::exec %s\n",key);
	if (strncmp(key, "MID:",4) == 0)
	{
		int id = -1;
		selectedDir = -1;
		sscanf(&key[4],"%d",&id);
		
		//printf("rec dir: %d\n",id);
		if( id > -1 && id < MAX_RECORDING_DIR)
		{
			dir = g_settings.recording_dir[id];
			selectedDir = id;
			if (index)
			{
				*index = nfsIndex[id];
			}
		}
		hide();
		result =  menu_return::RETURN_EXIT;
	} 
	else if (strcmp(key, "dirChooser") == 0)
	{
		selectedDir = -1;
		if(!g_settings.recording_dir[0].empty())
		{
			dir = g_settings.recording_dir[0];
		}
		else
		{
			dir = "/mnt/";
		}
		CDirChooser dirChooser(&dir);
		dirChooser.exec(NULL,"");
		if(dirChooser.new_path_selected == false)
		{
			dir = "";
		}
		if(dir.empty())
		{
			result = menu_return::RETURN_REPAINT;
		}
	}
	else
	{
		dir = "";
		result = CMenuWidget::exec(parent, actionKey);
		if(!dir.empty())
		{
			if (localDir) 
			{
				strcpy(localDir,dir.c_str());
			}
			if (localDirString)
			{ 
				*localDirString = dir;
			}
		}
	}
	return (result);
}