anapencere.cpp 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. #include "anapencere.h"
  2. #include "ui_anapencere.h"
  3. #include <QMessageBox>
  4. #include <QFileDialog>
  5. #include <QString>
  6. #include <QFile>
  7. #include <QDebug>
  8. #include <QDate>
  9. #include <QLabel>
  10. #include <QProcess>
  11. #include <QDate>
  12. AnaPencere::AnaPencere(QWidget *parent) :
  13. QMainWindow(parent),
  14. ui(new Ui::AnaPencere)
  15. {
  16. ui->setupUi(this);
  17. QProcess process;
  18. process.start("cat /usr/share/ay-gaste/ulusal");
  19. process.waitForFinished(-1); // will wait forever until finished
  20. ui->gazeteler->clear();
  21. ui->gazeteler->addItems(QString(process.readAll()).split(','));
  22. QProcess resim;
  23. resim.start("cat /usr/share/ay-gaste/program");
  24. resim.waitForFinished(-1); // will wait forever until finished
  25. ui->uygulama->clear();
  26. ui->uygulama->addItems(QString(resim.readAll()).split(','));
  27. QDate bugun = QDate::currentDate();
  28. ui->Gun->setCurrentText(bugun.toString("dd"));
  29. ui->Ay->setCurrentText(bugun.toString("MM"));
  30. ui->Yil->setCurrentText(bugun.toString("yy"));
  31. }
  32. AnaPencere::~AnaPencere()
  33. {
  34. delete ui;
  35. }
  36. void AnaPencere::on_commandLinkButton_2_clicked()
  37. {
  38. QMessageBox::information(this, "Ay-Gaste","Online gazete okumak için basit bir arayüz \nCihan Alkan Tarafından Aylinux İçin Hazırlanmıştır. \n \nwww.haberler.com adresinden yerel gazeteleri /usr/share/ay-gaste/yerel dosyasına ekleyerek programa dahil edebilirsiniz. \n \nFarklı resim görünütüleyici kullanmak isterseniz /usr/share/ay-gaste/program dosyasına ekleyerek programa dahil edebilirsiniz.");
  39. }
  40. void AnaPencere::on_okubuton_clicked()
  41. {
  42. if (ui->gazeteler->currentItem())
  43. {
  44. QString resimci = ui->uygulama->currentText();
  45. QFile kurulumu("/usr/bin/"+resimci);
  46. if(!kurulumu.exists())
  47. {
  48. QMessageBox::information(this, "Ay-Gaste", resimci+" uygulaması kurulu değil. Öncelikle "+resimci+" kurulmalıdır. \n sudo pacman -S "+resimci);
  49. }
  50. else
  51. {
  52. QString resimci = ui->uygulama->currentText();
  53. QString gun = ui->Gun->currentText();
  54. QString ay = ui->Ay->currentText();
  55. QString yil = ui->Yil->currentText();
  56. if (ui->gazeteler->currentItem()->text() == "Akşam")
  57. {
  58. QString gazete("aksam");
  59. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  60. }
  61. else if (ui->gazeteler->currentItem()->text() == "24 Saat")
  62. {
  63. QString gazete("gazete24saat");
  64. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  65. }
  66. else if (ui->gazeteler->currentItem()->text() == "Akit")
  67. {
  68. QString gazete("yeni-akit");
  69. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  70. }
  71. else if (ui->gazeteler->currentItem()->text() == "Amk")
  72. {
  73. QString gazete("amk");
  74. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  75. }
  76. else if (ui->gazeteler->currentItem()->text() == "Aydınlık")
  77. {
  78. QString gazete("aydinlik");
  79. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  80. }
  81. else if (ui->gazeteler->currentItem()->text() == "Birgün")
  82. {
  83. QString gazete("birgun");
  84. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  85. }
  86. else if (ui->gazeteler->currentItem()->text() == "Cumhuriyet")
  87. {
  88. QString gazete("cumhuriyet");
  89. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  90. }
  91. else if (ui->gazeteler->currentItem()->text() == "Diriliş Postası")
  92. {
  93. QString gazete("dirilispostasi");
  94. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  95. }
  96. else if (ui->gazeteler->currentItem()->text() == "Doğru Haber")
  97. {
  98. QString gazete("dogruhaber");
  99. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  100. }
  101. else if (ui->gazeteler->currentItem()->text() == "Dünya")
  102. {
  103. QString gazete("dunya");
  104. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  105. }
  106. else if (ui->gazeteler->currentItem()->text() == "Evrensel")
  107. {
  108. QString gazete("evrensel");
  109. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  110. }
  111. else if (ui->gazeteler->currentItem()->text() == "Fanatik")
  112. {
  113. QString gazete("fanatik");
  114. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  115. }
  116. else if (ui->gazeteler->currentItem()->text() == "Fotomaç")
  117. {
  118. QString gazete("fotomac");
  119. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  120. }
  121. else if (ui->gazeteler->currentItem()->text() == "Güneş")
  122. {
  123. QString gazete("gunes");
  124. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  125. }
  126. else if (ui->gazeteler->currentItem()->text() == "Gün Boyu")
  127. {
  128. QString gazete("gunes");
  129. QProcess::execute(resimci+" http://gazetebasliklari.iha.com.tr/GazeteBasliklari/"+gun+ay+"20"+yil+"/Gunboyu.jpg");
  130. }
  131. else if (ui->gazeteler->currentItem()->text() == "Haber Türk")
  132. {
  133. QString gazete("haberturk");
  134. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  135. }
  136. else if (ui->gazeteler->currentItem()->text() == "Harbi Gazete")
  137. {
  138. QString gazete("harbigazete");
  139. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  140. }
  141. else if (ui->gazeteler->currentItem()->text() == "Hürriyet")
  142. {
  143. QString gazete("hurriyet");
  144. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  145. }
  146. else if (ui->gazeteler->currentItem()->text() == "Karar")
  147. {
  148. QString gazete("karar");
  149. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  150. }
  151. else if (ui->gazeteler->currentItem()->text() == "Milat")
  152. {
  153. QString gazete("milat");
  154. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  155. }
  156. else if (ui->gazeteler->currentItem()->text() == "Milliyet")
  157. {
  158. QString gazete("milliyet");
  159. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  160. }
  161. else if (ui->gazeteler->currentItem()->text() == "Milli Gazete")
  162. {
  163. QString gazete("milligazete");
  164. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  165. }
  166. else if (ui->gazeteler->currentItem()->text() == "Odak")
  167. {
  168. QString gazete("odak");
  169. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  170. }
  171. else if (ui->gazeteler->currentItem()->text() == "Ortadoğu")
  172. {
  173. QString gazete("ortadogu");
  174. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  175. }
  176. else if (ui->gazeteler->currentItem()->text() == "Posta")
  177. {
  178. QString gazete("posta");
  179. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  180. }
  181. else if (ui->gazeteler->currentItem()->text() == "Sabah")
  182. {
  183. QString gazete("sabah");
  184. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  185. }
  186. else if (ui->gazeteler->currentItem()->text() == "Sonsöz")
  187. {
  188. QString gazete("sonsoz");
  189. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  190. }
  191. else if (ui->gazeteler->currentItem()->text() == "Sözcü")
  192. {
  193. QString gazete("sozcu");
  194. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  195. }
  196. else if (ui->gazeteler->currentItem()->text() == "Star")
  197. {
  198. QString gazete("star");
  199. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  200. }
  201. else if (ui->gazeteler->currentItem()->text() == "Türkiye")
  202. {
  203. QString gazete("turkiye");
  204. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  205. }
  206. else if (ui->gazeteler->currentItem()->text() == "Takvim")
  207. {
  208. QString gazete("takvim");
  209. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  210. }
  211. else if (ui->gazeteler->currentItem()->text() == "Vatan")
  212. {
  213. QString gazete("vatan");
  214. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  215. }
  216. else if (ui->gazeteler->currentItem()->text() == "Yeni Asya")
  217. {
  218. QString gazete("yeniasya");
  219. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  220. }
  221. else if (ui->gazeteler->currentItem()->text() == "Yeni Birlik")
  222. {
  223. QString gazete("yenibirlik");
  224. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  225. }
  226. else if (ui->gazeteler->currentItem()->text() == "Yeni Çağ")
  227. {
  228. QString gazete("yenicag");
  229. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  230. }
  231. else if (ui->gazeteler->currentItem()->text() == "Yeni Mesaj")
  232. {
  233. QString gazete("yenimesaj");
  234. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  235. }
  236. else if (ui->gazeteler->currentItem()->text() == "Yeni Şafak")
  237. {
  238. QString gazete("yenisafak");
  239. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  240. }
  241. else if (ui->gazeteler->currentItem()->text() == "Yeni Söz")
  242. {
  243. QString gazete("yenisoz");
  244. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  245. }
  246. else if (ui->gazeteler->currentItem()->text() == "İstiklal")
  247. {
  248. QString gazete("istiklal-gazetesi");
  249. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  250. }
  251. else if (ui->gazeteler->currentItem()->text() == "Yurt")
  252. {
  253. QString gazete("yurt");
  254. QProcess::execute(resimci+" https://i.f5haber.com/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg");
  255. }
  256. else
  257. {
  258. QString gazete = ui->gazeteler->currentItem()->text();
  259. QProcess::execute(resimci+" https://foto.haberler.com/gazeteler/"+gazete+"/20"+yil+"/"+ay+"/"+gun+"/"+gazete+".jpg ");
  260. }
  261. }
  262. }
  263. else
  264. {
  265. QMessageBox::information(this, "Ay-Gaste"," Lütfen okumak istediğiniz gazeteyi seçiniz");
  266. }
  267. }
  268. void AnaPencere::on_gazeteler_currentTextChanged(const QString &currentText)
  269. {
  270. QString resimci = ui->uygulama->currentText();
  271. QString gun = ui->Gun->currentText();
  272. QString ay = ui->Ay->currentText();
  273. QString yil = ui->Yil->currentText();
  274. if (ui->gazeteler->currentItem()->text() == "Akşam")
  275. {
  276. QString gazete("aksam");
  277. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  278. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  279. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  280. }
  281. else if (ui->gazeteler->currentItem()->text() == "24 Saat")
  282. {
  283. QString gazete("gazete24saat");
  284. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  285. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  286. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  287. }
  288. else if (ui->gazeteler->currentItem()->text() == "Akit")
  289. {
  290. QString gazete("yeni-akit");
  291. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  292. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  293. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  294. }
  295. else if (ui->gazeteler->currentItem()->text() == "Amk")
  296. {
  297. QString gazete("amk");
  298. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  299. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  300. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  301. }
  302. else if (ui->gazeteler->currentItem()->text() == "Aydınlık")
  303. {
  304. QString gazete("aydinlik");
  305. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  306. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  307. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  308. }
  309. else if (ui->gazeteler->currentItem()->text() == "Birgün")
  310. {
  311. QString gazete("birgun");
  312. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  313. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  314. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  315. }
  316. else if (ui->gazeteler->currentItem()->text() == "Cumhuriyet")
  317. {
  318. QString gazete("cumhuriyet");
  319. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  320. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  321. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  322. }
  323. else if (ui->gazeteler->currentItem()->text() == "Diriliş Postası")
  324. {
  325. QString gazete("dirilispostasi");
  326. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  327. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  328. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  329. }
  330. else if (ui->gazeteler->currentItem()->text() == "Doğru Haber")
  331. {
  332. QString gazete("dogruhaber");
  333. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  334. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  335. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  336. }
  337. else if (ui->gazeteler->currentItem()->text() == "Dünya")
  338. {
  339. QString gazete("dunya");
  340. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  341. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  342. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  343. }
  344. else if (ui->gazeteler->currentItem()->text() == "Evrensel")
  345. {
  346. QString gazete("evrensel");
  347. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  348. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  349. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  350. }
  351. else if (ui->gazeteler->currentItem()->text() == "Fanatik")
  352. {
  353. QString gazete("fanatik");
  354. QProcess::execute("wget https://i.f5haber.com/1/488/732/storage/newspapers/20"+yil+"-"+ay+"-"+gun+"/"+gazete+".jpg -P /tmp/ay-gaste");
  355. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+".jpg") );
  356. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  357. }
  358. else if (ui->gazeteler->currentItem()->text() == "Fotomaç")
  359. {
  360. QString gazete("fotomac");
  361. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  362. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  363. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  364. }
  365. else if (ui->gazeteler->currentItem()->text() == "Güneş")
  366. {
  367. QString gazete("gunes");
  368. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  369. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  370. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  371. }
  372. else if (ui->gazeteler->currentItem()->text() == "Gün Boyu")
  373. {
  374. QString gazete("gunboyu");
  375. QProcess::execute("wget http://gazetebasliklari.iha.com.tr/GazeteBasliklari/"+gun+ay+"20"+yil+"/Gunboyu_thumb.jpg -P /tmp/ay-gaste");
  376. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/Gunboyu_thumb.jpg") );
  377. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  378. }
  379. else if (ui->gazeteler->currentItem()->text() == "Haber Türk")
  380. {
  381. QString gazete("haberturk");
  382. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  383. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  384. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  385. }
  386. else if (ui->gazeteler->currentItem()->text() == "Harbi Gazete")
  387. {
  388. QString gazete("harbigazete");
  389. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  390. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  391. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  392. }
  393. else if (ui->gazeteler->currentItem()->text() == "Hürriyet")
  394. {
  395. QString gazete("hurriyet");
  396. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  397. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  398. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  399. }
  400. else if (ui->gazeteler->currentItem()->text() == "Karar")
  401. {
  402. QString gazete("karar");
  403. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  404. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  405. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  406. }
  407. else if (ui->gazeteler->currentItem()->text() == "Milat")
  408. {
  409. QString gazete("milat");
  410. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  411. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  412. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  413. }
  414. else if (ui->gazeteler->currentItem()->text() == "Milliyet")
  415. {
  416. QString gazete("milliyet");
  417. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  418. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  419. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  420. }
  421. else if (ui->gazeteler->currentItem()->text() == "Milli Gazete")
  422. {
  423. QString gazete("milligazete");
  424. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  425. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  426. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  427. }
  428. else if (ui->gazeteler->currentItem()->text() == "Odak")
  429. {
  430. QString gazete("odak");
  431. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  432. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  433. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  434. }
  435. else if (ui->gazeteler->currentItem()->text() == "Ortadoğu")
  436. {
  437. QString gazete("ortadogu");
  438. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  439. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  440. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  441. }
  442. else if (ui->gazeteler->currentItem()->text() == "Posta")
  443. {
  444. QString gazete("posta");
  445. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  446. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  447. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  448. }
  449. else if (ui->gazeteler->currentItem()->text() == "Sabah")
  450. {
  451. QString gazete("sabah");
  452. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  453. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  454. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  455. }
  456. else if (ui->gazeteler->currentItem()->text() == "Sonsöz")
  457. {
  458. QString gazete("sonsoz");
  459. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  460. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  461. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  462. }
  463. else if (ui->gazeteler->currentItem()->text() == "Sözcü")
  464. {
  465. QString gazete("sozcu");
  466. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  467. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  468. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  469. }
  470. else if (ui->gazeteler->currentItem()->text() == "Star")
  471. {
  472. QString gazete("star");
  473. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  474. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  475. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  476. }
  477. else if (ui->gazeteler->currentItem()->text() == "Türkiye")
  478. {
  479. QString gazete("turkiye");
  480. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  481. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  482. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  483. }
  484. else if (ui->gazeteler->currentItem()->text() == "Takvim")
  485. {
  486. QString gazete("takvim");
  487. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  488. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  489. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  490. }
  491. else if (ui->gazeteler->currentItem()->text() == "Vatan")
  492. {
  493. QString gazete("vatan");
  494. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  495. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  496. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  497. }
  498. else if (ui->gazeteler->currentItem()->text() == "Yeni Asya")
  499. {
  500. QString gazete("yeniasya");
  501. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  502. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  503. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  504. }
  505. else if (ui->gazeteler->currentItem()->text() == "Yeni Birlik")
  506. {
  507. QString gazete("yenibirlik");
  508. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  509. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  510. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  511. }
  512. else if (ui->gazeteler->currentItem()->text() == "Yeni Çağ")
  513. {
  514. QString gazete("yenicag");
  515. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  516. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  517. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  518. }
  519. else if (ui->gazeteler->currentItem()->text() == "Yeni Mesaj")
  520. {
  521. QString gazete("yenimesaj");
  522. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  523. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  524. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  525. }
  526. else if (ui->gazeteler->currentItem()->text() == "Yeni Şafak")
  527. {
  528. QString gazete("yenisafak");
  529. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  530. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  531. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  532. }
  533. else if (ui->gazeteler->currentItem()->text() == "Yeni Söz")
  534. {
  535. QString gazete("yenisoz");
  536. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  537. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  538. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  539. }
  540. else if (ui->gazeteler->currentItem()->text() == "İstiklal")
  541. {
  542. QString gazete("istiklal-gazetesi");
  543. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  544. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  545. // ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  546. }
  547. else if (ui->gazeteler->currentItem()->text() == "Yurt")
  548. {
  549. QString gazete("yurt");
  550. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  551. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  552. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  553. }
  554. else
  555. {
  556. QString gazete = ui->gazeteler->currentItem()->text();
  557. QProcess::execute("wget https://foto.haberler.com/gazeteler/"+gazete+"-gazetesi/20"+yil+"/"+ay+"/"+gun+"/"+gazete+"-gazetesi_o.jpg -P /tmp/ay-gaste");
  558. ui->gazetelogo->setPixmap(QPixmap("/tmp/ay-gaste/"+gazete+"-gazetesi_o.jpg") );
  559. ui->okubuton->setIcon(QPixmap("/usr/share/ay-gaste/logo/"+gazete+".png") );
  560. }
  561. }
  562. void AnaPencere::on_GazeteTuru_currentTextChanged(const QString &arg1)
  563. {
  564. if (ui->GazeteTuru->currentText() == "Ulusal Gazeteler")
  565. {
  566. ui->gazeteler->reset();
  567. QProcess process;
  568. process.start("cat /usr/share/ay-gaste/ulusal");
  569. process.waitForFinished(-1); // will wait forever until finished
  570. ui->gazeteler->clear();
  571. ui->gazeteler->addItems(QString(process.readAll()).split(','));
  572. }
  573. else if (ui->GazeteTuru->currentText() == "Yerel Gazeteler")
  574. {
  575. ui->gazeteler->reset();
  576. QProcess process;
  577. process.start("cat /usr/share/ay-gaste/yerel");
  578. process.waitForFinished(-1); // will wait forever until finished
  579. ui->gazeteler->clear();
  580. ui->gazeteler->addItems(QString(process.readAll()).split(','));
  581. }
  582. else
  583. {
  584. ui->gazeteler->reset();
  585. QProcess process;
  586. process.start("cat /usr/share/ay-gaste/ulusal");
  587. process.waitForFinished(-1); // will wait forever until finished
  588. ui->gazeteler->clear();
  589. ui->gazeteler->addItems(QString(process.readAll()).split(','));
  590. }
  591. }