diff --git a/Makefile.am b/Makefile.am index f20cbaa8d7..7b14ef91b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5294,8 +5294,8 @@ src_nmtui_nmtui_SOURCES = \ src/nmtui/nmt-route-entry.h \ src/nmtui/nmt-route-table.c \ src/nmtui/nmt-route-table.h \ - src/nmtui/nmt-slave-list.c \ - src/nmtui/nmt-slave-list.h \ + src/nmtui/nmt-port-list.c \ + src/nmtui/nmt-port-list.h \ src/nmtui/nmt-utils.c \ src/nmtui/nmt-utils.h \ src/nmtui/nmt-widget-list.c \ diff --git a/po/POTFILES.in b/po/POTFILES.in index 9be1b9035d..feb7de6437 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -187,7 +187,7 @@ src/nmtui/nmt-password-dialog.c src/nmtui/nmt-password-fields.c src/nmtui/nmt-route-editor.c src/nmtui/nmt-route-table.c -src/nmtui/nmt-slave-list.c +src/nmtui/nmt-port-list.c src/nmtui/nmt-widget-list.c src/nmtui/nmt-wireguard-peer-editor.c src/nmtui/nmt-wireguard-peer-list.c diff --git a/po/as.po b/po/as.po index 6787474fb1..8ee332eea7 100644 --- a/po/as.po +++ b/po/as.po @@ -13656,7 +13656,7 @@ msgstr "মেট্ৰিক" msgid "No custom routes are defined." msgstr "কোনো স্বনিৰ্বাচিত পথ নাই।" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "আপুনি যোগ কৰিব বিচৰা স্লেইভ সংযোগৰ ধৰণ বাছক।" diff --git a/po/be@latin.po b/po/be@latin.po index 649ca1be9f..4523a83b54 100644 --- a/po/be@latin.po +++ b/po/be@latin.po @@ -12557,7 +12557,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/bg.po b/po/bg.po index 7d5a118429..e58cd183dc 100644 --- a/po/bg.po +++ b/po/bg.po @@ -12963,7 +12963,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/bn_IN.po b/po/bn_IN.po index 1b9956d57b..b51eb6d4f3 100644 --- a/po/bn_IN.po +++ b/po/bn_IN.po @@ -13685,7 +13685,7 @@ msgstr "মেট্রিক" msgid "No custom routes are defined." msgstr "কোনো কাস্টম রাউট নির্দিষ্ট করা হয়নি।" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "অাপনি যে ধরনের স্লেভ সংযোগ যোগ করতে চান তা নির্বাচন করুন।" diff --git a/po/bs.po b/po/bs.po index bb35b2c778..60ebd4d4c2 100644 --- a/po/bs.po +++ b/po/bs.po @@ -12640,7 +12640,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/ca.po b/po/ca.po index 8a5c251ebd..476101788f 100644 --- a/po/ca.po +++ b/po/ca.po @@ -14429,7 +14429,7 @@ msgstr "Mètrica" msgid "No custom routes are defined." msgstr "No hi ha rutes personalitzades definides." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Seleccioneu el tipus de connexió esclava que voleu afegir." diff --git a/po/cs.po b/po/cs.po index af423d9f17..54eeba349d 100644 --- a/po/cs.po +++ b/po/cs.po @@ -13233,7 +13233,7 @@ msgstr "Metrika" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/da.po b/po/da.po index bd1aba6417..7403133973 100644 --- a/po/da.po +++ b/po/da.po @@ -13692,7 +13692,7 @@ msgstr "Metrisk" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/de.po b/po/de.po index a8e9e529b9..f869c7b712 100644 --- a/po/de.po +++ b/po/de.po @@ -15407,7 +15407,7 @@ msgstr "Metrik" msgid "No custom routes are defined." msgstr "Es sind keine eigenen Routen festgelegt." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Wählen Sie die Art der Slave-Verbindung, die Sie hinzufügen möchten." diff --git a/po/dz.po b/po/dz.po index 848c331142..4390d498a2 100644 --- a/po/dz.po +++ b/po/dz.po @@ -12709,7 +12709,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 #, fuzzy msgid "Select the type of slave connection you wish to add." msgstr "ཁྱོད་ཀྱིས་ཝི་པི་ཨེན་མཐེད་ལམ་ག་བཟུམ་གསར་བསྐྲུན་འབད་ནི་ཨིན་ན་གདམ་ཁ་བརྐྱབ།" diff --git a/po/el.po b/po/el.po index d531946669..ec7d6eb0e7 100644 --- a/po/el.po +++ b/po/el.po @@ -13790,7 +13790,7 @@ msgstr "Μετρικό" msgid "No custom routes are defined." msgstr "Δεν ορίστηκαν προσαρμοσμένες διαδρομές." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Επιλέξτε τον τύπο της υποτελούς σύνδεσης που θέλετε να προσθέσετε." diff --git a/po/en_CA.po b/po/en_CA.po index aab1972de0..f69607665b 100644 --- a/po/en_CA.po +++ b/po/en_CA.po @@ -12858,7 +12858,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 #, fuzzy msgid "Select the type of slave connection you wish to add." msgstr "Choose the type of VPN connection you wish to create." diff --git a/po/en_GB.po b/po/en_GB.po index 480c4cbe4e..1d1e8ea4fe 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -12961,7 +12961,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/eo.po b/po/eo.po index e6b5bfd901..f5700d505f 100644 --- a/po/eo.po +++ b/po/eo.po @@ -12752,7 +12752,7 @@ msgstr "Metriko" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/es.po b/po/es.po index a17de8f6a4..6ee38cbb53 100644 --- a/po/es.po +++ b/po/es.po @@ -15300,7 +15300,7 @@ msgstr "Métrica" msgid "No custom routes are defined." msgstr "No hay rutas personalizadas definidas." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Seleccionar el tipo de conexión esclava que desee añadir." diff --git a/po/et.po b/po/et.po index 8af4ce5a85..b3e933cf82 100644 --- a/po/et.po +++ b/po/et.po @@ -12615,7 +12615,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/eu.po b/po/eu.po index fea477aa9c..0c0fd48d68 100644 --- a/po/eu.po +++ b/po/eu.po @@ -12874,7 +12874,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/fi.po b/po/fi.po index 71aae9ca8a..ddcfeaa7cc 100644 --- a/po/fi.po +++ b/po/fi.po @@ -12831,7 +12831,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/fr.po b/po/fr.po index a32218b172..c861e77fca 100644 --- a/po/fr.po +++ b/po/fr.po @@ -15630,7 +15630,7 @@ msgstr "Métrique" msgid "No custom routes are defined." msgstr "Aucune route personnalisée n'est définie." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Sélectionnez le type de connexion esclave que vous souhaitez ajouter." diff --git a/po/gd.po b/po/gd.po index 31f997bc3e..037b1f36a2 100644 --- a/po/gd.po +++ b/po/gd.po @@ -13009,7 +13009,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/gl.po b/po/gl.po index 42e01639e0..f6887cb1bd 100644 --- a/po/gl.po +++ b/po/gl.po @@ -12959,7 +12959,7 @@ msgstr "Métrica" msgid "No custom routes are defined." msgstr "Non se definiron rutas personalizadas." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Seleccoine o tipo de conexión escrava que quere engadir." diff --git a/po/gu.po b/po/gu.po index 64faf1ed63..7d5f3748e0 100644 --- a/po/gu.po +++ b/po/gu.po @@ -13562,7 +13562,7 @@ msgstr "મેટ્રિક" msgid "No custom routes are defined." msgstr "કોઇ વૈવિધ્યપૂર્ણ માર્ગો વ્યાખ્યાયિત નથી." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "જે પ્રકારનું ગૌણ જોડાણ તમે ઉમેરવા ઇચ્છો છો તે પસંદ કરો." diff --git a/po/he.po b/po/he.po index 324b885d65..773ae7bc73 100644 --- a/po/he.po +++ b/po/he.po @@ -12551,7 +12551,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/hi.po b/po/hi.po index c5e383a84a..568c5f6e88 100644 --- a/po/hi.po +++ b/po/hi.po @@ -13629,7 +13629,7 @@ msgstr "मेट्रिक" msgid "No custom routes are defined." msgstr "कोई पसंदीदा रूट परिभाषित नहीं है." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "स्लेव कनेक्शन के प्रकार चुनें जिसे आप जोड़ना चाहते हैं." diff --git a/po/hr.po b/po/hr.po index d34c50f446..beac2f070f 100644 --- a/po/hr.po +++ b/po/hr.po @@ -14755,7 +14755,7 @@ msgstr "Metrika" msgid "No custom routes are defined." msgstr "Nema određenih prilagođenih ruta." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Odaberi vrstu pričuvnog povezivanja kojeg želite dodati." diff --git a/po/hu.po b/po/hu.po index 0de916e6f7..b6c0d555ae 100644 --- a/po/hu.po +++ b/po/hu.po @@ -14015,7 +14015,7 @@ msgstr "Metrika" msgid "No custom routes are defined." msgstr "Nincsenek egyéni útvonalak meghatározva." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Válassza ki a hozzáadni kívánt szolgakapcsolat típusát." diff --git a/po/id.po b/po/id.po index ebd88bb37b..192d4e27bd 100644 --- a/po/id.po +++ b/po/id.po @@ -15163,7 +15163,7 @@ msgstr "Metrik" msgid "No custom routes are defined." msgstr "Tidak ada rute ubahan yang didefinisikan." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Pilih tipe koneksi slave yang hendak Anda tambahkan." diff --git a/po/it.po b/po/it.po index 55aa6c7ba6..ae036b8241 100644 --- a/po/it.po +++ b/po/it.po @@ -15247,7 +15247,7 @@ msgstr "Metrica" msgid "No custom routes are defined." msgstr "Nessun instradamento personalizzato definito." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Selezionare il tipo di connessione slave da aggiungere." diff --git a/po/ja.po b/po/ja.po index 983491cfb7..65b9ff3a38 100644 --- a/po/ja.po +++ b/po/ja.po @@ -15170,7 +15170,7 @@ msgstr "メトリック" msgid "No custom routes are defined." msgstr "カスタムのルートが定義されていません。" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "追加したいスレーブ接続のタイプを選択してください。" diff --git a/po/ka.po b/po/ka.po index dc2d56fdf0..9245b74c32 100644 --- a/po/ka.po +++ b/po/ka.po @@ -13032,7 +13032,7 @@ msgstr "მეტრიკა" msgid "No custom routes are defined." msgstr "რაუტები ხელით მითითებული არაა." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/kn.po b/po/kn.po index ecdd9ae810..1960e4e126 100644 --- a/po/kn.po +++ b/po/kn.po @@ -13554,7 +13554,7 @@ msgstr "ಮೆಟ್ರಿಕ್" msgid "No custom routes are defined." msgstr "ಯಾವುದೆ ಅಗತ್ಯಾನುಗುಣ ರೌಟ್‌ಗಳನ್ನು ವಿವರಿಸಲಾಗಿಲ್ಲ" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "ನೀವು ಸೇರಿಸಲು ಬಯಸುವ ಸ್ಲೇವ ಸಂಪರ್ಕವನ್ನು ಆಯ್ಕೆ ಮಾಡಿ." diff --git a/po/ko.po b/po/ko.po index 44a5b50bbf..ff1f75d600 100644 --- a/po/ko.po +++ b/po/ko.po @@ -14935,7 +14935,7 @@ msgstr "메트릭" msgid "No custom routes are defined." msgstr "사용자 지정 라우팅이 정의되어 있지 않습니다." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "추가하려는 슬레이브 연결 유형을 선택합니다." diff --git a/po/ku.po b/po/ku.po index 1992f6fa55..87ef4e1126 100644 --- a/po/ku.po +++ b/po/ku.po @@ -12750,7 +12750,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/lt.po b/po/lt.po index 9f1058673e..d01b135ebf 100644 --- a/po/lt.po +++ b/po/lt.po @@ -13147,7 +13147,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/lv.po b/po/lv.po index 6a2e83cefb..80533958ee 100644 --- a/po/lv.po +++ b/po/lv.po @@ -12784,7 +12784,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 #, fuzzy msgid "Select the type of slave connection you wish to add." msgstr "Izvēlieties kuru VPN savienojuma tipu jūs vēlaties radīt." diff --git a/po/mk.po b/po/mk.po index 94bae32f33..7be786dcfe 100644 --- a/po/mk.po +++ b/po/mk.po @@ -12560,7 +12560,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/ml.po b/po/ml.po index a17bd352bd..ffd99f51da 100644 --- a/po/ml.po +++ b/po/ml.po @@ -13419,7 +13419,7 @@ msgstr "മെട്രിക്ക്" msgid "No custom routes are defined." msgstr "യഥേഷ്ടമായൊരു റൂട്ടുകളും നിഷ്കര്‍ഷിച്ചിട്ടില്ല." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "നിങ്ങള്‍ക്കു് ചേര്‍ക്കുവാനുള്ള സ്ലേവ് കണക്ഷന്‍ രീതി തെരഞ്ഞെടുക്കുക." diff --git a/po/mr.po b/po/mr.po index d382ce055e..cf887ca744 100644 --- a/po/mr.po +++ b/po/mr.po @@ -13486,7 +13486,7 @@ msgstr "मेट्रिक" msgid "No custom routes are defined." msgstr "पसंतीचे राउट्स ठरवले नाही." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "समावेशजोगी स्लेव्ह जोडणीचे प्रकार नीवडा." diff --git a/po/nb.po b/po/nb.po index 23e2ca8419..30c4e8c4e4 100644 --- a/po/nb.po +++ b/po/nb.po @@ -12580,7 +12580,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/ne.po b/po/ne.po index f93ceb60dd..f516ed9e44 100644 --- a/po/ne.po +++ b/po/ne.po @@ -12662,7 +12662,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 #, fuzzy msgid "Select the type of slave connection you wish to add." msgstr "तपाईँ कस्तो प्रकारको भीपीएन जडान सिर्जना गर्न चाहनुहुन्छ रोज्नुहोस् ।" diff --git a/po/nl.po b/po/nl.po index 06b45b011b..1941858a5b 100644 --- a/po/nl.po +++ b/po/nl.po @@ -13195,7 +13195,7 @@ msgstr "Metrisch" msgid "No custom routes are defined." msgstr "Er zijn geen aangepaste routes ingesteld." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/oc.po b/po/oc.po index 379989584e..bea585d289 100644 --- a/po/oc.po +++ b/po/oc.po @@ -13053,7 +13053,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/or.po b/po/or.po index 2f408faa86..808b5a2ca6 100644 --- a/po/or.po +++ b/po/or.po @@ -13403,7 +13403,7 @@ msgstr "ମେଟ୍ରିକ" msgid "No custom routes are defined." msgstr "କୌଣସି ଇଚ୍ଛାରୂପଣ ପଥ ବ୍ୟାଖା କରାଯାଇ ନାହିଁ।" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "ଆପଣ ଯୋଗ କରିବାକୁ ଚାହୁଁଥିବା ସ୍ଲେଭ ସଂଯୋଗ ପ୍ରକାରକୁ ବାଛନ୍ତୁ।" diff --git a/po/pa.po b/po/pa.po index 1775c14778..58937626ae 100644 --- a/po/pa.po +++ b/po/pa.po @@ -13232,7 +13232,7 @@ msgstr "ਮੀਟਰਿਕ" msgid "No custom routes are defined." msgstr "ਕੋਈ ਚੁਣਿੰਦਾ ਰੂਟ ਪਰਿਭਾਸ਼ਤ ਨਹੀਂ ਹਨ।" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "ਜਿਹੜਾ ਸਲੇਵ ਕਨੈਕਸ਼ਨ ਤੁਸੀਂ ਜੋੜਨਾ ਚਾਹੁੰਦੇ ਹੋ, ਉਹ ਚੁਣੋ।" diff --git a/po/pl.po b/po/pl.po index 861b57d09b..df8eb58ef8 100644 --- a/po/pl.po +++ b/po/pl.po @@ -13914,7 +13914,7 @@ msgstr "Parametry" msgid "No custom routes are defined." msgstr "Nie określono żadnych tras użytkownika." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Proszę wybrać typ połączenia podrzędnego do dodania." diff --git a/po/pt.po b/po/pt.po index 9c00362ccc..71663b2bd9 100644 --- a/po/pt.po +++ b/po/pt.po @@ -12706,7 +12706,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index f5e525fa2d..c60244e94a 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -15237,7 +15237,7 @@ msgstr "Métrica" msgid "No custom routes are defined." msgstr "Nenhuma rota de cliente foi definida." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Selecionar o tipo de conexão escrava que você deseja adicionar." diff --git a/po/ro.po b/po/ro.po index 33b2dc7e3b..dec5471b2f 100644 --- a/po/ro.po +++ b/po/ro.po @@ -12815,7 +12815,7 @@ msgstr "Metrică" msgid "No custom routes are defined." msgstr "Nu sunt definite rute personalizate." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Alegeți tipul conexiunii secundare pe care doriți s-o creați." diff --git a/po/ru.po b/po/ru.po index 0972558d9c..b8233e35cb 100644 --- a/po/ru.po +++ b/po/ru.po @@ -15839,7 +15839,7 @@ msgstr "Метрика" msgid "No custom routes are defined." msgstr "Нет дополнительных маршрутов." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Выберите тип добавляемого подчинённого подключения." diff --git a/po/rw.po b/po/rw.po index eb597cf164..91ca49fbce 100644 --- a/po/rw.po +++ b/po/rw.po @@ -12760,7 +12760,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/sk.po b/po/sk.po index 4b8eed3a11..e755a05217 100644 --- a/po/sk.po +++ b/po/sk.po @@ -12804,7 +12804,7 @@ msgstr "Metrika" msgid "No custom routes are defined." msgstr "Nie sú definované žiane vlastné smerovania." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Vyberte typ podriadeného spojenia, ktoré si želáte pridať." diff --git a/po/sl.po b/po/sl.po index 0b471c41d2..b8b3028d94 100644 --- a/po/sl.po +++ b/po/sl.po @@ -12911,7 +12911,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/sq.po b/po/sq.po index 7e6af58ed2..c7941e261f 100644 --- a/po/sq.po +++ b/po/sq.po @@ -12634,7 +12634,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/sr.po b/po/sr.po index 04049c0e6f..fe20605596 100644 --- a/po/sr.po +++ b/po/sr.po @@ -12987,7 +12987,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/sr@latin.po b/po/sr@latin.po index 7a05d7f62c..93edf41fd0 100644 --- a/po/sr@latin.po +++ b/po/sr@latin.po @@ -12992,7 +12992,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/sv.po b/po/sv.po index 38ad0e6f4f..21eb6bb3b9 100644 --- a/po/sv.po +++ b/po/sv.po @@ -14887,7 +14887,7 @@ msgstr "Mätvärde" msgid "No custom routes are defined." msgstr "Inga anpassade rutter är definierade." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Välj den typ av slavanslutning du vill lägga till." diff --git a/po/ta.po b/po/ta.po index 73ba34abf4..3cf6f955ca 100644 --- a/po/ta.po +++ b/po/ta.po @@ -13568,7 +13568,7 @@ msgstr "மெட்ரிக்" msgid "No custom routes are defined." msgstr "தனிப்பயன் தடங்கள் ஏதும் வரையறுக்கப்படவில்லை." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "நீங்கள் சேர்க்க விரும்பும் அடிமை இணைப்பு வகையைத் தேர்ந்தெடுக்கவும்." diff --git a/po/te.po b/po/te.po index 9ed1b982b6..7c1ae91983 100644 --- a/po/te.po +++ b/po/te.po @@ -13475,7 +13475,7 @@ msgstr "మెట్రిక్" msgid "No custom routes are defined." msgstr "ఏ మలచిన రౌట్లు నిర్వచించలేదు." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "మీరు జతచేయాలని అనుకొంటున్న స్లేవ్ అనుసంధానం రకం ఎంపికచేయి." diff --git a/po/th.po b/po/th.po index 9c7c00397d..43993937dc 100644 --- a/po/th.po +++ b/po/th.po @@ -12786,7 +12786,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/tr.po b/po/tr.po index 6b2e51c74c..4c4fe18f55 100644 --- a/po/tr.po +++ b/po/tr.po @@ -13521,7 +13521,7 @@ msgstr "Ölçü" msgid "No custom routes are defined." msgstr "Tanımlanmış bir özel yönlendirme yok." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Eklemek istediğiniz ikincil bağlantının türünü seçin." diff --git a/po/uk.po b/po/uk.po index cbaa5d7d9c..9a84bbe33e 100644 --- a/po/uk.po +++ b/po/uk.po @@ -16080,7 +16080,7 @@ msgstr "Метрика" msgid "No custom routes are defined." msgstr "Нетипових маршрутів не визначено." -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "Виберіть тип підлеглого з'єднання, яке ви хочете додати." diff --git a/po/vi.po b/po/vi.po index 8326d3749c..eeca507642 100644 --- a/po/vi.po +++ b/po/vi.po @@ -12605,7 +12605,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/wa.po b/po/wa.po index 8eaab9504d..c06e14e270 100644 --- a/po/wa.po +++ b/po/wa.po @@ -12715,7 +12715,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 017f4cc1d8..75697639b4 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -14581,7 +14581,7 @@ msgstr "跃点数" msgid "No custom routes are defined." msgstr "未定义自定义陆游。" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "选择您要添加的从连接类型。" diff --git a/po/zh_HK.po b/po/zh_HK.po index 4309ec9f94..56083ffd34 100644 --- a/po/zh_HK.po +++ b/po/zh_HK.po @@ -12812,7 +12812,7 @@ msgstr "" msgid "No custom routes are defined." msgstr "" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "" diff --git a/po/zh_TW.po b/po/zh_TW.po index f160d06635..1baea8eddc 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -14298,7 +14298,7 @@ msgstr "公制" msgid "No custom routes are defined." msgstr "沒有已定義的自訂路線。" -#: src/nmtui/nmt-slave-list.c:126 +#: src/nmtui/nmt-port-list.c:126 msgid "Select the type of slave connection you wish to add." msgstr "選擇您想要新增的 slave 連線類型。" diff --git a/src/nmtui/meson.build b/src/nmtui/meson.build index 97ea9f32ec..13aa864750 100644 --- a/src/nmtui/meson.build +++ b/src/nmtui/meson.build @@ -40,7 +40,7 @@ executable( 'nmt-route-editor.c', 'nmt-route-entry.c', 'nmt-route-table.c', - 'nmt-slave-list.c', + 'nmt-port-list.c', 'nmt-wireguard-peer-list.c', 'nmt-wireguard-peer-editor.c', 'nmtui.c', diff --git a/src/nmtui/nm-editor-utils.c b/src/nmtui/nm-editor-utils.c index 0b6c00eec0..718c0aefb7 100644 --- a/src/nmtui/nm-editor-utils.c +++ b/src/nmtui/nm-editor-utils.c @@ -201,22 +201,22 @@ nm_editor_utils_get_connection_type_list(void) item->connection_setup_func = bond_connection_setup_func; g_ptr_array_add(array, item); - item = g_new0(NMEditorConnectionTypeDataReal, 1); - item->data.name = _("Bridge"); - item->data.setting_type = NM_TYPE_SETTING_BRIDGE; - item->data.slave_setting_type = NM_TYPE_SETTING_BRIDGE_PORT; - item->data.device_type = NM_TYPE_DEVICE_BRIDGE; - item->data.virtual = TRUE; - item->id_format = _("Bridge connection %d"); + item = g_new0(NMEditorConnectionTypeDataReal, 1); + item->data.name = _("Bridge"); + item->data.setting_type = NM_TYPE_SETTING_BRIDGE; + item->data.port_setting_type = NM_TYPE_SETTING_BRIDGE_PORT; + item->data.device_type = NM_TYPE_DEVICE_BRIDGE; + item->data.virtual = TRUE; + item->id_format = _("Bridge connection %d"); g_ptr_array_add(array, item); - item = g_new0(NMEditorConnectionTypeDataReal, 1); - item->data.name = _("Team"); - item->data.setting_type = NM_TYPE_SETTING_TEAM; - item->data.slave_setting_type = NM_TYPE_SETTING_TEAM_PORT; - item->data.device_type = NM_TYPE_DEVICE_TEAM; - item->data.virtual = TRUE; - item->id_format = _("Team connection %d"); + item = g_new0(NMEditorConnectionTypeDataReal, 1); + item->data.name = _("Team"); + item->data.setting_type = NM_TYPE_SETTING_TEAM; + item->data.port_setting_type = NM_TYPE_SETTING_TEAM_PORT; + item->data.device_type = NM_TYPE_DEVICE_TEAM; + item->data.virtual = TRUE; + item->id_format = _("Team connection %d"); g_ptr_array_add(array, item); item = g_new0(NMEditorConnectionTypeDataReal, 1); @@ -367,46 +367,46 @@ get_available_iface_name(const char *try_name, NMClient *client) /** * nm_editor_utils_create_connection: * @type: the type of the connection's primary #NMSetting - * @master: (nullable): the connection's master, if any + * @controller: (nullable): the connection's controller, if any * @client: an #NMClient * * Creates a new #NMConnection of the given type, automatically * creating a UUID and an appropriate not-currently-in-use connection * name, setting #NMSettingConnection:autoconnect appropriately for - * the connection type, filling in slave-related information if - * @master is not %NULL, and initializing any other mandatory-to-set + * the connection type, filling in port-related information if + * @controller is not %NULL, and initializing any other mandatory-to-set * properties to reasonable initial values. * * Returns: a new #NMConnection */ NMConnection * -nm_editor_utils_create_connection(GType type, NMConnection *master, NMClient *client) +nm_editor_utils_create_connection(GType type, NMConnection *controller, NMClient *client) { NMEditorConnectionTypeData **types; - NMEditorConnectionTypeDataReal *type_data = NULL; - const char *master_setting_type = NULL, *master_uuid = NULL; - GType master_type = G_TYPE_INVALID, slave_setting_type = G_TYPE_INVALID; + NMEditorConnectionTypeDataReal *type_data = NULL; + const char *controller_setting_type = NULL, *controller_uuid = NULL; + GType controller_type = G_TYPE_INVALID, port_setting_type = G_TYPE_INVALID; NMConnection *connection; NMSettingConnection *s_con; - NMSetting *s_hw, *s_slave; + NMSetting *s_hw, *s_port; char *uuid, *id, *ifname; int i; - if (master) { - NMSettingConnection *master_s_con; + if (controller) { + NMSettingConnection *controller_s_con; - master_s_con = nm_connection_get_setting_connection(master); - master_setting_type = nm_setting_connection_get_connection_type(master_s_con); - master_uuid = nm_setting_connection_get_uuid(master_s_con); - master_type = nm_setting_lookup_type(master_setting_type); + controller_s_con = nm_connection_get_setting_connection(controller); + controller_setting_type = nm_setting_connection_get_connection_type(controller_s_con); + controller_uuid = nm_setting_connection_get_uuid(controller_s_con); + controller_type = nm_setting_lookup_type(controller_setting_type); } types = nm_editor_utils_get_connection_type_list(); for (i = 0; types[i]; i++) { if (types[i]->setting_type == type) type_data = (NMEditorConnectionTypeDataReal *) types[i]; - if (types[i]->setting_type == master_type) - slave_setting_type = types[i]->slave_setting_type; + if (types[i]->setting_type == controller_type) + port_setting_type = types[i]->port_setting_type; } if (!type_data) { g_return_val_if_reached(NULL); @@ -430,9 +430,9 @@ nm_editor_utils_create_connection(GType type, NMConnection *master, NMClient *cl else ifname = NULL; - if (slave_setting_type != G_TYPE_INVALID) { - s_slave = g_object_new(slave_setting_type, NULL); - nm_connection_add_setting(connection, s_slave); + if (port_setting_type != G_TYPE_INVALID) { + s_port = g_object_new(port_setting_type, NULL); + nm_connection_add_setting(connection, s_port); } uuid = nm_utils_uuid_generate(); @@ -448,9 +448,9 @@ nm_editor_utils_create_connection(GType type, NMConnection *master, NMClient *cl NM_SETTING_CONNECTION_AUTOCONNECT, !type_data->no_autoconnect, NM_SETTING_CONNECTION_MASTER, - master_uuid, + controller_uuid, NM_SETTING_CONNECTION_SLAVE_TYPE, - master_setting_type, + controller_setting_type, NM_SETTING_CONNECTION_INTERFACE_NAME, ifname, NULL); diff --git a/src/nmtui/nm-editor-utils.h b/src/nmtui/nm-editor-utils.h index decbc271a2..98f59595b3 100644 --- a/src/nmtui/nm-editor-utils.h +++ b/src/nmtui/nm-editor-utils.h @@ -9,7 +9,7 @@ typedef struct { const char *name; GType setting_type; - GType slave_setting_type; + GType port_setting_type; GType device_type; gboolean virtual; } NMEditorConnectionTypeData; @@ -17,6 +17,7 @@ typedef struct { NMEditorConnectionTypeData **nm_editor_utils_get_connection_type_list(void); NMEditorConnectionTypeData *nm_editor_utils_get_connection_type_data(NMConnection *conn); -NMConnection *nm_editor_utils_create_connection(GType type, NMConnection *master, NMClient *client); +NMConnection * +nm_editor_utils_create_connection(GType type, NMConnection *controller, NMClient *client); #endif /* NM_EDITOR_UTILS_H */ diff --git a/src/nmtui/nmt-edit-connection-list.c b/src/nmtui/nmt-edit-connection-list.c index aec669c81b..f8d8303b65 100644 --- a/src/nmtui/nmt-edit-connection-list.c +++ b/src/nmtui/nmt-edit-connection-list.c @@ -490,7 +490,7 @@ nmt_edit_connection_list_class_init(NmtEditConnectionListClass *list_class) * * If %TRUE, connections should be grouped by type, with headers * indicating the types (as in the main connection list). If %FALSE, - * they will not be grouped (as in slave connection lists). + * they will not be grouped (as in port connection lists). */ g_object_class_install_property( object_class, diff --git a/src/nmtui/nmt-editor-page.c b/src/nmtui/nmt-editor-page.c index d94b1f0fe9..7af277fcc5 100644 --- a/src/nmtui/nmt-editor-page.c +++ b/src/nmtui/nmt-editor-page.c @@ -104,7 +104,7 @@ nmt_editor_page_add_section(NmtEditorPage *page, NmtEditorSection *section) * * This method is called when the user saves the connection. It gives * the page a chance to do save its data outside the connections (such as - * recommit the slave connections). + * recommit the port connections). */ void nmt_editor_page_saved(NmtEditorPage *page) diff --git a/src/nmtui/nmt-editor.c b/src/nmtui/nmt-editor.c index 9a64333afc..ad8803b6b4 100644 --- a/src/nmtui/nmt-editor.c +++ b/src/nmtui/nmt-editor.c @@ -306,7 +306,7 @@ nmt_editor_constructed(GObject *object) const char *deventry_label; NmtDeviceEntry *deventry; GType hardware_type; - const char *slave_type; + const char *port_type; NmtEditorPage *page; if (G_OBJECT_CLASS(nmt_editor_parent_class)->constructed) @@ -385,13 +385,13 @@ nmt_editor_constructed(GObject *object) add_sections_for_page(editor, grid, page); nmt_editor_grid_append(grid, NULL, nmt_newt_separator_new(), NULL); - slave_type = nm_setting_connection_get_slave_type(s_con); - if (slave_type) { - if (!strcmp(slave_type, NM_SETTING_BRIDGE_SETTING_NAME)) + port_type = nm_setting_connection_get_slave_type(s_con); + if (port_type) { + if (!strcmp(port_type, NM_SETTING_BRIDGE_SETTING_NAME)) add_sections_for_page(editor, grid, nmt_page_bridge_port_new(priv->edit_connection)); - else if (!strcmp(slave_type, NM_SETTING_TEAM_SETTING_NAME)) + else if (!strcmp(port_type, NM_SETTING_TEAM_SETTING_NAME)) add_sections_for_page(editor, grid, nmt_page_team_port_new(priv->edit_connection)); - else if (nm_streq(slave_type, NM_SETTING_BOND_SETTING_NAME)) + else if (nm_streq(port_type, NM_SETTING_BOND_SETTING_NAME)) add_sections_for_page(editor, grid, nmt_page_bond_port_new(priv->edit_connection)); } else { NmtNewtWidget *section; diff --git a/src/nmtui/nmt-page-bond.c b/src/nmtui/nmt-page-bond.c index 3396320dab..5a64590cdd 100644 --- a/src/nmtui/nmt-page-bond.c +++ b/src/nmtui/nmt-page-bond.c @@ -22,7 +22,7 @@ #include "libnm-core-aux-intern/nm-libnm-core-utils.h" #include "nmt-mac-entry.h" #include "nmt-address-list.h" -#include "nmt-slave-list.h" +#include "nmt-port-list.h" G_DEFINE_TYPE(NmtPageBond, nmt_page_bond, NMT_TYPE_EDITOR_PAGE_DEVICE) @@ -36,7 +36,7 @@ typedef enum { } NmtPageBondMonitoringMode; typedef struct { - NmtSlaveList *slaves; + NmtPortList *ports; /* Note: when adding new options to the UI also ensure they are * initialized in bond_connection_setup_func() @@ -53,7 +53,7 @@ typedef struct { NmtPageBondMonitoringMode monitoring_mode; NMSettingBond *s_bond; - GType slave_type; + GType port_type; gboolean updating; } NmtPageBondPrivate; @@ -75,7 +75,7 @@ nmt_page_bond_init(NmtPageBond *bond) NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE(bond); priv->monitoring_mode = NMT_PAGE_BOND_MONITORING_UNKNOWN; - priv->slave_type = G_TYPE_NONE; + priv->port_type = G_TYPE_NONE; } static NmtNewtPopupEntry bond_mode[] = { @@ -159,30 +159,30 @@ bond_options_changed(GObject *object, GParamSpec *pspec, gpointer user_data) } static void -slaves_changed(GObject *object, GParamSpec *pspec, gpointer user_data) +ports_changed(GObject *object, GParamSpec *pspec, gpointer user_data) { NmtPageBond *bond = NMT_PAGE_BOND(user_data); NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE(bond); - GPtrArray *slaves; + GPtrArray *ports; - g_object_get(object, "connections", &slaves, NULL); - if (slaves->len == 0) { - if (priv->slave_type == G_TYPE_NONE) + g_object_get(object, "connections", &ports, NULL); + if (ports->len == 0) { + if (priv->port_type == G_TYPE_NONE) return; - priv->slave_type = G_TYPE_NONE; + priv->port_type = G_TYPE_NONE; } else { - NMConnection *slave = slaves->pdata[0]; + NMConnection *port = ports->pdata[0]; - if (priv->slave_type != G_TYPE_NONE) + if (priv->port_type != G_TYPE_NONE) return; - if (nm_connection_is_type(slave, NM_SETTING_INFINIBAND_SETTING_NAME)) - priv->slave_type = NM_TYPE_SETTING_INFINIBAND; + if (nm_connection_is_type(port, NM_SETTING_INFINIBAND_SETTING_NAME)) + priv->port_type = NM_TYPE_SETTING_INFINIBAND; else - priv->slave_type = NM_TYPE_SETTING_WIRED; + priv->port_type = NM_TYPE_SETTING_WIRED; } - if (priv->slave_type == NM_TYPE_SETTING_INFINIBAND) { + if (priv->port_type == NM_TYPE_SETTING_INFINIBAND) { nmt_newt_popup_set_active_id(priv->mode, "active-backup"); nmt_newt_component_set_sensitive(NMT_NEWT_COMPONENT(priv->mode), FALSE); } else @@ -314,9 +314,9 @@ bond_connection_type_filter(GType connection_type, gpointer user_data) NmtPageBond *bond = user_data; NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE(bond); - if (priv->slave_type != NM_TYPE_SETTING_WIRED && connection_type == NM_TYPE_SETTING_INFINIBAND) + if (priv->port_type != NM_TYPE_SETTING_WIRED && connection_type == NM_TYPE_SETTING_INFINIBAND) return TRUE; - if (priv->slave_type != NM_TYPE_SETTING_INFINIBAND && connection_type == NM_TYPE_SETTING_WIRED) + if (priv->port_type != NM_TYPE_SETTING_INFINIBAND && connection_type == NM_TYPE_SETTING_WIRED) return TRUE; return FALSE; @@ -346,10 +346,10 @@ nmt_page_bond_constructed(GObject *object) nmt_editor_grid_append(grid, _("Slaves"), widget, NULL); nmt_editor_grid_set_row_flags(grid, widget, NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT); - widget = nmt_slave_list_new(conn, bond_connection_type_filter, bond); - g_signal_connect(widget, "notify::connections", G_CALLBACK(slaves_changed), bond); + widget = nmt_port_list_new(conn, bond_connection_type_filter, bond); + g_signal_connect(widget, "notify::connections", G_CALLBACK(ports_changed), bond); nmt_editor_grid_append(grid, NULL, widget, NULL); - priv->slaves = NMT_SLAVE_LIST(widget); + priv->ports = NMT_PORT_LIST(widget); widget = nmt_newt_popup_new(bond_mode); g_signal_connect(widget, "notify::active-id", G_CALLBACK(mode_widget_changed), bond); @@ -408,7 +408,7 @@ nmt_page_bond_constructed(GObject *object) G_CALLBACK(bond_options_changed), bond); bond_options_changed(G_OBJECT(s_bond), NULL, bond); - slaves_changed(G_OBJECT(priv->slaves), NULL, bond); + ports_changed(G_OBJECT(priv->ports), NULL, bond); nmt_editor_page_add_section(NMT_EDITOR_PAGE(bond), section); @@ -420,7 +420,7 @@ nmt_page_bond_saved(NmtEditorPage *editor_page) { NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE(editor_page); - nmt_edit_connection_list_recommit(NMT_EDIT_CONNECTION_LIST(priv->slaves)); + nmt_edit_connection_list_recommit(NMT_EDIT_CONNECTION_LIST(priv->ports)); } static void diff --git a/src/nmtui/nmt-page-bridge.c b/src/nmtui/nmt-page-bridge.c index bc32e2a28c..e84af1d829 100644 --- a/src/nmtui/nmt-page-bridge.c +++ b/src/nmtui/nmt-page-bridge.c @@ -14,7 +14,7 @@ #include "libnm-core-aux-intern/nm-libnm-core-utils.h" #include "nmt-address-list.h" -#include "nmt-slave-list.h" +#include "nmt-port-list.h" G_DEFINE_TYPE(NmtPageBridge, nmt_page_bridge, NMT_TYPE_EDITOR_PAGE_DEVICE) @@ -22,7 +22,7 @@ G_DEFINE_TYPE(NmtPageBridge, nmt_page_bridge, NMT_TYPE_EDITOR_PAGE_DEVICE) (G_TYPE_INSTANCE_GET_PRIVATE((o), NMT_TYPE_PAGE_BRIDGE, NmtPageBridgePrivate)) typedef struct { - NmtSlaveList *slaves; + NmtPortList *ports; } NmtPageBridgePrivate; NmtEditorPage * @@ -63,9 +63,9 @@ nmt_page_bridge_constructed(GObject *object) nmt_editor_grid_append(grid, _("Slaves"), widget, NULL); nmt_editor_grid_set_row_flags(grid, widget, NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT); - widget = nmt_slave_list_new(conn, bridge_connection_type_filter, bridge); + widget = nmt_port_list_new(conn, bridge_connection_type_filter, bridge); nmt_editor_grid_append(grid, NULL, widget, NULL); - priv->slaves = NMT_SLAVE_LIST(widget); + priv->ports = NMT_PORT_LIST(widget); widget = nmt_newt_entry_numeric_new(10, 0, 1000000); g_object_bind_property(s_bridge, @@ -165,7 +165,7 @@ nmt_page_bridge_saved(NmtEditorPage *editor_page) { NmtPageBridgePrivate *priv = NMT_PAGE_BRIDGE_GET_PRIVATE(editor_page); - nmt_edit_connection_list_recommit(NMT_EDIT_CONNECTION_LIST(priv->slaves)); + nmt_edit_connection_list_recommit(NMT_EDIT_CONNECTION_LIST(priv->ports)); } static void diff --git a/src/nmtui/nmt-page-team.c b/src/nmtui/nmt-page-team.c index 1a554aada1..f6311c7ec1 100644 --- a/src/nmtui/nmt-page-team.c +++ b/src/nmtui/nmt-page-team.c @@ -13,7 +13,7 @@ #include "nmt-page-team.h" #include "libnm-core-aux-intern/nm-libnm-core-utils.h" -#include "nmt-slave-list.h" +#include "nmt-port-list.h" G_DEFINE_TYPE(NmtPageTeam, nmt_page_team, NMT_TYPE_EDITOR_PAGE_DEVICE) @@ -21,10 +21,10 @@ G_DEFINE_TYPE(NmtPageTeam, nmt_page_team, NMT_TYPE_EDITOR_PAGE_DEVICE) (G_TYPE_INSTANCE_GET_PRIVATE((o), NMT_TYPE_PAGE_TEAM, NmtPageTeamPrivate)) typedef struct { - NmtSlaveList *slaves; + NmtPortList *ports; NMSettingTeam *s_team; - GType slave_type; + GType port_type; } NmtPageTeamPrivate; @@ -39,26 +39,26 @@ nmt_page_team_init(NmtPageTeam *team) { NmtPageTeamPrivate *priv = NMT_PAGE_TEAM_GET_PRIVATE(team); - priv->slave_type = G_TYPE_NONE; + priv->port_type = G_TYPE_NONE; } static void -slaves_changed(GObject *object, GParamSpec *pspec, gpointer user_data) +ports_changed(GObject *object, GParamSpec *pspec, gpointer user_data) { NmtPageTeam *team = NMT_PAGE_TEAM(user_data); NmtPageTeamPrivate *priv = NMT_PAGE_TEAM_GET_PRIVATE(team); - GPtrArray *slaves; + GPtrArray *ports; - g_object_get(object, "connections", &slaves, NULL); - if (slaves->len == 0) { - priv->slave_type = G_TYPE_NONE; - } else if (priv->slave_type == G_TYPE_NONE) { - NMConnection *slave = slaves->pdata[0]; + g_object_get(object, "connections", &ports, NULL); + if (ports->len == 0) { + priv->port_type = G_TYPE_NONE; + } else if (priv->port_type == G_TYPE_NONE) { + NMConnection *port = ports->pdata[0]; - if (nm_connection_is_type(slave, NM_SETTING_INFINIBAND_SETTING_NAME)) - priv->slave_type = NM_TYPE_SETTING_INFINIBAND; + if (nm_connection_is_type(port, NM_SETTING_INFINIBAND_SETTING_NAME)) + priv->port_type = NM_TYPE_SETTING_INFINIBAND; else - priv->slave_type = NM_TYPE_SETTING_WIRED; + priv->port_type = NM_TYPE_SETTING_WIRED; } } @@ -68,11 +68,11 @@ team_connection_type_filter(GType connection_type, gpointer user_data) NmtPageTeam *team = user_data; NmtPageTeamPrivate *priv = NMT_PAGE_TEAM_GET_PRIVATE(team); - if (priv->slave_type != NM_TYPE_SETTING_WIRED) { + if (priv->port_type != NM_TYPE_SETTING_WIRED) { if (connection_type == NM_TYPE_SETTING_INFINIBAND) return TRUE; } - if (priv->slave_type != NM_TYPE_SETTING_INFINIBAND) { + if (priv->port_type != NM_TYPE_SETTING_INFINIBAND) { if (connection_type == NM_TYPE_SETTING_WIRED || connection_type == NM_TYPE_SETTING_WIRELESS || connection_type == NM_TYPE_SETTING_VLAN) return TRUE; @@ -126,12 +126,12 @@ nmt_page_team_constructed(GObject *object) widget = nmt_newt_label_new(_("Slaves")); nmt_newt_grid_add(grid, widget, 0, 0); - widget = nmt_slave_list_new(conn, team_connection_type_filter, team); - g_signal_connect(widget, "notify::connections", G_CALLBACK(slaves_changed), team); + widget = nmt_port_list_new(conn, team_connection_type_filter, team); + g_signal_connect(widget, "notify::connections", G_CALLBACK(ports_changed), team); nmt_newt_grid_add(grid, widget, 0, 1); nmt_newt_widget_set_padding(widget, 0, 0, 0, 1); - priv->slaves = NMT_SLAVE_LIST(widget); - slaves_changed(G_OBJECT(priv->slaves), NULL, team); + priv->ports = NMT_PORT_LIST(widget); + ports_changed(G_OBJECT(priv->ports), NULL, team); widget = nmt_newt_label_new(_("JSON configuration")); nmt_newt_grid_add(grid, widget, 0, 2); @@ -156,7 +156,7 @@ nmt_page_team_saved(NmtEditorPage *editor_page) { NmtPageTeamPrivate *priv = NMT_PAGE_TEAM_GET_PRIVATE(editor_page); - nmt_edit_connection_list_recommit(NMT_EDIT_CONNECTION_LIST(priv->slaves)); + nmt_edit_connection_list_recommit(NMT_EDIT_CONNECTION_LIST(priv->ports)); } static void diff --git a/src/nmtui/nmt-port-list.c b/src/nmtui/nmt-port-list.c new file mode 100644 index 0000000000..9f964c73ff --- /dev/null +++ b/src/nmtui/nmt-port-list.c @@ -0,0 +1,254 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2013 Red Hat, Inc. + */ + +/** + * SECTION:nmt-port-list: + * @short_description: An editable list of a connection's ports + * + * #NmtPortList implements an #NmtEditConnectionList for the + * ports of a connection. + */ + +#include "libnm-client-aux-extern/nm-default-client.h" + +#include "nmt-port-list.h" + +G_DEFINE_TYPE(NmtPortList, nmt_port_list, NMT_TYPE_EDIT_CONNECTION_LIST) + +#define NMT_PORT_LIST_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE((o), NMT_TYPE_PORT_LIST, NmtPortListPrivate)) + +typedef struct { + NMConnection *controller; + const char *controller_type, *controller_uuid; + + NmtAddConnectionTypeFilter type_filter; + gpointer type_filter_data; +} NmtPortListPrivate; + +enum { + PROP_0, + PROP_CONTROLLER, + PROP_TYPE_FILTER, + PROP_TYPE_FILTER_DATA, + + LAST_PROP +}; + +static gboolean nmt_port_list_connection_filter(NmtEditConnectionList *list, + NMConnection *connection, + gpointer user_data); + +/** + * nmt_port_list_new: + * @controller: the controller #NMConnection whose ports are being listed + * @type_filter: (nullable): a function to limit the available port types + * @type_filter_data: (nullable): data for @type_filter. + * + * Creates a new #NmtPortList. + * + * If @type_filter is non-%NULL, it will be used to limit the connection + * types that are available when the user clicks on the "Add" button to add + * a new port. If the @type_filter filters the list down to only a single + * connection type, then the user will not be presented with a connection-type + * dialog, and will instead be immediately taken to an editor window for the + * new port after clicking "Add". + * + * Returns: a new #NmtPortList. + */ +NmtNewtWidget * +nmt_port_list_new(NMConnection *controller, + NmtAddConnectionTypeFilter type_filter, + gpointer type_filter_data) +{ + return g_object_new(NMT_TYPE_PORT_LIST, + "controller", + controller, + "type-filter", + type_filter, + "type-filter-data", + type_filter_data, + "grouped", + FALSE, + "connection-filter", + nmt_port_list_connection_filter, + NULL); +} + +static void +nmt_port_list_init(NmtPortList *list) +{} + +static void +nmt_port_list_finalize(GObject *object) +{ + NmtPortListPrivate *priv = NMT_PORT_LIST_GET_PRIVATE(object); + + g_object_unref(priv->controller); + + G_OBJECT_CLASS(nmt_port_list_parent_class)->finalize(object); +} + +static gboolean +nmt_port_list_connection_filter(NmtEditConnectionList *list, + NMConnection *connection, + gpointer user_data) +{ + NmtPortListPrivate *priv = NMT_PORT_LIST_GET_PRIVATE(list); + NMSettingConnection *s_con; + const char *controller, *controller_ifname, *port_type; + + s_con = nm_connection_get_setting_connection(connection); + g_return_val_if_fail(s_con != NULL, FALSE); + + port_type = nm_setting_connection_get_slave_type(s_con); + if (g_strcmp0(port_type, priv->controller_type) != 0) + return FALSE; + + controller = nm_setting_connection_get_master(s_con); + if (!controller) + return FALSE; + + controller_ifname = nm_connection_get_interface_name(priv->controller); + if (g_strcmp0(controller, controller_ifname) != 0 + && g_strcmp0(controller, priv->controller_uuid) != 0) + return FALSE; + + return TRUE; +} + +static void +nmt_port_list_add_connection(NmtEditConnectionList *list) +{ + NmtPortListPrivate *priv = NMT_PORT_LIST_GET_PRIVATE(list); + + nmt_add_connection_full(_("Select the type of slave connection you wish to add."), + NULL, + priv->controller, + priv->type_filter, + priv->type_filter_data); +} + +static void +nmt_port_list_edit_connection(NmtEditConnectionList *list, NMConnection *connection) +{ + nmt_edit_connection(connection); +} + +static void +nmt_port_list_remove_connection(NmtEditConnectionList *list, NMRemoteConnection *connection) +{ + nmt_remove_connection(connection); +} + +static void +nmt_port_list_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + NmtPortListPrivate *priv = NMT_PORT_LIST_GET_PRIVATE(object); + + switch (prop_id) { + case PROP_CONTROLLER: + priv->controller = g_value_dup_object(value); + if (priv->controller) { + NMSettingConnection *s_con = nm_connection_get_setting_connection(priv->controller); + + priv->controller_type = nm_setting_connection_get_connection_type(s_con); + priv->controller_uuid = nm_setting_connection_get_uuid(s_con); + } + break; + case PROP_TYPE_FILTER: + priv->type_filter = g_value_get_pointer(value); + break; + case PROP_TYPE_FILTER_DATA: + priv->type_filter_data = g_value_get_pointer(value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } +} + +static void +nmt_port_list_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + NmtPortListPrivate *priv = NMT_PORT_LIST_GET_PRIVATE(object); + + switch (prop_id) { + case PROP_CONTROLLER: + g_value_set_object(value, priv->controller); + break; + case PROP_TYPE_FILTER: + g_value_set_pointer(value, priv->type_filter); + break; + case PROP_TYPE_FILTER_DATA: + g_value_set_pointer(value, priv->type_filter_data); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } +} + +static void +nmt_port_list_class_init(NmtPortListClass *list_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS(list_class); + NmtEditConnectionListClass *connection_list_class = NMT_EDIT_CONNECTION_LIST_CLASS(list_class); + + g_type_class_add_private(list_class, sizeof(NmtPortListPrivate)); + + /* virtual methods */ + object_class->set_property = nmt_port_list_set_property; + object_class->get_property = nmt_port_list_get_property; + object_class->finalize = nmt_port_list_finalize; + + connection_list_class->add_connection = nmt_port_list_add_connection; + connection_list_class->edit_connection = nmt_port_list_edit_connection; + connection_list_class->remove_connection = nmt_port_list_remove_connection; + + /** + * NmtPortList:controller: + * + * The controller #NMConnection whose ports are being displayed. + */ + g_object_class_install_property( + object_class, + PROP_CONTROLLER, + g_param_spec_object("controller", + "", + "", + NM_TYPE_CONNECTION, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + /** + * NmtPortList:type-filter: + * + * If non-%NULL, this will be used to limit the connection types + * that are available when the user clicks on the "Add" button to + * add a new port. If the filter filters the list down to only a + * single connection type, then the user will not be presented + * with a connection-type dialog, and will instead be immediately + * taken to an editor window for the new port after clicking + * "Add". + */ + g_object_class_install_property( + object_class, + PROP_TYPE_FILTER, + g_param_spec_pointer("type-filter", + "", + "", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + /** + * NmtPortList:type-filter-data: + * + * User data passed to #NmtPortList:type-filter + */ + g_object_class_install_property( + object_class, + PROP_TYPE_FILTER_DATA, + g_param_spec_pointer("type-filter-data", + "", + "", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); +} diff --git a/src/nmtui/nmt-port-list.h b/src/nmtui/nmt-port-list.h new file mode 100644 index 0000000000..df4f22ff18 --- /dev/null +++ b/src/nmtui/nmt-port-list.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2013 Red Hat, Inc. + */ + +#ifndef NMT_PORT_LIST_H +#define NMT_PORT_LIST_H + +#include "nmt-edit-connection-list.h" +#include "nmtui-edit.h" + +#define NMT_TYPE_PORT_LIST (nmt_port_list_get_type()) +#define NMT_PORT_LIST(obj) (_NM_G_TYPE_CHECK_INSTANCE_CAST((obj), NMT_TYPE_PORT_LIST, NmtPortList)) +#define NMT_PORT_LIST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NMT_TYPE_PORT_LIST, NmtPortListClass)) +#define NMT_IS_PORT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NMT_TYPE_PORT_LIST)) +#define NMT_IS_PORT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NMT_TYPE_PORT_LIST)) +#define NMT_PORT_LIST_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), NMT_TYPE_PORT_LIST, NmtPortListClass)) + +typedef struct { + NmtEditConnectionList parent; + +} NmtPortList; + +typedef struct { + NmtEditConnectionListClass parent; + +} NmtPortListClass; + +GType nmt_port_list_get_type(void); + +NmtNewtWidget *nmt_port_list_new(NMConnection *controller, + NmtAddConnectionTypeFilter type_filter, + gpointer type_filter_data); + +#endif /* NMT_PORT_LIST_H */ diff --git a/src/nmtui/nmt-slave-list.c b/src/nmtui/nmt-slave-list.c deleted file mode 100644 index c523f305e5..0000000000 --- a/src/nmtui/nmt-slave-list.c +++ /dev/null @@ -1,253 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Copyright (C) 2013 Red Hat, Inc. - */ - -/** - * SECTION:nmt-slave-list: - * @short_description: An editable list of a connection's slaves - * - * #NmtSlaveList implements an #NmtEditConnectionList for the - * slaves of a connection. - */ - -#include "libnm-client-aux-extern/nm-default-client.h" - -#include "nmt-slave-list.h" - -G_DEFINE_TYPE(NmtSlaveList, nmt_slave_list, NMT_TYPE_EDIT_CONNECTION_LIST) - -#define NMT_SLAVE_LIST_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE((o), NMT_TYPE_SLAVE_LIST, NmtSlaveListPrivate)) - -typedef struct { - NMConnection *master; - const char *master_type, *master_uuid; - - NmtAddConnectionTypeFilter type_filter; - gpointer type_filter_data; -} NmtSlaveListPrivate; - -enum { - PROP_0, - PROP_MASTER, - PROP_TYPE_FILTER, - PROP_TYPE_FILTER_DATA, - - LAST_PROP -}; - -static gboolean nmt_slave_list_connection_filter(NmtEditConnectionList *list, - NMConnection *connection, - gpointer user_data); - -/** - * nmt_slave_list_new: - * @master: the master #NMConnection whose slaves are being listed - * @type_filter: (nullable): a function to limit the available slave types - * @type_filter_data: (nullable): data for @type_filter. - * - * Creates a new #NmtSlaveList. - * - * If @type_filter is non-%NULL, it will be used to limit the connection - * types that are available when the user clicks on the "Add" button to add - * a new slave. If the @type_filter filters the list down to only a single - * connection type, then the user will not be presented with a connection-type - * dialog, and will instead be immediately taken to an editor window for the - * new slave after clicking "Add". - * - * Returns: a new #NmtSlaveList. - */ -NmtNewtWidget * -nmt_slave_list_new(NMConnection *master, - NmtAddConnectionTypeFilter type_filter, - gpointer type_filter_data) -{ - return g_object_new(NMT_TYPE_SLAVE_LIST, - "master", - master, - "type-filter", - type_filter, - "type-filter-data", - type_filter_data, - "grouped", - FALSE, - "connection-filter", - nmt_slave_list_connection_filter, - NULL); -} - -static void -nmt_slave_list_init(NmtSlaveList *list) -{} - -static void -nmt_slave_list_finalize(GObject *object) -{ - NmtSlaveListPrivate *priv = NMT_SLAVE_LIST_GET_PRIVATE(object); - - g_object_unref(priv->master); - - G_OBJECT_CLASS(nmt_slave_list_parent_class)->finalize(object); -} - -static gboolean -nmt_slave_list_connection_filter(NmtEditConnectionList *list, - NMConnection *connection, - gpointer user_data) -{ - NmtSlaveListPrivate *priv = NMT_SLAVE_LIST_GET_PRIVATE(list); - NMSettingConnection *s_con; - const char *master, *master_ifname, *slave_type; - - s_con = nm_connection_get_setting_connection(connection); - g_return_val_if_fail(s_con != NULL, FALSE); - - slave_type = nm_setting_connection_get_slave_type(s_con); - if (g_strcmp0(slave_type, priv->master_type) != 0) - return FALSE; - - master = nm_setting_connection_get_master(s_con); - if (!master) - return FALSE; - - master_ifname = nm_connection_get_interface_name(priv->master); - if (g_strcmp0(master, master_ifname) != 0 && g_strcmp0(master, priv->master_uuid) != 0) - return FALSE; - - return TRUE; -} - -static void -nmt_slave_list_add_connection(NmtEditConnectionList *list) -{ - NmtSlaveListPrivate *priv = NMT_SLAVE_LIST_GET_PRIVATE(list); - - nmt_add_connection_full(_("Select the type of slave connection you wish to add."), - NULL, - priv->master, - priv->type_filter, - priv->type_filter_data); -} - -static void -nmt_slave_list_edit_connection(NmtEditConnectionList *list, NMConnection *connection) -{ - nmt_edit_connection(connection); -} - -static void -nmt_slave_list_remove_connection(NmtEditConnectionList *list, NMRemoteConnection *connection) -{ - nmt_remove_connection(connection); -} - -static void -nmt_slave_list_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) -{ - NmtSlaveListPrivate *priv = NMT_SLAVE_LIST_GET_PRIVATE(object); - - switch (prop_id) { - case PROP_MASTER: - priv->master = g_value_dup_object(value); - if (priv->master) { - NMSettingConnection *s_con = nm_connection_get_setting_connection(priv->master); - - priv->master_type = nm_setting_connection_get_connection_type(s_con); - priv->master_uuid = nm_setting_connection_get_uuid(s_con); - } - break; - case PROP_TYPE_FILTER: - priv->type_filter = g_value_get_pointer(value); - break; - case PROP_TYPE_FILTER_DATA: - priv->type_filter_data = g_value_get_pointer(value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); - break; - } -} - -static void -nmt_slave_list_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) -{ - NmtSlaveListPrivate *priv = NMT_SLAVE_LIST_GET_PRIVATE(object); - - switch (prop_id) { - case PROP_MASTER: - g_value_set_object(value, priv->master); - break; - case PROP_TYPE_FILTER: - g_value_set_pointer(value, priv->type_filter); - break; - case PROP_TYPE_FILTER_DATA: - g_value_set_pointer(value, priv->type_filter_data); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); - break; - } -} - -static void -nmt_slave_list_class_init(NmtSlaveListClass *list_class) -{ - GObjectClass *object_class = G_OBJECT_CLASS(list_class); - NmtEditConnectionListClass *connection_list_class = NMT_EDIT_CONNECTION_LIST_CLASS(list_class); - - g_type_class_add_private(list_class, sizeof(NmtSlaveListPrivate)); - - /* virtual methods */ - object_class->set_property = nmt_slave_list_set_property; - object_class->get_property = nmt_slave_list_get_property; - object_class->finalize = nmt_slave_list_finalize; - - connection_list_class->add_connection = nmt_slave_list_add_connection; - connection_list_class->edit_connection = nmt_slave_list_edit_connection; - connection_list_class->remove_connection = nmt_slave_list_remove_connection; - - /** - * NmtSlaveList:master: - * - * The master #NMConnection whose slaves are being displayed. - */ - g_object_class_install_property( - object_class, - PROP_MASTER, - g_param_spec_object("master", - "", - "", - NM_TYPE_CONNECTION, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); - /** - * NmtSlaveList:type-filter: - * - * If non-%NULL, this will be used to limit the connection types - * that are available when the user clicks on the "Add" button to - * add a new slave. If the filter filters the list down to only a - * single connection type, then the user will not be presented - * with a connection-type dialog, and will instead be immediately - * taken to an editor window for the new slave after clicking - * "Add". - */ - g_object_class_install_property( - object_class, - PROP_TYPE_FILTER, - g_param_spec_pointer("type-filter", - "", - "", - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); - /** - * NmtSlaveList:type-filter-data: - * - * User data passed to #NmtSlaveList:type-filter - */ - g_object_class_install_property( - object_class, - PROP_TYPE_FILTER_DATA, - g_param_spec_pointer("type-filter-data", - "", - "", - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); -} diff --git a/src/nmtui/nmt-slave-list.h b/src/nmtui/nmt-slave-list.h deleted file mode 100644 index 7bb60c5944..0000000000 --- a/src/nmtui/nmt-slave-list.h +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Copyright (C) 2013 Red Hat, Inc. - */ - -#ifndef NMT_SLAVE_LIST_H -#define NMT_SLAVE_LIST_H - -#include "nmt-edit-connection-list.h" -#include "nmtui-edit.h" - -#define NMT_TYPE_SLAVE_LIST (nmt_slave_list_get_type()) -#define NMT_SLAVE_LIST(obj) \ - (_NM_G_TYPE_CHECK_INSTANCE_CAST((obj), NMT_TYPE_SLAVE_LIST, NmtSlaveList)) -#define NMT_SLAVE_LIST_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), NMT_TYPE_SLAVE_LIST, NmtSlaveListClass)) -#define NMT_IS_SLAVE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NMT_TYPE_SLAVE_LIST)) -#define NMT_IS_SLAVE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NMT_TYPE_SLAVE_LIST)) -#define NMT_SLAVE_LIST_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), NMT_TYPE_SLAVE_LIST, NmtSlaveListClass)) - -typedef struct { - NmtEditConnectionList parent; - -} NmtSlaveList; - -typedef struct { - NmtEditConnectionListClass parent; - -} NmtSlaveListClass; - -GType nmt_slave_list_get_type(void); - -NmtNewtWidget *nmt_slave_list_new(NMConnection *master, - NmtAddConnectionTypeFilter type_filter, - gpointer type_filter_data); - -#endif /* NMT_SLAVE_LIST_H */ diff --git a/src/nmtui/nmtui-edit.c b/src/nmtui/nmtui-edit.c index 4eed22dd5c..3cedf1973c 100644 --- a/src/nmtui/nmtui-edit.c +++ b/src/nmtui/nmtui-edit.c @@ -49,22 +49,22 @@ edit_connection_list_filter(NmtEditConnectionList *list, gpointer user_data) { NMSettingConnection *s_con; - const char *master, *slave_type; + const char *controller, *port_type; const char *uuid, *ifname; const GPtrArray *conns; int i; - gboolean found_master = FALSE; + gboolean found_controller = FALSE; s_con = nm_connection_get_setting_connection(connection); g_return_val_if_fail(s_con != NULL, FALSE); - master = nm_setting_connection_get_master(s_con); - if (!master) + controller = nm_setting_connection_get_master(s_con); + if (!controller) return TRUE; - slave_type = nm_setting_connection_get_slave_type(s_con); - if (g_strcmp0(slave_type, NM_SETTING_BOND_SETTING_NAME) != 0 - && g_strcmp0(slave_type, NM_SETTING_TEAM_SETTING_NAME) != 0 - && g_strcmp0(slave_type, NM_SETTING_BRIDGE_SETTING_NAME) != 0) + port_type = nm_setting_connection_get_slave_type(s_con); + if (g_strcmp0(port_type, NM_SETTING_BOND_SETTING_NAME) != 0 + && g_strcmp0(port_type, NM_SETTING_TEAM_SETTING_NAME) != 0 + && g_strcmp0(port_type, NM_SETTING_BRIDGE_SETTING_NAME) != 0) return TRUE; conns = nm_client_get_connections(nm_client); @@ -73,13 +73,13 @@ edit_connection_list_filter(NmtEditConnectionList *list, uuid = nm_connection_get_uuid(candidate); ifname = nm_connection_get_interface_name(candidate); - if (!g_strcmp0(master, uuid) || !g_strcmp0(master, ifname)) { - found_master = TRUE; + if (!g_strcmp0(controller, uuid) || !g_strcmp0(controller, ifname)) { + found_controller = TRUE; break; } } - return !found_master; + return !found_controller; } static NmtNewtForm * @@ -132,7 +132,7 @@ typedef struct { char *primary_text; char *secondary_text; - NMConnection *master; + NMConnection *controller; NmtAddConnectionTypeFilter type_filter; gpointer type_filter_data; @@ -144,7 +144,7 @@ enum { PROP_PRIMARY_TEXT, PROP_SECONDARY_TEXT, - PROP_MASTER, + PROP_CONTROLLER, PROP_TYPE_FILTER, PROP_TYPE_FILTER_DATA, @@ -158,7 +158,7 @@ create_connection(NmtNewtWidget *widget, gpointer list) GType type = (GType) GPOINTER_TO_SIZE(nmt_newt_listbox_get_active_key(priv->listbox)); NMConnection *connection; - connection = nm_editor_utils_create_connection(type, priv->master, nm_client); + connection = nm_editor_utils_create_connection(type, priv->controller, nm_client); nmt_edit_connection(connection); g_object_unref(connection); } @@ -262,7 +262,7 @@ nmt_add_connection_finalize(GObject *object) g_free(priv->primary_text); g_free(priv->secondary_text); - g_clear_object(&priv->master); + g_clear_object(&priv->controller); G_OBJECT_CLASS(nmt_add_connection_parent_class)->finalize(object); } @@ -282,8 +282,8 @@ nmt_add_connection_set_property(GObject *object, case PROP_SECONDARY_TEXT: priv->secondary_text = g_value_dup_string(value); break; - case PROP_MASTER: - priv->master = g_value_dup_object(value); + case PROP_CONTROLLER: + priv->controller = g_value_dup_object(value); break; case PROP_TYPE_FILTER: priv->type_filter = g_value_get_pointer(value); @@ -309,8 +309,8 @@ nmt_add_connection_get_property(GObject *object, guint prop_id, GValue *value, G case PROP_SECONDARY_TEXT: g_value_set_string(value, priv->secondary_text); break; - case PROP_MASTER: - g_value_set_object(value, priv->master); + case PROP_CONTROLLER: + g_value_set_object(value, priv->controller); break; case PROP_TYPE_FILTER: g_value_set_pointer(value, priv->type_filter); @@ -364,8 +364,8 @@ nmt_add_connection_class_init(NmtAddConnectionClass *add_class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property( object_class, - PROP_MASTER, - g_param_spec_object("master", + PROP_CONTROLLER, + g_param_spec_object("controller", "", "", NM_TYPE_CONNECTION, @@ -399,7 +399,7 @@ nmt_add_connection(void) void nmt_add_connection_full(const char *primary_text, const char *secondary_text, - NMConnection *master, + NMConnection *controller, NmtAddConnectionTypeFilter type_filter, gpointer type_filter_data) { @@ -412,8 +412,8 @@ nmt_add_connection_full(const char *primary_text, primary_text, "secondary-text", secondary_text, - "master", - master, + "controller", + controller, "type-filter", type_filter, "type-filter-data", @@ -500,11 +500,11 @@ void nmt_remove_connection(NMRemoteConnection *connection) { const GPtrArray *all_conns; - GSList *slaves, *iter; + GSList *ports, *iter; int i; - NMRemoteConnection *slave; + NMRemoteConnection *port; NMSettingConnection *s_con; - const char *uuid, *iface, *master; + const char *uuid, *iface, *controller; int choice; choice = nmt_newt_choice_dialog(_("Cancel"), @@ -521,20 +521,20 @@ nmt_remove_connection(NMRemoteConnection *connection) iface = nm_connection_get_interface_name(NM_CONNECTION(connection)); all_conns = nm_client_get_connections(nm_client); - slaves = NULL; + ports = NULL; for (i = 0; i < all_conns->len; i++) { - slave = all_conns->pdata[i]; - s_con = nm_connection_get_setting_connection(NM_CONNECTION(slave)); - master = nm_setting_connection_get_master(s_con); - if (master) { - if (!g_strcmp0(master, uuid) || !g_strcmp0(master, iface)) - slaves = g_slist_prepend(slaves, g_object_ref(slave)); + port = all_conns->pdata[i]; + s_con = nm_connection_get_setting_connection(NM_CONNECTION(port)); + controller = nm_setting_connection_get_master(s_con); + if (controller) { + if (!g_strcmp0(controller, uuid) || !g_strcmp0(controller, iface)) + ports = g_slist_prepend(ports, g_object_ref(port)); } } - for (iter = slaves; iter; iter = iter->next) + for (iter = ports; iter; iter = iter->next) remove_one_connection(iter->data); - g_slist_free_full(slaves, g_object_unref); + g_slist_free_full(ports, g_object_unref); g_object_unref(connection); } diff --git a/src/nmtui/nmtui-edit.h b/src/nmtui/nmtui-edit.h index e868560225..45d6d7af25 100644 --- a/src/nmtui/nmtui-edit.h +++ b/src/nmtui/nmtui-edit.h @@ -15,7 +15,7 @@ NmtNewtForm *nmtui_edit(gboolean is_top, int argc, char **argv); void nmt_add_connection(void); void nmt_add_connection_full(const char *primary_text, const char *secondary_text, - NMConnection *master, + NMConnection *controller, NmtAddConnectionTypeFilter type_filter, gpointer type_filter_data);