Beispiel #1
0
/***************************************************************************
  Slot for receinving right clicks, hides messages or chat
***************************************************************************/
void info_tab::on_right_clicked()
{
  right_click_button *rcb;
  rcb = qobject_cast<right_click_button *>(sender());
  if (rcb == chat_button && !hidden_mess) {
    hide_chat(true);
  } else if (rcb == chat_button && hidden_mess) {
    hide_me();
  }
  if (rcb == msg_button && !hidden_chat) {
    hide_messages(true);
  } else if (rcb == msg_button && hidden_chat) {
    hide_me();
  }
}
Beispiel #2
0
/***************************************************************************
  Chat button was pressed
  Changes stretch value for chat (increases chat's width)
***************************************************************************/
void info_tab::activate_chat()
{
  int i;

  if (hidden_state) {
    hidden_mess = true;
    hidden_chat = false;
    hide_me();
    return;
  }
  if (hidden_mess) {
    return;
  }
  i = layout->columnStretch(6);
  i++;
  i = qMin(i, 5);
  layout->setColumnStretch(6, i);
  chat_stretch = i;
  i = layout->columnStretch(4);
  i--;
  i = qMax(i, 1);
  layout->setColumnStretch(4, i);
  msg_stretch = i;

}
Beispiel #3
0
/***************************************************************************
  info_tab constructor
***************************************************************************/
info_tab::info_tab(QWidget *parent)
{
  setParent(parent);
  setStyleSheet("QPushButton {background-color: transparent;}"
    "QPushButton {color: #038713;}"
    "QPushButton:enabled {color: #038713;}"
    "QPushButton:hover {background-color: blue;}"
    "QPushButton {min-width: 80px;}"
    "QPushButton {border: noborder;}");

  layout = new QGridLayout;
  msg_button = new right_click_button;
  msg_button->setText(_("Messages"));
  chat_button = new right_click_button;
  chat_button->setText(_("Chat"));
  hide_button = new QPushButton(
                    style()->standardIcon(QStyle::SP_ArrowDown), "");

  layout->addWidget(hide_button, 1, 0, 1, 1);
  layout->addWidget(msg_button, 1, 1, 1, 4);
  layout->addWidget(chat_button, 1, 5, 1, 5);
  msgwdg = new messagewdg(this);
  layout->addWidget(msgwdg, 0, 0, 1, 5);
  layout->setRowStretch(0, 10);
  chtwdg = new chatwdg(this);
  layout->addWidget(chtwdg, 0, 5, 1, 5);
  layout->setColumnStretch(6, 3);
  layout->setColumnStretch(4, 3);
  layout->setHorizontalSpacing(0);
  layout->setVerticalSpacing(0);
  layout->setContentsMargins(0, 0, 0, 0);
  setLayout(layout);
  hidden_chat = false;
  hidden_mess = false;
  hidden_state = false;
  layout_changed = false;
  resize_mode = false;
  connect(hide_button, SIGNAL(clicked()), SLOT(hide_me()));
  connect(msg_button, SIGNAL(clicked()), SLOT(activate_msg()));
  connect(chat_button, SIGNAL(clicked()), SLOT(activate_chat()));
  connect(msg_button, SIGNAL(right_clicked()), SLOT(on_right_clicked()));
  connect(chat_button, SIGNAL(right_clicked()), SLOT(on_right_clicked()));
  resx = false;
  resy = false;
  chat_stretch = 5;
  msg_stretch = 5;
  setMouseTracking(true);
}
Beispiel #4
0
Tasksettings::Tasksettings(Settingsstore* store, Taskaccessmanager* taskaccessmanager, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Tasksettings)
{
    ui->setupUi(this);
    my_task_uid = -1;//default value to recognize if task uid has been set already...
    storage = store;
    taskaccess = taskaccessmanager;
    taskpriority = new Taskpriority();
    taskpriority->hide();
    taskevent = new Taskevent(taskaccess);
    taskevent->hide();
    QObject::connect(ui->pushButtonBack, SIGNAL(clicked()), this, SLOT(hide_me()));
    QObject::connect(ui->pushButtonRefresh, SIGNAL(clicked()), this, SLOT(refresh_info()));
    QObject::connect(ui->pushButtonClose, SIGNAL(clicked()), this, SLOT(close_task()));
    QObject::connect(ui->pushButtonKill, SIGNAL(clicked()), this, SLOT(kill_task()));
    QObject::connect(ui->pushButtonPriority, SIGNAL(clicked()), this, SLOT(set_task_priority()));
    QObject::connect(ui->pushButtonEvent, SIGNAL(clicked()), this, SLOT(send_system_event()));

    refresh_interval = 1000;
    timer_refresh = new QTimer();
    timer_refresh->setInterval(refresh_interval);
    QObject::connect(timer_refresh, SIGNAL(timeout()), this, SLOT(refresh_stats()));
}
	/** 
	 * Create new connection 
	 * 
	 * @param io_service io_service in which this connection will work
	 * 
	 * @return pointer to newly allocated object
	 */
	static pointer create(ba::io_service& io_service) {
		return boost::make_shared<connection>(io_service, hide_me());
	}