Adding some work-in-progress files for shortcut handling which I don't have time...
[quassel.git] / src / uisupport / bufferview.cpp
index c4529cb..e922559 100644 (file)
@@ -57,7 +57,13 @@ void BufferView::init() {
 
   setSortingEnabled(true);
   sortByColumn(0, Qt::AscendingOrder);
+#ifndef Q_WS_QWS
+  // this is a workaround to not join channels automatically... we need a saner way to navigate for qtopia anyway though,
+  // such as mark first, activate at second click...
   connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
+#else
+  connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));  // Qtopia uses single click for activation
+#endif
 }
 
 void BufferView::setFilteredModel(QAbstractItemModel *model, BufferViewFilter::Modes mode, QList<NetworkId> nets) {
@@ -234,16 +240,20 @@ void BufferView::showContextMenu(const QPoint &pos) {
       network->requestDisconnect();
   } else
   if(result == joinChannelAction) {
+    // FIXME no QInputDialog in Qtopia
+#ifndef Q_WS_QWS
     bool ok;
     QString channelName = QInputDialog::getText(this, tr("Join Channel"), 
                                                 tr("Input channel name:"),QLineEdit::Normal,
                                                 QDir::home().dirName(), &ok);
+
     if (ok && !channelName.isEmpty()) {
       BufferInfo bufferInfo = index.child(0,0).data(NetworkModel::BufferInfoRole).value<BufferInfo>();
       if(bufferInfo.isValid()) {
         Client::instance()->userInput(bufferInfo, QString("/J %1").arg(channelName));
       }
     }
+#endif
   } else
   if(result == joinBufferAction) {
     Client::instance()->userInput(bufferInfo, QString("/JOIN %1").arg(channelname));