{"action":"created","issue":{"url":"https://api.github.com/repos/Qucs/qucs/issues/192","labels_url":"https://api.github.com/repos/Qucs/qucs/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/Qucs/qucs/issues/192/comments","events_url":"https://api.github.com/repos/Qucs/qucs/issues/192/events","html_url":"https://github.com/Qucs/qucs/issues/192","id":54779576,"number":192,"title":"Should Qucs separate Schematic, Textdoc into different window?","user":{"login":"yodalee","id":1913143,"avatar_url":"https://avatars.githubusercontent.com/u/1913143?v=3","gravatar_id":"","url":"https://api.github.com/users/yodalee","html_url":"https://github.com/yodalee","followers_url":"https://api.github.com/users/yodalee/followers","following_url":"https://api.github.com/users/yodalee/following{/other_user}","gists_url":"https://api.github.com/users/yodalee/gists{/gist_id}","starred_url":"https://api.github.com/users/yodalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yodalee/subscriptions","organizations_url":"https://api.github.com/users/yodalee/orgs","repos_url":"https://api.github.com/users/yodalee/repos","events_url":"https://api.github.com/users/yodalee/events{/privacy}","received_events_url":"https://api.github.com/users/yodalee/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Qucs/qucs/labels/qucs-gui","name":"qucs-gui","color":"009800"},{"url":"https://api.github.com/repos/Qucs/qucs/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":39,"created_at":"2015-01-19T15:50:04Z","updated_at":"2015-01-24T18:02:53Z","closed_at":null,"body":"Recently I spend some time so watch and clean up code in qucs.cpp, the main program. Here is the issue need to be discussed.\r\nCurrently qucs support two type of doc: `schematic`, and pure text document `textdoc`. Both files are double inherited from `Qwidget` and `QucsDoc`, with QucsDoc provides some function interface like `becomeCurrent`, `DocName`. In mainwindow, all open files will add into tabwidget in mainwindow, and all files share same window menu.\r\nThis design use single window to manage all design files, but it also shows many drawback.\r\n* In the following code:\r\nhttps://github.com/Qucs/qucs/blob/master/qucs/qucs/qucs.cpp#L577\r\nSince what QTabWidget stores is QWidget, not QucsDoc, and QWidget doesn't have the function interface needed, we need first change it into QucsDoc. If we add Layout Document, EM simulation document, the function like getDoc will become crazy. There are more function handle what to do when user switch to other tab, in every case, determining the file type, casting the pointer are also required.\r\n* Also, every doc need a `becomeCurrent`:\r\nhttps://github.com/Qucs/qucs/blob/master/qucs/qucs/schematic.cpp#L196\r\nIn current state, there are only two doc, if we wanna add another file type, we may have to change `becomeCurrent` in each files. Also, each type of document uses different QActions. `Insert menu` in schematic and layout will definitely have different contents. The implementation of `becomeCurrent` will quickly become unmanageable.\r\n\r\n******\r\nI'm not sure how others think, but I feels that putting every file into same window will limit the progress of adding new function. I suggest that, though someone may dislike this, in the future, `one file per window` will be necessary, this eliminate the needs of `becomeCurrent` and makes the function of each window more clearly.\r\nMaybe I'm wrong, I'm still consider the design concept, but before we get to the answer, I need everyone think of this question."},"comment":{"url":"https://api.github.com/repos/Qucs/qucs/issues/comments/71329761","html_url":"https://github.com/Qucs/qucs/issues/192#issuecomment-71329761","issue_url":"https://api.github.com/repos/Qucs/qucs/issues/192","id":71329761,"user":{"login":"guitorri","id":1388949,"avatar_url":"https://avatars.githubusercontent.com/u/1388949?v=3","gravatar_id":"","url":"https://api.github.com/users/guitorri","html_url":"https://github.com/guitorri","followers_url":"https://api.github.com/users/guitorri/followers","following_url":"https://api.github.com/users/guitorri/following{/other_user}","gists_url":"https://api.github.com/users/guitorri/gists{/gist_id}","starred_url":"https://api.github.com/users/guitorri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guitorri/subscriptions","organizations_url":"https://api.github.com/users/guitorri/orgs","repos_url":"https://api.github.com/users/guitorri/repos","events_url":"https://api.github.com/users/guitorri/events{/privacy}","received_events_url":"https://api.github.com/users/guitorri/received_events","type":"User","site_admin":false},"created_at":"2015-01-24T18:02:53Z","updated_at":"2015-01-24T18:02:53Z","body":"Yes, the idea is to have a simple and ease to use schematic capture and circuit simulator. This is **one** thing. \r\n\r\nWe need text files to simulate stuff (spice netlists, octave, verilog...). It helps to have them in a tab besides the schematic where they are being used. If the user don't like that, you can override the editor in the settings and use an external editor. In the text mode the \"Calculate DC bias\" is disabled. The \"Activate/Deactivate\" should also be disabled, it is a bug.\r\n\r\nFrankly I don't see any contradiction.\r\n\r\nI don't understand why seem so defensive, you asked a question and you got 3 answers.\r\n\r\nAs a result we are not separating the TextDoc from the QTabWidget at this moment.\r\n\r\nAs you said the if EM and layout are \"all bubble now\", then we have to agree that we don't need refactoring right now. \r\n\r\nIf you feel like doing the refactoring anyway, please open another issue or PR and we can discuss it further.\r\n\r\nIt is not about user hearts here, but we should try to make the UI more usable not less...\r\n\r\n \r\n\r\n"}}