Пример #1
0
int Form1::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: quit(); break;
        case 1: play(); break;
        case 2: musinfo(); break;
        case 3: stop(); break;
        case 4: slR(); break;
        case 5: slP(); break;
        case 6: opcje(); break;
        case 7: showplaylist(); break;
        case 8: timrefDo(); break;
        case 9: funkcje_opn(); break;
        case 10: info(); break;
        case 11: aWAV(); break;
        case 12: slAT((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 13: setVol((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 14: savMus(); break;
        case 15: nextB(); break;
        case 16: prevB(); break;
        case 17: AboutQMP(); break;
        case 18: NextXs(); break;
        case 19: volup(); break;
        case 20: voldown(); break;
        case 21: minimize(); break;
        case 22: seekP((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 23: setVolR((*reinterpret_cast< int*(*)>(_a[1]))); break;
        case 24: pwp(); break;
        case 25: pwl(); break;
        case 26: netA(); break;
        case 27: selA(); break;
        case 28: SoH(); break;
        case 29: mnuAct((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        case 30: checkUpdatesButton(); break;
        case 31: checkUpdates(); break;
        case 32: updateQVis(); break;
        case 33: BTpause(); break;
        case 34: showEq(); break;
        case 35: volMnu(); break;
        case 36: setBothVolB(); break;
        case 37: TrayMessageClicked(); break;
        case 38: showMnuOpt(); break;
        case 39: miniQMP(); break;
        case 40: showTrayMnu(); break;
        case 41: setVolFromMiniQMP((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 42: opisQMP(); break;
        case 43: resetInfoWindow(); break;
        case 44: miniVersion(); break;
        case 45: copyTitleA(); break;
        case 46: fileChanged(); break;
        default: ;
        }
        _id -= 47;
    }
    return _id;
}
Пример #2
0
void ExtractorLocator::motionCallback(Vrui::LocatorTool::MotionCallbackData* cbData)
{
    /* Update the locator: */
    bool positionChanged=locator->setPosition(cbData->currentTransformation.getOrigin());
    positionChanged=locator->setOrientation(cbData->currentTransformation.getRotation())||positionChanged;

    /* Post a seed request if the locator has moved since the last frame: */
    if(dragging&&positionChanged)
    {
        /* Bump up the seed request ID: */
        if((++lastSeedRequestID)==0) // 0 is an invalid ID
            ++lastSeedRequestID;

        if(extractor->isMaster())
        {
            /* Get extraction parameters for the current locator state from the extractor: */
            if(extractor->hasSeededCreator())
                extractor->setSeedLocator(locator);

#ifdef VISUALIZER_USE_COLLABORATION
            if(application->sharedVisualizationClient!=0)
            {
                /* Send a seed request to the shared visualization server: */
                application->sharedVisualizationClient->postSeedRequest(this,lastSeedRequestID,extractor->cloneParameters());
            }
#endif

            /* Post a seed request: */
            seedRequest(lastSeedRequestID,extractor->cloneParameters());
        }
    }

    /* Check for updates from the extraction thread: */
    ElementPointer newElement=checkUpdates();
    if(newElement!=0)
    {
        /* Add the new element to visualizer's element list: */
        application->elementList->addElement(newElement.getPointer(),extractor->getName());

        /* Pop down the busy dialog: */
        if(!(extractor->hasSeededCreator()&&extractor->hasIncrementalCreator())&&busyDialog!=0)
            Vrui::popdownPrimaryWidget(busyDialog);
    }

    /* Check for updates on long-running operations: */
    if(completionPercentageUpdated)
    {
        if(busyDialog!=0)
        {
            char percentage[10];
            snprintf(percentage,sizeof(percentage),"%5.1f",completionPercentage);
            percentageLabel->setString(percentage);
        }
        completionPercentageUpdated=false;
    }
}
Пример #3
0
void HelpDialog::createDialogContent()
{
	ui->setupUi(dialog);
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
	ui->stackedWidget->setCurrentIndex(0);
	ui->stackListWidget->setCurrentRow(0);
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

	// Kinetic scrolling
	kineticScrollingList << ui->helpBrowser << ui->aboutBrowser << ui->logBrowser;
	StelGui* gui= dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
	if (gui)
	{
		enableKineticScrolling(gui->getFlagUseKineticScrolling());
		connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));
	}


	// Help page
	updateHelpText();
	connect(ui->editShortcutsButton, SIGNAL(clicked()), this, SLOT(showShortcutsWindow()));
	connect(StelApp::getInstance().getStelActionManager(), SIGNAL(shortcutsChanged()), this, SLOT(updateHelpText()));

	// About page
	updateAboutText();

	// Log page	
	ui->logPathLabel->setText(QString("%1/log.txt:").arg(StelFileMgr::getUserDir()));
	connect(ui->stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(updateLog(int)));
	connect(ui->refreshButton, SIGNAL(clicked()), this, SLOT(refreshLog()));

	// Set up download manager for checker of updates
	networkManager = StelApp::getInstance().getNetworkAccessManager();
	updateState = CompleteNoUpdates;
	connect(ui->checkUpdatesButton, SIGNAL(clicked()), this, SLOT(checkUpdates()));
	connect(this, SIGNAL(checkUpdatesComplete(void)), this, SLOT(updateAboutText()));

	connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
}
Пример #4
0
const SysInfo *checkCIAs(PrintConsole *con) {
  TitleList *updateCIAs;
  
  int i;
  printf("Gathering CIAs, this may take several minutes...\n");
  updateCIAs = getUpdateCIAs();

  for(i = 0; i < UPDATEINFO_COUNT; i++) {
    printf("Checking for ");
    printRegionModel(&(updateInfos[i].info));
    printf(" %s", updateInfos[i].version);
    printf("...\n");
    if(checkUpdates(&(updateInfos[i]), updateCIAs, con) == 0) {
      stepFrame();
      freeTitleList(updateCIAs);
      return(&(updateInfos[i].info));
    }
    stepFrame();
  }
  
  freeTitleList(updateCIAs);
  return(NULL);
}
Пример #5
0
RouterKeygen::RouterKeygen(QWidget *parent) :
    QMainWindow(parent), ui(new Ui::RouterKeygen), manualWifi(NULL),matcher(new WirelessMatcher()),
    calculator(NULL), loading(NULL), loadingText(NULL), aboutDialog(NULL), welcomeDialog(NULL){
    ui->setupUi(this);
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
    setWindowIcon(QIcon(":/big_icon.png"));
#endif
    connect(ui->calculateButton, SIGNAL( clicked() ), this,
            SLOT( manualCalculation() ));
    connect(ui->refreshScan, SIGNAL( clicked() ), this,
            SLOT( refreshNetworks() ));
    connect(ui->supportedNetworkslist, SIGNAL( cellClicked(int,int) ), this,
            SLOT( supportedNetworkRowSelected(int,int) ));
    connect(ui->unlikelyNetworkslist, SIGNAL( cellClicked(int,int) ), this,
            SLOT( unlikelyNetworkRowSelected(int,int) ));
    connect(ui->unsupportedNetworkslist, SIGNAL( cellClicked(int,int) ), this,
            SLOT( unsupportedNetworkRowSelected(int,int) ));

    connect(ui->actionDonate,SIGNAL(triggered()), this, SLOT(donatePaypal()));
    connect(ui->actionDonate_Google_Play, SIGNAL(triggered()),this, SLOT(donateGooglePlay()) );
    connect(ui->actionFeedback, SIGNAL(triggered()), this,SLOT(feedback()));
    connect(ui->actionAbout, SIGNAL(triggered()), this,SLOT(showAboutDialog()) );
    connect(ui->actionCheck_for_Updates, SIGNAL(triggered()), this,SLOT(checkUpdates()));
    ui->actionCheck_for_Updates->setEnabled(false); //It is enabled after the automatic update check
#if defined(Q_OS_MAC)


#endif
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
    connect(ui->forceRefresh, SIGNAL( stateChanged(int) ), this,
            SLOT( forceRefreshToggle(int) ));
#else
    ui->forceRefresh->setVisible(false); // it is not needed in Windows or Mac
#endif

    wifiManager = new QWifiManager();
    connect(wifiManager, SIGNAL( scanFinished(int) ), this,
            SLOT( scanFinished(int) ));
    loadingAnim = new QMovie(":/loading.gif");
    loadingAnim->setParent(this);
    //Auto-Complete!
    wordList << "Alice-" <<  "Arcor-" << "AXTEL-" << "AXTEL-XTREMO-" << "Bbox-" <<
            "BigPond" << "Blink" << "Cabovisao-" << "CONN" << "CYTA" << "Discus--"<<
            "DLink-" << "DMAX" << "EasyBox-" << "eircom" << "FASTWEB-1-" << "INFINITUM" <<
            "InfostradaWiFi-" << "InterCable" << "JAZZTEL_" << "MAXCOM" << "Megared" <<
            "MEO-" << "O2Wireless" << "Optimus" << "OptimusFibra" << "Orange-" << "OTE" <<
            "Otenet" << "PBS" << "privat" << "ptv" << "SKY" << "SpeedTouch" << "TECOM-AH4222-" <<
            "TECOM-AH4021-" << "TeleTu" << "Thomson" << "TN_private_" << "Vodafone-" << "WiFi" <<
            "wifimedia_R-" << "WLAN_" << "WLAN" << "YaCom";
    completer = new QCompleter(wordList, this);
    completer->setCaseSensitivity(Qt::CaseInsensitive);
    completer->setCompletionMode(QCompleter::PopupCompletion);
    ui->ssidInput->setCompleter(completer);
    ui->passwordsList->installEventFilter(this);

    // build menu
    trayMenu = new QMenu(this);
    trayIcon = new QSystemTrayIcon(this);
    // set up and show the system tray icon
    trayIcon->setIcon(QIcon(":/tray_icon.png"));
    trayIcon->setContextMenu(trayMenu);
    trayIcon->show();
    
    //Set widget ration
    ui->splitterVertical->setStretchFactor(0, 3);
    ui->splitterVertical->setStretchFactor(1, 2);
    
    settings = new QSettings("Exobel", "RouterKeygen");
    bool forceRefresh = settings->value(FORCE_REFRESH, false).toBool();
    wifiManager->setForceScan(forceRefresh);
    ui->forceRefresh->setChecked(forceRefresh);
    runInBackground = settings->value(RUN_IN_BACKGROUND, false).toBool();
    runOnStartUp = settings->value(RUN_ON_START_UP, false).toBool();
    qApp->setQuitOnLastWindowClosed(!runInBackground);

    startUpAction = ui->menuPreferences->addAction(tr("Run on Start up"));
    startUpAction->setCheckable(true);
    startUpAction->setChecked(runOnStartUp);
    connect(startUpAction, SIGNAL(toggled(bool)), this,
            SLOT(startUpRunToggle(bool)));

    runInBackgroundAction = ui->menuPreferences->addAction(tr("Run in the background"));
    runInBackgroundAction->setCheckable(true);
    runInBackgroundAction->setChecked(runInBackground);
    connect(runInBackgroundAction, SIGNAL(toggled(bool)), this,
            SLOT(backgroundRunToggle(bool)));

    //Set up the tray icon
    connect(trayMenu->addAction(tr("Open")),
            SIGNAL(triggered()), this, SLOT(show()));
    trayMenu->addSeparator();
    connect(trayMenu->addAction(tr("Vulnerable networks")),
            SIGNAL(triggered()), this, SLOT(show()));
    trayMenu->addAction(tr("None were detected"))->setEnabled(false);
    trayMenu->addSeparator();
    trayMenu->addAction(startUpAction);
    trayMenu->addAction(runInBackgroundAction);
    trayMenu->addSeparator();
    connect(trayMenu->addAction(tr("Quit")), SIGNAL(triggered()), qApp, SLOT(quit()));

    //Do an initial scan
    wifiManager->startScan();

    //Check for application updates, it fails silently
    automaticUpdateCheck = true;
    checkUpdates();
}
UpdaterApplication::UpdaterApplication() : KUniqueApplication(true,true,false)
{

  int backend = UpdaterSettings::self()->backend();
  
 	if ( backend == UpdaterSettings::EnumBackend::zmd )
  {
      kdDebug() << "Using ZMD backend..." << endl;
 			updater = new ZmdUpdater();
  }
 	else if ( backend == UpdaterSettings::EnumBackend::zypp )
  {
      kdDebug() << "Using ZYPP backend..." << endl;
      updater = new ZYppUpdater();
  }
  else
  {
      kdDebug() << "No backend selected. Using ZYPP backend..." << endl;
 			updater = new ZYppUpdater();
      kdDebug() << "backend initialized" << endl;
 	}

	main = new MainWindow(updater->capabilities());
	setMainWidget(main);

	//Connects the signals 

	//Signal that controls applet state
	connect(updater, SIGNAL(updateApplet(int, int)), main, SLOT(slotAppletState(int, int)));

  connect(updater, SIGNAL(updateAppletError(const QString &)), main, SLOT(slotAppletError(const QString &)));
  
	//Signal which allows updater "plugins" to force an update refresh
	connect(updater, SIGNAL(refreshList()), main, SLOT(checkUpdates()));

	//Signal to hide selection buttons if updater doesn't pack QCheckListItems
	connect(updater, SIGNAL(disableSelectButtons()), main, SLOT(disableSelectButtons()));

	//Starts installation
	connect(main, SIGNAL(startInstall()), updater, SLOT(startInstall()));

	//Starts updater backend configuration
	connect(main, SIGNAL(configureUpdater()), updater, SLOT(configureUpdater()));

	//Start update list populate, makes backend check for updates
	connect(main, SIGNAL(populateUpdateList(QListView*)), updater, SLOT(populateUpdateList(QListView*)));

	//Signal to inform the mainwindow of new updates in the list
	connect(updater, SIGNAL(populateDone()), main, SLOT(populateDone()));

	//Signals to get backend to put together a description for selected update and to return that description
	connect(main, SIGNAL(updateSelected(QListViewItem*)), updater, SLOT(updateSelected(QListViewItem*)));
	connect(updater, SIGNAL(returnDescription(QString)), main, SLOT(gotDescription(QString)));

	//Signal to tell the backend to show a menu at the specified position
	connect(main, SIGNAL(updateMenu(QListViewItem*, const QPoint&)), updater, SLOT(updateMenu(QListViewItem*, const QPoint&)));

  // signal to tell the gui that install are allowed or not
  connect( updater, SIGNAL(installAllowed(bool)), main, SLOT(slotInstallAllowed(bool)));
  
	main->checkUpdates();

}
Пример #7
0
int main(int argc, char *argv[])
{
    QCoreApplication::setOrganizationName("SRFGames");
    QCoreApplication::setOrganizationDomain("sol-online.org"),
    QCoreApplication::setApplicationName("TrackYourTime");

#ifdef Q_OS_MAC
    QDir dir(argv[0]);
    dir.cdUp();
    QString currentDir = dir.absolutePath();
    dir.cdUp();
    dir.cd("PlugIns");
    QCoreApplication::setLibraryPaths(QStringList(dir.absolutePath()));
#endif

    QApplication a(argc, argv);
    QApplication::setQuitOnLastWindowClosed(false);

#ifdef Q_OS_MAC
    QDir::setCurrent(currentDir);
#endif


    qDebug() << "application start\n";

    cSettings settings;
    QString Language = QLocale::system().name();
    Language.truncate(Language.lastIndexOf('_'));
    Language = settings.db()->value(cDataManager::CONF_LANGUAGE_ID,Language).toString();
    if (settings.db()->value(cDataManager::CONF_FIRST_LAUNCH_ID,true).toBool()){
        settings.db()->setValue(cDataManager::CONF_FIRST_LAUNCH_ID,false);
        settings.db()->setValue(cDataManager::CONF_LANGUAGE_ID,Language);
        settings.db()->setValue(cDataManager::CONF_AUTORUN_ID,true);
        setAutorun();
        settings.db()->sync();
    }

    qDebug() << "laod translation\n";
    QTranslator translator;
    translator.load("lang_" + Language,QDir::currentPath()+"/data/languages");
    QApplication::installTranslator(&translator);

    qDebug() << "init datamanager\n";
    cDataManager datamanager;
    qDebug() << "init schedule\n";
    cSchedule schedule(&datamanager);
    qDebug() << "init updater\n";
    cUpdater updater;
    QObject::connect(&schedule,SIGNAL(checkUpdates()),&updater,SLOT(checkUpdates()));

    qDebug() << "init tray icon\n";
    cTrayIcon trIcon(&datamanager);
    QObject::connect(&datamanager, SIGNAL(trayActive()), &trIcon, SLOT(setActive()));
    QObject::connect(&datamanager, SIGNAL(traySleep()), &trIcon, SLOT(setInactive()));
    QObject::connect(&datamanager, SIGNAL(trayShowHint(QString)), &trIcon, SLOT(showHint(QString)));
    QObject::connect(&datamanager, SIGNAL(profilesChanged()), &trIcon, SLOT(onProfilesChange()));

    qDebug() << "init applications window\n";
    ApplicationsWindow applicationsWindow(&datamanager);
    QObject::connect(&trIcon, SIGNAL(showApplications()), &applicationsWindow, SLOT(showNormal()));
    QObject::connect(&datamanager, SIGNAL(profilesChanged()), &applicationsWindow, SLOT(onProfilesChange()));
    QObject::connect(&datamanager, SIGNAL(applicationsChanged()), &applicationsWindow, SLOT(onApplicationsChange()));

    qDebug() << "init profiles window\n";
    ProfilesWindow profilesWindow(&datamanager);
    QObject::connect(&applicationsWindow, SIGNAL(showProfiles()), &profilesWindow, SLOT(showNormal()));

    qDebug() << "init app settings window\n";
    App_SettingsWindow app_settingsWindow(&datamanager);
    QObject::connect(&applicationsWindow, SIGNAL(showAppSettings(int)), &app_settingsWindow, SLOT(showApp(int)));
    QObject::connect(&datamanager, SIGNAL(debugScriptResult(QString,sSysInfo)), &app_settingsWindow, SLOT(onScriptResult(QString,sSysInfo)));

    qDebug() << "init settings window\n";
    SettingsWindow settingsWindow(&datamanager);
    QObject::connect(&trIcon, SIGNAL(showSettings()), &settingsWindow, SLOT(showNormal()));
    QObject::connect(&settingsWindow, SIGNAL(preferencesChange()), &datamanager, SLOT(onPreferencesChanged()));

    qDebug() << "init schedule window\n";
    ScheduleWindow scheduleWindow(&datamanager,&schedule);
    QObject::connect(&datamanager, SIGNAL(profilesChanged()), &scheduleWindow, SLOT(rebuild()));
    QObject::connect(&trIcon, SIGNAL(showSchedule()), &scheduleWindow, SLOT(showNormal()));

    qDebug() << "init statistic window\n";
    StatisticWindow statisticWindow(&datamanager);
    QObject::connect(&trIcon, SIGNAL(showStatistic()), &statisticWindow, SLOT(showNormal()));

    qDebug() << "init about window\n";
    AboutWindow aboutWindow;
    QObject::connect(&trIcon, SIGNAL(showAbout()), &aboutWindow, SLOT(showNormal()));

    qDebug() << "init update window\n";
    UpdateAvailableWindow updateAvailableWindow;
    QObject::connect(&updater, SIGNAL(newVersionAvailable(QString)), &updateAvailableWindow, SLOT(showUpdate(QString)));
    QObject::connect(&updateAvailableWindow, SIGNAL(ignoreUpdate()), &updater, SLOT(ignoreNewVersion()));

    qDebug() << "init notification window\n";
    NotificationWindow notificationWindow(&datamanager);
    QObject::connect(&settingsWindow, SIGNAL(preferencesChange()), &notificationWindow, SLOT(onPreferencesChanged()));
    QObject::connect(&datamanager, SIGNAL(showNotification()), &notificationWindow, SLOT(onShow()));

    qDebug() << "start schedule\n";
    schedule.start();

    qDebug() << "start app loop\n";
    int result = a.exec();
    qDebug() << "application close\n";
    return result;
}