removed some unused buttons

This commit is contained in:
csoler 2020-06-08 21:09:23 +02:00
parent 730a3be2e4
commit 405fd2b5ca
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
3 changed files with 29 additions and 99 deletions

View File

@ -277,31 +277,24 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
ui->postButton->setText(tr("Add new post")); ui->postButton->setText(tr("Add new post"));
/* add filter actions */ /* add filter actions */
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_TITLE, tr("Search Title")); connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
ui->filterLineEdit->addFilter(QIcon(), tr("Message"), FILTER_MSG, tr("Search Message"));
ui->filterLineEdit->addFilter(QIcon(), tr("Filename"), FILTER_FILE_NAME, tr("Search Filename"));
#ifdef TODO
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), ui->feedWidget, SLOT(setFilterText(QString)));
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), ui->fileWidget, SLOT(setFilterText(QString)));
#endif
connect(ui->filterLineEdit, SIGNAL(filterChanged(int)), this, SLOT(filterChanged()));
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged()));
/* Initialize view button */ /* Initialize view button */
//setViewMode(VIEW_MODE_FEEDS); see processSettings //setViewMode(VIEW_MODE_FEEDS); see processSettings
//ui->infoWidget->hide(); //ui->infoWidget->hide();
QSignalMapper *signalMapper = new QSignalMapper(this); //QSignalMapper *signalMapper = new QSignalMapper(this);
connect(ui->feedToolButton, SIGNAL(clicked()), signalMapper, SLOT(map())); //connect(ui->feedToolButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
connect(ui->fileToolButton, SIGNAL(clicked()), signalMapper, SLOT(map())); //connect(ui->fileToolButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(ui->feedToolButton, VIEW_MODE_FEEDS); //signalMapper->setMapping(ui->feedToolButton, VIEW_MODE_FEEDS);
signalMapper->setMapping(ui->fileToolButton, VIEW_MODE_FILES); //signalMapper->setMapping(ui->fileToolButton, VIEW_MODE_FILES);
connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(setViewMode(int))); //connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(setViewMode(int)));
/*************** Setup Left Hand Side (List of Channels) ****************/ /*************** Setup Left Hand Side (List of Channels) ****************/
ui->loadingLabel->hide(); //ui->loadingLabel->hide();
ui->progressBar->hide(); //ui->progressBar->hide();
ui->postsTree->setPlaceholderText(tr("Thumbnails")); ui->postsTree->setPlaceholderText(tr("Thumbnails"));
ui->postsTree->setMinimumWidth(COLUMN_SIZE_FONT_FACTOR_W*QFontMetricsF(font()).height()+1); ui->postsTree->setMinimumWidth(COLUMN_SIZE_FONT_FACTOR_W*QFontMetricsF(font()).height()+1);
@ -521,21 +514,25 @@ void GxsChannelPostsWidgetWithModel::processSettings(bool load)
Settings->beginGroup(QString("ChannelPostsWidget")); Settings->beginGroup(QString("ChannelPostsWidget"));
if (load) { if (load) {
#ifdef TO_REMOVE
// load settings // load settings
/* Filter */ /* Filter */
ui->filterLineEdit->setCurrentFilter(Settings->value("filter", FILTER_TITLE).toInt()); //ui->filterLineEdit->setCurrentFilter(Settings->value("filter", FILTER_TITLE).toInt());
/* View mode */ /* View mode */
setViewMode(Settings->value("viewMode", VIEW_MODE_FEEDS).toInt()); //setViewMode(Settings->value("viewMode", VIEW_MODE_FEEDS).toInt());
#endif
} else { } else {
#ifdef TO_REMOVE
// save settings // save settings
/* Filter */ /* Filter */
Settings->setValue("filter", ui->filterLineEdit->currentFilter()); //Settings->setValue("filter", ui->filterLineEdit->currentFilter());
/* View mode */ /* View mode */
Settings->setValue("viewMode", viewMode()); //Settings->setValue("viewMode", viewMode());
#endif
} }
Settings->endGroup(); Settings->endGroup();
@ -629,8 +626,8 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
if (IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) if (IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags))
{ {
ui->subscribeToolButton->setText(tr("Subscribed") + " " + QString::number(group.mMeta.mPop) ); ui->subscribeToolButton->setText(tr("Subscribed") + " " + QString::number(group.mMeta.mPop) );
ui->feedToolButton->setEnabled(true); //ui->feedToolButton->setEnabled(true);
ui->fileToolButton->setEnabled(true); //ui->fileToolButton->setEnabled(true);
ui->channel_TW->setTabEnabled(CHANNEL_TABS_POSTS,true); ui->channel_TW->setTabEnabled(CHANNEL_TABS_POSTS,true);
ui->details_TW->setEnabled(true); ui->details_TW->setEnabled(true);
} }
@ -698,14 +695,15 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
ui->infoWidget->show(); ui->infoWidget->show();
ui->feedWidget->hide(); ui->feedWidget->hide();
ui->fileWidget->hide(); ui->fileWidget->hide();
#endif
ui->feedToolButton->setEnabled(false); //ui->feedToolButton->setEnabled(false);
ui->fileToolButton->setEnabled(false); //ui->fileToolButton->setEnabled(false);
#endif
ui->subscribeToolButton->setText(tr("Subscribe ") + " " + QString::number(group.mMeta.mPop) ); ui->subscribeToolButton->setText(tr("Subscribe ") + " " + QString::number(group.mMeta.mPop) );
} }
#ifdef TODO
int GxsChannelPostsWidgetWithModel::viewMode() int GxsChannelPostsWidgetWithModel::viewMode()
{ {
if (ui->feedToolButton->isChecked()) { if (ui->feedToolButton->isChecked()) {
@ -717,6 +715,7 @@ int GxsChannelPostsWidgetWithModel::viewMode()
/* Default */ /* Default */
return VIEW_MODE_FEEDS; return VIEW_MODE_FEEDS;
} }
#endif
void GxsChannelPostsWidgetWithModel::setViewMode(int viewMode) void GxsChannelPostsWidgetWithModel::setViewMode(int viewMode)
{ {
@ -745,9 +744,9 @@ void GxsChannelPostsWidgetWithModel::setViewMode(int viewMode)
#endif #endif
} }
void GxsChannelPostsWidgetWithModel::filterChanged() void GxsChannelPostsWidgetWithModel::filterChanged(QString s)
{ {
QStringList ql = ui->filterLineEdit->text().split(' ',QString::SkipEmptyParts); QStringList ql = s.split(' ',QString::SkipEmptyParts);
uint32_t count; uint32_t count;
mChannelPostsModel->setFilter(ql,count); mChannelPostsModel->setFilter(ql,count);
} }

View File

@ -132,7 +132,7 @@ private slots:
void createMsg(); void createMsg();
void toggleAutoDownload(); void toggleAutoDownload();
void subscribeGroup(bool subscribe); void subscribeGroup(bool subscribe);
void filterChanged(); void filterChanged(QString);
void setViewMode(int viewMode); void setViewMode(int viewMode);
void settingsChanged(); void settingsChanged();
void handlePostsTreeSizeChange(QSize s); void handlePostsTreeSizeChange(QSize s);

View File

@ -120,78 +120,15 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="loadingLabel">
<property name="text">
<string>Loading</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>10</height>
</size>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="viewModeLayout"> <layout class="QHBoxLayout" name="viewModeLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item>
<widget class="QToolButton" name="feedToolButton">
<property name="toolTip">
<string>Show feeds</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/view-feeds.png</normaloff>:/images/view-feeds.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="fileToolButton">
<property name="toolTip">
<string>Show files</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/view-files.png</normaloff>:/images/view-files.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="LineEditClear" name="filterLineEdit"> <widget class="QLineEdit" name="filterLineEdit">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -583,11 +520,6 @@ p, li { white-space: pre-wrap; }
<extends>QToolButton</extends> <extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header> <header>gui/common/SubscribeToolButton.h</header>
</customwidget> </customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
<customwidget> <customwidget>
<class>RSTreeView</class> <class>RSTreeView</class>
<extends>QTreeView</extends> <extends>QTreeView</extends>
@ -601,7 +533,6 @@ p, li { white-space: pre-wrap; }
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../images.qrc"/>
<include location="../icons.qrc"/> <include location="../icons.qrc"/>
</resources> </resources>
<connections/> <connections/>