Exemple #1
0
void DkControlWidget::showWidgetsSettings() {

	if (mViewport->getImage().isNull()) {
		showPreview(false);
		showScroller(false);
		showMetaData(false);
		showFileInfo(false);
		showPlayer(false);
		showOverview(false);
		showHistogram(false);
		showCommentWidget(false);
		return;
	}

	//qDebug() << "current app mode: " << DkSettingsManager::param().app().currentAppMode;

	showOverview(mZoomWidget->getCurrentDisplaySetting());
	showPreview(mFilePreview->getCurrentDisplaySetting());
	showMetaData(mMetaDataInfo->getCurrentDisplaySetting());
	showFileInfo(mFileInfoLabel->getCurrentDisplaySetting());
	showPlayer(mPlayer->getCurrentDisplaySetting());
	showHistogram(mHistogram->getCurrentDisplaySetting());
	showCommentWidget(mCommentWidget->getCurrentDisplaySetting());
	showScroller(mFolderScroll->getCurrentDisplaySetting());
}
/* 读取文件面板-下拉控件-读取速度 */
int CVICALLBACK readSpeedCallback (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2) {
	switch (event) {
		case EVENT_COMMIT:
			if(strlen(loadFilePath) <= 2)
				break;
			showFileInfo(panel);
			break;
	}
	return 0;
}
/* 读取文件面板-选择文件Btn */
int CVICALLBACK chooseFileBtnCallback (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2) {
	switch (event) {
		case EVENT_COMMIT:
            if (FileSelectPopup ("", "", "", "Select File to Load",
               		VAL_OK_BUTTON, 0, 0, 1, 1, loadFilePath) <= 0) return 0;
            SetCtrlVal(panel, ReadPanel_PathString, loadFilePath);
			showFileInfo(panel);
			break;
	}
	return 0;
}
Exemple #4
0
int PhotoViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: showList(); break;
        case 1: showFlow(); break;
        case 2: showFileInfo(); break;
        case 3: showImage(); break;
        }
        _id -= 4;
    }
    return _id;
}
Exemple #5
0
/************************************************************
* 功能		: 向QTableView中添加文件
* 输入		: 无
* 返回值	: void
*************************************************************/
void CreatModel::OnAppend()
{
	m_sAllList = QStringList();
	QString sInfoFile;
	QFileDialog* dialogFiles = new QFileDialog(this,"选择文件");
	dialogFiles->setFileMode(QFileDialog::ExistingFiles);
	dialogFiles->setFilter("All Files (*.*)");
	dialogFiles->setViewMode(QFileDialog::List);

	if (dialogFiles->exec() == QDialog::Accepted) 
	{       
		m_sCurrentList = dialogFiles->selectedFiles();
		m_sAllList += m_sCurrentList;
		m_sAllList.removeDuplicates();
		showFileInfo(m_sAllList);
	}
}
Exemple #6
0
int main()
{


    // FILE *f; 
    // int fileID,i; ede
   //  FieldType *fieldType;
    // FileHeader *fh;
//float v=1.24;

  //   f=fopen("/home/yair/testfloat","w");  
// writefloat(v, f) ;
 //fclose(f); 

  //   f=fopen("/home/yair/testfloat","r");  
//	printf("%d\n",readfloat(f));
//	fclose(f);
//return;

	// initate Data Base
	//FileClass fileClass;
     DB_Init();
     Time time;	
     time.hour=12;
     time.minutes=45;
     time.seconds=23;
     time.month=11;
     time.year=2011;
     time.msSec=233;
     CreateMBTDataFile("/home/openrisc/junk.mbt");
     showFileInfo("/home/openrisc/junk.mbt");
	addData();



	
//	fileClass = FileClass_Open("/home/yair/junk.mbt");
//	FileClass_ShowFileInfo(fileClass);

	
	readData();


//	File_Open(&fileClass,"/home/yair/junk.mbt");
//	File_SetColum(&fileClass,"EUR_USD",0);
//	File_SetColum(&fileClass,"EUR_CAD",1);




	DB_Finalize();



   //  DB_Init();

     //fh = DBHeader_Create();
	
     //fieldType = DBField_Create("EUR_USD",DB_LEN16,4);
     //DBHeader_AddField(fh,fieldType);
     //fieldType = DBField_Create("EUR_CAD",DB_LEN16,4);
     //DBHeader_AddField(fh,fieldType);

// DBFile_SetHeader(FileHeader *fh)

     
  //   fileID = DBFile_Open("/home/yair/junk");
    // DBFile_SetHeader(FileHeader *fh)

     //DBFile_SetTime(fileID, time);
     //DBFile_SetPointer(fileID, 0);
     //for (i = 0; i<10; i++)
     //{
    // }
     //DBFile_Close(fileID);


   //  fwrite(&fh,sizeof(struct _FileHeader),1,f);    
    // fclose (f);
     
        //f=fopen("/mnt/win_c/yair/junk","r");    
       // fread(&fh1,sizeof(struct _FileHeader),1,f);      
      //  printf("%d:%d:%d\n",fh1.hour,fh1.minutes,fh1.seconds);
return 0;
}
int main(int argc, char *argv[])
{
  Options options;
  bool options_chosen = false;

  std::vector<std::string> filenames;
  for (int i = 1; i < argc; i++)
  {
    std::string s = argv[i];
    if(s[0] == '-' && s.size() > 1)
    {
      if(s != "-x") options_chosen = true; //only selecting hexadecimal is no choice, keep the defaults
      for(size_t j = 1; j < s.size(); j++)
      {
        char c = s[j];
        if(c == 'h')
        {
          showHelp();
          return 0;
        }
        else if(c == 's') options.show_png_summary = true;
        else if(c == 'p') options.show_png_info = true;
        else if(c == 'P')
        {
          options.show_png_info = true;
          options.show_extra_png_info = true;
        }
        else if(c == 'l') options.show_palette = true;
        else if(c == 'L') options.show_palette_pixels = true;
        else if(c == 'a') options.show_ascii_art = true;
        else if(c == 'A')
        {
          options.show_ascii_art = true;
          options.ascii_art_size += 40;
        }
        else if(c == '#') options.show_colors_hex = true;
        else if(c == '@') options.show_colors_hex_16 = true;
        else if(c == 'c') options.show_chunks = true;
        else if(c == 'C') options.show_chunks2 = true;
        else if(c == 'f') options.show_filters = true;
        else if(c == 'z') options.zlib_info = true;
        else if(c == 'b') options.zlib_blocks = true;
        else if(c == 'B')
        {
          options.zlib_blocks = true;
          options.zlib_counts = true;
        }
        else if(c == '7')
        {
          options.zlib_blocks = true;
          options.zlib_full = true;
        }
        else if(c == 'x')
        {
          options.use_hex = true;
          std::cout << std::hex;
        }
        else
        {
          std::cout << "Unknown flag: " << c << ". Use -h for help" << std::endl;
          return 0;
        }

      }
    }
    else filenames.push_back(s);
  }

  if(filenames.empty())
  {
    std::cout << "Please provide a filename to preview" << std::endl;
    showHelp();
    return 0;
  }

  if(!options_chosen)
  {
    //fill in defaults
    options.show_png_info = true;
    options.show_chunks = true;
    options.show_filters = true;
    options.zlib_info = true;
  }

  for(size_t i = 0; i < filenames.size(); i++)
  {
    if(filenames.size() > 1) std::cout << filenames[i] << std::endl;
    showFileInfo(filenames[i], options);
  }
}