show and hide sync tree
diff --git a/chatdialog.cpp b/chatdialog.cpp
index 6a26cc3..4a6ae3f 100644
--- a/chatdialog.cpp
+++ b/chatdialog.cpp
@@ -50,6 +50,7 @@
m_timer = new QTimer(this);
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
connect(setButton, SIGNAL(pressed()), this, SLOT(buttonPressed()));
+ connect(treeButton, SIGNAL(pressed()), this, SLOT(treeButtonPressed()));
connect(this, SIGNAL(dataReceived(QString, const char *, size_t, bool)), this, SLOT(processData(QString, const char *, size_t, bool)));
connect(this, SIGNAL(treeUpdated(const std::vector<Sync::MissingDataInfo>)), this, SLOT(processTreeUpdate(const std::vector<Sync::MissingDataInfo>)));
connect(this, SIGNAL(removeReceived(QString)), this, SLOT(processRemove(QString)));
@@ -424,8 +425,8 @@
QString settingDisp = QString("Chatroom: %1").arg(m_user.getChatroom());
infoLabel->setStyleSheet("QLabel {color: #630; font-size: 16px; font: bold \"Verdana\";}");
infoLabel->setText(settingDisp);
- QString prefixDisp = QString("<Prefix: %1>").arg(m_user.getPrefix());
- prefixLabel->setText(prefixDisp);
+ //QString prefixDisp = QString("<Prefix: %1>").arg(m_user.getPrefix());
+ //prefixLabel->setText(prefixDisp);
}
void
@@ -504,6 +505,20 @@
QTimer::singleShot(100, this, SLOT(checkSetting()));
}
+void ChatDialog::treeButtonPressed()
+{
+ if (treeViewer->isVisible())
+ {
+ treeViewer->hide();
+ treeButton->setText("Show Sync Tree");
+ }
+ else
+ {
+ treeViewer->show();
+ treeButton->setText("Hide Sync Tree");
+ }
+}
+
void
ChatDialog::checkSetting()
{
diff --git a/chatdialog.h b/chatdialog.h
index c282a90..b604b02 100644
--- a/chatdialog.h
+++ b/chatdialog.h
@@ -59,6 +59,7 @@
private slots:
void returnPressed();
void buttonPressed();
+ void treeButtonPressed();
void checkSetting();
void settingUpdated(QString, QString, QString);
void sendHello();
diff --git a/chatdialog.ui b/chatdialog.ui
index 8e60c81..4fb3c6f 100644
--- a/chatdialog.ui
+++ b/chatdialog.ui
@@ -27,6 +27,13 @@
<number>6</number>
</property>
<item>
+ <widget class="QLabel" name="infoLabel">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
<layout class = "QVBoxLayout" >
<property name="margin">
<number>0</number>
@@ -34,13 +41,7 @@
<property name="spacing">
<number>6</number>
</property>
- <item>
- <widget class="QLabel" name="infoLabel">
- <property name="focusPolicy">
- <enum>Qt::NoFocus</enum>
- </property>
- </widget>
- </item>
+ <!--
<item>
<widget class="QLabel" name="prefixLabel">
<property name="focusPolicy">
@@ -48,24 +49,41 @@
</property>
</widget>
</item>
+ -->
+ <item>
+ <widget class="QPushButton" name="setButton">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ <property name="minimumWidth">
+ <number>150</number>
+ </property>
+ <property name="maximumWidth">
+ <number>150</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="treeButton">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ <property name="text">
+ <string>Hide Sync Tree</string>
+ </property>
+ <property name="minimumWidth">
+ <number>150</number>
+ </property>
+ <property name="maximumWidth">
+ <number>150</number>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
- <item>
- <widget class="QPushButton" name="setButton">
- <property name="focusPolicy">
- <enum>Qt::NoFocus</enum>
- </property>
- <property name="text">
- <string>Settings</string>
- </property>
- <property name="minimumWidth">
- <number>150</number>
- </property>
- <property name="maximumWidth">
- <number>150</number>
- </property>
- </widget>
- </item>
</layout>
</item>
<!-- end of head bar item -->
@@ -83,6 +101,9 @@
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
+ <property name="maximumWidth">
+ <number>200</number>
+ </property>
</widget>
</item>
<item>