~ubuntu-branches/ubuntu/jaunty/quassel/jaunty-backports

« back to all changes in this revision

Viewing changes to src/qtui/mainwin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2009-01-14 01:28:49 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090114012849-38celzez3y3wpai9
Tags: 0.4.0~git090113-0ubuntu1
* New upstream git snapshot
  - Use networks.ini to provide default network/channel
  - Provide presets for common IRC networks
* Add kubuntu_01_default_network_channel.patch to set Freenode, port
  8001, and #kubuntu as defaults
* Add build-dep on quilt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2005-08 by the Quassel Project                          *
 
2
 *   Copyright (C) 2005-09 by the Quassel Project                          *
3
3
 *   devel@quassel-irc.org                                                 *
4
4
 *                                                                         *
5
5
 *   This program is free software; you can redistribute it and/or modify  *
315
315
  //create the view and initialize it's filter
316
316
  BufferView *view = new BufferView(dock);
317
317
  view->setFilteredModel(Client::bufferModel(), config);
 
318
  view->installEventFilter(_inputWidget->inputLine()); // for key presses
318
319
  view->show();
319
320
 
320
321
  Client::bufferModel()->synchronizeView(view);
414
415
  VerticalDock *dock = new VerticalDock(tr("Inputline"), this);
415
416
  dock->setObjectName("InputDock");
416
417
 
417
 
  InputWidget *inputWidget = new InputWidget(dock);
418
 
  dock->setWidget(inputWidget);
 
418
  _inputWidget = new InputWidget(dock);
 
419
  dock->setWidget(_inputWidget);
419
420
 
420
421
  addDockWidget(Qt::BottomDockWidgetArea, dock);
421
422
 
422
423
  _viewMenu->addAction(dock->toggleViewAction());
423
424
  dock->toggleViewAction()->setText(tr("Show Input Line"));
424
425
 
425
 
  inputWidget->setModel(Client::bufferModel());
426
 
  inputWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
427
 
 
428
 
  _bufferWidget->setFocusProxy(inputWidget);
429
 
 
430
 
  inputWidget->inputLine()->installEventFilter(_bufferWidget);
 
426
  _inputWidget->setModel(Client::bufferModel());
 
427
  _inputWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
428
 
 
429
  _bufferWidget->setFocusProxy(_inputWidget);
 
430
 
 
431
  _inputWidget->inputLine()->installEventFilter(_bufferWidget);
431
432
}
432
433
 
433
434
void MainWin::setupTopicWidget() {
457
458
  connect(Client::messageProcessor(), SIGNAL(progressUpdated(int, int)), msgProcessorStatusWidget, SLOT(setProgress(int, int)));
458
459
 
459
460
  // Core Lag:
460
 
  updateLagIndicator(0);
 
461
  updateLagIndicator();
461
462
  statusBar()->addPermanentWidget(coreLagLabel);
462
463
  coreLagLabel->hide();
463
464
  connect(Client::signalProxy(), SIGNAL(lagUpdated(int)), this, SLOT(updateLagIndicator(int)));
573
574
}
574
575
 
575
576
void MainWin::updateLagIndicator(int lag) {
576
 
  coreLagLabel->setText(QString(tr("Core Lag: %1 msec")).arg(lag));
 
577
  QString text = tr("Core Lag: %1");
 
578
  if(lag == -1)
 
579
    text = text.arg('-');
 
580
  else
 
581
    text = text.arg("%1 msec").arg(lag);
 
582
  coreLagLabel->setText(text);
577
583
}
578
584
 
579
585
 
613
619
  statusBar()->showMessage(tr("Not connected to core."));
614
620
  sslLabel->setPixmap(QPixmap());
615
621
  sslLabel->hide();
 
622
  updateLagIndicator();
616
623
  coreLagLabel->hide();
617
624
  updateIcon();
618
625
}