File tree Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 22
33## 25.9.6
44
5+ - You can now **open the URL to a card** in the **Nextcloud Deck dialog** in the
6+   browser by right-clicking on the card and choosing _Open in browser_ or double-clicking
7+   on the card in the list (for [#3357](https://github.com/pbek/QOwnNotes/issues/3357))
58- There now is a software repository for **openSUSE Leap 16.0**
69  - Please visit the [openSUSE installation page](https://www.qownnotes.org/installation/opensuse.html)
710    for instructions
Original file line number Diff line number Diff line change 11#include  " nextclouddeckdialog.h" 
22
3+ #include  < QDesktopServices> 
34#include  < QMenu> 
45#include  < QShortcut> 
56#include  < QTimeZone> 
@@ -337,9 +338,45 @@ void NextcloudDeckDialog::on_archiveCardButton_clicked() {
337338    }
338339
339340    NextcloudDeckService nextcloudDeckService (this );
340-     bool  isSuccess = nextcloudDeckService.archiveCard (_currentCard.id );
341+     const   bool  isSuccess = nextcloudDeckService.archiveCard (_currentCard.id );
341342
342343    if  (isSuccess) {
343344        reloadCardList ();
344345    }
345346}
347+ 
348+ void  NextcloudDeckDialog::openUrlInBrowserForItem (const  QTreeWidgetItem *item) {
349+     if  (item == nullptr ) {
350+         return ;
351+     }
352+ 
353+     QDesktopServices::openUrl (
354+         QUrl (NextcloudDeckService (this ).getCardLinkForId (item->data (0 , Qt::UserRole).toInt ())));
355+ }
356+ 
357+ void  NextcloudDeckDialog::on_cardItemTreeWidget_itemDoubleClicked (QTreeWidgetItem *item,
358+                                                                   int  column) {
359+     Q_UNUSED (column)
360+ 
361+     openUrlInBrowserForItem (item);
362+ }
363+ 
364+ void  NextcloudDeckDialog::on_cardItemTreeWidget_customContextMenuRequested (const  QPoint &pos) {
365+     const  QPoint globalPos = ui->cardItemTreeWidget ->mapToGlobal (pos);
366+     QMenu menu;
367+ 
368+     QAction *openUrlAction = menu.addAction (tr (" &Open card in browser" 
369+     openUrlAction->setIcon (QIcon::fromTheme (QStringLiteral (" text-html" 
370+                                             QIcon (" :icons/breeze-qownnotes/16x16/text-html.svg" 
371+     QAction *selectedItem = menu.exec (globalPos);
372+ 
373+     if  (selectedItem == nullptr ) {
374+         return ;
375+     }
376+ 
377+     QTreeWidgetItem *item = ui->cardItemTreeWidget ->currentItem ();
378+ 
379+     if  (selectedItem == openUrlAction) {
380+         openUrlInBrowserForItem (item);
381+     }
382+ }
Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ class NextcloudDeckDialog : public MasterDialog {
5555
5656    void  on_archiveCardButton_clicked ();
5757
58+     void  on_cardItemTreeWidget_itemDoubleClicked (QTreeWidgetItem *item, int  column);
59+ 
60+     void  on_cardItemTreeWidget_customContextMenuRequested (const  QPoint &pos);
61+ 
5862   private: 
5963    Ui::NextcloudDeckDialog *ui;
6064    void  setupMainSplitter ();
@@ -65,6 +69,8 @@ class NextcloudDeckDialog : public MasterDialog {
6569    void  jumpToCard (int  id);
6670    QHash<int , NextcloudDeckService::Card> _cards;
6771    NextcloudDeckService::Card _currentCard;
72+ 
73+     void  openUrlInBrowserForItem (const  QTreeWidgetItem *item);
6874};
6975
7076#endif     //  NEXTCLOUDDECKDIALOG_H
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments