BalanceWindow::BalanceWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::BalanceWindow)
{
    ui->setupUi(this);

    INFO = QSystemTrayIcon::Information;
    WARNING = QSystemTrayIcon::Warning;
    CRYTICAL = QSystemTrayIcon::Critical;


    isAuthPage = true;

    setCentralWidget(ui->verticalLayoutWidget);

    setupStatusBar();

    setupTrayIcon();


    trayMessageTimer = new QTimer();
    trayMessageTimer->setSingleShot(true);
    updateTimer = new QTimer();
    connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateBalance()));
    connect(ui->updateAction, SIGNAL(triggered()), this, SLOT(updateBalance()));

    getSettings();

    updateInfo();

    if(!d)
        updateBalance();


}
Example #2
0
TimerWindow::TimerWindow(QWidget *parent) : QMainWindow(parent) {
    qDebug("TimerWindow::TimerWindow");

    setAllowClose( false );

    setupUi(this);

    libkiIcon = QIcon(":images/libki_clock.png");

    this->setWindowIcon(libkiIcon);

    setFixedSize(width(), height()); // Prevent the window from being resized
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowMaximizeButtonHint); // Remove the maximize window button
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowSystemMenuHint); // Remove the close window button

    setupActions();
    setupTrayIcon();

    trayIconPopupTimer = new QTimer(this);
    connect(trayIconPopupTimer, SIGNAL(timeout()), this, SLOT(showSystemTrayIconTimeLeftMessage()) );


    // Disable unused features
    pauseButton->hide();

    this->move(QApplication::desktop()->screen()->rect().center()-this->rect().center());

    this->hide();
}
Example #3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    m_mutex(0),
    m_information_count(0),
    m_wifi(new Wifi()),
    m_wsettings(new WSettings()),
    m_wdevices(new WDevices()),
    m_wthread(new WThread()),
    m_translator(new QTranslator(this)),
    m_trayIcon(new QSystemTrayIcon(this)),
    m_restoreAction(new QAction(this)),
    m_quitAction(new QAction(this)),
    m_controlWifi(new QAction(this)),
    m_restartWifi(new QAction(this)),
    m_trayIconMenu(new QMenu(this))
{
    setupLanguage();
    ui->setupUi(this);

    initUIValue();
    setupTrayIcon();
    setupSignalsSlots();

    //setupDevicesForTest();
}
Example #4
0
//---------------------------------------------------------
// Implementations
//---------------------------------------------------------
//-------------------------------------
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), m_ui(new Ui::MainWindow), m_lblSongInfo(NULL) {
  m_ui->setupUi(this);
  m_ui->dockWidgetLyrics->setWindowTitle(tr("Lyrics"));
#ifdef Q_OS_WIN32
  if(QSysInfo::WindowsVersion == QSysInfo::WV_WINDOWS10)
    setStyleSheet("QToolBar { background-color: white;};");
#endif
  setupActions();
  setupTrayIcon();
  setupDockMenu();
  setupToolbar();
  connectSlots();
  restoreGeometryAndState();
  m_ui->stackedWidget->setCurrentIndex(PAGE_HOME);
  onPageChanged(PAGE_HOME);

  qApp->setWindowIcon(Icons::mellowPlayer());
  setWindowIcon(Icons::mellowPlayer());

  // Setup controllers
  new UpdateController(this);
  new PlayerController(this);
  new StreamingServicesController(this);
  new NotificationsController(this);
  new HotkeysController(this);
  new MPRIS2Controller(this);
  new LyricsController(this);
}
Example #5
0
void MainWindow::readFromConfig()
{
    //switchLanguage(NULL);

    /* read saved state */
    readSettings(&settings, false);

    toggleASQLow(ui->checkBox_asq_detectLow->isChecked());
    toggleASQHigh(ui->checkBox_asq_detectHigh->isChecked());

    toggleTransmitPilot(ui->checkBox_transmitter_pilot->isChecked());
    toggleTransmitRds(ui->checkBox_transmitter_rds->isChecked());
    toggleTransmitEnabled(ui->checkBox_transmitter_enabled->isChecked());

    toggleRDSaf(ui->checkBox_rds_useaf->isChecked());
    toggleRDSfifo(ui->checkBox_rds_fifo->isChecked());
    toggleRDSPSVisibility(ui->spinBox_rds_ps_msgs->value());
    UpdateRDSRTFileEnabled(ui->checkBox_rds_title_file->isChecked());
    UpdateRDSRTPlusEnabled();
    //updateHTTPListener();

    createLanguageMenu();
    ui->actionSelect_Language->setMenu(languageMenu);

    setupTrayIcon();
    SetWindowMode(!ui->checkBox_mini_mode->isChecked());
    SetAudioCompLimPresetByParams();

    /* actions for querier */
    if(ui->checkBox_rds_time->isChecked()) {
        querier->rdsInterval = ui->spinBox_rds_time_int->value() * 1000;
    }

    /* try to connect */
    toggleConnection(false, false);
    if(ui->checkBox_sw_autoconnect->isChecked())
        querier->timer.start();
    else {
        QStatusBar *status = statusBar();
        status->showMessage(tr("Default config editing mode..."));
        status->show();
    }

    this->adjustSize();
    this->resize(1,1);
    this->updateGeometry();

    qDebug() << __FUNCTION__;
}
Example #6
0
MainWindow::MainWindow(QWidget *widget, Qt::WFlags fl)
  : QMainWindow(widget, fl)
  , Ui::MainWindow()
{
    setupUi(this);

    Ui_MainWindow::mainToolBar->setIconSize(QSize(35, 35));

    connect(actionVolumeUp, SIGNAL(triggered()), this, SLOT(onVolumeUp()));
    connect(actionVolumeDown, SIGNAL(triggered()), this, SLOT(onVolumeDown()));
    connect(actionMute, SIGNAL(triggered()), this, SLOT(onMute()));
    connect(actionSkip, SIGNAL(triggered()), this, SLOT(onSkip()));
    connect(actionStop, SIGNAL(triggered()), this, SLOT(onStop()));
    connect(actionPlay, SIGNAL(triggered()), this, SLOT(onUnpause()));
    connect(actionPause, SIGNAL(triggered()), this, SLOT(onPause()));

    actionPlay->setVisible(false);

    connect(actionLogoutAndQuit, SIGNAL(triggered()), qApp, SLOT(logoutAndQuit()));
    connect(actionQuit, SIGNAL(triggered()), qApp, SLOT(logout()));
    connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAboutSpotfm()));

    m_settingsDlg = new SettingsDialog(this);
    connect(actionSettings, SIGNAL(triggered()), m_settingsDlg, SLOT(show()));

    Radio *radio = SpotFm::app()->radio();
    connect(radio, SIGNAL(trackStarted(Track)), this, SLOT(onTrackStarted(Track)));
    connect(radio, SIGNAL(skipsLeft(int)), this, SLOT(enableSkipButton(int)));
    connect(radio, SIGNAL(trackProgress(int)), this, SLOT(onTrackProgress(int)));
    connect(radio, SIGNAL(error(int, QString)), this, SLOT(onRadioError(int, QString)));

    connect(volumeSlider, SIGNAL(valueChanged(int)), radio, SLOT(setVolume(int)));

    connect(stationWidget, SIGNAL(clicked()), this, SLOT(onNewStation()));
    stationWidget->setFocus();

    QSettings *s = SpotFm::app()->settings();
    volumeSlider->setValue(s->value("volume", 80).toInt());
    radio->setVolume(volumeSlider->value());
    m_lastVolume = volumeSlider->value();

    defaultWindow();
    setupTrayIcon();
    loadExtensions();
}
Example #7
0
MainWindow::MainWindow(QWidget *parent, KchildlockLimits *current_limits, Consumption *my_consumption)
  : KXmlGuiWindow(parent)
{
  
  my_limits = current_limits;
  my_consumedtime = my_consumption;
  QWidget* widget = new QWidget( this );
  my_mainWidget = new Ui::UserInfoPage();
  my_mainWidget->setupUi(widget);

  setCentralWidget(widget);

  setupActions();
//  setHelpMenuEnabled(FALSE);
//  setStandardToolBarMenuEnabled(FALSE);
  setupGUI(Save);
//  setupGUI(KXmlGuiWindow::Save);
  setupTrayIcon();
  setupConnections();

}
Example #8
0
MainWindow::MainWindow(QWidget *parent) :
    QmlApplicationViewer(parent),
    m_netManager(new QNetworkAccessManager(this)),
    m_oauthTwitter(new OAuthTwitter(this)),
    m_userStream(new QTweetUserStream(this))
{
    m_oauthTwitter->setNetworkAccessManager(m_netManager);
    m_userStream->setOAuthTwitter(m_oauthTwitter);

    qApp->setOrganizationName("QTwitdget");

    connect(m_oauthTwitter, SIGNAL(authorizeXAuthFinished()), this, SLOT(authorizationFinished()));
    connect(m_oauthTwitter, SIGNAL(authorizeXAuthError()), this, SLOT(authorizationFailed()));

    m_database = QSqlDatabase::addDatabase("QSQLITE");

    setupTrayIcon();

    readSettings();

    createDeclarativeView();
}
Example #9
0
void KupDaemon::setupGuiStuff() {
	// timer to update logged time and also trigger warning if too long
	// time has now passed since last backup
	mUsageAccumulatorTimer = new QTimer(this);
	mUsageAccumulatorTimer->setInterval(KUP_USAGE_MONITOR_INTERVAL_S * 1000);
	mUsageAccumulatorTimer->start();
	KIdleTime::instance()->addIdleTimeout(KUP_IDLE_TIMEOUT_S * 1000);
	connect(KIdleTime::instance(), SIGNAL(timeoutReached(int)), mUsageAccumulatorTimer, SLOT(stop()));
	connect(KIdleTime::instance(), SIGNAL(timeoutReached(int)), KIdleTime::instance(), SLOT(catchNextResumeEvent()));
	connect(KIdleTime::instance(), SIGNAL(resumingFromIdle()), mUsageAccumulatorTimer, SLOT(start()));

	setupTrayIcon();
	setupExecutors();
	setupContextMenu();
	updateTrayIcon();

	QDBusConnection lDBus = QDBusConnection::sessionBus();
	if(lDBus.isConnected()) {
		if(lDBus.registerService(KUP_DBUS_SERVICE_NAME)) {
			lDBus.registerObject(KUP_DBUS_OBJECT_PATH, this, QDBusConnection::ExportAllSlots);
		}
	}
}
Example #10
0
QNetsoul::QNetsoul(void)
  : _network(new Network(this)), _options(new OptionsWidget(this)),
    _trayIcon(NULL), _portraitResolver(new PortraitResolver),
    _pastebin(new Pastebin), _popup(new SlidingPopup(300, 200)),
    _vdm(new VieDeMerde(this->_popup)),
    _cnf(new ChuckNorrisFacts(this->_popup)), _ping(new QTimer(this)),
    _internUpdater(new InternUpdater(this)),
    _pluginsManager(new PluginsManager)
{
  setupUi(this);
  setupTrayIcon();
  this->_pluginsManager->init(this->menuPlugins, this->_popup);
  this->_pluginsManager->loadDefaultDirectory();
  connectQNetsoulModules();
  connectActionsSignals();
  connectNetworkSignals();
  QWidget::setAttribute(Qt::WA_AlwaysShowToolTips);
  setWhatsThis(whatsThis()
               .replace("%CurrentVersion%", Tools::qnetsoulVersion())
               .replace("%Platform%", Tools::identifyPlatform(QNS_VERBOSE)));
  readSettings();
  this->tree->setOptions(this->_options);
  this->tree->setNetwork(this->_network);
  this->_network->setOptions(this->_options);
  this->tree->initTree();
  if (this->_options->mainWidget->autoConnect())
    connectToServer();
  this->_portraitResolver->addRequest(this->tree->getLoginList());
  const QString startWith = this->_options->funWidget->getStartingModule();
  if (startWith == QObject::tr("Vie de merde"))
    this->_vdm->getVdm();
  else if (startWith == QObject::tr("Chuck Norris facts"))
    this->_cnf->getFact();
  Credentials& instance = Singleton<Credentials>::Instance();
  instance.setOptions(this->_options);
  this->_internUpdater->checkLastVersion();
}
radeon_profile::radeon_profile(QStringList a,QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::radeon_profile)
{
    ui->setupUi(this);
    timer = new QTimer(this);
    execsRunning = new QList<execBin*>();

    // checks if running as root
    if (globalStuff::grabSystemInfo("whoami")[0] == "root") {
         globalStuff::globalConfig.rootMode = true;
        ui->label_rootWarrning->setVisible(true);
    } else {
        globalStuff::globalConfig.rootMode = false;
        ui->label_rootWarrning->setVisible(false);
    }

    // setup ui elemensts
    ui->mainTabs->setCurrentIndex(0);
    ui->tabs_systemInfo->setCurrentIndex(0);
    ui->configGroups->setCurrentIndex(0);
    ui->list_currentGPUData->setHeaderHidden(false);
    ui->execPages->setCurrentIndex(0);
    setupGraphs();
    setupForcePowerLevelMenu();
    setupOptionsMenu();
    setupContextMenus();
    setupTrayIcon();

    loadConfig();

    //figure out parameters
    QString params = a.join(" ");
    if (params.contains("--driver xorg")) {
        device.driverByParam(gpu::XORG);
        ui->combo_gpus->addItems(device.initialize(true));
    }
    else if (params.contains("--driver fglrx")) {
        device.driverByParam(gpu::FGLRX);
        ui->combo_gpus->addItems(device.initialize(true));
    }
    else // driver object detects cards in pc and fill the list in ui //
        ui->combo_gpus->addItems(device.initialize());

    ui->configGroups->setTabEnabled(2,device.daemonConnected());
    setupUiEnabledFeatures(device.features);

    if(ui->cb_enableOverclock->isChecked() && ui->cb_overclockAtLaunch->isChecked())
        ui->btn_applyOverclock->click();


    connectSignals();

    // timer init
    timer->setInterval(ui->spin_timerInterval->value()*1000);

    // fill tables with data at the start //
    refreshGpuData();
    ui->list_glxinfo->addItems(device.getGLXInfo(ui->combo_gpus->currentText()));
    ui->list_connectors->addTopLevelItems(device.getCardConnectors());
    ui->list_connectors->expandToDepth(2);
    ui->list_modInfo->addTopLevelItems(device.getModuleInfo());
    refreshUI();

    timer->start();
    addRuntimeWidgets();

    showWindow();
}
Example #12
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    pDetectorProgress = NULL;
    mLogAllXmlRpcOutput = false;
    mDbUpdated = false;
    // mSyncRequests tracks how many sync requests have been made
    // in order to know when to re-enable the widgets
    mSyncRequests = 0;
    // mSyncPosition is used to iterate through the backend list,
    // so we only sync one repository at a time, rather than flinging
    // requests at all of them at once.
    mSyncPosition = 0;
    mUploading = false;
    QSettings settings("Entomologist");

    pManager = new QNetworkAccessManager();
    connect(pManager, SIGNAL(sslErrors(QNetworkReply *, const QList<QSslError> &)),
            this, SLOT(handleSslErrors(QNetworkReply *, const QList<QSslError> &)));

    ui->setupUi(this);

    QToolBar *toolBar = new QToolBar("Main Toolbar");
    toolBar->setObjectName("Main ToolBar");
    toolBar->setIconSize(QSize(32,32));
    refreshButton = toolBar->addAction(style()->standardIcon(QStyle::SP_BrowserReload), "");
    refreshButton->setToolTip("Resync all trackers");
    uploadButton = toolBar->addAction(style()->standardIcon(QStyle::SP_ArrowUp), "");
    uploadButton->setToolTip("Upload changes");
    changelogButton = toolBar->addAction(style()->standardIcon(QStyle::SP_FileDialogInfoView), "");
    changelogButton->setToolTip("Show changelog");
    toolBar->setMovable(false);
    addToolBar(Qt::TopToolBarArea, toolBar);


    setupTrayIcon();
    // Setup the "Show" menu and "Work Offline"
    ui->actionMy_Bugs->setChecked(settings.value("show-my-bugs", true).toBool());
    ui->actionMy_Reports->setChecked(settings.value("show-my-reports", true).toBool());
    ui->actionMy_CCs->setChecked(settings.value("show-my-ccs", true).toBool());
    ui->actionMonitored_Components->setChecked(settings.value("show-my-monitored", true).toBool());
    ui->action_Work_Offline->setChecked(settings.value("work-offline", false).toBool());

    // Set the default network status
    pStatusIcon = new QLabel();
    pStatusIcon->setPixmap(QPixmap(":/online"));
    pStatusMessage = new QLabel("");
    ui->statusBar->addPermanentWidget(pStatusMessage);
    ui->statusBar->addPermanentWidget(pStatusIcon);

    // We use a spinner animation to show that we're doing things
    pSpinnerMovie = new QMovie(this);
    pSpinnerMovie->setFileName(":/spinner");
    pSpinnerMovie->setScaledSize(QSize(48,48));
    ui->spinnerLabel->setMovie(pSpinnerMovie);
    ui->spinnerLabel->hide();
    ui->syncingLabel->hide();

    // Set up the resync timer
    pUpdateTimer = new QTimer(this);
    connect(pUpdateTimer, SIGNAL(timeout()),
            this, SLOT(resync()));
    setTimer();

    // Keyboard shortcuts for search bar focus / upload changes.
    QShortcut* searchFocus;
    QShortcut* uploadChange;
    QShortcut *logXmlRpc;

    searchFocus = new QShortcut(QKeySequence(Qt::META + Qt::Key_Space),this);
    searchFocus->setContext(Qt::ApplicationShortcut);
    connect(searchFocus,SIGNAL(activated()),this,SLOT(searchFocusTriggered()));

    uploadChange = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_S),this);
    uploadChange->setContext(Qt::ApplicationShortcut);
    connect(uploadChange,SIGNAL(activated()),this,SLOT(upload()));

    logXmlRpc = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_0), this);
    logXmlRpc->setContext(Qt::ApplicationShortcut);
    connect(logXmlRpc, SIGNAL(activated()), this, SLOT(toggleXmlRpcLogging()));

    // Menu actions
    connect(ui->action_Add_Tracker, SIGNAL(triggered()),
            this, SLOT(addTrackerTriggered()));
    connect(ui->action_Refresh_Tracker,SIGNAL(triggered()),
            this, SLOT(resync()));
    connect(ui->actionShow_ToDo_List, SIGNAL(triggered()),
            this, SLOT(showTodoList()));
    connect(ui->action_About, SIGNAL(triggered()),
            this, SLOT(aboutTriggered()));
    connect(ui->action_Web_Site, SIGNAL(triggered()),
            this, SLOT(websiteTriggered()));
    connect(ui->action_Preferences, SIGNAL(triggered()),
            this, SLOT(prefsTriggered()));
    connect(ui->action_Quit, SIGNAL(triggered()),
            this, SLOT(quitEvent()));
    connect(ui->actionMy_Bugs, SIGNAL(triggered()),
            this, SLOT(showActionTriggered()));
    connect(ui->actionMy_CCs, SIGNAL(triggered()),
            this, SLOT(showActionTriggered()));
    connect(ui->actionMy_Reports, SIGNAL(triggered()),
            this, SLOT(showActionTriggered()));
    connect(ui->actionMonitored_Components, SIGNAL(triggered()),
            this, SLOT(showActionTriggered()));
    connect(ui->actionEdit_Monitored_Components, SIGNAL(triggered()),
            this, SLOT(showEditMonitoredComponents()));
    connect(ui->action_Work_Offline, SIGNAL(triggered()),
            this, SLOT(workOfflineTriggered()));

    // Set up the search button
    connect(changelogButton, SIGNAL(triggered()),
            this, SLOT(changelogTriggered()));

    connect(ui->trackerTab, SIGNAL(showMenu(int)),
            this, SLOT(showMenu(int)));
    ui->trackerTab->removeTab(0);
    ui->trackerTab->removeTab(0);

    // And finally set up the various other widgets
    connect(refreshButton, SIGNAL(triggered()),
            this, SLOT(resync()));
    connect(uploadButton, SIGNAL(triggered()),
            this, SLOT(upload()));
    restoreGeometry(settings.value("window-geometry").toByteArray());
    // Set the network status bar and check for updates if possible
    if (isOnline())
        if (settings.value("update-check", true).toBool() == true)
            checkForUpdates();

    setupDB();
    toggleButtons();

    // Now we need the todo list widget
    pToDoDock = new QDockWidget(tr("ToDo List"), this);
    pToDoDock->setObjectName("ToDoDock");
    pToDoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    pToDoListWidget = new ToDoListWidget(pToDoDock);
    pToDoDock->setWidget(pToDoListWidget);
    addDockWidget(Qt::LeftDockWidgetArea, pToDoDock);
    pToDoDock->hide();
    restoreState(settings.value("entomologist-state").toByteArray());
    connect(pToDoDock, SIGNAL(visibilityChanged(bool)),
            this, SLOT(dockVisibilityChanged(bool)));
    if (pToDoDock->isVisible())
        ui->actionShow_ToDo_List->setText("Hide ToDo List");
    else
        ui->actionShow_ToDo_List->setText("Show ToDo List");

    pSearchTab = new SearchTab(this);
    connect(pSearchTab, SIGNAL(openSearchedBug(QString,QString)),
            this, SLOT(openSearchedBug(QString,QString)));

    loadTrackers();
    ui->trackerTab->addTab(pSearchTab, QIcon(":/search"), "Search");

    if ((settings.value("startup-sync", false).toBool() == true)
       || (mDbUpdated))
        syncNextTracker();
}