コード例 #1
0
void 
StartWindow::list_users()
{
	this->hide();

	// we're going to look up existing profiles in the users/ directory
	QDir *cur = new QDir(QDir::currentPath()+"/users/");

	// shows only files
	cur->setFilter(QDir::Files);
	bool ok;
	QString username = QInputDialog::getItem(0, 
						 tr("Profile selection"),
						 tr("Please pick a profile"),
						 cur->entryList(),
						 0,
						 false,
						 &ok);	
	
	if(ok) {
		emit(send_user(username));
	} else {
		this->show();
	}
}
コード例 #2
0
ファイル: GaugeFLARM.cpp プロジェクト: galippi/xcsoar
void
GaugeFLARM::Update(bool enable, const NMEA_INFO &gps_info,
                   const SETTINGS_TEAMCODE &settings)
{
  // If FLARM alarm level higher then 0
  if (gps_info.flarm.FLARM_AlarmLevel > 0)
    // Show FLARM gauge and do not care about suppression
    Suppress = false;

  bool visible = ForceVisible ||
    (gps_info.flarm.FLARMTraffic && enable && !Suppress);
  if (visible) {
    FlarmTrafficWindow::Update(gps_info.TrackBearing, gps_info.flarm,
                               settings);
    send_user(MSG_SHOW);
  } else
    send_user(MSG_HIDE);
}
コード例 #3
0
GameSession::GameSession() 
{
	start = new StartWindow();

	center_widget(start);
	
	connect(start, 
		SIGNAL(send_user(QString)),
		this, 
		SLOT(show_user(QString)));
}
コード例 #4
0
void 
StartWindow::new_user_profile()
{
	this->hide();
	bool response;
	QString username = QInputDialog::getText(0, tr("New profile"),
						 tr("Please enter a name : "), 
						 QLineEdit::Normal,
						 tr("Your name"), &response); 
	if (response) {
		emit(send_user(username));
	} else {
		this->show();
	}
}
コード例 #5
0
ファイル: browse.c プロジェクト: khaytsus/opennap-ng
static void browse_callback(DATUM * info, BROWSE * ctx)
{
    /* avoid flooding the client */
    if(ctx->max == 0 || ctx->count < ctx->max)
    {
        send_user(ctx->sender, MSG_SERVER_BROWSE_RESPONSE,"%s \"%s\" %s %u %hu %hu %hu", info->user->nick, info->filename,
#if RESUME
            info->hash,
#else
            "00000000000000000000000000000000",
#endif
            info->size, BitRate[info->bitrate], SampleRate[info->frequency], info->duration);

        ctx->count++;
    }
}
コード例 #6
0
ファイル: fct_send_msg.c プロジェクト: marchah/myirc
void		send_all_users(t_msg ***msg, t_channel *channel,
			       int id, char *str)
{
  int		j;
  int		pos_dest;

  j = 0;
  while (j != MAX_FD)
    {
      if (g_env.fd_type[j] == FD_CLIENT && channel->id[j]
	  != UNUSED && (pos_dest = find_id_msg(j, *msg)) != UNUSED)
	{
	  (*msg)[pos_dest]->buffer = send_channel((*msg)[pos_dest]->buffer,
						  channel->name, '\0');
	  (*msg)[pos_dest]->buffer = send_user((*msg)[pos_dest]->buffer,
					       g_env.name[id], ' ', E_TRUE);
	  (*msg)[pos_dest]->buffer = add_msg((*msg)[pos_dest]->buffer,
					     str, '\0');
	}
      j = j + 1;
    }
}
コード例 #7
0
ファイル: MainWindow.hpp プロジェクト: macsux/XCSoar
 void SendCalculatedUpdate() {
   send_user(CMD_CALCULATED_UPDATE);
 }
コード例 #8
0
ファイル: MainWindow.hpp プロジェクト: macsux/XCSoar
 /**
  * A new airspace warning was found.  This method sends the
  * CMD_AIRSPACE_WARNING command to this window, which displays the
  * airspace warning dialog.
  */
 void SendAirspaceWarning() {
   airspace_warning_pending = true;
   send_user(CMD_AIRSPACE_WARNING);
 }
コード例 #9
0
ファイル: botifex.c プロジェクト: scosu/botifex
void *irc_event_privmsg(irc_conn_t *c, struct irc_message *m)
{
	if (m->suffix[0] == '\001')
		return NULL;
	char buf[128];
	switch (bot_cmds_parse_msg(&boti, c, m)) {
	case -2:
		strcpy(buf, "ERROR not authorized");
		goto error_send;
	case -1:
		strcpy(buf, "ERROR command requires other parameters");
		goto error_send;
	case 0:
		strcpy(buf, "DONE");
error_send:
		if (m->middle[0] != '#') {
			struct bot_message bm = {
					.src = NULL,
					.dst = m->source,
					.msg = buf
			};
			send_user((void*) c, &bm);
		} else {
			struct bot_message bm = {
					.src = NULL,
					.dst = m->middle,
					.msg = buf
			};
			send_channel((void*) c, &bm);
		}
		return NULL;
	default:
		break;
	}
	bot_know_t *bot = boti.know;
	struct bot_message msg = {m->source, m->middle, m->suffix};
	if (m->middle[0] != '#') {
		bot_know_user_msg(bot, &msg, (void *) c);
		return NULL;
	} else {
		if (msg.msg[0] == '!') {
			++msg.msg;
			bot_know_channel_msg(bot, &msg, (void *) c, 1);
		} else {
			bot_know_channel_msg(bot, &msg, (void *) c, 0);
		}
	}

	return NULL;
}

void *send_channel(void *user_data, struct bot_message *m)
{
	if(user_data == NULL) {
		return NULL;
	}
#ifdef IRC
	irc_privmsg((irc_conn_t *) user_data, m->dst, m->msg);
#endif
	return NULL;
}

void *send_user(void *user_data, struct bot_message *m)
{
	irc_privmsg((irc_conn_t *) user_data, m->dst, m->msg);
	return NULL;
}
コード例 #10
0
ファイル: MainWindow.hpp プロジェクト: davidswelt/XCSoar
 void SendGPSUpdate() {
   send_user(CMD_GPS_UPDATE);
 }