Exemplo n.º 1
0
ConfigurationManager::ConfigurationManager(ItemFactory *itemFactory, QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::ConfigurationManager)
    , m_options()
{
    ui->setupUi(this);
    connectSlots();
    setWindowIcon(appIcon());

    connect( ui->configTabShortcuts, &ConfigTabShortcuts::commandsSaved,
             this, &ConfigurationManager::commandsSaved );

    ui->spinBoxItems->setMaximum(Config::maxItems);

    if ( itemFactory && itemFactory->hasLoaders() )
        initPluginWidgets(itemFactory);
    else
        ui->tabItems->hide();

    initOptions();

    if (itemFactory)
        ui->configTabAppearance->createPreview(itemFactory);

    loadSettings();

    if (itemFactory)
        ui->configTabShortcuts->addCommands( itemFactory->commands() );
}
Exemplo n.º 2
0
void ClipboardDialog::init()
{
    Q_ASSERT(!ui);

    ui = new Ui::ClipboardDialog;
    ui->setupUi(this);

    connect(ui->listWidgetFormats, &QListWidget::currentItemChanged,
            this, &ClipboardDialog::onListWidgetFormatsCurrentItemChanged);
    connect(ui->actionRemove_Format, &QAction::triggered,
            this, &ClipboardDialog::onActionRemoveFormatTriggered);

    setWindowIcon(appIcon());

    ui->horizontalLayout->setStretchFactor(1, 1);
    ui->listWidgetFormats->setCurrentRow(0);

    WindowGeometryGuard::create(this);

    ui->actionRemove_Format->setIcon( getIcon("list-remove", IconTrash) );
    ui->actionRemove_Format->setShortcut(shortcutToRemove());
    ui->listWidgetFormats->addAction(ui->actionRemove_Format);

    onListWidgetFormatsCurrentItemChanged(nullptr, nullptr);
}
Exemplo n.º 3
0
TreeItem *TreeView::createTreeItem(TreeItem *parent, Q3ListViewItem *after, MenuEntryInfo *entryInfo, bool _init)
{
   bool hidden = entryInfo->hidden;

   TreeItem* item;
   if (parent == 0)
     item = new TreeItem(this, after, entryInfo->menuId(), _init);
   else
     item = new TreeItem(parent, after, entryInfo->menuId(),_init);

   QString	name;

   if (m_detailedMenuEntries && entryInfo->description.length() != 0)
   {
      if (m_detailedEntriesNamesFirst)
      {
         name = entryInfo->caption + " (" + entryInfo->description + ')';
      }
      else
      {
         name = entryInfo->description + " (" + entryInfo->caption + ')';
      }
   }
   else
   {
      name = entryInfo->caption;
   }
   item->setMenuEntryInfo(entryInfo);
   item->setName(name);
   item->setPixmap(0, appIcon(entryInfo->icon));

   item->setHidden(hidden);
   return item;
}
Exemplo n.º 4
0
int main(int argc, char *argv[])
{
  Q_INIT_RESOURCE(pvbrowser);
#ifdef USE_SYMBIAN
    //display args in debug console
    //printf are not visible with default settings
    int i;
    qDebug()<<"v: 0.5";//to see if really the app havebeen replaced on debug device
    for(i=0;i<argc;i++){
        qDebug()<<"ARG["<<i<<"]: "<<argv[i];
    }
#endif
  wsa(); // init windows sockets
  QApplication app(argc, argv);
  QPixmap pm(splash);
  QSplashScreen *splash = new QSplashScreen(pm);
  splash->show();
  init(argc,argv);
  perhapsSetFont(app);
  QIcon appIcon(":/images/app.png");
  app.setWindowIcon(appIcon);
  MainWindow mainWin;
  app.processEvents();
  splash->finish(&mainWin);
  delete splash;
  mainWin.show();
  mainWin.showBusyWidget(2000,"Starting...");
  app.processEvents();
  mainWin.slotReconnect();
  mainWin.slotTimeOut();
  mainWin.mythread.start(QThread::HighestPriority);
  mainWin.hideBusyWidget();
  return app.exec();
}
Exemplo n.º 5
0
guiLog::guiLog(const wxString& title, int x, int y, int w, int h, wxWindow * parent)
: wxFrame(parent, -1, title, wxPoint(x, y), wxSize(w, h))
{
    wxIcon appIcon(yoda_xpm);
    SetIcon(appIcon);  // Set the icon

    wxPanel * panel = new wxPanel(this);

    LogView(panel, true, true);

    m_listctrl = (wxListCtrl *)FindWindow(ID_LOG_LIST);

    m_listctrl->InsertColumn(0, wxT("Message"));
    m_listctrl->InsertColumn(1, wxT("Type"));

    // prepare the imagelist
    enum { ICON_SIZE = 16 };
    wxImageList *imageList = new wxImageList(ICON_SIZE, ICON_SIZE, true);

    // order should be the same as in the switch below!

    imageList->Add( wxBitmap( stormtroop_xpm ).ConvertToImage().Rescale(ICON_SIZE, ICON_SIZE) );
    imageList->Add( wxBitmap( boba_ship_xpm ).ConvertToImage().Rescale(ICON_SIZE, ICON_SIZE) );
    imageList->Add( wxBitmap( yoda_xpm ).ConvertToImage().Rescale(ICON_SIZE, ICON_SIZE) );

    m_listctrl->SetImageList(imageList, wxIMAGE_LIST_SMALL);

    Show(TRUE);

    m_logOld = wxLog::SetActiveTarget(this);

}
Exemplo n.º 6
0
void TreeView::currentChanged(MenuEntryInfo *entryInfo)
{
    TreeItem *item = (TreeItem*)selectedItem();
    if (item == 0) return;
    if (entryInfo == 0) return;

    QString	name;

    if (m_detailedMenuEntries && entryInfo->description.length() != 0)
    {
        if (m_detailedEntriesNamesFirst)
	 {
            name = entryInfo->caption + " (" + entryInfo->description + ')';
        }
	 else
        {
            name = entryInfo->description + " (" + entryInfo->caption + ')';
        }
    }
    else
    {
        name = entryInfo->caption;
    }
    item->setName(name);
    item->setPixmap(0, appIcon(entryInfo->icon));
}
Exemplo n.º 7
0
void TreeView::currentChanged(MenuFolderInfo *folderInfo)
{
    TreeItem *item = (TreeItem*)selectedItem();
    if (item == 0) return;
    if (folderInfo == 0) return;

    item->setName(folderInfo->caption);
    item->setPixmap(0, appIcon(folderInfo->icon));
}
Exemplo n.º 8
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QIcon appIcon(":xs_icon/images/icon.jpg");
    a.setWindowIcon(appIcon);
    XSMainWindow w;
    w.show();

    return a.exec();
}
Exemplo n.º 9
0
ModuleTreeItem::ModuleTreeItem(QListView *parent, ConfigModule *module)
  : QListViewItem(parent)
  , _module(module)
  , _tag(QString::null)
  , _maxChildIconWidth(0)
{
  if (_module)
        {
          setText(0, " " + module->moduleName());
          _icon = module->icon();
          setPixmap(0, appIcon(_icon));
        }
}
Exemplo n.º 10
0
TreeItem *TreeView::createTreeItem(TreeItem *parent, Q3ListViewItem *after, MenuFolderInfo *folderInfo, bool _init)
{
   TreeItem *item;
   if (parent == 0)
     item = new TreeItem(this, after, QString(), _init);
   else
     item = new TreeItem(parent, after, QString(), _init);

   item->setMenuFolderInfo(folderInfo);
   item->setName(folderInfo->caption);
   item->setPixmap(0, appIcon(folderInfo->icon));
   item->setDirectoryPath(folderInfo->fullId);
   item->setHidden(folderInfo->hidden);
   item->setExpandable(true);
   return item;
}
Exemplo n.º 11
0
void tst_QGuiApplication::windowIcon()
{
    int argc = 3;
    char *argv[] = { const_cast<char*>("tst_qguiapplication"), const_cast<char*>("-qwindowicon"), const_cast<char*>(":/icons/usericon.png") };
    QGuiApplication app(argc, argv);
    QIcon appIcon(":/icons/appicon.png");
    app.setWindowIcon(appIcon);

    QWindow window;
    window.show();

    QIcon userIcon(":/icons/usericon.png");
    // Comparing icons is hard. cacheKey() differs because the icon was independently loaded.
    // So we use availableSizes, after making sure that the app and user icons do have different sizes.
    QVERIFY(userIcon.availableSizes() != appIcon.availableSizes());
    QCOMPARE(window.icon().availableSizes(), userIcon.availableSizes());
}
Exemplo n.º 12
0
int main(int argc, char *argv[])
{
    setlocale(LC_NUMERIC, "C");
    getargs(argc,argv);
    setDefaultOptions();
    readIniFile();

    Q_INIT_RESOURCE(pvdevelop);

    QApplication app(argc, argv);
    setlocale(LC_NUMERIC, "C");
    perhapsDoAction();
    QIcon appIcon(":/images/app.png");
    app.setWindowIcon(appIcon);
    MainWindow mainWin;
    mainWin.showMaximized();
    if(opt_develop.murx) QDir::setCurrent("/home/lehrig/temp/murx");
    return app.exec();
}
Exemplo n.º 13
0
void ClipboardDialog::init()
{
    Q_ASSERT(!ui);

    ui = new Ui::ClipboardDialog;
    ui->setupUi(this);

    setWindowIcon(appIcon());

    ui->horizontalLayout->setStretchFactor(1, 1);
    ui->listWidgetFormats->setCurrentRow(0);

    WindowGeometryGuard::create(this);

    ui->actionRemove_Format->setIcon( getIcon("list-remove", IconRemove) );
    ui->actionRemove_Format->setShortcut(shortcutToRemove());
    ui->listWidgetFormats->addAction(ui->actionRemove_Format);

    on_listWidgetFormats_currentItemChanged(NULL, NULL);
}
Exemplo n.º 14
0
int main(int argc, char *argv[])
{
    Logger::Init("Tombola.log.txt");
    qInfo() << "\n\n" << "========== Startup ==========";

    CrashHandler crashHandler;

    QApplication app(argc, argv);
    QCoreApplication::setApplicationName("Tombola");     // QSettings init early enough
    QCoreApplication::setOrganizationName("Kúr Attila"); // QSettings init early enough

    DynamicTranslation dynamicTranslation(app);

    TombolaDocument document;

//    qmlRegisterType<BlockColorsSet_ViewModel>("com.quatso.tombola", 1, 0, "BlockColorSetListModel");
    TicketDrawExecutor ticketDrawExecutor(  document
                                          , new SingleTicketDraw_ViewModel()
                                          , new SingleTicketDraw_ViewModel());

    Controller controller(document, ticketDrawExecutor);
    controller.OnAppStartup();

    TicketsSellingPoint_ViewModel ticketsSellingPoint_ViewModel(document);
    ticketsSellingPoint_ViewModel.Init(ticketDrawExecutor.IsPrizeDrawingRunning());

    QQmlApplicationEngine engine;
    engine.rootContext()->setContextProperty("ticketsSellingPoint", QVariant::fromValue(&ticketsSellingPoint_ViewModel));
    engine.rootContext()->setContextProperty("ticketDrawExecutor", QVariant::fromValue(&ticketDrawExecutor));
    engine.rootContext()->setContextProperty("dynamicTranslation", &dynamicTranslation);
    engine.rootContext()->setContextProperty("crashHandler", &crashHandler);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    QIcon appIcon(":///Images/TombolaAppIcon.png");
    app.setWindowIcon(appIcon);

    int appRetVal = app.exec();
    controller.OnAppExit();
    return appRetVal;
}
Exemplo n.º 15
0
void ModuleTreeItem::setGroup(const QString &path)
{
  KServiceGroup::Ptr group = KServiceGroup::group(path);
  QString defName = path.left(path.length()-1);
  int pos = defName.findRev('/');
  if (pos >= 0)
     defName = defName.mid(pos+1);
  if (group && group->isValid())
  {
     _icon = group->icon();
     setPixmap(0, appIcon(_icon));
     setText(0, " " + group->caption());
     setTag(defName);
     setCaption(group->caption());
  }
  else
  {
     // Should not happen: Installation problem
     // Let's try to fail softly.
     setText(0, " " + defName);
     setTag(defName);
  }
}
Exemplo n.º 16
0
Arquivo: main.cpp Projeto: nrj123/pvb
int main(int argc, char *argv[])
{
  Q_INIT_RESOURCE(pvbrowser);

  wsa(); // init windows sockets
  QApplication app(argc, argv);
  QPixmap pm(splash);
  QSplashScreen *splash = new QSplashScreen(pm);
  splash->show();
  init(argc,argv);
  perhapsSetFont(app);
  QIcon appIcon(":/images/app.png");
  app.setWindowIcon(appIcon);
  MainWindow mainWin;
  app.processEvents();
  splash->finish(&mainWin);
  delete splash;
  mainWin.show();
  app.processEvents();
  mainWin.slotReconnect();
  mainWin.slotTimeOut();
  mainWin.mythread.start(QThread::HighestPriority);
  return app.exec();
}
Exemplo n.º 17
0
QT_BEGIN_NAMESPACE

MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
    : QMainWindow(parent)
    , m_bookmarkWidget(0)
    , m_filterCombo(0)
    , m_toolBarMenu(0)
    , m_cmdLine(cmdLine)
    , m_progressWidget(0)
    , m_qtDocInstaller(0)
    , m_connectedInitSignals(false)
{
    TRACE_OBJ

    setToolButtonStyle(Qt::ToolButtonFollowStyle);
    setDockOptions(dockOptions() | AllowNestedDocks);

    QString collectionFile;
    if (usesDefaultCollection()) {
        MainWindow::collectionFileDirectory(true);
        collectionFile = MainWindow::defaultHelpCollectionFileName();
    } else {
        collectionFile = cmdLine->collectionFile();
    }
    HelpEngineWrapper &helpEngineWrapper =
        HelpEngineWrapper::instance(collectionFile);
    BookmarkManager *bookMarkManager = BookmarkManager::instance();

    if (!initHelpDB(!cmdLine->collectionFileGiven())) {
        qDebug("Fatal error: Help engine initialization failed. "
            "Error message was: %s\nAssistant will now exit.",
            qPrintable(HelpEngineWrapper::instance().error()));
        std::exit(1);
    }

    m_centralWidget = new CentralWidget(this);
    setCentralWidget(m_centralWidget);

    m_indexWindow = new IndexWindow(this);
    QDockWidget *indexDock = new QDockWidget(tr("Index"), this);
    indexDock->setObjectName(QLatin1String("IndexWindow"));
    indexDock->setWidget(m_indexWindow);
    addDockWidget(Qt::LeftDockWidgetArea, indexDock);

    m_contentWindow = new ContentWindow;
    QDockWidget *contentDock = new QDockWidget(tr("Contents"), this);
    contentDock->setObjectName(QLatin1String("ContentWindow"));
    contentDock->setWidget(m_contentWindow);
    addDockWidget(Qt::LeftDockWidgetArea, contentDock);

    m_searchWindow = new SearchWidget(helpEngineWrapper.searchEngine());
    m_searchWindow->setFont(!helpEngineWrapper.usesBrowserFont() ? qApp->font()
        : helpEngineWrapper.browserFont());
    QDockWidget *searchDock = new QDockWidget(tr("Search"), this);
    searchDock->setObjectName(QLatin1String("SearchWindow"));
    searchDock->setWidget(m_searchWindow);
    addDockWidget(Qt::LeftDockWidgetArea, searchDock);

    QDockWidget *bookmarkDock = new QDockWidget(tr("Bookmarks"), this);
    bookmarkDock->setObjectName(QLatin1String("BookmarkWindow"));
    bookmarkDock->setWidget(m_bookmarkWidget
        = bookMarkManager->bookmarkDockWidget());
    addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock);

    QDockWidget *openPagesDock = new QDockWidget(tr("Open Pages"), this);
    openPagesDock->setObjectName(QLatin1String("Open Pages"));
    OpenPagesManager *openPagesManager
        = OpenPagesManager::createInstance(this, usesDefaultCollection(), m_cmdLine->url());
    openPagesDock->setWidget(openPagesManager->openPagesWidget());
    addDockWidget(Qt::LeftDockWidgetArea, openPagesDock);

    connect(m_centralWidget, SIGNAL(addBookmark(QString, QString)),
        bookMarkManager, SLOT(addBookmark(QString, QString)));
    connect(bookMarkManager, SIGNAL(escapePressed()), this,
            SLOT(activateCurrentCentralWidgetTab()));
    connect(bookMarkManager, SIGNAL(setSource(QUrl)), m_centralWidget,
            SLOT(setSource(QUrl)));
    connect(bookMarkManager, SIGNAL(setSourceInNewTab(QUrl)),
        openPagesManager, SLOT(createPage(QUrl)));

    QHelpSearchEngine *searchEngine = helpEngineWrapper.searchEngine();
    connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted()));
    connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished()));

    QString defWindowTitle = tr("Qt Assistant");
    setWindowTitle(defWindowTitle);

    setupActions();
    statusBar()->show();
    m_centralWidget->connectTabBar();

    setupFilterToolbar();
    setupAddressToolbar();

    const QString windowTitle = helpEngineWrapper.windowTitle();
    setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle);
    QByteArray iconArray = helpEngineWrapper.applicationIcon();
    if (iconArray.size() > 0) {
        QPixmap pix;
        pix.loadFromData(iconArray);
        QIcon appIcon(pix);
        qApp->setWindowIcon(appIcon);
    } else {
        QIcon appIcon(QLatin1String(":/trolltech/assistant/images/assistant-128.png"));
        qApp->setWindowIcon(appIcon);
    }

    QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar"));
    toolBar->setObjectName(QLatin1String("Bookmark Toolbar"));
    bookMarkManager->setBookmarksToolbar(toolBar);

    // Show the widget here, otherwise the restore geometry and state won't work
    // on x11.
    show();

    toolBar->hide();
    toolBarMenu()->addAction(toolBar->toggleViewAction());

    QByteArray ba(helpEngineWrapper.mainWindow());
    if (!ba.isEmpty())
        restoreState(ba);

    ba = helpEngineWrapper.mainWindowGeometry();
    if (!ba.isEmpty()) {
        restoreGeometry(ba);
    } else {
        tabifyDockWidget(contentDock, indexDock);
        tabifyDockWidget(indexDock, bookmarkDock);
        tabifyDockWidget(bookmarkDock, searchDock);
        contentDock->raise();
        const QRect screen = QApplication::desktop()->screenGeometry();
        resize(4*screen.width()/5, 4*screen.height()/5);
    }

    if (!helpEngineWrapper.hasFontSettings()) {
        helpEngineWrapper.setUseAppFont(false);
        helpEngineWrapper.setUseBrowserFont(false);
        helpEngineWrapper.setAppFont(qApp->font());
        helpEngineWrapper.setAppWritingSystem(QFontDatabase::Latin);
        helpEngineWrapper.setBrowserFont(qApp->font());
        helpEngineWrapper.setBrowserWritingSystem(QFontDatabase::Latin);
    } else {
        updateApplicationFont();
    }

    updateAboutMenuText();

    QTimer::singleShot(0, this, SLOT(insertLastPages()));
    if (m_cmdLine->enableRemoteControl())
        (void)new RemoteControl(this);

    if (m_cmdLine->contents() == CmdLineParser::Show)
        showContents();
    else if (m_cmdLine->contents() == CmdLineParser::Hide)
        hideContents();

    if (m_cmdLine->index() == CmdLineParser::Show)
        showIndex();
    else if (m_cmdLine->index() == CmdLineParser::Hide)
        hideIndex();

    if (m_cmdLine->bookmarks() == CmdLineParser::Show)
        showBookmarksDockWidget();
    else if (m_cmdLine->bookmarks() == CmdLineParser::Hide)
        hideBookmarksDockWidget();

    if (m_cmdLine->search() == CmdLineParser::Show)
        showSearch();
    else if (m_cmdLine->search() == CmdLineParser::Hide)
        hideSearch();

    if (m_cmdLine->contents() == CmdLineParser::Activate)
        showContents();
    else if (m_cmdLine->index() == CmdLineParser::Activate)
        showIndex();
    else if (m_cmdLine->bookmarks() == CmdLineParser::Activate)
        showBookmarksDockWidget();

    if (!m_cmdLine->currentFilter().isEmpty()) {
        const QString &curFilter = m_cmdLine->currentFilter();
        if (helpEngineWrapper.customFilters().contains(curFilter))
            helpEngineWrapper.setCurrentFilter(curFilter);
    }

    if (usesDefaultCollection())
        QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation()));
    else
        checkInitState();

    connect(&helpEngineWrapper, SIGNAL(documentationRemoved(QString)),
            this, SLOT(documentationRemoved(QString)));
    connect(&helpEngineWrapper, SIGNAL(documentationUpdated(QString)),
            this, SLOT(documentationUpdated(QString)));

    setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North);
    GlobalActions::instance()->updateActions();
    if (helpEngineWrapper.addressBarEnabled())
        showNewAddress();
}