@@ -27,22 +27,22 @@ AttachPanel::~AttachPanel()
2727 delete ui;
2828}
2929
30- void AttachPanel::setViewTo ( RichTextNote * n )
30+ void AttachPanel::setNote ( RichTextNote * note )
3131{
32- if ( note )
32+ if ( this -> note )
3333 disconnect ( ui->listView ->selectionModel (), SIGNAL ( selectionChanged (QItemSelection,QItemSelection) ), this , SLOT ( updateStates () ) );
3434
35- if ( !n )
35+ if ( !note )
3636 {
37- note = 0 ;
37+ this -> note = 0 ;
3838 model = 0 ;
3939 ui->listView ->setModel ( 0 );
4040 updateStates ();
4141 return ;
4242 }
4343
44- note = n ;
45- model = ¬e->attachModel ;
44+ this -> note = note ;
45+ model = &this -> note ->attachModel ;
4646
4747 ui->listView ->setModel ( model );
4848 QObject::connect ( ui->listView ->selectionModel (), SIGNAL ( selectionChanged (QItemSelection,QItemSelection) ), this , SLOT ( updateStates () ) );
@@ -68,32 +68,32 @@ void AttachPanel::updateStates()
6868{
6969 if ( !note || !model )
7070 {
71- ui->tButtonRefreshList ->setEnabled ( false );
72- ui->tButtonAttach ->setEnabled ( false );
73- ui->tButtonRemoveAll ->setEnabled ( false );
74- ui->tButtonRemove ->setEnabled ( false );
75- ui->tButtonCopyToClipboard ->setEnabled ( false );
76- ui->tButtonRun ->setEnabled ( false );
71+ ui->refreshList ->setEnabled ( false );
72+ ui->attach ->setEnabled ( false );
73+ ui->removeAll ->setEnabled ( false );
74+ ui->remove ->setEnabled ( false );
75+ ui->copyToClipboard ->setEnabled ( false );
76+ ui->run ->setEnabled ( false );
7777 return ;
7878 }
7979
80- ui->tButtonRefreshList ->setEnabled ( true );
81- ui->tButtonAttach ->setEnabled ( true );
80+ ui->refreshList ->setEnabled ( true );
81+ ui->attach ->setEnabled ( true );
8282
8383 bool isEmpty = model->rowCount () == 0 ;
8484 bool hasSelection = ui->listView ->selectionModel ()->hasSelection ();
8585
86- ui->tButtonRemoveAll ->setEnabled ( !isEmpty );
87- ui->tButtonRemove ->setEnabled ( hasSelection );
88- ui->tButtonCopyToClipboard ->setEnabled ( hasSelection );
89- ui->tButtonRun ->setEnabled ( hasSelection );
86+ ui->removeAll ->setEnabled ( !isEmpty );
87+ ui->remove ->setEnabled ( hasSelection );
88+ ui->copyToClipboard ->setEnabled ( hasSelection );
89+ ui->run ->setEnabled ( hasSelection );
9090}
9191
92- void AttachPanel::on_tButtonAttach_clicked ()
92+ void AttachPanel::on_attach_clicked ()
9393{
9494 note->selectAttach ();
9595}
96- void AttachPanel::on_tButtonRemove_clicked ()
96+ void AttachPanel::on_remove_clicked ()
9797{
9898 QDir dir ( note->attachDirPath () );
9999
@@ -112,7 +112,7 @@ void AttachPanel::on_tButtonRemove_clicked()
112112
113113 emit note->changed ( EventsNote::ChangeAttach );
114114}
115- void AttachPanel::on_tButtonRemoveAll_clicked ()
115+ void AttachPanel::on_removeAll_clicked ()
116116{
117117 QDir dir ( note->attachDirPath () );
118118
@@ -131,11 +131,11 @@ void AttachPanel::on_tButtonRemoveAll_clicked()
131131 refresh ();
132132 emit note->changed ( EventsNote::ChangeAttach );
133133}
134- void AttachPanel::on_tButtonRefreshList_clicked ()
134+ void AttachPanel::on_refreshList_clicked ()
135135{
136136 refresh ();
137137}
138- void AttachPanel::on_tButtonCopyToClipboard_clicked ()
138+ void AttachPanel::on_copyToClipboard_clicked ()
139139{
140140 int row = ui->listView ->currentIndex ().row ();
141141 int col = ui->listView ->currentIndex ().column ();
@@ -148,7 +148,7 @@ void AttachPanel::on_tButtonCopyToClipboard_clicked()
148148 mime->setUrls ( urls );
149149 QApplication::clipboard ()->setMimeData ( mime );
150150}
151- void AttachPanel::on_tButtonRun_clicked ()
151+ void AttachPanel::on_run_clicked ()
152152{
153153 int row = ui->listView ->currentIndex ().row ();
154154 int col = ui->listView ->currentIndex ().column ();
0 commit comments