Beispiel #1
0
QAction* SpotifyService::GetNewShowConfigAction() {
  QAction* action = new QAction(IconLoader::Load("configure", 
                                IconLoader::Base),
                                tr("Configure Spotify..."), this);
  connect(action, SIGNAL(triggered()), this, SLOT(ShowConfig()));
  return action;
}
Beispiel #2
0
void MagnatuneService::EnsureMenuCreated() {
  if (context_menu_) return;

  context_menu_ = new QMenu;

  context_menu_->addActions(GetPlaylistActions());
  download_ = context_menu_->addAction(IconLoader::Load("download"),
                                       tr("Download this album"), this,
                                       SLOT(Download()));
  context_menu_->addSeparator();
  context_menu_->addAction(IconLoader::Load("download"),
                           tr("Open %1 in browser").arg("magnatune.com"), this,
                           SLOT(Homepage()));
  context_menu_->addAction(IconLoader::Load("view-refresh"),
                           tr("Refresh catalogue"), this,
                           SLOT(ReloadDatabase()));
  QAction* config_action = context_menu_->addAction(
      IconLoader::Load("configure"), tr("Configure Magnatune..."), this,
      SLOT(ShowConfig()));

  library_filter_ = new LibraryFilterWidget(0);
  library_filter_->SetSettingsGroup(kSettingsGroup);
  library_filter_->SetLibraryModel(library_model_);
  library_filter_->SetFilterHint(tr("Search Magnatune"));
  library_filter_->SetAgeFilterEnabled(false);
  library_filter_->AddMenuAction(config_action);

  context_menu_->addSeparator();
  context_menu_->addMenu(library_filter_->menu());
}
SearchBoxWidget::SearchBoxWidget(InternetService* service)
    : service_(service),
      ui_(new Ui_SearchBoxWidget),
      menu_(new QMenu(tr("Display options"), this)) {
  ui_->setupUi(this);

  // Icons
  ui_->options->setIcon(IconLoader::Load("configure", IconLoader::Base));

  // Options menu
  menu_->setIcon(ui_->options->icon());
  ui_->options->setMenu(menu_);

  menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
                   tr("Configure %1...").arg(service_->name()), service_,
                   SLOT(ShowConfig()));

  ui_->filter->setPlaceholderText(
      QString("Search on %1").arg(service_->name()));
  connect(ui_->filter, SIGNAL(textChanged(QString)),
          SIGNAL(TextChanged(QString)));

  did_you_mean_ = new DidYouMean(ui_->filter, this);
  connect(did_you_mean_, SIGNAL(Accepted(QString)), ui_->filter,
          SLOT(setText(QString)));
}
void AQEsc32ConfigWidget::btnConnectEsc32()
{
    if (!esc32) {
        QString port = portNameEsc32;
        QString baud = ui->comboBox_esc32PortSpeed->currentText();

//        if (checkAqSerialConnection(port)) {
//            QString msg = QString("WARNING: You are already connected to AutoQuad! If you continue, you will be disconnected.\n\nDo you wish to continue connecting to ESC32?").arg(port);
//            QMessageBox::StandardButton qrply = QMessageBox::warning(this, tr("Confirm Disconnect AutoQuad"), msg, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
//            if (qrply == QMessageBox::Cancel)
//                return;

//            connectedLink->disconnect();
//        }

        esc32 = new AQEsc32();
        connect(esc32, SIGNAL(Esc32Connected()), this, SLOT(Esc32Connected()));
        connect(esc32, SIGNAL(ESc32Disconnected()), this, SLOT(ESc32Disconnected()));
        connect(esc32, SIGNAL(getCommandBack(int)), this, SLOT(Esc32CaliGetCommand(int)));
        connect(esc32, SIGNAL(ShowConfig(QString)), this, SLOT(Esc32LoadConfig(QString)));
        connect(esc32, SIGNAL(Esc32ParaWritten(QString)), this, SLOT(ParaWrittenEsc32(QString)));
        connect(esc32, SIGNAL(Esc32CommandWritten(int,QVariant,QVariant)), this, SLOT(CommandWrittenEsc32(int,QVariant,QVariant)));
        connect(esc32, SIGNAL(finishedCalibration(int)), this, SLOT(Esc32CalibrationFinished(int)));
        connect(esc32, SIGNAL(GotFirmwareVersion(QString)), this, SLOT(Esc32GotFirmwareVersion(QString)));

        esc32->Connect(port, baud);
    }
Beispiel #5
0
rc_t CC KMain(int argc, char* argv[]) {
    rc_t rc = 0;

    Params prm;
    KConfig* cfg = NULL;

    if (rc == 0)
    {   rc = ParamsConstruct(argc, argv, &prm); }

    if (rc == 0) {
        rc = KConfigMake(&cfg, NULL);
        DISP_RC(rc, "while calling KConfigMake");
    }

    if (rc == 0) {
        if (prm.modeSetNode)
        {   rc = SetNode(cfg, &prm); }
        if (prm.modeShowCfg)
        {   rc = ShowConfig(cfg, &prm); }
        if (prm.modeShowFiles) {
            rc_t rc3 = ShowFiles(cfg, &prm);
            if (rc3 != 0 && rc == 0)
            {   rc = rc3; }
        }
        if (prm.modeShowModules) {
            rc_t rc3 = ShowModules(cfg, &prm);
            if (rc3 != 0 && rc == 0)
            {   rc = rc3; }
        }
        if (prm.modeShowLoadPath) {
            const char* path = NULL;
            rc_t rc3 = KConfigGetLoadPath(cfg, &path);
            if (rc3 == 0) {
                if (path != NULL && path[0])
                {   OUTMSG(("%s\n", path)); }
            }
            else if (rc == 0)
            {   rc = rc3; }
        }
    }

    if (prm.modeShowEnv)
    {   ShowEnv(&prm); }

    RELEASE(KConfig, cfg);

    if (rc == 0 && prm.modeCreate)
    {   rc = CreateConfig(argv[0]); }

    ParamsDestruct(&prm);
    return rc;
}
Beispiel #6
0
void DumpRecords()
{
BYTE item[16];
ShowConfig((*((sensor_saved_config* )&item))) ;
ShowMMRec((*((mmax  *)& item)));
ShowImuRec((*((ImuRegisters * )& item))) ;
ShowGps((*((GPS_READING  * )&item)));
ShowRC((*((DSM2_READING *)&item)));
ShowSmGps(((*(SMGPS_READING *)& item))); 
FileReporter::DumpList();
LogConfig(SensorConfig);

}
Beispiel #7
0
bool BecherConfig::Conf(HINSTANCE hInstance)
{
	if (!m_continue)
		return false;

	if (Load(v_config.GetString())!=0 || m_showdlg)
	{
		if (!ShowConfig(hInstance))
			return false;
	}

	return m_continue;
}
Beispiel #8
0
void SubsonicService::LazyPopulate(QStandardItem* item) {
  switch (item->data(InternetModel::Role_Type).toInt()) {
    case InternetModel::Type_Service:
      library_model_->Init();
      if (login_state() != LoginState_Loggedin) {
        ShowConfig();
      } else if (total_song_count_ == 0 && !load_database_task_id_) {
        ReloadDatabase();
      }
      model()->merged_model()->AddSubModel(item->index(), library_sort_model_);
      break;

    default:
      break;
  }
}
Beispiel #9
0
void SampleCfg::TypeChanged (int)
{
	IT_IT("SampleCfg::TypeChanged");
	//
	if(pCfgDriver)
	{
		CurrentTypeList.clear(); // get the list of permitted indices
		pCfgDriver->GetInputList(Type->currentText(), CurrentTypeList,Unit->currentText(),Name->text());    
		if(CurrentTypeList.count() < 1) CurrentTypeList << tr(NONE_STR); // handle empty list 
		InputIndex->clear(); // put them in the list box
		GetConfigureDb()->DoExec(this,
		"select IPINDEX from SAMPLE where UNIT='" +
		Unit->currentText() + "' and QTYPE='" + Type->currentText() + "';",tIpIndex);
	};
	
	IT_COMMENT1("Tmp Input Index %s", (const char *)tmp_ip_index);
	//
	ShowConfig();
	//
}
Beispiel #10
0
void CConfigAlarmVlost::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
	ShowConfig();
}
Beispiel #11
0
void EXPORT_CALL handle_Config(u32 id,void* w,void* p)
{
	ShowConfig((HWND)w);
}
Beispiel #12
0
SubsonicService::SubsonicService(Application* app, InternetModel* parent)
  : InternetService(kServiceName, app, parent, parent),
    network_(new QNetworkAccessManager(this)),
    url_handler_(new SubsonicUrlHandler(this, this)),
    scanner_(new SubsonicLibraryScanner(this, this)),
    load_database_task_id_(0),
    context_menu_(NULL),
    root_(NULL),
    library_backend_(NULL),
    library_model_(NULL),
    library_filter_(NULL),
    library_sort_model_(new QSortFilterProxyModel(this)),
    total_song_count_(0),
    login_state_(LoginState_OtherError),
    redirect_count_(0) {
  app_->player()->RegisterUrlHandler(url_handler_);

  connect(scanner_, SIGNAL(ScanFinished()),
          SLOT(ReloadDatabaseFinished()));

  library_backend_ = new LibraryBackend;
  library_backend_->moveToThread(app_->database()->thread());
  library_backend_->Init(app_->database(),
                         kSongsTable,
                         QString::null,
                         QString::null,
                         kFtsTable);
  connect(library_backend_, SIGNAL(TotalSongCountUpdated(int)),
          SLOT(UpdateTotalSongCount(int)));

  library_model_ = new LibraryModel(library_backend_, app_, this);
  library_model_->set_show_various_artists(false);
  library_model_->set_show_smart_playlists(false);

  library_filter_ = new LibraryFilterWidget(0);
  library_filter_->SetSettingsGroup(kSettingsGroup);
  library_filter_->SetLibraryModel(library_model_);
  library_filter_->SetFilterHint(tr("Search Subsonic"));
  library_filter_->SetAgeFilterEnabled(false);

  library_sort_model_->setSourceModel(library_model_);
  library_sort_model_->setSortRole(LibraryModel::Role_SortText);
  library_sort_model_->setDynamicSortFilter(true);
  library_sort_model_->setSortLocaleAware(true);
  library_sort_model_->sort(0);

  connect(this, SIGNAL(LoginStateChanged(SubsonicService::LoginState)),
          SLOT(OnLoginStateChanged(SubsonicService::LoginState)));

  context_menu_ = new QMenu;
  context_menu_->addActions(GetPlaylistActions());
  context_menu_->addSeparator();
  context_menu_->addAction(
      IconLoader::Load("view-refresh"),
      tr("Refresh catalogue"),
      this, SLOT(ReloadDatabase()));
  QAction* config_action = context_menu_->addAction(
      IconLoader::Load("configure"),
      tr("Configure Subsonic..."),
      this, SLOT(ShowConfig()));
  context_menu_->addSeparator();
  context_menu_->addMenu(library_filter_->menu());

  library_filter_->AddMenuAction(config_action);

  app_->global_search()->AddProvider(new LibrarySearchProvider(
      library_backend_,
      tr("Subsonic"),
      "subsonic",
      QIcon(":/providers/subsonic.png"),
      true, app_, this));
}
Beispiel #13
0
void UIManager::on_contextmenu(HWND hWndFrom)
{   //TODO:메뉴 다 지우고 설정만
    enum
    {
        ID_SETTING = 1,
        ID_RESIZE,
        ID_CONTEXT_FIRST,
        ID_CONTEXT_LAST = ID_CONTEXT_FIRST + 1000,
    };

    HMENU hMenu = CreatePopupMenu();
    AppendMenu(hMenu, MF_STRING, ID_SETTING, TEXT("설정..."));
    if(GetParent(hWndFrom) == NULL)
    {
        if(WndInstance.isResizing())
            AppendMenu(hMenu, MF_STRING | MF_CHECKED, ID_RESIZE, TEXT("크기 조절"));
        else
            AppendMenu(hMenu, MF_STRING, ID_RESIZE, TEXT("크기 조절"));
    }

    try
    {
        metadb_handle_list items;
        static_api_ptr_t<play_control> pc;
        metadb_handle_ptr handle;
        if (pc->get_now_playing(handle))
            items.add_item(handle);
        service_ptr_t<contextmenu_manager> cmm;
        contextmenu_manager::g_create(cmm);
        const bool show_shortcuts = config_object::g_get_data_bool_simple(standard_config_objects::bool_show_keyboard_shortcuts_in_menus, false);
        unsigned flags = show_shortcuts ? contextmenu_manager::FLAG_SHOW_SHORTCUTS : 0;
        cmm->init_context(items, flags);
        if (cmm->get_root())
        {
            uAppendMenu(hMenu, MF_SEPARATOR, 0, 0);
            cmm->win32_build_menu(hMenu, ID_CONTEXT_FIRST, ID_CONTEXT_LAST);
        }

        menu_helpers::win32_auto_mnemonics(hMenu);

        POINT pt;
        GetCursorPos(&pt);
        int cmd = TrackPopupMenu(hMenu, TPM_NONOTIFY | TPM_RETURNCMD | TPM_RIGHTBUTTON,
                                 pt.x, pt.y, 0, hWndFrom, 0);

        if(cmd == ID_SETTING)
            ShowConfig(hWndFrom);
        else if(cmd == ID_RESIZE)
        {
            if(WndInstance.isResizing())
                WndInstance.EndResize();
            else
                WndInstance.StartResize();
        }
        else if (cmd >= ID_CONTEXT_FIRST && cmd <= ID_CONTEXT_LAST )
            cmm->execute_by_id(cmd - ID_CONTEXT_FIRST);

    }
    catch (const exception_service_not_found &) {
    }
    DestroyMenu(hMenu);
}