コード例 #1
0
ファイル: tab_logs.cpp プロジェクト: DINKIN/Cockatrice
TabLog::TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent)
    : Tab(_tabSupervisor, parent), client(_client)
{
    roomTable = new QTableWidget();
    roomTable->setColumnCount(6);
    roomTable->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    roomTable->setHorizontalHeaderLabels(QString(tr("Time;SenderName;SenderIP;Message;TargetID;TargetName")).split(";"));

    gameTable = new QTableWidget();
    gameTable->setColumnCount(6);
    gameTable->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    gameTable->setHorizontalHeaderLabels(QString(tr("Time;SenderName;SenderIP;Message;TargetID;TargetName")).split(";"));

    chatTable = new QTableWidget();
    chatTable->setColumnCount(6);
    chatTable->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    chatTable->setHorizontalHeaderLabels(QString(tr("Time;SenderName;SenderIP;Message;TargetID;TargetName")).split(";"));

    QTabWidget *tabManager = new QTabWidget();
    tabManager->addTab(roomTable, tr("Room Logs"));
    tabManager->addTab(gameTable, tr("Game Logs"));
    tabManager->addTab(chatTable, tr("Chat Logs"));
    setCentralWidget(tabManager);

    createDock();
    restartLayout();
    clearClicked();
    retranslateUi();
}
コード例 #2
0
LocationEditor::LocationEditor(QWidget *parent) :
    QToolButton(parent)
{
    QPalette pal;
    pal.setColor(backgroundRole(), QPalette::Base);
    setPalette(pal);

    this->setFont(global.getGuiFont(font()));

    inactiveColor = "QToolButton {background-color: transparent; border-radius: 0px; border:none; margin 0px; padding: 4px} ";
    this->setCursor(Qt::PointingHandCursor);
    this->setStyleSheet(inactiveColor);

    defaultText = QString(tr("Click to set location..."));
    this->setText(defaultText);
    actionMenu = new QMenu();
    editAction = actionMenu->addAction(tr("Edit..."));
    clearAction = actionMenu->addAction(tr("Clear"));
    viewAction = actionMenu->addAction(tr("View on map"));
    connect(editAction, SIGNAL(triggered()), this, SLOT(buttonClicked()));
    connect(viewAction, SIGNAL(triggered()), this, SLOT(viewClicked()));
    connect(clearAction, SIGNAL(triggered()), this, SLOT(clearClicked()));
    setAutoRaise(false);
    setMenu(actionMenu);
    this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    this->reloadIcons();
    connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));

    hide();
}
コード例 #3
0
ファイル: onyx_search_dialog.cpp プロジェクト: qbikez/booxsdk
void OnyxSearchDialog::onItemActivated(CatalogView *catalog,
                                   ContentView *item,
                                   int user_data)
{
    OData * item_data = item->data();
    if (item_data->contains(TAG_MENU_TYPE))
    {
        int menu_type = item->data()->value(TAG_MENU_TYPE).toInt();
        if(OnyxKeyboard::KEYBOARD_MENU_OK == menu_type)
        {
            onSearchClicked();
        }
        else if(OnyxKeyboard::KEYBOARD_MENU_CLEAR == menu_type)
        {
            clearClicked();
            update();
            onyx::screen::watcher().enqueue(this, onyx::screen::ScreenProxy::DW);
        }
        else if (SEARCH_NAV_PREVIOUS == menu_type)
        {
            onSearchPrevClicked();
        }
        else if (SEARCH_NAV_NEXT == menu_type)
        {
            onSearchNextClicked();
        }
    }
}
コード例 #4
0
ファイル: MainWindow.cpp プロジェクト: FITLab-Swansea/xkeys
MainWindow::MainWindow(QWidget *parent)
	: QDialog(parent),
	handle(-1),
	keyboard(false),
	joystick(false),
	mouseon(false),
	lastprogsw(false)
{
	g_main_window = this; // HACK

	setupUi(this);

	connect(start_button, SIGNAL(clicked(bool)), this, SLOT(startButtonClicked(bool)));
	connect(stop_button, SIGNAL(clicked()), this, SLOT(stopButtonClicked()));
	connect(quit_button, SIGNAL(clicked()), this, SLOT(quitButtonClicked()));
	connect(clear_button, SIGNAL(clicked()), this, SLOT(clearClicked()));

	// LED controls
	connect(green_check, SIGNAL(clicked(bool)), this, SLOT(greenCheckClicked(bool)));
	connect(red_check, SIGNAL(clicked(bool)), this, SLOT(redCheckClicked(bool)));
	connect(flash_green_check, SIGNAL(clicked(bool)), this, SLOT(flashGreenCheckClicked(bool)));
	connect(flash_red_check, SIGNAL(clicked(bool)), this, SLOT(flashRedCheckClicked(bool)));
	connect(flash_freq, SIGNAL(textChanged(const QString &)), this, SLOT(flashFrequencyChanged(const QString &)));

	// Backlight
	connect(backlight_on_off, SIGNAL(clicked(bool)), this, SLOT(backlightOnOffClicked(bool)));
	connect(backlight_flash, SIGNAL(clicked(bool)), this, SLOT(backlightFlashClicked(bool)));
	connect(backlight_bank1_all, SIGNAL(clicked(bool)), this, SLOT(backlightBank1AllClicked(bool)));
	connect(backlight_bank2_all, SIGNAL(clicked(bool)), this, SLOT(backlightBank2AllClicked(bool)));
	connect(backlight_scroll_lock, SIGNAL(clicked(bool)), this, SLOT(backlightScrollLockClicked(bool)));
	connect(backlight_toggle, SIGNAL(clicked()), this, SLOT(backlightToggle()));
	connect(backlight_set_intensity, SIGNAL(clicked()), this, SLOT(backlightSetIntensity()));
	connect(backlight_save, SIGNAL(clicked()), this, SLOT(backlightSave()));

	// PID controls
	connect(convert_pid1, SIGNAL(clicked()), this, SLOT(convertPID1Clicked()));
	connect(convert_pid2, SIGNAL(clicked()), this, SLOT(convertPID2Clicked()));
	connect(show_descriptor, SIGNAL(clicked()), this, SLOT(showDescriptorClicked()));
	connect(generate_report, SIGNAL(clicked()), this, SLOT(generateReportClicked()));
	
	// Timestamp
	connect(timestamp_on, SIGNAL(clicked()), this, SLOT(timestampOnClicked()));
	connect(timestamp_off, SIGNAL(clicked()), this, SLOT(tiemstampOffClicked()));

	// Reflector Controls
	connect(keyboard_reflector, SIGNAL(clicked()), this, SLOT(keyboardReflectorClicked()));
	connect(joystick_reflector, SIGNAL(clicked()), this, SLOT(joystickReflectorClicked()));
	connect(mouse_reflector, SIGNAL(clicked()), this, SLOT(mouseReflectorClicked()));

	// Connect our append() signal to the output box's append() slot.
	// This is so we can append to the output box from the callback
	// thread.
	connect(this, SIGNAL(append(const QString &)), output_box, SLOT(append(const QString &)));

	connect(this, SIGNAL(messageBox(const QString &, const QString &)),
	        this, SLOT(showMessageBox(const QString &, const QString&)));

}
コード例 #5
0
ShortcutCaptureDialog::ShortcutCaptureDialog(Shortcut* _s, QMap<QString, Shortcut*> ls, QWidget* parent)
   : QDialog(parent)
      {
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      localShortcuts = ls;
      s = _s;

      addButton->setEnabled(false);
      replaceButton->setEnabled(false);
      oshrtLabel->setText(s->keysToString());
      oshrtLabel->setEnabled(false);
      connect(clearButton, SIGNAL(clicked()), SLOT(clearClicked()));
      connect(addButton, SIGNAL(clicked()), SLOT(addClicked()));
      connect(replaceButton, SIGNAL(clicked()), SLOT(replaceClicked()));
      clearClicked();

      nshrtLabel->installEventFilter(this);
      }
コード例 #6
0
ファイル: UberCalc.cpp プロジェクト: IgorOzernykh/HomeTask
void UberCalc::connectButtons()
{
    numberMapper->setMapping(ui->Num_0, QString::number(0));
    numberMapper->setMapping(ui->Num_1, QString::number(1));
    numberMapper->setMapping(ui->Num_2, QString::number(2));
    numberMapper->setMapping(ui->Num_3, QString::number(3));
    numberMapper->setMapping(ui->Num_4, QString::number(4));
    numberMapper->setMapping(ui->Num_5, QString::number(5));
    numberMapper->setMapping(ui->Num_6, QString::number(6));
    numberMapper->setMapping(ui->Num_7, QString::number(7));
    numberMapper->setMapping(ui->Num_8, QString::number(8));
    numberMapper->setMapping(ui->Num_9, QString::number(9));
    numberMapper->setMapping(ui->dot, QString("."));

    connect (ui->Num_0, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_1, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_2, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_3, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_4, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_5, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_6, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_7, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_8, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->Num_9, SIGNAL (clicked()), numberMapper, SLOT (map()));
    connect (ui->dot, SIGNAL (clicked()), numberMapper, SLOT(map()));


    operationMapper->setMapping(ui->Composition, QString("+"));
    operationMapper->setMapping(ui->Subtraction, QString("-"));
    operationMapper->setMapping(ui->Multiplication, QString("*"));
    operationMapper->setMapping(ui->Division, QString("/"));

    connect (ui->Composition, SIGNAL (clicked()), operationMapper, SLOT(map()));
    connect (ui->Subtraction, SIGNAL (clicked()), operationMapper, SLOT(map()));
    connect (ui->Multiplication, SIGNAL (clicked()), operationMapper, SLOT(map()));
    connect (ui->Division, SIGNAL (clicked()), operationMapper, SLOT(map()));

    connect (ui->Equal, SIGNAL (clicked()), this, SLOT (equalClicked()));
    connect (ui->clear, SIGNAL (clicked()), this, SLOT (clearClicked()));
    connect (ui->plus_minus, SIGNAL (clicked()), this, SLOT (plus_minusClicked()));
    connect (ui->MemSave, SIGNAL (clicked()), this, SLOT (MemSaveClicked()));
    connect (ui->MemRest, SIGNAL (clicked()), this, SLOT (MemRestClicked()));

    connect(numberMapper, SIGNAL(mapped(QString)), this, SLOT (addToResultLine(QString)));
    connect(operationMapper, SIGNAL(mapped(QString)), this, SLOT(operationClicked(QString)));
}
コード例 #7
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
{
    for (int i=0;i<9;++i)
        for(int j=0;j<9;++j)
        {
            square[i][j] = new QPushButton("",this);
            connect(square[i][j],SIGNAL(released()),this,SLOT(squareClicked()));
        }

    for (int i=0;i<9;++i)
    {
        number[i]=new QPushButton(QString::number(i+1),this);
        connect(number[i],SIGNAL(released()),this,SLOT(numberClicked()));
    }

    emtyButton = new QPushButton("Emty",this);
    emtyButton->setGeometry(QRect(QPoint(25,460),QSize(150,40)));
    connect(emtyButton,SIGNAL(released()),this,SLOT(emtyClicked()));

    solveButton = new QPushButton("Solve",this);
    solveButton->setGeometry(QRect(QPoint(200,340),QSize(115,67)));
    connect(solveButton,SIGNAL(released()),this,SLOT(solveClicked()));

    clearButton = new QPushButton("Clear",this);
    clearButton->setGeometry(QRect(QPoint(200,433),QSize(115,67)));
    connect(clearButton,SIGNAL(released()),this,SLOT(clearClicked()));

    redText = new QPalette();
    redText->setColor(QPalette::ButtonText,Qt::red);

    blueText = new QPalette();
    blueText->setColor(QPalette::ButtonText,Qt::blue);

    blackText = new QPalette();
    blackText->setColor(QPalette::ButtonText,Qt::black);

    setSquareGeo();
    setNumberGeo();
}
コード例 #8
0
void OnyxKeyboardDialog::onItemActivated(CatalogView *catalog,
                                   ContentView *item,
                                   int user_data)
{
    OData * item_data = item->data();
    if (item_data->contains(TAG_MENU_TYPE))
    {
        int menu_type = item->data()->value(TAG_MENU_TYPE).toInt();
        if(OnyxKeyboard::KEYBOARD_MENU_OK == menu_type)
        {
            input_text_ = getText();
            accept();
        }
        else if(OnyxKeyboard::KEYBOARD_MENU_CLEAR == menu_type)
        {
            input_text_ = "";
            clearClicked();
            update();
            onyx::screen::watcher().enqueue(this, onyx::screen::ScreenProxy::DW);
        }
    }
}
コード例 #9
0
Message::Message(QColor base,unsigned hang_time,
		 QWidget *parent,const char *name)
  : QWidget(parent,name)
{
  msg_base_color=base;
  msg_hang_time=hang_time;
  msg_hanging=false;
  msg_send_lines=2;

  //
  // The Send Box
  //
  msg_send_box=new SendMsgTextEdit(this);
  connect(msg_send_box,SIGNAL(messageSent()),this,SLOT(sendData()));

  //
  // The Receive Box
  //
  msg_rcv_box=new MsgTextEdit(this);
  connect(msg_rcv_box,SIGNAL(doubleClicked()),
	  this,SLOT(doubleClickedData()));
  connect(msg_rcv_box,SIGNAL(nicknameChanged(const QString &)),
	  this,SLOT(nicknameChangedData(const QString &)));
  connect(msg_rcv_box,SIGNAL(clearClicked()),this,SLOT(clearClickedData()));

  //
  // The Backdrop
  //
  //  msg_backdrop_label=new QLabel(this);
  //DrawBackdrop();
  //msg_backdrop_label->hide();

  //
  // The Hang Timer
  //
  msg_hang_timer=new QTimer(this);
  connect(msg_hang_timer,SIGNAL(timeout()),this,SLOT(timerData()));
}
コード例 #10
0
/*
 *  Constructs a ObjectBrowser which is a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ObjectBrowserWidget::ObjectBrowserWidget(QWidget* parent, const char* name, Qt::WFlags fl, int state)
    : QWidget(parent, name, fl),
    objectItemList(NULL),
    refreshList(NULL),
    ObjectBrowserLayout(NULL),
    clearButton(NULL),
    toggleViewButton(NULL),
    commitButton(NULL),
    ObjectListView(NULL),
    Line1(NULL),
    spacer(NULL),
    ObjectItemText(NULL),
    mOutputObjectVector(NULL),
    currentPage(LISTVIEWPAGE)
{
  if (!name)
    setName("ObjectBrowser");

  if (state == 0)
    ObjectBrowserLayout = new Q3GridLayout(this, 1, 1, 0, -1, "ObjectBrowserLayout");
  else
    ObjectBrowserLayout = new Q3GridLayout(this, 2, 4, 0, 6, "ObjectBrowserLayout");

  ObjectBrowserLayout->setAutoAdd(false);
  ObjectListView = new Q3ListView(this, "ObjectListView");
  //  ObjectListView->addColumn(trUtf8("Object Browser"));
  ObjectListView->addColumn(trUtf8("Name"));
  ObjectListView->addColumn(trUtf8("Type"));
  ObjectListView->header()->setClickEnabled(false, ObjectListView->header()->count() - 1);
  ObjectListView->setAcceptDrops(false);
  ObjectListView->setResizeMode(Q3ListView::LastColumn);
  ObjectListView->setTreeStepSize(19);
  //  ObjectListView->setSorting(-1);
  ObjectListView->setSelectionMode(Q3ListView::NoSelection);

  ObjectItemText = new Q3TextEdit(this, "ObjectItemText");
  ObjectItemText ->hide();

  ObjectBrowserLayout->addMultiCellWidget(ObjectListView, 0, 0, 0, 3);
  ObjectBrowserLayout->addMultiCellWidget(ObjectItemText, 0, 0, 0, 3);

  if (state != 0)
    {
      Line1 = new Q3Frame(this, "Line1");
      Line1->setFrameShape(Q3Frame::HLine);
      Line1->setFrameShadow(Q3Frame::Sunken);
      Line1->setFrameShape(Q3Frame::HLine);

      ObjectBrowserLayout->addMultiCellWidget(Line1, 1, 1, 0, 3);

      clearButton = new QPushButton(this, "clearButton");
      clearButton->setText(trUtf8("Clear"));
      ObjectBrowserLayout->addWidget(clearButton, 2, 0);

      commitButton = new QPushButton(this, "commitButton");
      commitButton->setText(trUtf8("Commit"));
      ObjectBrowserLayout->addWidget(commitButton, 2, 3);

      toggleViewButton = new QPushButton(this, "toggleViewButton");
      toggleViewButton->setText(trUtf8("Selected Items"));
      ObjectBrowserLayout->addWidget(toggleViewButton, 2, 2);

      spacer = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
      ObjectBrowserLayout->addItem(spacer, 2, 1);

      // signals and slots connections
      connect(clearButton, SIGNAL(clicked()), this, SLOT(clearClicked()));
      connect(toggleViewButton, SIGNAL(clicked()), this, SLOT(toggleViewClicked()));
      connect(commitButton, SIGNAL(clicked()), this, SLOT(commitClicked()));

      // tab order
      setTabOrder(ObjectListView, clearButton);
      setTabOrder(clearButton, toggleViewButton);
      setTabOrder(toggleViewButton, commitButton);
    }

  connect(ObjectListView, SIGNAL(clicked(Q3ListViewItem*)), this, SLOT(listviewChecked(Q3ListViewItem*)));

  pObjectAll = new QPixmap((const char**)ptrObjectAll);
  pObjectNone = new QPixmap((const char**)ptrObjectNone);
  pObjectParts = new QPixmap((const char**)ptrObjectParts);

  objectItemList = new ObjectList();
  refreshList = new ObjectList();
  ObjectBrowserItem::resetKeySpace();
  loadData();
  currentPage = LISTVIEWPAGE;
}
コード例 #11
0
ファイル: fieldgui.cpp プロジェクト: Youw/SeaBattle
void FieldGUI::on_btnClear_clicked()
{
  emit clearClicked();
}
コード例 #12
0
/*
 *  Constructs a ObjectBrowserDialog which is a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ObjectBrowserDialog::ObjectBrowserDialog(QWidget* parent, const char* name, bool modal, int state)
    : QDialog(parent),
    clearButton(NULL),
    toggleViewButton(NULL),
    cancelButton(NULL),
    okButton(NULL),
    Line1(NULL),
    spacer(NULL),
    objectBrowserWidget(NULL),
    ObjectBrowserDialogLayout(NULL)
{
  setObjectName(QString::fromUtf8(name));
  setModal(modal);
  setAttribute(Qt::WA_DeleteOnClose);
  ObjectBrowserDialogLayout = new QGridLayout(this);
  ObjectBrowserDialogLayout->setMargin(11);
  ObjectBrowserDialogLayout->setSpacing(6);
  ObjectBrowserDialogLayout->setObjectName(QString::fromUtf8("ObjectBrowserDialogLayout"));

  objectBrowserWidget = new ObjectBrowserWidget(this);
  ObjectBrowserDialogLayout->addWidget(objectBrowserWidget, 0, 0, 1, 2);

  Line1 = new QFrame(this);
  Line1->setObjectName("Line1");
  Line1->setFrameShape(QFrame::HLine);
  Line1->setFrameShadow(QFrame::Sunken);
  Line1->setFrameShape(QFrame::HLine);
  ObjectBrowserDialogLayout->addWidget(Line1, 1, 0, 1, 2);

  if (state == 0)
    {
      clearButton = new QPushButton(this);
      clearButton->setObjectName("clearButton");
      clearButton->setText("Clear");

      toggleViewButton = new QPushButton(this);
      toggleViewButton->setObjectName("toggleViewButton");
      toggleViewButton->setText("Selected Items");

      cancelButton = new QPushButton(this);
      cancelButton->setObjectName("cancelButton");
      cancelButton->setText("Cancel");

      okButton = new QPushButton(this);
      okButton->setObjectName("okButton");
      okButton->setText("OK");
      okButton->setDefault(true);
      okButton->setAutoDefault(true);

      connect(clearButton, SIGNAL(clicked()), objectBrowserWidget, SLOT(clearClicked()));
      connect(toggleViewButton, SIGNAL(clicked()), this, SLOT(toggleViewClicked()));
      connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
      connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));

      ObjectBrowserDialogLayout->addWidget(clearButton, 2, 0);
      ObjectBrowserDialogLayout->addWidget(toggleViewButton, 2, 1);
      ObjectBrowserDialogLayout->addWidget(cancelButton, 2, 2);
      ObjectBrowserDialogLayout->addWidget(okButton, 2, 3);

      setTabOrder(okButton, clearButton);
      setTabOrder(clearButton, toggleViewButton);
      setTabOrder(toggleViewButton, cancelButton);
      setTabOrder(cancelButton, objectBrowserWidget);
    }
  else
    {
      okButton = new QPushButton(this);
      okButton->setObjectName("okButton");
      okButton->setText("Close");
      okButton->setDefault(true);
      okButton->setAutoDefault(true);
      ObjectBrowserDialogLayout->addWidget(okButton, 2, 1, 1, 1);

      connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));

      setTabOrder(okButton, objectBrowserWidget);
    }

  if (!name)
    setObjectName("ObjectBrowser");

  resize(420, 460);
  setWindowTitle(trUtf8("Object Browser"));
}
コード例 #13
0
ファイル: tab_logs.cpp プロジェクト: DINKIN/Cockatrice
void TabLog::createDock()
{

    labelFindUserName = new QLabel(tr("Username: "******"");
    findUsername->setAlignment(Qt::AlignCenter);
    labelFindIPAddress = new QLabel(tr("IP Address: "));
    findIPAddress = new QLineEdit("");
    findIPAddress->setAlignment(Qt::AlignCenter);
    labelFindGameName = new QLabel(tr("Game Name: "));
    findGameName = new QLineEdit("");
    findGameName->setAlignment(Qt::AlignCenter);
    labelFindGameID = new QLabel(tr("GameID: "));
    findGameID = new QLineEdit("");
    findGameID->setAlignment(Qt::AlignCenter);
    labelMessage = new QLabel(tr("Message: "));
    findMessage = new QLineEdit("");
    findMessage->setAlignment(Qt::AlignCenter);

    mainRoom = new QCheckBox(tr("Main Room"));
    gameRoom = new QCheckBox(tr("Game Room"));
    privateChat = new QCheckBox(tr("Private Chat"));

    pastDays = new QRadioButton(tr("Past X Days: "));
    today = new QRadioButton(tr("Today"));
    lastHour = new QRadioButton(tr("Last Hour"));
    pastXDays = new QSpinBox;
    pastXDays->setMaximum(20);


    labelMaximum = new QLabel(tr("Maximum Results: "));
    maximumResults = new QSpinBox;
    maximumResults->setMaximum(1000);

    labelDescription = new QLabel(tr("At least one filter is required.\nThe more information you put in, the more specific your results will be."));

    getButton = new QPushButton(tr("Get User Logs"));
    getButton->setAutoDefault(true);
    connect(getButton, SIGNAL(clicked()), this, SLOT(getClicked()));

    clearButton = new QPushButton(tr("Clear Filters"));
    clearButton->setAutoDefault(true);
    connect(clearButton, SIGNAL(clicked()), this, SLOT(clearClicked()));

    criteriaGrid = new QGridLayout;
    criteriaGrid->addWidget(labelFindUserName, 0, 0);
    criteriaGrid->addWidget(findUsername, 0, 1);
    criteriaGrid->addWidget(labelFindIPAddress, 1, 0);
    criteriaGrid->addWidget(findIPAddress, 1, 1);
    criteriaGrid->addWidget(labelFindGameName, 2, 0);
    criteriaGrid->addWidget(findGameName, 2, 1);
    criteriaGrid->addWidget(labelFindGameID, 3, 0);
    criteriaGrid->addWidget(findGameID, 3, 1);
    criteriaGrid->addWidget(labelMessage, 4, 0);
    criteriaGrid->addWidget(findMessage, 4, 1);

    criteriaGroupBox = new QGroupBox(tr("Filters"));
    criteriaGroupBox->setLayout(criteriaGrid);
    criteriaGroupBox->setFixedSize(500,300);

    locationGrid = new QGridLayout;
    locationGrid->addWidget(mainRoom, 0, 0);
    locationGrid->addWidget(gameRoom, 0, 1);
    locationGrid->addWidget(privateChat, 0, 2);

    locationGroupBox = new QGroupBox(tr("Log Locations"));
    locationGroupBox->setLayout(locationGrid);

    rangeGrid = new QGridLayout;
    rangeGrid->addWidget(pastDays, 0, 0);
    rangeGrid->addWidget(pastXDays, 0, 1);
    rangeGrid->addWidget(today, 0, 2);
    rangeGrid->addWidget(lastHour, 0, 3);

    rangeGroupBox = new QGroupBox(tr("Date Range"));
    rangeGroupBox->setLayout(rangeGrid);

    maxResultsGrid = new QGridLayout;
    maxResultsGrid->addWidget(labelMaximum, 0, 0);
    maxResultsGrid->addWidget(maximumResults, 0, 1);

    maxResultsGroupBox = new QGroupBox(tr("Maximum Results"));
    maxResultsGroupBox->setLayout(maxResultsGrid);

    descriptionGrid = new QGridLayout;
    descriptionGrid->addWidget(labelDescription, 0, 0);

    descriptionGroupBox = new QGroupBox(tr(""));
    descriptionGroupBox->setLayout(descriptionGrid);

    buttonGrid = new QGridLayout;
    buttonGrid->addWidget(getButton, 0, 0);
    buttonGrid->addWidget(clearButton, 0, 1);

    buttonGroupBox = new QGroupBox(tr(""));
    buttonGroupBox->setLayout(buttonGrid);

    mainLayout = new QVBoxLayout(this);
    mainLayout->addWidget(criteriaGroupBox);
    mainLayout->addWidget(locationGroupBox);
    mainLayout->addWidget(rangeGroupBox);
    mainLayout->addWidget(maxResultsGroupBox);
    mainLayout->addWidget(descriptionGroupBox);
    mainLayout->addWidget(buttonGroupBox);
    mainLayout->setAlignment(Qt::AlignCenter);

    searchDockContents = new QWidget(this);
    searchDockContents->setLayout(mainLayout);

    searchDock = new QDockWidget(this);
    searchDock->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable);
    searchDock->setWidget(searchDockContents);
}
コード例 #14
0
ChannelsJoinDialog::ChannelsJoinDialog(const char * name)
: QDialog(g_pMainWindow)
{
	setObjectName(name);
	setWindowTitle(__tr2qs("Join Channels"));
	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Channel)));

	m_pConsole = 0;

	QGridLayout * g = new QGridLayout(this);

	m_pTreeWidget = new ChannelsJoinDialogTreeWidget(this);
	m_pTreeWidget->setHeaderLabel(__tr2qs("Channel"));
	m_pTreeWidget->setRootIsDecorated(true);
	m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	g->addWidget(m_pTreeWidget,0,0,1,2);
	//connect(m_pTreeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem *,int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *,int)));


	m_pGroupBox = new KviTalGroupBox(Qt::Horizontal,__tr2qs("Channel" ),this);
	QString szMsg = __tr2qs("Name");
	szMsg.append(":");

	new QLabel(szMsg,m_pGroupBox);

	m_pChannelEdit = new QLineEdit(m_pGroupBox);
	connect(m_pChannelEdit,SIGNAL(returnPressed()), this, SLOT(editReturnPressed()));
	connect(m_pChannelEdit,SIGNAL(textChanged(const QString &)),this,SLOT(editTextChanged(const QString &)));

	szMsg = __tr2qs("Password");
	szMsg.append(":");
	QLabel(szMsg,m_pGroupBox);

	m_pPass = new QLineEdit(m_pGroupBox);
	m_pPass->setEchoMode(QLineEdit::Password);

	g->addWidget(m_pGroupBox,1,0,1,2);

	KviTalHBox * hb = new KviTalHBox(this);
	hb->setSpacing(4);

	g->addWidget(hb,2,0,1,2,Qt::AlignHCenter);

	m_pJoinButton = new QPushButton(__tr2qs("&Join"),hb);
	// Join on return pressed
	m_pJoinButton->setDefault(true);
	connect(m_pJoinButton,SIGNAL(clicked()),this,SLOT(joinClicked()));

	m_pRegButton = new QPushButton(__tr2qs("&Register"),hb);
	// Join on return pressed
	connect(m_pRegButton,SIGNAL(clicked()),this,SLOT(regClicked()));

	m_pClearButton = new QPushButton(__tr2qs("Clear Recent"),hb);
	connect(m_pClearButton,SIGNAL(clicked()),this,SLOT(clearClicked()));

	m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show this window after connecting"),this);
	m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc));
	g->addWidget(m_pShowAtStartupCheck,3,0);


	QPushButton * cancelButton = new QPushButton(__tr2qs("Close"),this);
	connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked()));

	g->addWidget(cancelButton,3,1);

/*
	KviTalHBox * hb = new KviTalHBox(this);
	hb->setSpacing(4);

	QPushButton * namesButton = new QPushButton("/names", hb);
	connect(namesButton,SIGNAL(clicked()),this,SLOT(namesClicked()));
	QPushButton * whoButton = new QPushButton("/who", hb);
	connect(whoButton,SIGNAL(clicked()),this,SLOT(whoClicked()));

	g->addWidget(hb,2,0);
*/

	g->setRowStretch(0,1);
	g->setColumnStretch(0,1);

	fillListView();

	if(g_rectChannelsJoinGeometry.y() < 5)
		g_rectChannelsJoinGeometry.setY(5);

	resize(g_rectChannelsJoinGeometry.width(),g_rectChannelsJoinGeometry.height());
	//move(g_rectChannelsJoinGeometry.x(),g_rectChannelsJoinGeometry.y());

	QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow);
	move(rect.x() + ((rect.width() - g_rectChannelsJoinGeometry.width())/2),rect.y() + ((rect.height() - g_rectChannelsJoinGeometry.height())/2));

	enableJoin();
}