MapleManager::MapleManager(Server* server, QWidget *widget) : QObject(server), m_status(ConnectionStatus::WAITIGN), m_launch_status(LaunchStatus::LAUNCHIGN), m_socket(0), m_relaunch(true), r_mode(MapleManager::RESIZE_MODE::AUTO) { m_server = server; m_widget = new ManagerWidget(widget); m_widget->installEventFilter(this); connect(m_widget,SIGNAL(save()),this,SLOT(saveSettings())); connect(m_widget,SIGNAL(load()),this,SLOT(loadSettings())); connect(m_widget,SIGNAL(showDBG(bool)),this,SLOT(showDBG(bool))); connect(m_widget,SIGNAL(relaunch(bool)),this,SLOT(setRelaunch(bool))); connect(m_widget,SIGNAL(s_changeTabName(QString)),this,SLOT(changeTabName(QString))); m_engine = new QScriptEngine(this); QScriptEngineDebugger *dbg = new QScriptEngineDebugger(this); dbg->attachTo(m_engine); m_widget->regiterDebugger((QWidget*)dbg->standardWindow()); ScriptFunctions::registerFuncions(m_engine); m_engine->globalObject().setProperty(API::Path,qApp->applicationDirPath()); m_engine->globalObject().setProperty(API::GUI,m_engine->newQObject(m_widget)); m_engine->globalObject().setProperty(API::Socket,m_engine->newQObject(this)); }
void Plugin::RecoverTabs (const QList<TabRecoverInfo>& infos) { Q_FOREACH (const TabRecoverInfo& recInfo, infos) { QDataStream str (recInfo.Data_); qint8 version; str >> version; if (version == 1) { auto tab = Core::Instance ().CreateBlogiqueWidget (); Entry e; str >> e.Subject_ >> e.Content_ >> e.Date_ >> e.Tags_ >> e.Target_ >> e.PostOptions_ >> e.CustomData_; QByteArray accId; str >> accId; tab->FillWidget (e, accId); emit addNewTab ("Blogique", tab); emit changeTabIcon (tab, GetIcon ()); emit raiseTab (tab); emit changeTabName (tab, e.Subject_); }
void TermTab::updateTitle () { auto cwd = Term_->workingDirectory (); while (cwd.endsWith ('/')) cwd.chop (1); const auto& tree = ProcessGraphBuilder { Term_->getShellPID () }.GetProcessTree (); const auto& processName = tree.Children_.isEmpty () ? tree.Command_ : tree.Children_.value (0).Command_; const auto& title = cwd.isEmpty () ? processName : (cwd.section ('/', -1, -1) + " : " + processName); emit changeTabName (this, title); }
void Core::handleTitleChanged (const QString& newTitle) { emit changeTabName (dynamic_cast<QWidget*> (sender ()), newTitle); saveSingleSession (); }