void CacicSysTray::iniciarSysTray() { if(QSystemTrayIcon::isSystemTrayAvailable()) { if(logcacic != NULL) logcacic->escrever(LogCacic::InfoLevel,QString("Inicializando SystemTray")); sysTray = new QSystemTrayIcon(this); sysTray->setToolTip(QString("Cacic")); sysTray->setIcon(QIcon(":/icon/cacic-logo.png")); QMenu *menu; menu = setupMenu(); sysTray->setContextMenu(menu); sysTray->show(); if(logcacic != NULL && sysTray->isVisible()) logcacic->escrever(LogCacic::InfoLevel,QString("SysTray iniciada.")); connect(sysTray,&QSystemTrayIcon::activated,this,&CacicSysTray::on_activated); } else { if(logcacic != NULL) logcacic->escrever(LogCacic::InfoLevel,QString("Falha ao iniciar SystemTray")); } }
MainWindow::MainWindow(InterfaceManagerP_t im, ProbeStore &store, ProbeStore &noBroadcastStore, QWidget *parent) : QWidget(parent), m_interface(im) { m_ifaceName = new QLabel(QString("Interface: %1").arg(im->getInterfaceName())); m_channelList = new QComboBox(); m_model = new ProbesModel(store, noBroadcastStore); m_tree = new QTreeView(); m_tree->setModel(m_model); connect(m_model, SIGNAL(layoutChanged()), this, SLOT(redraw())); m_layout = new QGridLayout(this); m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setSpacing(0); m_statusbar = new QStatusBar(this); setupMenu(); m_layout->addWidget(m_ifaceName, 1, 0); m_layout->addWidget(m_channelList, 1, 1); m_layout->addWidget(m_tree, 2, 0, 1, 2); m_layout->addWidget(m_statusbar, 3, 0, 1, 2); setLayout(m_layout); connect(m_channelList, SIGNAL(currentIndexChanged(int)), this, SLOT(channelChange(int))); connect(m_model, SIGNAL(statusMessage(const QString&)), m_statusbar, SLOT(showMessage(const QString&))); updateChannelList(); }
MainWindow::MainWindow(ScriptEnvironment *env, QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) { d = new MainWindowPrivate; d->pagesActionGroup = new QActionGroup( this ); d->message = new Message(); connect(qApp, SIGNAL(showMessage(QString,QString,QString)), d->message, SLOT(showMessage(QString,QString,QString))); d->env = env; //setAttribute(Qt::WA_DeleteOnClose, true); // Restore size and position QSettings settings; resize(settings.value("Size", size()).toSize()); move(settings.value("Pos", pos()).toPoint()); statusBar()->setSizeGripEnabled(true); setupMenu(); QWidget *centralWidget = new QWidget(this); QVBoxLayout *layout = new QVBoxLayout; centralWidget->setLayout(layout); layout->addWidget(d->message); d->stackedLayout = new QStackedLayout; layout->addLayout(d->stackedLayout); setCentralWidget(centralWidget); setupToolBar(); setWindowTitle( tr("TelldusCenter") ); }
/*! \brief Constructor */ CalenDayView::CalenDayView(MCalenServices &services) : CalenNativeView(services), mContentScrollArea(NULL), mContentWidget(NULL), mHourScrollArea(NULL), mVLayout(NULL), mMainContainer(NULL), mDocLoader(NULL), mIsLaunching(true), mSettingsManager(NULL), mRegionalInfoKey(XQSettingsKey::TargetCentralRepository, KCRUidCalendar, KCalendarShowRegionalInfo), mServices(services), mRegionalInfoGroupBox(NULL), mGoToTodayMenuAction(NULL), mBg(NULL), mGesturesAbsorber(NULL) { setupMenu(); // Create model manager mModelManager = new CalenDayModelManager(mServices, true, this); mSettingsManager = new XQSettingsManager(this); mSettingsManager->startMonitoring(mRegionalInfoKey); //setup Back functionality, launch the month view only when it is // the first view if (ECalenMonthView == mServices.getFirstView()) { HbAction* action = new HbAction(Hb::BackNaviAction, this); setNavigationAction(action); // Connect to the signal triggered by clicking on back button. connect(action, SIGNAL(triggered()), this, SLOT(onBack())); } HbStyleLoader::registerFilePath(":/calendayhourelement.css"); HbStyleLoader::registerFilePath(":/calendayhourelement.widgetml"); HbStyleLoader::registerFilePath(":/calendayitem.css"); HbStyleLoader::registerFilePath(":/calendayitem.widgetml"); HbStyleLoader::registerFilePath(":/calendayeventspane.css"); HbStyleLoader::registerFilePath(":/calendayhourscrollarea.css"); }
MainWindow::MainWindow() { //ui.setupUi(this); _disassembler_widget=new DisassemblerWidget(this); IDisassemblerCore* core=new DisassemblerCoreZX(this); core->init(); _disassembler_widget->setCore(core); QDockWidget* dock=new QDockWidget(tr("Navigation Stack"), this); dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); _navigation_stack = new QListWidget(dock); dock->setWidget(_navigation_stack); addDockWidget(Qt::RightDockWidgetArea, dock); dock=new QDockWidget(tr("Labels list"), this); dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); _labels_widget = new LabelsWidget(dock, _disassembler_widget); dock->setWidget(_labels_widget); addDockWidget(Qt::RightDockWidgetArea, dock); //m_Highlighter=new Highlighter(m_Disassembler->document()); setCentralWidget(_disassembler_widget); setupMenu(); }
TDDSubMenu::TDDSubMenu(const Size &size, const Color4B &headerColor, const Color4B &bodyColor, const Color3B &textColor, const std::string font, const int fontSize) : mShow(true) , mHeaderLayer(NULL) , mToggleButton(NULL) , mIsPressed(false) , mMenu(NULL) , mBackButton(NULL) { TDDSubMenu::initWithColor(bodyColor, size.width, size.height); mMaxSize.width = size.width; mMaxSize.height = size.height; // Add the header setupHeader(headerColor); setupMenu(); // Set touch setTouchEnabled(true); setTouchMode(Touch::DispatchMode::ONE_BY_ONE); // ??? }
ResourceView::ResourceView(QUndoStack *history, QWidget *parent) : QTreeView(parent), m_qrcModel(new Internal::RelativeResourceModel(m_qrcFile, this)), m_addFile(0), m_editAlias(0), m_removeItem(0), m_addPrefix(0), m_editPrefix(0), m_editLang(0), m_viewMenu(0), m_defaultAddFile(false), m_history(history), m_mergeId(-1) { advanceMergeId(); setModel(m_qrcModel); header()->hide(); connect(m_qrcModel, SIGNAL(dirtyChanged(bool)), this, SIGNAL(dirtyChanged(bool))); setupMenu(); setDefaultAddFileEnabled(true); enableContextMenu(true); }
BrowserWindow::BrowserWindow(Qz::BrowserWindowType type, const QUrl &startUrl) : QMainWindow(0) , m_startUrl(startUrl) , m_windowType(type) , m_startTab(0) , m_sideBarManager(new SideBarManager(this)) , m_statusBarMessage(new StatusBarMessage(this)) , m_hideNavigationTimer(0) { setObjectName("mainwindow"); setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("QupZilla")); setProperty("private", mApp->isPrivate()); setupUi(); setupMenu(); m_hideNavigationTimer = new QTimer(this); m_hideNavigationTimer->setInterval(1000); m_hideNavigationTimer->setSingleShot(true); connect(m_hideNavigationTimer, SIGNAL(timeout()), this, SLOT(hideNavigationSlot())); connect(mApp, SIGNAL(settingsReloaded()), this, SLOT(loadSettings())); QTimer::singleShot(0, this, SLOT(postLaunch())); if (mApp->isPrivate()) { QzTools::setWmClass("QupZilla Browser (Private Window)", this); } else { QzTools::setWmClass("QupZilla Browser", this); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow{parent} , ui{new Ui::MainWindow} { ms_mainWindow = this; // Setup UI controls. ui->setupUi(this); m_movingPixmapOverlay = std::make_unique<Util::MovingPixmapOverlay>(centralWidget()); m_statusBarProgress = new StatusBarProgressWidget{this}; ui->statusBar->addPermanentWidget(m_statusBarProgress); setupMenu(); setupToolSelector(); setupHelpURLs(); // Setup window properties. setWindowIcon(Util::loadIcon(Q("mkvtoolnix-gui.png"), QList<int>{} << 32 << 48 << 64 << 128 << 256)); retranslateUi(); Util::restoreWidgetGeometry(this); jobTool()->loadAndStart(); #if defined(HAVE_CURL_EASY_H) silentlyCheckForUpdates(); #endif // HAVE_CURL_EASY_H }
WBBrowserWindow::WBBrowserWindow(QWidget *parent, Ui::MainWindow* uniboardMainWindow, bool isViewerWebInstance) : QWidget(parent) , mWebToolBar(0) , mSearchToolBar(0) , mTabWidget(new WBTabWidget(this)) , mSearchAction(0) , mUniboardMainWindow(uniboardMainWindow) { QWebSettings *defaultSettings = QWebSettings::globalSettings(); defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, true); defaultSettings->setAttribute(QWebSettings::PluginsEnabled, true); setupMenu(); if(!isViewerWebInstance) setupToolBar(); else{ setupToolBarForTutorial(); } QVBoxLayout *layout = new QVBoxLayout; layout->setSpacing(0); layout->setMargin(0); layout->addWidget(mTabWidget); this->setLayout(layout); connect(mTabWidget, SIGNAL(loadPage(const QString &)), this, SLOT(loadPage(const QString &))); connect(mTabWidget, SIGNAL(setCurrentTitle(const QString &)), this, SLOT(slotUpdateWindowTitle(const QString &))); if (!isViewerWebInstance) { connect(mTabWidget, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); }
void ToolbarSearch::clear() { m_recentSearches.clear(); m_autosaver->changeOccurred(); setupMenu(); QLineEdit::clear(); clearFocus(); }
CUiPercentPicker::CUiPercentPicker(QWidget *parent) : QMenu(parent) { setupPercentages(); setupMenu(); connect(this, SIGNAL(triggered(QAction*)), this, SLOT(onActionTriggered(QAction*))); }
KTMainWindow::KTMainWindow(KTSplash *splash) : DMainWindow(), m_exposureSheet(0), m_scenes(0) { DINIT; setObjectName("KTMainWindow_"); m_osd = new KTOsd( centralWidget() ); m_statusBar = new KTStatusBar(this); setStatusBar( m_statusBar ); setWindowTitle(tr("KToon: 2D animation toolkit")); m_renderType = KToon::RenderType(DCONFIG->value("RenderType").toInt()); m_projectManager = new KTProjectManager(this); splash->setMessage( tr("Setting up the project manager") ); m_drawingSpace = new KTWorkspace; m_drawingSpace->setWindowIcon(QIcon(THEME_DIR+"/icons/illustration_mode.png")); m_drawingSpace->setScrollBarsEnabled( true ); addWidget(m_drawingSpace, tr("Illustration"), true); m_animationSpace = new KTWorkspace; m_animationSpace->setWindowIcon(QIcon(THEME_DIR+"/icons/animation_mode.png")); m_animationSpace->setScrollBarsEnabled ( true ); connect(m_animationSpace, SIGNAL(contextMenu( const QPoint& )), this, SLOT(showAnimationMenu( const QPoint& ))); addWidget(m_animationSpace, tr("Animation"), true); splash->setMessage( tr("Loading action manager...")); m_actionManager = new DActionManager(this); // Create the menubar; splash->setMessage( tr("Creating menu bar...")); setupActions(); splash->setMessage( tr("Creating GUI...")); createGUI(); setupMenu(); m_pActiveTabWidget->setCurrentIndex( 0 ); DCONFIG->beginGroup("TipOfDay"); bool showTips = qvariant_cast<bool>(DCONFIG->value("ShowOnStart", true )); if ( showTips ) { QTimer::singleShot(0, this, SLOT(showTipDialog())); } KTPluginManager::instance()->loadPlugins(); }
CUiAlignmentFlagPicker::CUiAlignmentFlagPicker(QWidget *parent) : QMenu(parent), m_default(Qt::AlignLeft) { setupAligns(); setupMenu(); connect(this, SIGNAL(triggered(QAction*)), this, SLOT(onActionTriggered(QAction*))); }
void TrayIcon::setupConnections() { // systray icon clicked connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); // project list changed connect(this, SIGNAL(projectListChanged()), this, SLOT(setupMenu())); }
PrefsRunProgramWidget::PrefsRunProgramWidget(QWidget *parent, Util::Settings::RunProgramConfig const &cfg) : QWidget{parent} , d_ptr{new PrefsRunProgramWidgetPrivate{}} { setupUi(cfg); setupToolTips(); setupMenu(); setupConnections(); }
ccGamepadManager::ccGamepadManager( ccMainAppInterface *appInterface, QObject *parent ) : QObject(parent) , m_appInterface(appInterface) , m_gamepadInput(nullptr) , m_menu(nullptr) , m_actionEnable(nullptr) { setupMenu(); setupGamepadInput(); //DGM:at this point we can only init the gamepadInput structure (Qt will send a signal when the gamepad is connected - at least from its point of view) }
Rocket::Rocket() : Project::Project("rocket") { app->addItem("straw", 2, "general", "straw"); app->addItem("balloon_sphere", 2, "general", "balloon"); app->addItem("balloon_long", 2, "general", "balloon"); _straw = (Straw*) addElement(new Straw(this)); _balloons = (Balloon*) addElement(new Balloon(this, _straw)); setupMenu(); }
void UI::setup(Scene *scene) { sceneList = new HierarchicalList(scene, this); grabAxis = -1; this->scene = scene; shiftDown = false; inspector.setup(); setupMenu(); enabled = false; }
FVAnimation::FVAnimation(FVBoxMgr * manager, int x, int y) : FVObject(manager,x,y) { sName = "Animation"; sType = "Animation"; cColor = fvsettings.value( classType() + "_DefaultColor", FV_DEFAULT_BOX_COLOR_ANIMATION ).value<QColor>(); tmr = 0; setupAttributes(); setupMenu(); lastPlaySpeed = tr("Turtle"); }
PomodoroTimerApplication::PomodoroTimerApplication(int& argc, char** argv) : QApplication{argc, argv}, mIdleIcon{IdleIconPath}, mSystemTrayIcon{mIdleIcon}, mFont{createFont()}, mMinutesLeft{0}, mCurrentState{PomodoroState::Idle} { setupMenu(); mSystemTrayIcon.show(); mTimer.setInterval(IconUpdateIntervalMsec); connect(&mTimer, &QTimer::timeout, this, &PomodoroTimerApplication::onTimer); }
FVBoxField::FVBoxField(FVBoxMgr * manager, Field * f, int x, int y) : FVObject(manager, x ,y ) { fvOpener = 0; fvFieldInterface = new FVFieldInterface( &field ); field = f; cColor = fvsettings.value( classType() + "_DefaultColor", FV_DEFAULT_BOX_COLOR_FIELD ).value<QColor>(); setupAttributes(); setupMenu(); rRect.setWidth( 150 ); }
/* Entrypoint */ int main(int argc, char **argv) { int result = 0; QApplication::setApplicationDisplayName("pengsh"); QApplication::setApplicationName("pengsh"); QApplication::setOrganizationName("jchadwick"); QApplication::setOrganizationDomain("jchadwick.net"); QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); settings.load(); nm = new QNetworkAccessManager(); setupActions(); setupMenu(); setupShortcuts(); if (settings.apiKey.isEmpty()) if (!loginPrompt()) return 0; trayicon = new QSystemTrayIcon(QIcon(":/icon.png")); trayicon->setContextMenu(menu); trayicon->show(); QObject::connect(trayicon, &QSystemTrayIcon::activated, &trayClicked); history(); setupMenu(); result = a.exec(); settings.flush(); return result; }
static void updateGameOver(void) { if (overAnimFrames > 0) { overAnimFrames--; if (vanishFlashFrames > 0) vanishFlashFrames--; if (gameMode == GAME_MODE_PUZZLE && overAnimFrames == 0) arduboy.stopScore2(); } else if (arduboy.buttonDown(A_BUTTON | B_BUTTON)) { if (gameMode == GAME_MODE_PUZZLE) { state = STATE_ISSUES; playSoundClick(); } else { setupMenu(); } isInvalid = true; } }
PyObject * py_guiQt_main(PyObject* self) { (void)self; // This is called from Python and replaces the main() control. // It might make sense to assert that we are the main thread. // However, there is no good cross-platform way to do this (afaik). // We could use Python... For now, we just hope that Qt behaves sane. // Anyway, on the Python side, we should have called this // in the main thread. int ret = 0; { PyScopedGIUnlock giunlock; QtApp::prepareInit(); // Keep it static. Noone should access it when we return // from here, but I like to be safe anyway. static QtApp app; setupMenu(); if(!app.openMainWindow()) { PyScopedGIL gil; PyErr_SetString(PyExc_SystemError, "guiQt.main: failed to create main window"); return NULL; } { PyScopedGIL gil; PyObject* initRet = handleModuleCommand("main", "handleApplicationInit", NULL); if(!initRet) { PyErr_SetString(PyExc_SystemError, "guiQt.main: main.handleApplicationInit() error"); return NULL; } Py_DECREF(initRet); } // Enter the Qt main event loop. ret = app.exec(); // Note that it depends on the Qt backend whether we return here or not. } PyErr_SetObject(PyExc_SystemExit, PyInt_FromLong(ret)); return NULL; }
QString upload(PuushFile file) { QDateTime time = QDateTime::currentDateTime(); QList<FormField> formData = { textField("k", settings.apiKey.toUtf8()), textField("z", "poop"), dataField("f", file.name, file.data) }; QHttpMultiPart *form = createForm(formData); QNetworkReply *reply = apiCall("/api/up", form); if (!reply) return QString(); QString replyText = QString::fromUtf8(reply->readAll()); QStringList replyParts = replyText.split(','); if (replyParts.length() < 3) { if (!replyParts.isEmpty()) { if (replyParts.first() == "-2") trayicon->showMessage(QObject::tr("Upload error."), QObject::tr("Server rejected request."), QSystemTrayIcon::Critical); else if (replyParts.first() == "-1") trayicon->showMessage(QObject::tr("Upload error."), QObject::tr("Server error."), QSystemTrayIcon::Critical); else trayicon->showMessage(QObject::tr("Upload error."), QObject::tr("Unknown server error."), QSystemTrayIcon::Critical); } else { trayicon->showMessage(QObject::tr("Upload error."), QObject::tr("Empty response."), QSystemTrayIcon::Critical); } return QString(); } recent.prepend({replyParts.at(2).toInt(), time, replyParts.at(1), file.name}); setupMenu(); QString url = replyParts.at(1); trayicon->showMessage(QObject::tr("Upload successful."), url, QSystemTrayIcon::Information, 5000); if (settings.onPuushActions & Settings::PlaySound) playSound("qrc:/notify.wav"); if (settings.onPuushActions & Settings::CopyLink) setClipboardText(url); if (settings.onPuushActions & Settings::OpenInBrowser) QDesktopServices::openUrl(url); return url; }
void MainWindow::on_actionConnect_triggered() { if (db->isOpen()) { return; } #ifndef QT_DEBUG LogInDialog dialog(this, db); if (dialog.exec() == QDialog::Rejected) { return; } #endif //QT_DEBUG #ifdef QT_DEBUG QString user = QString::fromLocal8Bit("shul20"); db->setHostName("37.53.75.87"); db->setDatabaseName("pro_print"); db->setUserName(user); db->setPassword(" "); //db->setConnectOptions("requiressl=1"); if (!db->open()) { //db->setConnectOptions(); return; } Client *client = new Client(); client->retrive("client_name", user); Client::currentClient = client; Client::currentRole = client->fields["client_role"].toInt(); #endif checkVersion(); status->start(); setupMenu(ui->menuBar, ui->mainToolBar); #ifndef QT_DEBUG /*if (Client::clientRole < UserModel::PRINT) { on_setCurrency_triggered(); }*/ #endif }
void ToolbarSearch::load() { QSettings settings; settings.beginGroup(QLatin1String("toolbarsearch")); m_recentSearches = settings.value(QLatin1String("recentSearches")).toStringList(); m_maxSavedSearches = settings.value(QLatin1String("maximumSaved"), m_maxSavedSearches).toInt(); bool useGoogleSuggest = settings.value(QLatin1String("useGoogleSuggest"), true).toBool(); if (useGoogleSuggest) { m_googleSuggest = new GoogleSuggest(this); connect(m_googleSuggest, SIGNAL(suggestions(const QStringList &, const QString &)), this, SLOT(newSuggestions(const QStringList &))); connect(this, SIGNAL(textEdited(const QString &)), this, SLOT(textEdited(const QString &))); } settings.endGroup(); setupMenu(); }
Gtk::Widget * Ganash::ApplicationWindow::setupUi() { GtkWidget *vbox; GtkWidget *menubar; GtkWidget *toolbar; GtkWidget *dockbar; GtkWidget *statusbar; vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); menubar = setupMenu()->gobj();//gtk_menu_bar_new(); toolbar = setupTool()->gobj();//gtk_toolbar_new(); dockbar = setupDock()->gobj(); statusbar = gtk_statusbar_new(); gtk_widget_set_vexpand(vbox, TRUE); gtk_widget_set_vexpand(dockbar, TRUE); //gtk_widget_set_vexpand(toolbar, FALSE); // ---------------- Gtk::Toolbar *tools = new Gtk::Toolbar(); //tools->set_property("orientation", Gtk::ORIENTATION_VERTICAL); //tools->set_property("toolbar-style", Gtk::TOOLBAR_ICONS); //tools->set_property("icon-size", Gtk::ICON_SIZE_SMALL_TOOLBAR); //tools->set_property("icon-size", Gtk::ICON_SIZE_LARGE_TOOLBAR); Gtk::ToolButton *cursor5_tool = new Gtk::ToolButton(Gtk::StockID(Ganash::Ui::Stock::SELECT)); Gtk::ToolButton *cursor6_tool = new Gtk::ToolButton(Gtk::StockID(Ganash::Ui::Stock::TRANSFORM)); tools->insert(*cursor5_tool, 0); tools->insert(*cursor6_tool, 1); // ---- gtk_container_add(GTK_CONTAINER(vbox), menubar); gtk_container_add(GTK_CONTAINER(vbox), toolbar); gtk_container_add(GTK_CONTAINER(vbox), GTK_WIDGET(tools->gobj())); gtk_container_add(GTK_CONTAINER(vbox), dockbar); //gtk_container_add(GTK_CONTAINER(vbox), statusbar); _menubar = Glib::wrap(menubar); _toolbar = Glib::wrap(toolbar); _dockbar = Glib::wrap(dockbar); _statusbar = Glib::wrap(statusbar); return Glib::wrap(vbox); }
task main() { initializeRobot(); setupMenu(); bDisplayDiagnostics = false; startTask(runMenu); waitForStart(); // Wait for the beginning of autonomous phase. stopTask(runMenu); eraseDisplay(); bDisplayDiagnostics = true; wait1Msec(delayTime*1000); //Use the variables to run your auto here }