Esempio n. 1
0
//! [8]
ApplicationsTab::ApplicationsTab(const QFileInfo &fileInfo, QWidget *parent)
    : QWidget(parent)
{
    QLabel *topLabel = new QLabel(tr("Open with:"));

    QListWidget *applicationsListBox = new QListWidget;
    QStringList applications;

    for (int i = 1; i <= 30; ++i)
        applications.append(tr("Application %1").arg(i));
    applicationsListBox->insertItems(0, applications);

    QCheckBox *alwaysCheckBox;

    if (fileInfo.suffix().isEmpty())
        alwaysCheckBox = new QCheckBox(tr("Always use this application to "
            "open this type of file"));
    else
        alwaysCheckBox = new QCheckBox(tr("Always use this application to "
            "open files with the extension '%1'").arg(fileInfo.suffix()));

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(topLabel);
    layout->addWidget(applicationsListBox);
    layout->addWidget(alwaysCheckBox);
    setLayout(layout);
}
Esempio n. 2
0
int main(int argc, char *argv[])
{
  QApplication a(argc, argv);

  a.setStyle("cleanlooks");

#if 0
  if (!QSystemTrayIcon::isSystemTrayAvailable())
  {
    QMessageBox::critical
    (
        0,
        QObject::tr("Systray"),
        QObject::tr("There is no system tray on this system.")
    );
    return 1;
  }

  QApplication::setQuitOnLastWindowClosed(false);
#endif

#if 0
  Allegrex::create_instructions_directory();
  Allegrex::create_interpreter_directory();
  Allegrex::create_disassembler_directory();

  QPspe4all w;

  w.show();

#else
  if (true/*emulator.check_integrity()*/)
  {
    QPspe4all w;

    w.show();

    psp::memw(0x00010000) = 0xDEADBEEF;
    psp::memw(0x04000000) = 0xDEADC0DE;
    psp::memw(0x08000000) = 0xE117C0DE;

    QStringList list;

#define IDEF(n, m, s, x) list.append(QString("%1/%2 : %3").arg(uint(s), 8, 16, QChar('0')).arg(uint(m), 8, 16, QChar('0')).arg(Allegrex::decode_instruction(s)->opcode_name()));
#include "emulator/allegrex/allegrex.def"
#undef IDEF

    QListWidget l;
    l.setFont(QFont("Terminal"));
    l.insertItems(0, list);
    l.show();

    return a.exec();
  }
#endif
  return a.exec();

  return 1;
}