Exemple #1
0
void FormStyle::SetColor()
{
	QMP_RUN_OS os = getOS();
	if ( os == QMP_MAC || ( os != QMP_WINDOWS && styl == "QtCurve" ) )
		QTimer::singleShot( 0, this, SLOT( quickSetColor() ) );
	quickSetColor();
	setButtonsColor();
	if ( !ui.colorsB->currentText().isEmpty() )
		colorScheme = ui.colorsB->currentText();
	resetTray();
}
DiagnosticsDialog::DiagnosticsDialog( QWidget *parent )
:	QDialog( parent )
{
	setupUi( this );
	setAttribute( Qt::WA_DeleteOnClose, true );

	QString info;
	QTextStream s( &info );

	s << "<b>" << tr("Locale:") << "</b> ";
	QLocale::Language language = QLocale::system().language();
	s << (language == QLocale::C ? "English/United States" : QLocale::languageToString( language ) ) << "<br /><br />";

	QString base = getRegistry( "Eesti ID kaardi tarkvara" );
	if ( !base.isEmpty() )
		s << "<b>" << tr("Base version:") << "</b> " << base << "<br />";
	s << "<b>" << tr("ID-card utility version:") << "</b> "<< QCoreApplication::applicationVersion() << "<br />";

	s << "<b>" << tr("OS:") << "</b> " << getOS() << " (" << getBits() << ")<br />";
	s << "<b>" << tr("CPU:") << "</b> " << getProcessor() << "<br /><br />";

	s << "<b>" << tr("Library paths:") << "</b> " << QCoreApplication::libraryPaths().join( ";" ) << "<br />";

	s << "<b>" << tr("Libraries") << ":</b><br />";
	s << getLibVersion( "digidoc") << "<br />";
	s << getLibVersion( "digidocpp") << "<br />";
	s << getLibVersion( "advapi32") << "<br />";
	s << getLibVersion( "crypt32") << "<br />";
	s << getLibVersion( "winscard") << "<br />";
	s << getLibVersion( "esteidcsp") << "<br />";
	s << getLibVersion( "esteidcm") << "<br />";
	s << getLibVersion( "libeay32" ) << "<br />";
	s << getLibVersion( "ssleay32" ) << "<br />";
	s << getLibVersion( "opensc-pkcs11" ) << "<br />";
	s << "QT (" << qVersion() << ")<br />" << "<br />";

	s << "<b>" << tr("Smart Card service status: ") << "</b>" << " " << (isPCSCRunning() ? tr("Running") : tr("Not running")) << "<br /><br />";

	s << "<b>" << tr("Card readers") << ":</b><br />" << getReaderInfo() << "<br />";

	QString browsers = getRegistry( "Mozilla|Windows Internet Explorer|Google Chrome" );
	if ( !browsers.isEmpty() )
		s << "<b>" << tr("Browsers:") << "</b><br />" << browsers << "<br /><br />";

	diagnosticsText->setHtml( info );

	buttonBox->addButton( tr( "More info" ), QDialogButtonBox::HelpRole );
}
Exemple #3
0
QString filestuff::mcDir()
{
    QString result = st.read("general", "mcdir", "none").toString();
    if (result == "none")
    {
        QString os = getOS();
        if (os == "Win"){
            result = QDir::homePath() + "/appdata/roaming/.minecraft";
        } else if (os == "Mac") {
            result = QDir::homePath() + "/Library/Application Support/minecraft";
        } else if (os == "Linux") {
            result = QDir::homePath() + "/.minecraft";
        }
    }
    st.write("general", "mcdir", result);
    return result;
}
Exemple #4
0
QString filestuff::appDir()
{
    QString result = st.read("general", "appdir", "none").toString();
    if (result == "none")
    {
        QString os = getOS();
        if (os == "Win"){
            result = QDir::homePath() + "/appdata/roaming/MCMx";
        } else if (os == "Mac") {
            result = QDir::homePath() + "/Library/Application Support/MCMx";
        } else if (os == "Linux") {
            result = QDir::homePath() + "/.MCMx";
        }
    }
    exMake(result);
    exMake(result + "/backups");
    st.write("general", "appdir", result);
    return result;
}
Exemple #5
0
bool mmap_alloc_process::plat_createAllocationSnippet(Dyninst::Address addr, bool use_addr, unsigned long size, 
                                                      void* &buffer, unsigned long &buffer_size, 
                                                      unsigned long &start_offset)
{
   int flags = MAP_ANONYMOUS | MAP_PRIVATE;
   if (use_addr) 
      flags |= MAP_FIXED;
   else
      addr = 0x0;

   if (getTargetArch() == Arch_x86_64 || getTargetArch() == Arch_x86) {
       const void *buf_tmp = NULL;
       unsigned addr_size = 0;
       unsigned addr_pos = 0;
       unsigned flags_pos = 0;
       unsigned size_pos = 0;

       bool use_linux = (getOS() == Dyninst::Linux);
       bool use_bsd = (getOS() == Dyninst::FreeBSD);
       bool use_64 = (getTargetArch() == Arch_x86_64);
       
       if (use_linux && use_64) {
          buf_tmp = linux_x86_64_call_mmap;
          buffer_size = linux_x86_64_call_mmap_size;
          start_offset = linux_x86_64_mmap_start_position;
          addr_pos = linux_x86_64_mmap_addr_position;
          flags_pos = linux_x86_64_mmap_flags_position;
          size_pos = linux_x86_64_mmap_size_position;
          addr_size = 8;
       }
       else if (use_bsd && use_64) {
          buf_tmp = freebsd_x86_64_call_mmap;
          buffer_size = freebsd_x86_64_call_mmap_size;
          start_offset = freebsd_x86_64_mmap_start_position;
          addr_pos = freebsd_x86_64_mmap_addr_position;
          flags_pos = freebsd_x86_64_mmap_flags_position;
          size_pos = freebsd_x86_64_mmap_size_position;
          addr_size = 8;
       }
       else if (use_linux && !use_64) {
          buf_tmp = linux_x86_call_mmap;
          buffer_size = linux_x86_call_mmap_size;
          start_offset = linux_x86_mmap_start_position;
          addr_pos = linux_x86_mmap_addr_position;
          flags_pos = linux_x86_mmap_flags_position;
          size_pos = linux_x86_mmap_size_position;
          addr_size = 4;
       } 
       else if (use_bsd && !use_64) {
          buf_tmp = freebsd_x86_call_mmap;
          buffer_size = freebsd_x86_call_mmap_size;
          start_offset = freebsd_x86_mmap_start_position;
          addr_pos = freebsd_x86_mmap_addr_position;
          flags_pos = freebsd_x86_mmap_flags_position;
          size_pos = freebsd_x86_mmap_size_position;
          addr_size = 4;
       }
       else {
          assert(0); //Fill in the entry in mmapalloc.h for this system
       }
       
       buffer = malloc(buffer_size);
       memcpy(buffer, buf_tmp, buffer_size);

       //Assuming endianess of debugger and debugee match.
       *((unsigned int *) (((char *) buffer)+size_pos)) = size;
       *((unsigned int *) (((char *) buffer)+flags_pos)) = flags;
       if (addr_size == 8)
          *((unsigned long *) (((char *) buffer)+addr_pos)) = addr;
       else if (addr_size == 4)
          *((unsigned *) (((char *) buffer)+addr_pos)) = (unsigned) addr;
       else 
          assert(0);
   }
   else if (getTargetArch() == Arch_ppc32) {
      unsigned int flags_hi_position;
      unsigned int flags_lo_position;
      unsigned int size_hi_position;
      unsigned int size_lo_position;
      unsigned int addr_hi_position;
      unsigned int addr_lo_position;
      const void *buf_tmp;

      //BlueGene can share the linux allocation snippet.
      bool use_linux = (getOS() == Linux || getOS() == BlueGeneP || getOS() == BlueGeneL);

      if (use_linux) {
         flags_hi_position = linux_ppc32_mmap_flags_hi_position;
         flags_lo_position = linux_ppc32_mmap_flags_lo_position;
         size_hi_position = linux_ppc32_mmap_size_hi_position;
         size_lo_position = linux_ppc32_mmap_size_lo_position;
         addr_hi_position = linux_ppc32_mmap_addr_hi_position;
         addr_lo_position = linux_ppc32_mmap_addr_lo_position;
         start_offset = linux_ppc32_mmap_start_position;
         buffer_size = linux_ppc32_call_mmap_size;
         buf_tmp = linux_ppc32_call_mmap;
      }
      else {
         assert(0); //Fill in the entry in mmapalloc.h for this system
      }

      buffer = malloc(buffer_size);
      memcpy(buffer, buf_tmp, buffer_size);
      
      // Assuming endianess of debugger and debuggee match
      *((uint16_t *) (((char *) buffer)+size_hi_position)) = (uint16_t)(size >> 16);
      *((uint16_t *) (((char *) buffer)+size_lo_position)) = (uint16_t)size;
      *((uint16_t *) (((char *) buffer)+flags_hi_position)) = (uint16_t)(flags >> 16);
      *((uint16_t *) (((char *) buffer)+flags_lo_position)) = (uint16_t)flags;
      *((uint16_t *) (((char *) buffer)+addr_hi_position)) = (uint16_t)(addr >> 16);
      *((uint16_t *) (((char *) buffer)+addr_lo_position)) = (uint16_t)addr;
   }