mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-12 00:00:44 -04:00
fixed colors in keyring with new ModelIndex based view (patch from sss)
This commit is contained in:
parent
acbcba8a64
commit
3007fec1b2
4 changed files with 62 additions and 33 deletions
|
@ -58,18 +58,22 @@
|
|||
#define IMAGE_MESSAGE ":/images/mail_new.png"
|
||||
|
||||
/* Images for Status icons */
|
||||
#define IMAGE_AUTHED ":/images/accepted16.png"
|
||||
|
||||
//following defined in model
|
||||
/*#define IMAGE_AUTHED ":/images/accepted16.png"
|
||||
#define IMAGE_DENIED ":/images/denied16.png"
|
||||
#define IMAGE_TRUSTED ":/images/rs-2.png"
|
||||
#define IMAGE_TRUSTED ":/images/rs-2.png" */
|
||||
|
||||
// Defines for key list columns
|
||||
#define COLUMN_CHECK 0
|
||||
|
||||
//following defined in model
|
||||
/*#define COLUMN_CHECK 0
|
||||
#define COLUMN_PEERNAME 1
|
||||
#define COLUMN_I_AUTH_PEER 2
|
||||
#define COLUMN_PEER_AUTH_ME 3
|
||||
#define COLUMN_PEERID 4
|
||||
#define COLUMN_LAST_USED 5
|
||||
#define COLUMN_COUNT 6
|
||||
#define COLUMN_COUNT 6 */
|
||||
|
||||
//RsPeerId getNeighRsCertId(QTreeWidgetItem *i);
|
||||
|
||||
|
@ -77,12 +81,13 @@
|
|||
* #define NET_DEBUG 1
|
||||
*****/
|
||||
|
||||
static const unsigned int ROLE_SORT = Qt::UserRole + 1 ;
|
||||
//static const unsigned int ROLE_SORT = Qt::UserRole + 1 ;
|
||||
|
||||
/** Constructor */
|
||||
NetworkDialog::NetworkDialog(QWidget *parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
Q_UNUSED(parent);
|
||||
ui.setupUi(this);
|
||||
|
||||
connect( ui.filterLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterItems(QString)));
|
||||
|
@ -91,6 +96,7 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
|||
|
||||
//list data model
|
||||
float f = QFontMetricsF(font()).height()/14.0 ;
|
||||
|
||||
PGPIdItemModel = new pgpid_item_model(neighs, f, this);
|
||||
PGPIdItemProxy = new pgpid_item_proxy(this);
|
||||
connect(ui.onlyTrustedKeys, SIGNAL(toggled(bool)), PGPIdItemProxy, SLOT(use_only_trusted_keys(bool)));
|
||||
|
@ -105,11 +111,10 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
|||
ui.connectTreeWidget->setUpdatesEnabled(true);
|
||||
ui.connectTreeWidget->setSortingEnabled(true);
|
||||
ui.connectTreeWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
ui.connectTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
connect(ui.connectTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( connectTreeWidgetCostumPopupMenu( QPoint ) ) );
|
||||
connect(ui.connectTreeWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(peerdetails()));
|
||||
|
||||
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
/* QHeaderView * _header = ui.connectTreeWidget->header () ;
|
||||
QHeaderView_setSectionResizeModeColumn(_header, COLUMN_CHECK, QHeaderView::Custom);
|
||||
|
@ -122,8 +127,6 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
|||
|
||||
ui.onlyTrustedKeys->setMinimumWidth(20*f);
|
||||
|
||||
|
||||
|
||||
/* QMenu *menu = new QMenu();
|
||||
menu->addAction(ui.actionTabsright);
|
||||
menu->addAction(ui.actionTabswest);
|
||||
|
@ -159,7 +162,9 @@ void NetworkDialog::connectTreeWidgetCostumPopupMenu( QPoint /*point*/ )
|
|||
|
||||
QModelIndexList l = ui.connectTreeWidget->selectionModel()->selection().indexes();
|
||||
if(l.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QMenu *contextMnu = new QMenu;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue