Skip to content

Commit

Permalink
Adding direct add contact back
Browse files Browse the repository at this point in the history
  • Loading branch information
bruinfish authored and cawka committed May 9, 2014
1 parent e370a2a commit 9d7dfc2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
11 changes: 7 additions & 4 deletions src/browsecontactdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ BrowseContactDialog::BrowseContactDialog(Ptr<ContactManager> contactManager,
connect(ui->AddButton, SIGNAL(clicked()),
this, SLOT(onAddClicked()));

connect(ui->CancelButton, SIGNAL(clicked()),
this, SLOT(onCancelClicked()));
connect(ui->DirectAddButton, SIGNAL(clicked()),
this, SLOT(onDirectAddClicked()));
}

BrowseContactDialog::~BrowseContactDialog()
Expand Down Expand Up @@ -306,8 +306,11 @@ BrowseContactDialog::onAddClicked()
}

void
BrowseContactDialog::onCancelClicked()
{ this->close(); }
BrowseContactDialog::onDirectAddClicked()
{
emit directAddClicked();
this->close();
}

void
BrowseContactDialog::closeEvent(QCloseEvent *e)
Expand Down
5 changes: 4 additions & 1 deletion src/browsecontactdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private slots:
onAddClicked();

void
onCancelClicked();
onDirectAddClicked();

public slots:
void
Expand All @@ -89,6 +89,9 @@ public slots:
void
newContactAdded();

void
directAddClicked();

private:
Ui::BrowseContactDialog *ui;

Expand Down
6 changes: 3 additions & 3 deletions src/browsecontactdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<property name="windowTitle">
<string>BrowseContacts</string>
</property>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>12</x>
Expand Down Expand Up @@ -50,9 +50,9 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,1">
<item>
<widget class="QPushButton" name="CancelButton">
<widget class="QPushButton" name="DirectAddButton">
<property name="text">
<string>Cancel</string>
<string>Direct Add</string>
</property>
<property name="autoDefault">
<bool>false</bool>
Expand Down
7 changes: 5 additions & 2 deletions src/contactpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ ContactPanel::ContactPanel(QWidget *parent)
connect(m_profileEditor, SIGNAL(noKeyOrCert(const QString&)),
this, SLOT(showWarning(const QString&)));

// connect(ui->AddContactButton, SIGNAL(clicked()),
// this, SLOT(openAddContactPanel()));
connect(ui->AddContactButton, SIGNAL(clicked()),
this, SLOT(openBrowseContactDialog()));

connect(m_browseContactDialog, SIGNAL(directAddClicked()),
this, SLOT(openAddContactPanel()));

connect(this, SIGNAL(refreshCertDirectory()),
m_browseContactDialog, SLOT(refreshList()));

Expand All @@ -133,6 +134,8 @@ ContactPanel::ContactPanel(QWidget *parent)
connect(ui->settingButton, SIGNAL(clicked()),
this, SLOT(openSettingDialog()));

connect(m_addContactPanel, SIGNAL(newContactAdded()),
this, SLOT(refreshContactList()));
connect(m_browseContactDialog, SIGNAL(newContactAdded()),
this, SLOT(refreshContactList()));
connect(m_setAliasDialog, SIGNAL(aliasChanged()),
Expand Down

0 comments on commit 9d7dfc2

Please sign in to comment.